@aion0/forge 0.5.22 → 0.5.24

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.
@@ -2,253 +2,809 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Workspace is a multi-agent orchestration system. You define a team of **Smiths** (agents) with roles, dependencies, and steps. Smiths run as long-lived daemons, communicate via a message bus, and can be controlled manually or automatically.
5
+ Workspace is a multi-agent orchestration system. You define a team of **Smiths** (agents) that coordinate via DAG dependencies, a message bus, and request/response documents. Smiths run as long-lived daemons or can be manually driven from a terminal.
6
6
 
7
- ## Concepts
7
+ ## Core Concepts
8
8
 
9
9
  | Term | Description |
10
10
  |------|-------------|
11
- | **Smith** | A long-running agent instance in the workspace |
12
- | **Agent Profile** | A reusable configuration (CLI type + env vars + model) that can be assigned to any smith |
13
- | **Message Bus** | Inter-agent communication system with two message categories |
11
+ | **Smith** | A long-running agent in the workspace (Claude Code, Codex, etc.) |
12
+ | **Primary Smith** | The coordinator smith runs at project root, typically Lead |
14
13
  | **Input Node** | User-provided requirements node (append-only history) |
15
- | **Daemon** | Background execution loop that keeps smiths alive and consuming messages |
14
+ | **DAG** | Directed acyclic graph of agent dependencies (no cycles allowed) |
15
+ | **Request Document** | YAML doc describing a task, flows through status stages |
16
+ | **Topology Cache** | Live in-memory map of all smiths, auto-injected into every task |
17
+ | **Message Bus** | Inter-agent messaging (notifications + direct messages) |
18
+ | **Daemon** | Background loop that keeps smiths alive and consumes messages |
16
19
 
17
- ## Three-Layer State Model
20
+ ## Two-Layer State Model
18
21
 
19
- Each smith has three independent status layers displayed on the node:
22
+ Each smith has two independent status layers displayed on the node:
20
23
 
21
24
  | Layer | Values | Description |
22
25
  |-------|--------|-------------|
23
- | **Smith Status** | `down` / `active` | Whether the daemon process is running |
24
- | **Mode** | `auto` / `manual` | `auto` = daemon-driven, `manual` = user in terminal (purple) |
26
+ | **Smith Status** | `down` / `starting` / `active` | Daemon lifecycle |
25
27
  | **Task Status** | `idle` / `running` / `done` / `failed` | Current work status |
26
28
 
27
- - **Mode controls message consumption**: `manual` pauses inbox processing (same as `running`)
28
- - **Smith Status controls the daemon loop**: `down` stops the message loop entirely
29
- - **Task Status tracks work**: unaffected by mode changes
29
+ - **Smith Status** is controlled by daemon start/stop
30
+ - **Task Status** tracks individual work execution
31
+ - Session-monitor auto-marks `done` after 20 min of file stability (fallback if Stop hook misses)
32
+
33
+ ## Creating Smiths
34
+
35
+ ### Add Agent Modal
36
+
37
+ Click **+ Add Agent** in workspace header to open config modal. Fields:
38
+
39
+ | Field | Description |
40
+ |-------|-------------|
41
+ | **Template** | Quick-select preset (Lead ★, PM, Engineer, QA, Reviewer, UI Designer, Design Evaluator) |
42
+ | **Saved Templates** | User-saved smith configs (if any) |
43
+ | **Icon + Label** | Display on node (emoji icon + agent name) |
44
+ | **Backend** | `cli` (subscription, Claude Code/Codex/Aider) or `api` (API key) |
45
+ | **Agent / Profile** | Which CLI or API profile to use (from Settings) |
46
+ | **Role / System Prompt** | Core instructions, synced to `CLAUDE.md` in workDir |
47
+ | **Plugin Instances** | MCP plugins the agent can use (playwright, shell-command, llm-vision) |
48
+ | **Depends On** | Upstream agents this one depends on (creates DAG edges) |
49
+ | **Work Dir** | Relative path within project where agent runs |
50
+ | **Outputs** | Expected output paths (informational, no longer enforces uniqueness) |
51
+ | **Primary** | Only one per workspace — runs at root, gets fixed session, persistent |
52
+ | **Requires Approval** | User must approve each inbox message before processing |
53
+ | **Terminal Mode** | Keep a tmux+CLI session alive (persistent session) |
54
+ | **Skip Permissions** | Auto-approve tool calls (`--dangerously-skip-permissions`) |
55
+ | **Model** | Override model (claude-sonnet-4-6, claude-opus-4-6, etc.) |
56
+ | **Steps** | Ordered task steps (Label: Prompt) |
57
+ | **Watch** | Autonomous file/git/command monitoring |
58
+
59
+ ### Preset Templates
60
+
61
+ | Preset | Icon | Role | Notes |
62
+ |--------|------|------|-------|
63
+ | **Lead** ★ | 👑 | Primary coordinator — SOP-driven intake, delegation, gap coverage | **Recommended for Primary smith** |
64
+ | **PM** | 📋 | Product Manager — versioned PRDs, testable acceptance_criteria | Writes to `docs/prd/` |
65
+ | **Architect** | 🏗️ | Breaks requirements into request documents | Uses `create_request` |
66
+ | **Engineer** | 🔨 | Claims requests, implements code | Uses `claim_request` + `update_response` |
67
+ | **QA** | 🧪 | Writes Playwright tests, verifies acceptance_criteria | Uses `update_response(section: qa)` |
68
+ | **Reviewer** | 🔍 | Reviews code quality, security, performance | Uses `update_response(section: review)` |
69
+ | **UI Designer** | 🎨 | Writes UI code, iterates via screenshots | Needs playwright plugin |
70
+ | **Design Evaluator** | 🔍 | Scores UI implementations visually | Needs playwright + llm-vision |
71
+
72
+ Primary presets (Lead) have orange ★ badge and are recommended when designing workspaces with a coordinator.
73
+
74
+ ## Smith Templates (Save/Load)
75
+
76
+ ### Save a Smith as Template
77
+
78
+ On any configured smith node, click **💾** button:
79
+ - Enter template name + optional description
80
+ - Stored at `~/.forge/data/smith-templates/<id>.json`
81
+ - Appears in "Saved Templates" section when adding new agents
82
+
83
+ ### Export / Import
84
+
85
+ - **📤 Export** (in Edit Agent modal): download current config as JSON file
86
+ - **📂 Import from file**: load a JSON template when creating a new agent
87
+ - Share template files across machines/workspaces
88
+
89
+ API endpoints:
90
+ - `GET /api/smith-templates` — list all
91
+ - `POST /api/smith-templates` — save (body: `{name, icon, description, config}`)
92
+ - `POST /api/smith-templates` with `{action: "delete", id}` — remove
30
93
 
