Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

deep-module-design

БесплатноЗапускает вложенные скриптыНе проверен

Design deep modules with small interfaces and rank shallow, pass-through or leaky code for deepening. Use when designing a module interface, improving…

borgheiот borghei★ 1 250 звёзд на GitHub

Об этом скилле

Deep Module Design

Module-level design for code that is getting harder to change. A deep module gives callers a lot of behaviour behind a small interface; a shallow one makes them learn almost as much as it does. This skill measures where a codebase is shallow, ranks the places where deepening would pay back, writes the review, and then designs the replacement interface at least twice before anyone writes it. The goal: callers get a lot done through very little surface, a change stays inside one module, and tests exercise the same interface callers use.

When to use this skill

  • Designing a new module and wanting its interface right before callers multiply
  • "Improve the architecture of this codebase" — find and rank deepening opportunities
  • A change keeps touching five files for one business rule
  • Tests are brittle because they reach past interfaces into internals
  • Layers that only forward calls — services that call repositories that call clients, each adding nothing
  • Choosing between interface proposals for the same module

Inputs the skill expects

  • The code: a path to scan, or the module and its callers for a design task
  • Change history if available (git log), to weight hotspots
  • The project's glossary and recorded decisions, so names and past choices are respected
  • For a design task: the responsibilities the module must own and its dependencies
  • Constraints: public API stability, number of callers, test coverage today

Clarify First

What most shapes the output is whether this is a review of existing code or the design of one module, and how much change the codebase can absorb. Settle the inputs below before producing anything. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

  • Review or design: a review scans and ranks many candidates; a design goes deep on one module and compares interfaces.
  • Scope and hotspots: a named pain point beats a whole-repo scan; without one, change frequency decides where to look.
  • Interface stability: a published library interface rules out merges a private module would allow.
  • Recorded decisions: a candidate that contradicts one is only worth raising if the pain justifies reopening it.

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

Quick Start

# Rank shallow, pass-through and leaky modules in the sample order-management codebase
python3 engineering/deep-module-design/scripts/module_depth.py \
  --input engineering/deep-module-design/assets/sample_codebase.json

# Compare three candidate interfaces for the merged order-intake module
python3 engineering/deep-module-design/scripts/interface_compare.py \
  --input engineering/deep-module-design/assets/sample_designs.json

Workflows

Workflow 1 — Architecture review: scan, rank, report [RECOMMENDED]

The agent finds deepening opportunities, ranks them, and writes a report; it does not propose signatures until a candidate is chosen.

  1. Choose where to look: the requester's named area, or the most-changed paths over six months (the churn one-liner is in references/architecture-review-playbook.md).

  2. Read the glossary and recorded decisions for those areas first.

  3. Run the analyser from the repository root so module names match the churn keys:

    python3 engineering/deep-module-design/scripts/module_depth.py \
      --path . --churn churn.json --format json > depth.json
    
  4. Read each flagged module and its callers. Apply the deletion test: would deleting it concentrate complexity or spread it? Discard acceptable shapes (adapters at real seams, type definitions, framework handlers).

  5. Score the survivors 1–3 on change frequency, pain evidence, locality gain, test gain and migration risk; keep the top 3–5.

  6. Write the report from assets/architecture-review-template.md: friction with evidence, proposed deepening in plain words, leverage and locality gains, test impact, before/after sketch, strength label.

  7. End with one top recommendation and ask which candidate to explore.

Validation checkpoint: every candidate cites evidence (churn, a bug, a duplicated rule), uses glossary names, and states which tests move or get deleted.

Workflow 2 — Interrogate the chosen candidate [RECOMMENDED]

  1. Name the one concept the module will own. If the name needs "and", split it.
  2. List the callers and what the most common one needs.
  3. Classify each dependency: in-process, local stand-in, remote owned, third party (table in references/depth-principles.md).
  4. Place the seam where behaviour varies, and name its two adapters.
  5. Decide which error modes callers must distinguish; translate the rest at the seam.
  6. Record new or sharpened terms in the glossary as they settle; offer to record a lasting r
Полный SKILL.md на GitHub

Установить deep-module-design в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/architecture-review-template.mdassets/interface-design-brief-template.mdassets/sample_codebase.jsonassets/sample_designs.jsonreferences/architecture-review-playbook.mdreferences/depth-principles.mdscripts/interface_compare.pyscripts/module_depth.py

FAQ

Что делает скилл deep-module-design?

Design deep modules with small interfaces and rank shallow, pass-through or leaky code for deepening. Use when designing a module interface, improving codebase architecture, or making code easier to test.

Как установить скилл deep-module-design?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл deep-module-design запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить deep-module-design с