Hello, this is Lovefield.
When building production software with Google Antigravity and Gemini models, it quickly becomes tedious to repeat the same team conventions in every chat session. Constantly reminding the agent—"We use Bun and Biome," "Follow this API response envelope," or "Use Vue 3.5 syntax"—wastes time and often leads to drift as conversations grow longer.
Antigravity addresses this cleanly through a structured configuration system: the .agents directory, AGENTS.md, and modular skills packages. In this guide, we will walk through how to configure Gemini agents in Antigravity so they write consistent, production-ready code aligned with your team's engineering standards.
The .agents Directory and Context Hierarchy
Antigravity automatically scans your repository root and .agents folder to load agent instructions and domain knowledge. Dumping every guideline into a single massive file wastes tokens and causes rule conflicts. Instead, separate always-on global rules (AGENTS.md) from task-specific expertise (.agents/skills/).
Plain Text
1
2
3
4
5
6
7
8
9
10
11
12
my-project/
├── AGENTS.md # Global project rules (always loaded)
└── .agents/
├── rules/ # Modular rules (scans direct .md files only)
│ └── security.md
└── skills/ # Domain-specific skills (loaded on demand)
├── code-style/
│ ├── SKILL.md # Required: YAML frontmatter + style guide
│ └── examples/ # Optional: reference implementations
└── api-design/
├── SKILL.md # Required: API standards and error specs
└── resources/ # Optional: OpenAPI templates, schemasOne important detail about .agents/rules/: Antigravity only scans direct .md files inside .agents/rules/ (such as security.md) by default and ignores nested subdirectories unless explicitly referenced. Whenever a domain guide needs companion examples or templates, organize it as a skill under .agents/skills/<skill-name>/SKILL.md.

Establishing Project Guardrails in AGENTS.md
Located at the repository root (or .agents/AGENTS.md), AGENTS.md acts as the constitution that Gemini reads first at the start of every session.
Rather than filling it with lengthy tutorials, keep it dense and actionable: define your tech stack, self-verification commands, directory boundaries, and strict guardrails.
Markdown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Project Overview & Core Rules
## Tech Stack
- Runtime & Package Manager: Bun
- Framework: Nuxt 4 (Vue 3.5, TypeScript 5.x strict mode)
- Linter & Formatter: Biome
## Verification Commands
Always run these commands before finishing a task to verify zero errors:
- Type Check: `bun run typecheck`
- Lint & Format: `bun run check:fix`
- Unit Test: `bun test`
## Directory Boundaries
- `app/components/`: Pure presentational UI components (no business logic)
- `app/composables/`: State management and API fetching logic
- `server/api/`: Nitro backend endpoints
## Global Guardrails
- Strictly prohibit `any` and `@ts-ignore`.
- Never install external packages without asking for approval first.
- Do not leave `console.log` statements in production code.By listing verification commands directly in AGENTS.md, the Gemini agent can run bun run typecheck and bun run check:fix on its own, catching and fixing type or formatting issues before presenting its changes.
How Progressive Disclosure Works in .agents/skills
What separates .agents/skills/ from ordinary documentation is Progressive Disclosure:
Discovery: At session startup, Antigravity only reads the lightweight name and description fields from each SKILL.md YAML frontmatter—not the full body.
Activation: When your prompt matches a skill's description (or when you invoke it explicitly via a slash command like /code-style), Antigravity loads the full SKILL.md along with any referenced examples/ or resources/.
Execution: The agent applies those exact conventions and checklists to generate consistent output.
This keeps your context window lean even when your repository holds dozens of specialized engineering guides.
Practical Skill Example Code Style (code-style)
Here is how to structure .agents/skills/code-style/SKILL.md. The key is writing a clear description that specifies when the skill should trigger.
Markdown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
name: code-style
description: Frontend code style and conventions for Vue 3.5, TypeScript, and Biome. Use when creating new components or composables, refactoring existing code, or performing code reviews.
---
# Frontend Code Style Guide
## Vue 3.5 Conventions
- Use `<script setup lang="ts">` for all components.
- Declare props with type-based `defineProps<Props>()` and Reactive Props Destructure.
- Prefer `useTemplateRef()` over `ref(null)` for DOM element references.
- Clean up async requests and event listeners inside watchers using `onWatcherCleanup()`.
## TypeScript Rules
- Prefer `interface` for object shapes; reserve `type` for unions and intersections.
- Always declare explicit return types on exported functions.
- Catch errors as `unknown` and narrow them with type guards.
## Checklist Before Finishing
1. Remove unused imports and redundant comments.
2. Run `bun run check:fix` to ensure full Biome compliance.Practical Skill Example API Design (api-design)
Inconsistent response envelopes and error formats across server/api/ handlers quickly inflate frontend integration costs. Defining .agents/skills/api-design/SKILL.md ensures Gemini designs every endpoint to the same specification.
Plain Text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
name: api-design
description: REST API endpoint design, request schema validation, standard response envelopes, and error handling. Use when adding new endpoints under server/api or updating existing API contracts.
---
# API Design Standards
## URL & HTTP Methods
- Use lowercase kebab-case plural nouns for resource paths (e.g., `/api/v1/blog-posts`).
- Return `201` for `POST` creation, `200` for `PATCH` partial updates, and `204` for `DELETE`.
## Input Validation
- Validate all request bodies and query parameters at the top of each handler with `zod`.
- On validation failure, return `400 Bad Request` with field-level error details.
## Standard Response Envelope
All success and error responses must follow this JSON structure:
// Success
{
"success": true,
"data": { ... },
"meta": { "timestamp": "2026-12-15T09:00:00Z" }
}
// Error
{
"success": false,
"error": {
"code": "INVALID_INPUT",
"message": "Invalid input parameters.",
"details": []
}
}
## Security & Performance
- Never expose internal stack traces in client responses.
- Apply `page` and `limit` pagination by default on all list endpoints.Team Sharing and Maintenance Tips
Treat .agents/ and AGENTS.md as shared engineering assets committed to Git, not personal local tweaks.
Keep skills focused: Combining code style, API design, and deployment steps into a single SKILL.md lowers activation accuracy. Split skills cleanly by concern.
Include reference examples: A single well-crafted file like .agents/skills/api-design/examples/sample-handler.ts teaches Gemini your patterns far more reliably than paragraphs of prose.
Separate workspace and global skills: Keep project-specific conventions inside the repository's .agents/skills/, and place personal cross-project workflows (like commit message formatting or PR summaries) in ~/.gemini/config/skills/.
Summary
The most reliable way to elevate Gemini agents in Antigravity is not crafting longer one-off prompts, but designing .agents, AGENTS.md, and modular skills/ as first-class parts of your codebase.
Lock down global guardrails in AGENTS.md and package repeatable expertise like code-style and api-design into SKILL.md files. You will immediately notice fewer review cycles and much higher consistency across every pull request.
This article was generated by AI.

Lovefield
Web Front-End developer
하고싶은게 많고, 나만의 서비스를 만들고 싶은 변태스러운 개발자입니다.

Building Your Own MCP Server with TypeScript and Bun
Learn the core architecture of MCP (Model Context Protocol) and build your own lightweight custom MCP server from scratch using TypeScript and Bun to connect AI agents with local files and internal workflows.
Java Script

Building Real-Time AI Streaming UI with Nuxt 4 and SSE
Learn how to stream LLM responses in real time using Nuxt 4 Nitro endpoints, Server-Sent Events (SSE), and the Web Streams API, complete with AbortController cancellation and smooth UI rendering patterns.
Nuxt