Prompt Engineering in Antigravity CLI

Effective prompting strategies for Antigravity CLI. Multi-model routing, system prompts, context management, hooks, subagents, and agent skills.

October 20, 2026
antigravityagyprompt-engineeringmulti-modelagent-skills
Prompt Engineering in Antigravity CLI

Prompt Engineering in Antigravity CLI

Antigravity CLI supports multiple models, agent skills, hooks, and subagents. Effective prompting requires understanding when to use each.

Multi-Model Routing

Flat vector flow diagram mapping prompt inputs to fast, reasoning, and coding models

Antigravity CLI's key differentiator is built-in multi-model support. Route tasks to the right model:

Quick one-off questions

Use Gemini 3.8 Flash for speed:

agy -p "What does this function do?"
agy --model gemini-3.8-flash-medium -p "List all TODO comments in this project"

Complex architecture decisions

Use Claude Opus 5.5 or Gemini 3.1 Pro for deep reasoning. --model takes a slug from agy models:

agy --model gemini-3.1-pro-high -p "Design a data pipeline that handles 10M events/day"

In-session switching

> /model Gemini 3.8 Flash (High)
> Explain how this GraphQL resolver works
> /model Claude Opus 5.5 (Thinking)
> Now audit the same resolver for security vulnerabilities

Context Management

GEMINI.md

Create a GEMINI.md at project root for persistent context:

# Project Context

## Commands
- `npm run dev` — Dev server
- `npm run build` — Production build
- `npm test` — Run tests

## Architecture
- Next.js 15 App Router
- Tailwind CSS v4
- Supabase for database + auth
- Vitest + Playwright for testing

## Conventions
- Components in `src/components/`
- Pages in `src/app/`
- PascalCase for component files

Session rewind and resume

Cyberpunk synthwave dashboard showcasing session rewind and restore interface

Antigravity CLI uses /rewind and /undo to roll back conversation history, /resume to reopen a previous conversation, and /fork to branch into a parallel session:

> /rewind
... work ...
> /resume

Hooks

Hooks are JSON entries in .agents/hooks.json (workspace) or ~/.gemini/config/hooks.json (global).

Hook events

HookWhen it runs
PreToolUseBefore a tool is executed
PostToolUseAfter a tool completes
PreInvocationBefore the model is called
PostInvocationAfter each model invocation
StopWhen the execution loop terminates

Example: Always run lint after file changes

{
  "lint-changes": {
    "PostToolUse": [
      {
        "matcher": "write_to_file|replace_file_content",
        "hooks": [
          {
            "type": "command",
            "command": "npm run lint"
          }
        ]
      }
    ]
  }
}

Example: Verify the build when the loop stops

{
  "verify-build": {
    "Stop": [
      {
        "type": "command",
        "command": "npm run build"
      }
    ]
  }
}

Subagents

Subagents let you delegate specialized work to dedicated agents from the Agent Manager:

> /agents

Use the panel to start a subagent for a task such as writing tests for the auth module or auditing the codebase for security issues, and select its model there. Agents run in the background and report back; /agents does not take task, --background, or --model arguments.

Agent Skills

Agent Skills is an open standard for packaging specialized expertise as portable SKILL.md folders. Antigravity CLI auto-loads skills from the project's .agents/skills/ directory or global config at startup — no manual activation needed.

List available skills:

> /skills

Skills are community-contributed and installed via the plugin system. See the Agent Skills guide for the format specification, best practices, and cross-tool usage.

Prompt Patterns

The "Explain and Extend" Pattern

Read src/lib/api.ts and explain the authentication flow.
Then add rate limiting using the same patterns.

The "Generate, Then Polish" Pattern

Generate a React component for a data table with sorting and filtering.
First generate the skeleton, then I'll ask for refinements.

The "Cross-Model Review" Pattern

> /model Gemini 3.8 Flash (High)
Generate a TypeScript utility library with 10 string manipulation functions.
> /model Claude Opus 5.5 (Thinking)
Review the generated code for edge cases and type safety.

Sources