improve-codebase-architecture
Skill4 starsChanged 3 months agoApache-2.0View on GitHub
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick. Use when the user says architecture review, codebase health, deepening, refactor suggestions, or complains about architectural friction.
195 other projects use a version of this, 158 of them edited.
Adopted by
Most recently taken up by
- quarkiverse/quarkus-reactive-messaging-nats-jetstreamedited, first seen Nov 30, 2026
- Rain-kl/OpenFlareedited, first seen Nov 30, 2026
- Forget-C/Jellyfishedited, first seen Nov 29, 2026
- ctaxnagomi/agent-kd-skilltheir own version, first seen Nov 29, 2026
- karanmrn/karanagentskillsedited, first seen Nov 29, 2026
- karanmrn/kstackedited, first seen Nov 29, 2026
Used with
Projects with it also use writing-beats, migrate-to-shoehorn and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
LesaniSkillwriting-beats
Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.
Also in 83 projects that use this
simo97Skillmigrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Also in 88 projects that use this
simo97Skillrequest-refactor-plan
Use this skill when user wants to create a refactor plan.
Also in 45 projects that use this
FabienDehopreSkilldecision-mapping
Turn a loose idea into a sequenced map of investigation tickets, then drive them to resolution one at a time.
Also in 8 projects that use this
LesaniSkillwriting-shape
Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.
Also in 79 projects that use this
liufeng1976Skillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 54 projects that use this
- +2 more from simo97
Other versions195 projects use a version of this.
Word for word · 0
None found.
Edited · 158
- mattpocock/skills★ 335k55% same
- danny-avila/LibreChat★ 48k60% same
- LibreChat-AI/LibreChat★ 48k60% same
- QuivrHQ/quivr★ 40k58% same
- The-Vibe-Company/quivr★ 40k58% same
- windmill-labs/windmill★ 19k52% same
- GreyDGL/PentestGPT★ 16k68% same
- humanlayer/humanlayer★ 13k60% same
- mdiri-ai/SoduWork★ 9.1k54% same
- Forget-C/Jellyfish★ 7.5k55% same
148 more not listed
Wrote their own version · 37
- sanity-io/sanity★ 6.4ksame name
- vinvcn/mattpocock-skills-zh-CN★ 6.2ksame name
- openstatusHQ/data-table-filters★ 2.3ksame name
- stevesolun/ctx★ 583same name
- devcxl/mattpocock-skills-zh★ 565same name
- drvoss/everything-copilot-cli★ 49same name
- etr/groundwork★ 45same name
- WenWuZhiDao/mattpocock-skills-zh★ 27same name
- aveproject/ave★ 26same name
- allemaar/open-skills★ 15same name
27 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/lean.mdcCursor rule
- aiops-implementSkill
- aiops-setupSkill
- aiopsSkill
- architect-designSkill
- code-graphSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- exploreSkill
- file-refactorSkill
- gitopsSkill
- grillingSkill
- grill-with-docsSkill
- handoffSkill
- leanSkill
- prototypeSkill
- pruneSkill
- reviewSkill
- tddSkill
- to-issuesSkill
- to-prdSkill
- triageSkill
- ui-mockupSkill
The file
We split this skill into the rules it gives an agent
6 rules. 1 is common, 1 is distinctive, and 4 are very specific to this project.
1
Common
Most of the 187 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
If graphify-out/graph.json exists, tell the user: "代码图谱已就绪(N 个模块),将基于图谱做增强分析。" Then query /code-graph query god-nodes and /code-graph query …
- Very specific: line 25
If no graph exists, tell the user: "未检测到代码图谱,使用有机探索模式。如需更精确的分析,可先运行 /code-graph build(需要先安装 graphify)。" Then fall back to organic …
- Distinctive: line 29
Run 6 perspective agents in parallel using the Agent tool.
- Common: line 75
Do NOT propose interfaces yet.
- Very specific: line 84
Sharpening a fuzzy term during the conversation?: Update CONTEXT.md right there.
- Very specific: line 89
If the user declines /code-graph build, fall back to a single Explore agent for organic exploration — the original behavior.
“Common” is measured: kept by at least 6 in 10 of the 187 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Improve Codebase Architecture
Surface architectural friction and propose deepening opportunities — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
This command is informed by the project's domain model and design-vocabulary.md — use those terms exactly in every suggestion.
The domain language in CONTEXT.md gives names to good seams; ADRs in docs/adr/ record decisions this command should not re-litigate.
Process
1. Graph check (optional)
architecture_health flows run a graph_build phase first (phases.py). If you arrive here without a graph, check for graphify-out/graph.json:
- If
graphify-out/graph.jsonexists, tell the user: "代码图谱已就绪(N 个模块),将基于图谱做增强分析。" Then query/code-graph query god-nodesand/code-graph query communitiesto get the global view. Query specific modules as needed via/code-graph query. - If no graph exists, tell the user: "未检测到代码图谱,使用有机探索模式。如需更精确的分析,可先运行
/code-graph build(需要先安装 graphify)。" Then fall back to organic exploration.
2. Multi-modal sweep
Run 6 perspective agents in parallel using the Agent tool. Each agent queries the code graph from a different angle. See sweep-patterns.md for agent prompt templates.
Structure agent — Identify shallow modules (god-nodes where interface ≈ implementation)
Data-flow agent — Trace cross-module data flow and seam leakage
Change agent — Identify friction from hotspots: high-coupling + high-churn modules
Test agent — Map untested critical seams (high in-degree, zero test coverage)
Security agent — Identify trust boundary violations and auth/business logic mixing
Performance agent — Structural performance risks: broad-state queries, missing cache seams, deep sync chains
3. Cross-validate
Spawn a synthesis agent that receives all 6 perspectives:
- De-duplicate findings (same module flagged by multiple agents = higher confidence)
- Rank by convergence: findings confirmed by 2+ agents rank highest
- Apply the deletion test to the top findings
- Produce a final candidate list (5-10 items)
4. Present candidates as an HTML report
Write a self-contained HTML file to the OS temp directory so nothing lands in the repo. Resolve the temp dir from $TMPDIR, falling back to /tmp (or %TEMP% on Windows), and write to <tmpdir>/architecture-review-<timestamp>.html so each run gets a fresh file. Open it for the user — xdg-open <path> on Linux, open <path> on macOS, start <path> on Windows — and tell them the absolute path.
The report uses Tailwind via CDN for layout and styling, and Mermaid via CDN for diagrams where a graph/flow/sequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS/SVG visuals — use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs/SVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a before/after visualisation. Be visual.
For each candidate, render a card with:
- Files — which files/modules are involved
- Problem — why the current architecture is causing friction
- Solution — plain English description of what would change
- Benefits — explained in terms of locality and leverage, and how tests would improve
- Before / After diagram — side-by-side, custom-drawn, illustrating the shallowness and the deepening
- Recommendation strength — one of
Strong,Worth exploring,Speculative, rendered as a badge - Sweep evidence — which perspective agents flagged this (badge per agent)
End the report with a Top recommendation section: which candidate you'd tackle first and why.
Use CONTEXT.md vocabulary for the domain, and design-vocabulary.md for structure. If CONTEXT.md defines "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service."
ADR conflicts: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly in the card (e.g. a warning callout: "contradicts ADR-0007 — but worth reopening because…"). Don't list every theoretical refactor an ADR forbids.
See HTML-REPORT.md for the full HTML scaffold, diagram patterns, and styling guidance.
Do NOT propose interfaces yet. After the file is written, ask the user: "Which of these would you like to explore?"
5. Grilling loop
Once the user picks a candidate, run the /grilling skill to walk the design tree with them — constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.
Side effects happen inline as decisions crystallise — run the /domain-modeling skill to keep the domain model current as you go:
- Naming a deepened module after a concept not in
CONTEXT.md? Add the term toCONTEXT.md. Create the file lazily if it doesn't exist. - Sharpening a fuzzy term during the conversation? Update
CONTEXT.mdright there. - User rejects the candidate with a load-bearing reason? Offer an ADR, framed as: "Want me to record this as an ADR so future architecture reviews don't re-suggest it?" Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing — skip ephemeral reasons ("not worth it right now") and self-evident ones.
Legacy mode (no code graph)
If the user declines /code-graph build, fall back to a single Explore agent for organic exploration — the original behavior. The HTML report should note that findings are based on exploration only, not structured graph data, and may be less comprehensive.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

