Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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). |
Expand Down
44 changes: 35 additions & 9 deletions docs/guide/03-understand.md
Original file line number Diff line number Diff line change
@@ -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).

Expand All @@ -20,36 +32,50 @@ 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`

```text
/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`

```text
/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.
```

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).
Loading
Loading