Skip to content

Module 1: SDLC Productivity 75 min

Your first real Antigravity CLI session. This module covers the core daily-driver workflows — understanding code, refactoring, generating tests, and reviewing changes — plus how to extend the CLI with plugins for your team's toolchain.


1.0 — First Interactive Session 5 min

Launch Antigravity CLI in your workshop project directory:

cd agy-cli-field-workshop
agy

You'll land in the interactive prompt. Try:

> What files are in this project and what does each one do?

Observe how agy reads your workspace — it indexes the git repo, reads file contents, and responds with context. This is automatic: no config, no prompts to write first.

The .agents/ folder

After your first session, check .agents/ — agy created project config files tracking your workspace. This is how it knows what to index on future runs.


1.1 — Code Understanding 10 min

Pattern: Explain Before You Touch — understand the code before changing it.

Exercise: Map an Unfamiliar Codebase

# -i seeds the session with an initial prompt and stays interactive
agy -i "Give me a high-level architecture overview of this project. What are the main components and how do they connect?"

Then follow up interactively:

> Which file handles the entry point?
> What external dependencies does this project have?
> Are there any obvious code smells or tech debt?

Use -i for seeded sessions

agy -i "<task>" (short for --prompt-interactive) starts with a prompt but stays interactive. Great for oriented exploration — you set the direction, then steer with follow-ups.


1.2 — Refactoring 10 min

Pattern: Propose, Review, Apply — never apply changes you haven't read.

Exercise: Targeted Refactor

agy
> I want to refactor the error handling in this project. First, show me all the places where errors are currently caught or returned — don't change anything yet.

Review the findings. Then:

> Now propose a refactored version of [specific function] using a consistent error handling pattern. Show me the diff before applying.

Only apply after you've read the proposed change.

Permissions Model

agy has a 3-level permissions model that controls how it handles tool approvals:

Level Behavior
request-review Default. agy asks for approval before writing files or running commands
always-proceed Auto-approve all tool calls — useful for trusted scripts and CI
strict Deny all tool use unless explicitly allowed — maximum control

Use the /permissions slash command to view or change the current level. You can also set fine-grained rules in settings.json:

{
  "permissions": {
    "allow": ["command(git)", "read_file"],
    "deny": ["command(rm -rf)"]
  }
}

📖 Full details: Permissions docs · Strict Mode docs


1.3 — Test Generation 10 min

Pattern: Test What Exists — generate tests for real code, not hypotheticals.

Exercise: Generate Unit Tests

agy
> Look at [specific function or file]. Generate a comprehensive unit test suite for it. Include happy path, edge cases, and error conditions. Use the testing framework already in this project.

Then:

> Run the tests and fix any that fail.

Let agy run the tests

agy can execute shell commands. It will run your test suite and iterate on failures without you having to copy-paste error messages. Watch it self-correct.


1.4 — Code Review 10 min

Pattern: Pre-Commit Review — use agy as a senior reviewer before every push.

Exercise: Review Your Changes

# Stage some changes (or use an existing branch)
git add -p

# Start agy and review what's staged
agy
> Review my staged changes for: (1) correctness, (2) security issues, (3) missing test coverage, (4) anything that would block a PR. Be direct — don't soften findings.

Headless Variant (for scripting)

# Review changes non-interactively — useful in pre-commit hooks or CI
git diff --cached | agy --print "Review these changes. Flag any bugs, security issues, or missing tests. Output as markdown."

1.5 — Project Context with AGENTS.md 5 min

Pattern: Persistent Context — tell agy once, it remembers every session.

agy reads context files at session start. Create one at the project root:

cat > AGENTS.md << 'EOF'
# Project Context

This is a Node.js REST API built with Express and TypeScript.

## Key Conventions
- Language: TypeScript (strict mode, no `any`)
- Testing: Jest with 80% coverage minimum; run `npm test` to validate
- Style: ESLint + Prettier; run `npm run lint` before committing
- DO NOT modify `src/db/migrations/` — those are append-only
- DO NOT use `console.log` in production code; use the `logger` utility

## Architecture
Three-layer: `routes/` → `services/` → `repositories/`. All DB access goes through the repository layer. External HTTP calls go through `src/clients/`.

## Common Commands
- `npm run dev` — start local dev server on :3000
- `npm test` — run full test suite
- `npm run db:migrate` — apply pending DB migrations
EOF

Now start a new session:

agy --print "What do you know about this project?"

agy will incorporate your AGENTS.md into every subsequent session automatically.

Context hierarchy

agy reads AGENTS.md from: current directory → parent directories → home directory. More specific context overrides broader context.

Additional Context Sources

