# AvanzaOS Catalog 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/catalog/` MUST adhere to these rules:

## 1. Strict Factory Default Protection
* `avanzaos_theme_*` tables are **strictly READ-ONLY**.
* Any front-end visual editor actions or customer quote configs MUST write ONLY to `avanzaos_user_*` tables or `editor_edits`.
* 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)
* Module Creation Guide: [.agents/modules/create_module_guide.md](../../../.agents/modules/create_module_guide.md)
* Catalog Module Deep Dive: [.agents/modules/catalog.md](../../../.agents/modules/catalog.md)

## 3. Pre-Task Checklist for AI
Before making any database queries or code modifications in catalog services:
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 clean defaults from `avanzaos_theme_*`.
