structure-codebase

Design and audit source trees that expose real architectural boundaries and dependency rules.

3|Updated Nov 8, 2014
One-click install
npx skills add https://github.com/mintuz/.dotfiles --skill structure-codebase-mintuz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: structure-codebase
Source: https://github.com/mintuz/.dotfiles/tree/main/agents/.agents/skills/structure-codebase
Command: npx skills add https://github.com/mintuz/.dotfiles --skill structure-codebase-mintuz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Codebases often grow into flat folders, global buckets like utils or services, and cosmetic layers that hide real architectural boundaries. This Skill helps you design, audit, and migrate physical source and package structures so the tree truthfully reflects capabilities, ownership, and dependency direction. ## Core Features & Use Cases - Structure Design & Audit: Produces annotated target trees with placement rules, allowed/forbidden dependency directions, and proportionate enforcement for backends, frontends, BFFs, CLIs, and monorepos. - Hexagonal & DDD Boundaries: Makes ports, adapters, composition roots, and bounded contexts physically visible only when the project has genuinely earned them. - Safe Migration Planning: Provides staged migration sequences with characterization tests, enforcement gates, and deep workspace discovery checks before moving files. - Use Case: Ask it to review a monorepo where all code sits in packages/shared; it will propose a capability-grouped tree with package-role rules, import restrictions, and a step-by-step migration plan. ## Quick Start Use the structure-codebase skill to audit this repository's folder layout and propose an enforceable target source tree with dependency rules.

Frequently Asked Questions about structure-codebase

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

FAQPage Schema
How do I organize a codebase by feature instead of technical layers?

Group files by the behavior or use case that changes together, keeping routes, schemas, tests, and persistence colocated per feature. Avoid global buckets like controllers, services, or repositories that scatter one behavior across the tree.

When should I use hexagonal architecture folder structure?

Use a visible hexagon only when the project explicitly adopts ports and adapters with meaningful provider-free application policy, real port conversations, and test interactors at each port. Simple CRUD, scripts, or provider wrappers do not earn the boundary.

How do I enforce dependency direction between packages in a monorepo?

Combine package manifests, explicit public exports, project references, and architecture tests that validate both source imports and package.json dependencies. For deep workspaces, derive rules from package roles and test recursive discovery at the deepest target path.

What is the safest way to migrate an existing folder structure?

Separate semantic changes from mechanical moves: record the decision, add characterization tests, prepare enforcement, decompose god files, invert leaked dependencies, then reparent packages one capability at a time. Never combine mass moves with behavior changes.

Does domain-driven design require ports and adapters?

No. Bounded contexts define language and model authority while a hexagon defines a technology test wall; the axes are independent. DDD can use context-first organization with explicit public contracts without manufacturing port interfaces.