Skip to content

Add initial AGENTS.md#18156

Merged
GSadee merged 1 commit intoSylius:2.0from
mpysiak:add-init-AGENTS.md
Jun 12, 2025
Merged

Add initial AGENTS.md#18156
GSadee merged 1 commit intoSylius:2.0from
mpysiak:add-init-AGENTS.md

Conversation

@mpysiak
Copy link
Copy Markdown
Member

@mpysiak mpysiak commented Jun 12, 2025

Q A
Branch? 2.1
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets n/a
License MIT

I've added an initial AGENTS.md template — a guide for AI assistants like ChatGPT, Copilot, Codex, etc. to follow when contributing code to Sylius.

It’s meant to keep AI-generated code clean and aligned with how we build things

Feel free to review and suggest improvements. Let’s show the bots how we do things in Sylius 😎🤖

Summary by CodeRabbit

  • Documentation
    • Added AI Contribution Guidelines outlining best practices for AI assistants contributing to the project, including coding standards, project structure, compatibility, security, and testing requirements.
    • Introduced a reference file for AI-related documentation.

@mpysiak mpysiak requested review from a team as code owners June 12, 2025 06:04
@probot-autolabeler probot-autolabeler bot added the Maintenance CI configurations, READMEs, releases, etc. label Jun 12, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 12, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Two new documentation files have been added: "AI Contribution Guidelines" (AGENTS.md), detailing standards and practices for AI assistants contributing to the Sylius project, and "CLAUDE.md," which references the AGENTS.md file. No code or exported entities were modified.

Changes

File(s) Change Summary
AGENTS.md Added comprehensive AI Contribution Guidelines covering structure, standards, commands, and more.
CLAUDE.md Added a file referencing AGENTS.md.

Poem

In the warren of docs, two new leaves appear,
One guides AI bunnies, making standards clear.
The other, a signpost, points where to go—
Together they help our project to grow.
With every hop, we organize and write,
Bringing clarity to code, from morning till night!
🐇📚


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (8)
CLAUDE.md (1)

1-1: Use proper Markdown link syntax for referencing guidelines

Instead of using @AGENTS.md, link directly with descriptive text:

- See @AGENTS.md
+ See [AI Contribution Guidelines](AGENTS.md)
AGENTS.md (7)

1-4: Refine welcome message and heading clarity

Change "contributing to this Sylius:" to remove "this" and the trailing colon for a cleaner introduction:

- Welcome, 🤖 AI assistant! Please follow these guidelines when contributing to this Sylius:
+ Welcome, 🤖 AI assistant! Please follow these guidelines when contributing to Sylius.

9-16: Consolidate and improve project structure bullets

Combine the first two bullets for brevity and clarity, and maintain consistent wording:

- This is Sylius: e-commerce framework
- Sylius is built on top of **Symfony**
+ Sylius is an e-commerce framework built on **Symfony**, designed to be extendable, modular, and efficient.

19-22: Clarify terminology in security practices

Replace the shorthand "auth bypasses" with the full term for better clarity:

- Follow secure coding practices to prevent XSS, CSRF, injections, auth bypasses, etc.
+ Follow secure coding practices to prevent XSS, CSRF, injections, authentication bypasses, etc.

25-31: Spell out acronyms for readability

Consider expanding ECS and CI on first use to aid understanding:

- Use **ECS** to ensure consistent code style
+ Use **Easy Coding Standard (ECS)** to ensure consistent code style

- Use **CI** to run all tests and checks automatically
+ Use **Continuous Integration (CI)** to run all tests and checks automatically

43-61: Clarify strict_types directive and trailing comma support

Recommend explicitly noting the syntax and PHP version support for trailing commas:

- Declare `strict_types=1` in all PHP files
+ Include `declare(strict_types=1);` at the top of all PHP files

- Use trailing commas in multi-line arrays and argument lists
+ Use trailing commas in multi-line arrays and argument lists (supported since PHP 7.3)

74-78: Remove colon before series introduced by a preposition

Adjust the serialization groups bullet to fix typographical issue:

- Use serialization groups for: `index`, `show`, `create`, `update`
+ Use serialization groups for `index`, `show`, `create`, and `update`
🧰 Tools
🪛 LanguageTool

