improve-codebase-architecture (mattpocock/skills)
improve-codebase-architecture:对照组 3.2、一句话提示 3.91、装 skill 4.12(0–5 分,Codex 实测,n=2/任务/组)。结论:视情况而定,相对不装 skill +0.92。
23.0 / 30
相对不装 skill 的提升:+0.92
视情况而定:提升 +0.92 低于 +1.0。推荐要求总分 22/30、产出质量 3.5、提升 +1.0。
前沿
通过使用 Codex 测试。
覆盖 Codex, Claude Code
Codex CLI 0.166(SOTA 档):18 次评分运行。按我们的分档规则,这档通过同时覆盖 Claude Code;它不代表第二档的结果。
分数
每一维 0 到 5 分,六维相加是满分 30 的总分。每一维都是 5 更好。成本 5 表示又便宜又快。安装 5 表示容易。
- 触发可靠性
- 5.0
- 相对不装的提升
- 2.9
- 产出质量
- 4.1
- 令牌与时间成本
- 2.0
- 安装与可移植性
- 4.0
- 安全
- 5.0
安全审查
安全静态扫描:0 CRITICAL / 0 HIGH / 0 MEDIUM。人工审查:可在断网沙箱中运行。扫描没有命中不等于绝对安全。
安装
npx skills@latest add mattpocock/skills --skill improve-codebase-architecture
固定提交: 4ae2317ddb22b046e26455e4f9c9b3aaaf62212d
测试日期: 2026-11-02
我们测了什么
- Whole-repo architecture scan — Review this small shop backend for architecture improvements: where would restructuring make the code easier to change and easier to test? Write your findings as a self-contained HTML report named report.html in this folder (do not open a browser or start a se…
- Payments and inventory only — Look only at the payment and inventory parts of this backend and tell me which restructurings would pay off. Write your findings as a self-contained HTML report named report.html in this folder (do not open a browser or start a server) and do not change any co…
- Why is place_order hard to test? — It feels painful to write a proper test for place_order in this backend. Why, and what restructuring would fix that? Do not change any files; answer in your final message.
优点
- 平均分从不装时的 3.2 提到 4.12(+0.92)。
- 不点名也会被触发:Skill file read in 6/6 treatment runs.
缺点
- token 消耗是不装 skill 时的 1.8 倍。
- 每个任务每组 n=2,差距在 1 分以内属于噪声。
评测
在 Codex CLI(SOTA 档)上跑 3 个任务、对照、一句话提示、装 skill 三组,共 18 次运行,由规则脚本打分(没有 LLM 评委),断网沙箱、每次运行独立临时目录。具体做法见下方英文评测原文。
三组对比
| 组别 | 平均分(0–5) | 每次 token |
|---|---|---|
| 不装 skill | 3.2 | 115k |
| 一句话提示 | 3.91 | 120k |
| 装了 skill | 4.12 | 208k |
Codex CLI 实测,18 次运行,规则脚本打分,没有 LLM 评委。总分 23.0 / 30,结论 视情况而定。
下面是评测原文,英文。
Verdict: Situational (23.0 / 30). Source: mattpocock/skills, skills/engineering/improve-codebase-architecture, skills/engineering/codebase-design, pinned at commit 4ae2317. Install: npx skills@latest add mattpocock/skills --skill improve-codebase-architecture. Licence: MIT (repo LICENSE).
What it is
The improve-codebase-architecture skill from mattpocock/skills. It looks for 'deepening opportunities' in a codebase: shallow modules whose interface is as complex as their implementation, pass-through layers, hypothetical single-adapter seams, duplicated logic, behaviour only tested through helpers. It writes an HTML report with a before/after per candidate and a top recommendation. It leans on a sibling skill, codebase-design, for the vocabulary. Markdown only, no scripts.
How we tested
Codex CLI 0.166 (gpt-6-astra, low reasoning) on a dedicated Windows test PC, a fresh temporary project and temporary HOME/TMPDIR/caches per run, skill installed (treatment) or absent (control) or absent with the skill's core requirement squeezed into one sentence appended to the prompt (one-liner group), 2 runs per group per task, network off, /tmp writes blocked. The prompts never mention the skill (except the wording noted below).
Three tasks on a small Python shop backend with planted friction (shallow validators/money helpers, an inventory service that only forwards to its repo, a single payment adapter, discount logic duplicated in cart and orders, tests that only cover helpers): a whole-codebase architecture review written as report.html, the same limited to payment and inventory, and 'why is place_order painful to test' answered in chat. The skill group's prompts start with $improve-codebase-architecture (explicit invocation); control and one-sentence prompts do not name it.
- Whole-repo architecture scan — Review this small shop backend for architecture improvements: where would restructuring make the code easier to change and easier to test? Write your findings as a self-contained HTML report named report.html in this folder (do not open a browser or start a se…
- Payments and inventory only — Look only at the payment and inventory parts of this backend and tell me which restructurings would pay off. Write your findings as a self-contained HTML report named report.html in this folder (do not open a browser or start a server) and do not change any co…
- Why is place_order hard to test? — It feels painful to write a proper test for place_order in this backend. Why, and what restructuring would fix that? Do not change any files; answer in your final message.
Scoring is programmatic (hidden tests / planted-issue recall / constraint checks / render+OCR where relevant), 0–5 per run. No LLM judge decided any score.
Results
The one-liner given to the third group: "Look for deepening opportunities: shallow modules whose interface is as complex as their implementation (apply the deletion test: would deleting it concentrate complexity or just move it?), pass-through layers, single-adapter seams that are only hypothetical, logic duplicated across modules, and logic that is only tested through helpers instead of the real interface; present each candidate with files, problem, solution, benefits, a before/after, and name a top recommendation."
| Task | Control score | One-liner | With skill | Control tokens | One-liner tokens | With-skill tokens | Skill read |
|---|---|---|---|---|---|---|---|
| t1-scan | 2.92 | 4.24 | 4.43 | 154k | 158k | 243k | 2/2 |
| t2-focus | 2.08 | 2.5 | 3.75 | 116k | 133k | 228k | 2/2 |
| t3-testing | 4.58 | 5.0 | 4.17 | 74k | 67k | 150k | 2/2 |
Mean score: 3.2 without vs 4.12 with the skill (delta +0.92). Tokens per run: 115k vs 208k (1.80x); time 112s vs 135s. One-liner group: 3.91 (the skill's gain over the one-liner: +0.2; one-liner's own gain over no skill: +0.72); one-liner tokens 120k per run, so the skill costs 1.73x the one-liner.
What happened
- Whole-codebase review is where it shows: the skill and the one-sentence version found 6/6 planted points with architecture vocabulary, before/after and a top recommendation in all four runs; plain Codex found 2/6 in one run and 5 of 6 checks in the other, and neither run had a clear 'top recommendation'.
- The focused review (payment and inventory only) is hard for everyone: the best group found one of the two planted points on average. Control 2/4 checks, one-liner 3/4, skill 3/4. The skill did not do better than the sentence.
- On 'why is place_order hard to test' all three groups found the planted causes (hidden PaymentAdapter, shared module-level stock, duplicated discount logic, tests that stop at helpers). The skill's answer used the skill's vocabulary ('interface', 'locality'); the control's was equally correct in plain words.
- Mean score 3.20 control, 3.91 one-sentence, 4.12 skill. The skill adds 0.21 over the sentence at 1.7x the tokens (208k vs 120k per run) because it also reads the sibling skill; the one-sentence group costs the same as the control (115k).
- Because the skill installs two skill folders, the treatment runs created extra files in the project's .agents folder; they were excluded from the 'no code files changed' check (a first pass wrongly failed them and a Windows-specific bug in the check was fixed before the final numbers).
Dimension scores
| Dimension | Score | Why |
|---|---|---|
| 1_output_quality | 4.12 | Mean score 4.12/5 with the skill (programmatic checks, see per-task table). |
| 2_lift_vs_no_skill | 2.92 | +0.92 points vs 3.20 without the skill (n=2 per task; under ~1 point is noise). |
| 3_trigger | 5.0 | Skill file read in 6/6 treatment runs. |
| 4_instructions_portability | 4 | Depends on a sibling skill (codebase-design) and optionally
|
| 5_efficiency | 2 | 1.80x tokens (208k vs 115k per run) and 1.20x time (135s vs 112s). |
| 6_safety_hygiene | 5 | Markdown only; scanner clean. Generated report scaffold loads CDN scripts when opened in a browser. |
Limits of this test
- One small Python fixture with textbook planted problems; whether the report is useful on a large real repo is not measured.
- Report quality, false positives and the HTML styling (it loads Tailwind and Mermaid from CDNs when opened in a browser) were not scored; the sub-agent behaviour the skill describes was not exercised.
- The one-sentence prompt restates the skill's own checklist, so it is an upper bound for a short prompt.
- n = 2 per group per task: differences under about 1 point are noise.
- Rule-based scoring measures what the checks can see; it cannot judge taste or whether a result is the best possible.
Security
See security.md. Scan: 0 CRITICAL / 0 HIGH / 0 MEDIUM. Verdict: safe to run (no-network sandbox). A clean scan does not prove a skill safe.
Bottom line
Compared with doing nothing the skill clearly improves a whole-codebase review, mostly by forcing the report structure and vocabulary, and costs 1.8x tokens. A single sentence that lists the same smells gets most of the gain, so it is worth installing mainly if you want the identical report format every time.
记录
Run log for improve-codebase-architecture: Codex CLI, network off, per-run temp HOME/TMPDIR, one row per graded run. Columns: task, arm-run, score (0-5), tokens, seconds, checks passed, skill files the agent opened. t1-scan control-1: score 1.67, tokens 154044, secs 168.7, checks 2/6, opened nothing t1-scan control-2: score 4.17, tokens 154957, secs 158.2, checks 5/6, opened nothing t1-scan oneliner-1: score 4.24, tokens 158136, secs 159.2, checks 6/6, opened nothing t1-scan oneliner-2: score 4.24, tokens 158141, secs 183.3, checks 6/6, opened nothing t1-scan treatment-1: score 4.62, tokens 229717, secs 180.3, checks 6/6, opened codebase-design,improve-codebase-architecture t1-scan treatment-2: score 4.24, tokens 258001, secs 158.7, checks 6/6, opened codebase-design,improve-codebase-architecture t2-focus control-1: score 1.25, tokens 107480, secs 117.6, checks 2/4, opened nothing t2-focus control-2: score 2.92, tokens 125637, secs 137.1, checks 2/4, opened nothing t2-focus oneliner-1: score 2.5, tokens 139088, secs 200.6, checks 3/4, opened nothing
18 次运行、3 个产物
样例产物
前沿 · 装了 skill:report.html(t1-scan,第 1 次,Codex)
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Small shop — architecture review</title> <style> :root{color-scheme:light;--ink:#182b36;--muted:#52616b;--accent:#13745b;--paper:#f5f3ed;--line:#d6ddd8}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.6 system-ui,sans-serif}main{max-width:1120px;margin:auto;padding:50px 28px}h1,h2,h3{line-height:1.18}h1{font: clamp(34px,5vw,58px)/1.1 Georgia,serif;margin:12px 0}h2{font:30px/1.2 Georgia,serif;margin:12px 0}h3{font-size:16px}a{color:var(--accent)}.eyebrow,.label{font-size:12px;font-weight:750;letter-spacing:.1em;text-transform:uppercase}.muted{color:var(--muted)}header{margin-bottom:30px}.summary,article,.top{background:#fff;border:1px solid var(--line);border-radius:16px;padding:28px;margin:24px 0}article{border-top:4px solid var(--accent)}.badge{display:inline-block;padding:4px 12px;border-radius:20px;background:#dff3e9;color:#07583f;font-size:13px;font-weight:700}.explore{background:#fff0ce;color:#805800}.files{font:13px/1.8 ui-monospace,monospace;color:var(--muted);overflow-wrap:anywhere}.diagrams{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:24px 0}.diagram{padding:20px;background:#f5f7f5;border-radius:10px}.diagram h3{margin:0 0 18px}.box{border:1px solid #95aaa1;border-radius:6px;background:white;padding:12px;text-align:center}.row{display:flex;gap:10px}.row>*{flex:1}.arrow{text-align:center;color:var(--accent);font-weight:700;padding:6px}.leak{color:#ad3f35}.deep{background:var(--ink);color:#fff;border:4px solid var(--ink);border-radius:8px;padding:16px;text-align:center}.inside{margin-top:12px;border-top:1px solid #7d9b98;padding:12px 4px;color:#d2e4df;font-size:14px}.seam{border-top:2px dashed #80958c;margin:12px 0;padding-top:8px;text-align:center;font-size:13px;color:var(--muted)}p{margin:12px 0}ul{padding-left:22px}li{margin:6px 0}.note{border-left:3px solid #d29b35;padding:8px 14px;background:#fff9eb}.top{background:#e3eee7}.index{display:flex;gap:20px;flex-wrap:wrap}.footer{font-size:13px;color:var(--muted)}@media(max-width:720px){main{padding:24px 14px}.diagrams{grid-template-columns:1fr}article,.summary,.top{padding:20px}}@media print{body{background:#fff}main{padding:0}article{break-inside:avoid}a{color:inherit}} </style> </head> <body><main> <header><div class="eyebrow">Architecture review · 2 November 2026</div><h1>Give shop behavior<br>one place to live.</h1><p class="muted">Three focused opportunities for change locality and test leverage.</p><nav class="index" aria-label="Candidates"><a href="#pricing">01 Pricing</a><a href="#inventory">02 Inventory</a><a href="#order">03 Order execution</a></nav></header> <section class="summary" aria-label="Scope and evidence"> <h2>Scope & confidence</h2> <p>Reviewed all ten Python files in <code>shop/</code>, <code>tests/test_helpers.py</code>, README, and available history at <code>39cbee1</code>. History contains only <code>init</code>; no change hotspots can be inferred. No <code>GLOSSARY.md</code>, <code>docs/adr/</code>, or <code>AGENTS.md</code> was found. Domain names below come from [... excerpt: first 3200 of 13128 characters]