# AI EXECUTION RULES – ERPdash

These rules control how AI agents should implement tasks in the project.

---

# General Rules

AI must:

- follow AI_MASTER_PROJECT.md
- follow ARCHITECTURE_RULES.md
- follow DATABASE_SCHEMA.md
- follow PERMISSIONS_MAP.md

Never invent new architecture patterns.

---

# Task Execution

AI must execute tasks step by step.

Example:

Step 1 → Migration
Step 2 → Model
Step 3 → Service
Step 4 → Request
Step 5 → Controller
Step 6 → Views
Step 7 → Lang files

AI must NOT generate everything at once.

---

# Token Optimization

To reduce token usage:

- generate one file at a time
- avoid repeating project rules
- reference existing docs

Example prompt:

Follow docs/ai/AI_MASTER_PROJECT.md
Follow docs/ai/tasks/task-05-cost-centers.md

Implement Step 1 only.

---

# File Safety

AI must NOT:

- modify unrelated files
- rename existing tables
- change migrations already applied

---

# Confirmation Rule

AI must stop after each step and wait for confirmation before continuing.

---

# Testing

Testing should not be generated during feature development.

Testing must be handled in a separate Testing phase.

