Agent Manager with Google Antigravity/Real Fleet Projects
Lesson 2 / 6 · 14 min · 0 / 2 exercises
Course contents
Sandbox demo · 2 hands-on exercises

Docs That Track the Code

Make docs freshness an agent's recurring job: diff the public API since the last pass, update what changed, run every code sample, and schedule it with an Automation.

Docs drift because updating them is a chore nobody owns. Make it an agent's chore. After a release, a docs agent diffs the public API since the last docs pass, updates what changed and, the part that keeps docs honest, runs every code sample before opening the PR.

Why run the samples

A code sample that doesn't compile is worse than no sample. It actively misleads, and readers lose trust in every page around it. Running every sample on every pass is cheap insurance, and it's exactly the kind of tedious, checkable work agents are good at.

Package the procedure as a skill

Diff the API, update the pages, run the samples, open a PR: that's a procedure, so it belongs in a skill. Then the brief for each run is one line, /docs-sync, and improving the procedure is a reviewed change to a file.

.agents/skills/docs-sync/SKILL.md
---
name: docs-sync
description: Updates docs/ after public API changes and verifies every code sample runs. Use after a release, or when the exports in src/index.ts change.
---

1. Diff the public API since the last release: git diff <previous-tag>..HEAD -- src/index.ts
2. Update or add a page in docs/api/ for each changed export.
3. Run npx tsx docs/check-samples.ts. Every sample must pass.
4. Open a PR titled "docs: sync with <version>" whose body lists each change and the sample output.
Put it in orderExercise 1 of 2

Put one docs-sync pass in order.

  1. Open the PR for your review
  2. Diff the public API against the previous release tag
  3. Update or add a docs page for each changed export
  4. Run every code sample and fix any that fail
  5. Write the walkthrough with the API diff and the sample output
Quick checkExercise 2 of 2

The sample checker reports 6 of 7 samples passing. The failing one calls a function that was removed in this release. What should the agent do?

Make it recurring with Automations

Automations (called Scheduled Tasks until October 2026) let a project run work on a schedule, with the model of your choice. The CLI doesn't have Automations; its /schedule command sets timers within a conversation instead. A weekly docs pass is a natural first Automation: the same brief every time, a clear done, and a PR waiting for you on Monday morning.

Sandbox transcript
Antigravity · sandbox replay
Press Play to replay this transcript step-by-step.
0 / 7

The transcript is canned — no real API calls. The point is to internalize the loop: user → plan → tool → result → answer.

Steps · 0 / 3 done
  1. Write the skill

    Create .agents/skills/docs-sync/SKILL.md from the example, adjusted to your repo's paths and sample checker.

    VerifyTyping /docs-sync in a new conversation starts the procedure.
  2. Run it once by hand

    Run the skill after your next release and review the PR it opens.

    VerifyEvery sample in the PR body passed, and every changed export has a page.
  3. Schedule it

    Create an Automation in the project that runs /docs-sync weekly. Routine work suits Gemini 3.8 Flash.

    VerifyNext week's docs PR arrives without you starting it.
Check your understanding
Q1. Why make the agent run every code sample before opening the docs PR?
Q2. What's a skill's role in a recurring Automation?
· Tick off the 3 step(s) above.
· Work through the 2 remaining exercises above (stuck? each one can show you the answer).
· Score 100% on the quiz.
Vocabulary in this lesson

Plain-English definitions from the AI Coding Dictionary.