ANTIGRAVITY LABJP
Articles/Agents & Manager
Agents & Manager/2026-06-27Intermediate

Turning a throwaway prompt into a reusable sub-agent

When a one-off prompt to an Antigravity 2.0 dynamic sub-agent works beautifully, it usually vanishes into your chat history. Here is how to capture it as a reusable definition, with the actual file layout and the distillation steps.

Antigravity276sub-agentsAGENTS.md9automation66agent-design6

Premium Article

One night a prompt worked unusually well. It lined up my pre-release screenshots and flagged the truncated labels and the uneven margins per device. A week later I tried to run the same task again, and I could not find that prompt. It had sunk somewhere deep in the conversation scroll.

In Antigravity 2.0, dynamic sub-agents pick up parallel tasks for you. That is convenient, but the instructions you hand a child agent are born inside a conversation and they die inside it. The more useful a one-off result is, the more it pays to decide how you will keep it.

Why a prompt that worked once won't work again

The reason is plain: a prompt you typed in the moment carries no record of its assumptions.

The file that happened to be open, the exchange right before it, the unspoken bar for "good enough" you were holding in your head. The instruction only worked because all of that was present. Copy the string alone and none of it comes with you. Next week's version of you sits in a different context entirely.

So the thing worth keeping is not the wording of the prompt. It is the conditions under which that instruction held. A sub-agent definition is nothing more than those conditions, written down.

Four parts every reusable definition needs

The definitions I actually reused all shared the same four parts.

Role and boundaries

State in one sentence what this agent is responsible for. Just as important is what it must not do.

"Reviews the layout of screenshots. Does not touch code or assets." Spell out both the permitted scope and the forbidden one. Skip the boundary, and the child agent will helpfully propose changes you never asked for, which only adds to your review load.

Inputs and assumptions

Which files, which directory, which state does it need in order to work?

Leave this vague and every run begins with "which target did you mean?" — and the whole point of reuse evaporates. When the input cannot be fixed, declare it as a placeholder you pass in at call time.

Definition of done

What counts as finished? This is the heart of the definition.

"For each device size, check whether labels fit within the frame; list any that don't, together with the screen name. If everything is fine, reply only 'no issues'." Fix the shape of the output, and you can handle the result mechanically afterward.

Failure behavior

Cannot decide, target not found, assumption broken. Write down that, in those cases, it must not press ahead on its own.

This matters most in unattended runs. An agent that stops and reports is far cheaper to clean up after than one that charges forward on a shaky premise.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A concrete template that breaks a working prompt into four parts: role, inputs, definition of done, and failure behavior
Three steps to distill a throwaway prompt into a reusable definition, plus how to grow its accuracy over versions
A real indie-dev example: folding it into recurring release chores like screenshot review
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Agents & Manager2026-06-27
When Your Agent Automation Breaks: How Many Minutes to Recovery?
As Antigravity 2.0 adds desktop, CLI, and SDK surfaces, the things you must restore after a failure multiply too. As an indie developer running several sites on autopilot, I lay out a three-layer recovery design covering credentials, definitions, and state, plus a monthly restore drill.
Agents & Manager2026-06-15
Calling a Managed Antigravity Agent from the Gemini API: Design Notes on the Preview Model
antigravity-preview-05-2026, now in public preview on the Gemini API, is a Managed Agent that plans, runs code, edits files, and browses the web autonomously inside a sandbox. Here is how it differs from rolling your own orchestration, and where to draw the line.
Agents & Manager2026-05-06
Giving AI Agents an Aesthetic Sense — Building a UI Quality Evaluation Pipeline with Antigravity × Gemini Vision
Explore how to encode the vague judgment of 'is this UI good or bad' into code. Combines Antigravity with Gemini Vision to implement a complete pipeline — from screenshot capture to AI evaluation, improvement suggestions, automated fixes, and CI/CD integration.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →