mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-25 10:21:36 -04:00
1.2 KiB
1.2 KiB
Agent Instructions
This document provides guidance for AI agents working on the Open Source Point of Sale (OSPOS) codebase.
Code Style
- Follow PHP CodeIgniter 4 coding standards
- Run PHP-CS-Fixer before committing:
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.no-header.php - Write PHP 8.1+ compatible code with proper type declarations
- Use PSR-12 naming conventions:
camelCasefor variables and functions,PascalCasefor classes,UPPER_CASEfor constants
Development
- Create a new git worktree for each issue, based on the latest state of
origin/master - Commit fixes to the worktree and push to the remote
Testing
- Run PHPUnit tests:
composer test - Tests must pass before submitting changes
Build
- Install dependencies:
composer install && npm install - Build assets:
npm run buildorgulp
Conventions
- Controllers go in
app/Controllers/ - Models go in
app/Models/ - Views go in
app/Views/ - Database migrations in
app/Database/Migrations/ - Use CodeIgniter 4 framework patterns and helpers
- Sanitize user input; escape output using
esc()helper
Security
- Never commit secrets, credentials, or
.envfiles - Use parameterized queries to prevent SQL injection
- Validate and sanitize all user input