Antigravity Customizer (ag-customizer)
Use this skill to autonomously design, scaffold, configure, migrate, and validate customizations for Google Antigravity across workspace and global scopes.
Quick Navigation Decision Matrix
Determine which customization mechanism best solves the problem:
| Need | Mechanism | File Location | Reference Guide |
|---|---|---|---|
| Teach the agent a multi-step runbook, procedure, or slash command | Skill | .agents/skills/<name>/SKILL.md or ~/.gemini/antigravity/skills/<name>/SKILL.md | skills-guide.md |
| Enforce persistent constraints, coding standards, or style rules | Rule | .agents/rules/<name>.md, AGENTS.md, or ~/.gemini/GEMINI.md | rules-guide.md |
| Connect external services, local databases, or custom tools | MCP Server | .agents/mcp_config.json or ~/.gemini/config/mcp_config.json | mcp-guide.md |
| Intercept lifecycle events (gate commands, inject prompts, stop watchdog) | Lifecycle Hook | .agents/hooks.json or ~/.gemini/config/hooks.json | hooks-guide.md |
| Bundle skills, rules, hooks, and MCP into a shareable package | Plugin | .agents/plugins/<name>/ or ~/.gemini/config/plugins/<name>/ | plugins-and-configs.md |
| Register non-standard paths or share customizations via VCS | JSON Config | .agents/skills.json or .agents/plugins.json | plugins-and-configs.md |
| Upgrade deprecated workflows into modern slash-command skills | Workflow Migration | .agents/workflows/*.md -> .agents/skills/<name>/SKILL.md | workflows-migration.md |
Operational Workflows
1. Adding a New Skill
- Determine Scope:
- Workspace:
.agents/skills/<name>/(checked into repository for team use). - Global:
~/.gemini/antigravity/skills/<name>/(available across all projects).
- Workspace:
- Structure the Directory:
<customization_root>/skills/<skill-name>/ ├── SKILL.md # Required: Entry point with YAML frontmatter ├── scripts/ # Optional: Helper scripts (run with --help pattern) ├── references/ # Optional: Disclosed manuals & heavy documentation └── examples/ # Optional: Sample code or output references - Draft Frontmatter:
name: Lowercase, hyphenated (e.g.nextjs-otel,docker-deploy). This also registers as a slash command (/<name>).description: 1-3 sentences in third person, explicitly stating what the skill does and specific trigger phrases/scenarios when the agent should activate it.
- Apply Progressive Disclosure:
- Keep the main
SKILL.mdtightly focused on the sequence of operational steps and completion criteria. - Disclose deep reference material into
references/<topic>.mdfiles and link them relatively. - Refer to skills-guide.md for structure templates.
- Keep the main
- Obsidian Mirroring Check:
- When updating or creating skills in this workspace, mirror the skill folder to
d:/Scripts/Obsidian/skills/<name>/per repository guidelines.
- When updating or creating skills in this workspace, mirror the skill folder to
2. Creating a Rule
- Determine Scope & Format:
- Workspace Rule:
.agents/rules/<rule-name>.mdorAGENTS.mdat project root. - Global Rule:
~/.gemini/GEMINI.md.
- Workspace Rule:
- Choose Activation Mode (for
.agents/rules/*.md):always_on: Injected unconditionally into every turn. Use sparingly to preserve context.model_decision: Disclosed when the agent determines relevance based on the description.glob: Automatically activated whenever matching files are touched or opened (e.g.*.tsx,src/api/**/*.ts).manual: Only loaded when explicitly invoked via@mentionin chat (e.g.@my-rule.md).
- Author Content:
- Keep within the 12,000-character budget per file.
- State target behaviors in the positive ("Do X", "Always structure Y") rather than negative prohibitions.
- Use
@filenameto link to companion context files if needed. - Refer to rules-guide.md for full syntax and activation frontmatter.
3. Configuring an MCP Server
- Determine File Location:
- Workspace:
<workspace>/.agents/mcp_config.json - Global:
~/.gemini/config/mcp_config.json
- Workspace:
- Select Transport:
- stdio (Local executable):
{ "mcpServers": { "my-server": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-sqlite", "app.db"], "env": { "SQLITE_READONLY": "true" } } } } - Remote (SSE / Streamable HTTP):
[!IMPORTANT] Always use the key
serverUrl. The legacy keysurlorhttpUrlare not supported.{ "mcpServers": { "my-remote": { "serverUrl": "https://api.example.com/mcp/", "headers": { "Authorization": "Bearer YOUR_TOKEN" } } } }
- stdio (Local executable):
- Authentication:
- Google Application Default Credentials:
"authProviderType": "google_credentials"(requiresgcloud auth application-default login). - OAuth:
"oauth": { "clientId": "...", "clientSecret": "..." }with redirect URIhttps://antigravity.google/oauth-callback.
- Google Application Default Credentials:
- Tool Filtering:
- Temporarily disable tools without removing server:
"disabledTools": ["destructive_command"]. - Refer to mcp-guide.md for pre-built configurations.
- Temporarily disable tools without removing server:
4. Setting Up Lifecycle Hooks
- Target File:
.agents/hooks.json(or~/.gemini/config/hooks.json). - Supported Events:
PreToolUse: Match tool names (run_command,write_to_file,*) to gate execution (allow,deny,ask,force_ask) or shallow-overwrite arguments.PostToolUse: Audit output, run linters, or format code after tool completes.PreInvocation: Inject context or system instructions (injectStepswithephemeralMessage) before model processes the turn.PostInvocation: Force continuation (terminationBehavior: "force_continue") or stop.Stop: Inspect task completion (terminationReason,fullyIdle) and returndecision: "continue"withreasonto block premature exit.
- Contract Rules:
- Execution passes context via stdin and receives response via stdout.
- All JSON payload keys use camelCase (
conversationId,stepIdx,toolCall, etc.). - Commands execute synchronously and block the agent loop until timeout (default 30s).
- Refer to hooks-guide.md for templates in Python, PowerShell, and Bash.
5. Packaging a Plugin or VCS Shared Config
- Plugin Package:
- Group related skills, rules, hooks, and MCP servers into
.agents/plugins/<plugin-name>/. - Add
plugin.jsonmanifest ({"name": "my-plugin"}). - Manage activation state in
config.jsonunder"plugins": { "<plugin-name>": { "enabled": true } }.
- Group related skills, rules, hooks, and MCP servers into
- JSON Configurations (
skills.json/plugins.json):- Register external directories or shared team repositories.
- Support
entries(paths) andinherits(other configs) withinclude_onlyandexcluderegex filters. - Refer to plugins-and-configs.md for complete manifest examples.
6. Modernizing Legacy Workflows
- Inspect for deprecated
.agents/workflows/*.mdor~/.gemini/config/workflows/*.md. - Extract operational instructions and generate equivalent
SKILL.mdwith proper YAML frontmatter. - Archive original file to
<name>.md.bak(safe preservation). - Refer to workflows-migration.md for the automated migration runbook.
Validation & Verification Checklist
Before considering any customization complete:
- JSON Syntax: Ensure all
.jsonfiles parse cleanly without syntax errors or comments. - Frontmatter Check: Verify
SKILL.mdcontains valid YAML frontmatter withnameand descriptivedescription. - Character Budget: Ensure rule Markdown files are within the 12,000 character limit.
- MCP Connection: Verify command binaries or remote URLs exist and authenticate.
- Hook Contract: Verify hook scripts accept camelCase JSON on stdin and return valid JSON on stdout.
- Obsidian Mirroring: For skills in this workspace, sync the created skill folder to
d:/Scripts/Obsidian/skills/<name>/.