Code A Program
Master Google Antigravity Customizations: Rules, Workflows & Skills Guide
Published on January 29, 2026

Master Google Antigravity Customizations: Rules, Workflows & Skills Guide

Master Google Antigravity Customizations: Rules, Workflows & Skills Guide

Introduction: Stop Repeating Yourself to Your AI Agent

If you've been using AI coding assistants like Google Antigravity, you've probably found yourself typing the same instructions over and over again:

"Use TypeScript."
"Add JSDoc comments."
"Follow our API format."
"Keep functions under 20 lines."

What if I told you there's a way to set these preferences once and have your AI agent follow them forever?

That's exactly what Antigravity's customization features—Rules, Workflows, and Skills—are designed to do. In this comprehensive guide, I'll show you how to use these three powerful features to transform your AI coding experience and 10X your productivity.


What Are Antigravity Customizations?

Antigravity offers three types of customizations that work together to personalize your AI coding experience:

  • Rules: Define HOW your agent should code (coding standards, style preferences)

  • Workflows: Automate WHAT tasks to do (step-by-step procedures)

  • Skills: Provide specialized expertise (domain-specific knowledge)

Think of it this way:

  • Rules are your coding style guide

  • Workflows are your standard operating procedures

  • Skills are your expert consultants

Let's dive deep into each one.


Part 1: Rules - Your Automated Coding Standards

What Are Rules?

Rules are manually defined constraints that tell your AI agent exactly how to write code. They're like having a senior developer reviewing every piece of code the agent generates—automatically enforcing your standards without you lifting a finger.

Types of Rule Activation

Antigravity offers four ways to activate rules:

1. Always On

The rule applies to every piece of code the agent generates.

Use case: Core coding standards that should never be violated.

Example: Always use TypeScript, never JavaScript.

2. Glob Pattern

The rule applies only to files matching a specific pattern.

Use case: Project-specific or file-type-specific standards.

Example: Apply API response formatting only to files in /api/**/*.ts

3. Model Decision

The agent automatically decides when to apply the rule based on context.

Use case: Situational best practices.

Example: Security rules that only apply when working with authentication or sensitive data.

4. Manual

You activate the rule by mentioning it with @rule-name.

Use case: Optional guidelines you want on-demand.

Example: Git commit message formatting.

Creating Your First Rule

Let's create a simple but powerful rule for code comments:

Step 1: Navigate to Customizations → Rules → + Workspace

Step 2: Create a file named comments.md

Step 3: Add your rule:

Markdown
# Comments Rule

Add comments explaining:
- Why the code exists (not what it does)
- Any tricky logic
- TODO items

Use JSDoc for functions:

```typescript
/**
 * Calculates user's total points
 * @param userId - The user's ID
 * @returns Total points earned
 */
function calculatePoints(userId: string): number {
  // implementation
}
Markdown

**Step 4**: Set activation to "Always On"

**Step 5**: Save

Now, every time you ask the agent to create a function, it will automatically add proper JSDoc comments!

### Real-World Rule Examples

#### Example 1: TypeScript Standards

```markdown
# TypeScript Standards

- Always use const by default, let only when reassigning
- Never use var
- Always add explicit return types for functions
- Use interfaces for object shapes, types for unions
- Prefer unknown over any

Example 2: React Component Standards

TSX
# React Component Standards

Applies to: **/*.tsx

- Always use functional components with hooks
- Components must be PascalCase
- Props interface: ComponentNameProps
- Destructure props in function signature
- Export default at bottom

Example:
```typescript
interface ButtonProps {
  label: string;
  onClick: () => void;
}

const Button = ({ label, onClick }: ButtonProps) => {
  return <button onClick={onClick}>{label}</button>;
};

export default Button;
Markdown

#### Example 3: API Response Format (Glob Pattern)

```markdown
# API Response Standards

Activation: **/api/**/*.ts

All API responses must follow this structure:

```typescript
{
  "success": boolean,
  "data": {} | [],
  "error": {
    "code": "ERROR_CODE",
    "message": "User-friendly message"
  },
  "metadata": {
    "timestamp": string,
    "requestId": string
  }
}

Error codes:

  • AUTH_REQUIRED

  • FORBIDDEN

  • NOT_FOUND

  • VALIDATION_ERROR

  • SERVER_ERROR

Markdown

### Global vs Workspace Rules

**Global Rules** (`~/.gemini/GEMINI.md`):
- Apply to ALL your projects
- Perfect for personal coding preferences
- Examples: Your preferred code style, comment format, naming conventions

**Workspace Rules** (`.agent/rules/`):
- Apply only to the current project
- Perfect for team standards
- Examples: Project-specific API formats, company coding standards

---

## Part 2: Workflows - Automate Repetitive Tasks

### What Are Workflows?

Workflows are step-by-step procedures that guide your AI agent through repetitive tasks. Instead of manually running 10 git commands to clean up branches, you run one workflow command: `/cleanup-branches`.

### Creating Your First Workflow

Let's create a branch cleanup workflow:

**Step 1**: Navigate to Customizations → Workflows → + Workspace

**Step 2**: Create `cleanup-branches.md`

**Step 3**: Add your workflow:

```markdown
---
description: Clean up local and remote branches that have been merged to main
---

