improve-codebase-architecture
Skill8 starsChanged 2 months agoMITView on GitHub
Survey codebases for shallow modules, weak seams, and deepening opportunities, producing a visual report. Use when conducting architectural reviews, identifying design debt, finding deepening opportunities, or preparing codebase refactors — even if the user says \"analyze our architecture\". Do NOT use for basic syntax linting or formatting.
We split this skill into the rules it gives an agent
4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 184 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
External Temp Report: Write the visual report to the OS temporary directory (<tmpdir>/architecture-review-<timestamp>.html) with Tailwind …
- Distinctive: line 17
Before/After Visual Models: Every deepening candidate must feature a clear before/after structural diagram illustrating interface …
- Distinctive: line 45
Key Point: Check for extracted pure functions that lack locality and leak callers' state.
- Very specific: line 52
Action: Write <tmpdir>/architecture-review-<timestamp>.html with Tailwind and Mermaid CDN scripts.
“Common” is measured: kept by at least 6 in 10 of the 184 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
Survey codebases for shallow modules, leaky abstractions, and weak seams, generating an interactive, visual HTML report in the OS temp directory with before/after architectural refactoring models.
Core Invariants
- YAGNI Scope First: Prioritize hotspots in recent commit history (
git log --oneline) where architectural friction is actively slowing development. - Strict Design Vocabulary: Frame all findings using canonical terms (module, interface, depth, seam, adapter, leverage, locality) and domain vocabulary from
CONTEXT.md. - External Temp Report: Write the visual report to the OS temporary directory (
<tmpdir>/architecture-review-<timestamp>.html) with Tailwind CDN and Mermaid diagrams; never litter the repository with review HTML. - Before/After Visual Models: Every deepening candidate must feature a clear before/after structural diagram illustrating interface simplification and implementation depth.
- No Speculative Interface Proposing: Propose candidate problem areas and deepening directions; do not propose concrete code interfaces until the user selects a candidate.
Architecture & Map of Content (MOC)
[ Hotspot & Git Log Analysis ] ──► [ Deepening Candidate Survey ] ──► [ Generate HTML Report in /tmp ] ──► [ Grilling on Chosen Candidate ]| Component | Responsibility | Reference |
| Hotspot Scanner | Identify frequently changed, high-friction files | Git log & subagent exploration |
| HTML Visual Report | Render side-by-side Mermaid & Tailwind cards | skills/improve-codebase-architecture/HTML-REPORT.md |
| Candidate Deepening | Socratic review of selected candidate | skills/grilling/SKILL.md + skills/codebase-design/SKILL.md |
Step-by-Step Procedure (TWI)
Step 1: Scan Recent Codebase Hotspots
- Action: Inspect
git log --oneline -n 100andCONTEXT.mdto identify high-churn modules and domain boundaries. - Key Point: Focus on modules where understanding one concept requires hopping between multiple fragmented files.
- Why: Deepening stable, untouched legacy files yields low ROI compared to active hotspots.
Step 2: Survey Deepening Opportunities
- Action: Evaluate candidate modules using the deletion test and locate shallow pass-throughs.
- Key Point: Check for extracted pure functions that lack locality and leak callers' state.
- Inline Checklist:
- Hotspot files identified from git churn
- 2–4 distinct deepening candidates formulated
- Candidates categorized by recommendation strength (
Strong,Worth exploring,Speculative)
Step 3: Generate Self-Contained Visual HTML Report
- Action: Write
<tmpdir>/architecture-review-<timestamp>.htmlwith Tailwind and Mermaid CDN scripts. - Key Point: Include problem descriptions, leverage/locality benefits, and side-by-side before/after Mermaid diagrams.
- Why: Visual architecture diagrams communicate structural improvements far more effectively than walls of text.
Step 4: Open Report & Facilitate Candidate Selection
- Action: Launch the HTML report via
open <path>(macOS) /xdg-open(Linux) /start(Windows) and ask the user which candidate to explore. - Key Point: Upon selection, enter the grilling loop to settle module boundaries and update
CONTEXT.md/ ADRs. - Why: Collaborative candidate selection ensures team buy-in before investing in refactoring.
Anti-Rationalization Guardrails
| Tempting Rationalization | Binding Rule | Engineering Rationale |
| "Write the HTML review report directly into the repo root." | Write reports exclusively to the OS temp directory. | Review artifacts should never pollute project Git history. |
| "Draft full replacement code files immediately in the report." | Present architectural direction and diagrams first. | Premature coding before agreeing on architectural seams leads to wasted effort. |
| "Re-open settled ADR decisions without strong evidence." | Respect existing ADRs unless severe friction is demonstrated. | Constant relitigation of settled decisions stalls progress. |
Other versions195 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 195
- mattpocock/skills★ 309ksame name
- danny-avila/LibreChat★ 47ksame name
- LibreChat-AI/LibreChat★ 47ksame name
- QuivrHQ/quivr★ 40ksame name
- windmill-labs/windmill★ 18ksame name
- GreyDGL/PentestGPT★ 16ksame name
- humanlayer/humanlayer★ 13ksame name
- sanity-io/sanity★ 6.4ksame name
- ArcReel/ArcReel★ 6ksame name
- vinvcn/mattpocock-skills-zh-CN★ 5.5ksame name
185 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.
Used alongsideProjects with it also use decision-mapping, request-refactor-plan and 3 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.
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
simo97Skillrequest-refactor-plan
Use this skill when user wants to create a refactor plan.
Also in 43 projects that use this
simo97Skilledit-article
The user will invoke this skill to help them edit an article.
Also in 39 projects that use this
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 50 projects that use this
- +1 more from simo97
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-data-remediationSkill
- ai-engineeringSkill
- codebase-designSkill
- code-reviewSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- engineering-workflow-guideSkill
- git-safety-guardrailsSkill
- goalSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- implement-specSkill
- j-spaceSkill
- migrate-to-shoehornSkill
- ml-best-practicesSkill
- prototypeSkill
- researchSkill
- resolving-merge-conflictsSkill
- retroSkill
- scaffold-exercisesSkill
- setup-engineering-workflowsSkill
- setup-pre-commitSkill
- setup-ts-deep-modulesSkill
- skill-conductorSkill
- tddSkill
- teachSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- wayfinderSkill
- wizardSkill
- workflow-designerSkill
- writing-beatsSkill
- writing-for-agentsSkill
- writing-fragmentsSkill
- writing-shapeSkill
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.

