Who this is for: Anyone starting a new project or adding a new feature in Antigravity IDE. Goal: Set up Antigravity correctly before writing a single line of code so the AI agent works precisely, wastes zero tokens, and produces correct output on the first attempt.
- Why Token Optimization Matters
- How Antigravity Consumes Tokens
- The Two Scenarios
- 3A. Starting a Brand New Project
- 3B. Adding a Feature to an Existing Project
- Step-by-Step Setup — New Project
- Step 1: Create the Folder Structure
- Step 2: Write gemini.md (Project Identity)
- Step 3: Add Rules
- Step 4: Add Workflows
- Step 5: Add Skills
- Step 6: Add .antigravityignore
- Step 7: Connect MCP Servers
- Step 8: Select the Right Model
- Step 9: Write Your First Prompt
- Step-by-Step Setup — Existing Project / New Task
- Step 1: Update gemini.md
- Step 2: Check Rules Still Apply
- Step 3: Use the Right Workflow
- Step 4: Plan in ChatGPT or Claude First
- Step 5: Write a Scoped Prompt
- Deep Dive: Each Tool Explained
- gemini.md
- Rules
- Workflows
- Skills
- MCP Servers
- .antigravityignore
- Model Selection Guide
- Prompt Writing Guide
- Token Usage by Activity
- When Quota Runs Out
- Quick Reference Cheatsheet
Antigravity IDE is free during preview but has a weekly token quota. Each model has a different rate of token consumption:
| Model | Token Speed | Use Case |
|---|---|---|
| Gemini Flash | Slow burn | Simple tasks, 1–2 files |
| Gemini 3 Pro | Fast burn | Complex tasks, multi-file |
| Claude Sonnet | Medium burn | Logic-heavy tasks |
A single unoptimized prompt like "build me a login page" can burn 200,000–400,000 tokens because:
- The agent reads every file in your project to understand context
- It makes 30–50 tool calls exploring your codebase
- It retries when it gets things wrong
- It re-reads the full conversation history on every follow-up
A properly optimized setup reduces this to 30,000–60,000 tokens for the same task — a 6–10x reduction.
The setup steps in this guide happen BEFORE you start prompting. They are a one-time investment that pays back on every single prompt forever.
Understanding where tokens go helps you stop wasting them.
Every time you send a message, Antigravity automatically injects:
- Your
gemini.mdfile (project identity) - All active Rules
- Tool definitions
If your gemini.md is 8,000 tokens, that's 8,000 tokens burned before you type a single word. Over a 20-message session that's 160,000 tokens just for the system prompt.
✅ Fix: Keep
gemini.mdunder 1,500 tokens. Use references instead of pasting full content.
Each follow-up message re-sends the entire conversation history. By message 15 in a session, even a short reply costs 50,000+ tokens because the model processes everything said before it.
✅ Fix: Start a new conversation for each new task. Never continue a long thread for an unrelated feature.
When the agent reads a file, runs a terminal command, or queries a database — each action costs tokens. A vague prompt like "review my project" triggers 30–50 tool calls as the agent explores everything it can find.
✅ Fix: Tell the agent exactly which files to read. Precise prompts = precise tool calls.
Antigravity continuously indexes your project files for autocomplete — including node_modules, bin, obj, and lock files. These never need AI context but burn tokens constantly.
✅ Fix: Add
.antigravityignoreto block junk from being indexed.
When the agent has no script to follow, it enters "planning mode" — generating thousands of hidden reasoning tokens before producing any output. Without a Workflow, every task starts from scratch.
✅ Fix: Use Workflows so the agent follows a script instead of planning from scratch.
You have an empty folder. No code yet. You need to set up Antigravity before writing anything.
→ Follow Section 4 completely.
You already have code running. You want to add a feature, fix a bug, or implement a task.
→ Follow Section 5 for the lighter setup process.
Do these steps before sending your first prompt to the agent.
Create this exact structure in your project root:
your-project/
├── .agents/
│ ├── rules/
│ │ ├── backend.md
│ │ ├── frontend.md
│ │ └── database.md
│ ├── workflows/
│ │ ├── new-endpoint.md
│ │ ├── new-component.md
│ │ └── db-migrate.md
│ └── skills/
│ ├── feature-name/
│ │ └── SKILL.md
│ └── another-feature/
│ └── SKILL.md
├── .antigravityignore
├── gemini.md
├── GUIDELINES.md
└── INSTRUCTIONS.md
Why .agents/ and not .antigravity/?
Newer versions of Antigravity IDE read from .agents/. If you see both folders, use .agents/ — it's the current standard.
Open the correct folder in Antigravity:
File → Open Folder → select your-project/ (not a parent folder above it)
Antigravity auto-reads gemini.md, all files in .agents/rules/, and .antigravityignore the moment you open the folder. No manual loading needed.
gemini.md is loaded on every single prompt. It tells the agent who it is, what the project is, and where to find things.
Rules for writing gemini.md:
- Keep it under 1,500 tokens (roughly 1,200 words)
- Never paste full documentation — reference file paths instead
- Only include things the agent needs to know on every prompt
Template:
# Project Name — Identity
## What this project is
One sentence describing the project purpose.
## Tech Stack
- Frontend: React 18, TypeScript, Tailwind CSS, React Query
- Backend: ASP.NET Web API (.NET 8), C#
- Database: SQL Server (via EF Core)
- Architecture: Clean Architecture
## Project Structure
/frontend → React app
/backend
/Project.Domain → Entities, enums, exceptions
/Project.Application → Commands, queries, handlers, validators
/Project.Infrastructure → EF Core, repositories, migrations
/Project.API → Controllers, middleware, DI
## Key File References (read only when needed)
- Domain entities: /backend/Project.Domain/Entities/
- DB context: /backend/Project.Infrastructure/Persistence/AppDbContext.cs
- Controllers: /backend/Project.API/Controllers/
- React components: /frontend/src/components/
- API hooks: /frontend/src/hooks/
## Naming Conventions
- C# classes/methods: PascalCase
- React components: PascalCase
- React hooks: camelCase with `use` prefix
- TypeScript interfaces: prefix with I (ITransaction)
- SQL tables: PascalCase, plural (Transactions)
- API routes: kebab-case (/api/liquidity-transfers)What NOT to include in gemini.md:
- Full API documentation (reference the file path instead)
- Database schema details (agent reads from MCP)
- Long lists of business rules (put those in Rules files)
- Code examples (put those in Skills)
Rules are always-on guardrails. They prevent the agent from making mistakes that cause retry loops — and retry loops are the biggest token waster.
- Click the Agent icon in left sidebar
- Click Customizations
- Click Rules tab
- Click + Workspace
- Set Activation Mode to
Always On - Paste the rule content and save
Repeat for each rule set.
Create .agents/rules/backend.md, .agents/rules/frontend.md, .agents/rules/database.md with your rules. Antigravity reads these automatically. Files are committed to Git so the whole team shares them.
Rules should be short, direct, and cover things that must NEVER be violated.
Backend Rules Example:
- NEVER put business logic in Controllers
- NEVER reference Infrastructure from Domain or Application
- Use Result<T> for all Application service return types
- Soft delete only — never hard delete (use IsDeleted)
- All money columns: decimal(18,2) — never float
- Always add indexes on foreign keys
- Validate inputs via FluentValidation in Application layer
- Never expose internal exception messages in API responsesFrontend Rules Example:
- NEVER use `any` type — use `unknown` and narrow it
- All components must be functional — no class components
- Named exports only — no default exports
- Never fetch data in useEffect — always use React Query
- All forms use React Hook Form + Zod validation
- ALWAYS format currency using Intl.NumberFormat
- Tailwind CSS only — no inline stylesDatabase Rules Example:
- All tables: Id (uniqueidentifier), CreatedAt, UpdatedAt, IsDeleted
- All money columns: decimal(18,2)
- Use Fluent API — never data annotations on domain entities
- Never call SaveChanges() inside a loop
- Use AsNoTracking() for all read-only queries
- Migration name format: Add_Entity_Detail
- Always review migration SQL before applying| Mode | When to use |
|---|---|
| Always On | Rules that apply to every single prompt (architecture, code style, security) |
| Model Decision | Rules the agent should load only when relevant (specific feature rules) |
| Manual | Rules you want to toggle yourself depending on the task |
| Glob | Rules for specific file types (e.g. only apply when editing *.cs files) |
For the 3 core rule files (backend, frontend, database) → always use Always On.
Workflows are reusable step-by-step scripts triggered by /command. Instead of the agent planning from scratch (burning reasoning tokens), it follows your pre-written script.
- Click Customizations
- Click Workflows tab
- Click + Workspace
- Set a trigger (e.g.
/new-endpoint) - Write the steps and save
Create .agents/workflows/new-endpoint.md with trigger defined in the file header. Antigravity reads these automatically.
1. /new-endpoint — Create a full API endpoint
trigger: /new-endpoint
When triggered:
1. Ask: Entity name? Operation? Special business rules?
2. Create Domain entity if it doesn't exist
3. Create Application Command/Query + Handler + Validator + DTO
4. Create Infrastructure EntityTypeConfiguration
5. Create API Controller endpoint with ProducesResponseType attributes
6. Create Frontend API function + React Query hook
7. Run dotnet build → verify 0 errors2. /new-component — Create a React component
trigger: /new-component
When triggered:
1. Ask: Component name? What does it display? Data fetching or props only?
2. Create component with TypeScript interface for props
3. If data fetching: create React Query hook
4. Apply project color system (online=blue, offline=amber, expense=red, income=green)
5. Run npx tsc --noEmit → verify 0 errors3. /db-migrate — Safe database migration
trigger: /db-migrate
When triggered:
1. Ask: What schema change is needed?
2. Read affected entity and configuration files
3. Run: dotnet ef migrations add {Name} --startup-project ../Project.API
4. Read generated Up() and Down() methods — verify correctness
5. Verify money columns are decimal(18,2), FK columns have indexes
6. Run: dotnet ef database update --startup-project ../Project.API
7. Confirm migration in __EFMigrationsHistoryWhy Workflows save tokens:
- Agent skips planning phase (saves 5,000–15,000 reasoning tokens per task)
- Agent asks specific questions instead of exploring everything
- Consistent output means fewer corrections and retries
Skills are specialist knowledge modules loaded only when the agent detects relevance in your prompt. Unlike Rules (always loaded), Skills stay out of context until needed — saving tokens.
Each Skill is a folder with a SKILL.md file. The file has a YAML header with a description. Antigravity reads the description and loads the Skill only when your prompt matches.
.agents/skills/
liquidity-transfer/
SKILL.md ← loaded when you mention "transfer", "wallet", "balance"
clean-arch-scaffold/
SKILL.md ← loaded when you mention "entity", "scaffold", "feature"
db-migration/
SKILL.md ← loaded when you mention "migration", "ef core", "column"
---
name: skill-name
description: >
Use this skill when the user asks about X, Y, Z.
Triggers on: "keyword1", "keyword2", "keyword3".
---
# Skill Title
## What this skill covers
Detailed instructions, templates, code patterns, business rules
specific to this feature area.| Put in Rules | Put in Skills |
|---|---|
| Short universal guardrails | Long domain-specific logic |
| Code style standards | Feature-specific templates |
| Architecture constraints | Business rule calculations |
| Security requirements | Code patterns with examples |
- A 500-line Skill loaded always = 500 lines × 20 sessions = 10,000 lines of tokens wasted
- A 500-line Skill loaded on Model Decision = 500 lines × 3 relevant sessions = 1,500 lines ✅
Always put large knowledge blocks in Skills, not Rules.
This is one of the highest-impact token savings with zero effort. Antigravity indexes your entire project in the background for autocomplete. Without an ignore file, it indexes node_modules (100,000+ files), bin/, obj/, lock files — all of which are useless for AI context.
Create .antigravityignore in your project root:
# JavaScript/Node
node_modules/
dist/
build/
.next/
.vite/
coverage/
*.lock
package-lock.json
yarn.lock
# .NET
**/bin/
**/obj/
**/.vs/
**/TestResults/
# Generated files
**/Migrations/*.Designer.cs
# Logs
*.log
logs/
# Secrets — NEVER index these
appsettings.Production.json
appsettings.Staging.json
.env.local
.env.production
secrets.json
Token savings: Prevents background indexing of thousands of irrelevant files. Estimated saving: 10,000–50,000 background tokens per session depending on project size.
MCP (Model Context Protocol) gives the agent "hands" to reach external tools. Instead of you pasting large amounts of data into the chat, the agent fetches exactly what it needs.
Open Settings (Ctrl + ,) → search for MCP → click Edit in settings.json
Or directly open:
C:\Users\{YourName}\AppData\Roaming\Antigravity\settings.json
{
"mcpServers": {
"sqlserver": {
"command": "npx",
"args": ["-y", "mssql-mcp@latest"],
"env": {
"DB_SERVER": "YOUR-SERVER-NAME",
"DB_DATABASE": "YourDatabase",
"DB_TRUSTED_CONNECTION": "true",
"DB_TRUST_SERVER_CERTIFICATE": "true",
"DB_ENCRYPT": "false"
}
}
}
}{
"mcpServers": {
"sqlserver": {
"command": "npx",
"args": ["-y", "mssql-mcp@latest"],
"env": {
"DB_SERVER": "YOUR-SERVER-NAME",
"DB_DATABASE": "YourDatabase",
"DB_USER": "sa",
"DB_PASSWORD": "your-password",
"DB_TRUST_SERVER_CERTIFICATE": "true",
"DB_ENCRYPT": "false"
}
}
}
}- Save
settings.json - Restart Antigravity IDE completely
- Test with:
"Connect to the database and list all tables"
Without MCP:
You paste 200 lines of schema description into chat → 200 lines × every relevant session = thousands of wasted tokens
With MCP:
Agent calls
mssql_list_schema_objectsand gets precise schema in one tool call → agent only reads what it needs
Before sending any prompt, select the correct model from the dropdown in Antigravity.
| Task | Model | Mode |
|---|---|---|
| Full project scaffold (first prompt) | Gemini 3 Pro | Planning |
| New feature end-to-end (3+ files) | Gemini 3 Pro | Planning |
| Complex business logic | Gemini 3 Pro | Planning |
| Single file refactor | Gemini Flash | Fast |
| New React component (simple) | Gemini Flash | Fast |
| Database migration | Gemini Flash | Fast |
| Fix a specific bug | Gemini Flash | Fast |
| Write tests | Gemini Flash | Fast |
| Architecture question | Gemini 3 Pro | Planning |
| Token quota running low | Gemini Flash | Fast |
| Mode | When to use | Token cost |
|---|---|---|
| Fast | Simple, well-defined tasks | Low |
| Planning | New features, complex tasks requiring reasoning first | High |
Rule: Use Planning mode only when the task genuinely needs the agent to reason before acting. For everything else: Fast mode.
Your first prompt sets the tone for the entire project. A well-written first prompt means zero retries on the foundation.
Set up the complete project structure for [Project Name].
Backend ([Tech Stack]):
- [List exactly what to create with exact names]
- [File paths, class names, package names]
- [What NOT to do yet]
Frontend ([Tech Stack]):
- [List exactly what to create]
- [Folder structure, file names]
- [What NOT to do yet]
Do NOT add business logic yet. Structure and boilerplate only.
After completing, run [build command] and confirm 0 errors.
Every prompt must answer 3 questions:
- What — exact entity/file/function name
- Where — exact file path
- Done when — what success looks like (0 errors, specific behavior)
| ❌ Bad prompt | ✅ Good prompt |
|---|---|
| "add login" | "Create POST /api/auth/login in AuthController. Use LoginCommand + Handler in Application layer. Return JWT token in LoginResponseDto. Run dotnet build → 0 errors." |
| "make a component" | "Create WalletCard component in /src/components/Dashboard/WalletCard.tsx. Props: label (string), balance (number), type ('online'|'offline'|'total'). Display balance using formatCurrency(). Run npx tsc --noEmit → 0 errors." |
| "fix the bug" | "In TransactionRepository.cs line 47, the GetByUserId query is missing AsNoTracking(). Add it and run dotnet build." |
When your project is already running and you want to add a new feature or fix something, you don't need to redo all of Section 4. Follow this lighter process instead.
Before starting a new task, check if gemini.md needs updating:
- Did you add a new entity? Add its file path reference.
- Did you change the folder structure? Update it.
- Did you add a new library? Add it to the tech stack line.
Do NOT add the full feature description to gemini.md. It loads on every prompt — keep it lean.
If you are working on a completely different area (e.g. you were building backend, now you're adding a frontend feature), verify the relevant rules are still set to Always On in the Customizations panel.
No changes needed if rules were set up in Section 4.
Before typing a custom prompt, check: does a workflow exist for this task?
| Task | Use workflow |
|---|---|
| New API endpoint | /new-endpoint |
| New React component | /new-component |
| Database migration | /db-migrate |
| Domain-specific feature | /your-custom-workflow |
If a workflow exists → use it. The workflow gives the agent a script, saving planning tokens.
If no workflow exists for your task → create one before prompting. It takes 5 minutes and saves tokens on every future occurrence of that task type.
For any task that touches 3+ files or involves non-trivial business logic, plan it in ChatGPT or Claude before coming to Antigravity. Both are free to use and have no Antigravity token quota — so all planning work costs you nothing.
When you send a vague or complex prompt directly to Antigravity, the agent spends thousands of tokens:
- Exploring your codebase to understand the context
- Deliberating on how to approach the task
- Retrying when it guesses wrong
If you bring a finished, detailed plan to Antigravity instead, the agent skips all of that and only executes — saving 60–80% of tokens on complex tasks.
| Planning Tool | Best for | How to access |
|---|---|---|
| ChatGPT | Architecture decisions, step-by-step plans, SQL schema design | chat.openai.com |
| Claude | Complex logic reasoning, code review, business rule clarification | claude.ai |
Both are free. Use whichever you prefer — the output is the same: a finished plan you paste into Antigravity.
Step 1 — Open ChatGPT (chat.openai.com) or Claude (claude.ai)
Step 2 — Paste your relevant context
Copy and paste the files that are relevant to the task:
- The affected entity or model
- The current controller or service
- The current component (if frontend)
- The DB schema for the affected table
Step 3 — Ask for an implementation plan
Use this prompt template in ChatGPT or Claude:
I'm building a [project type] using [tech stack].
Here are my relevant files: [paste files]
I want to add: [describe the feature]
Give me a step-by-step implementation plan with:
- Exact file paths for each file to create or modify
- Exact class/method/component names
- What each file should contain
- Business rules to enforce
- What "done" looks like (build command + expected result)
Step 4 — Copy the output plan
ChatGPT or Claude will return a structured, detailed plan. Copy the entire output.
Step 5 — Paste into Antigravity as your prompt
Open a new Antigravity conversation, select the right model, and paste the plan directly. The agent now has a complete script to follow — no exploration, no guessing.
Without planning (token-wasteful):
Add a dashboard summary page to my project
→ Agent reads 40+ files, guesses the structure, retries 3 times = ~300,000 tokens
With ChatGPT/Claude planning first:
Create /src/pages/DashboardPage.tsx.
Fetches from GET /api/dashboard/summary using useQuery with QUERY_KEYS.DASHBOARD.
Shows 3 cards: OnlineBalance (blue), OfflineBalance (amber), TotalFund (gray).
Each card uses formatCurrency() from /src/utils/formatCurrency.ts.
Loading state: animate-pulse skeleton. Error state: red error message.
Done when: npx tsc --noEmit → 0 errors.
→ Agent executes directly = ~30,000 tokens ✅
Token saving: ~270,000 tokens on one task.
For an existing project, always scope your prompt to the minimum necessary context.
Name the exact files:
In /backend/Project.Application/Features/Transactions/Create/
CreateTransactionCommandHandler.cs — the handler is missing the UserId filter.
Add: .Where(t => t.UserId == request.UserId) to the query on line 23.
Run dotnet build → 0 errors.
Tell the agent what NOT to read:
Do not read any frontend files.
Focus only on: TransactionRepository.cs and ITransactionRepository.cs
Set a clear done condition:
Done when: dotnet build shows 0 errors and 0 warnings.
Start a new conversation for each task: Never continue a 20-message thread for a new unrelated feature. The full history re-sends on every message. Start fresh — paste only the context the new task needs.
What it is: The project identity file. Loaded automatically on every single prompt.
Token impact: HIGH — directly multiplied by every message in every session.
Optimization rules:
- Hard limit: 1,500 tokens (≈ 1,200 words)
- Use file path references instead of pasting content:
"API docs: /docs/api.md — read when needed" - Include only: tech stack, folder structure, naming conventions, core domain terms
- Never include: full business rules, code examples, long lists
Location: Project root /gemini.md
What it is: Always-on guardrails that prevent the agent from making mistakes.
Token impact: MEDIUM — loaded on every prompt but kept short.
Optimization rules:
- Each rule file should be under 100 lines
- Write rules as short imperative statements, not paragraphs
- Use Always On for universal constraints (architecture, style, security)
- Use Model Decision for feature-specific rules
- Split by layer: backend.md, frontend.md, database.md
Token saving mechanism: Rules prevent wrong-direction code → fewer retries → fewer tokens.
What it is: Reusable step-by-step scripts triggered by /command.
Token impact: HIGH SAVINGS — eliminates planning phase for repeated task types.
Optimization rules:
- Create a Workflow for any task you do more than once
- Workflows should ask clarifying questions at the start (not mid-task)
- Include a verification step at the end (build/typecheck command)
- Keep Workflow steps numbered and sequential — no ambiguity
Token saving mechanism: Agent follows a script instead of planning → saves 5,000–15,000 reasoning tokens per task.
What it is: Specialist knowledge modules loaded only when the agent detects relevance.
Token impact: HIGH SAVINGS — large knowledge blocks loaded only when needed.
Optimization rules:
- Put long domain logic, code templates, and business rules in Skills (not Rules or gemini.md)
- Write clear, specific trigger keywords in the description header
- Each Skill should be self-contained — don't reference other Skills
- Skills can be 200–500 lines — that's fine because they're not always loaded
Token saving mechanism: 500-line Skill costs zero tokens when you're working on an unrelated feature.
What it is: Persistent connections to external tools (databases, GitHub, etc.).
Token impact: HIGH SAVINGS — gives agent precise data without you pasting large contexts.
Optimization rules:
- Always prefer MCP over pasting content into chat
- For database tasks: let MCP read the schema instead of describing it
- For file tasks: let MCP read the file instead of copying it into the prompt
- Restart Antigravity after changing MCP config
Useful MCP servers for development projects:
mssql-mcp— SQL Server (read/write queries, schema inspection)@modelcontextprotocol/server-github— GitHub (branches, PRs, issues)@modelcontextprotocol/server-filesystem— file system operations@modelcontextprotocol/server-memory— cross-conversation memory
What it is: Tells Antigravity what NOT to index for background autocomplete.
Token impact: MEDIUM SAVINGS — prevents constant background token drain.
What to always ignore:
node_modules/ ← 100,000+ files, never relevant
**/bin/ ← .NET build output
**/obj/ ← .NET intermediate output
dist/ ← frontend build output
*.lock ← package lock files
**/*.Designer.cs ← EF Core migration designer files
*.log ← log files
What to never ignore:
- Your source code files
- Configuration files (appsettings.json, .env.example)
- Your
.agents/folder
- First project scaffold
- New feature touching 3+ files across layers
- Complex business logic (calculations, domain rules)
- Architecture or design decisions
- Debugging a complex issue with unknown root cause
- Adding a single field to an existing entity
- Creating a simple React component
- Running a database migration
- Writing unit tests
- Fixing a specific known bug
- Renaming, refactoring, moving files
- Tasks requiring precise logical reasoning
- Complex validation rules
- Algorithm implementation
- When Gemini Pro is giving inconsistent results
- Planning mode: Use when the task needs reasoning before acting. Costs more tokens but produces better output for complex tasks.
- Fast mode: Use for everything else. Direct execution, no deliberation.
Every good prompt has:
[WHAT] + [WHERE] + [DONE WHEN]
Example:
[WHAT] Create CreateTransactionCommand + Handler + Validator in Application layer.
[WHERE] File: /backend/Project.Application/Features/Transactions/Create/
[DONE WHEN] Run dotnet build → 0 errors before finishing.
/new-endpoint
Entity: {EntityName}
Operation: {Create/Read/Update/Delete/List}
Business rules:
- {rule 1}
- {rule 2}
Files to create:
- /backend/.../Command.cs
- /backend/.../Handler.cs
- /frontend/src/api/{entity}.api.ts
Done when: dotnet build + npx tsc --noEmit both show 0 errors.
File: {exact file path}
Problem: {describe exactly what is wrong, include line number if known}
Fix: {describe exactly what the correct behavior should be}
Do NOT change any other files.
Done when: {specific behavior or build result}
/db-migrate
Change: Add {ColumnName} ({type}) to {TableName} table.
Reason: {why this column is needed}
Constraints: {not null / default value / index needed?}
Done when: Migration applied, dotnet build 0 errors.
/new-component
Name: {ComponentName}
Location: /frontend/src/components/{Category}/{ComponentName}.tsx
Displays: {exactly what it shows}
Props: {propName: type, propName: type}
Data fetching: {yes/no — if yes, from which endpoint}
Done when: npx tsc --noEmit 0 errors, component renders without console errors.
- Exact file paths (not vague directory names)
- Exact class/function/component names
- A build/typecheck command as the done condition
- What NOT to change (prevent scope creep)
- Vague descriptions ("make it better", "fix the issue")
- Multiple unrelated tasks in one prompt
- Requests to "review the whole project"
- Open-ended exploration ("see what you can find")
This table shows approximate token usage for common activities, with and without optimization.
| Activity | Unoptimized | Optimized | Savings |
|---|---|---|---|
| New feature (3 files) | 300,000 | 60,000 | 80% |
| Single component | 80,000 | 15,000 | 81% |
| Bug fix | 60,000 | 8,000 | 87% |
| DB migration | 40,000 | 10,000 | 75% |
| Project scaffold | 500,000 | 120,000 | 76% |
| Code review | 200,000 | 25,000 | 88% |
- Bloated gemini.md — multiplied by every message
- No .antigravityignore — constant background drain
- Vague prompts — agent explores everything, retries often
- Long conversation threads — history re-sent on every reply
- No Workflows — agent plans from scratch every time
- Pasting content that MCP could fetch — unnecessary context
Free quota resets every week. No action needed.
- Go to aistudio.google.com
- Sign in → click Get API Key → Create API key
- Copy the key (looks like
AIzaSyXXXXXXXXX) - In Antigravity:
Settings (Ctrl + ,)→ Models → paste your key - Your own key uses Google AI Studio free quota which resets daily
Switch from Gemini 3 Pro to Gemini Flash for remaining tasks. Flash uses significantly fewer tokens per request.
Do all planning and architecture decisions in ChatGPT (chat.openai.com) or Claude (claude.ai) — both free, no Antigravity quota used. Only come to Antigravity for actual code execution.
- Open the correct project folder (not a parent folder)
- Check
gemini.mdis up to date and under 1,500 tokens - Verify rules are active (Customizations → Rules)
- Select correct model for the task
- Start a NEW conversation (don't continue old threads)
- Create
.agents/rules/backend.md - Create
.agents/rules/frontend.md - Create
.agents/rules/database.md - Create
.agents/workflows/new-endpoint.md - Create
.agents/workflows/new-component.md - Create
.agents/workflows/db-migrate.md - Create skills for domain-specific logic
- Write
gemini.md(under 1,500 tokens) - Add
.antigravityignore - Configure MCP servers in settings.json
- Restart Antigravity after MCP config
- Does a workflow exist for this task? → use it
- Is this a complex task (3+ files)? → plan in ChatGPT or Claude first
- Start a new conversation
- Select correct model (Flash for simple, Pro for complex)
- Write prompt with: What + Where + Done When
- Does the prompt name specific files/classes?
- Does it say where things should go?
- Does it have a build/typecheck done condition?
- Is it one task only (not multiple unrelated things)?
1-2 files, known task → Gemini Flash, Fast mode
3+ files, new feature → Gemini 3 Pro, Planning mode
Complex logic/debugging → Gemini 3 Pro, Planning mode
Running low on quota → Gemini Flash, Fast mode
This guide covers Antigravity IDE as of July 2026. Folder conventions (.agents/ vs .antigravity/) may vary by version — check which folder your version reads by opening Customizations and seeing which rules are detected.