## Description

Remove stale feature branches after PRs are merged to keep the repository clean

## Steps

1. Fetch latest changes from remote: `git fetch --prune`
2. Switch to main branch: `git checkout main`
3. Pull latest main: `git pull origin main`
4. List all branches merged into main: `git branch --merged main`
5. Identify branches safe to delete (exclude main, develop, staging)
6. Ask user to confirm which branches to delete
7. Delete confirmed local branches: `git branch -d <branch-name>`
8. Delete corresponding remote branches: `git push origin --delete <branch-name>`
9. Run garbage collection: `git gc --prune=now`
10. Show summary of cleaned branches

Step 4: Save

To use it: Simply type /cleanup-branches in the agent chat!

Workflow Examples for Common Tasks

Example 1: PR Response Workflow

Markdown
# PR Response

Respond to pull request comments and update code accordingly

## Steps

1. Read all PR comments and feedback
2. Categorize feedback: critical bugs, suggestions, questions, nitpicks
3. Address critical issues first
4. Make requested code changes
5. Add tests for any bug fixes
6. Respond to each comment explaining what was changed or why not
7. Update PR description if scope changed
8. Request re-review when ready

Example 2: Feature Implementation Workflow

Markdown
# Feature Implementation

Build a new feature from requirements to deployment

## Steps

1. Review feature requirements and acceptance criteria
2. Design the technical approach and architecture
3. Identify affected files and components
4. Create/update necessary interfaces and types
5. Implement core functionality
6. Add comprehensive tests (unit, integration, e2e as needed)
7. Update documentation and comments
8. Perform self-review of all changes
9. Create PR with detailed description

Example 3: API Endpoint Creation

Markdown
# Create API Endpoint

Build a complete, production-ready API endpoint

## Steps

1. Define endpoint specification (path, method, request/response schemas)
2. Add route and handler
3. Implement input validation
4. Add authentication/authorization checks
5. Implement business logic
6. Add error handling
7. Write unit tests for handler
8. Write integration tests
9. Add API documentation (OpenAPI/Swagger)
10. Test manually with curl/Postman

Calling Workflows from Workflows

You can even call other workflows from within a workflow!

Markdown
# Full Release

## Steps

1. Run code review using /code-review
2. Execute deployment using /deploy
3. Run post-deployment checks using /health-check
4. Update changelog

Part 3: Skills - Specialized AI Expertise

What Are Skills?

Skills are reusable packages of knowledge that give your AI agent specialized expertise in specific areas. Unlike Rules (which are always in context) and Workflows (which you manually trigger), Skills are automatically loaded only when relevant to your current task.

How Skills Work

  1. Discovery: When you start a conversation, the agent sees all available skills with their names and descriptions

  2. Activation: If a skill looks relevant, the agent reads the full instructions

  3. Execution: The agent follows the skill's guidance while working

You don't need to explicitly mention a skill—the agent decides based on context!

Skill Structure

.agent/skills/my-skill/
├── SKILL.md              # Main instructions (required)
├── scripts/              # Helper scripts (optional)
├── examples/             # Reference code (optional)
└── resources/            # Templates, docs (optional)

Creating Your First Skill

Let's create a Next.js code review skill:

Step 1: Create folder .agent/skills/nextjs-review/

Step 2: Create SKILL.md:

Markdown
---
name: nextjs-review
description: Reviews Next.js and TypeScript code for critical issues only - types, performance, security, and App Router patterns.
---

# Next.js + TypeScript Review (Essentials Only)

Focus on issues that actually break things or cause real problems.

## What to Check

### 1. TypeScript - Does it have types?
- Props missing types → Add interface
- Using `any` → Use proper type
- Function missing return type → Add it
- API response not typed → Create interface

### 2. Next.js Patterns - Is it using the right pattern?
- Should it be Server or Client Component?
- Using next/image instead of <img>?
- Has loading.tsx and error.tsx?
- Metadata for SEO?

### 3. Performance - Will it be slow?
- Fetching data in a loop? (N+1 problem)
- Missing cache settings?
- Heavy component not code-split?
- No debouncing on search/input?

