Agent skill

Improve Codebase Architecture

by vinvcn in vinvcn/mattpocock-skills-zh-CN

扫描代码库中的深化机会,生成可视化 HTML 报告,然后围绕你选中的候选项继续追问. An agent skill from vinvcn/mattpocock-skills-zh-CN.

MITAuto-check passedDevelopment

Install Improve Codebase Architecture

skills CLI
$ npx skills add vinvcn/mattpocock-skills-zh-CN --skill improve-codebase-architecture -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install vinvcn/mattpocock-skills-zh-CN improve-codebase-architecture --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/vinvcn/mattpocock-skills-zh-CN.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/engineering/improve-codebase-architecture .claude/skills/improve-codebase-architecture && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
improve-codebase-architecture
GitHub stars
4.7k
Token cost
~981 tokens
SKILL.md length
382 words
Files
3
Skills in repo
33
Repo updated
First seen
Licence
MIT

At a glance

扫描代码库中的深化机会,生成可视化 HTML 报告,然后围绕你选中的候选项继续追问. An agent skill from vinvcn/mattpocock-skills-zh-CN.

  • Works in 3 steps: Explore → Present candidates as an HTML report → Grilling loop
  • Development work in your project
  • Calls git

What it does

Improve Codebase Architecture is an agent skill from vinvcn/mattpocock-skills-zh-CN. 扫描代码库中的深化机会,生成可视化 HTML 报告,然后围绕你选中的候选项继续追问。

Its SKILL.md is about 980 tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `HTML-REPORT.md` and `agents/openai.yaml`).

It sits in Development. It works with Mermaid. The repository describes itself as: 这是 mattpocock/skills 的简体中文本地化版本。 The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/improve-codebase-architecture”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Explore
  2. Present candidates as an HTML report
  3. Grilling loop

What it can do on your machine

Read from SKILL.md and the folder at commit 3f92a83. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Improve Codebase Architecture loads about 981 tokens when it runs. Until then it costs about 18 tokens; SKILL.md has 382 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~18
When it runs · the whole SKILL.md, loaded when a task matches
~981

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from vinvcn/mattpocock-skills-zh-CN at commit 3f92a83, republished under its MIT licence (© vinvcn). 382 words, ~981 tokens.

Download SKILL.mdSave it as .claude/skills/improve-codebase-architecture/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
improve-codebase-architecture
description
扫描代码库中的深化机会,生成可视化 HTML 报告,然后围绕你选中的候选项继续追问。
disable-model-invocation
true

Improve Codebase Architecture

暴露 architectural friction,并提出 deepening opportunities:把 shallow modules 变成 deep modules 的 refactors。目标是 testability 和 AI-navigability。

这个命令由项目的 domain model 提供信息,并建立在共享 design vocabulary 上:

  • 调用 Skill 工具并指定 codebase-design,获取 architecture vocabulary(module、interface、depth、seam、adapter、leverage、locality)及其 principles(deletion test、"the interface is the test surface"、"one adapter = hypothetical seam, two = real")。每条建议都准确使用这些术语,不要漂移到 "component"、"service"、"API" 或 "boundary"。
  • CONTEXT.md 中的 domain language 会为好的 seams 命名;docs/adr/ 中的 ADRs 记录这个命令不应重新争论的 decisions。

Process

1. Explore

先划定扫描范围——YAGNI。 深化 module 的收益在于让未来修改更容易,因此要更关注最近仍在变化的 codebase 区域。开始探索前先决定去哪里看:

  • 如果用户点名了方向——module、subsystem 或 pain point——就按该方向探索,跳过下面的推断。
  • 否则,向前回看一段足够长的 commit history(git log --oneline),找出反复出现的 files 和 areas,让这些 hot spots 成为首要关注点。如果变更分散、没有明显 hot spot,再扩大范围。

先读取项目 domain glossary(CONTEXT.md)以及你将触碰区域的 ADRs。

然后 spawn 一个 sub-agent 来遍历 codebase。不要套死板 heuristics;自然探索,并记录你感到 friction 的地方:

  • 理解一个概念是否需要在许多小 modules 之间来回跳?
  • 哪些 modules 是 shallow 的,即 interface 几乎和 implementation 一样复杂?
  • 是否存在为了 testability 抽出的 pure functions,但真正 bugs 藏在它们如何被调用之处(没有 locality)?
  • 哪些 tightly-coupled modules 泄漏到了 seams 之外?
  • Codebase 的哪些部分未测试,或很难通过当前 interface 测试?

对任何你怀疑 shallow 的东西应用 deletion test:删除它会让复杂度集中,还是只把复杂度移动到别处?"yes, concentrates" 才是你要的 signal。

2. Present candidates as an HTML report

把 self-contained HTML file 写到 OS temp directory,避免任何内容落进 repo。Temp dir 从 $TMPDIR 解析,fallback 到 /tmp(Windows 用 %TEMP%),写到 <tmpdir>/architecture-review-<timestamp>.html,让每次运行都有新文件。为用户打开它:Linux 用 xdg-open <path>,macOS 用 open <path>,Windows 用 start <path>,并告诉用户 absolute path。

