|
1 | 1 | # AI Instructions Synchronization Guide |
2 | 2 |
|
3 | | -This document explains how AI instructions are organized and synchronized across different AI tools used with Coolify. |
| 3 | +**This file has moved!** |
4 | 4 |
|
5 | | -## Overview |
| 5 | +All AI documentation and synchronization guidelines are now in the `.ai/` directory. |
6 | 6 |
|
7 | | -Coolify maintains AI instructions in two parallel systems: |
| 7 | +## New Locations |
8 | 8 |
|
9 | | -1. **CLAUDE.md** - For Claude Code (claude.ai/code) |
10 | | -2. **.cursor/rules/** - For Cursor IDE and other AI assistants |
| 9 | +- **Sync Guide**: [.ai/meta/sync-guide.md](.ai/meta/sync-guide.md) |
| 10 | +- **Maintaining Docs**: [.ai/meta/maintaining-docs.md](.ai/meta/maintaining-docs.md) |
| 11 | +- **Documentation Hub**: [.ai/README.md](.ai/README.md) |
11 | 12 |
|
12 | | -Both systems share core principles but are optimized for their respective workflows. |
| 13 | +## Quick Overview |
13 | 14 |
|
14 | | -## Structure |
15 | | - |
16 | | -### CLAUDE.md |
17 | | -- **Purpose**: Condensed, workflow-focused guide for Claude Code |
18 | | -- **Format**: Single markdown file |
19 | | -- **Includes**: |
20 | | - - Quick-reference development commands |
21 | | - - High-level architecture overview |
22 | | - - Core patterns and guidelines |
23 | | - - Embedded Laravel Boost guidelines |
24 | | - - References to detailed .cursor/rules/ documentation |
25 | | - |
26 | | -### .cursor/rules/ |
27 | | -- **Purpose**: Detailed, topic-specific documentation |
28 | | -- **Format**: Multiple .mdc files organized by topic |
29 | | -- **Structure**: |
30 | | - - `README.mdc` - Main index and overview |
31 | | - - `cursor_rules.mdc` - Maintenance guidelines |
32 | | - - Topic-specific files (testing-patterns.mdc, security-patterns.mdc, etc.) |
33 | | -- **Used by**: Cursor IDE, Claude Code (for detailed reference), other AI assistants |
34 | | - |
35 | | -## Cross-References |
36 | | - |
37 | | -Both systems reference each other: |
38 | | - |
39 | | -- **CLAUDE.md** → references `.cursor/rules/` for detailed documentation |
40 | | -- **.cursor/rules/README.mdc** → references `CLAUDE.md` for Claude Code workflow |
41 | | -- **.cursor/rules/cursor_rules.mdc** → notes that changes should sync with CLAUDE.md |
42 | | - |
43 | | -## Maintaining Consistency |
44 | | - |
45 | | -When updating AI instructions, follow these guidelines: |
46 | | - |
47 | | -### 1. Core Principles (MUST be consistent) |
48 | | -- Laravel version (currently Laravel 12) |
49 | | -- PHP version (8.4) |
50 | | -- Testing execution rules (Docker for Feature tests, mocking for Unit tests) |
51 | | -- Security patterns and authorization requirements |
52 | | -- Code style requirements (Pint, PSR-12) |
53 | | - |
54 | | -### 2. Where to Make Changes |
55 | | - |
56 | | -**For workflow changes** (how to run commands, development setup): |
57 | | -- Primary: `CLAUDE.md` |
58 | | -- Secondary: `.cursor/rules/development-workflow.mdc` |
59 | | - |
60 | | -**For architectural patterns** (how code should be structured): |
61 | | -- Primary: `.cursor/rules/` topic files |
62 | | -- Secondary: Reference in `CLAUDE.md` "Additional Documentation" section |
63 | | - |
64 | | -**For testing patterns**: |
65 | | -- Both: Must be synchronized |
66 | | -- `CLAUDE.md` - Contains condensed testing execution rules |
67 | | -- `.cursor/rules/testing-patterns.mdc` - Contains detailed examples and patterns |
68 | | - |
69 | | -### 3. Update Checklist |
70 | | - |
71 | | -When making significant changes: |
72 | | - |
73 | | -- [ ] Identify if change affects core principles (version numbers, critical patterns) |
74 | | -- [ ] Update primary location (CLAUDE.md or .cursor/rules/) |
75 | | -- [ ] Check if update affects cross-referenced content |
76 | | -- [ ] Update secondary location if needed |
77 | | -- [ ] Verify cross-references are still accurate |
78 | | -- [ ] Run: `./vendor/bin/pint CLAUDE.md .cursor/rules/*.mdc` (if applicable) |
79 | | - |
80 | | -### 4. Common Inconsistencies to Watch |
81 | | - |
82 | | -- **Version numbers**: Laravel, PHP, package versions |
83 | | -- **Testing instructions**: Docker execution requirements |
84 | | -- **File paths**: Ensure relative paths work from root |
85 | | -- **Command syntax**: Docker commands, artisan commands |
86 | | -- **Architecture decisions**: Laravel 10 structure vs Laravel 12+ structure |
87 | | - |
88 | | -## File Organization |
| 15 | +All AI instructions are now organized in `.ai/` directory: |
89 | 16 |
|
90 | 17 | ``` |
91 | | -/ |
92 | | -├── CLAUDE.md # Claude Code instructions (condensed) |
93 | | -├── .AI_INSTRUCTIONS_SYNC.md # This file |
94 | | -└── .cursor/ |
95 | | - └── rules/ |
96 | | - ├── README.mdc # Index and overview |
97 | | - ├── cursor_rules.mdc # Maintenance guide |
98 | | - ├── testing-patterns.mdc # Testing details |
99 | | - ├── development-workflow.mdc # Dev setup details |
100 | | - ├── security-patterns.mdc # Security details |
101 | | - ├── application-architecture.mdc |
102 | | - ├── deployment-architecture.mdc |
103 | | - ├── database-patterns.mdc |
104 | | - ├── frontend-patterns.mdc |
105 | | - ├── api-and-routing.mdc |
106 | | - ├── form-components.mdc |
107 | | - ├── technology-stack.mdc |
108 | | - ├── project-overview.mdc |
109 | | - └── laravel-boost.mdc # Laravel-specific patterns |
| 18 | +.ai/ |
| 19 | +├── README.md # Navigation hub |
| 20 | +├── core/ # Project information |
| 21 | +├── development/ # Dev workflows |
| 22 | +├── patterns/ # Code patterns |
| 23 | +└── meta/ # Documentation guides |
110 | 24 | ``` |
111 | 25 |
|
112 | | -## Recent Updates |
113 | | - |
114 | | -### 2025-10-07 |
115 | | -- ✅ Added cross-references between CLAUDE.md and .cursor/rules/ |
116 | | -- ✅ Synchronized Laravel version (12) across all files |
117 | | -- ✅ Added comprehensive testing execution rules (Docker for Feature tests) |
118 | | -- ✅ Added test design philosophy (prefer mocking over database) |
119 | | -- ✅ Fixed inconsistencies in testing documentation |
120 | | -- ✅ Created this synchronization guide |
121 | | - |
122 | | -## Maintenance Commands |
123 | | - |
124 | | -```bash |
125 | | -# Check for version inconsistencies |
126 | | -grep -r "Laravel [0-9]" CLAUDE.md .cursor/rules/*.mdc |
127 | | - |
128 | | -# Check for PHP version consistency |
129 | | -grep -r "PHP [0-9]" CLAUDE.md .cursor/rules/*.mdc |
130 | | - |
131 | | -# Format all documentation |
132 | | -./vendor/bin/pint CLAUDE.md .cursor/rules/*.mdc |
133 | | - |
134 | | -# Search for specific patterns across all docs |
135 | | -grep -r "pattern_to_check" CLAUDE.md .cursor/rules/ |
136 | | -``` |
137 | | - |
138 | | -## Contributing |
139 | | - |
140 | | -When contributing documentation: |
| 26 | +### For AI Assistants |
141 | 27 |
|
142 | | -1. Check both CLAUDE.md and .cursor/rules/ for existing documentation |
143 | | -2. Add to appropriate location(s) based on guidelines above |
144 | | -3. Add cross-references if creating new patterns |
145 | | -4. Update this file if changing organizational structure |
146 | | -5. Verify consistency before submitting PR |
| 28 | +- **Claude Code**: Use `CLAUDE.md` (references `.ai/` files) |
| 29 | +- **Cursor IDE**: Use `.cursor/rules/coolify-ai-docs.mdc` (references `.ai/` files) |
| 30 | +- **All Tools**: Browse `.ai/` directory for detailed documentation |
147 | 31 |
|
148 | | -## Questions? |
| 32 | +### Key Principles |
149 | 33 |
|
150 | | -If unsure about where to document something: |
| 34 | +1. **Single Source of Truth**: Each piece of information exists in ONE file only |
| 35 | +2. **Cross-Reference**: Other files reference the source, don't duplicate |
| 36 | +3. **Organized by Topic**: Core, Development, Patterns, Meta |
| 37 | +4. **Version Consistency**: All versions in `.ai/core/technology-stack.md` |
151 | 38 |
|
152 | | -- **Quick reference / workflow** → CLAUDE.md |
153 | | -- **Detailed patterns / examples** → .cursor/rules/[topic].mdc |
154 | | -- **Both?** → Start with .cursor/rules/, then reference in CLAUDE.md |
| 39 | +## For More Information |
155 | 40 |
|
156 | | -When in doubt, prefer detailed documentation in .cursor/rules/ and concise references in CLAUDE.md. |
| 41 | +See [.ai/meta/sync-guide.md](.ai/meta/sync-guide.md) for complete synchronization guidelines and [.ai/meta/maintaining-docs.md](.ai/meta/maintaining-docs.md) for documentation maintenance instructions. |
0 commit comments