CLAUDE.md Assembly
Contributed by gokbeyinac
Improved by Laravel Company · 2026-09-07
Improved Prompt:
You are responsible for creating the definitive CLAUDE.md design system reference document for the [Project Name] AI assistant codebase. This markdown file will reside in the project root directory and serve as the single, authoritative source of truth for all AI assistant developers and human contributors working on the codebase.
Input Sources
- Architectural Tokens: The Phase 2 output containing the finalized token architecture for the project.
- Component Documentation: The Phase 3 output providing detailed documentation for each UI component in the system.
- Project Metadata:
- Project Name: [Project Name]
- Tech Stack: [Next.js 14+ / React 18+ / Tailwind 3.x / etc.]
- Node Version: [Node Version]
- Package Manager: [npm / pnpm / yarn]
CLAUDE.md Document Structure
Compile the final CLAUDE.md file with the following sections in this precise order. Each section should be self-contained, readable independently, and link to relevant sections using automatic markdown anchor links.
1. Project Identity (100-200 words)
- Project Name, Description, and Positioning: A clear, concise description of the project's purpose, audience, and unique value proposition.
- Tech Stack Summary: A table listing the primary technologies used in the project, their versions, and their roles in the architecture.
- Directory Structure Overview: A visual representation or brief description of the project's folder structure, highlighting the
srcdirectory and major subdirectories.
2. Quick Reference Card
A two-column table (50% width each) containing the most frequently needed information at a glance:
| Category | Value |
|---|---|
| Primary Colors (Hex) | - Brand: #123456 - Accent: #7890ab - Text: #cdef01 - Neutral: #90a1b2 |
| Font Stack | - Primary: Inter, system-serif - Secondary: Source Sans Pro, system-serif |
| Spacing Scale (px) | 4, 8, 12, 16, 24, 32, 48, 64 |
| Breakpoints (px) | - Small: 640 - Medium: 768 - Large: 1024 - X-Large: 1280 |
| Border Radius | - Small: 2px - Medium: 4px - Large: 8px |
| Shadow Values | - Small: 0 1px 2px rgba(0,0,0,.1) - Medium: 0 2px 4px rgba(0,0,0,.2) |
| Z-Index Map | - Lowest: 10 - Below: 20 - Base: 30 - Above: 40 - Highest: 50 |
3. Design Tokens â Full Reference
Organized by token tier (Primitive â Semantic â Component), each entry in a markdown table:
| Tier | Name | Value | CSS Variable | Tailwind Equivalent |
|---|---|---|---|---|
| Primitive | $color-brand | #123456 | --color-brand | text-brand-500 |
| Semantic | $spacing-xxs | 4px | --spacing-xxs | -- |
| Component | $btn-border-radius | 8px | --btn-border-radius | border-rounded-8xl |
4. Typography System
- Type Scale Table: A table listing font sizes, weights, line heights, letter spacing, and usage contexts for each font size variation.
- Responsive Rules: A description or pseudocode specifying how the font size scales across different viewport sizes.
- Font Loading Strategy: An explanation of the font loading technique (e.g., async, preload, etc.) and any optimization strategies.
5. Color System
- Full Palette: A table listing all color names, hex values, color swatches, and usage contexts.
- Semantic Color Mapping: A table mapping semantic colors (e.g., success, warning) to their corresponding hex values.
- Dark Mode Mapping: If applicable, a table mapping light mode colors to their dark mode equivalents.
- Contrast Ratio Compliance Notes: Detailed notes on contrast ratio calculations and any exceptions or adjustments made to meet accessibility guidelines.
6. Layout System
- Grid Specification: A description of the grid system used (e.g., Flexbox, CSS Grid, etc.) and any specific configuration details.
- Container Widths: A table or list of container widths for different screen sizes.
- Spacing System: A visual representation or table of the spacing system and its usage.
- Breakpoint Behavior: A description of how the layout adjusts at different breakpoints.
7. Component Library
Insert the Phase 3 output for each component, formatted as follows:
Button
- Props:
variant,size,color,disabled, etc. - Usage:
- Primary:
[use for main actions] - Secondary:
[for less important actions]
- Primary:
- CSS Class:
btn(with variants and sizes appended, e.g.,btn-primary-lg) - Code Example:javascript
<Button variant="primary" size="lg" onClick={handleClick}> Save </Button>
8. Motion & Animation
- Named Presets Table: A table listing animation names, durations, easing functions, and usage contexts.
- Rules: Detailed guidelines on when to animate, when not to, and any performance constraints.
- Preset Examples: Code examples or visual representations of the defined animations.
9. Coding Conventions
- File Naming Patterns: The exact naming conventions for components, modules, and other files.
- Import Order: The preferred order for importing dependencies.
- Component File Structure: A template for the structure of each component file.
- CSS Class Ordering: If using Tailwind, the preferred order for applying utility classes.
- State Management Patterns: An explanation of the state management techniques used (e.g., React Context, Redux, etc.).
10. Rules & Constraints
Hard Rules (Never to be Broken): A numbered list of rules that must be followed without exception, such as:
- Color Consistency: "Never use inline hex colors â always reference tokens."
- Accessibility: "All interactive elements must have visible focus states."
- Touch Target: "Minimum touch target size: 44x44px."
- Image Accessibility: "All images must have alt text."
11. Contributors Guidelines (Optional)
Brief instructions for new contributors, including how to make pull requests, the code review process, and any other relevant guidelines.
Formatting and Style Guide
- Tables: Use markdown tables for all token/value mappings, component props, and other data-driven content.
- Code Blocks: Enclose all code examples in markdown code blocks with proper syntax highlighting.
- Line Length: Keep each line of text and each line of code under 100 characters for optimal readability.
- Consistency: Maintain a consistent style throughout the document, following the project's code style guide.
Primary Rule: Authority of the Document
This document must be the absolute, authoritative reference for the design system. If any ambiguity arises between CLAUDE.md and the actual code, CLAUDE.md should always be updated to match the reality of the codebase. This document describes what IS, not what SHOULD BE (which is documented in a separate roadmap or design documentation).
By following this improved prompt, you will create a comprehensive, readable, and authoritative CLAUDE.md document that serves as the single source of truth for the project. The clear structure, detailed instructions, and emphasis on authority ensure that the output will be a valuable resource for the development team.
Original prompt (before our improvements)
You are compiling the definitive CLAUDE.md design system reference file. This file will live in the project root and serve as the single source of truth for any AI assistant (or human developer) working on this codebase. ## Inputs - **Token architecture:** [Phase 2 output] - **Component documentation:** [Phase 3 output] - **Project metadata:** - Project name: ${name} - Tech stack: [Next.js 14+ / React 18+ / Tailwind 3.x / etc.] - Node version: ${version} - Package manager: [npm / pnpm / yarn] ## CLAUDE.md Structure Compile the final file with these sections IN THIS ORDER: ### 1. Project Identity - Project name, description, positioning - Tech stack summary (one table) - Directory structure overview (src/ layout) ### 2. Quick Reference Card A condensed cheat sheet — the most frequently needed info at a glance: - Primary colors with hex values (max 6) - Font stack - Spacing scale (visual representation: 4, 8, 12, 16, 24, 32, 48, 64) - Breakpoints - Border radius values - Shadow values - Z-index map ### 3. Design Tokens — Full Reference Organized by tier (Primitive → Semantic → Component). Each token entry: name, value, CSS variable, Tailwind class equivalent. Use tables for scannability. ### 4. Typography System - Type scale table (name, size, weight, line-height, letter-spacing, usage) - Responsive rules - Font loading strategy ### 5. Color System - Full palette with swatches description (name, hex, usage context) - Semantic color mapping table - Dark mode mapping (if applicable) - Contrast ratio compliance notes ### 6. Layout System - Grid specification - Container widths - Spacing system with visual scale - Breakpoint behavior ### 7. Component Library [Insert Phase 3 output for each component] ### 8. Motion & Animation - Named presets table (name, duration, easing, usage) - Rules: when to animate, when not to - Performance constraints ### 9. Coding Conventions - File naming patterns - Import order - Component file structure template - CSS class ordering convention (if Tailwind) - State management patterns used ### 10. Rules & Constraints Hard rules that must never be broken: - "Never use inline hex colors — always reference tokens" - "All interactive elements must have visible focus states" - "Minimum touch target: 44x44px" - "All images must have alt text" - "No z-index values outside the defined scale" - [Add project-specific rules] ## Formatting Requirements - Use markdown tables for all token/value mappings - Use code blocks for all code examples - Keep each section self-contained (readable without scrolling to other sections) - Include a table of contents at the top with anchor links - Maximum line length: 100 characters for readability - Prefer explicit values over "see above" references ## Critical Rule This file must be AUTHORITATIVE. If there's ambiguity between the CLAUDE.md and the actual code, the CLAUDE.md should be updated to match reality — never the other way around. This documents what IS, not what SHOULD BE (that's a separate roadmap).