Google Antigravity Directory

The #1 directory for Google Antigravity prompts, rules, workflows & MCP servers. Optimized for Gemini 3 agentic development.

Resources

PromptsMCP ServersAntigravity RulesGEMINI.md GuideBest Practices

Company

Submit PromptAntigravityAI.directory

Popular Prompts

Next.js 14 App RouterReact TypeScriptTypeScript AdvancedFastAPI GuideDocker Best Practices

Legal

Privacy PolicyTerms of ServiceContact Us
Featured on FazierFeatured on Wired BusinessFeatured on Twelve ToolsListed on Turbo0Featured on findly.toolsFeatured on Aura++

© 2025 Antigravity AI Directory. All rights reserved.

The #1 directory for Google Antigravity IDE

This website is not affiliated with, endorsed by, or associated with Google LLC. "Google" and "Gemini" are trademarks of Google LLC.

Antigravity AI Directory
PromptsMCPBest PracticesUse CasesLearn
Home
Learn
.antigravity File Guide

.antigravity File Complete Reference

The .antigravity file is the heart of your Google Antigravity configuration. Learn how to use rules, workflows, and settings to customize AI behavior for your project.

Table of Contents

  • What is a .antigravity file?
  • File Locations
  • Basic Syntax
  • Rule Types
  • Example Configurations
  • Best Practices

What is a .antigravity File?

A .antigravity file is a configuration file that contains rules and instructions for Google Antigravity's AI agents. Think of it as a "coding constitution" that tells the AI:

  • →How to write code (style, patterns, conventions)
  • →What technologies and libraries to use
  • →Project architecture and file structure
  • →Testing requirements and documentation standards

Key Concept: The agent reads your .antigravity file on every interaction, treating it as trusted instructions that guide all code generation.

File Locations

Project Rules (Recommended)

your-project/
├── .antigravity           # Single file approach
└── ...

# OR

your-project/
├── .antigravity/
│   ├── rules.md          # Main rules
│   ├── styling.md        # CSS/styling rules
│   ├── testing.md        # Testing rules
│   └── api.md            # API conventions
└── ...

Global Rules

~/.gemini/
├── antigravity/
│   ├── GEMINI.md         # Global rules for all projects
│   └── browserAllowlist.txt
└── ...

Global rules apply to all projects. Project rules take precedence over global rules.

Basic Syntax

Rules are written in Markdown format. Here's a basic structure:

# Project Rules

## Code Style
- Use TypeScript for all new files
- Prefer functional components over class components
- Use async/await instead of .then() chains
- Maximum line length: 100 characters

## Architecture
- Follow the feature-based folder structure
- Keep components in /src/components
- API routes go in /src/app/api

## Naming Conventions
- Components: PascalCase (Button.tsx)
- Utilities: camelCase (formatDate.ts)
- Constants: UPPER_SNAKE_CASE

## Testing
- Write unit tests for all utility functions
- Use React Testing Library for component tests
- Minimum 80% code coverage

## Documentation
- Add JSDoc comments to exported functions
- Include usage examples in complex components

Rule Types

1. Style Rules

Define code formatting and style preferences:

## Style
- Use 2 spaces for indentation
- Always use semicolons
- Prefer single quotes for strings
- Use trailing commas in multiline arrays/objects

2. Technology Rules

Specify frameworks, libraries, and versions:

## Technology Stack
- Framework: Next.js 15 with App Router
- Styling: Tailwind CSS (no CSS modules)
- State: React Query for server state, Zustand for client
- Database: Supabase with Drizzle ORM
- Testing: Vitest + React Testing Library

3. Architecture Rules

Define project structure and patterns:

## Architecture
- Use feature-based folder structure
- Shared components in /src/components/ui
- Feature components in /src/features/[feature]/components
- All API calls through /src/lib/api
- No direct fetch() calls in components

4. Workflow Rules

Guide the agent's behavior and process:

## Workflow
- Always create a plan before implementing
- Run tests after making changes
- Update documentation when adding features
- Ask for clarification if requirements are unclear

