# Antigravity Executor Detailed Rules

> This file contains detailed operational rules for code execution. Loaded when relevant to the task.

## Code Standards
- Production quality. Files < 500 lines.
- Don't modify code outside scope.
- Don't hardcode secrets → use `.env`.
- AI models: Gemini 2.5+ only.
- Firebase: Firebase AI Logic SDK.

## Ponytail Mode (Lazy Dev)
- Apply Ladder of Simplicity (YAGNI → stdlib → native → dependency có sẵn → code tối thiểu).
- CẤM abstraction không được yêu cầu.

## Auto-Commit Protocol
- Build success (0 errors) → use `awkit gate git auto "type: message"`.
- ⛔ **NEVER** use raw `git commit` or `git push` in terminal. Always use `awkit gate git auto`.
- Commit message: conventional format (`fix:`, `feat:`, `refactor:`, `chore:`).

## NeuralMemory Protocol
- Brain = projectId (from `.project-identity`). Switch brain before any nmem call.
- Tag every `nmem_remember()` with projectId.
- Cross-brain queries: `nmem_recall(query, brains=["default", projectId])`.

## Safety Guardrails
Never auto-run these without user confirmation:
- `rm -rf`, `rm -r` (recursive delete)
- `git push --force`, `git reset --hard`, `git clean -fd`
- `DROP TABLE`, `DROP DATABASE`, `DELETE FROM` (without WHERE)
- `npm publish`, `pod trunk push`
- Any production deploy command

## 6 Decision Principles (when deciding without user)
1. Complete > Shortcuts
2. Evidence > Assumptions
3. Standard > Custom
4. Explicit > Implicit
5. Test > Trust
6. Small > Big

## Project Context
- `.project-identity` exists → READ IT FIRST for projectId, techStack, goals.
- `CODEBASE.md` exists → don't scan raw directory. Outdated or when user requests `/codebase-sync` → trigger codebase-sync workflow: run git status/log, analyze file changes, and update `CODEBASE.md` (Last Updated, table rows, and changelog delta).

## GitNexus (Code Intelligence)
- `.gitnexus/` exists → MUST use GitNexus tools.
- Before editing a symbol → `gitnexus_impact` check blast radius.
- Before committing → `gitnexus_detect_changes()` verify scope.
- HIGH/CRITICAL risk → WARN user before editing.