[typographical] ~77-~77: Do not use a colon (:) before a series that is introduced by a preposition (‘for’). Remove the colon or add a noun or a noun phrase after the preposition.
Context: ...ion/folder - Use serialization groups for:index, show, create, update` - U...

(RP_COLON)


80-87: Address empty sections or remove placeholders

The sections for PHPUnit, Behat, JavaScript, and CSS are empty. Either populate them with relevant guidance or remove these headings until ready.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3dd2af and 789f8d8.

📒 Files selected for processing (2)
  • AGENTS.md (1 hunks)
  • CLAUDE.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
AGENTS.md

[typographical] ~77-~77: Do not use a colon (:) before a series that is introduced by a preposition (‘for’). Remove the colon or add a noun or a noun phrase after the preposition.
Context: ...ion/folder - Use serialization groups for:index, show, create, update` - U...

(RP_COLON)

🔇 Additional comments (2)
AGENTS.md (2)

34-40: Commands section is clear and comprehensive

The listed commands cover all necessary steps for setup, style, analysis, testing, and asset compilation.


64-71: Templates section aligns with project practices

The guidelines for HTML5, Twig, icon usage, naming conventions, directory structure, and translations are well-defined.

GSadee
GSadee previously approved these changes Jun 12, 2025
- Declare `strict_types=1` in all PHP files
- Follow the **Sylius Coding Standard**
- Do not use deprecated features from PHP, Symfony, or Sylius
- Use `final` for all classes, except entities and repositories
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could be probably more exceptions like components, etc, but we can add it later 👌🏻

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe they should read rules in ecs etc to know rules by itself

@GSadee GSadee changed the base branch from 2.1 to 2.0 June 12, 2025 06:48
@GSadee GSadee dismissed their stale review June 12, 2025 06:48

The base branch was changed.

@GSadee GSadee force-pushed the add-init-AGENTS.md branch from 789f8d8 to 052340f Compare June 12, 2025 06:48
@GSadee
Copy link
Copy Markdown
Member

GSadee commented Jun 12, 2025

The base of this pull-request was changed, you need fetch and reset your local branch
if you want to add new commits to this pull request. Reset before you pull, else commits
may become messed-up.

Unless you added new commits (to this branch) locally that you did not push yet,
execute git fetch origin && git reset "add-init-AGENTS.md" to update your local branch.

Feel free to ask for assistance when you get stuck 👍

@GSadee GSadee merged commit 3422114 into Sylius:2.0 Jun 12, 2025
9 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 12, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands:

  • 🚀 /bns:deploy to redeploy the environment


### Compatibility & Security

- Ensure compatibility with **Symfony 6.4 and 7.x**, and **PHP 8.2 or higher**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mpysiak This will have to be updated for each version bump, can we tell it that it's supporting the last 2 available version of Symfony? And more globally can we avoid setting version number in this file?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should instruct to read composer.json.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the same

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR was just for initial AGENTS.md creation. Feel free to open new PRs with changes. I think this will need some iterations to make it look good

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's possible good idea

@mpysiak mpysiak mentioned this pull request Jun 12, 2025
- Use trailing commas in multi-line arrays and argument lists
- Order array keys alphabetically where applicable
- Use PHPDoc only when necessary (e.g. `@var Collection<ProductInterface>`)
- Group class elements in this order: constants, properties, constructor, public methods, protected methods, private methods
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should group getter,setter methods for the same properties together as well. getter first like

getProduct()
setProduct()
getTaxon()
setTaxon()

## API

- Define resources in `admin/` and `shop/` folders accordingly
- Define operations in the following order: `get collection`, `get item`, `post`, `put`, `delete`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should add patch too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mpysiak mpysiak mentioned this pull request Jun 12, 2025
GSadee added a commit that referenced this pull request Jun 12, 2025
| Q               | A
|-----------------|-----
| Branch?         | 2.0
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | #18156
| License         | MIT

<!--
 - Bug fixes must be submitted against the 1.14 or 2.0 branch
 - Features and deprecations must be submitted against the 2.1 branch
 - Make sure that the correct base branch is set

To be sure you are not breaking any Backward Compatibilities, check the
documentation:

https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->
@coderabbitai coderabbitai bot mentioned this pull request Jun 13, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance CI configurations, READMEs, releases, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants