improve-codebase-architecture

Identify shallow-module patterns and propose interface-deepening refactors.

Updated May 11, 2026
One-click install
npx skills add https://github.com/IsKenKenYa/Commory --skill improve-codebase-architecture-iskenkenya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/IsKenKenYa/Commory/tree/main/.windsurf/skills/improve-codebase-architecture
Command: npx skills add https://github.com/IsKenKenYa/Commory --skill improve-codebase-architecture-iskenkenya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you find and fix architectural “shallow module” patterns that hide complexity in the wrong places, making refactors harder, tests brittle, and AI navigation through the codebase less reliable.

Core Features & Use Cases

  • Deepening opportunities: Identifies modules/interfaces that lack leverage and recommends refactors that concentrate knowledge and change (locality) at a stable interface.
  • Seam- and adapter-driven design: Frames improvements around seams and adapters so behavior can vary across seams while preserving a single deep module behind a clean interface.
  • Testability as an outcome: Guides you to replace shallow-module tests with tests at the deepened module’s interface, so behavior is validated through observable outcomes rather than internal structure.

Use cases:

  • Refactoring a tangled area where understanding one concept requires bouncing across many small modules.
  • Consolidating tightly coupled code so dependencies become replaceable (e.g., in-memory adapters for tests).
  • Improving maintainability by making interfaces the “test surface” and reducing brittle test expectations tied to implementation details.

Quick Start

Ask the AI to run an architecture deepening exploration for the part of the repository involved in “authentication and import” and present the top candidates with file-level friction notes and proposed deepening directions.

Frequently Asked Questions about improve-codebase-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor shallow modules to improve codebase architecture?

To refactor shallow modules, you identify architectural patterns that hide complexity in the wrong places and propose refactors that increase interface leverage. This process concentrates knowledge at stable interfaces, making tightly coupled modules easier to maintain and AI-navigable.

What is the best way to improve testability in tightly coupled code?

Improving testability in tightly coupled code is best achieved by introducing seams and adapters. This allows behavior to vary across seams while preserving a deep module behind a clean interface, enabling you to validate behavior through observable outcomes rather than brittle internal structures.

How do seams and adapters help with module design refactoring?

Seams and adapters help module design refactoring by allowing behavior to vary across boundaries without altering the core deep module. Using adapters enables replacing dependencies with in-memory versions for tests, ensuring your test surface remains the interface rather than implementation details.

When do I need architecture deepening for my codebase?

You need architecture deepening when understanding a single concept requires bouncing across many small, tightly coupled modules. It is necessary when shallow module patterns make refactors harder, tests brittle, and AI navigation through the codebase less reliable due to friction.

Can I use ADRs to guide codebase refactoring?

Yes, you can use Architecture Decision Records to guide codebase refactoring. The workflow reads your domain vocabulary and ADRs to explore the codebase for friction, ensuring proposed deepening candidates align with established design decisions before creating new interfaces.

Why does understanding one concept require bouncing across many small modules?

Bouncing across many small modules happens due to shallow module patterns that hide complexity in the wrong places. This architectural friction scatters knowledge, reduces interface leverage, and makes codebase navigation unreliable, requiring consolidation into deeper, more cohesive modules.