This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Initialize Docker environment and install dependencies
make init
# Initialize database and run migrations
make database-init
# Load fixtures (optional)
make load-fixtures
# Start/stop containers
make up
make down
# Access containers
make php-shell
make node-shell# Frontend setup
(cd vendor/sylius/test-application && yarn install)
(cd vendor/sylius/test-application && yarn build)
vendor/bin/console assets:install
# Database setup
vendor/bin/console doctrine:database:create
vendor/bin/console doctrine:migrations:migrate -n
vendor/bin/console sylius:fixtures:load -n
# Start server
symfony server:start -d# PHPUnit tests
vendor/bin/phpunit
make phpunit # Docker
# Behat tests (non-JS)
vendor/bin/behat --strict --tags="~@javascript&&~@mink:chromedriver"
make behat # Docker
# Behat tests (JS scenarios)
# Requires Chrome headless and symfony server
APP_ENV=test symfony server:start --port=8080 --daemon
vendor/bin/behat --strict --tags="@javascript,@mink:chromedriver"# PHPStan analysis
vendor/bin/phpstan analyse -c phpstan.neon -l max src/
make phpstan # Docker
# Coding standards
vendor/bin/ecs check
make ecs # Docker# Database reset with fixtures
composer run database-reset
# Frontend rebuild
composer run frontend-clear
# Complete test app initialization
composer run test-app-initThis is a Sylius Plugin Skeleton - a template for creating Sylius e-commerce plugins. It provides a complete development environment with both traditional and Docker setups.
- Main Plugin Class:
src/AcmeSyliusExamplePlugin.php- Entry point usingSyliusPluginTrait - DI Extension:
src/DependencyInjection/AcmeSyliusExampleExtension.php- Handles service loading and Doctrine migrations - Services:
config/services.xml- Service definitions with XML configuration - Routes:
config/routes/- Separate admin and shop route definitions - Templates:
templates/- Twig templates for admin and shop with Twig hooks support
- Test Application: Uses
sylius/test-applicationfor plugin testing in isolation - Asset Management: Webpack Encore for frontend asset compilation
- Database: Doctrine migrations with proper namespace handling
- Testing: Full Behat + PHPUnit setup with browser testing support
- Code Quality: PHPStan, ECS (Easy Coding Standard), and Rector integration
- Docker: Complete containerized environment with PHP, Node.js, and database
- Traditional: Local Symfony server with manual dependency management
- Frontend: Yarn-based asset pipeline through test application
- Unit/Integration: PHPUnit for isolated component testing
- Functional: Behat for feature testing with browser automation
- Static Analysis: PHPStan for type checking and code quality
- Standards: ECS for coding standard enforcement
Database credentials should be configured in:
tests/TestApplication/.env(for development)tests/TestApplication/.env.test(for testing)
This project includes specialized AI guides to assist with common plugin development tasks:
- CLEANUP_GUIDE.md - Guidelines for cleaning up and organizing plugin code
- RENAME_GUIDE.md - Step-by-step instructions for renaming plugins and components
- COMPATIBILITY_GUIDE.md - Best practices for maintaining compatibility across different Sylius versions
These guides provide detailed instructions and automated workflows to help maintain code quality and ensure proper plugin structure.