-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
v4.0.0-beta.435 #6758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4.0.0-beta.435 #6758
Changes from all commits
3020ad3
ee7daca
d2254f6
ac40a65
e17fbd3
0e02eff
590de8c
7d99d6a
41a8ea8
9107fb2
4b08ac9
f0fbed8
fb7af48
0bc7283
b4cfb78
4cf6004
c144973
158747c
4b947a0
06dfcff
ad4a733
5b2d54b
239ecd4
17505aa
dd93f93
bac6f4d
acf2d5f
141199b
a05a233
26bc6ed
31beb0f
ae64f8c
83a3715
2d37189
cef3d3a
a031768
806b98a
70d0ae2
eb1f16b
8b22155
9962b69
981f46c
1a42187
bc8cf8e
2c64136
fbbaab5
6183787
201e30e
b19e8d6
5e711fb
fc7e317
d7bee48
a39bd8c
747c764
58d4bdf
62134ae
704e016
0cddee6
adf5bbd
318f092
9a7d3ab
d752ee2
0bc57f7
e8b2ef0
91d5a48
afd1004
2e6e07b
6f086d2
3323302
640f753
c548013
b803a13
503da6d
c1bcc41
bdd078e
0a5987a
354eadd
2fb7a6f
ee6b8c9
42f671c
215301f
d837aa1
61e688a
c9e6418
704ddf2
231ad85
da93a52
2f12459
8d5ac0d
3241bd2
4a38497
f85a4f0
bf5c08d
f4e5c19
d16b6e9
77dcabe
bbaef03
513f6b5
32b53d7
00cb061
2bca220
5362952
9c152fd
bd88bbc
2e21d87
ee21152
ac3af8a
ac26fbe
8e954a3
2787937
a90236e
b28875c
3c74620
840c162
4834ff2
655e5a0
606b3b5
eb9305d
9481247
53d1ad4
eea372d
22ef6c8
22153c4
729c891
413dee5
dc15bee
556d93e
769d2ec
4b5c641
7069236
0603acf
bdffa47
bd6b597
9c2ef0a
084e65f
3501d20
e256e76
36573ec
0303f52
fe42773
b48db99
2cf4058
7061eac
c009c97
05bd57e
e4bf8ab
6c0840d
e055c3b
ad7479b
b31b080
5463f4d
231de5d
6c5adce
ff69bf1
64c4ce2
f502011
2ce3052
ff889e6
a17b105
a3cecff
88bbf14
4b34a7d
d93a13e
9c21304
7ad7247
a7b9e78
821aa6a
fc9f59b
6e08af6
052ef19
95fe04c
ccdbf95
635af44
737ec52
6297ac6
b7af8ce
7a008c8
1902ef8
0462559
de24489
ecdeed7
a15ab54
8d280b4
3dfef0b
acc5dbe
6879ba8
400746f
78031b9
174c212
df77a99
bb9ddd0
a1916c9
3e5fb4a
6098a58
42e3908
f8f4c04
cdfc991
a1fa49e
3c3ac8c
70ab263
591d495
4092100
e875fed
7443b26
a1dfb31
0681f4d
fe91c25
8d403cc
777cdc9
473fe6f
009ac82
ea58490
9c79e2b
d4b9b61
b911d2b
baabbc9
03d4dd5
ce12c94
ff054cf
1cdd6fb
040e2b4
8408faf
2aef2c3
bf00405
893093f
74c70b4
a3d9ca5
1aea813
123c849
f254af0
e20327b
652f523
941afa3
91e070b
ebfc877
b81baff
2692ef8
933a676
7bdd53b
a9d8993
f9f1d87
375aecc
81455b1
6d3c996
3e2f124
d1379f6
20b4288
66cff9d
7383705
23c1184
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| # AI Instructions Synchronization Guide | ||
|
|
||
| This document explains how AI instructions are organized and synchronized across different AI tools used with Coolify. | ||
|
|
||
| ## Overview | ||
|
|
||
| Coolify maintains AI instructions in two parallel systems: | ||
|
|
||
| 1. **CLAUDE.md** - For Claude Code (claude.ai/code) | ||
| 2. **.cursor/rules/** - For Cursor IDE and other AI assistants | ||
|
|
||
| Both systems share core principles but are optimized for their respective workflows. | ||
|
|
||
| ## Structure | ||
|
|
||
| ### CLAUDE.md | ||
| - **Purpose**: Condensed, workflow-focused guide for Claude Code | ||
| - **Format**: Single markdown file | ||
| - **Includes**: | ||
| - Quick-reference development commands | ||
| - High-level architecture overview | ||
| - Core patterns and guidelines | ||
| - Embedded Laravel Boost guidelines | ||
| - References to detailed .cursor/rules/ documentation | ||
|
|
||
| ### .cursor/rules/ | ||
| - **Purpose**: Detailed, topic-specific documentation | ||
| - **Format**: Multiple .mdc files organized by topic | ||
| - **Structure**: | ||
| - `README.mdc` - Main index and overview | ||
| - `cursor_rules.mdc` - Maintenance guidelines | ||
| - Topic-specific files (testing-patterns.mdc, security-patterns.mdc, etc.) | ||
| - **Used by**: Cursor IDE, Claude Code (for detailed reference), other AI assistants | ||
|
|
||
| ## Cross-References | ||
|
|
||
| Both systems reference each other: | ||
|
|
||
| - **CLAUDE.md** β references `.cursor/rules/` for detailed documentation | ||
| - **.cursor/rules/README.mdc** β references `CLAUDE.md` for Claude Code workflow | ||
| - **.cursor/rules/cursor_rules.mdc** β notes that changes should sync with CLAUDE.md | ||
|
|
||
| ## Maintaining Consistency | ||
|
|
||
| When updating AI instructions, follow these guidelines: | ||
|
|
||
| ### 1. Core Principles (MUST be consistent) | ||
| - Laravel version (currently Laravel 12) | ||
| - PHP version (8.4) | ||
| - Testing execution rules (Docker for Feature tests, mocking for Unit tests) | ||
| - Security patterns and authorization requirements | ||
| - Code style requirements (Pint, PSR-12) | ||
|
|
||
| ### 2. Where to Make Changes | ||
|
|
||
| **For workflow changes** (how to run commands, development setup): | ||
| - Primary: `CLAUDE.md` | ||
| - Secondary: `.cursor/rules/development-workflow.mdc` | ||
|
|
||
| **For architectural patterns** (how code should be structured): | ||
| - Primary: `.cursor/rules/` topic files | ||
| - Secondary: Reference in `CLAUDE.md` "Additional Documentation" section | ||
|
|
||
| **For testing patterns**: | ||
| - Both: Must be synchronized | ||
| - `CLAUDE.md` - Contains condensed testing execution rules | ||
| - `.cursor/rules/testing-patterns.mdc` - Contains detailed examples and patterns | ||
|
|
||
| ### 3. Update Checklist | ||
|
|
||
| When making significant changes: | ||
|
|
||
| - [ ] Identify if change affects core principles (version numbers, critical patterns) | ||
| - [ ] Update primary location (CLAUDE.md or .cursor/rules/) | ||
| - [ ] Check if update affects cross-referenced content | ||
| - [ ] Update secondary location if needed | ||
| - [ ] Verify cross-references are still accurate | ||
| - [ ] Run: `./vendor/bin/pint CLAUDE.md .cursor/rules/*.mdc` (if applicable) | ||
|
|
||
| ### 4. Common Inconsistencies to Watch | ||
|
|
||
| - **Version numbers**: Laravel, PHP, package versions | ||
| - **Testing instructions**: Docker execution requirements | ||
| - **File paths**: Ensure relative paths work from root | ||
| - **Command syntax**: Docker commands, artisan commands | ||
| - **Architecture decisions**: Laravel 10 structure vs Laravel 12+ structure | ||
|
|
||
| ## File Organization | ||
|
|
||
| ``` | ||
| / | ||
| βββ CLAUDE.md # Claude Code instructions (condensed) | ||
| βββ .AI_INSTRUCTIONS_SYNC.md # This file | ||
| βββ .cursor/ | ||
| βββ rules/ | ||
| βββ README.mdc # Index and overview | ||
| βββ cursor_rules.mdc # Maintenance guide | ||
| βββ testing-patterns.mdc # Testing details | ||
| βββ development-workflow.mdc # Dev setup details | ||
| βββ security-patterns.mdc # Security details | ||
| βββ application-architecture.mdc | ||
| βββ deployment-architecture.mdc | ||
| βββ database-patterns.mdc | ||
| βββ frontend-patterns.mdc | ||
| βββ api-and-routing.mdc | ||
| βββ form-components.mdc | ||
| βββ technology-stack.mdc | ||
| βββ project-overview.mdc | ||
| βββ laravel-boost.mdc # Laravel-specific patterns | ||
| ``` | ||
|
|
||
| ## Recent Updates | ||
|
|
||
| ### 2025-10-07 | ||
| - β Added cross-references between CLAUDE.md and .cursor/rules/ | ||
| - β Synchronized Laravel version (12) across all files | ||
| - β Added comprehensive testing execution rules (Docker for Feature tests) | ||
| - β Added test design philosophy (prefer mocking over database) | ||
| - β Fixed inconsistencies in testing documentation | ||
| - β Created this synchronization guide | ||
|
|
||
| ## Maintenance Commands | ||
|
|
||
| ```bash | ||
| # Check for version inconsistencies | ||
| grep -r "Laravel [0-9]" CLAUDE.md .cursor/rules/*.mdc | ||
|
|
||
| # Check for PHP version consistency | ||
| grep -r "PHP [0-9]" CLAUDE.md .cursor/rules/*.mdc | ||
|
|
||
| # Format all documentation | ||
| ./vendor/bin/pint CLAUDE.md .cursor/rules/*.mdc | ||
|
|
||
| # Search for specific patterns across all docs | ||
| grep -r "pattern_to_check" CLAUDE.md .cursor/rules/ | ||
| ``` | ||
|
|
||
| ## Contributing | ||
|
|
||
| When contributing documentation: | ||
|
|
||
| 1. Check both CLAUDE.md and .cursor/rules/ for existing documentation | ||
| 2. Add to appropriate location(s) based on guidelines above | ||
| 3. Add cross-references if creating new patterns | ||
| 4. Update this file if changing organizational structure | ||
| 5. Verify consistency before submitting PR | ||
|
|
||
| ## Questions? | ||
|
|
||
| If unsure about where to document something: | ||
|
|
||
| - **Quick reference / workflow** β CLAUDE.md | ||
| - **Detailed patterns / examples** β .cursor/rules/[topic].mdc | ||
| - **Both?** β Start with .cursor/rules/, then reference in CLAUDE.md | ||
|
|
||
| When in doubt, prefer detailed documentation in .cursor/rules/ and concise references in CLAUDE.md. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,29 @@ Schema::create('applications', function (Blueprint $table) { | |
| - **Soft deletes** for audit trails | ||
| - **Activity logging** with Spatie package | ||
|
|
||
| ### **CRITICAL: Mass Assignment Protection** | ||
| **When adding new database columns, you MUST update the model's `$fillable` array.** Without this, Laravel will silently ignore mass assignment operations like `Model::create()` or `$model->update()`. | ||
|
|
||
| **Checklist for new columns:** | ||
| 1. β Create migration file | ||
| 2. β Run migration | ||
| 3. β **Add column to model's `$fillable` array** | ||
| 4. β Update any Livewire components that sync this property | ||
| 5. β Test that the column can be read and written | ||
|
|
||
| **Example:** | ||
| ```php | ||
| class Server extends BaseModel | ||
| { | ||
| protected $fillable = [ | ||
| 'name', | ||
| 'ip', | ||
| 'port', | ||
| 'is_validating', // β MUST add new columns here | ||
| ]; | ||
| } | ||
| ``` | ||
|
Comment on lines
+145
to
+166
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion | π Major Add a DON'T example to complete the rule. Nice checklist, but the Cursor rulebook demands both DO and DON'T samples. Throw in a short βwhat not to doβ snippet so future humans donβt skip π€ Prompt for AI Agents |
||
|
|
||
| ### Relationship Patterns | ||
| ```php | ||
| // Typical relationship structure in Application model | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insert breathing room around headings and code fences.
markdownlint is screaming louder than a server fan at full RPM: headings like Line 15 (
## Structure) and several others arenβt surrounded by blank lines, and fenced blocks (e.g., Line 105) need blank lines above/below. Please add those gaps so the docs pass MD022/MD031. Keep it neat like a self-hosted rack, not a serverless brochure.π§° Tools
πͺ markdownlint-cli2 (0.18.1)
15-15: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
19-19: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
27-27: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
32-32: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
41-41: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
51-51: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
60-60: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
65-65: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
71-71: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
77-77: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
92-92: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
100-100: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
103-103: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
105-105: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
112-112: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
114-114: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
121-121: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
123-123: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
π€ Prompt for AI Agents