mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-25 10:21:36 -04:00
40 lines
1.2 KiB
Markdown
40 lines
1.2 KiB
Markdown
# 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: `camelCase` for variables and functions, `PascalCase` for classes, `UPPER_CASE` for 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 build` or `gulp`
|
|
|
|
## 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 `.env` files
|
|
- Use parameterized queries to prevent SQL injection
|
|
- Validate and sanitize all user input |