Report 使用 Tailwind via CDN 做 layout/styling,用 Mermaid via CDN 做能可靠传达结构的 diagrams。Mermaid 和手写 CSS/SVG visuals 可以混用:关系是 graph-shaped(call graphs、dependencies、sequences)时用 Mermaid;需要 editorial 表达(mass diagrams、cross-sections、collapse animations)时用手写 divs/SVG。每个 candidate 都要有 before/after visualisation。要视觉化。

每个 candidate 渲染一张 card,包含:

  • Files - 涉及哪些 files/modules
  • Problem - 当前 architecture 为什么造成 friction
  • Solution - 会改变什么,用平实的语言描述
  • Benefits - 用 locality 与 leverage 解释收益,以及 tests 如何改善
  • Before / After diagram - side-by-side,自绘,说明 shallowness 与 deepening
  • Recommendation strength - Strong、Worth exploring、Speculative 之一,渲染为 badge
Show full SKILL.md (149 more words)Show less

Report 末尾包含 Top recommendation section:你会先处理哪个 candidate,以及为什么。

用 CONTEXT.md vocabulary 表达 domain,用 /codebase-design vocabulary 表达 architecture。 如果 CONTEXT.md 定义了 "Order",就说 "Order intake module",不要说 "FooBarHandler",也不要说 "Order service"。

ADR conflicts:如果 candidate 与现有 ADR 冲突,只有在 friction 真实到值得重新打开 ADR 时才提出。Card 中明确标记(例如 warning callout:"contradicts ADR-0007 - but worth reopening because...")。不要列出 ADR 理论上禁止的每个 refactor。

完整 HTML scaffold、diagram patterns 和 styling guidance 见 HTML-REPORT.md。

现在不要提出 interfaces。写完文件后问用户:"Which of these would you like to explore?"

3. Grilling loop

用户选中 candidate 后,调用 Skill 工具并指定 grilling,与用户走完 decision tree:constraints、dependencies、deepened module 的形状、seam 后面放什么、哪些 tests 能保留。

Side effects 随 decisions 成形而内联发生;调用 Skill 工具并指定 domain-modeling,让 domain model 保持最新:

  • 要用 CONTEXT.md 中不存在的概念命名 deepened module? 把 term 加入 CONTEXT.md。若文件不存在,按需创建。
  • 对话中打磨了 fuzzy term? 立即更新 CONTEXT.md。
  • 用户以 load-bearing reason 拒绝了 candidate? 提议写 ADR,表述为:"Want me to record this as an ADR so future architecture reviews don't re-suggest it?" 只有当未来 explorer 确实需要该 reason 以避免再次提出同样建议时才提议;跳过临时原因("not worth it right now")和显而易见原因。
  • 想探索 deepened module 的 alternative interfaces? 调用 Skill 工具并指定 codebase-design,并使用其中的 design-it-twice parallel sub-agent pattern。

© vinvcn, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in skills/engineering/improve-codebase-architecture of vinvcn/mattpocock-skills-zh-CN.

  • SKILL.md
  • HTML-REPORT.md
  • agents/openai.yaml

Open the folder on GitHubat commit 3f92a83

Compare with similar skills

Improve Codebase Architecture next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Improve Codebase Architecture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Improve Codebase Architecture this skillvinvcn/mattpocock-skills-zh-CN4.7k—~981Automated safety check: PassMIT
Archify Diagramstt-a1i/archify79k—~2.9kAutomated safety check: PassMIT
Diagram Designcathrynlavery/diagram-design45k1 repos~7.5kAutomated safety check: PassMIT
Draw.io Diagram StudioAgents365-ai/drawio-skill10k—~2.4kAutomated safety check: NotesMIT
Code Graph Mermaid Diagramstrailofbits/skills7.4k1 repos~1.7kAutomated safety check: PassCC-BY-SA-4.0
Pretty Mermaid Rendererimxv/Pretty-mermaid-skills1.5k—~2kAutomated safety check: PassMIT

Similar skills

  • Archify Diagrams

    tt-a1i/archify

    Creates interactive architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone HTML with inline SVG, themes and image or video export.

    79k GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Diagram Design

    cathrynlavery/diagram-design

    Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.

    45k GitHub starsUsed in 1 repo~7.5k tokens
    DevelopmentAuto-check passed
  • Draw.io Diagram Studio

    Agents365-ai/drawio-skill

    Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.

    10k GitHub stars~2.4k tokensUpdated 5 days ago
    DevelopmentAuto-check: notes
  • Code Graph Mermaid Diagrams

    trailofbits/skills

    Official

    Generates Mermaid diagrams from Trailmark code graphs, including call graphs, class hierarchies, module dependency maps, complexity heatmaps and attack surface data flows.

    7.4k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • Pretty Mermaid Renderer

    imxv/Pretty-mermaid-skills

    Writes and renders Mermaid diagrams as themed SVG, PNG or terminal ASCII and Unicode art with a bundled Node.js CLI that needs no browser.

    1.5k GitHub stars~2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Archify Diagram Builder

    Unclecheng-li/AI_Animation

    Builds validated architecture, workflow, sequence, data-flow and lifecycle diagrams as standalone interactive HTML from a small JSON spec, with optional motion and image export.

    1.5k GitHub starsUsed in 2 repos~4.1k tokens
    DevelopmentAuto-check passed

