Your Project's CLAUDE.md
2 min read
Your Project's CLAUDE.md
The CLAUDE.md you created in Project Kickoff was a placeholder. This is where you replace it with the real thing — a project-specific instruction file that gives Claude Code everything it needs to work consistently on your app across every session.
Run this step after: PRD approved, ADRs decided, design system generated. The Genesis Prompt reads all of those and produces a CLAUDE.md that's genuinely specific to your project — not a template with [TO BE FILLED] sections.
Why CLAUDE.md matters
- Claude Code reads it at the start of every session — it's how Claude knows your stack, conventions, and folder structure without you repeating yourself
- Without a complete CLAUDE.md, Claude makes inconsistent decisions across sessions (uses @Observable in one feature, @StateObject in another)
- A good CLAUDE.md means you spend less time correcting Claude and more time reviewing working code
- It's the difference between Claude as a code generator and Claude as a specialist who knows your codebase
Pre-requisites (do these first)
- docs/prd/prd.md — approved
- docs/adr/ — all ADRs with status Accepted
- docs/design-system/DESIGN-SYSTEM.md — generated and reviewed
- [AppName]/Resources/DesignSystem.swift — exists
- Assets.xcassets colour sets added manually
The Genesis Prompt
Run this in a Claude Code session in your project directory. It reads your actual project documents and generates a CLAUDE.md that's specific to your app — not a generic template.
Read ALL of the following before generating anything:- docs/prd/prd.md- docs/idea/idea-pack.md- docs/adr/README.md- docs/adr/ (all individual ADRs)- docs/design-system/DESIGN-SYSTEM.md
Replace CLAUDE.md at the project root with a complete, project-specific version.Do not use placeholder text or [TO BE FILLED] markers — every section must be specific to this project.Do not ask questions — derive everything from the documents above.
The CLAUDE.md must contain all of the following sections:
---
# [Actual App Name] — Claude Code Instructions
## Project Overview[Specific one-paragraph description of what this app does, who it's for, and what makes it different.Derived from PRD Overview section. Not generic — mentions the actual user persona and core value.]
## Platform- iOS [exact minimum version from ADR-003] minimum deployment target- Swift 6, SwiftUI, Xcode 16+- [iPhone only / Universal — from PRD non-functional requirements]- iOS 26 features allowed behind `#available(iOS 26, *)` with [specific fallback from design system]
## Architecture[Derived from ADRs. List each decision as a concrete rule, not a choice:]- Architecture: [exact pattern from ADR-002] — e.g., "MVVM with @Observable"- All @Observable view models must be @MainActor- State: [exact rules from ADR-003]- Persistence: [exact approach from ADR-004, e.g., "SwiftData for all local data — no Core Data"]- Networking: [exact approach from ADR-005, e.g., "URLSession with async/await — no Alamofire"]- Navigation: [exact structure from ADR-006, e.g., "TabView root with NavigationStack per tab"]- Authentication: [from ADR-007 if applicable, or "No authentication — local-only app"]- Sync: [from ADR-008 if applicable, or "No sync — all data local"]
## Folder Structure[Show the actual folder structure for THIS project based on the PRD features.Use the feature names from the PRD — not generic Feature1, Feature2.]
```[AppName]/├── [AppName]App.swift├── ContentView.swift├── Features/│ ├── [ActualFeature1]/│ │ ├── [Feature1]View.swift│ │ └── [Feature1]ViewModel.swift│ ├── [ActualFeature2]/│ │ ├── [Feature2]View.swift│ │ └── [Feature2]ViewModel.swift│ └── ... (one folder per major PRD feature)├── Core/│ ├── [include subfolders only if PRD requires — e.g., APIClient/ only if networking ADR requires it]│ └── Storage/ (if SwiftData ADR)├── Components/ (reusable SwiftUI views)├── Extensions/ (Swift extensions)├── Resources/│ └── DesignSystem.swift└── Models/ (shared data models)```
## Design System[Derived from docs/design-system/DESIGN-SYSTEM.md:]- Primary colour: [hex] — use DS.Color.primary- Secondary/Accent: [hex] — use DS.Color.secondary- Background: [hex light] / [hex dark] — use DS.Color.background- Surface: [hex light] / [hex dark] — use DS.Color.surface- Typography: SF Pro via Dynamic Type — use .font(.body), .font(.headline) etc — never hardcode sizes- Spacing: always use DS.Spacing.* constants — never hardcode spacing values- Corner radius: always use DS.Radius.* — never hardcode radii- Animations: always use DS.Animation.* — never hardcode durations- Liquid Glass: [specific surfaces from design system doc] — gated with `#available(iOS 26, *)` Fallback: [specific fallback material from design system doc]
## Code Conventions- File names match type names exactly: HomeView.swift contains struct HomeView- One type per file- Every SwiftUI view must have a `#Preview {}` macro at the bottom using the `@Previewable` macro where needed- No force unwrapping (`!`) — use guard let, if let, or `??` with a sensible default- No `try?` silently discarding errors — use typed `AppError` enums- No hardcoded colours, fonts, spacing, or radii — always DS.Color.*, DS.Spacing.*, DS.Radius.*- Accessibility: every interactive element must have an `.accessibilityLabel()`- Dark mode: only use semantic colours (DS.Color.*) and Dynamic Type — never hardcoded values
## Features to Build[Derived from PRD Phased Delivery Plan. List each phase and what it delivers:]Phase 1: [description] — delivers US-001, US-002Phase 2: [description] — delivers US-003, US-004[etc.]
## Commands- Build: `xcodebuild -scheme [AppName] -destination 'platform=iOS Simulator,name=iPhone 16'`- Test: `xcodebuild test -scheme [AppName] -destination 'platform=iOS Simulator,name=iPhone 16'`- Both targets: `xcodebuild test -scheme [AppName] -destination 'platform=iOS Simulator,name=iPhone SE (3rd generation)' -destination 'platform=iOS Simulator,name=iPhone 16 Pro Max'`
## Key Files- App entry point: [AppName]App.swift- Root view: ContentView.swift- Design system: [AppName]/Resources/DesignSystem.swift- PRD (source of truth): docs/prd/prd.md- Acceptance checklist: docs/prd/acceptance-checklist.md- ADRs: docs/adr/- Design system spec: docs/design-system/DESIGN-SYSTEM.md
## What Must Never Change Without an ADR- Minimum iOS version- Persistence approach (SwiftData vs Core Data vs UserDefaults)- Navigation structure (TabView vs single NavigationStack)- Authentication methodThese decisions have downstream consequences. If you think one should change, create a new ADR first.
---
After generating CLAUDE.md, print a brief summary of what changed from the placeholder version and what the 3 most project-specific rules are.Test the completed CLAUDE.md
Start a fresh Claude Code session (do not continue the current one — you want to test that Claude reads CLAUDE.md cold):
# Close current session, open a new oneclaude
# In the new session, test with:Create a new feature called "[any feature from your PRD]" following the project conventions.Claude should immediately:
- Create the correct folder structure (Features/[FeatureName]/[FeatureName]View.swift + [FeatureName]ViewModel.swift)
- Use @Observable and @MainActor on the view model without being told
- Use DS.Color.*, DS.Spacing.*, and DS.Radius.* constants — not hardcoded values
- Include #Preview {} at the bottom of the view file
- Follow the naming conventions from your actual PRD feature names
If the output doesn't match your conventions, the CLAUDE.md is missing something. Update it before starting the build — correcting this later is expensive.
git add CLAUDE.mdgit commit -m "docs: full project CLAUDE.md (genesis prompt)"CLAUDE.md complete. Go to The Build.
Sign up to read the full guide
Free access to all 12 workflow guides. No password needed.