Token导航 LogoToken导航

Agent Skill · 研究检索

tl-complexity-assessment(TL 复杂性评估)

tl-complexity-assessment 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

tl-complexity-assessment 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 65,745。

总安装 275周安装 11GitHub Stars 公开资料未说明下载 89核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tl-complexity-assessment(TL 复杂性评估)
来源仓库:https://github.com/toddlevy/tl-agent-skills
仓库路径:skills/tl-complexity-assessment
安装命令:
npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-complexity-assessment
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-complexity-assessment

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

tl-complexity-assessment 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。适用于研究检索类任务,可结合来源仓库和原始 README 核验具体用法。

通过 npx skills add 命令从 GitHub 安装,支持主流 AI 宿主环境。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/tl-complexity-assessment

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-complexity…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

tl-complexity-assessment 怎么安装?

在终端执行 npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-complexity-assessmen…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

tl-complexity-assessment 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

tl-complexity-assessment 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

tl-complexity-assessment 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

tl-complexity-assessment 用的人多吗?

公开数据是累计安装 275 次,近一周安装 11 次,下载 89 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

tl-complexity-assessment 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
tl-complexity-assessment

TL 复杂性评估 · 本页

275—需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

tl-complexity-assessment

Find the files that need to be split up. Get a ranked, evidence-based list of complexity hotspots with specific refactoring recommendations.

Quick Start

For experienced users — run the scanner and get a report:

# Bash
./scripts/complexity-scan.sh src/

# PowerShell
.\scripts\complexity-scan.ps1 -TargetDir src/

For guided assessment — follow the phases below.


When to Use

  • "find complex files"
  • "what needs to be split up"
  • "assess complexity" / "code health check"
  • "find monoliths" / "find god files"
  • "identify refactoring candidates"
  • "this file is too big"
  • Before major refactoring efforts
  • When onboarding to a new codebase
  • Sprint planning for tech debt reduction

Do Not Use When

  • Looking for bugs (use debugging skills instead)
  • Assessing security vulnerabilities (use security audit)
  • Reviewing code style (use linting/formatting tools)
  • File is already small and focused (<150 lines, single responsibility)

Outcomes

  • Analysis: Ranked list of complexity hotspots with evidence and recommendations
  • Decision: Which files/modules to refactor first (ROI-based prioritization)
  • Artifact: Optional findings register (markdown) for tracking remediation
  • Next Steps: Clear refactoring recommendations for each finding

The Iron Law

NO COMPLEXITY CLAIMS WITHOUT EVIDENCE

Every finding must include file path, line count or metric, and specific observation.

What Good Looks Like

❌ BAD: "UserService.ts is too complex and should be refactored"

✅ GOOD: "UserService.ts (847 lines, 23 exports) mixes 4 concerns:
   - Authentication (lines 1-150)
   - Validation (lines 151-320)
   - API calls (lines 321-600)
   - Formatting (lines 601-847)

   Recommendation: Split into auth.ts, validation.ts, api.ts, formatters.ts
   Effort: E2 (4-8 hours) | Impact: High (imported by 12 files)"

Assessment Categories

Category 1: Size Indicators

IndicatorThresholdSeverity
File lines>500High
File lines300-500Medium
Function lines>50High
Function lines30-50Medium
Component lines>300High
Component lines150-300Medium

Category 2: Responsibility Indicators

IndicatorThresholdSeverity
Exports per file>10High
Exports per file6-10Medium
Classes per file>2High
Functions per file>15Medium

Category 3: Coupling Indicators

IndicatorThresholdSeverity
Import statements>20High
Import statements10-20Medium
Cross-domain imports>5 distinct domainsHigh
Circular dependenciesAnyCritical

Category 4: Cyclomatic Complexity Proxies

IndicatorThresholdSeverity
Nested conditionals>3 levels deepHigh
Switch cases>7 casesMedium
Ternary chains>2 chainedMedium
Callback depth>3 levelsHigh

