improve-codebase-architecture
Analyze a codebase for high-leverage architectural improvements and explain evidence, tradeoffs, and next steps. Use explicitly for architecture audits or deep-module refactoring opportunities.
- License 许可
- MIT
- 所属仓库
- stevesolun/ctx
- 最近更新
- 2026-10-15
- Stars
- ★ 593
- Forks
- 69
01 前言 Front Matter
- name
- improve-codebase-architecture
- description
- Analyze a codebase for high-leverage architectural improvements and explain evidence, tradeoffs, and next steps. Use explicitly for architecture audits or deep-module refactoring opportunities.
02 资源文件 2
- 参考文档agents/openai.yaml170 B
- 参考文档HTML-REPORT.md1.7 KB
03 SKILL.md 正文
Improve Codebase Architecture
Look for architectural friction that a focused structural change could reduce. Favor improvements that shrink interfaces, concentrate related complexity, and make important behavior easier to test and understand.
Scope the investigation
Follow the user's named subsystem or pain point. Otherwise use recent changes, repeated maintenance friction, test difficulty, or dependency structure to select a useful area. Read relevant domain language and ADRs when present so recommendations respect intentional boundaries.
Use the codebase-design skill when its deep-module vocabulary will sharpen the
analysis. Explore independently in parallel only when the repository is large
enough to benefit and the lanes do not duplicate work.
Find evidence
Consider:
- interfaces that expose nearly as much complexity as their implementations;
- behavior spread across modules that change together;
- dependency seams that leak internal details;
- testing that bypasses the real call path because no stable seam exists; and
- repeated wrappers or indirection that add little leverage.
Treat these as prompts for investigation, not violations. Apply the deletion test where useful: would removing a layer concentrate complexity behind a better interface, or merely move it elsewhere?
Present candidates
For each material candidate, cite the affected code and explain:
- the observed friction;
- the structural change being considered;
- expected benefits and tradeoffs;
- evidence that the seam is real rather than hypothetical;
- test impact and migration risk; and
- conflicts with existing decisions.
Rank recommendations by evidence and likely leverage. Keep speculative ideas clearly labeled and avoid proposing a wide refactor solely for aesthetic consistency.
Use prose, a compact table, or diagrams according to what best communicates the relationships. When a visual HTML artifact is useful and authorized, load the HTML report guide.
Explore a selected candidate further only when the user requests it or the current task includes design. Update domain records or ADRs only when those artifacts are in scope and the decision is durable enough to justify them.
04 同仓库更多 Skills
toolbox
Pre/post dev toolbox — named bundles of skills/agents loaded before development work and councils of experts invoked after. Run /toolbox or the toolbox.py CLI to list, activate, initialize, export, import, and validate toolboxes. Invoke at the start or end of a dev session, when setting up a new repo, or when sharing toolboxes with a team.
skill-router
Alive skill router — reads the current project's stack and loads/unloads skills dynamically. Invoke at session start or when project context changes.
repo-stats-autoupdate
Keeps README badge + inline counts in sync with the real number of skills, agents, graph nodes/edges, communities, converted pipelines, and test inventory. Runs automatically on every commit via a git pre-commit hook. Use when the README drifts from reality or before publishing a release.
find-skills
Discover installable agent skills from ctx's shipped Skills.sh catalog, the Skills.sh search API, and the npx skills CLI. Use when a user asks whether a skill exists, wants to add/update a skill, or needs a repeatable procedure for finding candidate skills safely.
no-mistakes
Validate committed feature-branch changes through the no-mistakes pipeline: intent, rebase, review, test, docs, lint, push, PR, and CI. Use when the user asks to run no-mistakes, ship safely, validate before pushing, or gate a change before it reaches upstream.
zoom-out
Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.