Contribution Guide & AI Integration
Relevant source files
The following files were used as context for generating this wiki page:
PrestaShop is an open-source e-commerce web application written primarily in PHP. The project relies on community contributions for improvements, bug fixes, and translations. This guide defines the standards for code contributions, ethical behavior, and the integration of Artificial Intelligence (AI) tools in the development process.
Developers contribute to the project by following specific branching strategies, adhering to licensing requirements, and utilizing provided Docker environments for local testing. AI tools are supported provided they follow the project-defined context and architectural rules.
Sources: README.md:14-25, CONTRIBUTING.md:3-8
Technical Contribution Workflow
The project uses Git for source code management. Core files must use the Open Software License (OSL 3.0), while module files must use the Academic Free License (AFL 3.0).
Branching Strategy
PrestaShop follows a specific flavor of the Git Flow branching model. The develop branch serves as the workspace for the next version (currently 9.1).
| Branch Type | Target Branch | Purpose |
|---|---|---|
| Bug Fixes | 8.x or supported branches | Resolving issues in stable releases |
| New Features | develop | Introducing compatible or incompatible features |
Sources: CONTRIBUTING.md:27-33, README.md:34-37
Development Environment
A Docker-based environment provides a standardized setup for contributors. The environment includes a web server (PHP 8.1+), MySQL 5.6+, and email testing tools.
The diagram shows the logic used by the Docker container to decide whether to run an automated installation or start existing services.
Sources: README.md:52-77
AI-Assisted Development
The project allows the use of AI tools to write code. These tools must adhere to the context defined in the .ai/ directory to ensure architectural consistency.
- Context Management: AI agents must read
.ai/CONTEXT.mdfor project-wide rules and domain-specific contexts. - Structure: The
.ai/STRUCTURE.mdfile defines how the AI folder is organized for agent consumption. - Domain Context: Specific components have individual context files indexed in the main AI context file.
Sources: GEMINI.md:3-8, README.md:126-128
Quality Assurance & Testing
Contributors must validate their changes using the project's testing suite. The UI testing framework is built on Playwright and Mocha.
Automated Checks
The project executes several CI/CD workflows for every pull request:
- PHP Checks: Unit tests and static analysis.
- Integration Tests: Validating component interactions.
- UI Tests: Sanity and functional tests for the Front Office and Back Office.
UI Test Suites
The tests/UI/package.json file defines specific scripts for targeted testing:
| Script | Command | Description |
|---|---|---|
lint | eslint . | Checks code style |
test:sanity | npm run test:specific | Runs basic smoke tests |
test:functional:BO | npm run test:specific | Tests Back Office functionality |
test:all | ts-mocha ... | Runs the full testing campaign |
Sources: README.md:3-12, tests/UI/package.json:10-94
Community Standards
The PrestaShop Code of Conduct ensures a harassment-free environment. Maintainers enforce these standards across all project spaces, including GitHub and Slack.
The diagram illustrates the process for reporting and resolving violations of the Code of Conduct.
Sources: CODE_OF_CONDUCT.md:1-55
Conclusion
Contributing to PrestaShop requires adherence to specific licensing, branching, and testing protocols. By utilizing the Docker development environment and following AI integration guidelines, developers ensure their contributions meet the technical and architectural standards of the project. Enforcement of the Code of Conduct maintains a professional and inclusive community for all participants.