Beyond AGENTS.md, agy also loads:

  • .agents/rules.md (or .agents/rules/*.md) — project-level rules injected as system prompt directives. Use these for hard requirements like "never delete migration files" or "always use TypeScript strict mode."
  • .gemini/ — for Gemini CLI compatibility, agy reads .gemini/ directories alongside .agents/.
  • ~/.gemini/config/rules.md — global rules applied to all sessions.

📖 Full details: Rules & Workflows docs

Sample Agent Definitions (in samples/agents/)

Agent Model Purpose
doc-writer.md gemini-3.5-flash Generates API docs, README sections, and inline comments from source
pr-reviewer.md gemini-3.5-flash Reviews code changes for quality, bugs, and style violations
migration-validator.md gemini-3.5-flash Validates Gemini CLI → Antigravity CLI migration completeness

1.6 — Interactive Navigation 5 min

Pattern: Terminal Fluency — know the shortcuts that make agy sessions fast. 📖 Full reference: Using Antigravity CLI

Key Slash Commands

Command What it does
/rewind (or /undo) Roll back conversation history to a previous checkpoint
/resume (or /switch) Open conversation picker to resume or switch sessions
/rename <name> Rename the active conversation thread
/config (or /settings) Open full-screen settings overlay
/permissions Set agent autonomy level (request-review, always-proceed, strict)
/model Select reasoning model (persists across sessions)
/tasks Monitor, view logs for, or terminate background tasks
/agents View, manage, and approve subagent actions
/open <path> Open a file in your preferred external editor
/usage Open the inline interactive help manual
/skills Browse local and global agent skills
/mcp Configure and manage MCP servers

📖 Full slash command reference: CLI Features

Quick Tips

Shortcut What it does
@ File path autocomplete — type @ to trigger path suggestions
! Run terminal commands directly without leaving agy
esc esc Clear the current prompt input (when no streaming is active)
? Get help and list all slash commands
alt+enter / ctrl+j / shift+enter Insert a newline in your prompt (multi-line input)
ctrl+g Edit prompt inside your default shell editor
ctrl+l Clear TUI screen
ctrl+d Exit the CLI

📖 Full keybindings reference: Using Antigravity CLI


1.7 — Extend with Plugins 15 min

Pattern: Bring Your Toolchain — plugins add skills, MCP servers, agents, and rules to agy. Install once, available in every session.

Antigravity CLI's plugin system does something unique: it can import plugins you've already installed in Gemini CLI — without reinstalling or reconfiguring. Your existing investment carries over.

See What's Active

agy plugin list

Shows each plugin's name, source, import date, and components (skills, commands, mcpServers, agents).

Import from Gemini CLI

agy plugin import gemini

agy scans your local Gemini CLI installation, discovers all installed plugins, and stages their components into ~/.gemini/antigravity/. Output:

  [ok]    code-review
          ✔ skills      : 3 processed
          ✔ commands    : 2 processed
          - mcpServers  : skipped (not found)
  [ok]    gemini-deep-research
          ✔ commands    : 1 processed
          ✔ mcpServers  : 1 processed
  [skip]  superpowers (already imported)

Custom themes are silently dropped

Custom theme components cannot be migrated 1:1 to agy's model and are skipped without error during import. Check your active plugins after import if themes are important to your workflow.

Re-import after plugin updates

Already-imported plugins are skipped by default. Force a re-import:

agy plugin import gemini --force

What Gets Imported

Component What it means
skills SKILL.md files — injected as domain expertise into agy sessions
commands Slash commands available inside agy sessions
mcpServers MCP tool servers (GitHub, gcloud, Workspace, etc.)
agents Custom subagent definitions
rules Rules files injected as system prompt directives
hooks Staged but not auto-executed — agy handles lifecycle differently

Enable / Disable Per-Project

Not every plugin is appropriate for every codebase:

# Disable for this project
agy plugin disable gemini-deep-research

# Re-enable
agy plugin enable gemini-deep-research

Plugin Locations

Scope Path
Global ~/.gemini/antigravity/plugins/
Project .agents/plugins/

Building a Custom Plugin

A valid agy plugin needs a plugin.json manifest:

my-plugin/
├── plugin.json          ← required
├── mcp_config.json      ← MCP server definitions (optional)
├── hooks.json           ← hook event handlers (optional)
├── skills/              ← SKILL.md files (optional)
│   └── my-skill/
│       └── SKILL.md
├── agents/              ← subagent definitions (optional)
└── rules/               ← rules files (optional)
    └── my-rules.md
{
  "name": "my-plugin",
  "version": "1.0.0",
  "description": "My custom agy plugin",
  "components": ["skills"]
}

Validate it before shipping:

agy plugin validate ./my-plugin
# ✔ Plugin manifest is valid

📖 Full reference: Plugins · Migration guide


Module 1 Exercises

Exercise 1: First Session

File: ex01_first_session.md
Duration: 15 min
Objective: Launch agy, explore a codebase, generate an AGENTS.md.

Exercise 2: Plugin Bridge

File: ex02_plugin_bridge.md
Duration: 20 min
Objective: Import plugins from Gemini CLI, enable/disable selectively, validate a custom plugin.


Next Module

Module 2: Legacy Codebase Modernization — strict mode, agent self-onboarding, subagents, and /rewind as your safety net.