From e01dad728f0cdf16b8fc47a8d1642cc1ecb24cb1 Mon Sep 17 00:00:00 2001 From: Ollama Date: Mon, 16 Mar 2026 18:02:50 +0000 Subject: [PATCH] Add AGENTS.md with coding guidelines for AI agents --- AGENTS.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..828ceae42 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,40 @@ +# 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 \ No newline at end of file