More from vinvcn/mattpocock-skills-zh-CN

All 33 skills in this repo
  • Git Guardrails Claude Code

    vinvcn/mattpocock-skills-zh-CN

    设置 Claude Code hooks,在危险 git commands(push、reset --hard、clean、branch -D 等)执行前阻止它们。适用于用户想防止破坏性 git 操作、添加 git safety hooks,或在 Claude Code 中阻止 git push/reset 时。

    4.7k GitHub stars~474 tokensUpdated 9 days ago
    Auto-check passed
  • Codebase Design

    vinvcn/mattpocock-skills-zh-CN

    用于设计深模块的共享词汇。适用于用户想设计或改进模块接口、寻找深化机会、决定 seam 放在哪里、让代码更容易测试或更适合 AI 导航,或其他技能需要深模块词汇时。

    4.7k GitHub stars~1.1k tokensUpdated 9 days ago
    Auto-check passed
  • Diagnosing Bugs

    vinvcn/mattpocock-skills-zh-CN

    面向棘手缺陷和性能回退的诊断循环。适用于用户说 “diagnose” / “debug this”,或报告某些东西 broken、throwing、failing、slow 时。

    4.7k GitHub stars~1.4k tokensUpdated 9 days ago
    Auto-check passed
  • Domain Modeling

    vinvcn/mattpocock-skills-zh-CN

    构建并打磨项目的领域模型。适用于讨论 codebase 术语、编写或编辑 CONTEXT.md,或记录或编辑 ADR. An agent skill from vinvcn/mattpocock-skills-zh-CN.

    4.7k GitHub stars~505 tokensUpdated 9 days ago
    Auto-check passed
  • Migrate To Shoehorn

    vinvcn/mattpocock-skills-zh-CN

    将测试文件从 as 类型断言迁移到 @total-typescript/shoehorn。适用于用户提到 shoehorn、想替换测试中的 as,或需要局部测试数据时。

    4.7k GitHub stars~619 tokensUpdated 9 days ago
    Auto-check passed
  • PR

    vinvcn/mattpocock-skills-zh-CN

    用于撰写 PR 正文。适用于用户要求起草、改写或改进 PR 正文,或希望 PR 更便于审阅时. An agent skill from vinvcn/mattpocock-skills-zh-CN.

    4.7k GitHub stars~737 tokensUpdated 9 days ago
    Auto-check passed

Works with

Categories

Questions about Improve Codebase Architecture

What does Improve Codebase Architecture do?

扫描代码库中的深化机会,生成可视化 HTML 报告,然后围绕你选中的候选项继续追问. An agent skill from vinvcn/mattpocock-skills-zh-CN. Improve Codebase Architecture is an agent skill from vinvcn/mattpocock-skills-zh-CN.

When should I use Improve Codebase Architecture?

Improve Codebase Architecture fits situations like: development work in your project.

How do I install Improve Codebase Architecture in Claude Code?

Run `npx skills add vinvcn/mattpocock-skills-zh-CN --skill improve-codebase-architecture -a claude-code`. Or copy the skill folder (skills/engineering/improve-codebase-architecture in vinvcn/mattpocock-skills-zh-CN) into .claude/skills/improve-codebase-architecture in your project. Claude Code loads it when a task matches its description.

How do I install Improve Codebase Architecture in Codex?

Run `npx skills add vinvcn/mattpocock-skills-zh-CN --skill improve-codebase-architecture -a codex`. Or copy the skill folder (skills/engineering/improve-codebase-architecture in vinvcn/mattpocock-skills-zh-CN) into .agents/skills/improve-codebase-architecture in your project. Codex loads it when a task matches its description.

Can I use Improve Codebase Architecture in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vinvcn/mattpocock-skills-zh-CN --skill improve-codebase-architecture -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/improve-codebase-architecture, .gemini/skills/improve-codebase-architecture, .github/skills/improve-codebase-architecture and .opencode/skills/improve-codebase-architecture in your project.

What does Improve Codebase Architecture need to run?

Going by SKILL.md and its folder, Improve Codebase Architecture needs the command-line tools its instructions call (git).

Does Improve Codebase Architecture access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Improve Codebase Architecture safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Improve Codebase Architecture use?

Improve Codebase Architecture is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Improve Codebase Architecture use?

About 981 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Improve Codebase Architecture?

Skills that share tags, products or a category with Improve Codebase Architecture: Archify Diagrams (tt-a1i/archify, 79k stars), Diagram Design (cathrynlavery/diagram-design, 45k stars), Draw.io Diagram Studio (Agents365-ai/drawio-skill, 10k stars) and Code Graph Mermaid Diagrams (trailofbits/skills, 7.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Improve Codebase Architecture?

vinvcn (a GitHub user) maintains it in vinvcn/mattpocock-skills-zh-CN, which has 4,657 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on September 28, 2026.

Source: vinvcn/mattpocock-skills-zh-CN on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.