# GEMINI.md - Maestro Configuration > **Version 4.0** - Maestro AI Development Orchestrator > This file defines how the AI behaves in this workspace. --- ## � CRITICAL: AGENT & SKILL PROTOCOL (START HERE) > **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule. ### 1. Modular Skill Loading Protocol ``` Agent activated → Check frontmatter "skills:" field │ └── For EACH skill: ├── Read SKILL.md (INDEX only) ├── Find relevant sections from content map └── Read ONLY those section files ``` - **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request. - **Rule Priority:** P0 (GEMINI.md) > P1 (Agent .md) > P2 (SKILL.md). All rules are binding. ### 2. Enforcement Protocol 1. **When agent is activated:** - ✅ READ all rules inside the agent file. - ✅ CHECK frontmatter `skills:` list. - ✅ LOAD each skill's `SKILL.md`. - ✅ APPLY all rules from agent AND skills. 2. **Forbidden:** Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory. --- ## �📥 REQUEST CLASSIFIER (STEP 2) **Before ANY action, classify the request:** | Request Type | Trigger Keywords | Active Tiers | Result | |--------------|------------------|--------------|--------| | **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response | | **SURVEY/INTEL**| "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) | | **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit | | **COMPLEX CODE**| "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** | | **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** | | **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable | --- ## TIER 0: UNIVERSAL RULES (Always Active) ### 🌐 Language Handling When user's prompt is NOT in English: 1. **Internally translate** for better comprehension 2. **Respond in user's language** - match their communication 3. **Code comments/variables** remain in English ### 🧹 Clean Code (Global Mandatory) **ALL code MUST follow `@[skills/clean-code]` rules. No exceptions.** - Concise, direct, solution-focused - No verbose explanations - No over-commenting - No over-engineering - **Self-Documentation:** Every agent is responsible for documenting their own changes in relevant `.md` files. - **Global Testing Mandate:** Every agent is responsible for writing and running tests for their changes. Follow the "Testing Pyramid" (Unit > Integration > E2E) and the "AAA Pattern" (Arrange, Act, Assert). - **Global Performance Mandate:** "Measure first, optimize second." Every agent must ensure their changes adhere to 2025 performance standards (Core Web Vitals for Web, query optimization for DB, bundle limits for FS). - **Infrastructure & Safety Mandate:** Every agent is responsible for the deployability and operational safety of their changes. Follow the "5-Phase Deployment Process" (Prepare, Backup, Deploy, Verify, Confirm/Rollback). Always verify environment variables and secrets security. ### 📁 File Dependency Awareness **Before modifying ANY file:** 1. Check `CODEBASE.md` → File Dependencies 2. Identify dependent files 3. Update ALL affected files together ### 🗺️ System Map Read > 🔴 **MANDATORY:** Read `ARCHITECTURE.md` at session start to understand Agents, Skills, and Scripts. **Path Awareness:** - Agents: `~/.agent/` (Global) - Skills: `~/.gemini/antigravity/skills/` (Global) - Runtime Scripts: `~/.gemini/antigravity/skills//scripts/` ### 🧠 Read → Understand → Apply ``` ❌ WRONG: Read agent file → Start coding ✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code ``` **Before coding, answer:** 1. What is the GOAL of this agent/skill? 2. What PRINCIPLES must I apply? 3. How does this DIFFER from generic output? --- ## TIER 1: CODE RULES (When Writing Code) ### 📱 Project Type Routing | Project Type | Primary Agent | Skills | |--------------|---------------|--------| | **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design | | **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design | | **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design | > 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY. ### 🛑 Socratic Gate **For complex requests, STOP and ASK first:** ### 🛑 GLOBAL SOCRATIC GATE (TIER 0) **MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.** | Request Type | Strategy | Required Action | |--------------|----------|-----------------| | **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions | | **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions | | **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope | | **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details | | **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions | **Protocol:** 1. **Never Assume:** If even 1% is unclear, ASK. 2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** (e.g., "LocalStorage confirmed, but should we handle data clearing or versioning?") before starting. 3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate. 4. **Reference:** Full protocol in `@[skills/brainstorming]`. ### 🏁 Final Checklist Protocol **Trigger:** When the user says "son kontrolleri yap", "final checks", "çalıştır tüm testleri", or similar phrases. | Task Stage | Command | Purpose | |------------|---------|---------| | **Manual Audit** | `python scripts/checklist.py .` | Priority-based project audit | | **Pre-Deploy** | `python scripts/checklist.py . --url ` | Full Suite + Performance + E2E | **Priority Execution Order:** 1. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E** **Rules:** - **Completion:** A task is NOT finished until `checklist.py` returns success. - **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint). **Available Scripts (12 total):** | Script | Skill | When to Use | |--------|-------|-------------| | `security_scan.py` | vulnerability-scanner | Always on deploy | | `dependency_analyzer.py` | vulnerability-scanner | Weekly / Deploy | | `lint_runner.py` | lint-and-validate | Every code change | | `test_runner.py` | testing-patterns | After logic change | | `schema_validator.py` | database-design | After DB change | | `ux_audit.py` | frontend-design | After UI change | | `accessibility_checker.py` | frontend-design | After UI change | | `seo_checker.py` | seo-fundamentals | After page change | | `bundle_analyzer.py` | performance-profiling | Before deploy | | `mobile_audit.py` | mobile-design | After mobile change | | `lighthouse_audit.py` | performance-profiling | Before deploy | | `playwright_runner.py` | webapp-testing | Before deploy | > 🔴 **Agents & Skills can invoke ANY script** via `python ~/.gemini/antigravity//scripts/