31
94
  ## Dependencies (DAG)
32
95
 
33
- Dependencies must form a **directed acyclic graph** (DAG). Circular dependencies are rejected when adding or editing agents.
96
+ Dependencies must form a **directed acyclic graph**. Circular deps rejected at add/edit time.
34
97
 
35
98
  ```
36
99
  Input → PM → Engineer → QA → Reviewer
100
+ ↘________________↗
101
+ (both notify Reviewer)
37
102
  ```
38
103
 
39
- - Upstream agents complete first, then broadcast to downstream
40
- - Each agent knows its upstream (dependsOn) and the system prevents cycles
104
+ - Upstream completes first, broadcasts to downstream
105
+ - Each agent declares `dependsOn` (upstream agent IDs)
41
106
 
42
- ## Message System
107
+ ## Request/Response Document System
108
+
109
+ Structured YAML documents for multi-agent delivery workflows.
110
+
111
+ ### Storage Layout
112
+
113
+ ```
114
+ <project>/.forge/requests/
115
+ ├── REQ-20260403-001/
116
+ │ ├── request.yml # Architect/Lead creates
117
+ │ └── response.yml # Engineer/Reviewer/QA update
118
+ └── REQ-20260403-002/
119
+ ├── request.yml
120
+ └── response.yml
121
+ ```
43
122
 
44
- ### Two Message Categories
123
+ ### Status Lifecycle
45
124
 
46
- | Category | Direction | Behavior | Use Case |
47
- |----------|-----------|----------|----------|
48
- | **Notification** | Follows DAG (upstream → downstream) | Auto-broadcast on completion, downstream discards reverse notifications | "I'm done, here's what I did" |
49
- | **Ticket** | Any direction (ignores DAG) | 1-to-1, independent lifecycle, retry limits | Bug reports, fix requests |
125
+ ```
126
+ open → in_progress → review → qa → done
127
+ ```
50
128
 
51
- ### Notification Messages (Default)
129
+ - **open**: request created, no one claimed yet
130
+ - **in_progress**: Engineer claimed and is implementing
131
+ - **review**: Engineer done, Reviewer should review
132
+ - **qa**: Reviewer approved, QA should test
133
+ - **done**: QA passed
134
+
135
+ ### Request YAML Schema
136
+
137
+ ```yaml
138
+ id: "REQ-20260403-001"
139
+ batch: "delivery-20260403"
140
+ title: "User authentication"
141
+ description: "Detailed description..."
142
+ modules:
143
+ - name: "auth-service"
144
+ description: "JWT token generation"
145
+ acceptance_criteria:
146
+ - "Login returns access token"
147
+ - "Expired tokens return 401"
148
+ priority: "high" # high | medium | low
149
+ status: "open"
150
+ assigned_to: ""
151
+ created_by: "Architect"
152
+ created_at: "2026-04-03T10:00:00Z"
153
+ updated_at: "2026-04-03T10:00:00Z"
154
+ ```
52
155
 
53
- When a smith completes:
54
- - If it was processing an **upstream** message → broadcast to all downstream agents
55
- - If it was processing a **downstream** message → no broadcast, just mark the message done (sender checks outbox status)
56
- - Each message carries a `causedBy` field tracing which inbox message triggered it
156
+ ### Response YAML Schema
157
+
158
+ ```yaml
159
+ request_id: "REQ-20260403-001"
160
+ status: "done"
161
+ engineer:
162
+ completed_at: "2026-04-03T11:30:00Z"
163
+ files_changed: ["src/auth/service.ts"]
164
+ notes: "Implemented with jose library"
165
+ review:
166
+ completed_at: "2026-04-03T12:00:00Z"
167
+ result: "approved" # approved | changes_requested | rejected
168
+ findings: []
169
+ qa:
170
+ completed_at: "2026-04-03T12:30:00Z"
171
+ result: "passed" # passed | failed
172
+ test_files: ["tests/e2e/auth.spec.ts"]
173
+ findings: []
174
+ ```
57
175
 
58
- ### Ticket Messages
176
+ ### Auto-Notification via DAG
59
177
 
60
- - Created via `create_ticket` API or forge skills
61
- - Have their own lifecycle: `open → in_progress → fixed → verified → closed`
62
- - Retry limit (default 3), exceeding marks ticket as failed
63
- - Not affected by DAG direction — any agent can ticket any agent
178
+ When `create_request` or `update_response` is called, the orchestrator automatically sends notifications to all downstream agents (based on `dependsOn`). Agents don't manually send messages — they operate on the document and downstream smiths are notified.
64
179
 
65
- ### CausedBy Chain
180
+ ## MCP Tools (for Smiths)
66
181
 
67
- Every outgoing message carries `causedBy` linking to the inbox message that triggered it:
182
+ Agents use these MCP tools (via forge-mcp-server):
68
183
 
