by tt-a1i
Prove and remove accidental codebase complexity without breaking behavior.
# Add to your Claude Code skills
git clone https://github.com/tt-a1i/simplify-codebaseGuides for using ai agents skills like simplify-codebase.
simplify-codebase is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by tt-a1i. Prove and remove accidental codebase complexity without breaking behavior. It has 95 GitHub stars.
simplify-codebase's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/tt-a1i/simplify-codebase" and add it to your Claude Code skills directory (see the Installation section above). simplify-codebase ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh simplify-codebase against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Reduce the number of concepts and obligations a codebase must keep coherent. Line-count reduction is supporting evidence, not the objective. A successful run may conclude that the inspected surface is already justified.
First choose the authority mode:
Then choose the coverage scope:
Deleting a reachable capability, supported interface, stored representation, or compatibility path is a product decision. Describe the consequence and obtain direction unless the user has already chosen it.
Preserve authorization, trust-boundary validation, security isolation, accessibility essentials, data-loss prevention, stored-format compatibility, and cleanup that establishes quiescence. Treat changes to these protections as their own explicitly authorized objective, not an incidental simplification.
The contract map is complete when all in-scope entrypoints and authority boundaries are enumerated, each is traced far enough to name its owner and observable contract, and every uninspected or externally unknowable surface is recorded as a blind spot.
For every Broad engagement, and for Focused work involving dynamic architecture or dependency substitution, read investigation.md. Build a coverage map before ranking findings; the first plausible deletion must not end the survey.
For concurrency, cancellation, readiness, cleanup, defensive copies, validation, authorization, security isolation, accessibility, data-loss prevention, or cross-process data, also read boundaries-and-lifecycle.md.
Use repository-native search, compiler and linter output, dependency metadata, and history as discovery instruments. Treat their findings as leads until runtime consumers and contracts have been examined.
For every in-scope lead that reaches consumer-map evidence or could retire a meaningful contract, record:
Candidate: the exact contract, representation, or layer to remove or merge
Burden: the concepts, synchronization, publication, or testing cost it creates
Reachability: production, non-production, dynamic, external, and persisted consumers
Rationale: why it exists and whether that reason remains current
Cut: declarations, implementations, branches, artifacts, docs, and dependencies affected
Consequence: observable capability or compatibility behavior surrendered
Confidence / risk: evidence strength, uncertainty, blast radius, and reversibility
Proof: the smallest check that would expose an incorrect cut
Net effect: maintenance concepts removed minus replacement or migration machinery added
Prove cut boundaries below file granularity when the candidate shares an artifact with surviving consumers. Account for candidate-exclusive selectors, members, fields, keys, registry entries, generated fragments, and fixtures without disturbing the surviving owners.
Keep or downgrade the candidate when a real consumer exists, dynamic reachability remains unresolved, a current decision still owns the design, the change merely relocates complexity, the result is outside scope or retires no meaningful obligation, or the available check cannot distinguish success from accidental breakage.
Rank confidence separately from benefit. A high-value guess does not outrank a smaller proved cut.
Candidate proof is complete when every qualifying lead is classified as ranked, rejected, or unresolved, and every unresolved lead names the fact required to decide it.
In Survey mode, stop after reporting the ranked evidence. Include important rejected candidates when the rejection teaches something or identifies a concrete missing fact.
In Change mode, read execution-and-recovery.md and select the strongest authorized cut. One ownership boundary is the default batch size, not a run limit: for an explicitly requested set of cuts, finish and validate each boundary before starting the next.
If the user requests a simplification proposal, local cleanup annotation, or design-record consolidation, or if a selected change invalidates an ADR, RFC, design note, or architectural inventory, read decision-records.md. Do not turn an ordinary code audit into a repository-wide documentation purge.
If the user asks to combine findings from another branch, pull request, task, or agent run, read integrating-findings.md. Preserve evidence, not finding counts.
For a survey, report coverage, ranked proof records, rejected or unresolved high-value leads, and the next fact needed for each uncertainty.
For a change, complete the validation and operation receipt defined in execution-and-recovery.md. Report each validation layer separately; a narrow green check does not establish broader runtime, deployment, or user acceptance.
先证明,再删除。让代码库少维护一些事实、状态与契约。
simplify-codebase 是一个面向现有代码库的 Agent Skill。它帮助编码智能体识别并安全移除偶然复杂度,同时保护仍然有效的行为、边界与兼容性。
它不追求“删得多”。它关心的是:一次改动能否减少团队今后必须持续保持一致的概念和义务。
代码库里的冗余很少只是“某个函数没人调用”。它也可能是重复状态、失去所有者的抽象、只剩测试消费的接口、早已无效的兼容路径,或者被保留在共享文件中的半截功能。
静态检查可以提供线索,但不能单独证明一项删除是安全的。这个 Skill 会继续追踪运行时消费者、动态注册、持久化格式、公共接口、历史决策与验证边界,再决定应该删除、合并、保留,还是标记为暂时无法判断。
核心原则: 删除代码行只是结果。真正的收益是删除一个需要长期维护的事实、状态、契约或概念。
聚焦范围 Focused |
全库范围 Broad |
|
|---|---|---|
只读审计 Survey |
深挖一个子系统、状态机或疑似重复点 | 分区覆盖整个仓库,给出候选、反证与盲区 |
授权修改 Change |
证明并完成一个明确的简化边界 | 按所有权边界分批修改,每批独立验证 |
每个候选都要形成一份证明记录:
发现真实消费者、边界尚未查清,或者简化只是把复杂度搬到别处时,它会建议保留,而不是为了输出结果强行删除。
让 Codex 安装:
Install the simplify-codebase skill from https://github.com/tt-a1i/simplify-codebase
也可以手动安装到 Codex 的用户级 Skill 目录:
git clone https://github.com/tt-a1i/simplify-codebase.git \
~/.codex/skills/simplify-codebase
安装后请新建一个任务,让 Skill 目录重新加载。其他支持 SKILL.md 的 Agent 环境可将本仓库放入各自的 Skill 目录。
使用 $simplify-codebase 审计这个仓库,列出最安全、收益最高的简化候选。不要修改文件。
使用 $simplify-codebase 判断这些 readiness 标志是在表达不同的生命周期保证,还是重复状态。
使用 $simplify-codebase 删除一个高置信度的偶然复杂度来源。保留仍然有效的契约,完成验证,并给出操作回执和撤销路径。
使用 $simplify-codebase 复核并整合这个 PR 中的简化建议。保留证据,不保留候选数量。
只读审计会交付覆盖范围、排序后的证明记录、重要反例、未决问题和下一条所需证据。
修改任务会额外交付实际变更、分层验证结果、剩余风险、操作回执与可执行的撤销路径。一次小范围测试通过,不会被包装成完整的运行时或用户验收。
.
├── SKILL.md # 主工作流与判断标准
├── agents/openai.yaml # Agent 展示与调用元数据
├── references/
│ ├── investigation.md # 全库调查与候选发现
│ ├── boundaries-and-lifecycle.md
│ ├── execution-and-recovery.md
│ ├── decision-records.md
│ └── integrating-findings.md
├── docs/validation.md # 行为验证与质量证据
└── assets/hero.png # 原创 Hero 视觉
这个版本经过 Change、Broad、Integration 和 Decision-record 场景验证,也在一个 973 文件的 Python + TypeScript 项目上完成过全库审计。测试方法与已知边界记录在 docs/validation.md。
Skill 不能替代产品决策。删除仍然可达的能力、已支持接口、持久化表示或兼容路径时,仍需由使用者明确授权。
欢迎提交 Issue 和 PR。请优先提供失败案例、遗漏的消费者、错误删除风险或可以复现的验证缺口;这比单纯增加更多规则更有价值。