Skip to content

Commit 4ff797b

Browse files
committed
docs(recipes): Promote prompts to first-class position
Move prompt from footnote at bottom to chat-bubble block between Situation and Discover. The narrative now flows: context → trigger → agent response → lesson. Recipe 4 (stuck build) shows three specificity levels: exact pane ID, vague reference, and minimal — demonstrating the agent discovers what it needs regardless.
1 parent 3d71bbe commit 4ff797b

File tree

1 file changed

+53
-17
lines changed

1 file changed

+53
-17
lines changed

docs/recipes.md

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ existing tmux state so you can write better prompts and system instructions.
1010
Every recipe uses the same structure:
1111

1212
- **Situation** -- the developer's world before the agent acts
13+
- **Prompt** -- the natural-language sentence that triggers the recipe
1314
- **Discover** -- what the agent inspects and why
1415
- **Decide** -- the judgment call that changes the plan
1516
- **Act** -- the minimum safe action sequence
1617
- **The non-obvious part** -- the lesson you would miss from reading tool docs
1718
alone
18-
- **Prompt** -- a natural-language sentence that triggers this recipe
1919

2020
---
2121

@@ -27,6 +27,12 @@ Every recipe uses the same structure:
2727
Playwright e2e tests. The agent does not know which pane has the server,
2828
or what port it chose.
2929

30+
```{admonition} Prompt
31+
:class: prompt
32+
33+
Run the Playwright tests against my dev server in the myapp session.
34+
```
35+
3036
### Discover
3137

3238
```{admonition} Agent reasoning
@@ -77,9 +83,6 @@ working directory. If the agent had used {toolref}`list-panes` to find a pane
7783
running `node`, it would know a process exists but not whether it is ready or
7884
what URL it chose.
7985

80-
**Prompt:** "Run the Playwright tests against my dev server in the myapp
81-
session."
82-
8386
---
8487

8588
## Start a service and wait for it before running dependent work
@@ -88,6 +91,12 @@ session."
8891
no server running yet. They want to run integration tests, but the test
8992
suite needs a live API server.
9093

94+
```{admonition} Prompt
95+
:class: prompt
96+
97+
Start the API server in my backend session and run the integration tests once it's ready.
98+
```
99+
91100
### Discover
92101

93102
```{admonition} Agent reasoning
@@ -138,9 +147,6 @@ seconds or 20 -- the agent adapts. The anti-pattern is polling with repeated
138147
handles the polling internally with configurable `timeout` (default 8s) and
139148
`interval` (default 50ms).
140149

141-
**Prompt:** "Start the API server in my backend session and run the
142-
integration tests once it's ready."
143-
144150
---
145151

146152
## Find the failing pane without opening random terminals
@@ -149,6 +155,12 @@ integration tests once it's ready."
149155
session -- linting, unit tests, integration tests, type checking. One of
150156
them failed, but they stepped away and do not remember which pane.
151157

158+
```{admonition} Prompt
159+
:class: prompt
160+
161+
Check my ci session -- which jobs failed?
162+
```
163+
152164
### Discover
153165

154166
```{admonition} Agent reasoning
@@ -192,15 +204,35 @@ makes 20+ round trips for the same information. The `regex: true` parameter
192204
is required here because the `|` in the pattern is a regex alternation, not
193205
literal text.
194206

195-
**Prompt:** "Check my ci session -- which jobs failed?"
196-
197207
---
198208

199209
## Interrupt a stuck process and recover the pane
200210

201211
**Situation.** A long-running build is hanging. The developer wants to
202212
interrupt it, verify the pane is responsive, and re-run the command.
203213

214+
```{admonition} Prompt
215+
:class: prompt
216+
217+
The build in pane %2 is stuck. Kill it and restart.
218+
```
219+
220+
Or with less specificity — the agent will discover the target:
221+
222+
```{admonition} Prompt
223+
:class: prompt
224+
225+
The build in one of my panes is stuck. Kill it and restart.
226+
```
227+
228+
Or if you've built muscle memory in your chats:
229+
230+
```{admonition} Prompt
231+
:class: prompt
232+
233+
The build is stuck. Kill it and restart.
234+
```
235+
204236
### Discover
205237

206238
```{admonition} Agent reasoning
@@ -257,8 +289,6 @@ destroy. Skipping
257289
straight to {toolref}`kill-pane` loses the pane's scrollback history and any
258290
partially written output that might explain *why* it hung.
259291

260-
**Prompt:** "The build in pane %2 is stuck. Kill it and restart."
261-
262292
---
263293

264294
## Re-run a command without mixing old and new output
@@ -267,6 +297,12 @@ partially written output that might explain *why* it hung.
267297
candidate pane already has old test output in scrollback. They want only
268298
fresh results.
269299

300+
```{admonition} Prompt
301+
:class: prompt
302+
303+
Run `pytest` in the test pane and show me only the fresh output.
304+
```
305+
270306
### Discover
271307

272308
The agent calls {tooliconl}`list-panes` to find the pane by title, cwd, or
@@ -299,9 +335,6 @@ partial state. The {toolref}`wait-for-text` call after {toolref}`send-keys`
299335
naturally provides the needed delay, so the sequence clear-send-wait-capture
300336
is safe.
301337

302-
**Prompt:** "Run `pytest` in the test pane and show me only the fresh
303-
output."
304-
305338
---
306339

307340
## Build a workspace the agent can revisit later
@@ -310,6 +343,12 @@ output."
310343
quick split, but a layout that later prompts can refer to by role ("the
311344
server pane", "the test pane").
312345

346+
```{admonition} Prompt
347+
:class: prompt
348+
349+
Set up a tmux workspace for myproject with editor, server, and test panes.
350+
```
351+
313352
### Discover
314353

315354
```{admonition} Agent reasoning
@@ -361,9 +400,6 @@ figure out which one is which. But note: pane IDs are ephemeral across tmux
361400
server restarts, so the agent should always re-discover by metadata (session
362401
name, pane title, cwd) rather than trusting remembered `%N` values.
363402

364-
**Prompt:** "Set up a tmux workspace for myproject with editor, server, and
365-
test panes."
366-
367403
---
368404

369405
## What to read next

0 commit comments

Comments
 (0)