<laravel-boost-guidelines>
=== foundation rules ===

# Laravel Boost Guidelines

## Foundational Context

This application is a Laravel application running on PHP 8.3. Always use the APIs that match the installed major version of each package — do not assume a version.

Before relying on a package's API, confirm its installed version:
- PHP packages: run `composer show --direct` to list direct dependencies with versions, or `composer show <vendor/package>` for a single package.
- JS packages: check `package.json` for the installed versions.

## Conventions

- You must follow all existing code conventions used in this application. When creating or editing a file, check sibling files for the correct structure, approach, and naming.
- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`.
- Check for existing components to reuse before writing a new one.

## Verification Scripts

- Do not create verification scripts or tinker when tests cover that functionality and prove they work. Unit and feature tests are more important.

## Application Structure & Architecture

- Stick to existing directory structure; don't create new base folders without approval.
- Do not change the application's dependencies without approval.

## Frontend Bundling

- If a frontend change doesn't show in the UI or you get a "Unable to locate file in Vite manifest" error, run `npm run build` or ask the user to run `npm run dev` or `composer run dev`.

## Documentation Files

- You must only create documentation files if explicitly requested by the user.

=== boost rules ===

# Laravel Boost

## Project Rules

- This project contains committed, area-grouped rules in `.ai/rules` when that directory exists, including path-scoped framework guidelines under `.ai/rules/boost`. Before you enter plan mode or create/edit any file, you MUST first: open @.ai/rules/index.md (it maps file globs to rule files), read every rule file whose globs cover the path(s) in scope, and run `grep -rin 'keyword' .ai/rules` to catch what a path match alone misses. Do not write code until you have read and are following every matching rule. If `.ai/rules` does not exist, continue without it.

## Artisan

- Run Artisan commands directly via the command line (e.g., `php artisan route:list`). Use `php artisan list` to discover available commands and `php artisan [command] --help` to check parameters.
- Inspect routes with `php artisan route:list`. Filter with: `--method=GET`, `--name=users`, `--path=api`, `--except-vendor`, `--only-vendor`.
- Read configuration values using dot notation: `php artisan config:show app.name`, `php artisan config:show database.default`. Or read config files directly from the `config/` directory.

## Tinker

- Execute PHP in app context for debugging and testing code. Do not create models without user approval, prefer tests with factories instead. Prefer existing Artisan commands over custom tinker code.
- Always use single quotes to prevent shell expansion: `php artisan tinker --execute 'Your::code();'`
  - Double quotes for PHP strings inside: `php artisan tinker --execute 'User::where("active", true)->count();'`

=== php rules ===

# PHP

- Always use curly braces for control structures, even for single-line bodies.
- Use PHP 8 constructor property promotion: `public function __construct(public GitHub $github) { }`. Do not leave empty zero-parameter `__construct()` methods unless the constructor is private.
- Use explicit return type declarations and type hints for all method parameters: `function isAccessible(User $user, ?string $path = null): bool`
- Use TitleCase for Enum keys: `FavoritePerson`, `BestLake`, `Monthly`.
- Prefer PHPDoc blocks over inline comments. Only add inline comments for exceptionally complex logic.
- Use array shape type definitions in PHPDoc blocks.

=== deployments rules ===

# Deployment

- Laravel can be deployed using [Laravel Cloud](https://cloud.laravel.com/), which is the fastest way to deploy and scale production Laravel applications.

</laravel-boost-guidelines>

## Reglas específicas de SGE

Actualizado: 3 de diciembre de 2026.

- La documentación vigente, guías y tutoriales se administran desde Ayuda y soporte y se guardan en `guias_ayuda`. No crear copias Markdown de estos contenidos ni depender de carpetas externas de contexto.
- `AyudaSeeder`, incluido en `DatabaseSeeder`, utiliza `database/seeders/data/ayuda.json` como copia inicial de reinstalación. No debe sobrescribir registros existentes, ocultamientos ni eliminaciones auditadas. Los cambios posteriores del panel se recuperan con los respaldos de la base de datos y sus adjuntos.
- Las instrucciones detalladas de cron y el mapa del código están dentro de Ayuda y soporte, en Instalación y operación y Manual del programador. La jornada automática se inicia una vez al día a las 08:00 de America/Bogota y termina como máximo a las 10:00. No ejecutar envíos reales para comprobar una instalación ni cambiar a un cron cada minuto.
- Mantener `README.md` como presentación e instrucciones esenciales del repositorio. Este `AGENTS.md` se conserva por decisión del responsable como reglas para asistentes de programación; actualizarlo cuando cambien estas reglas.
- El servidor debe servir únicamente `public`. Los archivos privados se entregan por controladores autorizados; mantener desactivado `filesystems.disks.local.serve`. No exponer seeders, configuración, respaldos, logs o credenciales.
- Los permisos y la propiedad de registros se verifican en servidor. El borrado administrativo requiere el rol y el permiso correspondientes; no depender solo de botones ocultos.
- No reiniciar la base activa ni eliminar datos reales o de prueba sin autorización expresa. Los sembradores de ejemplos se mantienen fuera del sembrado inicial automático.
- El alcance habitual es Laravel. No modificar PHP, Apache o la configuración del servidor sin una instrucción expresa del responsable. Los cambios en dependencias requieren autorización previa.
- Usar pruebas aisladas para verificar los cambios. No regenerar contenido de ayuda desde archivos sobre las ediciones del panel. Mantener `.env.example` sin secretos y respetar las exclusiones de archivos locales en `.gitignore`.
