# AvanzaOS Menu Theme AI Agent Instructions

All AI assistants (DeepSeek, ChatGPT / OpenAI, Google Gemini, Anthropic Claude, Cursor, GitHub Copilot, Windsurf, Qwen, Mistral, Devin) working within `avanzaos/theme/menu/` MUST adhere to these rules:

## 1. Strict Factory Default Protection
* `avanzaos_theme_*` tables are **strictly READ-ONLY**.
* Any front-end visual editor actions MUST write ONLY to `avanzaos_user_*` tables.
* NEVER create loops that iterate over `['avanzaos_user_', 'avanzaos_theme_']` to write data.

## 2. Reference Documentation
* Global Architectural Rules: [.agents/global.md](../../../.agents/global.md)
* Menu Module Deep Dive: [.agents/modules/menu.md](../../../.agents/modules/menu.md)
* Table & QR Ordering Architecture: [.agents/modules/table_qr_ordering.md](../../../.agents/modules/table_qr_ordering.md)

## 3. Pre-Task Checklist for AI
Before making any database queries or code modifications in services (`UserProductService.php`, `UserCategoryService.php`, `ThemeDataService.php`):
1. [ ] Confirm that all `INSERT`, `UPDATE`, and `DELETE` statements target `avanzaos_user_*` tables.
2. [ ] Ensure no changes touch factory template tables (`avanzaos_theme_*`).
3. [ ] Verify that Reset / Factory restore logic continues to function cleanly by reading from `avanzaos_theme_*`.