69
- ```json
70
- {
71
- "from": "qa-123",
72
- "to": "reviewer-456",
73
- "action": "upstream_complete",
74
- "causedBy": {
75
- "messageId": "msg-789",
76
- "from": "engineer-111",
77
- "to": "qa-123"
78
- }
79
- }
184
+ ### Topology & Status
185
+
186
+ | Tool | Description |
187
+ |------|-------------|
188
+ | `get_agents` | Live workspace topology — all agents, roles, DAG flow, status, missing standard roles |
189
+ | `get_status` | Live status snapshot of all agents (smith+task status) |
190
+ | `get_inbox` | Pending/failed inbox messages for current agent |
191
+
192
+ ### Request Documents
193
+
194
+ | Tool | Description |
195
+ |------|-------------|
196
+ | `create_request` | Create a new request document (auto-notifies downstream) |
197
+ | `claim_request` | Atomically claim an open request (prevents duplicate work) |
198
+ | `list_requests` | List requests, filter by `batch` or `status` |
199
+ | `get_request` | Read full request + response content |
200
+ | `update_response` | Update response section (engineer/review/qa), auto-advances status |
201
+
202
+ ### Communication
203
+
204
+ | Tool | Description |
205
+ |------|-------------|
206
+ | `send_message` | Send a direct message to another agent |
207
+ | `mark_message_done` | Mark a processed message as done |
208
+ | `check_outbox` | Check delivery status of sent messages |
209
+
210
+ ### Other
211
+
212
+ | Tool | Description |
213
+ |------|-------------|
214
+ | `run_plugin` | Execute a plugin action (e.g., Playwright test/screenshot) |
215
+ | `sync_progress` | Report work progress to workspace |
216
+ | `trigger_pipeline` | Trigger a pipeline from a smith |
217
+ | `get_pipeline_status` | Check pipeline run status |
218
+
219
+ ## Topology Cache (Auto-Injected Context)
220
+
221
+ Every task execution automatically includes a **Workspace Team** section in the agent's context:
222
+
223
+ ```
224
+ ## Workspace Team
225
+ Flow: Lead → Engineer → QA → Reviewer
226
+ Missing: architect, pm
227
+ - 👑 Lead ← you [active/running]: Lead Coordinator — Primary agent...
228
+ - 🔨 Engineer [active/idle]: Senior Software Engineer — You design...
229
+ - 🧪 QA [active/idle]: QA Engineer — You ensure quality...
230
+ - 🔍 Reviewer [active/idle]: Senior Code Reviewer — You review...
80
231
  ```
81
232
 
82
- This enables:
83
- - **Loop prevention**: Notifications from downstream are silently discarded
84
- - **Outbox tracking**: Sender can verify their message was processed
85
- - **Audit trail**: Every message traces back to its trigger
233
+ - **Rebuilt on every agent change** (add/remove/update/status change)
234
+ - **Auto-injected** via `buildUpstreamContext` agents don't need to call `get_agents` at start
235
+ - **Missing roles hint** shows which standard roles are absent (so Lead knows to cover gaps)
236
+ - Agents can still call `get_agents` for detailed mid-task status
237
+
238
+ ## Lead / Primary Smith
239
+
240
+ The **Lead** preset is designed as a Primary coordinator:
86
241
 
87
- ### Message Receive Rules
242
+ - Runs at project root (`workDir: ./`)
243
+ - `persistentSession: true` — always has a terminal
244
+ - `primary: true` — fixed session ID, gets ★ badge on node
245
+ - Orange border + ★ in preset picker (recommended for primary role)
88
246
 
89
- When a message arrives at an agent's inbox:
247
+ ### Lead SOP
90
248
 
91
- 1. **Tickets** always accepted (with retry limit check)
92
- 2. **Notification with causedBy matching own outbox** accepted (response to my request)
93
- 3. **Notification from downstream agent** silently discarded (prevents reverse flow)
94
- 4. **Notification from upstream or no causedBy** accepted (normal DAG flow)
249
+ 1. **Intake**: Read Workspace Team, classify requirement, route by team composition
250
+ 2. **Delegate**: `create_request` for each module with testable `acceptance_criteria`
251
+ 3. **Cover Gaps**: If a role is missing (no Engineer/QA/Reviewer), handle it yourself
252
+ 4. **Monitor**: `get_status` + `list_requests` to unblock stuck agents
253
+ 5. **Quality Gate**: Verify all requests done/approved/passed before declaring complete
95
254
 
96
- ### Message Status Flow
255
+ ### Gap Coverage
97
256
 
98
- `pending` `running` `done` / `failed`
257
+ | Missing Role | Lead Does |
258
+ |--------------|-----------|
259
+ | PM/Architect | Break requirements into modules with acceptance_criteria |
260
+ | Engineer | Implement code, update_response(section: engineer) |
261
+ | QA | Write/run tests, update_response(section: qa) |
262
+ | Reviewer | Review code for quality/security, update_response(section: review) |
99
263
 
100
- - Only one message processed at a time per agent
101
- - `currentMessageId` persisted in agent state for crash recovery
264
+ ## Message Bus
102
265
 
103
- ## Manual Mode
266
+ Two message categories:
104
267
 
105
- Click the **⌨️** button on any smith to open a terminal:
106
- - Mode switches to `manual` (purple indicator on node)
107
- - Inbox message processing pauses (messages stay pending)
108
- - A tmux session opens with CLI + profile env + forge env vars (`FORGE_AGENT_ID`, `FORGE_WORKSPACE_ID`, `FORGE_PORT`)
109
- - Forge Skills auto-installed for inter-agent communication
110
- - Close terminal → mode returns to `auto`, pending messages resume processing
268
+ | Category | Direction | Use Case |
269
+ |----------|-----------|----------|
270
+ | **Notification** | DAG-based (upstream downstream) | "I'm done, here's what I did" |
271
+ | **Direct Message** | Any direction | Questions, bug reports, coordination |
111
272
 
112
- ### Forge Skills in Terminal
273
+ ### Notification Flow
113
274
 
114
- | Skill | Description |
275
+ - When agent completes, system broadcasts `task_complete` to all downstream agents
276
+ - Downstream uses `causedBy` field to trace which inbox message triggered their run
277
+ - Messages from downstream → discarded (prevents reverse loops)
278
+
279
+ ### Inbox Management
280
+
281
+ Each smith has an inbox panel with:
282
+ - **Inbox tab**: incoming messages with status (pending/running/done/failed)
283
+ - **Outbox tab**: sent messages with delivery status
284
+ - **Batch operations**: select all completed → bulk delete, or abort all pending
285
+
286
+ ## Plugins (MCP Plugin System)
287
+
288
+ Smiths can use MCP plugins for extended capabilities.
289
+
290
+ ### Built-in Plugin Types
291
+
292
+ | Plugin | Description |
293
+ |--------|-------------|
294
+ | `playwright` | Browser automation — test, screenshot, navigate |
295
+ | `shell-command` | Execute custom shell commands |
296
+ | `llm-vision` | Send screenshots to LLM for visual evaluation |
297
+
298
+ ### Using Plugins in a Smith
299
+
300
+ 1. In Settings → Plugins, install plugin definitions
301
+ 2. Create plugin instances (configure endpoints, credentials)
302
+ 3. In Add Agent modal, select which instances this smith can access
303
+ 4. Smith calls `run_plugin(plugin: "<instance-id>", action: "<action>", params: {...})`
304
+
305
+ ### Recommended Plugins per Preset
306
+
307
+ - **QA**: `playwright` (e2e testing)
308
+ - **UI Designer**: `playwright` + `shell-command` (screenshots)
309
+ - **Design Evaluator**: `playwright` + `llm-vision` (visual scoring)
310
+ - **Lead**: `playwright` + `shell-command` (fallback for any role)
311
+
312
+ ## Terminal Mode (Manual)
313
+
314
+ Click **⌨️** on any smith to open a terminal session:
315
+
316
+ - tmux session opens with CLI + env vars (`FORGE_AGENT_ID`, `FORGE_WORKSPACE_ID`, `FORGE_PORT`)
317
+ - Forge Skills available: `/forge-send`, `/forge-inbox`, `/forge-status`, `/forge-workspace-sync`
318
+ - Session Picker: choose new session, continue existing, or browse all Claude sessions
319
+ - Close terminal → smith returns to auto mode, pending messages resume
320
+
321
+ ## Watch (Autonomous Monitoring)
322
+
323
+ Agents can monitor file/git/command changes without message-driven triggers.
324
+
325
+ ### Configuration
326
+
327
+ | Field | Description |
115
328
  |-------|-------------|
116
- | `/forge-send` | Send a message to another smith (blocked if replying to current sender — use for NEW issues only) |
117
- | `/forge-inbox` | Check incoming messages |
118
- | `/forge-status` | Check all smiths' status |
119
- | `/forge-workspace-sync` | Sync progress back to workspace |
329
+ | **Interval** | Check frequency in seconds (min 10, default 60) |
330
+ | **Debounce** | Minimum seconds between alerts (default 10) |
331
+ | **Targets** | What to watch (multiple allowed) |
332
+ | **On Change** | Action: `log`, `analyze`, `approve`, or `send_message` |
120
333
 
121
- **Note**: When processing a message from another agent, do NOT use `/forge-send` to reply — the system auto-delivers results via `markMessageDone`. Only use `/forge-send` for new issues to other agents.
334
+ ### Target Types
335
+
336
+ | Type | Description |
337
+ |------|-------------|
338
+ | `Directory` | File mtime changes in a project folder |
339
+ | `Git` | New commits via HEAD hash comparison |
340
+ | `Agent Output` | Another agent's declared output paths |
341
+ | `Agent Log` | Another agent's log file with optional keyword filter |
342
+ | `Session Output` | Claude session tail output |
343
+ | `Command` | Run a shell command, detect output changes |
344
+ | `Agent Status` | Another agent's smithStatus/taskStatus changes |
122
345
 
123
- ## Inbox Management
346
+ ### Watch Actions
124
347
 
125
- Each smith has an inbox panel with two tabs:
348
+ | Action | Behavior |
349
+ |--------|----------|
350
+ | `Log` | Write alert to agent log (no token cost) |
351
+ | `Analyze` | Auto-wake agent to analyze changes (costs tokens) |
352
+ | `Approve` | Create pending approval, user decides |
353
+ | `Send Message` | Send alert to specified agent |
126
354
 
127
- ### Inbox Tab
128
- - Messages received from other smiths
129
- - Status badges: pending (yellow), running (blue), done (green), failed (red)
130
- - Ticket messages have purple border + TICKET badge + lifecycle status
131
- - CausedBy trace shows which agent triggered the message
355
+ ## Mascot Animations (Visual Flair)
132
356
 
133
- ### Outbox Tab
134
- - Messages sent by this smith
135
- - Track delivery status and responses
357
+ Each smith can display an animated companion character next to its node.
136
358
 
137
- ### Batch Operations
138
- - **Select all completed** → batch delete done/failed messages
139
- - **Abort all pending (N)** → cancel all pending messages at once
140
- - Checkbox selection on individual done/failed messages
359
+ **Themes**: Stick figure, Cat, Dog, Pig, Emoji, Off (default)
360
+
361
+ - Theme picker in workspace header
362
+ - Animates based on smith state (idle/running/done/failed/sleeping)
363
+ - Persists to localStorage (`forge.mascotTheme`)
364
+ - Done state plays celebration 2x then settles quietly
141
365
 
142
366
  ## Controls
143
367
 
144
368
  | Action | Description |
145
369
  |--------|-------------|
146
- | **Start** | Launch daemon, begin executing all agents |
147
- | **Stop** | Stop daemon, kill all workers |
148
- | **Pause** | Pause a specific smith (stops consuming messages) |
149
- | **Resume** | Resume a paused smith |
150
- | **Retry** | Retry a failed smith |
151
- | **Reset** | Reset smith to idle, clear history |
152
- | **Open Terminal** | Switch to manual mode, open floating terminal |
153
- | **Close Terminal** | Return to auto mode, resume message processing |
370
+ | **Start Daemon** | Launch all smiths, begin consuming messages |
371
+ | **Stop Daemon** | Stop all smiths, kill workers |
372
+ | **Run All** | Trigger all runnable agents once |
373
+ | **Run** | Trigger specific agent |
374
+ | **Pause/Resume** | Pause/resume message consumption for one agent |
375
+ | **Mark Done/Failed/Idle** | Manually set task status |
376
+ | **Retry** | Re-run a failed agent from checkpoint |
377
+ | **Open Terminal** | Enter manual mode with tmux session |
378
+ | **Remove** | Delete agent (cascades — cleans dangling dependsOn) |
154
379
 
155
380
  ## Workspace API
156
381
 
382
+ ### HTTP Endpoints
383
+
157
384
  ```bash
