一键导入
code-complexity
Analyse code for complexity issues and suggest reductions. Use when the user asks to check complexity, simplify code, or reduce technical debt.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyse code for complexity issues and suggest reductions. Use when the user asks to check complexity, simplify code, or reduce technical debt.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Create new agent skills from scratch, improve or optimize existing skills, and measure skill performance with evaluations. Use when the user wants to create a skill, edit or improve an existing skill, run evals or benchmarks to test skill quality, optimize a skill's description for better triggering, or package a skill for distribution. Works across Claude Code, OpenAI Codex, GitHub Copilot, OpenCode, Gemini, and other agents supporting the Agent Skills open standard.
Review code changes for correctness, security, clarity, and adherence to project conventions. Use when the user asks to review code, check a diff, or audit a PR.
基于 SOC 职业分类
| name | code-complexity |
| description | Analyse code for complexity issues and suggest reductions. Use when the user asks to check complexity, simplify code, or reduce technical debt. |
Evaluate the code for complexity using these signals:
Cyclomatic complexity — count decision points (if, else, switch cases, loops, catch, ternaries, logical operators). Flag any function with more than ~10 branches; suggest splitting or extracting early returns.
Cognitive complexity — focus on nesting depth and logical operator density. Deeply nested blocks are harder to read than equivalent flat code; flatten with guard clauses or extracted functions.
Coupling — identify modules that reach into each other's internals, share mutable state, or have implicit execution ordering. High coupling makes isolated changes risky.
Dead code — flag unused variables, unreachable branches, obsolete classes or interfaces. Dead code adds noise without value.
Size — functions or files that do too much. A function that needs a paragraph to describe what it does is a candidate to split.
For each issue found:
Severity guide: