Recommended configuration for Antigravity agents, including generation settings and model selection.
# Antigravity Configuration Guide for Google Antigravity IDE
Master the configuration of your Google Antigravity development environment. This comprehensive guide covers .antigravity files, workspace settings, project rules, and customization options for optimal AI-assisted development.
## Understanding .antigravity Files
Configure AI behavior for your projects:
```yaml
# .antigravity
# Project-level configuration for Google Antigravity IDE
# Project context helps Gemini understand your codebase
project:
name: "My Awesome App"
description: "A Next.js SaaS application with real-time features"
type: "web-application"
language: "typescript"
framework: "nextjs"
# Technology stack for accurate code generation
stack:
frontend:
- "React 18"
- "Next.js 14 (App Router)"
- "Tailwind CSS"
- "Radix UI"
backend:
- "Node.js"
- "Prisma ORM"
- "PostgreSQL"
infrastructure:
- "Vercel"
- "Supabase"
- "Redis"
# Code style preferences
style:
# Formatting
indentation: "spaces"
indent_size: 2
max_line_length: 100
trailing_comma: "es5"
semicolons: true
quotes: "double"
# Naming conventions
naming:
components: "PascalCase"
functions: "camelCase"
constants: "SCREAMING_SNAKE_CASE"
files:
components: "PascalCase"
utilities: "camelCase"
types: "PascalCase"
# Import organization
imports:
order:
- "react"
- "next"
- "third-party"
- "@/components"
- "@/lib"
- "@/hooks"
- "@/types"
- "relative"
group_separator: true
```
## Advanced Rules Configuration
Define detailed coding rules:
```yaml
# .antigravity (continued)
# Coding rules and best practices
rules:
typescript:
strict: true
no_any: true
explicit_return_types: true
prefer_const: true
no_unused_vars: "error"
react:
prefer_function_components: true
use_memo_wisely: true
avoid_prop_drilling: true
error_boundaries: true
nextjs:
use_app_router: true
prefer_server_components: true
use_image_component: true
use_link_component: true
testing:
required_coverage: 80
test_file_pattern: "*.test.ts"
prefer_testing_library: true
mock_external_services: true
security:
sanitize_inputs: true
validate_api_requests: true
use_parameterized_queries: true
no_secrets_in_code: true
# File-specific overrides
overrides:
- files: ["src/app/api/**/*.ts"]
rules:
explicit_return_types: true
error_handling: "required"
- files: ["src/components/**/*.tsx"]
rules:
prefer_named_exports: true
require_display_name: true
- files: ["*.test.ts", "*.test.tsx"]
rules:
no_any: false
max_line_length: 120
```
## MCP Server Configuration
Configure Model Context Protocol servers:
```yaml
# .antigravity (continued)
# MCP server integrations
mcp:
servers:
# Database integration
- name: "supabase"
enabled: true
config:
project_url: "${SUPABASE_URL}"
anon_key: "${SUPABASE_ANON_KEY}"
# File system access
- name: "filesystem"
enabled: true
config:
allowed_paths:
- "./src"
- "./public"
- "./prisma"
excluded_paths:
- "./node_modules"
- "./.git"
# Git integration
- name: "git"
enabled: true
config:
auto_commit: false
commit_message_style: "conventional"
# Browser automation
- name: "puppeteer"
enabled: true
config:
headless: true
viewport:
width: 1920
height: 1080
```
## Prompt Templates
Define reusable prompt templates:
```yaml
# .antigravity (continued)
# Custom prompt templates
templates:
component:
description: "Generate a React component"
prompt: |
Create a React component with the following requirements:
- Use TypeScript with proper type definitions
- Follow our component structure in src/components
- Include proper accessibility attributes
- Add JSDoc comments for complex logic
- Use Tailwind CSS for styling
- Export as named export
api_route:
description: "Generate a Next.js API route"
prompt: |
Create a Next.js API route handler:
- Use the App Router route handler format
- Include Zod validation for request body
- Implement proper error handling
- Add rate limiting if applicable
- Return proper HTTP status codes
- Include TypeScript types
test:
description: "Generate tests for a component or function"
prompt: |
Create comprehensive tests:
- Use Jest and React Testing Library
- Cover happy path and edge cases
- Mock external dependencies
- Test accessibility where applicable
- Follow AAA pattern (Arrange, Act, Assert)
```
## Workspace Settings
Configure IDE-level settings:
```json
// .vscode/settings.json (or Antigravity equivalent)
{
"antigravity.enabled": true,
"antigravity.model": "gemini-3-pro",
"antigravity.temperature": 0.3,
"antigravity.maxTokens": 4096,
"antigravity.codeActions": {
"autoFix": true,
"suggestImports": true,
"generateDocs": true
},
"antigravity.inlineCompletion": {
"enabled": true,
"delay": 300,
"maxSuggestions": 3
},
"antigravity.chat": {
"defaultContext": "workspace",
"includeOpenFiles": true,
"maxContextFiles": 10
},
"antigravity.agent": {
"enabled": true,
"confirmDestructiveActions": true,
"maxIterations": 10
}
}
```
## Environment-Specific Configuration
Handle different environments:
```yaml
# .antigravity.development
extends: .antigravity
rules:
security:
strict_mode: false
mcp:
servers:
- name: "supabase"
config:
project_url: "${SUPABASE_DEV_URL}"
# .antigravity.production
extends: .antigravity
rules:
security:
strict_mode: true
require_auth: true
style:
comments:
remove_todos: true
require_jsdoc: true
```
Google Antigravity uses these configuration files to provide context-aware code generation that matches your project structure and coding standards.This Antigravity prompt is ideal for developers working on:
By using this prompt, you can save hours of manual coding and ensure best practices are followed from the start. It's particularly valuable for teams looking to maintain consistency across their antigravity implementations.
Yes! All prompts on Antigravity AI Directory are free to use for both personal and commercial projects. No attribution required, though it's always appreciated.
This prompt works excellently with Claude, ChatGPT, Cursor, GitHub Copilot, and other modern AI coding assistants. For best results, use models with large context windows.
You can modify the prompt by adding specific requirements, constraints, or preferences. For Antigravity projects, consider mentioning your framework version, coding style, and any specific libraries you're using.