158
385
  # List workspaces
159
386
  curl http://localhost:8403/api/workspace
160
387
 
161
- # Get workspace state
162
- curl http://localhost:8403/api/workspace/<id>
388
+ # Find by project path
389
+ curl "http://localhost:8403/api/workspace?projectPath=/path/to/project"
163
390
 
164
- # Agent operations
165
- curl -X POST http://localhost:8403/api/workspace/<id>/agents \
166
- -H 'Content-Type: application/json' \
167
- -d '{"action":"start"}' # start daemon
168
- -d '{"action":"stop"}' # stop daemon
169
- -d '{"action":"run", "agentId":"engineer-123"}' # run one smith
170
- -d '{"action":"open_terminal", "agentId":"engineer-123"}' # manual mode
171
- -d '{"action":"close_terminal", "agentId":"engineer-123"}' # back to auto
172
- -d '{"action":"reset", "agentId":"engineer-123"}' # reset to idle
173
-
174
- # Smith API (via workspace daemon)
175
- curl -X POST http://localhost:8403/api/workspace/<id>/smith \
391
+ # Export workspace as template
392
+ curl "http://localhost:8403/api/workspace?export=<workspaceId>"
393
+
394
+ # Import template
395
+ curl -X POST http://localhost:8403/api/workspace \
176
396
  -H 'Content-Type: application/json' \
