structure-codebase
БесплатноБез исполняемых скриптовНе проверенDesign, audit, and evolve physical source and package structures that expose real architectural boundaries while keeping related behavior together. Use when…
от citypaul★ 764 звезды на GitHubОб этом скилле
Structure Codebase
Design the source tree as a truthful map of meaning, ownership, runtime boundaries, and change cohesion. Do not start from a universal template. Select the lightest structure that makes this project's real seams easy to see and mechanically difficult to violate.
Use this skill for physical placement and dependency enforcement, including audits specifically about source trees, folders, packages, exports, or import direction. Load codebase-design when the question is which coherent responsibility and caller-facing contract a module should own; load improve-codebase-architecture when the unresolved question is which broader architecture investment is worth making and why now. Load reduce-system-complexity when a flatter tree is intended to support an evidence-backed claim that real dependencies, hops, states, or operational mechanism disappeared—a physical move alone is not reduction. Load evaluate-existing-solutions only when monorepo, build, workspace, or boundary-enforcement tooling is materially unresolved. Load hexagonal-architecture for port and adapter implementation, and domain-driven-design for domain modeling. Those patterns are independent; never infer that using one requires the other.
Read the relevant reference before producing a target tree:
- Read
references/visible-hexagon.mdfor a ports-and-adapters backend, DDD plus hexagonal architecture, or questions about ports, test actors, read models, and package isolation. - Read
references/backend-patterns.mdfor a BFF, ordinary feature-first service, framework-constrained backend, operational tool, CLI, or small package. - Read
references/frontend-patterns.mdfor a frontend, design system, client-side feature architecture, meta-framework UI, or full-stack request. - Read
references/enforcement-and-migration.mdbefore moving existing code, changing package depth, or designing import/package enforcement. - Read
references/research-notes.mdwhen explaining named approaches or source rationale.
Core Model
Read a well-structured codebase from broadest meaning to narrowest detail:
- Product or capability — why the code exists and who owns it.
- Architectural boundary — inside versus outside, but only when that boundary is real.
- Feature, domain concept, use case, workflow, or endpoint — what changes together.
- Implementation detail — framework, persistence, SDK, protocol, and small helpers.
Treat “screaming architecture” as a fitness question, not a folder taxonomy: can a newcomer tell what the system does? Technical names such as hexagon, adapters, driving, driven, and composition are useful at real seams. They are harmful only when they replace product meaning or claim boundaries that do not exist.
Folder names make claims. Packages, exports, imports, tests, and automated boundary rules prove them.
Keep the Axes Distinct
| Axis | It answers | Do not confuse it with |
|---|---|---|
| Capability | Why does this code exist and change? | A technical layer |
| Bounded context | Where does language and model authority change? | A noun, table, team label, or folder of convenience |
| Hexagon | What policy must remain independently testable from external technology? | DDD, a generic core, or every pure library |
| Feature/use case | What behavior changes together? | A required package or bounded context |
| Endpoint | Where does a BFF request enter? | The owner of shared workflow state |
| Package/module | What boundary can tooling enforce? | A business boundary by itself |
| Composition root | Where is the runtime object graph constructed and owned? | A mandatory folder in every library |
Workflow
1. Preserve the Requested Scope
Determine whether the user asked for an audit, proposal, migration plan, or implementation. Do not move files for a suggestion-only request. Do not broaden a folder change into a domain redesign without authorization.
2. Inspect Before Naming
Read enough of the actual system to avoid designing from filenames alone:
- Project rules, architecture decisions, glossary, roadmap, and package index.
- Routes, screens, commands, jobs, components, state/data owners, tests, public exports, and user-facing language.
- Package manifests, source imports, runtime/deployment units, and provider dependencies.
- Framework-required locations, generated code, workspace globs, build/test configuration, and boundary tooling.
- Recent changes or ownership signals that reveal which files change together.
Record uncertainty. Candidate bounded contexts and package splits are hypotheses until language, invariants, ownership, or dependency direction justify them.
3. Select the Smallest Honest Shape
| Project signal | Primary shape | |------
Установить structure-codebase в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл structure-codebase?
Design, audit, and evolve physical source and package structures that expose real architectural boundaries while keeping related behavior together. Use when creating or reviewing repository trees, deciding where files or packages belong, reducing flat folders, organizing by feature, route, screen, use case, bounded context, workflow or endpoint, structuring frontend state/data/UI ownership and design systems, making hexagonal inside/outside boundaries visible, locating ports, adapters and composition roots, structuring BFF routes, planning folder migrations, or enforcing package and import direction. For one module's logical responsibility, deepening, splitting, or caller contract use codebase-design; for repository-wide architecture investment discovery use improve-codebase-architecture. A physical flattening alone is not a reduce-system-complexity result.
Как установить скилл structure-codebase?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл structure-codebase запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic