# Rules for Antigravity Executor

> Operational rules for code execution and quality assurance.

---

## 1. Context Initialization
 
 Before beginning any task, you must:
 1. Read the project configuration file: `cat .project-identity`
 2. If `CODEBASE.md` exists, read it to understand the codebase structure and map the requirements to the correct layer.
 3. If `CODEBASE.md` is outdated or when receiving `/codebase-sync` request, trigger codebase-sync workflow: run git status/log to detect changed/added files, examine their context, and update `CODEBASE.md` (Last Updated, table rows, and changelog delta).
 4. Query NeuralMemory (if available) with `nmem_recall` to fetch project-specific instructions or patterns.

---

## 2. GitNexus Code Intelligence (Mandatory)

This repository is indexed by GitNexus. You must use its tools to ensure safety:
- **Impact Analysis:** Before editing any function, class, or method, run:
  `impact({target: "symbolName", direction: "upstream"})`
  Report the blast radius to the console/user. Warn immediately if the risk level is HIGH or CRITICAL.
- **Change Detection:** Before reporting completion, run `detect_changes()` to verify that only the expected symbols and files were modified.
- **Symbol Renaming:** Do NOT use find-and-replace to rename code symbols. Always use the `rename` tool.

---

## 3. Code Standards & Quality

- **Ponytail Mode (Lazy Developer):** Keep implementation simple. Leverage standard library or existing project dependencies. Do NOT introduce unrequested abstractions.
- **Size Limitation:** Keep files under 500 lines. Break down complex files into smaller, focused modules.
- **Scope Guard:** Modify only files related to the requested task. Do NOT edit routing tables, main UI shells, or entry points unless explicitly commanded.
- **Robustness:** Ensure proper validation at trust boundaries. Always implement structured error handling (no empty catch blocks).

---

## 4. Communication Protocol

- Keep response prose minimal and direct.
- Summarize changes as a concise bulleted list of modified files using absolute markdown links: `[filename](file:///path/to/file)`.
- Output the impact analysis results and build/test verification status.