177
- -d '{"action":"send","agentId":"$ID","to":"QA","msgAction":"review","content":"Please check"}'
178
- -d '{"action":"inbox","agentId":"$ID"}'
179
- -d '{"action":"status","agentId":"$ID"}'
180
- -d '{"action":"create_ticket","agentId":"$FROM","targetId":"$TO","content":"Bug found"}'
181
- -d '{"action":"update_ticket","messageId":"$ID","ticketStatus":"fixed"}'
397
+ -d '{"projectPath":"...","projectName":"...","template":{...}}'
398
+
399
+ # Delete workspace
400
+ curl -X DELETE "http://localhost:8403/api/workspace?id=<workspaceId>"
401
+ ```
402
+
403
+ ### Agent Operations
404
+
405
+ ```bash
406
+ POST /api/workspace/<id>/agents
407
+ {
408
+ "action": "add", # create agent
409
+ "config": {...}
410
+ }
411
+ {
412
+ "action": "update", # update agent
413
+ "agentId": "...",
414
+ "config": {...}
415
+ }
416
+ {
417
+ "action": "remove", # remove agent
418
+ "agentId": "..."
419
+ }
420
+ {
421
+ "action": "start_daemon" # start all smiths
422
+ }
423
+ {
424
+ "action": "stop_daemon" # stop all smiths
425
+ }
426
+ {
427
+ "action": "run", # trigger one agent
428
+ "agentId": "..."
429
+ }
430
+ {
431
+ "action": "mark_done", # manual status
432
+ "agentId": "...",
433
+ "notify": true # also send downstream notifications
434
+ }
435
+ ```
182
436
 
183
- # Stream real-time events (SSE)
437
+ ### Streaming Events (SSE)
438
+
439
+ ```bash
184
440
  curl http://localhost:8403/api/workspace/<id>/stream