Example Configurations

Next.js Project

# Next.js 15 Project Rules

## Framework
- Next.js 15 with App Router
- TypeScript strict mode enabled
- Server Components by default
- Use 'use client' only when necessary

## Styling
- Tailwind CSS for all styling
- Use CSS variables for theming
- Mobile-first responsive design
- Use cn() helper for conditional classes

## Components
- Functional components only
- Props interface above component
- Export default for page components
- Named exports for shared components

## Data Fetching
- Server Components for initial data
- React Query for client-side fetching
- Implement proper loading states
- Handle errors gracefully

## File Structure
src/
├── app/           # Next.js App Router
├── components/    # Shared components
│   └── ui/       # Base UI components
├── lib/          # Utilities and helpers
├── hooks/        # Custom React hooks
└── types/        # TypeScript types

Python FastAPI Project

# FastAPI Project Rules

## Framework
- FastAPI with Pydantic v2
- Python 3.11+
- Async/await for all I/O operations
- SQLAlchemy 2.0 with async sessions

## Code Style
- Type hints for all functions
- Docstrings for public functions
- Black formatting (line length 88)
- isort for import sorting

## API Design
- RESTful conventions
- Versioned endpoints (/api/v1/)
- Consistent error responses
- OpenAPI documentation

## Architecture
app/
├── api/          # Route handlers
├── core/         # Config and security
├── models/       # SQLAlchemy models
├── schemas/      # Pydantic schemas
├── services/     # Business logic
└── utils/        # Helpers

Best Practices

Do

  • ✓ Be specific and clear
  • ✓ Include examples
  • ✓ Organize rules by category
  • ✓ Update as project evolves
  • ✓ Keep rules actionable

Don't

  • ✗ Write vague instructions
  • ✗ Include sensitive data
  • ✗ Make rules too restrictive
  • ✗ Contradict yourself
  • ✗ Forget to test rules

For comprehensive best practices, see our Best Practices guide.

Advanced Configuration

Exclude Patterns

Prevent the AI from reading or modifying certain files:

## Exclude Patterns
exclude_patterns:
  - node_modules/**
  - .git/**
  - dist/**
  - coverage/**
  - *.log
  - .env*
  - secrets/**

This improves performance and prevents accidental exposure of sensitive data.

MCP Server Integration

Configure MCP servers in your .antigravity file:

## MCP Servers
Use the following MCP servers:
- @supabase/mcp for database operations
- @github/mcp for repository management
- @stripe/mcp for payment integration

Configure in .antigravity/mcp.json

Browse available MCP servers in our MCP directory.

Agent Mode Configuration

Configure Agent Mode behavior:

## Agent Mode Settings
When using Agent Mode:
- Always create a plan before implementation
- Ask for confirmation before destructive operations
- Run tests after making changes
- Provide progress updates during long tasks
- Stop and ask if encountering unexpected errors

⚡ Workflow Integration

Your .antigravity file works seamlessly with Antigravity's built-in workflows:

Development Workflows

12 optimized workflows for common tasks

Agent Mode

Autonomous multi-step task execution

Extensions

Extend functionality with built-in extensions

Keyboard Shortcuts

Speed up your development workflow

🔧 Troubleshooting

If your .antigravity rules aren't being applied:

  • 1.Check file location - Must be in project root or ~/.gemini/
  • 2.Reload the agent - Rules are loaded on startup
  • 3.Check syntax - Use valid Markdown formatting
  • 4.Verify file name - Must be .antigravity or in .antigravity/ folder

Still having issues? Check our Troubleshooting Guide for more solutions.

📚 Related Configuration Guides

Antigravity Rules Guide

Comprehensive rules configuration with examples for every framework

GEMINI.md Guide

Set up global rules that apply to all your projects

Related Resources

📥 Download

Get Google Antigravity

🎯 Browse Prompts

130+ ready-to-use rules

✅ Best Practices

Expert recommendations

💡 Use Cases

Real-world examples

🚀 Getting Started

Complete beginner guide

📝 Blog

Tips and tutorials