skills/architecture-deepening/SKILL.md
Proactive architecture improvement: find shallow modules, propose deepening opportunities, design conversation.
npx skillsauth add notque/claude-code-toolkit architecture-deepeningInstall 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.
Find shallow modules and propose deepening opportunities. Not a code review -- does not find bugs or style violations. Finds modules where the interface is too close to the implementation, where users must understand internals to use the API, and where small interface changes would absorb disproportionate complexity.
When to use: After codebase onboarding, before a major feature push, when new contributors report confusion, or when "how do I use this?" questions recur.
Differs from full-repo-review: Full-repo-review finds defects. This skill finds structural improvement opportunities. Pair well: run full-repo-review first to fix defects, then architecture-deepening to raise the bar.
| Signal | Load These Files | Why |
|---|---|---|
| Phase 1, module analysis, vocabulary terms | vocabulary.md | Shared architecture vocabulary: module, depth, seam, leverage, locality, deletion test |
| Phase 2, interface alternatives, parallel exploration | interface-design.md | Parallel sub-agent pattern for exploring alternative interfaces |
| Phase 2-3, dependency analysis, testing strategy | deepening-strategies.md | Dependency categorization, safe deepening patterns, testing strategies |
Execute all three phases in order. Each phase has a gate. The user is a collaborator -- present findings, get input, refine together.
Language-agnostic. Vocabulary and strategies apply to Go, Python, TypeScript, or any codebase with module boundaries.
Goal: Identify shallow modules -- where the interface exposes too much implementation detail.
Step 1: Scope the codebase
If user specified a directory/package, start there. Otherwise, scan for module boundaries.
find . -name "go.mod" -o -name "package.json" -o -name "pyproject.toml" -o -name "__init__.py" -o -name "index.ts" -o -name "mod.rs" 2>/dev/null | head -50
# Exported symbols per package (Go)
grep -rn "^func [A-Z]" --include="*.go" | cut -d: -f1 | sort | uniq -c | sort -rn | head -20
# Public exports (TypeScript)
grep -rn "^export " --include="*.ts" --include="*.tsx" | cut -d: -f1 | sort | uniq -c | sort -rn | head -20
Step 2: Apply shallowness signals
Read references/vocabulary.md for full vocabulary. A module is shallow when:
Score each: HIGH (clear shallowness, high-leverage fix), MEDIUM (some shallowness, moderate leverage), LOW (minor, low impact).
Step 3: Identify seams
For HIGH-scored modules, identify seams -- natural boundaries where the module could absorb more responsibility. See references/vocabulary.md for seam types (data, protocol, temporal).
Gate: At least 3 candidates with shallowness scores and seam analysis. If fewer than 3, document why and proceed.
Goal: Show findings, explore interface alternatives for top candidates.
Step 1: Present findings table
| Module | Depth Score | Shallowness Signal | Seam | Leverage |
|--------|------------|-------------------|------|----------|
| pkg/config | HIGH | Users must know YAML structure to use API | Data seam | High -- 12 callers |
| internal/auth | MEDIUM | Token refresh logic leaks to callers | Protocol seam | Medium -- 4 callers |
For each: what it does today, why it is shallow (cite specific interface elements), where the seam is, the leverage (how many callers benefit).
Step 2: Get user input
Ask which candidates to explore. Do not proceed to interface design without confirmation -- the user knows codebase priorities better.
Step 3: Explore interface alternatives
Read references/interface-design.md and references/deepening-strategies.md. Design 2-3 alternative interfaces per candidate:
Gate: At least 2 alternatives per selected candidate. User confirmed candidates. Each alternative includes deletion test result.
Goal: Grill the chosen approach until the best deepening emerges. Collaborative design, not presentation.
Step 1: Challenge each alternative
references/deepening-strategies.md.Step 2: Iterate until convergence
Continue until:
No fixed round count. Each round should narrow the design space. If not converging, surface it: "We have been going back and forth on X -- should we pick one, or is this a sign the deepening is not worth it?"
Step 3: Document the decision
## Deepening Decision: {module name}
**Current interface**: {what callers see today}
**Proposed interface**: {what callers would see after}
**What moves behind the interface**: {details callers no longer manage}
**Deletion test**: {what caller code can be removed}
**Migration path**: {incremental adoption plan}
**Trade-offs accepted**: {flexibility traded for simplicity}
**Next step**: {specific first action -- "create ADR", "prototype in branch", "discuss with team"}
If user wants to formalize, suggest pairing with adr-consultation.
Gate: Design conversation completed. Decision documented with all fields. Next step identified.
| Error | Cause | Solution | |-------|-------|----------| | No shallow modules found | Well-structured or too small codebase | Valid outcome. Suggest re-running after next major feature. | | Too many candidates | Pervasive shallowness | Focus on 5 highest-leverage (most callers benefit). Split into sessions by subsystem. | | User disagrees with assessment | Model misjudged boundaries or caller patterns | Ask user to explain design intent. Complexity may be intentional (performance, backward compatibility). | | Design conversation does not converge | Fundamental trade-off disagreement | Surface explicitly. Suggest prototyping both in separate branches. |
documentation
Document translation: quick/normal/refined modes with chunked parallel subagents and glossary support.
development
AI image generation: Gemini and Nano Banana backends; single/series/batch workflows with prompt-to-disk.
testing
Unified voice content generation pipeline with mandatory validation and joy-check. 13-phase pipeline: LOAD, GROUND, STATS-CHECKPOINT, GENERATE, HOOK-GATE, VALIDATE, REFINE, VARIETY-GATE, JOY-CHECK, ANTI-AI, CLOSE-GATE, OUTPUT, CLEANUP. Use when writing articles, blog posts, or any content that uses a voice profile. Use for "write article", "blog post", "write in voice", "generate content", "draft article", "write about".
documentation
Critique-and-rewrite loop for voice fidelity validation.