一键导入
code-simplification
Use after a feature or fix is verified and passing to reduce complexity, remove dead code, and improve clarity without changing behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use after a feature or fix is verified and passing to reduce complexity, remove dead code, and improve clarity without changing behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | code-simplification |
| description | Use after a feature or fix is verified and passing to reduce complexity, remove dead code, and improve clarity without changing behavior. |
| type | skill |
| license | MIT |
| compatibility | ["claude-code","cursor","codex"] |
| trigger | post-verification|cleanup-pass|heavy-abstractions |
| skip_when | pre-correctness|unrelated-refactor |
| user-invocable | false |
Simplify only after behavior is proven. The goal is to reduce complexity, remove dead weight, and improve clarity without broadening scope or changing behavior.
--audit-duplicatesOptional audit that scans the repo for near-duplicate capabilities so they can be consolidated before they multiply. Use the "check before you write" reflex during spec writing; this mode is the periodic sweep that catches duplicates that slipped past it.
CODE_INDEX.md at the repo root (template:
.claude/references/code-index-template.md). If absent, skip
index-guided scanning and note CODE_INDEX.md missing in the report
(it is generated during setup-bootstrap).bash scripts/query-code-index.sh find "<keyword>" (prints each matching row prefixed with its ## <Domain>
section) only for targeted follow-up lookups, and fall back to
grep -i CODE_INDEX.md if the script is absent (repo bootstrapped
before v7.17). Group near-duplicates by stem (verb + noun) using simple
normalization: lowercase, drop suffixes like Async / _v2 / Impl.Trigger this mode when:
CODE_INDEX.md is older than 30 days and the repo had >50 commits since.The cheapest code is the code you do not write. When simplifying — or when reviewing whether a block should exist at all — walk this ladder and stop at the first rung that satisfies the requirement:
--audit-duplicates) rather than adding a parallel one.dependency-intake-checklist.md).This is the antidote to defensive-guard bloat (F5) and dead-code accretion (F10): every rung climbed is volume a future reader has to carry.
Aggressive simplification has a hard boundary. Never remove, collapse, or "tidy away" the following just because they look redundant — lazy ≠ broken:
A guard in one of these categories is presumed load-bearing. If you believe one is genuinely dead, that is a security-and-hardening question, not a cleanup call — surface it, do not delete it.
See .claude/skills/context-engineering/SKILL.md for the shared table. Simplification-specific traps: "now that I'm here, I should refactor the whole module" (cleanup is not permission for a hidden rewrite — stay scoped), and "the dead code is probably still needed somewhere" (probably is a reason to verify or ask, not to leave clutter in place).
Corrective batch of multiple small independent fixes (apply review findings, several/multiple fixes across >3 files, no new contract or architecture) — broader than fix, lighter than implement.
One-time repo setup that detects tech stack, audits the codebase, pulls coding guidelines, and generates a project-specific CLAUDE.md
Full feature implementation loop orchestrating planning, batching, verification, and review skills
Use when the task is a new feature, breaking change, multi-file change, or any work where approval should happen before coding begins.
Use to create, update, and read durable workflow state under .mtk/workflows/ so orchestration survives compaction, crash, and session handoff.
Use after a spec is approved and before multi-file implementation begins, to break work into verifiable batches with checkpoints.