### 4. Security - Can it be exploited?
- Secrets exposed in client code?
- No authentication on API routes?
- SQL injection possible?
- No input validation?

## Review Priority

Check in this order:
1. 🔴 **BREAKS**: Type errors, security holes, crashes
2. 🟡 **SLOWS**: Performance issues, bad patterns
3. 🔵 **IMPROVES**: Minor optimizations

## Keep Feedback Short

Format:
🔴 ISSUE: Missing types on props
Fix: Add interface Props { user: User }

That's it. No long explanations unless asked.

Step 3: Save

Now, whenever you ask the agent to review Next.js code, it automatically loads and applies this skill!

Skill vs Rule: When to Use Which?

Use a Rule when:

  • It should apply to EVERY piece of code

  • It's about HOW to write code

  • Example: "Always use TypeScript"

Use a Skill when:

  • It's specialized knowledge

  • It should only apply in specific contexts

  • Example: "Review Next.js code for best practices"

Where Skills Live

Workspace Skills: .agent/skills/ (project-specific) Global Skills: ~/.gemini/antigravity/global_skills/ (all projects)


Rules vs Workflows vs Skills: Quick Comparison

Feature Rules Workflows Skills Purpose HOW to code WHAT to do Specialized expertise Activation Automatic/Conditional Manual (/command) Auto (when relevant) Use Case Coding standards Repetitive tasks Domain knowledge Example "Use TypeScript" "Deploy app" "Review Next.js code" When Applied Based on activation mode When you run it When task matches File Limit 12,000 chars 12,000 chars No specific limit Best For Consistency Automation Context-aware help


Best Practices

For Rules:

  1. Start simple: Begin with 2-3 important rules, not 20

  2. Include examples: Show the agent what good code looks like

  3. Use the right activation: Always On for core standards, Glob for specific files

  4. Team rules in git: Check workspace rules into version control

For Workflows:

  1. Keep them focused: One workflow = one task

  2. Be specific: Clear step-by-step instructions

  3. Add error handling: What to do if a step fails?

  4. Chain workflows: Complex tasks can call multiple workflows

For Skills:

  1. Clear descriptions: Help the agent know when to use it

  2. Include decision trees: Guide the agent to choose the right approach

  3. Use scripts as black boxes: Run with --help first

  4. Keep them specialized: One skill = one area of expertise


Real-World Example: All Three Together

Let's see how Rules, Workflows, and Skills work together in a real scenario:

Scenario: Building a new API endpoint

1. Rules Apply Automatically:

  • TypeScript rule ensures proper typing

  • API standards rule enforces response format

  • Error handling rule adds try-catch blocks

  • Comment rule adds JSDoc

2. You Trigger a Workflow:

/create-api-endpoint
  • Creates route file

  • Adds boilerplate

  • Generates tests

  • Updates documentation

3. Skills Load When Relevant:

  • Security skill checks for vulnerabilities

  • API design skill suggests improvements

  • Testing skill recommends edge cases

Result: A fully-typed, properly formatted, well-tested, secure API endpoint—automatically following all your standards.


Getting Started Today

Step 1: Install Antigravity

Visit antigravity.google and download with one click.

Step 2: Create Your First Rule

Start with something simple like a comment rule or TypeScript standard.

Step 3: Create Your First Workflow

Pick a repetitive task you do often (branch cleanup, deployment, etc.).

Step 4: Explore Community Skills

Check out skills others have created and adapt them for your needs.

Step 5: Iterate

Add more customizations as you discover patterns in your workflow.


Resources

🌐 Antigravity Official Site: https://antigravity.google

📚 Getting Started Guide: https://antigravity.google/docs/get-started

💻 Example Workflows: https://github.com/Sridhar-C-25/ag-workflow


Conclusion

Antigravity's Rules, Workflows, and Skills transform your AI coding agent from a generic assistant into a personalized development partner that:

✅ Automatically follows your coding standards
✅ Automates your repetitive tasks
✅ Provides expert guidance when you need it

The best part? You set it up once, and it works forever.

Start with one rule today. Add a workflow tomorrow. Create a skill next week. Before you know it, you'll have a fully customized AI agent that codes exactly the way you want—automatically.

What rule, workflow, or skill will you create first? Let me know in the comments!

Share:
Download Source Code

Get the complete source code for this tutorial. Includes all files, components, and documentation to help you follow along.

View on GitHub

📦What's Included:

  • • Complete source code files
  • • All assets and resources used
  • • README with setup instructions
  • • Package.json with dependencies
💡Free to use for personal and commercial projects