skills/team/improve-codebase-architecture/SKILL.md
Deep module refactoring using APOSD vocabulary: eliminates shallow modules, reduces information leakage, resolves temporal coupling, and aligns naming with the ubiquitous language. Use when asked to "improve the architecture", "refactor this module", "apply APOSD", or "clean up the design". Works best after domain-model is established. Ported from https://github.com/mattpocock/skills (Matt Pocock).
npx skillsauth add michaelalber/ai-toolkit improve-codebase-architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Improve this codebase's architecture using principles from A Philosophy of Software Design (APOSD) by John Ousterhout.
The APOSD module-shape vocabulary this skill names problems with — shallow module, interface,
depth, seam, adapter, leverage, locality — is defined in the codebase-design skill. Load it
when you need the precise definitions or the deepening/design-it-twice procedures.
CONTEXT.md or UBIQUITOUS_LANGUAGE.md — load if present.
These define the canonical vocabulary for all naming decisions.domain-model first for best results."Decide where to look before you look — deepening a module only pays off where change is frequent, so scope before scanning.
git log --oneline -- <path>, or repo-wide)
and rank paths by change frequency. The hot spots are the candidates; let them pull
your attention first. If changes are scattered with no clear hot spot, widen the net.Find the worst offenders first, within the scope set above. Use references/DEEPENING.md
as a checklist.
Shallow modules — interfaces that expose more complexity than they abstract. Red flag: method count approaches implementation line count.
Information leakage — implementation details that escape module boundaries. Red flag: two modules both know about the same data format, error type, or ordering.
Temporal coupling — callers that must invoke methods in a specific order. Red flag: comments like "call init() before use()" or "must call A before B".
Naming mismatches — code symbols that contradict the ubiquitous language.
Red flag: UserManager, DataProcessor, Helper — words that reveal no domain meaning.
For each identified issue:
references/INTERFACE-DESIGN.md patternsPriority order: information leakage → shallow modules → temporal coupling → naming
For every rename proposed:
CONTEXT.md or UBIQUITOUS_LANGUAGE.mdUBIQUITOUS_LANGUAGE.md first, then renamereferences/LANGUAGE.md for naming anti-patterns to avoid## Architecture Review: [Module / Package Name]
**Issues found:** [N]
| Issue | Type | Call sites affected | Effort | Priority |
|-------|------|---------------------|--------|----------|
| [name] | Shallow / Info leak / Temporal / Naming | [N] | S/M/L | P1/P2/P3 |
### Proposed Refactorings
#### [Issue name]
**Type:** [APOSD category]
**Before:**
[current interface]
**After:**
[improved interface]
**Rationale:** [APOSD principle cited]
development
Interviews the user relentlessly about a plan, decision, or idea — one question at a time, each with a recommended answer. Shared engine behind "grill-me" and "grill-with-docs". Use on any "grill" trigger phrase or to stress-test thinking. Do NOT use to build the plan; it ends at shared understanding, not implementation.
testing
Runs a relentless interview to sharpen a plan or design, capturing the decisions as ADRs and a glossary along the way. Use when the user wants to be grilled AND wants the session to leave durable domain documentation behind. Do NOT use for a throwaway stress-test with no artifacts; use grill-me instead.
tools
OWASP-based security review of Vue/TypeScript front-ends. Detects framework (Vite/Vue CLI/Nuxt), entry points, and data flows; scans the OWASP Top 10 (2025) mapped to Vue client-side risks (raw-HTML XSS via v-html, URL/protocol injection, bundled secrets, insecure token storage, dependency CVEs, missing CSP, open redirects, router guard bypass); emits an exec summary plus graded findings. Use to audit Vue for vulnerabilities. Not for architecture grading (vue-architecture-checklist).
tools
Analyzes legacy Vue codebases and produces actionable modernization plans. Primary migration paths include Options API to Composition API, Vue 2 to Vue 3, Vue CLI to Vite, JavaScript to TypeScript, Vue Test Utils/Karma/Mocha to Vitest + Vue Testing Library, legacy Vuex to Pinia, and removed-in-Vue-3 pattern cleanup (filters, event bus, `$listeners`). Does NOT perform the migration — assesses, quantifies risk, and plans.