From odin
Identifies and suggests codebase refactors that turn shallow, high-friction modules into deeper ones using deletion tests and seam analysis. Best for architecture improvement, testability, and agent navigation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/odin:improve-codebase-architectureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Iteration loop: explore for friction, present deepening candidates, grill the chosen one, update domain artifacts inline. Vocabulary is load-bearing — see `references/LANGUAGE.md`.
Iteration loop: explore for friction, present deepening candidates, grill the chosen one, update domain artifacts inline. Vocabulary is load-bearing — see references/LANGUAGE.md.
Use these terms exactly. Do not substitute "component," "service," "API," or "boundary." Full definitions in references/LANGUAGE.md.
First tool call MUST be Explore-agent dispatch — not direct reads. The agent's brief:
CONTEXT.md (or CONTEXT-MAP.md + per-context CONTEXT.md) and any docs/adr/. If absent, proceed silently.Numbered list. Each candidate: Files, Problem (concrete friction; cite deletion test), Solution (plain-English description; no interface yet), Benefits (locality, leverage, testability deltas).
ADR conflicts: surface only when friction warrants reopening; mark explicitly: "contradicts ADR-0007 — worth reopening because…".
Ask: "Which candidate to explore?" Do not propose interfaces yet.
Once user picks, drop into adversarial interview — walk the design tree, resolve dependencies one decision at a time, recommend an answer per question. Side effects happen inline:
CONTEXT.md immediately (lazy create).references/INTERFACE-DESIGN.md — parallel sub-agent design twice (Ousterhout).Full treatment in references/DEEPENING.md. Summary:
| Class | Deepenable? | Test strategy |
|---|---|---|
| In-process (pure / in-memory) | Always | Merge modules; test through new interface directly. No adapter. |
| Local-substitutable (PGLite, in-memory FS) | Yes if stand-in exists | Stand-in runs in tests; seam stays internal. |
| Remote but owned (microservices) | Yes via Ports & Adapters | Port at seam; HTTP/gRPC adapter prod, in-memory adapter test. |
| True external (Stripe, Twilio) | Yes | Injected port; mock adapter for tests. |
Replace, don't layer: delete shallow-module tests once interface tests exist.
Rust — shallow validate_address + format_address + geocode_address separately called by a Shipment aggregator. Deletion test: removing format_address concentrates string-handling at one call site → was a pass-through. Deepen into address::Resolver with resolve(raw) -> Result<Resolved, AddressError>; tests cross the new interface; in-memory Geocoder adapter for tests, HTTP adapter for production.
Python — module exposes parse_invoice, apply_tax, round_total as separate top-level functions; every caller chains all three. Deepen into billing.Invoice.finalize(raw) -> Invoice. Internal seams (tax tables, rounding rules) stay private; the test surface is Invoice.finalize.
references/LANGUAGE.md — full vocabulary, principles, rejected framings.references/DEEPENING.md — dependency taxonomy, seam discipline, replace-don't-layer testing.references/INTERFACE-DESIGN.md — parallel sub-agent "Design It Twice" workflow when the chosen candidate's interface needs alternatives.Forbidden: proposing interfaces in step 2 (premature commitment), bundling unrelated refactors, re-litigating ADRs without a load-bearing reason.
npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odinAnalyzes codebase architecture, identifies shallow modules, and proposes deepening refactors to improve testability and AI-navigability using precise vocabulary (Module, Interface, Depth, Seam, Adapter).
Analyzes codebase architecture to identify shallow modules and propose refactoring opportunities that increase depth, testability, and AI-navigability. Use when improving architecture, finding refactoring candidates, or consolidating tightly-coupled code.
Audits codebase architecture for tightly-coupled modules and suggests refactors toward deep modules with simple interfaces. Use for architectural improvement, refactoring opportunities, or making code more testable.