improve-codebase-architecture
扫描代码库中的深化机会,生成可视化 HTML 报告,然后围绕你选中的候选项继续追问。
Skill by vinvcn
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/vinvcn-improve-codebase-architecture
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, refactoring
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/improve-codebase-architecture
What's inside
- Skill name
improve-codebase-architecture- Description
- 扫描代码库中的深化机会,生成可视化 HTML 报告,然后围绕你选中的候选项继续追问。
- License
- MIT
- Instructions
- 67 lines in SKILL.md · view on GitHub
Files (3)
- HTML-REPORT.md
- SKILL.md
- openai.yaml · agents/
SKILL.md (first lines)
# 改进代码库架构 暴露 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"。 - `GLOSSARY.md` 中的 domain language 会为好的 seams 命名;`docs/adr/` 中的 ADRs 记录这个命令不应重新争论的 decisions。 ## 流程 ### 1. 探索 **先划定扫描范围:YAGNI。** 深化 module 的收益在于让未来修改更容易,因此要更关注最近仍在变化的 codebase 区域。开始探索前先决定去哪里看: - 如果用户点名了方向(module、subsystem 或 pain point),就按该方向探索,跳过下面的推断。 - 否则,向前回看一段足够长的 commit history(`git log --oneline`),找出反复出现的 files 和 areas,让这些 hot spots 成为首要关注点。如果变更分散、没有明显 hot spot,再扩大范围。 先读取项目 domain glossary(`GLOSSARY.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. 用 HTML 报告呈现候选项 把 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 Report 末尾包含**首选推荐区**:你会先处理哪个 candidate,以及为什么。 **用 `GLOSSARY.md` vocabulary 表达 domain,用 `/codebase-design` vocabulary 表达 architecture。** 如果 `GLOSSARY.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](HTML-REPORT.md)。 现在不要提出 interfaces。写完文件后问用户:"Which of these would you like to explore?" ### 3. Grilling 循环 用户选中 candidate 后,调用 Skill 工具并指定 `grilling`,与用户走完 decision tree:constraints、dependencies、deepened module 的形状、seam 后面放什么、哪些 tests 能保留。 Side effects 随 decisions 成形而内联发生;调用 Skill 工具并指定 `domain-modeling`,让 domain model 保持最新: - **要用 `GLOSSARY.md` 中不存在的概念命名 deepened module?** 把 term 加入 `GLOSSARY.md`。若文件不存在,按需创建。 - **对话中打磨了 fuzzy term?** 立即更新 `GLOSSARY.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。
From vinvcn/mattpocock-skills-zh-CN, MIT.
More from vinvcn/mattpocock-skills-zh-CN
- 0.848score
git-guardrails-claude-code
vinvcn
设置 Claude Code hooks,在危险 git commands(push、reset --hard、clean、branch -D 等)执行前阻止它们。适用于用户想防止破坏性 git 操作、添加 git safety hooks,或在 Claude Code 中阻止 git push/reset 时。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.844score
diagnosing-bugs
vinvcn
面向棘手缺陷和性能回退的诊断循环。适用于用户说 “diagnose” / “debug this”,或报告某些东西 broken、throwing、failing、slow 时。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
setup-ts-deep-modules
vinvcn
在 TypeScript repo 中接入 dependency-cruiser,让每个 package 成为 deep module:implementation 隐藏在 subfolders 中,只能通过 entry-point files 访问。User-invoked。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
to-tickets
vinvcn
把 plan、spec 或当前对话拆成一组 tracer-bullet tickets,每个 ticket 声明 blocking edges,并发布到已配置的 tracker;本地用每 ticket 一个文件中的文本 edge,真实 tracker 用 native blocking links。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
wizard
vinvcn
生成一个交互式 bash wizard,逐步引导人完成只有他们能执行的手动流程。用于 provisioning 基础设施、设置 credentials 或 CI secrets、走查不熟悉的第三方 dashboard,或运行一次性 migration 或 cutover。对于 agent…
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
code-review
vinvcn
从固定点(commit、branch、tag 或 merge-base)开始,按 Standards(代码是否符合本仓库记录的编码标准?)和 Spec(代码是否符合来源 issue/spec 的要求?)两个轴线审查变更。两个审查会在并行子代理中运行,并并排报告。适用于用户想审查…
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
setup-pre-commit
vinvcn
在当前仓库设置 Husky pre-commit hooks,集成 lint-staged (Prettier)、类型检查和测试。适用于用户想添加 pre-commit hooks、设置 Husky、配置 lint-staged,或在提交时运行格式化、类型检查和测试时。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
translate-skill
vinvcn
将 mattpocock/skills 的内容翻译、刷新或复核到简体中文本地化仓库 vinvcn/mattpocock-skills-zh-CN 时使用这个项目级 skill。适用于 skill files、README content、CLAUDE.md、GLOSSARY.md、docs,以及其他需要保留行为关键…
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.838score
writing-beats
vinvcn
Writing, exploit——把原始素材组装成一段节拍旅程,在某个 beat 依赖一个术语之前先把它 grounded。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.838score
grilling
vinvcn
围绕计划、decision 或 idea 持续追问用户。适用于用户想对自己的思路做压力测试,或使用任何 “grill” 触发措辞时。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.838score
migrate-to-shoehorn
vinvcn
将测试文件从 `as` 类型断言迁移到 @total-typescript/shoehorn。适用于用户提到 shoehorn、想替换测试中的 `as`,或需要局部测试数据时。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.838score
scaffold-exercises
vinvcn
创建包含章节、题目、答案和讲解的练习目录结构,并确保通过 linting。适用于用户想 scaffold exercises、创建 exercise stubs,或设置新的课程章节时。
SkillAFreshness: A★ 5.2KClaude Code +9
Signals
- Stars
- 5,245
- Forks
- 416
- Open issues
- 0
- Last commit (this folder)
- Oct 8, 2026 (20 days ago)
- Last release
- Oct 8, 2026 (20 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from vinvcn
- 0.848score
git-guardrails-claude-code
vinvcn
设置 Claude Code hooks,在危险 git commands(push、reset --hard、clean、branch -D 等)执行前阻止它们。适用于用户想防止破坏性 git 操作、添加 git safety hooks,或在 Claude Code 中阻止 git push/reset 时。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.844score
diagnosing-bugs
vinvcn
面向棘手缺陷和性能回退的诊断循环。适用于用户说 “diagnose” / “debug this”,或报告某些东西 broken、throwing、failing、slow 时。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
code-review
vinvcn
从固定点(commit、branch、tag 或 merge-base)开始,按 Standards(代码是否符合本仓库记录的编码标准?)和 Spec(代码是否符合来源 issue/spec 的要求?)两个轴线审查变更。两个审查会在并行子代理中运行,并并排报告。适用于用户想审查…
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
setup-pre-commit
vinvcn
在当前仓库设置 Husky pre-commit hooks,集成 lint-staged (Prettier)、类型检查和测试。适用于用户想添加 pre-commit hooks、设置 Husky、配置 lint-staged,或在提交时运行格式化、类型检查和测试时。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
setup-ts-deep-modules
vinvcn
在 TypeScript repo 中接入 dependency-cruiser,让每个 package 成为 deep module:implementation 隐藏在 subfolders 中,只能通过 entry-point files 访问。User-invoked。
SkillAFreshness: A★ 5.2KClaude Code +9 - 0.842score
wizard
vinvcn
生成一个交互式 bash wizard,逐步引导人完成只有他们能执行的手动流程。用于 provisioning 基础设施、设置 credentials 或 CI secrets、走查不熟悉的第三方 dashboard,或运行一次性 migration 或 cutover。对于 agent…
SkillAFreshness: A★ 5.2KClaude Code +9
Cite this page
improve-codebase-architecture skill. Agent Mart. https://agentmart.dev/skills/vinvcn-improve-codebase-architecture (last updated 2026-10-24)