diff --git a/README.md b/README.md index d84f089..f4a9597 100644 --- a/README.md +++ b/README.md @@ -201,6 +201,7 @@ Or trigger `/cloud-swarm` right in chat: | skill | use it when | |---|---| | [`/agystack`](./skills/agystack/SKILL.md) | default entry point for any non-trivial task on Antigravity (twin of poteto-mode). | +| [`/agystack-help`](./skills/agystack-help/SKILL.md) | you have a question about agystack setup, skills, playbooks, or prompts without starting edits yet. | | [`/poteto-mode`](./skills/poteto-mode/SKILL.md) | default entry point for any non-trivial task. | | [`/how`](./skills/how/SKILL.md) | you want a walkthrough of how a subsystem works. | | [`/why`](./skills/why/SKILL.md) | you want to know why something was built this way. discovers available MCPs at run time and queries each evidence category in parallel (source control, issue tracker, long-form docs, real-time chat, infra observability, error tracking, analytics warehouse). | diff --git a/docs/guide/03-understand.md b/docs/guide/03-understand.md index 5dedfaa..7a8581c 100644 --- a/docs/guide/03-understand.md +++ b/docs/guide/03-understand.md @@ -1,16 +1,28 @@ # Understand the code before changing it -Editing code you don't understand is how subtle regressions ship. agystack gives you four ways in. `/how` explains what the code does now. `/why` digs up the reasons it's shaped that way. `/teach` blends both into one explanation. `/recall` rebuilds your own recent context on a topic. +Editing code you do not understand is how subtle regressions ship, and that is as true for the agent as for you. Agents usually fail in one of two ways. They misread what you want, or they lack the context to do the work right. [Say the goal, not the ceremony](./02-poteto-mode.md#say-the-goal-not-the-ceremony) handles the first. This page handles the second. + +agystack gives you four ways in. `/how` explains what the code does now. `/why` digs up the reasons it is shaped that way. `/teach` blends both into one explanation. `/recall` rebuilds your own recent context on a topic. Each one also makes the agent explain itself in words you can check. That is how you supervise an agent that may know the code better than you do. ![A detective studies a machine blueprint with a magnifying glass while robots fetch case files; the evidence board behind her links clues under /how and /why.](./images/understanding.jpg) +## Start with a read-only investigation + +When the cause is unclear, ask for findings, not a fix. + +```text +/poteto-mode investigate why background jobs time out every few hours. give me what we know, what data you used, and your best hypotheses. don't change any code yet. +``` + +`"don't change any code yet"` routes this to the [Investigation playbook](../../skills/poteto-mode/playbooks/investigation.md). It traces the code, adds `/why` for motivation questions, and returns a cited explanation (writing `investigation_report.md` for deeper subsystems). For a choice between options, it returns a recommendation with a trade-offs table. Asking `"what data you used"` makes the agent separate direct evidence from guesses. When the findings point at a fix, start the fix as a new task. + ## Trace behavior with `/how` ```text /how do we dedupe notifications? is there an n+1 when we look up subscribers? ``` -Ask the question you actually have. [`/how`](../../skills/how/SKILL.md) reads the code and answers at the level of a senior engineer onboarding you onto the subsystem, with the runtime flow, the key types, and the non-obvious parts. For a big subsystem it fans out two to four read-only explorers first. For a narrow question it just reads and explains. +Ask the question you actually have. [`/how`](../../skills/how/SKILL.md) reads the code and answers at the level of a senior engineer onboarding you onto the subsystem, with the runtime flow, the key types, and the non-obvious parts. For a big subsystem it fans out two to four read-only `flash` explorers first. For a narrow question it reads directly and explains. For adversarial challenge and stress-testing code or architecture, use [`/interrogate`](../../skills/interrogate/SKILL.md). @@ -20,9 +32,9 @@ For adversarial challenge and stress-testing code or architecture, use [`/interr /why was the retry limit set to five? does the reason still hold? ``` -[`/why`](../../skills/why/SKILL.md) works like a detective on a cold case. It starts from source control, then queries whatever evidence categories your MCPs expose, such as the issue tracker, long-form docs, team chat, observability, error tracking, and analytics, all in parallel. The report cites everything, separates direct evidence from inference, and says "appears to" when the record is thin. A null result gets reported too, because "nobody wrote down why" is itself an answer. +[`/why`](../../skills/why/SKILL.md) works like a detective on a cold case. It starts from source control, then queries whatever evidence categories your MCPs expose, such as the issue tracker, long-form docs, team chat, observability, error tracking, and analytics, all in parallel. The report cites what the authors wrote, separates direct evidence from inference, and says `"appears to"` when the record is thin. A null result gets reported too, because `"nobody wrote down why"` is itself an answer. -The two compose naturally. `do why first then how` is a perfectly good prompt when you suspect the history explains the mess. +The two compose naturally. `do why first then how` is a good prompt when you suspect the history explains the mess. ## Actually understand it with `/teach` @@ -30,7 +42,15 @@ The two compose naturally. `do why first then how` is a perfectly good prompt wh /teach me how this PR changes retries. convince me it fixes the cause and not the symptom. ``` -[`/teach`](../../skills/teach/SKILL.md) is for when a summary isn't enough. It runs `/how` and `/why`, for a small change maybe just one of them, and weaves the findings into a plain explanation that builds up diagram by diagram. The "convince me" framing is worth stealing. It turns the explanation into an argument you can poke at instead of a tour. +[`/teach`](../../skills/teach/SKILL.md) is for when a summary is not enough. It runs `/how` and `/why`, or just one of them for a small change, and weaves the findings into a plain explanation that builds up diagram by diagram. The `"convince me"` framing is worth reusing. It turns the explanation into an argument you can test instead of a tour. + +It works on the agent's own choices too. + +```text +/teach me why you implemented it this way and not with a queue. what did you trade off, and why? +``` + +Teaching helps the agent as much as you. An agent that has to explain its work must read the code and back each claim with evidence, instead of stating it confidently and moving on. ## Rebuild your own context with `/recall` @@ -38,11 +58,17 @@ The two compose naturally. `do why first then how` is a perfectly good prompt wh /recall catch me up on the export work from last week ``` -[`/recall`](../../skills/recall/SKILL.md) mines your own recent chats plus the shared record (issues, prior fixes, errors still firing) and hands back a brief on where things stand and what's next. Use it when you're returning to a topic cold. If you want to resume one specific chat, that's the Session pickup playbook below, not `/recall`. +[`/recall`](../../skills/recall/SKILL.md) mines your recent Antigravity workspace chats plus the shared record (issues, prior fixes, errors still firing) and hands back a brief on where things stand and what is next. Your old chats hold context that a fresh agent lacks, so start new work on an old topic by loading it first, then hand over the new input. + +```text +/recall my work on the virtualized list from yesterday, then read this bug report. +``` + +If you want to resume one specific chat or branch, use the Session pickup playbook below instead of `/recall`. ## Take over prior work with Session pickup -When another agent (or you, last week) left a branch mid-flight: +When another agent (or you, last week) left a branch mid-flight, hand over the branch explicitly. ```text /poteto-mode take over this branch. read the decision log, figure out what's done, and continue from there. don't redo finished work. @@ -50,6 +76,6 @@ When another agent (or you, last week) left a branch mid-flight: The [Session pickup playbook](../../skills/poteto-mode/playbooks/session-pickup.md) treats the prior trail as authoritative. It reconstructs the branch state and decisions, names the resume point, and verifies inherited claims against the original goal instead of re-deriving everything from scratch. -**Pitfall:** don't skip this page's skills because "the agent will read the code anyway." An agent that starts editing without a traced model tends to fix the symptom at the first plausible spot. `/how` first is cheaper than the second bug. +**Pitfall.** Do not skip this page's skills because `"the agent will read the code anyway."` An agent that starts editing without a traced model tends to fix the symptom at the first plausible spot. Running `/how` first is cheaper than shipping the second bug. -Next: [Design the change](./04-design.md). +Next, [Design the change](./04-design.md). diff --git a/docs/guide/04-design.md b/docs/guide/04-design.md index 7293a85..e949037 100644 --- a/docs/guide/04-design.md +++ b/docs/guide/04-design.md @@ -1,18 +1,10 @@ # Design before you write code -One attempt at a hard design locks in the first shape the model thought of. `/architect` settles types and boundaries before implementation. `/arena` runs several attempts at the same brief and merges the best parts. `/interrogate` has other models try to break the result. When the job is coverage rather than design synthesis, `/cloud-swarm` (or local fan-out) fans out slices or races and aggregates their results. +One attempt at a hard design locks in the first shape the model thought of. `/architect` settles types and boundaries before implementation. `/arena` runs several attempts at the same brief and merges the best parts. `/interrogate` has other models try to break the result. When the job is coverage rather than design synthesis, `/cloud-swarm` (or local `invoke_subagent` fan-out for 8 or fewer workers) fans out slices or races and aggregates their results. -![Three robots draft competing bridge models at their own tables under /architect, /arena, and /interrogate panels, while a judge robot with a clipboard inspects skeptically.](./images/design.jpg) - -## Flesh out ambiguous requirements with `/grill-me` - -```text -/grill-me I want to add a plugin system for storage backends, but I'm not sure where the boundaries should be. -``` +The two most common design mistakes are taking the agent's first design and polishing a plan that no code has tested. This page fixes both. You plan through code. Prototypes answer the open questions, a README or tutorial sets the target, and the written plan comes last. -When a problem statement is underspecified or you have only a rough hunch, run `/grill-me` before kicking off architecture or autonomous runs. `/grill-me` conducts an upfront, Socratic dialogue—probing constraints, non-goals, trade-offs, and failure modes—until requirements are crisp. - -Importantly, this is an upfront human ideation tool. Once an autonomous execution run or `/architect` begins, agents do not bounce the user with mid-run interrogation; they explore solution shapes autonomously against the grounded codebase. Use `/grill-me` early when you want the agent to challenge your assumptions before settling the architectural contract. +![Three robots draft competing bridge models at their own tables under /architect, /arena, and /interrogate panels, while a judge robot with a clipboard inspects skeptically.](./images/design.jpg) ## Settle the shape with `/architect` @@ -20,21 +12,23 @@ Importantly, this is an upfront human ideation tool. Once an autonomous executio /architect design the import pipeline before writing any code. i care most about how callers use it. ``` -[`/architect`](../../skills/architect/SKILL.md) grounds itself first, running `/how` over the code the design touches and `/why` when it moves ownership or layers. Then it runs `/arena` to produce competing design sketches, with the caller's usage written first in each, followed by types, signatures, and a module map. +[`/architect`](../../skills/architect/SKILL.md) traces every system the change touches first, running `/how` over touched code and `/why` when moving ownership or layers. Then it sketches competing shapes, each with caller usage written first, followed by types, signatures, and module boundaries, and picks the shape where each piece of state has one owner, each task has one way to run, and callers need to know least. For a large or contested design, it runs `/arena` instead of sketching alone. -By default it proceeds straight from the synthesized design into implementation. If you want to see the design first, say so: +By default it proceeds straight from the synthesized design into implementation. If you want to inspect the design before code starts, say so in the prompt. ```text /architect with checkpoint. stop and show me before implementing. ``` +The design is not sacred once code starts. If the same workaround keeps coming back, `/architect` redesigns instead of patching around it. + ## Fan out attempts with `/arena` ```text /arena take my prompt to the arena verbatim. i want to compare their proposals with yours. ``` -[`/arena`](../../skills/arena/SKILL.md) is the general tool underneath. N subagents attempt the same design or code brief in parallel, each writing to its own worktree or directory. A read-only judge, on a different model family when your configuration allows one, scores every candidate against a rubric. The coordinator reads each candidate end to end, picks a base, grafts in the best ideas from the losers, and verifies the result. +[`/arena`](../../skills/arena/SKILL.md) is the general tool underneath. N subagents attempt the same design or code brief in parallel, each writing to its own worktree or isolated path. A read-only cross-judge pool scores every candidate against a rubric. The coordinator reads each candidate end to end, picks a base, grafts in the strongest parts from the losers, and verifies the result. ```mermaid flowchart LR @@ -50,7 +44,7 @@ flowchart LR H --> I[Verify] ``` -The panel comes from your [`/setup-agystack`](../../skills/setup-agystack/SKILL.md) configuration, and you can adjust it per task. Ask for more candidates when the decision matters, fewer when it doesn't: +The panel comes from your [`/setup-agystack`](../../skills/setup-agystack/SKILL.md) configuration in `agystack-models.md` (`inherit`, `flash`, `pro`), and you can adjust the count per task. Ask for more candidates when the decision matters, and fewer when it does not. ```text /arena this, 5 candidates. the cache key format is expensive to change later. @@ -62,9 +56,9 @@ The panel comes from your [`/setup-agystack`](../../skills/setup-agystack/SKILL. /cloud-swarm check every package under packages/ against its check.sh. one worker per package. one report. ``` -[`/cloud-swarm`](../../skills/cloud-swarm/SKILL.md) fans N workers across Google Cloud Run for independent slices, coverage matrices, gauntlet lanes, exploration partitions, or declared race arms (or uses local `invoke_subagent` fan-out for 8 or fewer workers). Each worker gets its own scope and check, then reports `PASS`, `ISSUES`, or `BLOCKED`. The parent waits for the workers and returns one compact report with any gaps or dropouts. +[`/cloud-swarm`](../../skills/cloud-swarm/SKILL.md) fans more than 8 workers across Google Cloud Run for independent slices, coverage matrices, gauntlet lanes, exploration partitions, or declared race arms. For 8 or fewer workers, agystack uses local `invoke_subagent` fan-out instead, and for agents collaborating on a shared board it leaves Antigravity's native `/swarm` unshadowed. Each worker gets its own scope and check, then reports `PASS`, `ISSUES`, or `BLOCKED`. The parent waits for the workers and returns one compact report with any gaps or dropouts. -Reach for it when parallelism buys coverage or lets independent checks race. `/arena` gives every worker the same design or code brief, then picks a base and grafts the best parts. `/cloud-swarm` covers slices or runs a race with a selection rule declared up front. It does not use the base-selection and grafting ceremony. +Reach for it when parallelism buys coverage or lets independent checks race. `/arena` gives every worker the same design or code brief, then picks a base and grafts the best parts. `/cloud-swarm` covers slices or runs a race with a selection rule declared up front, without base selection or grafting. ## Break it with `/interrogate` @@ -72,20 +66,68 @@ Reach for it when parallelism buys coverage or lets independent checks race. `/a /interrogate the whole branch, but skeptically. no nitpicks unless it's an actual bug or regression. ``` -[`/interrogate`](../../skills/interrogate/SKILL.md) sends the same diff, intent, and rubric to several reviewers on different model families. Model diversity is the point. Different models have different blind spots, so a finding two models raise independently is high-confidence signal. The lead sorts everything into `Act on`, `Consider`, `Noted`, and `Dismissed`, with a reason for each dismissal, and applies nothing automatically. +[`/interrogate`](../../skills/interrogate/SKILL.md) sends the diff, stated intent, and rubric to concurrent reviewers across configured model tiers (`pro`, `flash`, `inherit`). Diverse tiers surface different blind spots. Every actionable finding must include an executable repro command, and the coordinator reruns each repro command via `run_command`. Speculative findings that fail to reproduce against the codebase are dropped. The coordinator writes `adversarial_review.md` sorting surviving findings into `Act on`, `Consider`, `Noted`, and `Dismissed` (the dropped findings with justification), and applies nothing automatically. + +Read the `Dismissed` (dropped) list too. The lead verifier applies pragmatic engineering judgment rather than infallibility, and you can override any dismissal. + +## Prototype instead of debating + +Never take the first design. Ask for a few, and pick from evidence you can see. + +```text +/poteto-mode prototype a few options for the new dropdown menu. take screenshots or videos for me to compare. +``` + +The [Prototype playbook](../../skills/poteto-mode/playbooks/prototype.md) builds throwaway sketches in a scratch directory, puts the variants behind one switcher, drives each one, and captures screenshots or timings into `prototype_review.md`. It also works for behavior and algorithms, not just UI. Prototypes are planning with code. They let the agent answer open questions by running something instead of asking you, and they leave room for an option you would not have invented up front. + +The same idea scales up to a real design. Pair `/architect` with prototypes and keep a review gate. + +```text +/poteto-mode we need rate limiting for external webhooks. /architect it first, and answer open questions with prototypes. let me review before proceeding. +``` + +Do not spend adversaries on an abstract plan. `/interrogate` drops every finding that a live run does not prove, so a plan with no code behind it gives reviewers nothing to break. Let prototypes settle the questions, then review what got built. + +## Write the README first for shared code + +For a package or API that other code will use, start with the doc a user would read. + +```text +/poteto-mode write a tutorial for how i would use the new config package first. then /teach me why it beats the current one. +``` + +Writing the tutorial first forces the caller's view. You describe the API to a hypothetical user and work back to the implementation. The doc also becomes a concrete target the agent checks its own work against. Name [`/technical-writing`](../../skills/technical-writing/SKILL.md) when the doc itself matters, so a tutorial stays a tutorial instead of drifting into reference and explanation at once. + +## Plan after the design settles + +agystack has no standalone planning skill because Antigravity already provides native `implementation_plan.md` artifacts. When you want a written multi-PR plan, ask for it once the design settles. + +```text +/poteto-mode turn this design into a plan. small verifiable PRs, each with its own verification steps. +``` + +The [Multi-phase plan playbook](../../skills/poteto-mode/playbooks/multi-phase-plan.md) settles any remaining open questions by prototype, writes one section per PR (each ending in concrete verification receipts, checked with `node skills/poteto-mode/scripts/check-plan.mjs`), and stops at the `implementation_plan.md` deliverable. A passing test suite alone does not count as proof. Execution starts only when you say go. + +For a migration, state the bar in the prompt. + +```text +/poteto-mode plan the migration of our ui library to the new styling system. small verifiable PRs, each with visual regression checks. the result must match the original exactly, bugs included. +``` -Read the dismissals too. The lead is a pragmatic senior engineer, not an oracle, and you can override it. +`"bugs included"` keeps the migration from quietly changing behavior along the way, which would make old and new outputs impossible to compare. For a multi-day project, you can commit the plan to the repo temporarily so other agents see the work in progress, then delete it when the work lands. ## How much design work does a task deserve? -You might be wondering whether every change needs this. No. Most changes need none of it. A rough ladder: +Most changes need none of this. Use this rough ladder when deciding how far to go. -- A small, finished change you're unsure about needs `/interrogate` alone. -- A change that crosses function boundaries or moves ownership earns `/architect`, which brings `/arena` with it. -- A standalone decision where independent attempts would help, like naming, formats, or an algorithm, is `/arena` directly. -- A coverage matrix, set of parallel checks, or race with declared arms is `/cloud-swarm` (or local fan-out). -- A contested design that's expensive to reverse gets `/architect`, then `/interrogate` before shipping. +- A small, finished change you are unsure about needs `/interrogate` alone. +- A change that crosses function boundaries or moves ownership earns `/architect`, which brings `/arena` when the design is large or contested. +- A standalone decision where independent attempts help, such as naming, formats, or an algorithm, uses `/arena` directly. +- A coverage matrix, set of parallel checks, or race with declared arms uses local `invoke_subagent` fan-out (`<= 8` workers) or `/cloud-swarm` (`> 8` workers). +- An open question you could answer by running something, such as layout, timing, or behavior, gets a prototype instead of a debate. +- A contested design that is expensive to reverse gets `/architect`, then `/interrogate` before shipping. +- Work that spans several PRs gets a plan written after the design settles. -`/poteto-mode` already applies this ladder. Boundary-crossing work triggers `/architect` on its own, so you reach for these directly mainly when you want more or less scrutiny than the default. +`/poteto-mode` already applies this ladder. Boundary-crossing work triggers `/architect` on its own, so reach for these directly mainly when you want more or less scrutiny than the default. -Next: [Build and clean the change](./05-build-and-clean.md). +Next, [Build and clean the change](./05-build-and-clean.md). diff --git a/docs/guide/06-verify-and-ship.md b/docs/guide/06-verify-and-ship.md index cbb6ff4..dfdb87e 100644 --- a/docs/guide/06-verify-and-ship.md +++ b/docs/guide/06-verify-and-ship.md @@ -1,64 +1,137 @@ # Verify the result and open a PR -"It compiles" is not evidence. The [Prove It Works principle](../../skills/principle-prove-it-works/SKILL.md) makes the agent check the real artifact before it reports success, and your job is to make "the real artifact" checkable. This page covers stating a finish condition, generating a verification skill for your app, opening the PR, and driving it to merged. +"It compiles" is not evidence. The [Prove It Works principle](../../skills/principle-prove-it-works/SKILL.md) makes the agent check the real artifact before reporting success, and your job is to make `"the real artifact"` checkable. This page covers stating a finish condition, vetting a measured number, creating a verification skill for your app, formally verifying properties tests rarely reach, opening the PR, and driving it to merged. + +Verification is the slowest step in most agent work, because it is the step that usually waits on a human. Make the agent able to run it, and you stop being the bottleneck. Skip it, and running more agents only produces unchecked diffs faster. ![A prototype plane flies a real test course while she times it with a stopwatch and robots film and checklist the run; the terminal reads verify: pass, evidence: captured.](./images/verification.jpg) ## State the finish condition up front -Put what done means in the first prompt, in whatever words fit: +Put what done means in the first prompt, in whatever words fit. ```text /poteto-mode add json output to this command. text output stays byte-identical, the json parses, both run against the sample project. show me the evidence. ``` -Now the agent has three checks it can run, not a mood to satisfy. When the reply comes back, it links directly to a `walkthrough.md` artifact carrying the exact commands, outputs, and verification receipts. If a check couldn't run, a good reply says "inconclusive", and you should treat a confident reply without evidence as a red flag. +Now the agent has three checks it can run, not a mood to satisfy. When the reply comes back, it links directly to a `walkthrough.md` artifact carrying the exact commands, outputs, and verification receipts. If a check could not run, a good reply says `"inconclusive"`. Treat a confident reply without evidence as a warning sign. -Match the check to the change: +Match the check to the change. - A CLI change runs the real command. -- A UI change walks the changed flow in the running app. +- A UI change walks the changed flow in the running app. When a view must match a reference pixel for pixel, the [Visual parity playbook](../../skills/poteto-mode/playbooks/visual-parity.md) diffs screenshots against a frozen baseline instead of judging by eye. - A parser or migration replays a saved input. - A perf change compares before and after profiles. - A storage change reads back the written value. -For a small diff you don't fully trust, [`/blast-radius`](../../skills/blast-radius/SKILL.md) finds what it could break elsewhere. It picks the one fact the change is safe because of and proves it by running code instead of writing an essay about it. +Ask for proof as an artifact you can inspect directly, such as the failing test followed by the passing one, screenshot carousels in `walkthrough.md`, or the trace. If the fix already merged, ask for the same check on `main`. An artifact beats a plausible explanation because you can challenge it without replaying the whole run. + +For a small diff you do not fully trust, [`/blast-radius`](../../skills/blast-radius/SKILL.md) finds what it could break elsewhere. It identifies the one fact that makes the change safe and proves that fact by running code rather than arguing for it. + +## Vet a measured number with `/benchmark-checklist` + +A before-and-after number is the easiest evidence to get wrong by accident. A warm cache, a debug build on one side, or work skipped outside the timed region can fake a convincing speedup. Before you report or act on a number, run the checklist. + +```text +/benchmark-checklist vet the export speedup before it goes in the pr +``` + +[`/benchmark-checklist`](../../skills/benchmark-checklist/SKILL.md) asks seven questions and requires run evidence for each. + +1. What limits the number, and why is it not double? +2. Did every side run tuned the way production runs? +3. Does the result break a physical limit, such as disk bandwidth or core count? +4. Did anything error or return wrong output? +5. Does it reproduce over alternating runs, with a median and a range? +6. Does it matter end to end, on the path a user waits on? +7. Did the work actually happen inside the timed region? + +The verdict comes back as `faster`, `slower`, `no measurable difference`, or `inconclusive`, with the run count, range, and limiter logged in `perf_report.md`. It reports `inconclusive` when it cannot name the limiter or a side ran untuned. `/poteto-mode` already runs this checklist inside the Perf issue and Hillclimb playbooks, so invoke it directly when you measured outside them or when a speedup looks too good. It is the working form of the [Explain the Number principle](../../skills/principle-explain-the-number/SKILL.md). ## Surface Precedence Hierarchy -When verifying or investigating, enforce strict tool precedence: +When verifying or investigating, enforce strict tool precedence. -1. **Filesystem Tools (`view_file`, `grep_search`, `find_by_name`)**: Ground truth for code, configs, AST, tests, and repo docs. Never use a browser or UI tools to view, search, or scroll through code and repo files. -2. **CLI / Runtime Tools (`run_command`)**: Test suites, API endpoints, build/server logs, process lifecycles, and exit codes. -3. **Browser Tools (`browser_subagent` / Chrome DevTools MCP)**: Strictly for live UI interaction, DOM layout inspection, CSS styles, user events, and rendered visual screenshots. +1. **Filesystem Tools (`view_file`, `grep_search`, `find_by_name`).** Ground truth for code, configs, AST, tests, and repo docs. Never use a browser or UI tool to view, search, or scroll through code and repository files. +2. **CLI and Runtime Tools (`run_command`).** Test suites, API endpoints, build and server logs, process lifecycles, and exit codes. +3. **Browser Tools (`browser_subagent` and Chrome DevTools MCP).** Strictly for live UI interaction, DOM layout inspection, CSS styles, user events, and rendered visual screenshots. ## Create a project verification skill -The UI bullet above hides a real requirement: the agent needs a scripted way to drive your app. Antigravity already includes native browser automation as `browser_subagent` (Chrome DevTools MCP), so there is no need to wait on generic driver packages (like cursor-team-kit or control-ui). +The UI bullet above hides a real requirement. The agent needs a scripted way to drive your app. Antigravity includes native browser automation through `browser_subagent` (Chrome DevTools MCP) alongside process execution, so no external driver package is needed. -The high-leverage asset needed for any project is the app's **feature map** (generated by `/create-verification-skill`). If your project lacks one, run: +Any project needs an app feature map first, generated by `/create-verification-skill`. If your project lacks one, run the generator. ```text /create-verification-skill ``` -[`/create-verification-skill`](../../skills/create-verification-skill/SKILL.md) interviews the repository, not you. It works out what a user touches, how the app launches locally, what drives it (an existing harness first, otherwise native `browser_subagent` / CDP, a PTY, or plain HTTP), what evidence proves behavior, and whether two instances can run side by side. It asks you only what the code can't answer. +[`/create-verification-skill`](../../skills/create-verification-skill/SKILL.md) interviews the repository, not you. It works out what a user touches, how the app launches locally, what drives it (an existing harness first, otherwise native `browser_subagent` / CDP, a PTY or tmux harness, or plain HTTP), what evidence proves behavior, and whether two instances can run side by side. It asks you only what the code cannot answer. + +It writes `.agents/skills/verify-/`, agent-facing instructions with exact `Launch`, `Doctor`, `Drive`, `Evidence`, `Cleanup`, and `Helpers` sections, plus a feature map under `features/` indexing what the app does and what observable end state proves each feature works. The skill ships a [worked feature-map example](../../skills/create-verification-skill/references/feature-map-example/README.md) with an index and one file per feature using the four required H2 headings. Before handing it over, the generator proves the skill once end to end (launch, doctor, drive one feature, capture evidence, clean up, and confirm evidence survived cleanup). If that proof fails, do not use the output. + +From then on, `"verify it in the app"` is a step any agent can execute in this repo with no setup conversation. Name it in the prompt when you want proof in a specific form. + +```text +/poteto-mode build the bulk-archive action. use /verify- to verify your changes and attach screenshots in walkthrough.md. +``` + +```text +/poteto-mode repro this with /verify-. if it repros on main, fix it and capture before-and-after screenshots. +``` + +Once the verify skill works, a local `invoke_subagent` fan-out (`<= 8` workers) or [`/cloud-swarm`](../../skills/cloud-swarm/SKILL.md) (`> 8` workers) can split a full pass by feature-map entry and aggregate one report, confirm a perf gain over a larger sample, or fuzz flows before a PR ships. -It writes `.agents/skills/verify-/`, agent-facing instructions with exact Launch, Doctor, Drive, Evidence, and Cleanup sections, plus a feature map under `features/` that indexes what the app does and what result proves each feature works. The skill ships a [worked feature-map example](../../skills/create-verification-skill/references/feature-map-example/) with a README index and one file per feature using the four required H2s. Before handing it over, the generator proves the skill once end to end: launch, doctor check, drive one feature, capture evidence, clean up. If that proof fails, don't use the output. +Treat the verification skill as infrastructure, not a one-off. Commit it so every person and agent drives the app the same way. Then [build the lever](../../skills/principle-build-the-lever/SKILL.md). When agents keep writing throwaway scripts to click through the app, ask for a small control CLI that the skill calls instead. Agents spend fewer tokens, and every run becomes repeatable. A CLI that agents use well has these traits. -From then on, "verify it in the app" is a step any agent can execute, in this repo, with no setup conversation. +- A few composable commands, each doing real work, rather than many thin ones. +- A `--dry-run` option on anything destructive. +- Subcommands that reveal features gradually instead of all at once. +- Error messages that say what to do instead. +- Rich `--help` text. +- Machine-readable output, such as JSON. -Once the verify skill works, a [`/cloud-swarm`](../../skills/cloud-swarm/SKILL.md) or local fan-out can split a full pass by feature-map entry and aggregate the results. +Make dev setup repeatable at the same time with seeded data, test users, and one command that brings the environment up cleanly. ## Keep the verification skill honest -Apps change and feature maps rot. When yours drifts, run: +Apps change, and feature maps go out of date. Run this regularly, or trigger it on a recurring schedule, so the map stays true to the app. ```text /maintain-verification-skill ``` -[`/maintain-verification-skill`](../../skills/maintain-verification-skill/SKILL.md) audits the generated skill: one read-only source reader per feature in parallel, then one live pass that drives every mapped feature. It ends in exactly one of three outcomes. `clean` means full coverage and nothing to ship. `changed` means one PR of proven corrections, confined to the verification skill's own directory. `blocked` names the blocker. It never edits product code. If the live pass catches a product regression, it reports the regression instead of papering over it in docs. +[`/maintain-verification-skill`](../../skills/maintain-verification-skill/SKILL.md) audits the generated skill using one read-only source reader per feature in parallel, then one live pass driving every mapped feature. It ends in exactly one of three outcomes (`clean`, `changed`, or `blocked`). It never edits product code. If the live pass catches a product regression, it reports the regression instead of papering over it in docs. + +## Prove a property with a formal verification skill + +A verification skill proves the paths you drive. Some bugs live on paths nobody drives, such as two retries overlapping, a lock expiring mid-write, or a state change arriving out of order. Tests rarely reach those cases. For concurrency protocols, distributed consensus, complex state machines, or critical parsers where such a bug is costly, run the formal generator. + +```text +/create-formal-verification-skill +``` + +[`/create-formal-verification-skill`](../../skills/create-formal-verification-skill/SKILL.md) picks the target from the code where a break harms users and tests rarely reach the failure case, choosing the strongest promise rather than the easiest module. Name an area or a bug to start there directly. + +```text +/create-formal-verification-skill the job lease and retry logic. a job must never run twice at once. +``` + +The question selects the tool. Event ordering and concurrency use a model checker over a faithful small model, with TLA+ as the default in any language. Input-level safety or data-structure invariants use an SMT-backed verifier on the real code, or generated inputs against the real code when no verifier exists for the language. Unbounded size properties use a proof assistant. The agent records why it chose the tool in `formal_verification_report.md`. + +Every property is verified and proven able to fail against a temporary scratch break in real code, because a check that has never failed proves nothing. When current code already breaks a property, the agent reports the counterexample as short steps in the code's terms without weakening the property or silently editing product code. + +The generated `.agents/skills/verify-/SKILL.md` records the coverage map (files and functions covered) and the sync-commit SHA where verification last matched the code. After merges or refactors that touched covered code, run [`/maintain-formal-verification-skill`](../../skills/maintain-formal-verification-skill/SKILL.md). It diffs from the sync commit, updates the model or harness from code before rerunning, proves the updated check still catches a scratch break, and assigns `in sync`, `updated`, `bug`, or `blocked` so verification drift never hides a product bug. + +## Show the behavior as a statechart + +A counterexample in model terms convinces you. A PM or designer who owns the behavior needs to see it in their own words. + +```text +/statechart what the user sees when they edit a note offline +``` + +[`/statechart`](../../skills/statechart/SKILL.md) supports two explicit modes. **Mode 1 (Verified TLC model)** checks a `.tla` and `.cfg` model with TLC via `scripts/statechart`, rendering a Mermaid `stateDiagram-v2` chart (`chart.mmd`) and `report.md` inside `statechart_.md` so the diagram and checked model cannot drift apart. Reader rules become TLA+ invariants, broken states get marked on the diagram, and the report lists the shortest counterexample path in plain words. When the model describes real code, replay every counterexample path against the real code so modeling drift never reaches the reader as a bug. **Mode 2 (Unverified design sketch)** draws native Mermaid directly for early exploration and labels the artifact explicitly as unverified. ## Open the PR @@ -66,32 +139,32 @@ Apps change and feature maps rot. When yours drifts, run: /poteto-mode open the pr. small ordered commits, evidence in the description. ``` -The [Opening a PR playbook](../../skills/poteto-mode/playbooks/opening-a-pr.md) works from a worktree, rebases the work into small ordered commits, cleans the diff, unslops the prose, and returns the PR link. Five narrow PRs beat one fat one, and stacked follow-ups beat a growing branch. +The [Opening a PR playbook](../../skills/poteto-mode/playbooks/opening-a-pr.md) works from a worktree, rebases work into small ordered commits, runs `/deslop` and `/no-comments`, writes a briefing under 40 lines using `/technical-writing` and `/unslop`, and opens the PR ready (`draft: false`) via `gh pr create` by default (or `origin pr create --status open` when Origin resolves the repo; Graphite tracking is optional only). Five narrow PRs beat one fat one, and stacked follow-ups beat a growing branch. ## Drive the PR to merge-ready with Babysit -An open PR starts collecting blockers immediately. Checks fail, reviewers comment, trunk moves. Hand that churn to the [Babysit playbook](../../skills/poteto-mode/playbooks/babysit.md): +An open PR starts collecting blockers immediately. Checks fail, reviewers comment, trunk moves. Hand that churn to the [Babysit playbook](../../skills/poteto-mode/playbooks/babysit.md). ```text /poteto-mode babysit this pr. get it green. ``` -Babysit watches the PR with a bundled watcher and takes blockers in order: conflicts, then review threads, then CI. Every known fix batches into one push, so the checks restart once instead of after every fix. The comment triage is skeptical, because humans and bots file real catches and noise in the same list. A real finding gets a fix, and noise gets dismissed with the disproof posted on the thread. When all you want is status, ask smaller and Babysit answers without starting the loop: +Babysit declares its mode (`drive`, `background`, `threads-only`, or `check`) first, watches GitHub PRs via the bundled `watch-pr` tool under `/goal` and `schedule` (or `origin pr checks` on Origin), and takes blockers in order (conflicts, then review threads, then CI). Every known fix batches into one push wave so checks restart once, and Babysit never mutates stack topology or force-pushes shared stacks. Comment triage is skeptical per `bugbot-triage.md`, fixing real catches and posting concrete disproofs on noise threads. When you only want status, ask smaller and Babysit replies without looping. ```text /poteto-mode check on pr 123. anything outstanding? ``` -Babysit stops at merge-ready. It never merges, even with everything green, because merging is a different decision. +Babysit stops at merge-ready (`READY` or queued `WAITING`). It never merges or arms auto-merge, because merging is a separate decision. ## Land the stack with Shipping -Green is not the same as safe. When you're ready to land, say so: +Green is not the same as safe. When you are ready to land, say so explicitly. ```text /poteto-mode land the stack. ``` -The [Shipping playbook](../../skills/poteto-mode/playbooks/shipping.md) verifies each PR independently before it arms anything. One fresh agent per PR proves the behavior live, and the agent that judges a change is never the one that wrote it. Then Shipping lands only the contiguous verified run from the bottom, through Graphite merge-when-ready, and reports the first PR that breaks the chain. A verified PR sitting above an unverified one waits, because merging it would pull the gap in underneath. +The [Shipping playbook](../../skills/poteto-mode/playbooks/shipping.md) resolves the forge (`gh` by default, or `origin pr` when Origin resolves the repository; Graphite `gt` is never required) and dispatches one fresh `poteto-agent` per PR to prove behavior live on the real surface before arming anything. Then Shipping lands only the contiguous verified run bottom-up, checking `git patch-id` across restacks, keeping intermediate child PRs off `--auto` so they never collapse into an unmerged parent branch, reading each PR back to confirm `mergedAt`, and reporting the first PR that breaks the chain. A verified PR sitting above an unverified one waits, because merging it would pull the gap in underneath. -Next: [Run work while you sleep](./07-overnight.md). +Next, [Run work while you sleep](./07-overnight.md). diff --git a/docs/guide/07-overnight.md b/docs/guide/07-overnight.md index 4fb4a1c..da6ee37 100644 --- a/docs/guide/07-overnight.md +++ b/docs/guide/07-overnight.md @@ -1,12 +1,23 @@ # Run work while you sleep -This is the payoff for everything before it. An agent you can trust to verify its own work is an agent you can leave alone with a hard task. What makes that safe isn't hope. It's a checkable finish condition, an isolated worktree, and a decision log you audit in the morning. +This is the payoff for everything before it. An agent you can trust to verify its own work is an agent you can leave alone with a hard task. What makes that safe is not hope. It is a checkable finish condition, an isolated worktree or Cloud Run worker, and a decision log you audit in the morning. ![She waves goodnight from the door while robots keep the factory running, one updating a DECISION LOG wall board under a BUILD LOOP ACTIVE sign.](./images/overnight.jpg) +## Earn the trust before the loop + +A loop you do not trust just produces unchecked work faster, and the mess compounds with every iteration. Before you leave one running, check that it has earned that autonomy. + +- You have done the task once by hand, or watched an agent do it, so you know what good looks like. +- The agent has the tools and signals you would use yourself, such as the verification skill, the profiler, and the logs. +- Every stage proves its work and can stop the line when the work misses the bar. +- You have read several transcripts and turned repeated failures into tools, skills, or checks. + +Make the loop autonomous only after all four hold. Until then, run it while you watch. + ## The overnight contract -A good handoff has the goal, the finish condition, permissions, and an escape hatch. It doesn't need to be long: +A good handoff has the goal, the finish condition, permissions, and an escape hatch. It does not need to be long. ```text /poteto-mode im going to bed. migrate every caller to the new parser in a fresh worktree off . @@ -15,17 +26,19 @@ keep a decision log. don't ask me before committing. /goal run until done. if you're truly stuck after a few hours, stop and write up why. ``` -Walk through what each line buys you: +Walk through what each line buys you. -- "im going to bed" is a session override. The agent stops asking and keeps going. -- "done means..." turns the goal into checks every iteration can run. -- "fresh worktree off ``" keeps the run from colliding with anything else you have open. -- "don't ask me before committing" pre-answers the permission the agent would otherwise block on. -- `/goal` paired with `schedule` provides the autonomous execution and wake mechanism. The [Autonomous run playbook](../../skills/poteto-mode/playbooks/autonomous-run.md) uses it to re-check the finish condition on events or a heartbeat, delivering `walkthrough.md` and `decisions.tsv` as the human-facing audit receipts. -- Do not confuse `/goal` with `/loop`: `/loop` is an inner-loop, exit-code hillclimb with a 10-iteration default (for metric optimization, micro-benchmarks, or fast TDD cycles). Overnight tasks, refactors, and shipping queue drains belong on `/goal` plus `schedule`. -- The escape hatch lets it stop at a genuine dead end and write up why, which beats eight hours of creative goal reinterpretation. +- `"im going to bed"` is a session override. The agent stops asking on reversible steps and keeps going. +- `"done means..."` turns the goal into checks every iteration can run. +- `"fresh worktree off "` keeps the run from colliding with anything else you have open. +- `"don't ask me before committing"` pre-answers the permission the agent would otherwise block on. +- `/goal` paired with Antigravity's `schedule` tool drives overnight runs and periodic audit ticks under the [Autonomous run playbook](../../skills/poteto-mode/playbooks/autonomous-run.md), delivering `walkthrough.md` and `decisions.tsv` as receipts. +- Keep [`/loop`](../../skills/loop/SKILL.md) strictly for inner-loop verification hillclimbs (`--verify ""`, 10 iterations by default, stopping when the command exits `0`). Do not send standing overnight runs or PR audit ticks through `/loop`; those belong on `/goal` plus `schedule`. +- The escape hatch lets the agent stop at a genuine dead end and write up why, which beats eight hours of creative goal reinterpretation. -Because you'll review this work after stepping away, `/poteto-mode` routes it through [`/figure-it-out`](../../skills/figure-it-out/SKILL.md), which designs the run's phases before any code and wires in the decision log. +Because you will review this work after stepping away, `/poteto-mode` routes it through [`/figure-it-out`](../../skills/figure-it-out/SKILL.md), which designs the run's phases before any code and wires in the decision log. + +To stop a run on purpose, tell the agent to pause, or that you are going offline or restarting Antigravity. The [Pause safely playbook](../../skills/poteto-mode/playbooks/pause-safely.md) finishes or backs out of the current atomic step, commits a `wip:` checkpoint on the current branch, and writes `resume_checkpoint.md`. A fresh chat picks the work up from that note through the [Session pickup playbook](../../skills/poteto-mode/playbooks/session-pickup.md). Saying `"keep going"` never triggers a pause. ## What the loop does all night @@ -41,42 +54,46 @@ flowchart TD G --> A ``` -One change, one check, one log row, every iteration. Changes that didn't help get discarded, not left to ride. A plateau means pivot, not stop, and the finish condition never quietly relaxes to declare victory. +One change, one check, one log row, every iteration. Changes that did not help get discarded, not left to ride. A plateau means pivot, not stop, and the finish condition never quietly relaxes to declare victory. ## The morning audit -[`/show-me-your-work`](../../skills/show-me-your-work/SKILL.md) is what makes the run reviewable. Each row records the time, phase, decision, reason, an evidence pointer, and the result, in a TSV at `decisions.tsv` (or `.audit/.tsv` when several runs share a directory). It stays local by default. Commit it when the work is ambitious enough that a reviewer needs the trail to trust the result. +[`/show-me-your-work`](../../skills/show-me-your-work/SKILL.md) is what makes the run reviewable. Each row records the timestamp, phase, decision, reason, an evidence pointer, and the result in an append-only TSV at `decisions.tsv` inside `/brain//` (or `.audit/.tsv` when several runs share a repo). It stays local by default. Commit a copy only when the work is ambitious enough that an external reviewer needs the trail to trust the result. -When you're back, ask for the run in review form: +When you return, ask for the run in review form. ```text /show-me-your-work catch me up on what you did last night ``` -Before the skill hands back its summary, it spawns a reviewer on a different model family to read the trail and the transcript, and the reply ends with an Attention section listing what deserves your scrutiny. Read that section first, then the log rows it points at. You're auditing decisions, not re-reading the whole night. +Before the skill hands back its summary, it dispatches a reviewer on a distinct model tier to audit the trail against the transcript, and the reply ends with an `Attention` section listing what deserves your scrutiny. Read that section first, then inspect the log rows it points at. You are auditing decisions, not re-reading the whole night. + +For a quick status instead of a full trail audit, run [`/ketchup`](../../skills/ketchup/SKILL.md) in the chat that ran the work. It keeps the turn strictly read-only, summarizes what changed since your last message in under 100 words alongside native artifact visuals (`carousel` blocks and screenshots), and lists every decision waiting on you (about 30 words per item) with its pick, evidence, and risk so you can decide from the reply alone. ## When the night holds a queue, not a task -The contract above drives one task to one finish condition. Some nights hold more, a queue of independent changes or a whole program. Three playbooks scale the same trust up. +The contract above drives one task to one finish condition. Some nights hold more, such as a queue of independent changes or a multi-day program. Three playbooks scale the same trust up. -[Autopilot-full](../../skills/poteto-mode/playbooks/autopilot-full.md) runs a queue of independent PRs to merged. Each PR gets one owner agent that carries it from build through merge, and no owner merges on its own verdict. A swarm of fresh verifiers checks every merge-ready head, and only a clean verdict authorizes the merge: +[Autopilot-full](../../skills/poteto-mode/playbooks/autopilot-full.md) runs a queue of independent PRs to merged. Each PR gets one `poteto-agent` owner carrying build through merge, and no owner merges on its own verdict. A verification swarm proves the code-ready head live, while rebases or minor fixes get a single fresh verifier (`git patch-id` preserves valid lanes across pure rebases). Only a clean verdict authorizes the merge via `gh` (or `origin pr`). ```text /poteto-mode full autopilot on this queue. each item is independent. i want them merged by morning. ``` -[Autopilot-stack](../../skills/poteto-mode/playbooks/autopilot-stack.md) runs the same owner loop but ships nothing. You wake up to one linear Graphite stack with a verifier's verdict on every link, and you review and land it yourself. Pick it over Autopilot-full when the changes are coupled, or when you want your own eyes on the work before anything merges: +[Autopilot-stack](../../skills/poteto-mode/playbooks/autopilot-stack.md) runs the same owner loop without merging. You wake up to one linear stack built on parent PR branches via `gh pr` or `origin pr` (Graphite tracking is optional only), with a verifier's verdict on every link, and you review and land it yourself. Pick it over Autopilot-full when changes are coupled or when you want your own eyes on the code before anything merges. ```text -/poteto-mode autopilot these five changes but stack them, don't ship. i'll land the stack in the morning. +/poteto-mode autopilot these five changes, but stack them, don't ship. i'll land the stack in the morning. ``` -[Orchestrate](../../skills/poteto-mode/playbooks/orchestrate.md) is for a program that outlives any single agent: multi-day, many stacked PRs, fleets of subagents under one standing coordinator chat. The coordinator authors briefs, collects what its subagents finish, keeps the lowest unmerged PR green, and never writes code itself. It's deliberately heavy machinery. If one agent could finish the work in a session, the playbook itself routes you back to the overnight contract above: +[Orchestrate](../../skills/poteto-mode/playbooks/orchestrate.md) handles programs that outlive any single agent (multi-day, many stacked PRs, dozens of subagents under one standing coordinator chat). The coordinator authors briefs, drains completions, keeps the lowest unmerged PR green, and never edits code itself. If one agent could finish the work inside a single session, Orchestrate routes you back to the overnight contract above. ```text /poteto-mode orchestrate the store migration. own it until every package is converted and merged. i'll check in twice a day. ``` -**Pitfall:** a duration is not a finish condition. "work on this for 4 hours" gives the agent nothing to check, and you'll wake up to four hours of motion instead of a result. Give `/goal` a predicate that can pass or fail. +When you automate staged triage, repro, and fix passes on a recurring `schedule`, keep two rules intact. Every stage can stop the line when a report fails to reproduce or looks too risky, and every stage hands over concrete evidence (screenshots, logs, and before-and-after proof) so a human can check intent before reading code. + +**Pitfall.** A duration is not a finish condition. `"work on this for 4 hours"` gives the agent nothing to check, and you will wake up to motion instead of a result. Give `/goal` a checkable predicate or artifact, and give `/loop` a `--verify` command that exits `0` on success. -Next: [Steer with principle names](./08-principles.md). +Next, [Steer with principle names](./08-principles.md). diff --git a/docs/guide/09-make-it-yours.md b/docs/guide/09-make-it-yours.md index 3771f18..a2b58d5 100644 --- a/docs/guide/09-make-it-yours.md +++ b/docs/guide/09-make-it-yours.md @@ -1,6 +1,8 @@ # Make it yours -poteto-mode is one person's style. The machinery underneath, playbooks, routing, model roles, works just as well wearing yours. This page covers generating a personal mode, capturing lessons from a session, authoring a focused skill, and testing a skill change before you trust it. +poteto-mode is one person's style. The machinery underneath (playbooks, routing, model roles) works just as well wearing yours. This page covers generating a personal mode, capturing lessons from a session, fixing the repo so agents stop repeating mistakes, authoring a focused skill, and testing a skill change before you trust it. + +Start smaller than you think. You do not need many skills on day one, or even this whole plugin. Prompt plainly, watch where agents fail, and add a skill or a check when the same failure shows up twice. ## Generate your own mode with `/automate-me` @@ -8,60 +10,83 @@ poteto-mode is one person's style. The machinery underneath, playbooks, routing, /automate-me ``` -You don't describe your style, because [`/automate-me`](../../skills/automate-me/SKILL.md) reads it out of your history. It mines your recent transcripts in the active workspace for repeated preferences, in how you like replies, delegation, verification, code, prose, and process, then asks you which patterns are really you. It drafts `.agents/skills/-mode/SKILL.md` (or `~/.gemini/config/skills/-mode/`), formats standard YAML frontmatter, runs the draft through [`/unslop`](../../skills/unslop/SKILL.md), and opens a PR from a worktree so you review it like any other change. +You do not describe your style, because [`/automate-me`](../../skills/automate-me/SKILL.md) reads it out of your history. It mines your recent transcripts in the active workspace for repeated preferences across replies, delegation, verification, code, prose, and process, then asks which patterns are really you. It drafts `.agents/skills/-mode/SKILL.md` (or `~/.gemini/config/skills/-mode/`), formats standard YAML frontmatter, runs the draft through [`/unslop`](../../skills/unslop/SKILL.md), and opens a PR from a worktree so you review it like any other change. -Run it again whenever your habits drift: +Run it again whenever your habits drift. ```text /automate-me update my mode skill with everything since its last edit ``` -Update mode mines only the history since the skill last changed. It keeps rules you haven't contradicted, revises the ones with new evidence, and adds sections only for genuinely new patterns. +Update mode mines only the history since the skill last changed. It keeps rules you have not contradicted, revises the ones with new evidence, and adds sections only for genuinely new patterns. ## Capture a session's lessons with `/reflect` -Right after a task that taught you something, run: +Right after a task that taught you something, run `/reflect`. ```text /reflect that took way too long. capture what we learned so the next run doesn't repeat it. ``` -[`/reflect`](../../skills/reflect/SKILL.md) sends the transcript to three parallel reviewers, then a synthesizer sorts the proposals into `Accepted`, `Rejected`, and `Backlog` and waits for your approval before any skill changes. Approve a proposal only if it would change a future decision. One weird session is an anecdote, not a rule. +[`/reflect`](../../skills/reflect/SKILL.md) sends the transcript to three parallel reviewers, then a synthesizer sorts proposals into `Accepted`, `Rejected`, and `Backlog` and waits for your approval before editing any skill. Approve a proposal only if it would change a future decision. One weird session is an anecdote, not a rule. + +## Fix the environment with `/correct` + +When you keep correcting agents for the same mistake, the fix belongs in the repo, not in your next prompt. Rank the options by how reliably they enforce the rule. + +1. Eliminate the mistake with architecture or a better data structure. +2. Enforce it with types, static checks, or Antigravity lifecycle hooks ([`hooks.json.example`](../../hooks.json.example)) and linters whose error messages name the fix. +3. Catch it with behavioral tests under `tests/`. +4. Write it down in `rules/AGENTS.md` or skill prose last. Nothing fails automatically when an agent skips text. + +Human review is not on the list. A reviewer catching the same mistake on every PR is the symptom this solves. Run [`/correct`](../../skills/correct/SKILL.md) with a specific pattern or with no arguments. + +```text +/correct agents keep calling the database client directly instead of going through the repository layer +``` + +It reads recent commits, reverts, review comments, `rules/AGENTS.md`, and workaround comments, then groups repeated failures into classes (a class counts once it happens twice). It fixes the top classes one commit each at the highest level that works, proves each new check fails on a real past mistake, and maintains a rule-to-enforcer table so unenforced rules stand out immediately. Run `/correct` with no arguments to surface repeated mistake classes from repo history on its own. `/reflect` improves skills from one session, while `/correct` changes the repo so a mistake class cannot return. ## Author a focused skill -When you already know the workflow you want to capture: +When you already know the workflow you want to capture, ask the mode to draft it. ```text /poteto-mode write a skill for verifying database migrations in this repo ``` -Writing a skill matches the [Authoring or modifying a skill playbook](../../skills/poteto-mode/playbooks/authoring-a-skill.md), which drafts the standard Antigravity skill layout, validates the YAML frontmatter and links, and ships the result through the Opening a PR playbook. Agent-facing prose has a higher bar than human prose, because an unhelpful sentence becomes an instruction some future agent follows. Let the playbook hold that bar rather than writing a `SKILL.md` freehand. +Writing a skill matches the [Authoring or modifying a skill playbook](../../skills/poteto-mode/playbooks/authoring-a-skill.md), which drafts the standard Antigravity `SKILL.md` layout, validates YAML frontmatter and links, and ships the result through the Opening a PR playbook. Agent-facing prose has a higher bar than human prose, because an unhelpful sentence becomes an instruction some future agent follows. Let the playbook hold that bar rather than writing a `SKILL.md` freehand. -One special case has its own generator. A skill that must drive your app and prove behavior is a verification skill, so use [`/create-verification-skill`](../../skills/create-verification-skill/SKILL.md) and [`/maintain-verification-skill`](../../skills/maintain-verification-skill/SKILL.md) instead. [Verify and ship](./06-verify-and-ship.md#create-a-project-verification-skill) covers both. +Two special cases have their own generators. A skill that drives your app and proves behavior is a verification skill, built with [`/create-verification-skill`](../../skills/create-verification-skill/SKILL.md) and kept honest with [`/maintain-verification-skill`](../../skills/maintain-verification-skill/SKILL.md). A skill that checks properties with a model checker, prover, or code-level verifier uses [`/create-formal-verification-skill`](../../skills/create-formal-verification-skill/SKILL.md) and [`/maintain-formal-verification-skill`](../../skills/maintain-formal-verification-skill/SKILL.md). [Verify and ship](./06-verify-and-ship.md#prove-a-property-with-a-formal-verification-skill) covers both kinds. ## Write docs to a standard with `/technical-writing` -Skills aren't the only prose you ship. For docs, RFCs, readmes, PR descriptions, and commit messages: +Skills are not the only prose you ship. For docs, RFCs, readmes, PR descriptions, and commit messages, run `/technical-writing`. ```text /technical-writing review the readme changes ``` -[`/technical-writing`](../../skills/technical-writing/SKILL.md) applies a layered standard with one goal, prose a tired engineer understands on the first read. It picks the document's mode first (tutorial, how-to, reference, or explanation), then works sentence by sentence: who does what, one thought per sentence, nothing readable two ways. Use it to review what you or an agent just wrote, or name it up front when you ask for a doc. +[`/technical-writing`](../../skills/technical-writing/SKILL.md) applies a layered standard aimed at prose a tired engineer understands on the first read. It picks the document's mode first (tutorial, how-to, reference, or explanation), then works sentence by sentence on actor clarity, single-thought pacing, and removing ambiguity. Use it to review what you or an agent wrote, or name it up front when asking for a doc. ## Test a skill change blind -A skill edit affects every future session, so test it like the experiment it is: +A skill edit affects every future session, so test it like an experiment. The same goes for adopting someone else's skill; check that it improves agent behavior on your real tasks before keeping it. ```text /poteto-mode run the eval playbook on this skill change. same task for both variants, candidates stay blind. ``` -The [Eval playbook](../../skills/poteto-mode/playbooks/eval.md) is built around one failure mode, the observer effect. An agent that knows it's being evaluated behaves differently. So candidate agents get an organic-looking task in sanitized directories, never the words "eval" or "candidate", and never each other's existence. One judge scores all outputs under neutral labels, and chain-following gets graded from which files each candidate actually read, not from what it claims. +When a skill keeps missing something you know it should catch, update and test it in one task. + +```text +/poteto-mode update the review skill so it flags missing migrations, and eval the change. +``` + +Asking for the eval up front prevents overfitting to a single bad chat. The [Eval playbook](../../skills/poteto-mode/playbooks/eval.md) is built around the observer effect. An agent that knows it is being evaluated behaves differently. Candidate subagents receive an organic task in sanitized directories, never see the words `"eval"` or `"candidate"`, and never know about sibling candidates. One judge scores all outputs under neutral labels, grading chain-following from files actually read rather than self-reports. Read every output yourself before accepting the verdict. If you disagree with the judge, suspect the rubric before you suspect your judgment. -**Pitfall:** don't edit a skill mid-task because it's misbehaving. Fix it in its own PR and keep the task moving. A skill edit that ships tangled into feature work is invisible to review and impossible to evaluate. +**Pitfall.** Do not edit a skill mid-task because it is misbehaving. Fix it in its own PR and keep the task moving. A skill edit tangled into feature work is invisible to review and impossible to evaluate cleanly. -Next: [Recipes and pitfalls](./10-recipes-and-pitfalls.md). +Next, [Recipes and pitfalls](./10-recipes-and-pitfalls.md). diff --git a/docs/guide/10-recipes-and-pitfalls.md b/docs/guide/10-recipes-and-pitfalls.md index ee42bce..7fe63c0 100644 --- a/docs/guide/10-recipes-and-pitfalls.md +++ b/docs/guide/10-recipes-and-pitfalls.md @@ -1,6 +1,6 @@ # Recipes and pitfalls -Prompts worth copying, then the mistakes everyone makes once. Swap in your own paths and finish conditions. The recipes are deliberately informal. That's how they get typed in practice, and the skills read intent fine. +Prompts worth copying, then the mistakes everyone makes once. Swap in your own paths and finish conditions. The recipes are deliberately informal. That is how they get typed in practice, and the skills read intent fine. ![She tastes a finished dish while robots cook from a recipe box, with pinned cards reading /how, /tdd, and /loop above the counter.](./images/recipes.jpg) @@ -10,7 +10,39 @@ Prompts worth copying, then the mistakes everyone makes once. Swap in your own p use /how first to understand how this initialization works. then use /why to figure out why it broke recently. ``` -Mechanics first, history second. Each skill's report tells you which sources it searched, so you know what the answer is grounded in. +Mechanics first, history second. Each skill's report names the sources it searched, so you know what the answer is grounded in. + +## Restate a noisy report before touching code + +```text +/poteto-mode read this thread. restate the underlying issue in your own words, in plain english. don't change any code yet. +``` + +A misreading shows up in the restatement, where it costs one message to fix. Keep your own theory to yourself until the agent states its own. [`/in-your-own-words`](../../skills/in-your-own-words/SKILL.md) asks for the restatement alone, with no playbook. + +## Sharpen a prompt before you send it + +```text +/sharpen write the onboarding doc for the new billing service. +``` + +[`/sharpen`](../../skills/sharpen/SKILL.md) names what a top practitioner would add that you did not ask for, the raw material they start from, their tools, and an external check that proves the result. It returns the rewritten prompt without running the task. Send the rewrite when it looks right. + +## Prototype before you pick + +```text +/poteto-mode prototype a few options for the settings layout. put them behind a switcher and capture screenshots of each in prototype_review.md. +``` + +You pick from running variants, not descriptions. The agent settles layout and timing questions through live observation. + +## Turn a settled design into a plan + +```text +/poteto-mode turn this design into a plan. small verifiable PRs, each with its own proof. +``` + +Ask only after the design settles. The plan (`implementation_plan.md`) is the deliverable, checked with `check-plan.mjs`, and execution waits for your go. ## Get a second opinion on a design @@ -18,7 +50,7 @@ Mechanics first, history second. Each skill's report tells you which sources it ask /arena for a second opinion on this thread and our approach ``` -Your current design becomes one candidate among several, and the synthesis tells you whether the panel found something better or confirmed what you had. Cheap insurance before a costly commitment. +Your current design becomes one candidate among several, and the synthesis tells you whether the panel found something stronger or confirmed what you had. Cheap insurance before a costly commitment. ## Check independent slices in parallel @@ -26,7 +58,7 @@ Your current design becomes one candidate among several, and the synthesis tells /cloud-swarm check every package under packages/ against its check.sh. one worker per package. one report. ``` -Each worker owns one package. The parent waits for every slice and returns one `PASS`, `ISSUES`, or `BLOCKED` report instead of raw worker dumps. +Each worker owns one package. The parent waits for every slice and returns one `PASS`, `ISSUES`, or `BLOCKED` report instead of raw worker dumps. For 8 or fewer packages, ask for a local `invoke_subagent` fan-out; for agents collaborating on a shared board, use Antigravity's native `/swarm`. ## Review a branch skeptically @@ -34,7 +66,7 @@ Each worker owns one package. The parent waits for every slice and returns one ` /interrogate the whole branch, but skeptically. don't change anything yet. no nitpicks unless it's an actual bug or regression in behavior. ``` -The qualifiers do real work. "don't change anything yet" keeps it read-only, and the nitpick rule pre-filters the noise so `Act on` findings are worth your time. +The qualifiers do real work. `"don't change anything yet"` keeps the pass read-only, the nitpick filter focuses on real defects, and every surviving finding requires a working repro command. Read the `Dismissed` bucket in `adversarial_review.md` too. ## Fix a bug through a failing test @@ -42,19 +74,59 @@ The qualifiers do real work. "don't change anything yet" keeps it read-only, and /poteto-mode repro the duplicate write first. if there's a cheap test path, /tdd it. then fix and rerun. ``` -"if there's a cheap test path" matters. Forcing a test through brittle mocks proves less than running the real command, and the playbook is allowed to say so. +`"if there's a cheap test path"` matters. Forcing a test through brittle mocks proves less than running the real command, and the playbook is allowed to say so. + +## Repro and fix a report with proof + +```text +/poteto-mode repro this with /verify-. if it repros on main, fix it and attach before-and-after screenshots in walkthrough.md. +``` + +`"if it repros on main"` lets the run stop early when the bug is already gone. The visual receipt in `walkthrough.md` lets you check the fix before reading the diff. + +## Prove a property tests rarely reach + +```text +/create-formal-verification-skill the retry queue. a message must never be delivered twice. +``` + +You get one property checked across every case in a stated scope, a counterexample in your code's terms if the code breaks it, and a project skill (`.agents/skills/verify-/SKILL.md`) the next agent runs on future edits. + +## Vet a number before you post it + +```text +/benchmark-checklist vet this 40% speedup before it goes in the pr description +``` + +You get `faster`, `slower`, `no measurable difference`, or `inconclusive`, with the run count, range, and physical limiter recorded in `perf_report.md`. + +## Stop correcting the same mistake + +```text +/correct agents keep adding new config flags without registering them in the schema +``` + +The fix lands in the repo as architecture, types, hooks (`hooks.json.example`), or tests (`tests/`), so future agents hit the check instead of repeating the mistake. + +## Ask how without starting the work + +```text +/agystack-help how do i keep agystack active across turns? +``` + +You get an answer, one prompt to send, and a link to the source file. Nothing runs or changes on disk until you send that prompt. ## Keep a run honest while you're away ```text -im going to bed, keep going autonomously until every fixture passes. do not stop. keep a decision log i can audit in the morning. +im going to bed, keep going autonomously until every fixture passes. do not stop. keep a decision log i can audit in the morning. /goal run until done. ``` -The full contract is on the [overnight page](./07-overnight.md). The short form works once the task and finish condition are already in the conversation. +The full contract lives on the [overnight page](./07-overnight.md). The short form works once the task and finish condition are already in the conversation. ## Redirect a drifting run -Steering prompts are one line: +Steering prompts are one line. ```text i said the goal is to repro. i did not ask for a fix yet. @@ -76,11 +148,19 @@ You rarely need more words. You need the right name, and [the principles page](. /bro ``` -That's the whole prompt. [`/bro`](../../skills/bro/SKILL.md) restates the last message like one human talking to another, no jargon, shorter. Use it when a reply is technically thorough and you still don't know what it said. +That is the whole prompt. [`/bro`](../../skills/bro/SKILL.md) restates the last message like one human talking to another, without jargon and shorter. Use it when a reply is technically thorough and you still do not know what it said. + +## Catch up on a chat you left running + +```text +/ketchup +``` + +[`/ketchup`](../../skills/ketchup/SKILL.md) reports what changed since your last message in plain words under 100 words, pairs it with native `carousel` visuals or screenshots, and lists every decision waiting on you with its pick, evidence, and risk while changing nothing on disk. ## Automated Code Formatting with Antigravity Lifecycle Hooks -Keep generated code formatted cleanly without manual cleanup turns. Enable automatic linting and formatting on every file edit using Antigravity's `PostToolUse` lifecycle hook: +Keep generated code formatted cleanly without manual cleanup turns. Enable automatic linting and formatting on every file edit using Antigravity's `PostToolUse` lifecycle hook. ```bash # Project-local hook @@ -94,7 +174,7 @@ Whenever an agent uses `write_to_file`, the hook triggers `skills/poteto-mode/sc ## Destructive Command Guard with Antigravity PreToolUse Hooks -Prevent accidental catastrophic commands in interactive sessions without disrupting autonomous swarms or CI pipelines. Antigravity's `PreToolUse` lifecycle hook intercepts commands before execution and prompts for confirmation if a destructive command pattern is detected: +Prevent accidental catastrophic commands in interactive sessions without disrupting autonomous swarms or CI pipelines. Antigravity's `PreToolUse` lifecycle hook intercepts commands before execution and prompts for confirmation if a destructive command pattern is detected. ```json { @@ -115,18 +195,18 @@ Prevent accidental catastrophic commands in interactive sessions without disrupt } ``` -The hook evaluates `run_command` invocations for destructive signatures: +The hook evaluates `run_command` invocations for destructive signatures. - Root deletion (`rm -rf /`, `--no-preserve-root`) - Force-pushing to protected trunk branches (`git push --force origin main`, `git push origin +master`), while explicitly allowing `--force-with-lease` on feature branches - Dropping databases (`drop database `) When running in headless environments (`NON_INTERACTIVE="1"`, `CI="true"`, or `CLOUD_RUN_TASK_INDEX` in Cloud Run worker containers), the hook automatically rejects destructive commands (`"decision": "reject"`) to prevent catastrophic corruption in unattended runs or automated test suites. -To activate, copy or merge `hooks.json.example` into `.agents/hooks.json` (project-local) or `~/.gemini/config/hooks.json` (user-global). +To activate, copy or merge [`hooks.json.example`](../../hooks.json.example) into `.agents/hooks.json` (project-local) or `~/.gemini/config/hooks.json` (user-global). ## Coordinator Code Delegation Guard with Antigravity PreToolUse Hooks -Enforce the Coordinator Code Delegation Invariant deterministically. Antigravity's `PreToolUse` lifecycle hook intercepts direct code modification attempts by coordinator sessions and prompts for confirmation or delegates to a `poteto-agent` subagent: +Enforce the Coordinator Code Delegation Invariant deterministically. Antigravity's `PreToolUse` lifecycle hook intercepts direct code modification attempts by coordinator sessions and prompts for confirmation or delegates to a `poteto-agent` subagent. ```json { @@ -147,7 +227,7 @@ Enforce the Coordinator Code Delegation Invariant deterministically. Antigravity } ``` -The hook intercepts `write_to_file` and `replace_file_content` to keep coordinator contexts clean: +The hook intercepts `write_to_file` and `replace_file_content` to keep coordinator contexts clean. - Permits markdown deliverables (`*.md`, `*.markdown`) and scratch/slice files (`scratch/*`, `.slices/*`) immediately. - Permits trivial surgical edits (<= 50 lines of code on a single existing file) directly. - Bypasses checks for active subagents (`SUBAGENT=1`, `IS_SUBAGENT=1`, or child transcript detection). @@ -156,15 +236,21 @@ The hook intercepts `write_to_file` and `replace_file_content` to keep coordinat ## The pitfalls -- **Enumerating skills in the prompt.** "use /how then /architect then /arena" reorders steps the playbook already sequences. State the goal and constraints. Name a skill only to override a default. -- **A vague finish condition.** "make it better" gives `/loop` or `/goal` nothing to check. `/loop` requires a command that exits 0. `/goal` requires a checkable predicate or artifact. Give a command or artifact that can pass or fail. -- **Parallel agents in one worktree.** They overwrite each other and the diff becomes archaeology. Say "own worktree per attempt" and the isolation is free. -- **Using `/arena` for coverage.** `/arena` repeats one design or code brief, then picks a base and grafts the best parts. `/cloud-swarm` (or local fan-out) partitions slices or declared race arms and aggregates one report. -- **Accepting every review comment.** Bots and humans both file real catches and noise in one list. `/interrogate` sorts findings into act-on and dismissed buckets with reasons, and you can override either way. -- **Treating `auto` as a model slug.** `auto` and `inherit-parent` mean "omit the model field so the subagent inherits the parent chat model." [Setup](./01-setup.md) covers the roles. -- **Reporting success off a green build.** A build proves it compiles. Ask for the real command, flow, stored value, or profile, and expect the evidence in the reply. +- **Enumerating skills in the prompt.** `"use /architect then /arena then /interrogate"` reorders steps the playbook already sequences. State the goal and constraints. Name a skill only to override a default. +- **A vague finish condition.** `"make it better"` gives `/loop` or `/goal` nothing to check. `/loop` requires a `--verify` command that exits `0`, and `/goal` requires a checkable predicate or artifact. Give a command or artifact that can pass or fail. +- **Leading with your theory of the cause.** The agent searches wherever you pointed. Ask it to restate the problem first, then share your hunch. +- **Taking the first design.** One attempt locks in the first shape the model thought of. Ask for prototypes or `/architect` and pick from evidence. +- **Polishing an abstract plan.** Adversarial review of a plan with no code behind it invents risks that never happen. Settle open questions with prototypes, then review what got built. +- **Parallel agents in one worktree.** They overwrite each other and the diff becomes archaeology. Dispatch isolated subagents (`Workspace: "branch"`) or say `"own worktree per attempt"`. +- **Looping before you trust the loop.** A loop that cannot verify its own work only produces unchecked work faster. Get the verification skill working first. +- **Trusting an unvetted number.** A warm cache or a skipped code path can fake a speedup. Run `/benchmark-checklist` before reporting the number. +- **Correcting the same mistake by hand.** A correction in chat helps one run. `/correct` hardens the repo so no later run repeats it. +- **Using `/arena` for coverage.** `/arena` repeats one design or code brief, then picks a base and grafts the best parts. Local `invoke_subagent` fan-out (`<= 8`), `/cloud-swarm` (`> 8`), or native `/swarm` (shared board) handles slice coverage and races. +- **Accepting every review comment.** Bots and humans both file real catches and noise in one list. `/interrogate` keeps findings proven by executable repros and lists `Dismissed` items with reasons, and you can override either way. +- **Treating `auto` as a model slug.** `auto` and `inherit` mean `"omit the model field or pass inherit so the subagent inherits the parent chat model."` [Setup](./01-setup.md) covers the roles. +- **Reporting success off a green build.** A build proves it compiles. Ask for the real command, flow, stored value, or profile, and expect the evidence in `walkthrough.md`. - **Writing a `SKILL.md` freehand.** Route it through the [Authoring or modifying a skill playbook](../../skills/poteto-mode/playbooks/authoring-a-skill.md) so validation and review happen. -That's the guide. If you skipped ahead, go back to [setup](./01-setup.md) and run one real task. The habits stick from use, not from reading. +That is the guide. If you skipped ahead, go back to [setup](./01-setup.md) and run one real task. The habits stick from use, not from reading. Back to the [guide index](./README.md). diff --git a/docs/guide/README.md b/docs/guide/README.md index 029ede3..b6a39e4 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -1,30 +1,38 @@ # The agystack guide -agystack works best when you stop micromanaging the agent. You describe what you want and how you'll know it's done. `/poteto-mode` picks the playbook, runs the other skills as the steps need them, and shows you the evidence. This guide teaches that habit with realistic prompts. +agystack works best when you stop micromanaging the agent. You describe what you want and how you will know it is done. `/agystack` and `/poteto-mode` pick the playbook, run the other skills as the steps need them, and show you the evidence. This guide teaches that habit with realistic prompts. -Here's what you'll learn: +Here is what you will learn. 1. [Set up agystack](./01-setup.md). Install the plugin and pick your models. 2. [Route work through `/poteto-mode`](./02-poteto-mode.md). Give it a goal and watch it pick a playbook. -3. [Understand the code](./03-understand.md). `/how`, `/why`, `/teach`, and `/recall` before you edit anything. -4. [Design the change](./04-design.md). `/architect`, `/arena`, `/cloud-swarm`, and `/interrogate` before code locks in a shape. +3. [Understand the code](./03-understand.md). A read-only investigation, then `/how`, `/why`, `/teach`, and `/recall` before you edit anything. +4. [Design the change](./04-design.md). `/architect`, `/arena`, `/cloud-swarm`, `/interrogate`, prototypes, and plans before code locks in a shape. 5. [Build and clean the change](./05-build-and-clean.md). The build playbooks, `/tdd`, `/deslop`, `/unslop`, and `/no-comments`. -6. [Verify and ship](./06-verify-and-ship.md). Prove behavior on the real app, then open a focused PR and drive it to merged. -7. [Run work while you sleep](./07-overnight.md). An overnight contract, a decision log you can audit, and the playbooks that scale past one agent. -8. [Steer with principle names](./08-principles.md). The 23 names that redirect an agent mid-task. -9. [Make it yours](./09-make-it-yours.md). Your own mode, plus how to test a skill change. +6. [Verify and ship](./06-verify-and-ship.md). Prove behavior on the real app, formally verify what tests rarely reach, vet numbers with `/benchmark-checklist`, then open a focused PR and drive it to merged. +7. [Run work while you sleep](./07-overnight.md). Trust before loops, an overnight contract using `/goal` and `schedule`, a decision log you can audit, and playbooks that scale past one agent. +8. [Steer with principle names](./08-principles.md). The 24 names that redirect an agent mid-task. +9. [Make it yours](./09-make-it-yours.md). Your own mode, `/correct` for repeated mistakes, and how to test a skill change. 10. [Recipes and pitfalls](./10-recipes-and-pitfalls.md). Prompts to copy and mistakes to skip. Read the pages in order the first time. After that, each page stands alone. +When you are stuck, or cannot tell which skill fits, type [`/agystack-help`](../../skills/agystack-help/SKILL.md) with your question. + +```text +/agystack-help which skill should i use to review this branch? +``` + +It answers without editing files, hands you a prompt to send, and links the skill or guide page the answer came from. It stays read-only and does not start the work, because an agystack run spends real tokens, so you send the prompt when ready. + ## If you only remember one thing -Give the agent a goal and a way to check it, in your own words: +Give the agent a goal and a way to check it, in your own words. ```text /poteto-mode the export writes duplicate rows when a retry lands mid-run. repro first, then fix and verify. ``` -You don't need to name a playbook or list skills. "repro first" and a checkable outcome are all the routing signal `/poteto-mode` needs. It matches the Bug fix playbook, copies the steps into a todo list, and calls the right skills as each step fires. +You do not need to name a playbook or list skills. `"repro first"` and a checkable outcome are all the routing signal `/poteto-mode` needs. It matches the Bug fix playbook, copies the steps into a todo list, and calls the right skills as each step fires. -Next: [Set up agystack](./01-setup.md). +Next, [Set up agystack](./01-setup.md). diff --git a/skills/agystack-help/SKILL.md b/skills/agystack-help/SKILL.md new file mode 100644 index 0000000..3c2825e --- /dev/null +++ b/skills/agystack-help/SKILL.md @@ -0,0 +1,175 @@ +--- +name: agystack-help +description: Guides users through agystack setup, /agystack and /poteto-mode, and picking the skill, playbook, or principle for a task. Type /agystack-help with a question. +disable-model-invocation: true +--- + +# Agystack help + +Answer the user's question about agystack, hand them a prompt they can send, and link the file the answer came from. Keep every help turn strictly read-only. Do not edit files, run mutations, or start the work when the user asks a question, because an agystack run spends tokens and changes repository state. Let the user send the prompt when ready. + +A message that asks for work, such as "use agystack to fix this bug", is not a help question. Read [`agystack`](../agystack/SKILL.md) or [`poteto-mode`](../poteto-mode/SKILL.md), execute the task under it, and note once that both stay active as sticky modes for the conversation. + +This file maps questions to the skills and guide pages that hold the answers. Those files own the details. Read the file you route to before quoting it, and trust it when it disagrees with this map. Give installed plugin users the public copy when they cannot open plugin internals, using `https://github.com/jtaroreh/agystack/blob/main/` followed by the repo-relative path. + +## Find out what they need + +Infer the need from the message and the conversation. A named situation, such as "which skill reviews a PR?", goes straight to its section. If the need is still unclear, ask one multiple-choice question via `ask_question` with these options, then answer only the section they pick. + +- Get set up +- Start a task with `/agystack` or `/poteto-mode` +- Pick a skill for a situation +- Fix a run that went wrong +- Make agystack my own + +Inspect the live Antigravity setup before answering, and mention state only when it changes the answer. + +- Read `agystack-models.md` at `~/.gemini/config/plugins/agystack/agystack-models.md`, `.agents/plugins/agystack/agystack-models.md`, or the plugin root to see configured role model tiers (`inherit`, `flash`, `pro`, `flash_lite`). Missing user overrides mean roles fall back to skill defaults. +- Read `agystack-runtime.json` at `~/.gemini/config/plugins/agystack/agystack-runtime.json` or `.agents/plugins/agystack/agystack-runtime.json` when the question touches Cloud Run swarms. +- Run the read-only doctor check when diagnosing setup or prerequisites, using `python3 skills/setup-agystack/scripts/setup_runtime.py --doctor` or dynamic discovery across `~/.gemini/config/plugins/agystack` and `.agents/plugins/agystack`. It checks `bun`, `gh`, `gt`, `gcloud`, `agystack-models.md`, the safety hook contract, the brain artifact directory, and legacy `skills/swarm/` collisions. +- Check [`hooks.json.example`](../../hooks.json.example) against `.agents/hooks.json` or `~/.gemini/config/hooks.json` when the question touches automatic formatting, command safety, or coordinator delegation guards. +- Check `.agents/skills/verify-*` in the workspace when the question involves proving app behavior (`/create-verification-skill` or `/maintain-verification-skill`) or formal properties (`/create-formal-verification-skill` or `/maintain-formal-verification-skill`). When a formal verification skill exists and covered code changed past its recorded sync-commit SHA, mention `/maintain-formal-verification-skill` if the question touches that code. + +When custom model roles are missing and it matters (new user, setup or cost question, or model-dependent answer), ask once via `ask_question` whether to configure roles now or later. If the need is also unclear, ask both questions together. Offer two choices. + +- **Now.** Give them `/setup-agystack` to run, and answer their question too. +- **Later.** Answer their question, and add one line noting that roles use their defaults until they run `/setup-agystack`. + +## Get set up + +1. Install agystack with `agy plugin install agystack`, through **Customizations > Marketplace** in the Antigravity UI, or by cloning into `~/.gemini/config/plugins/agystack` (global) or `.agents/plugins/agystack` (workspace-local). +2. Run [`/setup-agystack`](../setup-agystack/SKILL.md). It runs `setup_runtime.py --doctor`, explains local subagents versus on-demand Cloud Run swarms, maps model tiers per role in `agystack-models.md` (and writes `agystack-runtime.json` when Cloud Run is selected), and offers `/create-verification-skill` or `/create-formal-verification-skill` when missing. +3. Optionally enable lifecycle hooks by copying [`hooks.json.example`](../../hooks.json.example) to `.agents/hooks.json` or `~/.gemini/config/hooks.json`. +4. Start a real task with `/agystack` or `/poteto-mode`, a goal, and a check that can pass or fail. + +Installing changes nothing until a skill or hook runs. The [README](../../README.md) and [guide page 1](../../docs/guide/01-setup.md) cover setup details. Offer to word their first prompt together using [`references/prompting.md`](references/prompting.md). + +If cost is the worry, explain where tokens go and how to spend fewer. agystack spends extra tokens on subagents and multi-model review panels (`interrogate`, `arena`, `architect`). Rerun `/setup-agystack` or edit `agystack-models.md` to route explorers and workers to `flash` or `flash_lite`. Setting a role to `inherit` (or `auto`) runs that role on the parent chat model. Shortening a panel list runs fewer subagents because one subagent spawns per entry. Daily tasks and local fan-outs of 8 or fewer workers always run locally via `invoke_subagent`. Cloud Run (`/cloud-swarm`) spins up only on explicit swarm invocation and costs `$0` when idle. + +## Start a task with `/agystack` or `/poteto-mode` + +`/agystack` and `/poteto-mode` are twin entry points that both load [`poteto-mode`](../poteto-mode/SKILL.md). Both match the task to one of 23 playbooks, copy its steps into the todo list, delegate non-trivial code edits (`> 50` lines or multi-file changes) to `poteto-agent` via `invoke_subagent`, and write deliverables (`implementation_plan.md`, `walkthrough.md`, domain reports) under `/brain//`. + +A good prompt states the goal and how to verify completion. Leave out a hand-written sequence of skills, because listing skills drops or reorders steps the playbook keeps. Read [`references/prompting.md`](references/prompting.md) before helping word a prompt. [Guide page 2](../../docs/guide/02-poteto-mode.md) has examples. + +Both `/agystack` and `/poteto-mode` stay active as sticky modes for the conversation. Say `"new task"` mid-chat to re-match a fresh playbook, or opt out explicitly on casual turns. To get the same style from a custom subagent you spawn directly, pass `TypeName: "poteto-agent"`. + +## Route across Antigravity slash commands and agystack skills + +Antigravity separates user-facing slash commands from programmatic agent primitives (`invoke_subagent`, `run_command`, `schedule`, `ask_question`). See [`antigravity-tools.md`](../poteto-mode/references/antigravity-tools.md). Users type slash commands in chat; agents execute skills and programmatic primitives. + +### Antigravity slash commands and native capabilities + +| Command or capability | When to use | +|---|---| +| `/agystack` or `/poteto-mode` | Run any non-trivial task under the 23 playbooks and 24 principles | +| `/goal` with `schedule` | Drive overnight autonomous tasks, queue drains, and periodic audit ticks | +| `/loop` with `--verify` | Run an inner-loop verification hillclimb against a command that exits `0` on success | +| `/schedule` | Set one-shot wakeups (`DurationSeconds`) or recurring cron triggers (`CronExpression`) | +| `/boost` | Trigger Antigravity's native multi-stage deep reasoning pipeline | +| `/teamwork-preview` | Run Antigravity's native collaborative team roles across large projects | +| Native `/swarm` | Coordinate Antigravity agents that collaborate on a shared board | + +Do not send overnight audit ticks or standing PR watch loops through `/loop`. Use `/goal` paired with `schedule` for standing autonomous ticks, and reserve [`/loop`](../loop/SKILL.md) strictly for inner-loop verification hillclimbs (`--verify ""`). Use local `invoke_subagent` fan-out for 8 or fewer independent workers, and [`/cloud-swarm`](../cloud-swarm/SKILL.md) for more than 8 headless workers on Cloud Run. + +### agystack skills + +The default answer for multi-step engineering work is `/agystack` or `/poteto-mode`, which invokes most other skills automatically when a step needs them. Name a skill directly when the user wants more or less rigor than the playbook provides. Read the target skill before recommending it, and include one example prompt. + +| The user wants to | Skill | +|---|---| +| Run any non-trivial task with full Antigravity rigor | [`/agystack`](../agystack/SKILL.md) | +| Run poteto's playbook engine and style directly | [`/poteto-mode`](../poteto-mode/SKILL.md) | +| Check that the agent understood the goal and scope before starting | [`/in-your-own-words`](../in-your-own-words/SKILL.md) | +| Rewrite a prompt deeper, not bigger, with raw inputs and outside checks before sending it | [`/sharpen`](../sharpen/SKILL.md) | +| Understand how code works now, or where new code belongs | [`/how`](../how/SKILL.md) | +| Learn why code is shaped a certain way, or where a threshold came from | [`/why`](../why/SKILL.md) | +| Understand a change or subsystem explained plainly with diagrams | [`/teach`](../teach/SKILL.md) | +| Rebuild working context on a topic from recent chats and shared records | [`/recall`](../recall/SKILL.md) | +| Get a tight status brief under 100 words with artifact links and waiting calls | [`/ketchup`](../ketchup/SKILL.md) | +| Check what a small diff could break outside itself with a live proof | [`/blast-radius`](../blast-radius/SKILL.md) | +| Settle caller usage, types, and module boundaries before coding | [`/architect`](../architect/SKILL.md) | +| Run competing attempts at one brief, score them, and graft the best parts | [`/arena`](../arena/SKILL.md) | +| Fan out more than 8 parallel workers over slices or races on Cloud Run | [`/cloud-swarm`](../cloud-swarm/SKILL.md) | +| Have diverse model tiers challenge a diff and prove bugs with executable repros | [`/interrogate`](../interrogate/SKILL.md) | +| Fix a bug test-first when a cheap local test target exists | [`/tdd`](../tdd/SKILL.md) | +| Apply TypeScript type-system rules to `.ts` or `.tsx` changes | [`typescript-best-practices`](../typescript-best-practices/SKILL.md) | +| Strip defensive bloat, redundant guards, and AI tells from code and diffs before commit | [`/deslop`](../deslop/SKILL.md) | +| Strip unnecessary comments before review using a fresh reviewer (`comment-sicko`) | [`/no-comments`](../no-comments/SKILL.md) | +| Clean AI tells and filler out of prose | [`/unslop`](../unslop/SKILL.md) | +| Write docs, RFCs, readmes, PR descriptions, or commit messages to standard | [`/technical-writing`](../technical-writing/SKILL.md) | +| Restate the last reply in plain human words without jargon | [`/bro`](../bro/SKILL.md) | +| Generate a project-local `verify-` skill and feature map | [`/create-verification-skill`](../create-verification-skill/SKILL.md) | +| Bring a `verify-` skill and feature map back in sync with the app | [`/maintain-verification-skill`](../maintain-verification-skill/SKILL.md) | +| Formally verify concurrency, consensus, state machines, or critical parsers | [`/create-formal-verification-skill`](../create-formal-verification-skill/SKILL.md) | +| Sync a formal verification model or harness after code changes and separate drift from bugs | [`/maintain-formal-verification-skill`](../maintain-formal-verification-skill/SKILL.md) | +| Verify a TLA+ state model into a Mermaid chart with bug paths, or draft a labeled sketch | [`/statechart`](../statechart/SKILL.md) | +| Vet a speedup, latency, or benchmark number against the seven verification questions | [`/benchmark-checklist`](../benchmark-checklist/SKILL.md) | +| Drive iterative edits against a `--verify` command until exit code `0` | [`/loop`](../loop/SKILL.md) | +| Design a bespoke auditable playbook for large or cross-cutting work | [`/figure-it-out`](../figure-it-out/SKILL.md) | +| Keep an append-only `decisions.tsv` trail and cross-model audit during unattended runs | [`/show-me-your-work`](../show-me-your-work/SKILL.md) | +| Configure per-role model tiers and Cloud Run swarm settings | [`/setup-agystack`](../setup-agystack/SKILL.md) | +| Draft a personal `-mode` skill from recent workspace transcripts | [`/automate-me`](../automate-me/SKILL.md) | +| Turn lessons from a completed session into skill edits | [`/reflect`](../reflect/SKILL.md) | +| Stop recurring agent mistakes using architecture, types, hooks, or tests | [`/correct`](../correct/SKILL.md) | +| Get help choosing agystack skills, playbooks, or prompts without starting work | `/agystack-help` | + +If another skill directory appears under `skills/` or `.agents/skills/` that is missing from this table, read its `SKILL.md` frontmatter and route by its `description`. Principles live in `skills/principle-*/` and are covered below. + +Close calls worth keeping straight. + +- `/how` explains current code mechanics, `/why` explains historical reasons, and `/teach` runs one or both into one plain explanation. +- `/arena` runs the same brief across candidates and grafts winners. Local `invoke_subagent` fan-out covers `<= 8` slice or race workers. Native `/swarm` handles shared-board collaboration. `/cloud-swarm` scales `> 8` headless slice or race workers on Cloud Run. +- `/interrogate` challenges the diff with adversarial models and drops unreproduced findings. `/blast-radius` checks what could break outside the diff and proves one safety invariant by running code. +- `/recall` rebuilds context across recent chats and shared records. `/ketchup` summarizes only what changed in the active conversation since the user's last message. Resuming one specific branch or checkpoint uses the [Session pickup playbook](../poteto-mode/playbooks/session-pickup.md). +- `/figure-it-out` designs a bespoke rigorous run when no bundled playbook fits. The [Autonomous run playbook](../poteto-mode/playbooks/autonomous-run.md) drives one predicate to completion. +- `/goal` with `schedule` runs overnight work and periodic audit ticks. [`/loop`](../loop/SKILL.md) runs iterative verification hillclimbs tied to `--verify ""`. +- [`/deslop`](../deslop/SKILL.md) cleans code and diffs, [`/unslop`](../unslop/SKILL.md) cleans prose, and [`/no-comments`](../no-comments/SKILL.md) strips comments through `comment-sicko`. + +## Playbooks and principles + +Playbooks are step lists inside `skills/poteto-mode/playbooks/`, not slash commands. Describing the task under `/agystack` or `/poteto-mode` picks one automatically, and these phrases route directly. + +- `"babysit this pr"` or `"check on pr 123"` runs [Babysit](../poteto-mode/playbooks/babysit.md). It declares a mode (`drive`, `background`, `threads-only`, or `check`), stops at merge-ready, and never merges. +- `"land the stack"` runs [Shipping](../poteto-mode/playbooks/shipping.md), which verifies each PR independently and lands only the contiguous verified run bottom-up via `gh` (or `origin pr`). +- `"take over this branch"` runs [Session pickup](../poteto-mode/playbooks/session-pickup.md). +- `"pause safely"` runs [Pause safely](../poteto-mode/playbooks/pause-safely.md). +- `"full autopilot on this queue"` runs [Autopilot-full](../poteto-mode/playbooks/autopilot-full.md). `"autopilot, don't merge"` runs [Autopilot-stack](../poteto-mode/playbooks/autopilot-stack.md). +- `"orchestrate"` for multi-day multi-stack programs runs [Orchestrate](../poteto-mode/playbooks/orchestrate.md). +- `"run the eval playbook"` runs [Eval](../poteto-mode/playbooks/eval.md). + +The Playbooks section of [`poteto-mode`](../poteto-mode/SKILL.md) lists all 23 playbooks. [Guide page 6](../../docs/guide/06-verify-and-ship.md) covers verification, opening PRs, babysitting, and shipping. + +agystack has no standalone planning skill because Antigravity provides native `implementation_plan.md` artifacts. For phased or stacked multi-PR work, asking `/agystack` or `/poteto-mode` for a plan triggers the [Multi-phase plan playbook](../poteto-mode/playbooks/multi-phase-plan.md), which writes the plan without implementing it and checks it with `node skills/poteto-mode/scripts/check-plan.mjs`. For design forks, [Prototype](../poteto-mode/playbooks/prototype.md) or `/architect` settles questions in code first. + +Principles are 24 single-rule skills that `/poteto-mode` reads and cites alongside the decision changed. Users rarely invoke them with slashes; steer by naming the principle instead (such as `"apply prove it works. show me the real output"`). [Guide page 8](../../docs/guide/08-principles.md) indexes all 24. + +## Fix a run that went wrong + +| Symptom | Fix | +|---|---| +| A follow-up question got pulled into the last task | Say `"new task"` so the sticky mode matches a fresh playbook, or opt out explicitly. | +| A model override had no effect | Check `agystack-models.md` with `setup_runtime.py --doctor` and start a new session so the updated config loads. | +| Native `/swarm` collides with an old swarm folder | Check `setup_runtime.py --doctor` and delete any leftover `skills/swarm/` directory from pre-0.17.0 archives. | +| An overnight run drifted or exited without finishing | Move standing work from `/loop` to `/goal` with `schedule` and a checkable predicate, or keep `/loop` strictly on `--verify ""`. See [guide page 7](../../docs/guide/07-overnight.md). | +| Parallel subagents overwrote each other's files | Dispatch isolated workers with `Workspace: "branch"` or fresh worktrees, or run large sweeps on `/cloud-swarm`. | +| Runs cost more tokens than expected | Set explorer and worker roles to `flash` or `flash_lite` in `agystack-models.md`, shorten panel lists, and reserve `/cloud-swarm` for `> 8` workers. | +| The reply declared victory from a passing build | Ask for the real command, live flow receipt in `walkthrough.md`, stored value, or profile via `prove-it-works`. | +| `/interrogate` dropped an issue you care about | Read the `Dismissed` section in `adversarial_review.md`; findings without a working repro command are dropped unless you override. | +| A lifecycle hook blocked a direct edit or command | Check [`hooks.json.example`](../../hooks.json.example); `pre_tool_delegation.py` asks or blocks non-trivial coordinator edits over 50 lines unless delegated to `poteto-agent`. | + +For mid-run steering, [`references/prompting.md`](references/prompting.md) has one-line redirects. [Guide page 10](../../docs/guide/10-recipes-and-pitfalls.md) lists recipes, lifecycle hooks, and common pitfalls. + +## Make agystack my own + +- [`/automate-me`](../automate-me/SKILL.md) mines workspace brain transcripts to draft a personal `-mode` skill. +- [`/reflect`](../reflect/SKILL.md) turns session lessons into candidate skill edits waiting on your approval. +- [`/correct`](../correct/SKILL.md) fixes recurring mistakes in repo architecture, types, hooks (`hooks.json.example`), or tests (`tests/`). +- `/agystack write a skill for ` runs [Authoring or modifying a skill](../poteto-mode/playbooks/authoring-a-skill.md), and [Eval](../poteto-mode/playbooks/eval.md) tests skill changes blind. +- Fix any broken skill in its own PR rather than inside unrelated feature work. + +[Guide page 9](../../docs/guide/09-make-it-yours.md) covers each workflow. + +## Reply + +Lead with the direct answer. Include at most one example prompt in a code block, adapted from [`references/recipes.md`](references/recipes.md) when one fits, followed by a link to that file and the source skill or guide page. Keep the reply concise unless the user asked for the full map, and make zero edits during a help turn. diff --git a/skills/agystack-help/references/prompting.md b/skills/agystack-help/references/prompting.md new file mode 100644 index 0000000..b9a645d --- /dev/null +++ b/skills/agystack-help/references/prompting.md @@ -0,0 +1,51 @@ +# Word the prompt + +A prompt states the intent and the check for done. The playbook supplies the steps, so a few plain sentences beat a spec. + +## Put in + +- The goal. Say what is broken or what you want changed. +- The done check. Give a condition that can pass or fail. Vague goals like "make it better" and bare durations are not checks. +- The proof to show. Ask for real command output, screenshots or carousels in `walkthrough.md`, the stored value, or a before and after measurement. +- What you already know. A symptom, repro step, log line, or link saves the agent a search. +- Real constraints. Phrases like `"repro first"`, `"don't change any code yet"`, `"zero behavior change"`, and `"let me review before proceeding"` steer playbook selection and gates. + +## Leave out + +- The how. State what to achieve and leave room for the agent to find a better path. +- A manual list of skills or steps. Hand-written sequences drop or reorder steps the playbook already runs. Name a skill only to override one choice. +- Your guess at the root cause before the agent restates the problem. Leading with a theory narrows the search prematurely. + +## Load the context first + +- For a noisy report, ask the agent to restate the underlying issue in plain words before editing code. Misreadings show up before any diff exists. +- In a fresh chat, run `/recall` over earlier chats and shared records on the topic before handing over new input. +- Before changing unfamiliar code, ask `/how` for current mechanics and `/why` for the reasons behind the design. +- Ask `/teach` to argue for a choice, such as `"convince me it fixes the cause and not the symptom"`. An argument is easier to test than a summary. + +## Design before the plan + +- Never take the first design. Ask for prototypes of two or three options with screenshots or timings in `prototype_review.md` and pick from evidence. +- Let prototypes answer open behavioral or layout questions instead of reviewing an abstract plan adversarially, because reviewers invent risks without runnable code. +- For a shared package or API, ask for the README or a tutorial first and build back to the code. The doc becomes the target the agent checks itself against. +- Ask for a written `implementation_plan.md` or multi-PR plan only after the design settles, with every step ending in concrete proof. + +## Follow up short + +- `"do it"`, `"continue"`, and `"keep going until done"` are complete follow-up prompts once the active chat holds the task. +- Open with `"new task"` whenever the subject shifts so the sticky `/agystack` or `/poteto-mode` session re-matches instead of treating a question as the next build step. + +## Before stepping away + +- Say `"im going to bed"` or `"im stepping away"` so the agent pauses only on irreversible actions. +- Pair `/goal` with `schedule` for overnight runs, or use `/loop --verify ""` for inner-loop verification hillclimbs where one command exit code defines success. +- Ask for a fresh git worktree (or `Workspace: "branch"`) off a named base. +- Pre-answer blocking questions such as `"don't ask me before committing"`. +- Ask for a `decisions.tsv` trail via `/show-me-your-work` so you can audit decisions in the morning. +- Include an escape hatch such as `"if you're truly stuck after a few hours, stop and write up why"`. + +## Steer in one line + +- Restate the goal directly, such as `"i said the goal is to repro. i did not ask for a fix yet."` +- Name a principle directly, such as `"apply prove it works. show me the real output, not the build log."` +- Naming a principle works because `/poteto-mode` reads the principle index at task start and reports which decision the rule changed. diff --git a/skills/agystack-help/references/recipes.md b/skills/agystack-help/references/recipes.md new file mode 100644 index 0000000..1e01e26 --- /dev/null +++ b/skills/agystack-help/references/recipes.md @@ -0,0 +1,56 @@ +# Prompts worth copying + +Swap in real paths, skills, and finish checks. Informal wording works. + +## Understand + +- `/agystack read . restate the underlying issue in your own words, in plain english.` +- `/in-your-own-words ` +- `/sharpen ` +- `/poteto-mode investigate why . give me what we know, what data you used, and your best hypotheses. don't change any code yet.` +- `use /how to understand . then use /why to find out why it broke recently.` +- `/recall my work on from last week, then read .` +- `/teach me why you implemented it this way and not . what did you trade off?` +- `/poteto-mode take over this branch. read the decision log, find what's done, and continue. don't redo finished work.` + +## Build + +- Bug fix with repro first via `/poteto-mode . repro first, then fix and verify.` +- App bug using a generated verify skill via `/poteto-mode repro this with /verify-. if it repros on main, fix it and capture screenshots in walkthrough.md.` +- Cheap local test bug via `/poteto-mode repro first. if there's a cheap test path, /tdd it. then fix and rerun.` +- Feature preserving existing behavior via `/poteto-mode add . stays byte-identical. verify both.` +- Behavior-preserving refactor via `/poteto-mode move into one module, zero behavior change. record the current output first and prove it's unchanged after.` +- Measured performance fix via `/poteto-mode takes