skills/improve-codebase-architecture/SKILL.md
--- name: improve-codebase-architecture description: Scan a repo for shallow modules and propose consolidations into deeper ones. Ousterhout's deep-modules principle applied to AI-friendly codebases (better feedback loops, easier delegation, fewer parallel-agent collisions). Standalone skill; can run on any repo. Use when a codebase feels hard for agents to work in, when modules feel too small, or before starting a Pocock Flow on a repo you haven't shaped yet. Triggers on "deepen modules", "impr
npx skillsauth add RonanCodes/ronan-skills skills/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.
Matt Pocock's "one thing to take away" pitch: scan your repo for shallow modules and propose how to deepen them. Deep modules (small interface, large behaviour) are easier to test, easier to delegate to agents, and produce fewer merge conflicts when multiple agents work in parallel.
docs/architecture/module-audit.md (with --write).This skill is read-only by default. It proposes; the human (or a follow-up Ralph run) does the actual refactoring.
/improve-codebase-architecture [--repo <path>] [--write] [--target <subdir>]
Defaults:
--repo: current directory (resolved via git rev-parse --show-toplevel).--write: off; pass to persist the report.--target: scans everything; pass a subdirectory to scope the audit.Walk the source tree. Per language:
.ts / .tsx file is a module candidate. Group by directory for higher-level modules..py file; group by package..go file; group by package.mod declaration.For each module:
A rough heuristic:
depth_score = behaviour_size / max(interface_size, 1)
depth_score >= 8: deep. Good shape.4 <= depth_score < 8: medium. Probably fine.depth_score < 4: shallow. Flag for review.This heuristic is rough on purpose. Don't treat the number as truth; use it to surface candidates.
For each cluster of shallow modules that share callers or call each other heavily, propose a consolidation:
SHALLOW CLUSTER A
- utils/format-currency.ts (3 exports, 18 lines)
- utils/format-date.ts (4 exports, 22 lines)
- utils/format-percent.ts (2 exports, 14 lines)
PROPOSED DEEP MODULE: utils/format.ts
Single export: format(value, type)
Internal: all current helpers as private functions
Test boundary: one integration test per format type
For each proposal, include:
Matt's killer example was wrapping a whole subsystem (browser video editor, front end to back end) in one deep module using a discriminated union between layers. Look for similar patterns:
client/ and server/ but conceptually represents one operation.These are the highest-leverage refactors. Flag them at the top of the report.
docs/architecture/module-audit.md:
# Module Audit, YYYY-MM-DD
## Summary
- N modules analysed
- M flagged as shallow (depth_score < 4)
- K proposed consolidations
## High-leverage refactors (perfect-fit candidates)
...
## Shallow clusters
...
## Already-deep modules (kept for reference)
...
## How to act on this
1. Pick one proposed consolidation.
2. Run /matt-pocock-coding-workflow with the consolidation as the brief.
3. Re-run /improve-codebase-architecture after to confirm the depth_score improved.
llm-wiki-ai-research:deep-modules-for-aitesting
--- name: linear-pipeline description: The Fable orchestrator for a single dispatched Linear ticket. Holds almost no context itself; it receives `--issue <ID> --detached`, decides the stage sequence, and fans out a sub-agent per stage, passing forward only each stage's artifact (never re-derived, never inlined into its own context). Step zero, before any planning or stage routing, is a boundary triage against `canon/security-boundary.md` (#199): a match tags Ronan Connolly and stops the run, no
development
--- name: in-your-face description: Capture a chat-only answer into a durable artifact (markdown + HTML, PDF when cheap) and launch it automatically so the user cannot miss it. Use when user says "in your face", "don't let me lose this", "save that answer", "make that durable", or right after answering a substantive side question (a recipe, comparison, how-to, or generated prompt) that would otherwise die with the context. category: workflow argument-hint: [--no-open] [--vault <short>] [hint of
tools
One-shot headless OpenAI Codex CLI calls for background/admin AI tasks — summaries, classification, extraction, admin glue. The default engine for anything that runs AI constantly in the background (daemon-driven, per-event), because it bills the flat ChatGPT subscription instead of Claude usage or per-token API spend, and it keeps working while Claude is rate-limited. NEVER for coding — coding stays Claude. Use when a skill or daemon needs a cheap always-on AI call, when the user says "use codex", "ask codex", "codex as backup", or when building a background summarizer/classifier into a listener or loop. Reads auth from ~/.codex/auth.json (ChatGPT account, no API key).
research
Turn a warranty rejection, repair quote, or RMA email into a cited decision brief — legal read (NL/EU consumer law), is the part user-serviceable, live part and new-unit prices, repair-vs-DIY-vs-new economics, before-you-send-it checklist, deadlines. Use when the user pastes or screenshots a repair quote, warranty rejection, "not covered" email, onderzoekskosten fee, or asks "should I repair or replace this".