Category 5: React-Specific Smells

IndicatorThresholdSeverity
useEffect hooks>3 per componentHigh
useEffect hooks2-3 per componentMedium
useState hooks>5 per componentMedium
Inline sub-componentsAnyMedium
Props count>7 propsMedium
Business logic in pageNon-trivialHigh

Category 6: Structural Smells

IndicatorPatternSeverity
God filesutils.ts, helpers.ts, common.ts, shared.tsHigh
Catch-all routers>10 routes inlineHigh
Mega schemas>10 unrelated tablesHigh
Mixed concernsAPI + UI in same fileMedium
Barrel bloatindex.ts >50 re-exportsMedium

Assessment Phases

Phase 1: Automated Discovery

Run these commands to gather metrics. Adapt paths to your project structure.

Find large files:

find src/ -name "*.ts" -o -name "*.tsx" | xargs wc -l 2>/dev/null | sort -rn | head -30

Count exports per file:

rg "^export " --type ts -c | sort -t: -k2 -rn | head -20

Count imports per file:

rg "^import " --type ts -c | sort -t: -k2 -rn | head -20

Find god files:

rg -l "utils|helpers|common|shared" --type ts --glob "!node_modules" | head -20

Find React components with many hooks:

rg "useEffect\(" --type tsx -c | sort -t: -k2 -rn | head -20

Find deeply nested conditionals:

rg "if.*if.*if" --type ts -l | head -20

Find files with many functions:

rg "^(export )?(async )?(function |const \w+ = )" --type ts -c | sort -t: -k2 -rn | head -20

Phase 2: Manual Analysis

For each candidate file from Phase 1:

  1. Read the file - Understand what it does
  2. Identify responsibilities - List distinct concerns
  3. Check coupling - What does it import from? What imports it?
  4. Assess cohesion - Do all parts serve a single purpose?
  5. Document evidence - File path, line count, specific observations

Phase 3: Scoring

Score each finding 0-10:

ScoreMeaning
0-2Acceptable - monitor only
3-4Low priority - refactor when convenient
5-6Medium priority - plan for refactor
7-8High priority - refactor soon
9-10Critical - blocking quality/velocity

Score Formula:

Score = (Severity × 2) + (Impact × 2) + (Effort_Inverse)

Where:

  • Severity: 1 (Low) to 3 (Critical)
  • Impact: 1 (isolated) to 3 (affects many files)
  • Effort_Inverse: 3 (easy fix) to 1 (hard fix)

Phase 4: Report

For each finding, report:

### [Rank] File: `path/to/file.ts`

**Score:** 8/10 | **Severity:** High | **Effort:** Medium

**Metrics:**
- Lines: 847
- Exports: 23
- Imports: 18 (from 6 domains)

**Observations:**
- Contains 4 unrelated responsibilities: auth, validation, API calls, formatting
- 3 useEffect hooks managing different concerns
- Imported by 12 other files

**Recommendation:**
Split into:
- `auth.ts` - Authentication utilities
- `validation.ts` - Form validation
- `api.ts` - API client functions
- `formatters.ts` - Display formatting

**Evidence:**
Lines 1-150: Auth functions
Lines 151-320: Validation schemas
Lines 321-600: API calls
Lines 601-847: Formatting utilities

Priority Matrix

ROI = Severity × (4 - Effort)

SeverityE0 (<1h)E1 (1-4h)E2 (4-8h)E3 (>8h)
Critical12 🔥9 🔥63
High8642
Medium4321

🔥 = Address first (ROI ≥ 9)


Red Flags - Stop and Reassess

If you catch yourself:

  • Claiming "this file is complex" without metrics
  • Recommending splits without identifying responsibilities
  • Skipping files because they "look fine"
  • Using vague terms like "too big" or "messy"
  • Recommending refactors without considering import impact

