Borrowing it
Nothing to install: this file belongs to ProgrammerAnthony/Expert-Coding-Harness. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ProgrammerAnthony/Expert-Coding-Harness/master/.cursor/skills/improve-codebase-architecture/SKILL.mdgit clone --depth 1 https://github.com/ProgrammerAnthony/Expert-Coding-HarnessWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/programmeranthony/expert-coding-harness/improve-codebase-architecture)<a href="https://agentmods.dev/skills/programmeranthony/expert-coding-harness/improve-codebase-architecture"><img src="https://agentmods.dev/badge/skills/programmeranthony/expert-coding-harness/improve-codebase-architecture/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/programmeranthony/expert-coding-harness/improve-codebase-architecture"><img src="https://agentmods.dev/badge/skills/programmeranthony/expert-coding-harness/improve-codebase-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00114 | $0.00999 |
| Opus 5.5 | $0.00046 | $0.00400 |
| Sonnet 5.5 | $0.00023 | $0.00200 |
| Haiku 4.5 | $0.00011 | $0.00100 |
Grade A, and why
improve-codebase-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
改进代码库架构
发现架构摩擦点,提出深化机会——将浅模块变为深模块的重构。目标:可测试性与 AI 可导航性。
使用 references/LANGUAGE.md 中的词汇表,所有建议中严格使用这些术语。
核心词汇(速查)
- 模块(Module):有接口和实现的任何东西(函数、类、包、切片)。
- 接口(Interface):调用者需要了解的一切:类型、不变量、错误模式、顺序、配置。不只是类型签名。
- 深度(Depth):接口背后的杠杆——大量行为隐藏在小接口后面是深,接口复杂度接近实现复杂度是浅。
- 接缝(Seam):可以不编辑内部代码而改变行为的地方。
- 适配器(Adapter):在接缝处满足接口的具体实现。
- 删除测试(Deletion test):想象删掉这个模块。复杂度消失了?那它是透传层。复杂度在 N 个调用者处重新出现?那它值得存在。
流程
1. 探索
先读取项目的领域词汇表(CONTEXT.md、UBIQUITOUS_LANGUAGE.md 等)和相关 ADR。
使用 Explore 子代理遍历代码库。有机探索,记录摩擦点:
- 理解一个概念需要在多个小模块间来回跳转的地方?
- 接口复杂度接近实现的浅模块?
- 为可测试性提取出来的纯函数,但真正的 Bug 隐藏在调用方式中(无局部性)?
- 紧耦合模块跨接缝泄漏的地方?
- 未测试或难以通过当前接口测试的代码?
对可疑的浅模块做删除测试:删掉它会集中复杂度,还是只是移动了它?"集中"是你要找的信号。
2. 提出候选项
呈现编号的深化机会列表。每个候选项包含:
- 模块标识:名称 + 文件路径
- 浅度诊断:为什么它是浅的(接口太多、散布在 N 个调用者、透传层、测试只能通过实现细节)
- 深化思路:合并哪些模块、接缝放哪里、哪些依赖需要端口
- 可测试性收益:深化后如何改善测试(更少 Mock、直接可测接口、局部性更好)
- 工作量估算:小/中/大(不做具体行数预估)
在提出候选项时停下,等待用户选择。 不要直接开始重构。
3. 为选定候选项设计接口(可选)
若用户想要对选定候选项探索多种接口设计,使用并行子代理模式——详见 references/INTERFACE-DESIGN.md。
4. 实施
用户选定候选项并批准接口设计后:
- 参考 references/DEEPENING.md 制定具体深化策略
- 编写新的集成测试,通过新接口测试行为
- 合并模块,删掉旧的浅层测试(它们已成废代码)
- 确认所有测试通过,删除任何遗留的原型代码
参考文档
- references/LANGUAGE.md — 完整词汇表与定义
- references/DEEPENING.md — 按依赖类型的深化策略
- references/INTERFACE-DESIGN.md — 并行子代理接口设计模式
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 67 lines · 114 tokens per session scan A d97445fcb6e7
improve-codebase-architecture is a skill published in the GitHub repository ProgrammerAnthony/Expert-Coding-Harness (246 stars, last pushed 5mo ago), licensed MIT. It adds 114 tokens to every session and 999 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
autoreview
Structured code review through the shared OpenClaw agent-skills installation.
omh-code-review
This is an OMH code-review workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).
revdiff-plan
Review the last Codex assistant message (plan, analysis, or proposal) with inline annotations in a TUI overlay. Extracts the most recent response from Codex rollout files and opens it in revdiff for review and annotation. Activates on "revdiff-plan", "review plan with revdiff", "annotate plan", "review last response"…
explore-unknowns
Guide the user through a quadrant walk that maps the unknowns of a task — open by listing the known knowns, then work through known unknowns, unknown knowns, and unknown unknowns one stage at a time, ending with a complete four-quadrant map in the user's hands. Use when a request is ambiguous or underspecified, the…
re0-merge
Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…
asplos-writing-style
Use when drafting or revising ASPLOS prose — engineering the first two pages that rapid review actually reads, stating the cross-layer insight as one quotable sentence, structuring per-layer mechanism sections, writing bounded claims, and fitting everything into 11 self-contained pages that include figures and…