MCPInstall

ai-codebase-deep-modules

Design or refactor cohesive modules with small, useful public contracts and enforceable dependency boundaries. Use for concrete architecture, coupling, refactoring, or agent-editability problems. Do not restructure a working codebase merely because an AI agent will edit it.

Installs
89
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/tristanmanchester/agent-skills --skill ai-codebase-deep-modules
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads ai-codebase-deep-modules automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Deep modules and fast feedback

Hide meaningful complexity behind a contract that lets callers do useful work. The objective is lower cognitive/change cost with preserved behaviour, not more folders, a prescribed export count, or an abstraction around every function. Agent productivity is a hypothesis to measure, not a benefit proved by the tree shape.

Inspect a real change path

Start from the task and trace the relevant entry point through domain policy, state/data ownership, side effects, callers, and tests. Read actual dependencies, not only README architecture. Identify which information callers must know and which coordinated edits recur. A large file can be cohesive; a tiny wrapper can leak a complicated protocol. Do not equate lines of code with module depth.

State the behaviour to preserve, the specific coupling or duplication to remove, and the smallest proposed seam. For a review, deliver actionable findings. For an implementation request, make the coherent patch and tests; do not stop at a mandatory nine-section architecture plan. Use the existing plan asset only when a substantial design decision needs it.

Design the contract around ownership

Define operations, input/output types, errors, state transitions, resource ownership, lifetime, authority, and concurrency/cancellation semantics. Keep invariants with the module that owns them. Separate validation at an external boundary from already- validated internal values without duplicating defensive checks everywhere.

Expose domain operations rather than a bag of internals or a universal manager. A public entry point can be a useful convention, but several intentional surfaces may better fit types, platform adapters, lazy loading, or server/client boundaries. Avoid a giant root barrel that changes import side effects or bundles server-only code into a client. Preserve the language/framework's actual loading contract.

Draw an explicit dependency direction. A direct acyclic dependency through another domain's public contract can be simpler than a new event bus. Use inversion when the dependency/ownership problem calls for it, and events when temporal decoupling is actually useful. Events add delivery, ordering, idempotency, and observability obligations; they do not make coupling disappear. Keep shared code genuinely shared, not the destination for every disputed type.

Enforce and test the seam

Read boundary enforcement before writing a lint rule. A rule must distinguish a module using its own internals from a foreign consumer crossing that boundary. Test allowed and forbidden imports through every supported spelling/resolver. Filenames, all, and grep are conventions/signals, not universal privacy or security mechanisms.

Create behavioural tests at the public boundary, including meaningful failure, empty/boundary data, state/restart, cancellation, and concurrency cases where applicable. Retain focused internal tests when they diagnose important algorithms. Mocks of the implementation's own call sequence do not prove its contract; a test that the stub returns not-implemented does not implement the domain behaviour.

Use the fastest relevant test/lint/typecheck first, then the actual build/integration path touched by the refactor. Measure feedback cost and correctness, not a fixed quota of mocks or files. Read testing and feedback for a deeper checklist, adapting it to the project's tooling and risks.

Refactor as one coherent change

Use the existing module examples as sketches, not scaffolding to install unchanged. Update the interface, implementation, consumers, dependency rules, and tests together. Do not create compatibility aliases, dead wrappers, speculative exports, or a second implementation when no consumer contract requires them. A destructive data/schema transition still needs an explicit rollout/recovery plan; removing source compatibility is not permission to lose data.

The old scaffold_deep_module.py is removed. It interpolated unchecked names into paths/source, skipped existing files while reporting them as created, and generated placeholder APIs/tests rather than a useful domain contract. Create the actual requested files through the normal reviewed patch workflow. No replacement CLI is needed to make four empty files.

Deliver evidence

Explain the seam, what it hides, dependencies it permits, and why it reduces the specific change burden. Report tests actually run and unresolved integration risks. Do not claim architecture enforcement because one import example fails, or that agent speed improved without a comparative task measurement. Keep project-specific assumptions explicit and avoid a blanket clean-architecture rewrite.

References are relative to this installed skill, not target-project folders. Authoring baseline reviewed 2026-09-13: https://agentskills.io/specification. Current language/linter sources are recorded in the boundary reference.

FAQ

What does the ai-codebase-deep-modules skill do?

Design or refactor cohesive modules with small, useful public contracts and enforceable dependency boundaries. Use for concrete architecture, coupling, refactoring, or agent-editability problems. Do not restructure a working codebase merely because an AI agent will edit it.

How do I install ai-codebase-deep-modules?

Run npx skills add https://github.com/tristanmanchester/agent-skills --skill ai-codebase-deep-modules in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ai-codebase-deep-modules/ (personal) or .claude/skills/ai-codebase-deep-modules/ (project).

Which AI agents can use ai-codebase-deep-modules?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is ai-codebase-deep-modules safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains ai-codebase-deep-modules?

It is published by tristanmanchester in tristanmanchester/agent-skills. It has 89 recorded installs.

More from tristanmanchester/agent-skills

View all →

designing-beautiful-websites

tristanmanchester/agent-skills

Design, implement, or critique website and web-app UX/UI: information structure, user flows, responsive layouts, visual systems, content, and interaction states. Use for a requested interface or visual-design change; do not expand a small component edit into an unrequested product redesign.

Frontend & Design2.8K installs

reddit-readonly

tristanmanchester/agent-skills

Browse and search Reddit in read-only mode using public JSON endpoints. Use when the user asks to browse subreddits, search for posts by topic, inspect comment threads, or build a shortlist of links to review and reply to manually.

Marketing & SEO432 installs

animating-react-native-expo

tristanmanchester/agent-skills

Implement and debug React Native or Expo motion with Reanimated 4 and Gesture Handler 3: state transitions, layout, gestures, scroll, worklets, cancellation, and accessible alternatives. Use for native UI motion, not web Motion or a reason to add canvas graphics to ordinary views.

Mobile416 installs

styling-nativewind-v4-expo

tristanmanchester/agent-skills

Set up, repair, and build components with NativeWind v4 and Tailwind CSS v3 in Expo React Native apps. Use for an explicitly v4 project, v4 configuration failures, className interoperability, or v4 theming; not for NativeWind v5 or generic web Tailwind setup.

Frontend & Design410 installs

nextjs-framer-motion-animations

tristanmanchester/agent-skills

Implement and debug Motion for React in Next.js: local interaction, presence, layout, shared elements, scroll, reduced motion, and router integration. Use for explicit Motion/Framer Motion work or interactions that need it; prefer CSS for simple effects and framework-native view transitions for supported route cases.

Frontend & Design177 installs

react-native-skia

tristanmanchester/agent-skills

Build, debug, or profile React Native Skia canvases, paths, rich text, shaders, images, snapshots, video, and animated graphics. Use when Skia is selected or custom drawing is needed. Do not introduce a canvas merely because ordinary native UI should look polished or animate smoothly.

Frontend & Design119 installs

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.