name: architecture-bootstrap description: Bootstrap project architecture governance. Use when the user says "bootstrap architecture", "create ARCHITECTURE.md", "set up codebase structure", or "add architecture governance to project".
Architecture Bootstrap
Use this skill to make architecture placement explicit before implementation agents write files. The goal is a project-specific ARCHITECTURE.md, a reusable per-task PLACEMENT_PLAN.md template, and an optional generator scaffold that makes the correct location the easiest location.
Workflow
Audit the existing structure
- Inspect the project root and
src/tree before proposing rules. - Identify existing layers such as primitives, feature modules, layouts, contexts/providers, shared utilities, tests, and app shells.
- Note ambiguous or overloaded folders instead of silently normalizing them.
- Inspect the project root and
Interview the user with focused Q&A Ask only the questions needed to make placement rules concrete:
- Which layer names should this project use (for example
shared/ui,features/<feature>,layouts,contexts)? - What belongs in each layer, and what must never go there?
- What naming conventions should components, hooks, services, tests, and routes follow?
- Which imports should be forbidden across layers?
- Which paths should generators/scaffolds create by default?
- Which layer names should this project use (for example
Generate
ARCHITECTURE.mdfrom the template- Start from
references/architecture-template.md. - Replace placeholders with project-specific decisions from the audit and Q&A.
- Keep the file concise enough for implementer agents to read before editing.
- Reference ecosystem precedent when explaining why the artifact exists: Cursor Project Rules, Cline Rules + Memory Bank, Devin
AGENTS.md, and Aider conventions all use persistent project rules to keep agents aligned.
- Start from
Generate a per-task placement plan
- Use
references/placement-plan-template.mdwhenever a project already hasARCHITECTURE.mdand the upcoming task creates, moves, or reorganizes files. - The implementer fills
PLACEMENT_PLAN.mdbefore Edit/Write tool use. - The reviewer compares the final diff against the plan and treats unexplained placement drift as a retry condition.
- Use
Optionally install a component generator scaffold
- Copy
references/gen-component-template.mjsinto the project only when the user wants scaffolding. - Customize it to the project-specific
ARCHITECTURE.md; do not pretend one global generator fits every repository.
- Copy
Output
For a bootstrap request, produce:
ARCHITECTURE.mddraft or patch plan.PLACEMENT_PLAN.mdtemplate or first task-specific plan.- Optional customized
gen-component.mjsscaffold. - A short adoption note explaining how implementer and reviewer agents should use the artifacts.