Skip to content

Commit 006c4e5

Browse files
authored
v4.0.0-beta.445 (#7257)
2 parents 5b850ba + 9af4f73 commit 006c4e5

File tree

177 files changed

+12205
-3249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+12205
-3249
lines changed

.AI_INSTRUCTIONS_SYNC.md

Lines changed: 25 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,41 @@
11
# AI Instructions Synchronization Guide
22

3-
This document explains how AI instructions are organized and synchronized across different AI tools used with Coolify.
3+
**This file has moved!**
44

5-
## Overview
5+
All AI documentation and synchronization guidelines are now in the `.ai/` directory.
66

7-
Coolify maintains AI instructions in two parallel systems:
7+
## New Locations
88

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)
1112

12-
Both systems share core principles but are optimized for their respective workflows.
13+
## Quick Overview
1314

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:
8916

9017
```
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
11024
```
11125

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
14127

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
14731

148-
## Questions?
32+
### Key Principles
14933

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`
15138

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
15540

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.

.ai/README.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Coolify AI Documentation
2+
3+
Welcome to the Coolify AI documentation hub. This directory contains all AI assistant instructions organized by topic for easy navigation and maintenance.
4+
5+
## Quick Start
6+
7+
- **For Claude Code**: Start with [CLAUDE.md in root directory](../CLAUDE.md)
8+
- **For Cursor IDE**: Check `.cursor/rules/coolify-ai-docs.mdc` which references this directory
9+
- **For Other AI Tools**: Continue reading below
10+
11+
## Documentation Structure
12+
13+
### 📚 Core Documentation
14+
Essential project information and architecture:
15+
16+
- **[Technology Stack](core/technology-stack.md)** - All versions, packages, and dependencies (Laravel 12.4.1, PHP 8.4.7, etc.)
17+
- **[Project Overview](core/project-overview.md)** - What Coolify is and how it works
18+
- **[Application Architecture](core/application-architecture.md)** - System design and component relationships
19+
- **[Deployment Architecture](core/deployment-architecture.md)** - How deployments work end-to-end, including Coolify Docker Compose extensions (custom fields)
20+
21+
### 💻 Development
22+
Day-to-day development practices:
23+
24+
- **[Workflow](development/development-workflow.md)** - Development setup, commands, and daily workflows
25+
- **[Testing Patterns](development/testing-patterns.md)** - How to write and run tests (Unit vs Feature, Docker requirements)
26+
- **[Laravel Boost](development/laravel-boost.md)** - Laravel-specific guidelines and best practices
27+
28+
### 🎨 Patterns
29+
Code patterns and best practices by domain:
30+
31+
- **[Database Patterns](patterns/database-patterns.md)** - Eloquent, migrations, relationships
32+
- **[Frontend Patterns](patterns/frontend-patterns.md)** - Livewire, Alpine.js, Tailwind CSS
33+
- **[Security Patterns](patterns/security-patterns.md)** - Authentication, authorization, security best practices
34+
- **[Form Components](patterns/form-components.md)** - Enhanced form components with authorization
35+
- **[API & Routing](patterns/api-and-routing.md)** - API design, routing conventions, REST patterns
36+
37+
### 📖 Meta
38+
Documentation about documentation:
39+
40+
- **[Maintaining Docs](meta/maintaining-docs.md)** - How to update and improve this documentation
41+
- **[Sync Guide](meta/sync-guide.md)** - Keeping documentation synchronized across tools
42+
43+
## Quick Decision Tree
44+
45+
**What do you need help with?**
46+
47+
### Running Commands
48+
[development/development-workflow.md](development/development-workflow.md)
49+
- Frontend: `npm run dev`, `npm run build`
50+
- Backend: `php artisan serve`, `php artisan migrate`
51+
- Tests: Docker for Feature tests, mocking for Unit tests
52+
- Code quality: `./vendor/bin/pint`, `./vendor/bin/phpstan`
53+
54+
### Writing Tests
55+
[development/testing-patterns.md](development/testing-patterns.md)
56+
- **Unit tests**: No database, use mocking, run outside Docker
57+
- **Feature tests**: Can use database, must run inside Docker
58+
- Command: `docker exec coolify php artisan test`
59+
60+
### Building UI
61+
[patterns/frontend-patterns.md](patterns/frontend-patterns.md) or [patterns/form-components.md](patterns/form-components.md)
62+
- Livewire components with server-side state
63+
- Alpine.js for client-side interactivity
64+
- Tailwind CSS 4.1.4 for styling
65+
- Form components with built-in authorization
66+
67+
### Database Work
68+
[patterns/database-patterns.md](patterns/database-patterns.md)
69+
- Eloquent ORM patterns
70+
- Migration best practices
71+
- Relationship definitions
72+
- Query optimization
73+
74+
### Security & Auth
75+
[patterns/security-patterns.md](patterns/security-patterns.md)
76+
- Team-based access control
77+
- Policy and gate patterns
78+
- Form authorization (canGate, canResource)
79+
- API security
80+
81+
### Laravel-Specific Questions
82+
[development/laravel-boost.md](development/laravel-boost.md)
83+
- Laravel 12 patterns
84+
- Livewire 3 best practices
85+
- Pest testing patterns
86+
- Laravel conventions
87+
88+
### Docker Compose Extensions
89+
[core/deployment-architecture.md](core/deployment-architecture.md#coolify-docker-compose-extensions)
90+
- Custom fields: `exclude_from_hc`, `content`, `isDirectory`
91+
- How to use inline file content
92+
- Health check exclusion patterns
93+
- Volume creation control
94+
95+
### Version Numbers
96+
[core/technology-stack.md](core/technology-stack.md)
97+
- **Single source of truth** for all version numbers
98+
- Don't duplicate versions elsewhere, reference this file
99+
100+
## Navigation Tips
101+
102+
1. **Start broad**: Begin with project-overview or ../CLAUDE.md
103+
2. **Get specific**: Navigate to topic-specific files for details
104+
3. **Cross-reference**: Files link to related topics
105+
4. **Single source**: Version numbers and critical data exist in ONE place only
106+
107+
## For AI Assistants
108+
109+
### Important Patterns to Follow
110+
111+
**Testing Commands:**
112+
- Unit tests: `./vendor/bin/pest tests/Unit` (no database, outside Docker)
113+
- Feature tests: `docker exec coolify php artisan test` (requires database, inside Docker)
114+
- NEVER run Feature tests outside Docker - they will fail with database connection errors
115+
116+
**Version Numbers:**
117+
- Always use exact versions from [technology-stack.md](core/technology-stack.md)
118+
- Laravel 12.4.1, PHP 8.4.7, Tailwind 4.1.4
119+
- Don't use "v12" or "8.4" - be precise
120+
121+
**Form Authorization:**
122+
- ALWAYS include `canGate` and `:canResource` on form components
123+
- See [form-components.md](patterns/form-components.md) for examples
124+
125+
**Livewire Components:**
126+
- MUST have exactly ONE root element
127+
- See [frontend-patterns.md](patterns/frontend-patterns.md) for details
128+
129+
**Code Style:**
130+
- Run `./vendor/bin/pint` before finalizing changes
131+
- Follow PSR-12 standards
132+
- Use PHP 8.4 features (constructor promotion, typed properties, etc.)
133+
134+
## Contributing
135+
136+
When updating documentation:
137+
1. Read [meta/maintaining-docs.md](meta/maintaining-docs.md)
138+
2. Follow the single source of truth principle
139+
3. Update cross-references when moving content
140+
4. Test all links work
141+
5. Run Pint on markdown files if applicable
142+
143+
## Questions?
144+
145+
- **Claude Code users**: Check [../CLAUDE.md](../CLAUDE.md) first
146+
- **Cursor IDE users**: Check `.cursor/rules/coolify-ai-docs.mdc`
147+
- **Documentation issues**: See [meta/maintaining-docs.md](meta/maintaining-docs.md)
148+
- **Sync issues**: See [meta/sync-guide.md](meta/sync-guide.md)

0 commit comments

Comments
 (0)