improve-architecture

Identifies shallow modules in a codebase and proposes deepening refactors for testability.

1|2|Updated Nov 25, 2017
One-click install
npx skills add https://github.com/asarchami/dotfiles --skill improve-architecture-asarchami
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: improve-architecture
Source: https://github.com/asarchami/dotfiles/tree/main/dot_config/opencode/skills/improve-architecture
Command: npx skills add https://github.com/asarchami/dotfiles --skill improve-architecture-asarchami

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate shallow modules whose interfaces are nearly as complex as their implementations, spreading bugs and knowledge across callers and making testing difficult. This Skill surfaces that architectural friction and proposes deepening refactors that consolidate behaviour behind small interfaces. ## Core Features & Use Cases - Deepening opportunity detection: Explores the codebase with the deletion test and deep-module vocabulary (module, interface, seam, adapter, leverage, locality) to find shallow modules and tightly-coupled packages. - Spec comparison: Compares actual module depth against the intended deep module design documented in spec/specs.md and flags divergence. - Interface design via parallel sub-agents: Generates radically different interface proposals for a chosen candidate using the Design It Twice approach, then compares them by depth, locality, and seam placement. - Dependency-aware testing strategy: Classifies dependencies (in-process, local-substitutable, remote-owned, true external) and recommends ports, adapters, or mocks accordingly. - Use Case: Ask the Skill to review a service package where tests require heavy mocking; it identifies the shallow pass-through modules, proposes a deepened module with a port at the seam, and designs the new interface with in-memory and HTTP adapters. ## Quick Start Ask the assistant to analyze this codebase for shallow modules and propose deepening opportunities using the improve-architecture skill.

Frequently Asked Questions about improve-architecture

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

FAQPage Schema
How do I find refactoring opportunities in a codebase?

Run the Skill's exploration step, which walks the codebase looking for shallow modules, pass-through abstractions, and tightly-coupled packages. It applies the deletion test: if deleting a module would concentrate complexity rather than remove it, that module is a deepening candidate.

What is a deep module in software architecture?

A deep module hides a large amount of behaviour behind a small interface, giving callers leverage and maintainers locality. A shallow module is the opposite: its interface is nearly as complex as its implementation, so it earns little for the complexity it adds.

How does the Skill design a new interface for a refactored module?

It spawns three or more parallel sub-agents, each constrained to produce a radically different interface (minimal surface, maximum flexibility, or optimized for the common caller). The designs are then compared by depth, locality, and seam placement, with an opinionated recommendation.

When should I introduce a port and adapter at a seam?

Introduce a port only when at least two adapters are justified, typically a production adapter and a test adapter. A single-adapter seam is just indirection; the Skill treats one adapter as a hypothetical seam and two as a real one.

Does this Skill modify my spec or ticket files automatically?

No. If a deepened design contradicts the spec's module sketch, the Skill asks before updating spec/specs.md. It only flags impacts on future tickets in spec/tickets.md as a heads-up without changing them.