deepen — Claude Code skill: what it does, how to install
Finds shallow modules with bloated interfaces and re-architects them to hide complexity. Run it when your test suite is green and you have token budget left over.
npx skills add JuliusBrussee/cavekit --skill deepen -a claude-codeWhat deepen does
The skill targets shallow modules in files touched by your current task. These are classes or functions whose interfaces demand as much cognitive effort as writing the implementation from scratch, such as pass-through wrappers or methods taking five configuration flags. It tackles strictly one module per pass. Surgical precision prevents messy diff churn across your repository.
The workflow follows five discrete steps: pick the shallowest module, diagnose the defect with line references, research a deeper design, draft spec modifications (§I, §V, and §T), and verify invariants. The skill never silently rewrites files. Instead, it hands the proposed spec edits over to your spec-writing tool. If the codebase-design skill is installed, deepen adopts its vocabulary.
External behavior is strictly preserved throughout the pass. Both before and after the change, your entire test suite must stay green. Running deepen during crunch time or midway through an unfinished feature is a mistake, because it is built solely to drain spare token budget on design debt.
What it helps with
- hide implementation details behind a smaller interface
- eliminate pass-through methods and configuration leakage
- draft §I, §V, and §T edits without altering runtime behavior
- curb change amplification across unrelated files
Example prompts for the agent
- /ck:deepen
- this module feels shallow, pull complexity down
- use spare budget on the codebase to improve module design
How to install deepen
1Skills CLI (Vercel)
npx skills add JuliusBrussee/cavekit --skill deepen -a claude-code2Manually: put the files in place
~/.claude/skills/deepen/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/deepen/
1Skills CLI (Vercel)
npx skills add JuliusBrussee/cavekit --skill deepen -a codex2Manually: put the files in place
.agents/skills/deepen/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add JuliusBrussee/cavekit --skill deepen -a cursor2Manually: put the files in place
.cursor/skills/deepen/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install JuliusBrussee/cavekit deepen2Manually: put the files in place
.github/skills/deepen/SKILL.md1Skills CLI (Vercel)
npx skills add JuliusBrussee/cavekit --skill deepen -a gemini-cli2Platform CLI
gemini skills install https://github.com/JuliusBrussee/cavekit --path skills/deepenManually: put the files in place
.devin/skills/deepen/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add JuliusBrussee/cavekit --skill deepen -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about deepen
How to install deepen in Claude Code?
Run npx skills add JuliusBrussee/cavekit --skill deepen -a claude-code in your terminal.
What does the deepen skill do?
It finds shallow abstractions in touched files and designs a deeper interface to hide implementation details while keeping tests green.
Does deepen rewrite code directly?
No, it drafts structured refactoring edits as §I, §V, and §T blocks and hands them to a spec-writing workflow rather than silently rewriting your files.
Source text
SKILL.md · MIT
--- name: deepen description: | Optional design-improvement pass for when you have spare usage to drain. Finds the shallowest modules in the code the spec touches, researches a deeper design, and proposes refactors that shrink interfaces and hide decisions — behavior held constant, tests green before and after. Proposes §I/§V/§T edits, never silent rewrites. Triggers when the user says "deepen this", "improve the design", "this module feels shallow", "pull complexity down", "use spare budget on the codebase", or invokes /ck:deepen. Leans on the codebase-design skill's deep-module vocabulary when present. --- # deepen — make modules deep **Behavior is sacred: tests green before AND after. Every change shrinks an interface or hides a decision — deepen, don't churn.** A **deep module** hides a lot behind a small interface; a **shallow** one's interface costs as much to use as writing the code yourself. Complexity = dependencies + obscurity, and it compounds. Deepen spends spare usage paying that down *before* it becomes a §B. Run it when the build is green & you have budget to drain — not under deadline. ## WHEN TO DEEPEN - Build is green, tests pass, & you have token budget spare. - A module's interface feels as complex as its implementation (shallow smell). - The same change keeps touching many files (change amplification). - User explicitly asks to improve design quality. ⊥ run mid-feature or under pressure. Deepen is the deliberate pass, not the reflex. ## FIVE STEPS ### 1. PICK THE SHALLOW Scan the modules the spec touches. Rank by shallowness — interface surface vs work done. Pick the **one** worst offender. Tells: - Pass-through method that only forwards to one other (shallow layer). - Caller must set 5 flags right to use it (config leakage). - Same abstraction repeated at two layers (no information hiding). - A `?` or §B that traces back to a confusing interface. One module per pass. Deepening is surgical, ⊥ a codebase sweep. ### 2. DIAGNOSE Name the design defect in caveman, citing file:line: > src/auth/token.go: 6-arg ctor leaks rotation policy to every caller. shallow. Complexity is real only if it shows: change amplification, high cognitive load, or an unknown-unknown (caller must know a hidden fact to call it right). ### 3. RESEARCH THE DEEPENING What does a deeper version look like? Pull a known pattern (hand to **research** for the external case → §R) or derive from the codebase's own better modules. Moves that deepen: - **Pull complexity down** — hide the hard part inside, give callers the simple path. - **Define errors out of existence** — design the interface so the edge can't occur. - **Information hiding** — one decision, one module; callers don't learn it. - **General-purpose interface** over a pile of special-case methods. ### 4. PROPOSE Draft the change as spec edits, not a silent rewrite: - New/simpler §I shape for the module. - §V that locks the deepened invariant so a future build can't re-shallow it. - §T refactor row(s), each citing the §V/§I it serves. Hand to **spec** to write. Show the before/after interface so the user sees the shrink. ### 5. VERIFY BEHAVIOR HELD Refactor ≠ rewrite. Full suite green before you start AND after. A deepening that changes behavior is a feature in disguise — stop, route through `/spec` + `/build`. New interface gets a test proving the old callers still work. ## WHEN TO STOP Done when the chosen module's interface is strictly smaller, its hidden decision no longer leaks, tests are green, and §I/§V record the new shape. One module deepened beats five churned. Budget left → pick the next shallowest, fresh pass. ## BOUNDARIES - ⊥ change behavior. Green before, green after. Pure structure. - ⊥ write SPEC.md. Propose §I/§V/§T; spec writes. - ⊥ deepen more than one module per pass. - ⊥ run under deadline or mid-feature. This is the spare-budget pass. - ⊥ add abstraction for single-use code. A deep module earns its hiding; a speculative one is just more surface.
© JuliusBrussee · MIT · JuliusBrussee/cavekit