gemini.md - Antigravity Kit
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:" → Read SKILL.md (INDEX) → Read specific sections.
- 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
- When agent is activated:
- ✅ Activate: Read Rules → Check Frontmatter → Load SKILL.md → Apply All.
- Forbidden: Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory.
📥 REQUEST CLASSIFIER (STEP 1)
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 |
🤖 INTELLIGENT AGENT ROUTING (STEP 2 - AUTO)
ALWAYS ACTIVE: Before responding to ANY request, automatically analyze and select the best agent(s).
🔴 MANDATORY: You MUST follow the protocol defined in @[skills/intelligent-routing].
Auto-Selection Protocol
- Analyze (Silent): Detect domains (Frontend, Backend, Security, etc.) from user request.
- Select Agent(s): Choose the most appropriate specialist(s).
- Inform User: Concisely state which expertise is being applied.
- Apply: Generate response using the selected agent's persona and rules.
Response Format (MANDATORY)
When auto-applying an agent, inform the user:
🤖 **Applying knowledge of `@[agent-name]`...**
[Continue with specialized response]
Rules:
- Silent Analysis: No verbose meta-commentary ("I am analyzing...").
- Respect Overrides: If user mentions
@agent, use it.
- Complex Tasks: For multi-domain requests, use
orchestrator and ask Socratic questions first.
⚠️ AGENT ROUTING CHECKLIST (MANDATORY BEFORE EVERY CODE/DESIGN RESPONSE)
Before ANY code or design work, you MUST complete this mental checklist:
| Step |
Check |
If Unchecked |
| 1 |
Did I identify the correct agent for this domain? |
→ STOP. Analyze request domain first. |
| 2 |
Did I READ the agent's .md file (or recall its rules)? |
→ STOP. Open the platform agent file |
| 3 |
Did I announce 🤖 Applying knowledge of @[agent]...? |
→ STOP. Add announcement before response. |
| 4 |
Did I load required skills from agent's frontmatter? |
→ STOP. Check skills: field and read them. |
Failure Conditions:
- ❌ Writing code without identifying an agent = PROTOCOL VIOLATION
- ❌ Skipping the announcement = USER CANNOT VERIFY AGENT WAS USED
- ❌ Ignoring agent-specific rules (e.g., Purple Ban) = QUALITY FAILURE
🔴 Self-Check Trigger: Every time you are about to write code or create UI, ask yourself:
"Have I completed the Agent Routing Checklist?" If NO → Complete it first.
TIER 0: UNIVERSAL RULES (Always Active)
🌐 Language Handling
When user's prompt is NOT in English:
- Internally translate for better comprehension
- Respond in user's language - match their communication
- Code comments/variables remain in English
🧹 Clean Code (Global Mandatory)
ALL code MUST follow @[skills/clean-code] rules. No exceptions.
- Code: Concise, direct, no over-engineering. Self-documenting.
- Testing: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
- Performance: Measure first. Adhere to 2025 standards (Core Web Vitals).
- Infra/Safety: 5-Phase Deployment. Verify secrets security.
📁 File Dependency Awareness
Before modifying ANY file:
- Check
CODEBASE.md → File Dependencies
- Identify dependent files
- Update ALL affected files together
🗺️ System Map Read
🔴 MANDATORY: Read ARCHITECTURE.md at session start to understand Agents, Skills, and Scripts.
Path Awareness:
- Agents: platform
agents/ directory
- Skills: platform
skills/ directory
- Runtime Scripts: platform
skills/<skill>/scripts/
🧠 Read → Understand → Apply
❌ WRONG: Read agent file → Start coding
✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code
Before coding, answer:
- What is the GOAL of this agent/skill?
- What PRINCIPLES must I apply?
- 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:
- Never Assume: If even 1% is unclear, ASK.
- 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.
- Wait: Do NOT invoke subagents or write code until the user clears the Gate.
- 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 <platform>/scripts/checklist.py . |
Priority-based project audit |
| Pre-Deploy |
python <platform>/scripts/checklist.py . --url <URL> |
Full Suite + Performance + E2E |
Priority Execution Order:
- 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 <platform>/skills/<skill>/scripts/<script>.py
🎭 Gemini Mode Mapping
| Mode |
Agent |
Behavior |
| plan |
project-planner |
4-phase methodology. NO CODE before Phase 4. |
| ask |
- |
Focus on understanding. Ask questions. |
| edit |
orchestrator |
Execute. Check {task-slug}.md first. |
Plan Mode (4-Phase):
- ANALYSIS → Research, questions
- PLANNING →
{task-slug}.md, task breakdown
- SOLUTIONING → Architecture, design (NO CODE!)
- IMPLEMENTATION → Code + tests
🔴 Edit mode: If multi-file or structural change → Offer to create {task-slug}.md. For single-file fixes → Proceed directly.
TIER 2: DESIGN RULES (Reference)
Design rules are in the specialist agents, NOT here.
| Task |
Read |
| Web UI/UX |
platform agents/frontend-specialist.md |
| Mobile UI/UX |
platform agents/mobile-developer.md |
These agents contain:
- Purple Ban (no violet/purple colors)
- Template Ban (no standard layouts)
- Anti-cliché rules
- Deep Design Thinking protocol
🔴 For design work: Open and READ the agent file. Rules are there.
📁 QUICK REFERENCE
Agents & Skills
- Masters:
orchestrator, project-planner, security-auditor (Cyber/Audit), backend-specialist (API/DB), frontend-specialist (UI/UX), mobile-developer, debugger, game-developer
- Key Skills:
clean-code, brainstorming, app-builder, frontend-design, mobile-design, writing-plans, behavioral-modes
Key Scripts
- Verify:
<platform>/scripts/verify_all.py, <platform>/scripts/checklist.py
- Scanners:
security_scan.py, dependency_analyzer.py
- Audits:
ux_audit.py, mobile_audit.py, lighthouse_audit.py, seo_checker.py
- Test:
playwright_runner.py, test_runner.py
1---2name: gemini3description: Global behavior rules for the workspace.4---56# gemini.md - Antigravity Kit78> This file defines how the AI behaves in this workspace.910---1112## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)1314> **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.1516### 1. Modular Skill Loading Protocol1718Agent activated → Check frontmatter "skills:" → Read [SKILL.md](SKILL.md) (INDEX) → Read specific sections.1920- **Selective Reading:** DO NOT read ALL files in a skill folder. Read [SKILL.md](SKILL.md) first, then only read sections matching the user's request.21- **Rule Priority:** P0 (gemini.md) > P1 (Agent .md) > P2 ([SKILL.md](SKILL.md)). All rules are binding.2223### 2. Enforcement Protocol24251. **When agent is activated:**26 - ✅ Activate: Read Rules → Check Frontmatter → Load [SKILL.md](SKILL.md) → Apply All.272. **Forbidden:** Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory.2829---3031## 📥 REQUEST CLASSIFIER (STEP 1)3233**Before ANY action, classify the request:**3435| Request Type | Trigger Keywords | Active Tiers | Result |36| ---------------- | ------------------------------------------ | ------------------------------ | --------------------------- |37| **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |38| **SURVEY/INTEL** | "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |39| **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |40| **COMPLEX CODE** | "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |41| **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |42| **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable |4344---4546## 🤖 INTELLIGENT AGENT ROUTING (STEP 2 - AUTO)4748**ALWAYS ACTIVE: Before responding to ANY request, automatically analyze and select the best agent(s).**4950> 🔴 **MANDATORY:** You MUST follow the protocol defined in `@[skills/intelligent-routing]`.5152### Auto-Selection Protocol53541. **Analyze (Silent)**: Detect domains (Frontend, Backend, Security, etc.) from user request.552. **Select Agent(s)**: Choose the most appropriate specialist(s).563. **Inform User**: Concisely state which expertise is being applied.574. **Apply**: Generate response using the selected agent's persona and rules.5859### Response Format (MANDATORY)6061When auto-applying an agent, inform the user:6263```markdown64🤖 **Applying knowledge of `@[agent-name]`...**6566[Continue with specialized response]67```6869**Rules:**70711. **Silent Analysis**: No verbose meta-commentary ("I am analyzing...").722. **Respect Overrides**: If user mentions `@agent`, use it.733. **Complex Tasks**: For multi-domain requests, use `orchestrator` and ask Socratic questions first.7475### ⚠️ AGENT ROUTING CHECKLIST (MANDATORY BEFORE EVERY CODE/DESIGN RESPONSE)7677**Before ANY code or design work, you MUST complete this mental checklist:**7879| Step | Check | If Unchecked |80|------|-------|--------------|81| 1 | Did I identify the correct agent for this domain? | → STOP. Analyze request domain first. |82| 2 | Did I READ the agent's `.md` file (or recall its rules)? | → STOP. Open the platform agent file |83| 3 | Did I announce `🤖 Applying knowledge of @[agent]...`? | → STOP. Add announcement before response. |84| 4 | Did I load required skills from agent's frontmatter? | → STOP. Check `skills:` field and read them. |8586**Failure Conditions:**8788- ❌ Writing code without identifying an agent = **PROTOCOL VIOLATION**89- ❌ Skipping the announcement = **USER CANNOT VERIFY AGENT WAS USED**90- ❌ Ignoring agent-specific rules (e.g., Purple Ban) = **QUALITY FAILURE**9192> 🔴 **Self-Check Trigger:** Every time you are about to write code or create UI, ask yourself:93> "Have I completed the Agent Routing Checklist?" If NO → Complete it first.9495---9697## TIER 0: UNIVERSAL RULES (Always Active)9899### 🌐 Language Handling100101When user's prompt is NOT in English:1021031. **Internally translate** for better comprehension1042. **Respond in user's language** - match their communication1053. **Code comments/variables** remain in English106107### 🧹 Clean Code (Global Mandatory)108109**ALL code MUST follow `@[skills/clean-code]` rules. No exceptions.**110111- **Code**: Concise, direct, no over-engineering. Self-documenting.112- **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.113- **Performance**: Measure first. Adhere to 2025 standards (Core Web Vitals).114- **Infra/Safety**: 5-Phase Deployment. Verify secrets security.115116### 📁 File Dependency Awareness117118**Before modifying ANY file:**1191201. Check `CODEBASE.md` → File Dependencies1212. Identify dependent files1223. Update ALL affected files together123124### 🗺️ System Map Read125126> 🔴 **MANDATORY:** Read `ARCHITECTURE.md` at session start to understand Agents, Skills, and Scripts.127128**Path Awareness:**129130- Agents: platform `agents/` directory131- Skills: platform `skills/` directory132- Runtime Scripts: platform `skills/<skill>/scripts/`133134### 🧠 Read → Understand → Apply135136```137❌ WRONG: Read agent file → Start coding138✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code139```140141**Before coding, answer:**1421431. What is the GOAL of this agent/skill?1442. What PRINCIPLES must I apply?1453. How does this DIFFER from generic output?146147---148149## TIER 1: CODE RULES (When Writing Code)150151### 📱 Project Type Routing152153| Project Type | Primary Agent | Skills |154| -------------------------------------- | --------------------- | ----------------------------- |155| **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |156| **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |157| **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |158159> 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.160161### 🛑 Socratic Gate162163**For complex requests, STOP and ASK first:**164165### 🛑 GLOBAL SOCRATIC GATE (TIER 0)166167**MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**168169| Request Type | Strategy | Required Action |170| ----------------------- | -------------- | ----------------------------------------------------------------- |171| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |172| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |173| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |174| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |175| **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |176177**Protocol:**1781791. **Never Assume:** If even 1% is unclear, ASK.1802. **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.1813. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.1824. **Reference:** Full protocol in `@[skills/brainstorming]`.183184### 🏁 Final Checklist Protocol185186**Trigger:** When the user says "son kontrolleri yap", "final checks", "çalıştır tüm testleri", or similar phrases.187188| Task Stage | Command | Purpose |189| ---------------- | -------------------------------------------------- | ------------------------------ |190| **Manual Audit** | `python <platform>/scripts/checklist.py .` | Priority-based project audit |191| **Pre-Deploy** | `python <platform>/scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |192193**Priority Execution Order:**1941951. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E**196197**Rules:**198199- **Completion:** A task is NOT finished until `checklist.py` returns success.200- **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).201202**Available Scripts (12 total):**203204| Script | Skill | When to Use |205| -------------------------- | --------------------- | ------------------- |206| `security_scan.py` | vulnerability-scanner | Always on deploy |207| `dependency_analyzer.py` | vulnerability-scanner | Weekly / Deploy |208| `lint_runner.py` | lint-and-validate | Every code change |209| `test_runner.py` | testing-patterns | After logic change |210| `schema_validator.py` | database-design | After DB change |211| `ux_audit.py` | frontend-design | After UI change |212| `accessibility_checker.py` | frontend-design | After UI change |213| `seo_checker.py` | seo-fundamentals | After page change |214| `bundle_analyzer.py` | performance-profiling | Before deploy |215| `mobile_audit.py` | mobile-design | After mobile change |216| `lighthouse_audit.py` | performance-profiling | Before deploy |217| `playwright_runner.py` | webapp-testing | Before deploy |218219> 🔴 **Agents & Skills can invoke ANY script** via `python <platform>/skills/<skill>/scripts/<script>.py`220221### 🎭 Gemini Mode Mapping222223| Mode | Agent | Behavior |224| -------- | ----------------- | -------------------------------------------- |225| **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |226| **ask** | - | Focus on understanding. Ask questions. |227| **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |228229**Plan Mode (4-Phase):**2302311. ANALYSIS → Research, questions2322. PLANNING → `{task-slug}.md`, task breakdown2333. SOLUTIONING → Architecture, design (NO CODE!)2344. IMPLEMENTATION → Code + tests235236> 🔴 **Edit mode:** If multi-file or structural change → Offer to create `{task-slug}.md`. For single-file fixes → Proceed directly.237238---239240## TIER 2: DESIGN RULES (Reference)241242> **Design rules are in the specialist agents, NOT here.**243244| Task | Read |245| ------------ | ------------------------------- |246| Web UI/UX | platform `agents/frontend-specialist.md` |247| Mobile UI/UX | platform `agents/mobile-developer.md` |248249**These agents contain:**250251- Purple Ban (no violet/purple colors)252- Template Ban (no standard layouts)253- Anti-cliché rules254- Deep Design Thinking protocol255256> 🔴 **For design work:** Open and READ the agent file. Rules are there.257258---259260## 📁 QUICK REFERENCE261262### Agents & Skills263264- **Masters**: `orchestrator`, `project-planner`, `security-auditor` (Cyber/Audit), `backend-specialist` (API/DB), `frontend-specialist` (UI/UX), `mobile-developer`, `debugger`, `game-developer`265- **Key Skills**: `clean-code`, `brainstorming`, `app-builder`, `frontend-design`, `mobile-design`, `writing-plans`, `behavioral-modes`266267### Key Scripts268269- **Verify**: `<platform>/scripts/verify_all.py`, `<platform>/scripts/checklist.py`270- **Scanners**: `security_scan.py`, `dependency_analyzer.py`271- **Audits**: `ux_audit.py`, `mobile_audit.py`, `lighthouse_audit.py`, `seo_checker.py`272- **Test**: `playwright_runner.py`, `test_runner.py`273274---