Scan a codebase for module deepening and refactoring opportunities, generate an interactive HTML report, and grill through selected improvements. Use when the user invokes /improve-codebase-architecture or asks to audit code structure.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# 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 built on a shared design vocabulary:
- consult and apply the `codebase-design` skill (`.agents/skills/codebase-design/SKILL.md`) for the architecture vocabulary (**module**, **interface**, **depth**, **seam**, **adapter**, **leverage**, **locality**) and its principles (the deletion test, "the interface is the test surface", "one adapter = hypothetical seam, two = real"). Use these terms exactly in every suggestion, and don't drift into "component," "service," "API," or "boundary."
- The domain language in `GLOSSARY.md` gives names to good seams; ADRs in `docs/adr/` record decisions this command should not re-litigate.
## Process
### 1. Explore
**Scope before you scan: YAGNI.** Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide *where* to look before you look:
…
The line at the top of this page pins the label git:20261016.0f9b29d, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_3n57y2pc5gmj7phw
GET https://markdownregistry.com/api/v1/resolve?ref=saifallah-star/aegis/improve-codebase-architecture
GET https://markdownregistry.com/api/v1/blob/50dd1be1fb136f5d67483f022f7a5ffac5912871bd3a2fb62dd9bb5423ea87fe
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
saifallah-star/aegis · .agents/skills/ask-matt/SKILL.md · Router to help choose the right skill or engineering workflow for your situation. Use when the user asks for guidance…
saifallah-star/aegis · .agents/skills/codebase-design/SKILL.md · Shared vocabulary and principles for designing deep modules with narrow interfaces. Use when designing module…
saifallah-star/aegis · .agents/skills/diagnosing-bugs/SKILL.md · Disciplined diagnosis loop for hard bugs and performance regressions: reproducible test -> isolate -> hypothesis ->…
saifallah-star/aegis · .agents/skills/domain-modeling/SKILL.md · Actively build and sharpen a project's ubiquitous domain language, glossary, and Architectural Decision Records (ADRs)…
saifallah-star/aegis · .agents/skills/grill-me/SKILL.md · Interview the user relentlessly about a plan, idea, or decision until all branches of the design tree are settled. Use…
saifallah-star/aegis · .agents/skills/grill-with-docs/SKILL.md · Relentless interview session to stress-test and clarify a design or plan while creating GLOSSARY.md and ADRs inline…
saifallah-star/aegis · .agents/skills/grilling/SKILL.md · Core interviewing primitive that maps decisions into a branching design tree, working the frontier one round of…
saifallah-star/aegis · .agents/skills/handoff/SKILL.md · Serialize the active conversation context into a structured handoff document for another agent or future session to…
saifallah-star/aegis · .agents/skills/implement-spec/SKILL.md · Execute an entire spec on an integration branch by coordinating implementer subagents across a ticket task graph…
saifallah-star/aegis · .agents/skills/implement/SKILL.md · Build out work based on a spec or tickets by driving TDD at pre-agreed seams and closing with code review. Use when the…
saifallah-star/aegis · .agents/skills/pr/SKILL.md · Format structured pull request bodies with concise visuals, test verifications, and blast-radius analysis. Use when…
librechat-ai/librechat · .claude/skills/improve-codebase-architecture/SKILL.md · Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you…
danny-avila/librechat · .claude/skills/improve-codebase-architecture/SKILL.md · Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you…
mxyhi/ok-skills · improve-codebase-architecture/SKILL.md · Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you…
asymmetric-al/core · .agents/skills/improve-codebase-architecture/SKILL.md · Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you…
pc-style/x-md · .agents/skills/improve-codebase-architecture/SKILL.md · Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you…
rudycity/superagent · .agents/skills/improve-codebase-architecture/SKILL.md · Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you…
mart337i/odoo-skills · skills/improve-codebase-architecture/SKILL.md · Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in…