When applying this template to a real project, Layer 1 has three components:
Layer 1 Components
- PRD — defines what to build (MVP scope, features, success criteria). Use
templates/PRD-TEMPLATE.md - CLAUDE.md — defines how to build (global rules, tech stack, architecture). Use
/init-c - On-demand context — reference guides, external docs, tool designs (in
reference/)
Creation Order
New (greenfield) projects:
- Create PRD first (research phase — vibe plan to define scope)
- Use PRD to create global rules (CLAUDE.md)
- Create on-demand context from PRD + external sources
- Validate no contradictions between PRD, rules, and context
Existing projects:
- Analyze codebase
- Create global rules (from codebase analysis)
- Create on-demand context
- Validate no contradictions
CLAUDE.md Sections
Your CLAUDE.md should cover these sections. Use /init-c to generate them automatically, or fill in manually.
Always-loaded (in CLAUDE.md via @sections/):
- Core Principles — non-negotiable rules (type safety, KISS, YAGNI)
- Tech Stack — language, framework, package manager, linting, database
- Architecture — directory layout, design patterns, file naming
- Documentation Standards — docstring format
- Logging Rules — structured logging, context fields, exception patterns
- Testing Patterns — test structure, markers, commands, coverage
- Dev Commands — install, run, lint, test commands
- Common Patterns — 2-3 code examples of patterns used throughout
On-demand (in reference/ folder, loaded when needed):
- PRD stored in
reference/PRD.md(loaded when choosing next feature to build) - Task-specific step-by-step guides (e.g.,
reference/api_guide.md) - Detailed patterns only relevant for specific task types
How to load on-demand guides:
- Method 1: Reference in CLAUDE.md — mention the guide and when to read it. Flexible but AI must remember to load it.
- Method 2: Include in slash commands (recommended) — reference the guide in slash command prompts using
@reference/guide.md. Guarantees the guide is loaded for the task. More reliable, better for consistency. - See
templates/COMMAND-TEMPLATE.mdfor how to design commands with the INPUT → PROCESS → OUTPUT framework.
Two-question framework for deciding:
- Is this constant or task-specific? (constant → Layer 1, task-specific → Layer 2)
- Needed every session? (yes → auto-load in sections/, no → on-demand in reference/)
Layer 1 Reconciliation
When using a project template, you must reconcile template rules with your project-specific rules. Use the AI to inspect your PRD, global rules, and on-demand context for contradictions. All Layer 1 artifacts must work together — any inconsistency leads to problems during implementation.
For comprehensive Layer 1 guidance, see reference/global-rules-optimization.md for:
- Modular organization (Version 1 vs Version 2 with @sections)
- The Two-Question Framework for auto-load vs on-demand decisions
- Two methods for loading on-demand reference guides
- 10 recommended CLAUDE.md sections with examples
- Building Layer 1 with AI (two prompts,
/init-ccommand) - Practical exercise: auditing and optimizing a bloated CLAUDE.md