improve-codebase-architecture by mattpocock/skills
npx skills add https://github.com/mattpocock/skills --skill improve-codebase-architecture像 AI 一样探索代码库,发现架构上的摩擦点,寻找提升可测试性的机会,并提出深化模块的重构方案,作为 GitHub 议题的 RFC。
一个深模块(John Ousterhout,《软件设计哲学》)拥有一个小的接口,隐藏了庞大的实现。深模块更具可测试性,更易于 AI 导航,并允许你在边界而非内部进行测试。
使用 Agent 工具并设置 subagent_type=Explore 来自然地浏览代码库。不要遵循僵化的启发式方法——有机地探索并记录你遇到摩擦的地方:
你遇到的摩擦就是信号。
提出一个编号的深化机会列表。对于每个候选方案,展示:
不要立即提出接口。询问用户:“你想探索其中的哪一个?”
在生成子代理之前,为选定的候选方案撰写一份面向用户的问题空间说明:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
向用户展示此说明,然后立即进入第 5 步。用户在子代理并行工作的同时阅读和思考问题。
使用 Agent 工具并行生成 3 个或更多子代理。每个子代理必须为深化后的模块生成一个截然不同的接口。
为每个子代理提供一个独立的技术简报(文件路径、耦合细节、依赖类别、隐藏的内容)。此简报独立于第 4 步中面向用户的说明。为每个代理指定不同的设计约束:
每个子代理输出:
依次展示设计,然后用文字进行比较。
比较之后,给出你自己的建议:你认为哪个设计最强,以及原因。如果不同设计中的元素可以很好地结合,提出一个混合方案。要有主见——用户想要一个强有力的解读,而不仅仅是一个菜单。
使用 gh issue create 创建一个重构 RFC 作为 GitHub 议题。使用 REFERENCE.md 中的模板。在创建之前不要要求用户审阅——直接创建并分享 URL。
每周安装量
3.8K
代码仓库
GitHub 星标数
9.5K
首次出现
11 天前
安全审计
安装于
codex3.7K
opencode3.7K
cursor3.7K
github-copilot3.7K
gemini-cli3.7K
amp3.7K
Explore a codebase like an AI would, surface architectural friction, discover opportunities for improving testability, and propose module-deepening refactors as GitHub issue RFCs.
A deep module (John Ousterhout, "A Philosophy of Software Design") has a small interface hiding a large implementation. Deep modules are more testable, more AI-navigable, and let you test at the boundary instead of inside.
Use the Agent tool with subagent_type=Explore to navigate the codebase naturally. Do NOT follow rigid heuristics — explore organically and note where you experience friction:
The friction you encounter IS the signal.
Present a numbered list of deepening opportunities. For each candidate, show:
Do NOT propose interfaces yet. Ask the user: "Which of these would you like to explore?"
Before spawning sub-agents, write a user-facing explanation of the problem space for the chosen candidate:
Show this to the user, then immediately proceed to Step 5. The user reads and thinks about the problem while the sub-agents work in parallel.
Spawn 3+ sub-agents in parallel using the Agent tool. Each must produce a radically different interface for the deepened module.
Prompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category, what's being hidden). This brief is independent of the user-facing explanation in Step 4. Give each agent a different design constraint:
Each sub-agent outputs:
Present designs sequentially, then compare them in prose.
After comparing, give your own recommendation: which design you think is strongest and why. If elements from different designs would combine well, propose a hybrid. Be opinionated — the user wants a strong read, not just a menu.
Create a refactor RFC as a GitHub issue using gh issue create. Use the template in REFERENCE.md. Do NOT ask the user to review before creating — just create it and share the URL.
Weekly Installs
3.8K
Repository
GitHub Stars
9.5K
First Seen
11 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex3.7K
opencode3.7K
cursor3.7K
github-copilot3.7K
gemini-cli3.7K
amp3.7K
97,600 周安装