185
441
  ```
186
442
 
187
- ## Watch (Autonomous Monitoring)
443
+ Events: `agents_changed`, `task_status`, `smith_status`, `log`, `bus_message`, `workspace_complete`, `watch_alert`.
188
444
 
189
- Agents can autonomously monitor file changes, git commits, or custom commands without relying on messages.
445
+ ## Timeouts & Session Monitor
190
446
 
191
- ### Configuration
447
+ A background session monitor polls each agent's Claude session file:
192
448
 
193
- In the agent config modal, enable Watch and configure:
194
- - **Interval**: Check frequency in seconds (min 10, default 60)
195
- - **Targets**: What to monitor
196
- - `Directory` select from project folders, detect file mtime changes
197
- - `Git` detect new commits via HEAD hash comparison
198
- - `Agent Output` — monitor another agent's declared output paths
199
- - `Command` — run a shell command, detect output changes
200
- - **On Change**: Action when changes detected
201
- - `Log` — write to agent log only (default, no token cost)
202
- - `Analyze` — auto-wake agent to analyze changes (costs tokens)
203
- - `Approve` — create pending approval, user decides whether to trigger
449
+ | Threshold | Behavior |
450
+ |-----------|----------|
451
+ | **File change** | → `running` (mtime/size changed) |
452
+ | **19 min stable** | Check for `result` entry in session file mark `done` if found |
453
+ | **20 min stable** | Force `done` (fallback if Stop hook missed) |
204
454
 
205
- ### Watch Behavior
455
+ The Stop hook (installed in `~/.claude/settings.json`) triggers `done` immediately when Claude Code finishes a turn.
206
456
 
207
- - First check builds a baseline (no alert)
208
- - Subsequent checks compare timestamps — only files modified since last check are reported
209
- - No-change heartbeats log to console only (not to files)
210
- - Change alerts write to `logs.jsonl` and appear in Log panel
211
- - Watch never sends bus messages — report only, no auto-triggering other agents
457
+ ## Persistence
212
458
 
213
- ## Agent Logs
459
+ - **Workspace state**: `~/.forge/workspaces/<id>/state.json` (atomic writes, auto-save every 10s)
460
+ - **Agent logs**: `~/.forge/workspaces/<id>/agents/<agentId>/logs.jsonl` (append-only)
461
+ - **Smith templates**: `~/.forge/data/smith-templates/*.json`
462
+ - **Request documents**: `<project>/.forge/requests/REQ-*/` (request.yml + response.yml)
463
+ - **Agent context**: `<project>/<workDir>/.forge/agent-context.json` (read by Stop hook)
214
464
 
215
- Each agent has a persistent log file (`logs.jsonl`) that survives daemon restarts and agent re-execution.
465
+ ## Complete WorkspaceAgentConfig Schema
216
466
 
217
- - **Log panel**: Click the log button on any agent node to view
218
- - **Persistent**: Logs are append-only, not cleared on reset or re-run
219
- - **Clear**: Use the "Clear" button in the Log panel header to manually wipe logs
220
- - **Content**: Execution output, watch alerts, bus message receipts, system events
467
+ Use this exact JSON structure when calling `POST /api/workspace/<id>/agents` with `action: "add"` or `action: "update"`.
221
468
 
222
- ## Forge Skills (Terminal Communication)
469
+ ```json
470
+ {
471
+ "id": "engineer-1775268642253",
472
+ "label": "Engineer",
473
+ "icon": "🔨",
474
+ "type": "agent",
475
+ "primary": false,
476
+ "backend": "cli",
477
+ "agentId": "claude",
478
+ "provider": null,
479
+ "model": null,
480
+ "dependsOn": ["input-1775268600000", "pm-1775268620946"],
481
+ "workDir": "./src",
482
+ "outputs": ["src/", "docs/architecture/"],
483
+ "steps": [
484
+ { "id": "claim", "label": "Find & Claim", "prompt": "Read Workspace Team..." },
485
+ { "id": "design", "label": "Design", "prompt": "get_request for details..." },
486
+ { "id": "implement", "label": "Implement", "prompt": "Implement per design..." },
487
+ { "id": "report", "label": "Report Done", "prompt": "update_response..." }
488
+ ],
489
+ "role": "Senior Software Engineer. Context auto-includes Workspace Team...",
490
+ "persistentSession": true,
491
+ "skipPermissions": true,
492
+ "requiresApproval": false,
493
+ "plugins": ["playwright-main"],
494
+ "watch": {
495
+ "enabled": false,
496
+ "interval": 60,
497
+ "targets": [],
498
+ "action": "log",
499
+ "prompt": "",
500
+ "sendTo": ""
501
+ }
502
+ }
503
+ ```
223
504
 
224
- When in manual mode, agents have forge env vars injected (`FORGE_AGENT_ID`, `FORGE_WORKSPACE_ID`, `FORGE_PORT`) and can use:
505
+ ### Field Reference
506
+
507
+ | Field | Type | Required | Default | Description |
508
+ |-------|------|----------|---------|-------------|
509
+ | `id` | string | yes (for update/remove) | auto | Format: `{label-lower}-{timestamp}` |
510
+ | `label` | string | yes | — | Display name, must be unique in workspace |
511
+ | `icon` | string | yes | `🤖` | Emoji icon |
512
+ | `type` | string | yes | `agent` | `agent` or `input` |
513
+ | `primary` | boolean | no | false | Only one per workspace, workDir forced to `./` |
514
+ | `backend` | string | yes | `cli` | `cli` (subscription) or `api` (api key) |
515
+ | `agentId` | string | cli only | `claude` | Agent ID from Settings → Agents (e.g. `claude`, `codex`, `aider`) |
516
+ | `provider` | string | api only | — | e.g. `anthropic` |
517
+ | `model` | string | no | — | Model override (e.g. `claude-sonnet-4-6`) |
518
+ | `dependsOn` | string[] | yes | `[]` | Upstream agent IDs (DAG edges) |
519
+ | `workDir` | string | yes | `./` | Relative path from project root, must be unique |
520
+ | `outputs` | string[] | yes | `[]` | Expected output paths (informational) |
521
+ | `steps` | object[] | yes | `[]` | `{id, label, prompt}[]` |
522
+ | `role` | string | yes | — | System prompt, synced to `CLAUDE.md` in workDir |
523
+ | `persistentSession` | boolean | no | false | Keep tmux+CLI alive (required for primary) |
524
+ | `skipPermissions` | boolean | no | true | `--dangerously-skip-permissions` for Claude Code |
525
+ | `requiresApproval` | boolean | no | false | User approves each inbox message |
526
+ | `plugins` | string[] | no | — | Plugin instance IDs |
527
+ | `watch` | object | no | — | Watch config (see Watch section) |
528
+
529
+ ### Watch Config Schema
225
530
 
226
- | Skill | Description |
227
- |-------|-------------|
228
- | `/forge-send` | Send a message to another smith |
229
- | `/forge-inbox` | Check incoming messages |
230
- | `/forge-status` | Check all smiths' status |
231
- | `/forge-workspace-sync` | Sync progress back to workspace |
531
+ ```json
532
+ {
533
+ "enabled": true,
534
+ "interval": 60,
535
+ "targets": [
536
+ { "type": "directory", "path": "src/", "debounce": 10 },
537
+ { "type": "git", "debounce": 10 },
538
+ { "type": "agent_status", "path": "engineer-1234", "pattern": "done" },
539
+ { "type": "command", "cmd": "npm test", "debounce": 10 },
540
+ { "type": "agent_log", "path": "qa-5678", "pattern": "error" },
541
+ { "type": "agent_output", "path": "pm-9012" },
542
+ { "type": "session", "path": "engineer-1234" }
543
+ ],
544
+ "action": "log",
545
+ "prompt": "Analyze and report",
546
+ "sendTo": "engineer-1234"
547
+ }
548
+ ```
232
549
 
233
- **Send protection**: If an agent is currently processing a message from another agent, `/forge-send` to that agent is blocked (returns `skipped: true`). Results are delivered automatically via the message system. Only use `/forge-send` for new issues to other agents.
550
+ - `action` values: `log` | `analyze` | `approve` | `send_message`
551
+ - `sendTo` is required only when `action: "send_message"`
234
552
 
235
- ## Persistence
553
+ ## Complete Recipes
554
+
555
+ ### Authentication (Required for API Calls)
556
+
557
+ ```bash
558
+ # Ask user for admin password, then:
559
+ TOKEN=$(curl -s -X POST http://localhost:8403/api/auth/verify \
560
+ -H "Content-Type: application/json" \
561
+ -d '{"password":"USER_PASSWORD"}' | python3 -c "import sys,json; print(json.load(sys.stdin).get('token',''))")
562
+
563
+ # Use token in all subsequent requests:
564
+ # curl -H "X-Forge-Token: $TOKEN" ...
565
+ ```
566
+
567
+ ### Recipe 1: Create Workspace + Add Lead + Start Daemon
568
+
569
+ ```bash
570
+ # 1. Create workspace
571
+ WS=$(curl -s -X POST http://localhost:8403/api/workspace \
572
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
573
+ -d '{"projectPath":"/Users/me/projects/my-app","projectName":"my-app"}' \
574
+ | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
575
+
576
+ # 2. Add Input node (where user requirements go)
577
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
578
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
579
+ -d '{
580
+ "action": "add",
581
+ "config": {
582
+ "id": "input-'$(date +%s%N)'",
583
+ "label": "Requirements",
584
+ "icon": "📝",
585
+ "type": "input",
586
+ "backend": "cli",
587
+ "dependsOn": [],
588
+ "outputs": [],
589
+ "steps": [],
590
+ "role": "",
591
+ "content": "",
592
+ "entries": []
593
+ }
594
+ }'
595
+
596
+ # 3. Add Lead (Primary coordinator)
597
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
598
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
599
+ -d '{
600
+ "action": "add",
601
+ "config": {
602
+ "id": "lead-'$(date +%s%N)'",
603
+ "label": "Lead",
604
+ "icon": "👑",
605
+ "type": "agent",
606
+ "primary": true,
607
+ "backend": "cli",
608
+ "agentId": "claude",
609
+ "dependsOn": [],
610
+ "workDir": "./",
611
+ "outputs": ["docs/lead/"],
612
+ "persistentSession": true,
613
+ "skipPermissions": true,
614
+ "plugins": [],
615
+ "role": "You are the Lead — primary coordinator...",
616
+ "steps": [
617
+ {"id": "intake", "label": "Intake", "prompt": "Read Workspace Team..."},
618
+ {"id": "delegate", "label": "Delegate", "prompt": "create_request for each task..."},
619
+ {"id": "monitor", "label": "Monitor", "prompt": "get_status + list_requests..."}
620
+ ]
621
+ }
622
+ }'
623
+
624
+ # 4. Start daemon
625
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
626
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
627
+ -d '{"action": "start_daemon"}'
628
+ ```
629
+
630
+ ### Recipe 2: Add a Full Dev Team (Lead + Engineer + QA + Reviewer)
631
+
632
+ ```bash
633
+ TS=$(date +%s%N)
634
+ INPUT_ID="input-$TS"
635
+ LEAD_ID="lead-$TS"
636
+ ENG_ID="engineer-$TS"
637
+ QA_ID="qa-$TS"
638
+ REV_ID="reviewer-$TS"
639
+
640
+ # Input
641
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
642
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
643
+ -d "{\"action\":\"add\",\"config\":{\"id\":\"$INPUT_ID\",\"label\":\"Requirements\",\"icon\":\"📝\",\"type\":\"input\",\"backend\":\"cli\",\"dependsOn\":[],\"outputs\":[],\"steps\":[],\"role\":\"\",\"content\":\"\",\"entries\":[]}}"
644
+
645
+ # Lead (depends on Input)
646
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
647
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
648
+ -d "{\"action\":\"add\",\"config\":{\"id\":\"$LEAD_ID\",\"label\":\"Lead\",\"icon\":\"👑\",\"type\":\"agent\",\"primary\":true,\"backend\":\"cli\",\"agentId\":\"claude\",\"dependsOn\":[\"$INPUT_ID\"],\"workDir\":\"./\",\"outputs\":[\"docs/lead/\"],\"persistentSession\":true,\"skipPermissions\":true,\"role\":\"Lead coordinator\",\"steps\":[{\"id\":\"plan\",\"label\":\"Plan\",\"prompt\":\"Coordinate the team\"}]}}"
649
+
650
+ # Engineer (depends on Lead)
651
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
652
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
653
+ -d "{\"action\":\"add\",\"config\":{\"id\":\"$ENG_ID\",\"label\":\"Engineer\",\"icon\":\"🔨\",\"type\":\"agent\",\"backend\":\"cli\",\"agentId\":\"claude\",\"dependsOn\":[\"$LEAD_ID\"],\"workDir\":\"./src\",\"outputs\":[\"src/\"],\"persistentSession\":true,\"skipPermissions\":true,\"role\":\"Engineer\",\"steps\":[{\"id\":\"impl\",\"label\":\"Implement\",\"prompt\":\"Write code\"}]}}"
654
+
655
+ # QA (depends on Engineer)
656
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
657
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
658
+ -d "{\"action\":\"add\",\"config\":{\"id\":\"$QA_ID\",\"label\":\"QA\",\"icon\":\"🧪\",\"type\":\"agent\",\"backend\":\"cli\",\"agentId\":\"claude\",\"dependsOn\":[\"$ENG_ID\"],\"workDir\":\"./qa\",\"outputs\":[\"tests/\"],\"persistentSession\":true,\"skipPermissions\":true,\"plugins\":[\"playwright-main\"],\"role\":\"QA\",\"steps\":[{\"id\":\"test\",\"label\":\"Test\",\"prompt\":\"Write and run tests\"}]}}"
659
+
660
+ # Reviewer (depends on Engineer + QA)
661
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
662
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
663
+ -d "{\"action\":\"add\",\"config\":{\"id\":\"$REV_ID\",\"label\":\"Reviewer\",\"icon\":\"🔍\",\"type\":\"agent\",\"backend\":\"cli\",\"agentId\":\"claude\",\"dependsOn\":[\"$ENG_ID\",\"$QA_ID\"],\"workDir\":\"./review\",\"outputs\":[\"docs/review/\"],\"persistentSession\":true,\"skipPermissions\":true,\"role\":\"Reviewer\",\"steps\":[{\"id\":\"review\",\"label\":\"Review\",\"prompt\":\"Review code\"}]}}"
664
+ ```
665
+
666
+ ### Recipe 3: Submit Input and Run
667
+
668
+ ```bash
669
+ # Send requirement text to Input node
670
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
671
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
672
+ -d "{\"action\":\"complete_input\",\"agentId\":\"$INPUT_ID\",\"content\":\"Build a login page with email/password.\"}"
673
+
674
+ # Trigger Lead to start
675
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
676
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
677
+ -d "{\"action\":\"run\",\"agentId\":\"$LEAD_ID\"}"
678
+ ```
679
+
680
+ ### Recipe 4: Save a Smith as Template + Import Later
681
+
682
+ ```bash
683
+ # Save current agent config as template
684
+ curl -s -X POST http://localhost:8403/api/smith-templates \
685
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
686
+ -d '{
687
+ "name": "My Engineer",
688
+ "icon": "🔨",
689
+ "description": "Custom engineer with TDD preference",
690
+ "config": {
691
+ "label": "Engineer",
692
+ "icon": "🔨",
693
+ "backend": "cli",
694
+ "agentId": "claude",
695
+ "workDir": "./src",
696
+ "outputs": ["src/"],
697
+ "role": "Engineer with TDD approach...",
698
+ "steps": [...],
699
+ "persistentSession": true,
700
+ "plugins": ["playwright-main"]
701
+ }
702
+ }'
703
+
704
+ # List templates
705
+ curl -s http://localhost:8403/api/smith-templates -H "X-Forge-Token: $TOKEN"
706
+
707
+ # When adding agent, reuse saved template's config field
708
+ ```
709
+
710
+ ### Recipe 5: Configure Watch on an Agent
711
+
712
+ ```bash
713
+ # Update agent to watch the src/ directory and analyze on changes
714
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
715
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
716
+ -d "{
717
+ \"action\":\"update\",
718
+ \"agentId\":\"$REV_ID\",
719
+ \"config\": {
720
+ \"id\":\"$REV_ID\",
721
+ \"label\":\"Reviewer\",
722
+ ... (all existing fields)
723
+ \"watch\": {
724
+ \"enabled\": true,
725
+ \"interval\": 60,
726
+ \"targets\": [
727
+ {\"type\":\"directory\",\"path\":\"src/\",\"debounce\":10}
728
+ ],
729
+ \"action\": \"analyze\",
730
+ \"prompt\": \"Review recent changes for quality issues\"
731
+ }
732
+ }
733
+ }"
734
+ ```
735
+
736
+ ### Recipe 6: Install a Plugin Instance
737
+
738
+ ```bash
739
+ # List available plugin definitions
740
+ curl -s http://localhost:8403/api/plugins -H "X-Forge-Token: $TOKEN"
741
+
742
+ # Install a plugin instance (e.g., playwright)
743
+ curl -s -X POST http://localhost:8403/api/plugins \
744
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
745
+ -d '{
746
+ "action": "install",
747
+ "id": "playwright",
748
+ "config": {
749
+ "instanceName": "playwright-main"
750
+ }
751
+ }'
752
+
753
+ # List installed instances
754
+ curl -s "http://localhost:8403/api/plugins?installed=true" -H "X-Forge-Token: $TOKEN"
755
+ ```
756
+
757
+ ### Recipe 7: Query Workspace State
758
+
759
+ ```bash
760
+ # List all workspaces
761
+ curl -s http://localhost:8403/api/workspace -H "X-Forge-Token: $TOKEN"
762
+
763
+ # Get full workspace state (agents + states + bus)
764
+ curl -s "http://localhost:8403/api/workspace?projectPath=/Users/me/projects/my-app" \
765
+ -H "X-Forge-Token: $TOKEN"
766
+
767
+ # Get live agent list
768
+ curl -s "http://localhost:8403/api/workspace/$WS/agents" -H "X-Forge-Token: $TOKEN"
769
+
770
+ # Stream SSE events (runs forever, use Ctrl+C to stop)
771
+ curl -N "http://localhost:8403/api/workspace/$WS/stream" -H "X-Forge-Token: $TOKEN"
772
+ ```
773
+
774
+ ### Recipe 8: Remove Agent / Workspace
775
+
776
+ ```bash
777
+ # Remove an agent (non-primary only)
778
+ curl -s -X POST "http://localhost:8403/api/workspace/$WS/agents" \
779
+ -H "Content-Type: application/json" -H "X-Forge-Token: $TOKEN" \
780
+ -d "{\"action\":\"remove\",\"agentId\":\"$REV_ID\"}"
781
+
782
+ # Delete entire workspace
783
+ curl -s -X DELETE "http://localhost:8403/api/workspace?id=$WS" \
784
+ -H "X-Forge-Token: $TOKEN"
785
+ ```
786
+
787
+ ## Common Pitfalls
236
788
 
237
- - Workspace state: `~/.forge/workspaces/<id>/state.json`
238
- - Agent logs: `~/.forge/workspaces/<id>/agents/<agentId>/logs.jsonl`
239
- - Auto-saved every 10 seconds
240
- - Atomic writes (temp file rename) for crash safety
241
- - Synchronous save on daemon shutdown
242
- - `currentMessageId` persisted per agent for crash recovery
789
+ | Problem | Cause | Solution |
790
+ |---------|-------|----------|
791
+ | "Work directory conflict" | Two agents use same `workDir` | Each non-input smith must have unique workDir |
792
+ | "Cycle detected in dependencies" | `dependsOn` creates a loop | Review DAG, break the cycle |
793
+ | "Primary already set" | Trying to add 2nd primary smith | Only one primary per workspace |
794
+ | Daemon won't start | No primary agent, or config errors | Check logs at `~/.forge/data/forge.log` |
795
+ | Agent stuck in `running` | Stop hook didn't fire | 20-min auto timeout will kick in; or manual mark_done |
796
+ | Hook not firing | `.forge/agent-context.json` missing | Restart daemon to re-inject |
797
+ | `agentId` not found | CLI/profile deleted from Settings | Update agent config with valid agentId |
243
798
 
244
799
  ## Tips
245
800
 
246
- 1. **Dependencies must be a DAG** — no circular dependencies allowed
247
- 2. **Start with Input nodes** — define requirements before adding agent smiths
248
- 3. **Use profiles** for agents that need custom API endpoints or models
249
- 4. **Notifications flow downstream** — upstream agents won't receive downstream broadcasts
250
- 5. **Use tickets for bugs** — tickets ignore DAG direction, have retry limits
251
- 6. **Open Terminal** for manual interventionmode switches to manual, inbox pauses
252
- 7. **Use Watch for monitoring** — detect file changes without message overhead (set action to `log` to avoid token costs)
253
- 8. **Check Log panel** for execution history and watch alerts logs persist across restarts
254
- 9. **Batch operations** select all completed messages for bulk delete, or abort all pending at once
801
+ 1. **Start with a Lead** — add Lead first as Primary, then add specialists (Engineer, QA, etc.)
802
+ 2. **Dependencies must be DAG** — no cycles allowed
803
+ 3. **Use request documents** don't rely on loose `send_message` for delegation
804
+ 4. **Trust the topology** — agents auto-see the team in their context, no redundant `get_agents` calls needed
805
+ 5. **Let Lead cover gaps** — don't add roles you don't need, Lead handles missing ones
806
+ 6. **Use Watch for passive monitoring**avoid token costs with `action: log`
807
+ 7. **Save useful smiths as templates** — 💾 button reusable across workspaces
808
+ 8. **Use Terminal mode** for debugging interact with a smith directly
809
+ 9. **Check session logs** if a smith seems stuck `~/.claude/projects/<encoded-path>/<sessionId>.jsonl`
810
+ 10. **20-min timeout is a safety net** — if Stop hook fires normally, task is marked done immediately