@automagik/genie 0.260202.1833 → 0.260203.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.beads/README.md +81 -0
- package/.beads/config.yaml +67 -0
- package/.beads/interactions.jsonl +0 -0
- package/.beads/issues.jsonl +9 -0
- package/.beads/metadata.json +4 -0
- package/.claude/skills/brainstorm/SKILL.md +53 -0
- package/.claude/skills/genie-base/SKILL.md +66 -0
- package/.claude/skills/genie-base/assets/workspace/AGENTS.md +191 -0
- package/.claude/skills/genie-base/assets/workspace/ENVIRONMENT.md +18 -0
- package/.claude/skills/genie-base/assets/workspace/HEARTBEAT.md +4 -0
- package/.claude/skills/genie-base/assets/workspace/IDENTITY.md +17 -0
- package/.claude/skills/genie-base/assets/workspace/MEMORY.md +16 -0
- package/.claude/skills/genie-base/assets/workspace/ROLE.md +14 -0
- package/.claude/skills/genie-base/assets/workspace/SOUL.md +36 -0
- package/.claude/skills/genie-base/assets/workspace/TOOLS.md +25 -0
- package/.claude/skills/genie-base/assets/workspace/USER.md +13 -0
- package/.claude/skills/genie-base/assets/workspace/memory/2026-01-30.md +6 -0
- package/.claude/skills/genie-base/assets/workspace/memory/2026-01-31.md +16 -0
- package/.claude/skills/genie-base/assets/workspace/memory/882c22be-9710-41c1-91f8-ed82947ef6ce.txt +1 -0
- package/.claude/skills/genie-base/scripts/install-workspace.sh +107 -0
- package/.claude/skills/genie-base/scripts/sanity-sweep.sh +60 -0
- package/.claude/skills/genie-blank-init/SKILL.md +37 -0
- package/.claude/skills/genie-blank-init/assets/BOOTSTRAP.md +44 -0
- package/.claude/skills/genie-blank-init/assets/IDENTITY.md +9 -0
- package/.claude/skills/genie-blank-init/assets/SOUL.md +10 -0
- package/.claude/skills/genie-blank-init/assets/USER.md +9 -0
- package/.claude/skills/genie-blank-init/scripts/apply-blank-init.sh +117 -0
- package/.claude/skills/genie-forge/SKILL.md +171 -0
- package/.claude/skills/genie-plan-review/CLAUDE.md +11 -0
- package/.claude/skills/genie-plan-review/SKILL.md +53 -0
- package/.claude/skills/genie-review/SKILL.md +171 -0
- package/.claude/skills/genie-wish/SKILL.md +141 -0
- package/.claude-plugin/marketplace.json +18 -0
- package/.genie/.gitkeep +3 -0
- package/.genie/backlog/hooks-v2.md +82 -0
- package/.genie/wishes/upgrade-brainstorm-handoff/wish.md +124 -0
- package/.gitattributes +3 -0
- package/AGENTS.md +75 -0
- package/bun.lock +55 -0
- package/dist/claudio.js +1 -1
- package/dist/genie.js +1 -1
- package/dist/term.js +123 -99
- package/docs/CO-ORCHESTRATION-GUIDE.md +368 -0
- package/package.json +5 -1
- package/plugin/.claude-plugin/plugin.json +18 -0
- package/plugin/README.md +120 -0
- package/plugin/agents/implementor.md +92 -0
- package/plugin/agents/quality-reviewer.md +113 -0
- package/plugin/agents/spec-reviewer.md +90 -0
- package/plugin/hooks/hooks.json +3 -0
- package/plugin/references/review-criteria.md +72 -0
- package/plugin/references/wish-template.md +92 -0
- package/plugin/scripts/genie.cjs +141 -0
- package/plugin/scripts/smart-install.js +308 -0
- package/plugin/scripts/src/install-genie-cli.sh +120 -0
- package/plugin/scripts/src/validate-completion.ts +142 -0
- package/plugin/scripts/src/validate-wish.ts +137 -0
- package/plugin/scripts/term.cjs +229 -0
- package/plugin/scripts/validate-completion.cjs +16 -0
- package/plugin/scripts/validate-wish.cjs +17 -0
- package/plugin/scripts/worker-service.cjs +28 -0
- package/plugin/skills/brainstorm/SKILL.md +106 -0
- package/plugin/skills/forge/SKILL.md +171 -0
- package/plugin/skills/genie-base/SKILL.md +99 -0
- package/plugin/skills/genie-base/assets/workspace/AGENTS.md +191 -0
- package/plugin/skills/genie-base/assets/workspace/ENVIRONMENT.md +18 -0
- package/plugin/skills/genie-base/assets/workspace/HEARTBEAT.md +4 -0
- package/plugin/skills/genie-base/assets/workspace/IDENTITY.md +17 -0
- package/plugin/skills/genie-base/assets/workspace/MEMORY.md +16 -0
- package/plugin/skills/genie-base/assets/workspace/ROLE.md +14 -0
- package/plugin/skills/genie-base/assets/workspace/SOUL.md +36 -0
- package/plugin/skills/genie-base/assets/workspace/TOOLS.md +25 -0
- package/plugin/skills/genie-base/assets/workspace/USER.md +13 -0
- package/plugin/skills/genie-base/scripts/install-workspace.sh +107 -0
- package/plugin/skills/genie-base/scripts/sanity-sweep.sh +60 -0
- package/plugin/skills/genie-blank-init/SKILL.md +73 -0
- package/plugin/skills/genie-blank-init/assets/BOOTSTRAP.md +44 -0
- package/plugin/skills/genie-blank-init/assets/IDENTITY.md +9 -0
- package/plugin/skills/genie-blank-init/assets/SOUL.md +10 -0
- package/plugin/skills/genie-blank-init/assets/USER.md +9 -0
- package/plugin/skills/genie-blank-init/scripts/apply-blank-init.sh +117 -0
- package/plugin/skills/genie-cli-dev/CLAUDE.md +19 -0
- package/plugin/skills/genie-cli-dev/SKILL.md +292 -0
- package/plugin/skills/plan-review/SKILL.md +101 -0
- package/plugin/skills/review/SKILL.md +221 -0
- package/plugin/skills/wish/SKILL.md +110 -0
- package/plugin/skills/work-orchestration/SKILL.md +110 -0
- package/scripts/build.js +132 -0
- package/scripts/smart-install.js +308 -0
- package/scripts/sync.js +134 -0
- package/src/lib/beads-registry.ts +595 -0
- package/src/lib/orchestrator/event-monitor.ts +2 -0
- package/src/lib/skill-loader.ts +215 -0
- package/src/lib/tmux.ts +30 -11
- package/src/lib/version.ts +1 -1
- package/src/lib/worker-registry.ts +10 -0
- package/src/services/worker-service.ts +351 -0
- package/src/term-commands/close.ts +48 -3
- package/src/term-commands/create.ts +95 -0
- package/src/term-commands/daemon.ts +176 -0
- package/src/term-commands/kill.ts +56 -2
- package/src/term-commands/orchestrate.ts +3 -2
- package/src/term-commands/send.ts +43 -15
- package/src/term-commands/spawn.ts +446 -0
- package/src/term-commands/split.ts +20 -8
- package/src/term-commands/work.ts +279 -37
- package/src/term-commands/workers.ts +36 -2
- package/src/term.ts +120 -7
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genie-cli-dev
|
|
3
|
+
description: "Development guide for genie-cli - the AI-friendly terminal orchestration tool built on tmux. Use when modifying term commands, tmux library, or adding new CLI features."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genie-CLI Development Guide
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Genie-CLI (`tools/genie-cli/`) is an AI-friendly terminal orchestration system built on tmux. It provides two main entry points:
|
|
11
|
+
|
|
12
|
+
- **`genie`** - Setup and utilities (install, setup, doctor, shortcuts)
|
|
13
|
+
- **`term`** - Terminal orchestration (session/window/pane management, command execution)
|
|
14
|
+
|
|
15
|
+
**Stack:** TypeScript, Bun, Commander.js, tmux
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Architecture
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
tools/genie-cli/
|
|
23
|
+
├── src/
|
|
24
|
+
│ ├── genie.ts # genie CLI entry point
|
|
25
|
+
│ ├── term.ts # term CLI entry point
|
|
26
|
+
│ ├── lib/
|
|
27
|
+
│ │ ├── tmux.ts # Core tmux wrapper (CRITICAL)
|
|
28
|
+
│ │ ├── tmux-wrapper.ts
|
|
29
|
+
│ │ ├── config.ts
|
|
30
|
+
│ │ ├── worktree.ts # Git worktree management
|
|
31
|
+
│ │ ├── worker-registry.ts
|
|
32
|
+
│ │ └── orchestrator/ # Claude Code automation
|
|
33
|
+
│ ├── term-commands/ # term subcommands
|
|
34
|
+
│ │ ├── split.ts
|
|
35
|
+
│ │ ├── new.ts
|
|
36
|
+
│ │ ├── ls.ts
|
|
37
|
+
│ │ ├── exec.ts
|
|
38
|
+
│ │ ├── read.ts
|
|
39
|
+
│ │ ├── window.ts
|
|
40
|
+
│ │ ├── pane.ts
|
|
41
|
+
│ │ ├── spawn.ts # Skill-based Claude spawning
|
|
42
|
+
│ │ ├── work.ts # Worker orchestration
|
|
43
|
+
│ │ └── orchestrate.ts
|
|
44
|
+
│ └── genie-commands/ # genie subcommands
|
|
45
|
+
│ ├── install.ts
|
|
46
|
+
│ ├── setup.ts
|
|
47
|
+
│ └── doctor.ts
|
|
48
|
+
└── plugin/ # Claude Code plugin
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Core tmux Library (`src/lib/tmux.ts`)
|
|
54
|
+
|
|
55
|
+
### Key Interfaces
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
interface TmuxSession {
|
|
59
|
+
id: string; // e.g., "$0"
|
|
60
|
+
name: string; // User-friendly name
|
|
61
|
+
attached: boolean;
|
|
62
|
+
windows: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface TmuxWindow {
|
|
66
|
+
id: string; // e.g., "@0"
|
|
67
|
+
name: string;
|
|
68
|
+
active: boolean; // Is this the active window?
|
|
69
|
+
sessionId: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface TmuxPane {
|
|
73
|
+
id: string; // e.g., "%0"
|
|
74
|
+
windowId: string;
|
|
75
|
+
active: boolean; // Is this the active pane?
|
|
76
|
+
title: string;
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Critical Functions
|
|
81
|
+
|
|
82
|
+
| Function | Purpose | Returns |
|
|
83
|
+
|----------|---------|---------|
|
|
84
|
+
| `listSessions()` | Get all tmux sessions | `TmuxSession[]` |
|
|
85
|
+
| `findSessionByName(name)` | Find session by name | `TmuxSession \| null` |
|
|
86
|
+
| `listWindows(sessionId)` | Get windows in session | `TmuxWindow[]` |
|
|
87
|
+
| `listPanes(windowId)` | Get panes in window | `TmuxPane[]` |
|
|
88
|
+
| `splitPane(paneId, direction, size?, workingDir?)` | Split a pane | `TmuxPane \| null` |
|
|
89
|
+
| `executeCommand(paneId, command)` | Run command in pane | `commandId` |
|
|
90
|
+
| `runCommandSync(paneId, command, timeout?)` | Run command and wait | `{output, exitCode}` |
|
|
91
|
+
| `capturePaneContent(paneId, lines?)` | Read pane output | `string` |
|
|
92
|
+
|
|
93
|
+
### Finding Active Window/Pane
|
|
94
|
+
|
|
95
|
+
Both `TmuxWindow` and `TmuxPane` have an `active: boolean` property parsed from tmux format strings:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// From listWindows - uses #{?window_active,1,0}
|
|
99
|
+
const activeWindow = windows.find(w => w.active) || windows[0];
|
|
100
|
+
|
|
101
|
+
// From listPanes - uses #{?pane_active,1,0}
|
|
102
|
+
const activePane = panes.find(p => p.active) || panes[0];
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Common bug pattern:** Using `windows[0]` or `panes[0]` instead of finding the active one.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Term Commands Pattern
|
|
110
|
+
|
|
111
|
+
Each command in `src/term-commands/` follows this pattern:
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
// Example: split.ts
|
|
115
|
+
import * as tmux from '../lib/tmux.js';
|
|
116
|
+
|
|
117
|
+
export interface SplitOptions {
|
|
118
|
+
workspace?: string;
|
|
119
|
+
worktree?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export async function splitSessionPane(
|
|
123
|
+
sessionName: string,
|
|
124
|
+
direction?: string,
|
|
125
|
+
options: SplitOptions = {}
|
|
126
|
+
): Promise<void> {
|
|
127
|
+
// 1. Find session
|
|
128
|
+
const session = await tmux.findSessionByName(sessionName);
|
|
129
|
+
if (!session) { /* error handling */ }
|
|
130
|
+
|
|
131
|
+
// 2. Get windows/panes
|
|
132
|
+
const windows = await tmux.listWindows(session.id);
|
|
133
|
+
// ...
|
|
134
|
+
|
|
135
|
+
// 3. Perform operation
|
|
136
|
+
// ...
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Registering Commands
|
|
141
|
+
|
|
142
|
+
Commands are registered in `src/term.ts` using Commander.js:
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
program
|
|
146
|
+
.command('split <session> [direction]')
|
|
147
|
+
.description('Split pane in a tmux session (h=horizontal, v=vertical)')
|
|
148
|
+
.option('-d, --workspace <path>', 'Working directory for the new pane')
|
|
149
|
+
.action(async (session, direction, options) => {
|
|
150
|
+
await splitCmd.splitSessionPane(session, direction, options);
|
|
151
|
+
});
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Common Patterns
|
|
157
|
+
|
|
158
|
+
### Session → Window → Pane Navigation
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
// Get session by name
|
|
162
|
+
const session = await tmux.findSessionByName(sessionName);
|
|
163
|
+
|
|
164
|
+
// Get windows in session
|
|
165
|
+
const windows = await tmux.listWindows(session.id);
|
|
166
|
+
|
|
167
|
+
// Find ACTIVE window (not just first!)
|
|
168
|
+
const activeWindow = windows.find(w => w.active) || windows[0];
|
|
169
|
+
|
|
170
|
+
// Get panes in window
|
|
171
|
+
const panes = await tmux.listPanes(activeWindow.id);
|
|
172
|
+
|
|
173
|
+
// Find ACTIVE pane (not just first!)
|
|
174
|
+
const activePane = panes.find(p => p.active) || panes[0];
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Getting Pane Working Directory
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
const currentPath = await tmux.executeTmux(
|
|
181
|
+
`display-message -p -t '${paneId}' '#{pane_current_path}'`
|
|
182
|
+
);
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Splitting Panes
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
const newPane = await tmux.splitPane(
|
|
189
|
+
targetPaneId,
|
|
190
|
+
'horizontal' | 'vertical', // direction
|
|
191
|
+
undefined, // size (percentage)
|
|
192
|
+
workingDir // optional working directory
|
|
193
|
+
);
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Known Issues & Fixes
|
|
199
|
+
|
|
200
|
+
### Issue: Commands target first pane instead of active pane
|
|
201
|
+
|
|
202
|
+
**Symptom:** `term split genie h` splits the first pane of first window, not the user's current pane.
|
|
203
|
+
|
|
204
|
+
**Root cause:** Using `windows[0]` and `panes[0]` instead of finding active.
|
|
205
|
+
|
|
206
|
+
**Fix pattern:**
|
|
207
|
+
```typescript
|
|
208
|
+
// Before (wrong)
|
|
209
|
+
const panes = await tmux.listPanes(windows[0].id);
|
|
210
|
+
const paneId = panes[0].id;
|
|
211
|
+
|
|
212
|
+
// After (correct)
|
|
213
|
+
const activeWindow = windows.find(w => w.active) || windows[0];
|
|
214
|
+
const panes = await tmux.listPanes(activeWindow.id);
|
|
215
|
+
const activePane = panes.find(p => p.active) || panes[0];
|
|
216
|
+
const paneId = activePane.id;
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Testing Commands
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Build
|
|
225
|
+
cd tools/genie-cli && bun run build
|
|
226
|
+
|
|
227
|
+
# Test term commands
|
|
228
|
+
term ls # List sessions
|
|
229
|
+
term new test-session # Create session
|
|
230
|
+
term window ls test-session # List windows
|
|
231
|
+
term pane ls test-session # List panes
|
|
232
|
+
term split test-session h # Split horizontally
|
|
233
|
+
term rm test-session # Cleanup
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Worker Orchestration
|
|
239
|
+
|
|
240
|
+
Workers bind Claude Code sessions to beads issues:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
term work <bd-id> # Spawn worker for issue
|
|
244
|
+
term work next # Work on next ready issue
|
|
245
|
+
term workers # List workers
|
|
246
|
+
term close <bd-id> # Close issue and cleanup
|
|
247
|
+
term kill <worker> # Force kill worker
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Worker state tracked in `src/lib/worker-registry.ts`.
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Orchestrator (Claude Automation)
|
|
255
|
+
|
|
256
|
+
The `src/lib/orchestrator/` module automates Claude Code:
|
|
257
|
+
|
|
258
|
+
- **Completion detection** - Detect when Claude finishes
|
|
259
|
+
- **State detection** - Parse Claude's current state from terminal output
|
|
260
|
+
- **Event monitoring** - Watch for permissions, questions, errors
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
term orc start genie # Start Claude with monitoring
|
|
264
|
+
term orc status genie # Check Claude state
|
|
265
|
+
term orc send genie "msg" # Send message and wait
|
|
266
|
+
term orc approve genie # Approve permission
|
|
267
|
+
term orc answer genie 1 # Answer question
|
|
268
|
+
term orc run genie "task" # Fire-and-forget with auto-approve
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Development Workflow
|
|
274
|
+
|
|
275
|
+
1. Edit source in `src/`
|
|
276
|
+
2. Build: `bun run build`
|
|
277
|
+
3. Test: `term <command>`
|
|
278
|
+
4. The CLI is symlinked, so rebuilt files are immediately available
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Key Files Reference
|
|
283
|
+
|
|
284
|
+
| File | Purpose |
|
|
285
|
+
|------|---------|
|
|
286
|
+
| `src/lib/tmux.ts` | All tmux operations |
|
|
287
|
+
| `src/term.ts` | Command registration |
|
|
288
|
+
| `src/term-commands/split.ts` | Pane splitting |
|
|
289
|
+
| `src/term-commands/spawn.ts` | Skill-based Claude spawning |
|
|
290
|
+
| `src/term-commands/orchestrate.ts` | Claude automation |
|
|
291
|
+
| `src/lib/orchestrator/state-detector.ts` | Claude state parsing |
|
|
292
|
+
| `src/lib/worker-registry.ts` | Worker state tracking |
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan-review
|
|
3
|
+
description: "Validate a wish document (structure, scope boundaries, acceptance criteria, validation commands). Use after creating or editing .genie/wishes/<slug>/wish.md to catch missing sections before forge."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Plan Review - Validate Wish Documents
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Fast structural/quality check on wish documents before execution. Catches missing sections and weak criteria.
|
|
11
|
+
|
|
12
|
+
**Two verdicts: PASS / NEEDS ATTENTION**
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## How to Run
|
|
17
|
+
|
|
18
|
+
1. Identify the wish file to validate (`.genie/wishes/<slug>/wish.md`)
|
|
19
|
+
2. Check all items below
|
|
20
|
+
3. Report PASS or NEEDS ATTENTION with fix list
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Validation Checklist
|
|
25
|
+
|
|
26
|
+
### Structure Completeness
|
|
27
|
+
|
|
28
|
+
- [ ] Has `## Summary` (2-3 sentences)
|
|
29
|
+
- [ ] Has `## Scope` with `### IN` and `### OUT`
|
|
30
|
+
- [ ] OUT scope is **not empty** (must explicitly exclude something)
|
|
31
|
+
- [ ] Has `## Success Criteria` with checkbox items (`- [ ]`)
|
|
32
|
+
- [ ] Has `## Execution Groups` with at least one `### Group`
|
|
33
|
+
|
|
34
|
+
### Task Quality (per execution group)
|
|
35
|
+
|
|
36
|
+
- [ ] Each group has `**Goal:**` (one sentence)
|
|
37
|
+
- [ ] Each group has `**Deliverables:**` list
|
|
38
|
+
- [ ] Each group has `**Acceptance Criteria:**` with checkboxes
|
|
39
|
+
- [ ] Each group has `**Validation:**` with a concrete command
|
|
40
|
+
- [ ] Tasks are specific (not "implement everything")
|
|
41
|
+
- [ ] Tasks are small enough for one focused session
|
|
42
|
+
|
|
43
|
+
### Scope Boundaries
|
|
44
|
+
|
|
45
|
+
- [ ] OUT contains explicit exclusions (not empty)
|
|
46
|
+
- [ ] IN and OUT do not contradict
|
|
47
|
+
- [ ] Scope is realistic for the task count
|
|
48
|
+
|
|
49
|
+
### Acceptance Criteria Quality
|
|
50
|
+
|
|
51
|
+
- [ ] Criteria are testable (can verify pass/fail)
|
|
52
|
+
- [ ] Criteria are specific (not "works correctly")
|
|
53
|
+
- [ ] Validation commands are executable
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Output Format
|
|
58
|
+
|
|
59
|
+
**If all checks pass:**
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Plan review: PASS
|
|
63
|
+
|
|
64
|
+
Wish document is well-structured and ready for /forge.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**If checks fail:**
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Plan review: NEEDS ATTENTION
|
|
71
|
+
|
|
72
|
+
Structure:
|
|
73
|
+
- [ ] Missing OUT scope - add explicit exclusions
|
|
74
|
+
|
|
75
|
+
Task Quality:
|
|
76
|
+
- [ ] Group B missing validation command
|
|
77
|
+
- [ ] Group C acceptance criteria too vague ("works correctly")
|
|
78
|
+
|
|
79
|
+
Scope:
|
|
80
|
+
- [ ] IN/OUT contradiction: X is in both sections
|
|
81
|
+
|
|
82
|
+
Fix these issues, then run /plan-review again.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Key Principles
|
|
88
|
+
|
|
89
|
+
- **Fast** - This is a gate check, seconds not minutes
|
|
90
|
+
- **Structure over content** - Check format, not design quality
|
|
91
|
+
- **Actionable feedback** - Every issue includes what to fix
|
|
92
|
+
- **Don't block on style** - Focus on missing/broken structure
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Never Do
|
|
97
|
+
|
|
98
|
+
- Modify the wish document (only report)
|
|
99
|
+
- Block on style/naming preferences
|
|
100
|
+
- Deep review of design quality (trust brainstorm/wish phases)
|
|
101
|
+
- Take more than 30 seconds to run
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
description: "Use when all forge tasks are complete and work needs final validation - produces SHIP/FIX-FIRST/BLOCKED verdict with categorized gaps."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Review - Final Validation
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
After forge completes all tasks, run comprehensive final review. Check every success criterion with evidence, run validation commands, do quality spot-check, and produce the ship decision.
|
|
11
|
+
|
|
12
|
+
**Three verdicts: SHIP / FIX-FIRST / BLOCKED**
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## The Flow
|
|
17
|
+
|
|
18
|
+
### 1. Load Wish & Verify Tasks
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Read .genie/wishes/<slug>/wish.md
|
|
22
|
+
Check TaskList for wish tasks
|
|
23
|
+
Verify all tasks marked complete
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**If tasks incomplete:** Stop. Output: "Forge not complete. [N] tasks remaining. Run /forge to continue."
|
|
27
|
+
|
|
28
|
+
### 2. Task Completion Audit
|
|
29
|
+
|
|
30
|
+
For each execution group in the wish:
|
|
31
|
+
- Check the task was completed
|
|
32
|
+
- Verify acceptance criteria checkboxes are checked
|
|
33
|
+
- Note any tasks that were BLOCKED during forge
|
|
34
|
+
|
|
35
|
+
**Output per group:**
|
|
36
|
+
```
|
|
37
|
+
Group A: [name]
|
|
38
|
+
- Task: COMPLETE | BLOCKED
|
|
39
|
+
- Criteria: [X/Y] checked
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. Criterion-by-Criterion Audit
|
|
43
|
+
|
|
44
|
+
For each success criterion in the wish document:
|
|
45
|
+
|
|
46
|
+
- **PASS**: Evidence exists. Describe the evidence.
|
|
47
|
+
- **FAIL**: Not met. Categorize the gap.
|
|
48
|
+
|
|
49
|
+
**Gap Categories:**
|
|
50
|
+
|
|
51
|
+
| Severity | Meaning | Blocks Ship? |
|
|
52
|
+
|----------|---------|--------------|
|
|
53
|
+
| CRITICAL | Broken functionality, security flaw, data loss | Yes |
|
|
54
|
+
| HIGH | Missing feature, major bug, test failure | Yes |
|
|
55
|
+
| MEDIUM | Missing edge case, incomplete docs | No |
|
|
56
|
+
| LOW | Style, naming, minor polish | No |
|
|
57
|
+
|
|
58
|
+
### 4. Run All Validation Commands
|
|
59
|
+
|
|
60
|
+
Execute validation command for each execution group:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
For each execution group:
|
|
64
|
+
Run its validation command
|
|
65
|
+
Record: PASS or FAIL with output
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 5. Quality Spot-Check
|
|
69
|
+
|
|
70
|
+
Dispatch a quick quality review:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
Task tool dispatch:
|
|
74
|
+
subagent_type: general-purpose
|
|
75
|
+
prompt: |
|
|
76
|
+
Quick quality review for wish: [slug]
|
|
77
|
+
|
|
78
|
+
Check the changes made across all execution groups.
|
|
79
|
+
Look for obvious issues:
|
|
80
|
+
- Security vulnerabilities
|
|
81
|
+
- Broken error handling
|
|
82
|
+
- Missing null checks
|
|
83
|
+
- Obvious performance issues
|
|
84
|
+
|
|
85
|
+
Verdict: OK or CONCERNS with brief list.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 6. Browser Tests (Optional)
|
|
89
|
+
|
|
90
|
+
If the wish involves user-facing changes and agent-browser is available:
|
|
91
|
+
- Navigate to relevant pages
|
|
92
|
+
- Verify user-visible behavior
|
|
93
|
+
- Capture screenshots as evidence
|
|
94
|
+
|
|
95
|
+
**If agent-browser is not available:** Skip gracefully. Note: "Browser tests skipped - agent-browser not available."
|
|
96
|
+
|
|
97
|
+
### 7. Verdict
|
|
98
|
+
|
|
99
|
+
**SHIP** - All criteria pass. No CRITICAL or HIGH gaps.
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
Conditions:
|
|
103
|
+
- Zero CRITICAL gaps
|
|
104
|
+
- Zero HIGH gaps
|
|
105
|
+
- All validation commands pass
|
|
106
|
+
- No BLOCKED tasks
|
|
107
|
+
- Quality spot-check returns OK or minor concerns only
|
|
108
|
+
- MEDIUM/LOW gaps are advisory only
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**FIX-FIRST** - Fixable issues found. Return to forge.
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Conditions:
|
|
115
|
+
- One or more HIGH gaps (fixable)
|
|
116
|
+
- Or validation commands failing
|
|
117
|
+
- Quality spot-check found significant concerns
|
|
118
|
+
- Provide specific fix list for /forge
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**BLOCKED** - Fundamental issues. Return to wish.
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
Conditions:
|
|
125
|
+
- CRITICAL gaps that require scope changes
|
|
126
|
+
- Or architectural problems that can't be fixed in forge
|
|
127
|
+
- Any BLOCKED tasks from forge
|
|
128
|
+
- Provide specific issues requiring wish revision
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 8. Write Results
|
|
132
|
+
|
|
133
|
+
Update the wish document with review results:
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
## Review Results
|
|
137
|
+
|
|
138
|
+
**Verdict:** SHIP | FIX-FIRST | BLOCKED
|
|
139
|
+
**Date:** YYYY-MM-DD
|
|
140
|
+
|
|
141
|
+
### Task Completion
|
|
142
|
+
| Group | Status | Criteria |
|
|
143
|
+
|-------|--------|----------|
|
|
144
|
+
| A | COMPLETE | 3/3 |
|
|
145
|
+
| B | COMPLETE | 2/2 |
|
|
146
|
+
|
|
147
|
+
### Criteria Check
|
|
148
|
+
- [x] Criterion 1 - PASS: [evidence]
|
|
149
|
+
- [ ] Criterion 2 - FAIL (HIGH): [gap description]
|
|
150
|
+
|
|
151
|
+
### Validation Commands
|
|
152
|
+
- [x] `command 1` - PASS
|
|
153
|
+
- [ ] `command 2` - FAIL: [output]
|
|
154
|
+
|
|
155
|
+
### Quality Spot-Check
|
|
156
|
+
Verdict: OK
|
|
157
|
+
Notes: [brief notes if any]
|
|
158
|
+
|
|
159
|
+
### Browser Tests
|
|
160
|
+
- [x] Page loads correctly
|
|
161
|
+
- Skipped: agent-browser not available
|
|
162
|
+
|
|
163
|
+
### Gaps
|
|
164
|
+
| # | Severity | Description | Fix |
|
|
165
|
+
|---|----------|-------------|-----|
|
|
166
|
+
| 1 | HIGH | Missing error handling | Add try/catch in handler.ts |
|
|
167
|
+
| 2 | MEDIUM | No edge case test | Add test for empty input |
|
|
168
|
+
|
|
169
|
+
### Recommendation
|
|
170
|
+
[One paragraph: what to do next]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## After Review
|
|
176
|
+
|
|
177
|
+
**If SHIP:**
|
|
178
|
+
```
|
|
179
|
+
"Review passed. Work is complete and ready to ship."
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**If FIX-FIRST:**
|
|
183
|
+
```
|
|
184
|
+
"Review found fixable issues. Run /forge to address:
|
|
185
|
+
1. [gap 1]
|
|
186
|
+
2. [gap 2]
|
|
187
|
+
Then run /review again."
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**If BLOCKED:**
|
|
191
|
+
```
|
|
192
|
+
"Review found fundamental issues requiring scope changes.
|
|
193
|
+
Revise the wish document to address:
|
|
194
|
+
1. [issue 1]
|
|
195
|
+
2. [issue 2]
|
|
196
|
+
Then run /forge and /review again."
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Key Principles
|
|
202
|
+
|
|
203
|
+
- **Every criterion checked** - No skipping, no "probably fine"
|
|
204
|
+
- **Evidence required** - PASS needs proof, not assumption
|
|
205
|
+
- **Gaps categorized** - Severity determines whether it blocks
|
|
206
|
+
- **Actionable feedback** - Every FAIL includes how to fix
|
|
207
|
+
- **Browser tests graceful** - Skip if agent-browser unavailable, don't fail
|
|
208
|
+
- **Results written to wish** - Review results live in the wish document
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Never Do
|
|
213
|
+
|
|
214
|
+
- Declare SHIP with CRITICAL or HIGH gaps
|
|
215
|
+
- Skip validation commands
|
|
216
|
+
- Mark criteria PASS without evidence
|
|
217
|
+
- Re-implement fixes during review (that's forge's job)
|
|
218
|
+
- Change scope during review (that's wish's job)
|
|
219
|
+
- Block on MEDIUM or LOW gaps
|
|
220
|
+
- Pass with BLOCKED tasks from forge
|
|
221
|
+
- Forget to write results back to the wish document
|