Return to Phase 1. Gather evidence.


Rationalizations (Do Not Skip)

RationalizationWhy It's WrongRequired Action
"File is large but organized"Organization doesn't fix responsibility sprawlIdentify distinct responsibilities, recommend splits
"It's a utility file, expected to be big"Utility files are complexity magnetsBreak into domain-specific utilities
"Would take too long to refactor"Note effort, still report findingDocument with E3 effort, let prioritization decide
"Tests would break"Tests prove the split pointsNote as consideration, not blocker
"Team knows this code"Tribal knowledge is tech debtDocument for bus factor mitigation

Time-Boxing Guidelines

Codebase SizeDiscoveryAnalysisTotal
Small (<10k LOC)30 min30 min1 hour
Medium (10-50k LOC)1 hour1 hour2 hours
Large (50k+ LOC)2 hours2 hours4 hours

When time expires: Document what you found. Mark incomplete areas with next actions.


Output Format

Provide a summary table followed by detailed findings:

## Complexity Assessment Summary

| Rank | File | Score | Severity | Recommendation |
|------|------|-------|----------|----------------|
| 1 | `src/utils/helpers.ts` | 9 | Critical | Split into 4 domain files |
| 2 | `src/components/Dashboard.tsx` | 8 | High | Extract 3 sub-components |
| 3 | `src/api/client.ts` | 7 | High | Separate by API domain |

### Top Finding Details
[Detailed findings for top 5-10 items]

Example Real Output

See Example Output for a worked-through assessment report (summary table, per-file score, observations, recommendations, evidence).

What To Do After Assessment

Once you have findings, here's how to act on them:

Immediate (This Sprint)

  1. Fix 🔥 Critical findings (ROI ≥ 9) - These block velocity
  2. Run tl-knip to remove dead exports before splitting
  3. Add tests for files you're about to split

Plan (Next Sprint)

  1. Create tickets for High-priority findings (score 7-8)
  2. Group related splits (e.g., all API files together)
  3. Estimate using the Effort column

Monitor (Ongoing)

  1. Re-run assessment monthly to catch new complexity
  2. Add complexity checks to PR reviews
  3. Set team threshold: "No new files over 300 lines without review"

Cognitive vs Cyclomatic Complexity

See Cognitive Complexity for the difference between cyclomatic and cognitive complexity, scoring rules, and ESLint/SonarJS integration.

Code Review Metrics

See Code Review Metrics for optimal PR size thresholds, review time budgets, and a CI complexity-gate workflow example.

Verification Checklist

Before completing assessment:

  • Ran automated discovery commands
  • Every finding has file path and line count
  • Every finding has specific observations (not vague)
  • Responsibilities identified for each split recommendation
  • Effort estimated for each recommendation
  • Priority calculated using ROI formula
  • Time-boxing respected
  • Summary table provided with top findings

Skill Resources

Automated Discovery

Run the scanner script for quick assessment:

# Bash
./scripts/complexity-scan.sh src/

# PowerShell
.\scripts\complexity-scan.ps1 -TargetDir src/

Reference Documentation

DocumentPurpose
references/react-patterns.mdReact hook limits, component size, inline sub-components
references/coupling-analysis.mdImport analysis, circular deps, dependency direction
references/refactoring-strategies.mdExtract function/module/component patterns

Load these references when deeper analysis is needed for a specific category.


Related Skills

  • tl-knip - Find unused exports (reduces false positives in export counts)
  • codebase-audit - Broader code health assessment
  • ui-audit - UI-specific complexity and drift detection
  • semgrep/skills/code-security - Security vulnerability detection (complementary to structural complexity)

References

Quilted Sources

Official Skills

First-Party Documentation

Academic/Industry

平台分布

Codex

34.79%
按下载量换算31

Claude

30.46%
按下载量换算27

Cursor

16.13%
按下载量换算14

Gemini CLI

8.84%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills