[DX] Improve AI contribution guidelines#18708
Conversation
📝 WalkthroughWalkthroughDocumentation restructuring of AGENTS.md that expands and reorganizes AI contribution guidelines with new sections on reference file patterns, testing conventions, frontend standards, and common pitfalls. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @AGENTS.md:
- Around line 34-39: Update the Migrations location line to show the concrete
filename pattern used by the codebase: replace
`src/Sylius/Bundle/CoreBundle/Migrations/` with
`src/Sylius/Bundle/CoreBundle/Migrations/Version[TIMESTAMP].php` and include an
example like `Version20251126120001.php`, keeping the existing notes about
creating two migrations and extending AbstractMigration /
AbstractPostgreSQLMigration to guide developers to the required filename format.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
AGENTS.md
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T05:49:02.960Z
Learning: See AGENTS.md for coding guidelines
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T05:48:59.242Z
Learning: Refer to and follow guidelines documented in the global AGENTS.md file located at the project root
📚 Learning: 2025-11-25T05:49:02.960Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T05:49:02.960Z
Learning: See AGENTS.md for coding guidelines
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T05:48:59.242Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T05:48:59.242Z
Learning: Refer to and follow guidelines documented in the global AGENTS.md file located at the project root
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T05:49:22.765Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:49:22.765Z
Learning: Follow the Sylius Backward Compatibility (BC) policy
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T05:49:22.765Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:49:22.765Z
Learning: Applies to **/{admin,shop}/**/*.php : For API configuration, use API Platform 4.x
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T05:49:22.765Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:49:22.765Z
Learning: Applies to **/*Test.php : Use PHPUnit for unit and functional testing
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T05:49:22.765Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:49:22.765Z
Learning: Applies to **/*.php : Do not use deprecated features from PHP, Symfony, or Sylius
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T05:49:22.765Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:49:22.765Z
Learning: Applies to **/*.feature : Use Behat for behavior-driven scenarios
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T05:49:22.765Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:49:22.765Z
Learning: Applies to **/*.{php,twig} : Follow secure coding practices to prevent XSS, CSRF, injections, auth bypasses, etc.
Applied to files:
AGENTS.md
📚 Learning: 2025-05-13T09:09:07.413Z
Learnt from: Prometee
Repo: Sylius/Sylius PR: 17983
File: src/Sylius/Bundle/InventoryBundle/phpunit.xml.dist:14-14
Timestamp: 2025-05-13T09:09:07.413Z
Learning: In Sylius projects, PHPUnit schema references should use the local vendor file path (`vendor/phpunit/phpunit/phpunit.xsd`) instead of remote URLs (`http://schema.phpunit.de/x.y/phpunit.xsd`) in phpunit.xml.dist files, matching the convention used across Sylius components.
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T05:49:22.765Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:49:22.765Z
Learning: Applies to **/*.scss : Avoid `!important` unless absolutely necessary in stylesheets
Applied to files:
AGENTS.md
📚 Learning: 2025-11-25T05:49:22.765Z
Learnt from: CR
Repo: Sylius/Sylius PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:49:22.765Z
Learning: Applies to **/*.php : Use PHPDoc only when necessary (e.g., `var Collection<ProductInterface>`) in PHP
Applied to files:
AGENTS.md
🔇 Additional comments (6)
AGENTS.md (6)
41-73: General Guidelines and Commands sections look good.The sections appropriately reference the BC policy, API Platform 4.x, security practices, and provide practical command examples. Alignment with learnings and Sylius conventions appears solid.
114-131: PHPUnit and Behat sections are well-structured.The expanded sections provide clear directory patterns, naming conventions, and practical examples. Good alignment with learnings on testing frameworks.
132-149: Frontend sections provide clear standards.JavaScript and CSS sections appropriately emphasize TypeScript, Stimulus controllers, SCSS-only approach, and modular styling. Good alignment with Bootstrap 5 and project conventions.
150-157: Common Mistakes section is a valuable addition.This new section efficiently captures frequent pitfalls with concrete references and remediation guidance. Particularly valuable are the architectural distinction (line 156) and the explicit migration/mapping reminders. This will help reduce common onboarding issues.
74-95: No issues found. The PHP 8.2+ requirement specified in the coding standards matches the project'scomposer.jsonconfiguration ("php": "^8.2"), confirming the guideline is accurate and current.
17-18: The paths shown in AGENTS.md lines 17-18 are accurate. API Platform resources are correctly located atsrc/Sylius/Bundle/ApiBundle/Resources/config/api_platform/resources/admin/Product.xmlandresources/shop/Product.xml, following the bundle-based pattern. The abbreviated paths in the documentation are consistent with the style used throughout the section.Likely an incorrect or invalid review comment.
| ### Migrations | ||
| - Location: `src/Sylius/Bundle/CoreBundle/Migrations/` | ||
| - **ALWAYS create TWO migrations**: one for MySQL, one for PostgreSQL | ||
| - MySQL: extend `Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration` | ||
| - PostgreSQL: extend `Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractPostgreSQLMigration` | ||
| - When reviewing PRs that touch migrations, verify both versions exist |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for AbstractMigration and AbstractPostgreSQLMigration class definitions
echo "=== Searching for AbstractMigration ==="
find . -type f -name "*.php" -exec grep -l "class AbstractMigration" {} \; | head -10
echo -e "\n=== Searching for AbstractPostgreSQLMigration ==="
find . -type f -name "*.php" -exec grep -l "class AbstractPostgreSQLMigration" {} \; | head -10
echo -e "\n=== Checking migration file patterns in CoreBundle ==="
find . -path "*/CoreBundle/Migrations/*.php" -type f | head -20
echo -e "\n=== Checking full path structure ==="
find . -path "*/Migrations/*.php" -type f | grep -i core | head -15Repository: Sylius/Sylius
Length of output: 2807
🏁 Script executed:
cat -n AGENTS.md | sed -n '30,45p'Repository: Sylius/Sylius
Length of output: 786
Add concrete migration filename example with version prefix.
The class names AbstractMigration and AbstractPostgreSQLMigration are correct. However, line 35 should include a concrete filename example. All migrations in the codebase use the pattern VersionYYYYMMDDHHMMSS.php (e.g., Version20251126120001.php). Update the location line to show: src/Sylius/Bundle/CoreBundle/Migrations/Version[TIMESTAMP].php or provide a specific example to guide developers on the required filename format.
🤖 Prompt for AI Agents
In @AGENTS.md around lines 34 - 39, Update the Migrations location line to show
the concrete filename pattern used by the codebase: replace
`src/Sylius/Bundle/CoreBundle/Migrations/` with
`src/Sylius/Bundle/CoreBundle/Migrations/Version[TIMESTAMP].php` and include an
example like `Version20251126120001.php`, keeping the existing notes about
creating two migrations and extending AbstractMigration /
AbstractPostgreSQLMigration to guide developers to the required filename format.
b621fc8 to
f3c4454
Compare
Expands
AGENTS.mdwith practical reference paths and fills previously empty sections.Changes: