agent-worker 0.2.0 → 0.4.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # agent-worker
2
2
 
3
- CLI and SDK for creating and managing AI agent sessions with multiple backends.
3
+ CLI and SDK for running AI agents from standalone instances to collaborative workflows.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,244 +10,385 @@ npm install -g agent-worker
10
10
  bun add -g agent-worker
11
11
  ```
12
12
 
13
- ## CLI Usage
13
+ ## Two Modes of Operation
14
14
 
15
- ### Session Management
15
+ agent-worker supports two distinct usage patterns:
16
16
 
17
- ```bash
18
- # Create a session (SDK backend, default)
19
- agent-worker session new -m anthropic/claude-sonnet-4-5
20
-
21
- # Create with system prompt
22
- agent-worker session new -s "You are a code reviewer."
17
+ | Mode | Use Case | Entry Point | Coordination |
18
+ |------|----------|-------------|--------------|
19
+ | **Agent** | Single AI assistant | CLI commands | Direct interaction |
20
+ | **Workflow** | Multi-agent collaboration | YAML workflow file | @mention-based |
23
21
 
24
- # Create with system prompt from file
25
- agent-worker session new -f ./prompts/reviewer.txt
22
+ ---
26
23
 
27
- # Create named session
28
- agent-worker session new -n my-session
24
+ ## 🤖 Agent Mode
29
25
 
30
- # Create with Claude CLI backend
31
- agent-worker session new -b claude
26
+ **Run individual AI agents as standalone instances.**
32
27
 
33
- # List all sessions
34
- agent-worker session list
28
+ Perfect for: testing, prototyping, interactive Q&A, code assistance.
35
29
 
36
- # Switch default session
37
- agent-worker session use my-session
30
+ ### Quick Start
38
31
 
39
- # Check session status
40
- agent-worker session status
32
+ ```bash
33
+ # Start an agent
34
+ agent-worker new alice -m anthropic/claude-sonnet-4-5
41
35
 
42
- # End session
43
- agent-worker session end
36
+ # Send a message
37
+ agent-worker send alice "Analyze this codebase"
44
38
 
45
- # End specific session
46
- agent-worker session end my-session
39
+ # View conversation
40
+ agent-worker peek
47
41
 
48
- # End all sessions
49
- agent-worker session end --all
42
+ # Check status
43
+ agent-worker status alice
50
44
  ```
51
45
 
52
- ### Sending Messages
46
+ ### Organizing Agents
47
+
48
+ Agents can be grouped into **workflows** by defining them in YAML:
49
+
50
+ ```yaml
51
+ # review.yaml
52
+ agents:
53
+ reviewer:
54
+ backend: claude
55
+ system_prompt: You are a code reviewer.
56
+
57
+ coder:
58
+ backend: cursor
59
+ system_prompt: You are a code implementer.
60
+ ```
53
61
 
54
62
  ```bash
55
- # Send to current session
56
- agent-worker send "What is 2+2?"
63
+ # Run workflow agents (workflow name from YAML)
64
+ agent-worker run review.yaml
65
+
66
+ # Send to specific agent in workflow
67
+ agent-worker send reviewer@review "Check this code"
68
+ ```
57
69
 
58
- # Send to specific session
59
- agent-worker send "Explain recursion" --to my-session
70
+ **Note**: Agent Mode (`agent-worker new`) only creates standalone agents in the global workflow. For coordinated agents in named workflows, use Workflow Mode (YAML files).
60
71
 
61
- # View conversation history
62
- agent-worker history
63
- agent-worker history --last 5
72
+ ### Multiple Instances (workflow:tag)
64
73
 
65
- # View token usage
66
- agent-worker stats
74
+ Run multiple isolated instances of the same workflow using **tags**:
67
75
 
68
- # Export transcript
69
- agent-worker export > transcript.json
76
+ ```bash
77
+ # Different PRs, isolated contexts
78
+ agent-worker run review.yaml --tag pr-123
79
+ agent-worker run review.yaml --tag pr-456
70
80
 
71
- # Clear history (keep session)
72
- agent-worker clear
81
+ # Each has its own conversation history
82
+ agent-worker send reviewer@review:pr-123 "LGTM"
83
+ agent-worker peek @review:pr-123 # Only sees pr-123 messages
73
84
  ```
74
85
 
75
- ### Tool Management (SDK Backend Only)
86
+ **Target syntax** (used in send/peek/ls/stop commands):
87
+ - `alice` → alice@global:main (standalone agent)
88
+ - `alice@review` → alice@review:main (agent in review workflow)
89
+ - `alice@review:pr-123` → full specification
90
+ - `@review` → review workflow (for broadcast or listing)
91
+ - `@review:pr-123` → specific workflow instance
92
+
93
+ ### Agent Commands
76
94
 
77
95
  ```bash
78
- # Add a tool
79
- agent-worker tool add get_weather \
80
- -d "Get weather for a location" \
81
- -p "location:string:City name"
96
+ # Lifecycle
97
+ agent-worker new <name> [options] # Create standalone agent
98
+ agent-worker stop <target> # Stop agent
99
+ agent-worker ls [target] # List agents (default: global)
100
+ agent-worker ls --all # List all agents from all workflows
101
+ agent-worker status <target> # Check agent status
102
+
103
+ # Interaction
104
+ agent-worker send <target> <message> # Send to agent or workflow
105
+ agent-worker peek [target] [options] # View messages (default: @global)
106
+
107
+ # Scheduling (periodic wakeup when idle)
108
+ agent-worker schedule <target> set <interval> [--prompt "Task"]
109
+ agent-worker schedule <target> get
110
+ agent-worker schedule <target> clear
111
+
112
+ # Shared documents
113
+ agent-worker doc read <target>
114
+ agent-worker doc write <target> --content "..."
115
+ agent-worker doc append <target> --file notes.txt
116
+
117
+ # Testing & Debugging
118
+ agent-worker mock tool <name> <response> # Mock tool response
119
+ agent-worker feedback [target] # View agent feedback/observations
120
+ ```
82
121
 
83
- # Add tool requiring approval
84
- agent-worker tool add delete_file \
85
- -d "Delete a file" \
86
- -p "path:string:File path" \
87
- --needs-approval
122
+ ### Backend Options
88
123
 
89
- # Import tools from file
90
- agent-worker tool import ./my-tools.ts
124
+ ```bash
125
+ agent-worker new alice -m anthropic/claude-sonnet-4-5 # SDK (default)
126
+ agent-worker new alice -b claude # Claude CLI
127
+ agent-worker new alice -b cursor # Cursor Agent
128
+ agent-worker new alice -b mock # Testing (no API)
129
+
130
+ # Specify tools at creation (SDK backend only)
131
+ agent-worker new alice --tool ./custom-tools.ts
132
+ agent-worker new alice --skill ./skills --tool ./tools.ts
133
+ ```
91
134
 
92
- # Mock tool response (for testing)
93
- agent-worker tool mock get_weather '{"temp": 72, "condition": "sunny"}'
135
+ ### Examples
94
136
 
95
- # List registered tools
96
- agent-worker tool list
137
+ **Quick testing without API keys:**
138
+ ```bash
139
+ agent-worker new -b mock
140
+ agent-worker send a0 "Hello"
97
141
  ```
98
142
 
99
- ### Approval Workflow
143
+ **Scheduled agent (runs every 30s when idle):**
144
+ ```bash
145
+ # Standalone agent with wakeup schedule
146
+ agent-worker new monitor --wakeup 30s --prompt "Check CI status"
100
147
 
148
+ # Or schedule existing agent
149
+ agent-worker schedule monitor set 30s --prompt "Check CI status"
150
+ ```
151
+
152
+ **Send to workflow (broadcast or @mention):**
101
153
  ```bash
102
- # Check pending approvals
103
- agent-worker pending
154
+ # Broadcast to entire workflow
155
+ agent-worker send @review "Status update"
104
156
 
105
- # Approve a tool call
106
- agent-worker approve <approval-id>
157
+ # @mention specific agents in workflow
158
+ agent-worker send @review "@alice @bob discuss this"
159
+ ```
107
160
 
108
- # Deny with reason
109
- agent-worker deny <approval-id> -r "Path not allowed"
161
+ **Feedback-enabled agent (reports observations):**
162
+ ```bash
163
+ agent-worker new -m anthropic/claude-sonnet-4-5 --feedback
110
164
  ```
111
165
 
112
- ### Agent Skills
166
+ ---
113
167
 
114
- Agent skills provide reusable instructions and methodologies that agents can access on demand. Compatible with the [Agent Skills](https://agentskills.io) ecosystem.
168
+ ## 📋 Workflow Mode
115
169
 
116
- ```bash
117
- # Load skills from default directories (.agents/skills, .claude/skills, ~/.agents/skills)
118
- agent-worker session new
170
+ **Define multi-agent collaboration through YAML workflows.**
171
+
172
+ Perfect for: structured tasks, agent orchestration, reproducible pipelines.
119
173
 
120
- # Add a specific skill directory
121
- agent-worker session new --skill ./my-skills/custom-skill
174
+ ### Quick Start
122
175
 
123
- # Scan additional directories for skills
124
- agent-worker session new --skill-dir ./team-skills --skill-dir ~/shared-skills
176
+ ```yaml
177
+ # review.yaml
178
+ agents:
179
+ reviewer:
180
+ backend: claude
181
+ system_prompt: You are a code reviewer. Provide constructive feedback.
125
182
 
126
- # Combine multiple options
127
- agent-worker session new \
128
- --skill ./my-skills/dive \
129
- --skill-dir ~/company-skills
183
+ coder:
184
+ backend: cursor
185
+ model: sonnet-4.5
186
+ system_prompt: You implement code changes based on feedback.
130
187
 
131
- # Import skills from Git repositories (temporary, session-scoped)
132
- agent-worker session new --import-skill vercel-labs/agent-skills:dive
133
- agent-worker session new --import-skill lidessen/skills:{memory,orientation}
134
- agent-worker session new --import-skill gitlab:myorg/skills@v1.0.0:custom
188
+ kickoff: |
189
+ @reviewer Review the recent changes and provide feedback.
190
+ @coder Implement the suggested improvements.
135
191
  ```
136
192
 
137
- **Import Skill Spec Format:**
193
+ ```bash
194
+ # Run once and exit
195
+ agent-worker run review.yaml
138
196
 
139
- The `--import-skill` option supports temporary skill imports from Git repositories. Skills are cloned to a session-specific temp directory and cleaned up when the session ends.
197
+ # Run and keep agents alive
198
+ agent-worker start review.yaml
140
199
 
141
- ```
142
- [provider:]owner/repo[@ref]:{skill1,skill2,...}
200
+ # Run in background
201
+ agent-worker start review.yaml --background
143
202
  ```
144
203
 
145
- Examples:
146
- - `vercel-labs/agent-skills` - Import all skills from GitHub main branch
147
- - `vercel-labs/agent-skills:dive` - Import single skill
148
- - `vercel-labs/agent-skills:{dive,memory}` - Import multiple skills (brace expansion)
149
- - `vercel-labs/agent-skills@v1.0.0:dive` - Import from specific tag/branch
150
- - `gitlab:myorg/skills:custom` - Import from GitLab
151
- - `gitee:org/repo@dev:{a,b}` - Import from Gitee dev branch
204
+ ### Workflow Instances (Tags)
152
205
 
153
- Supported providers: `github` (default), `gitlab`, `gitee`
206
+ Run the same workflow definition with different contexts:
154
207
 
155
- **Skills Support by Backend:**
156
-
157
- | Backend | Skills Support | How It Works | `--import-skill` |
158
- |---------|----------------|--------------|------------------|
159
- | **SDK** (default) | ✅ Full | Skills loaded as a tool that agents can call | ✅ Supported |
160
- | **Claude CLI** | ✅ Full | Loads from `.claude/skills/` and `~/.claude/skills/` | ⚠️ Manual install required |
161
- | **Codex CLI** | ✅ Full | Loads from `.agents/skills/`, `~/.codex/skills/`, `~/.agents/skills/` | ⚠️ Manual install required |
162
- | **Cursor CLI** | ✅ Full | Loads from `.agents/skills/` and `~/.cursor/skills/` | ⚠️ Manual install required |
208
+ ```bash
209
+ # Each PR gets its own isolated instance (workflow name from YAML)
210
+ agent-worker run review.yaml --tag pr-123
211
+ agent-worker run review.yaml --tag pr-456
212
+
213
+ # Context isolation
214
+ ├── .workflow/
215
+ │ └── review/
216
+ │ ├── pr-123/ # Independent channel + documents
217
+ │ └── pr-456/ # Independent channel + documents
218
+ ```
163
219
 
164
- **Notes:**
165
- - **SDK Backend**: Skills work through the Skills tool, allowing dynamic file reading. `--import-skill` is fully supported.
166
- - **CLI Backends** (claude, codex, cursor): Skills are loaded from filesystem locations by the CLI tool itself. To use `--import-skill` with these backends, install skills manually using `npx skills add <repo> --global`.
167
- - If you specify `--import-skill` with a CLI backend, agent-worker will show a warning and suggest using SDK backend or manual installation.
220
+ ### Workflow Structure
221
+
222
+ ```yaml
223
+ # Full workflow structure
224
+ name: code-review # Optional, defaults to filename
225
+
226
+ agents:
227
+ alice:
228
+ backend: sdk | claude | cursor | codex | mock
229
+ model: anthropic/claude-sonnet-4-5 # Required for SDK
230
+ system_prompt: |
231
+ You are Alice, a senior code reviewer.
232
+ tools: [bash, read, write] # CLI backend tool names
233
+ max_tokens: 8000
234
+ max_steps: 20
235
+
236
+ bob:
237
+ backend: claude
238
+ system_prompt_file: ./prompts/bob.txt # Load from file
239
+
240
+ # Context configuration (shared channel + documents)
241
+ context:
242
+ provider: file
243
+ config:
244
+ dir: ./.workflow/${{ workflow.name }}/${{ workflow.tag }}/ # Ephemeral
245
+ # OR
246
+ bind: ./data/${{ workflow.tag }}/ # Persistent (survives shutdown)
247
+
248
+ # Setup commands (run before kickoff)
249
+ setup:
250
+ - shell: git log --oneline -10
251
+ as: recent_commits # Store output as variable
252
+
253
+ - shell: git diff main...HEAD
254
+ as: changes
255
+
256
+ # Kickoff message (starts the workflow)
257
+ kickoff: |
258
+ @alice Review these changes:
259
+
260
+ Recent commits:
261
+ ${{ recent_commits }}
262
+
263
+ Diff:
264
+ ${{ changes }}
265
+
266
+ @bob Stand by for implementation tasks.
267
+ ```
168
268
 
169
- **Default Skill Directories:**
170
- - `.agents/skills/` - Project-level skills (all backends)
171
- - `.claude/skills/` - Claude Code project skills
172
- - `.cursor/skills/` - Cursor project skills
173
- - `~/.agents/skills/` - User-level global skills (all backends)
174
- - `~/.claude/skills/` - User-level Claude skills
175
- - `~/.codex/skills/` - User-level Codex skills
269
+ ### Workflow Commands
176
270
 
177
- **Using Skills in Sessions:**
271
+ ```bash
272
+ # Execution (workflow name inferred from YAML)
273
+ agent-worker run <file> [--tag tag] [--json] # Run once
274
+ agent-worker start <file> [--tag tag] # Keep alive
275
+ agent-worker start <file> --background # Daemon mode
276
+ agent-worker stop @<workflow:tag> # Stop workflow
277
+
278
+ # Monitoring
279
+ agent-worker ls @<workflow:tag> # List agents in workflow
280
+ agent-worker peek @<workflow:tag> # View channel messages
281
+ agent-worker doc read @<workflow:tag> # Read shared document
282
+
283
+ # Debug
284
+ agent-worker run <file> --debug # Show internal logs
285
+ agent-worker run <file> --feedback # Enable observation tool
286
+ ```
178
287
 
179
- Once loaded, agents can interact with skills via the `Skills` tool:
288
+ ### Variable Interpolation
180
289
 
181
- ```typescript
182
- // List available skills
183
- Skills({ operation: 'list' })
290
+ Templates support `${{ variable }}` syntax:
184
291
 
185
- // View a skill's complete instructions
186
- Skills({ operation: 'view', skillName: 'dive' })
292
+ ```yaml
293
+ setup:
294
+ - shell: echo "pr-${{ env.PR_NUMBER }}"
295
+ as: branch_name
187
296
 
188
- // Read skill reference files
189
- Skills({
190
- operation: 'readFile',
191
- skillName: 'dive',
192
- filePath: 'references/search-strategies.md'
193
- })
297
+ kickoff: |
298
+ Workflow: ${{ workflow.name }}
299
+ Tag: ${{ workflow.tag }}
300
+ Branch: ${{ branch_name }}
194
301
  ```
195
302
 
196
- **Installing Skills:**
303
+ Available variables:
304
+ - `${{ workflow.name }}` - Workflow name
305
+ - `${{ workflow.tag }}` - Instance tag
306
+ - `${{ env.VAR }}` - Environment variable
307
+ - `${{ task_output }}` - Setup task output (via `as:` field)
197
308
 
198
- Use the [skills CLI](https://github.com/vercel-labs/skills) to install skills:
309
+ ### Coordination Patterns
199
310
 
200
- ```bash
201
- # Install from GitHub
202
- npx skills add vercel-labs/agent-skills
311
+ **Sequential handoff:**
312
+ ```yaml
313
+ kickoff: |
314
+ @alice Start the task.
315
+ ```
316
+ Alice's message: "Done! @bob your turn"
203
317
 
204
- # Or use the official skills tool
205
- npm install -g @agentskills/cli
206
- skills add vercel-labs/agent-skills
318
+ **Parallel broadcast:**
319
+ ```yaml
320
+ kickoff: |
321
+ @alice @bob @charlie All review this code.
207
322
  ```
208
323
 
209
- ### Backends
324
+ **Document-based:**
325
+ ```yaml
326
+ agents:
327
+ writer:
328
+ system_prompt: Write analysis to the shared document.
210
329
 
211
- ```bash
212
- # Check available backends
213
- agent-worker backends
330
+ reviewer:
331
+ system_prompt: Read the document and provide feedback.
214
332
 
215
- # Check SDK providers
216
- agent-worker providers
333
+ context:
334
+ provider: file
335
+ config:
336
+ bind: ./results/ # Persistent across runs
217
337
  ```
218
338
 
219
- | Backend | Command | Best For |
220
- |---------|---------|----------|
221
- | SDK (default) | `session new -m provider/model` | Full control, tool injection, mocking |
222
- | Claude CLI | `session new -b claude` | Use existing Claude installation |
223
- | Codex | `session new -b codex` | OpenAI Codex workflows |
224
- | Cursor | `session new -b cursor` | Cursor Agent integration |
339
+ ### Examples
225
340
 
226
- > **⚠️ Important:** Different backends have different capabilities. CLI backends (claude, codex, cursor) don't support:
227
- > - Dynamic tool management (`tool_add`, `tool_mock`, `tool_import`)
228
- > - Approval system (`approve`, `deny`)
229
- > - `--import-skill` (use `npx skills add --global` instead)
230
- >
231
- > See [BACKEND_COMPATIBILITY.md](./BACKEND_COMPATIBILITY.md) for a complete feature comparison.
341
+ **PR Review Workflow:**
342
+ ```yaml
343
+ # review.yaml
344
+ agents:
345
+ reviewer:
346
+ backend: claude
347
+ system_prompt: Review code for bugs, style, performance.
232
348
 
233
- ### Model Formats (SDK Backend)
349
+ setup:
350
+ - shell: gh pr diff ${{ env.PR_NUMBER }}
351
+ as: diff
234
352
 
235
- ```bash
236
- # Gateway format (recommended)
237
- agent-worker session new -m anthropic/claude-sonnet-4-5
238
- agent-worker session new -m openai/gpt-5.2
353
+ kickoff: |
354
+ @reviewer Review this PR:
355
+
356
+ ${{ diff }}
357
+ ```
239
358
 
240
- # Provider-only (uses frontier model)
241
- agent-worker session new -m anthropic
242
- agent-worker session new -m openai
359
+ ```bash
360
+ PR_NUMBER=123 agent-worker run review.yaml --tag pr-123
361
+ ```
243
362
 
244
- # Direct provider format
245
- agent-worker session new -m deepseek:deepseek-chat
363
+ **Research & Summarize:**
364
+ ```yaml
365
+ # research.yaml
366
+ agents:
367
+ researcher:
368
+ backend: sdk
369
+ model: anthropic/claude-sonnet-4-5
370
+ system_prompt: Research topics and write findings to document.
371
+
372
+ summarizer:
373
+ backend: sdk
374
+ model: anthropic/claude-haiku-4-5
375
+ system_prompt: Read document and create concise summary.
376
+
377
+ context:
378
+ provider: file
379
+ config:
380
+ bind: ./research-output/
381
+
382
+ kickoff: |
383
+ @researcher Research "${{ env.TOPIC }}" and document findings.
384
+ @summarizer Wait for research to complete, then summarize.
246
385
  ```
247
386
 
248
- ## SDK Usage
387
+ ---
388
+
389
+ ## 🔧 SDK Usage
249
390
 
250
- ### Basic Session
391
+ For programmatic control (TypeScript/JavaScript):
251
392
 
252
393
  ```typescript
253
394
  import { AgentSession } from 'agent-worker'
@@ -269,123 +410,77 @@ for await (const chunk of session.sendStream('Tell me a story')) {
269
410
  process.stdout.write(chunk)
270
411
  }
271
412
 
272
- // Get state for persistence
413
+ // State management
273
414
  const state = session.getState()
415
+ // Later: restore from state
274
416
  ```
275
417
 
276
418
  ### With Skills
277
419
 
278
420
  ```typescript
279
- import {
280
- AgentSession,
281
- SkillsProvider,
282
- createSkillsTool
283
- } from 'agent-worker'
421
+ import { AgentSession, SkillsProvider, createSkillsTool } from 'agent-worker'
284
422
 
285
- // Setup skills
286
423
  const skillsProvider = new SkillsProvider()
287
424
  await skillsProvider.scanDirectory('.agents/skills')
288
- await skillsProvider.scanDirectory('~/my-skills')
289
425
 
290
- // Or add individual skills
291
- await skillsProvider.addSkill('./custom-skills/my-skill')
292
-
293
- // Create session with Skills tool
294
426
  const session = new AgentSession({
295
427
  model: 'anthropic/claude-sonnet-4-5',
296
428
  system: 'You are a helpful assistant.',
297
- tools: [
298
- createSkillsTool(skillsProvider),
299
- // ... other tools
300
- ]
429
+ tools: [createSkillsTool(skillsProvider)]
301
430
  })
302
-
303
- // Agent can now access skills
304
- const response = await session.send(
305
- 'What skills are available? Use the dive skill to analyze this codebase.'
306
- )
307
431
  ```
308
432
 
309
- ### With Imported Skills
310
-
311
- ```typescript
312
- import {
313
- AgentSession,
314
- SkillsProvider,
315
- SkillImporter,
316
- createSkillsTool
317
- } from 'agent-worker'
318
-
319
- // Setup skills provider
320
- const skillsProvider = new SkillsProvider()
433
+ ---
321
434
 
322
- // Import skills from Git repositories
323
- const sessionId = 'my-session-123'
324
- const importer = new SkillImporter(sessionId)
435
+ ## 📊 Comparison: Agent vs Workflow
325
436
 
326
- // Import from GitHub
327
- await importer.import('vercel-labs/agent-skills:dive')
328
- await importer.import('lidessen/skills:{memory,orientation}')
437
+ | Feature | Agent Mode | Workflow Mode |
438
+ |---------|------------|---------------|
439
+ | **Definition** | CLI commands | YAML file |
440
+ | **Agents** | One at a time | Multiple (orchestrated) |
441
+ | **Coordination** | Manual (via commands) | Automatic (@mentions) |
442
+ | **Context** | Shared channel + docs | Shared channel + docs |
443
+ | **Isolation** | workflow:tag namespace | workflow:tag namespace |
444
+ | **Setup** | Start agents manually | Declarative setup tasks |
445
+ | **Best For** | Interactive tasks, testing | Structured workflows, automation |
329
446
 
330
- // Or import multiple specs at once
331
- await importer.importMultiple([
332
- 'vercel-labs/agent-skills:{dive,react}',
333
- 'gitlab:myorg/skills@v1.0.0:custom'
334
- ])
335
-
336
- // Add imported skills to provider
337
- await skillsProvider.addImportedSkills(importer)
338
-
339
- // Create session
340
- const session = new AgentSession({
341
- model: 'anthropic/claude-sonnet-4-5',
342
- system: 'You are a helpful assistant.',
343
- tools: [createSkillsTool(skillsProvider)]
344
- })
345
-
346
- // Don't forget cleanup when done
347
- process.on('exit', async () => {
348
- await importer.cleanup()
349
- })
447
+ Both modes share the same underlying context system:
448
+ ```
449
+ .workflow/
450
+ ├── global/main/ # Standalone agents (default)
451
+ ├── review/main/ # review workflow, main tag
452
+ └── review/pr-123/ # review workflow, pr-123 tag
350
453
  ```
351
454
 
352
- ## Common Patterns
455
+ ---
353
456
 
354
- ### Prompt Testing
457
+ ## 🎯 Model Formats
355
458
 
356
459
  ```bash
357
- agent-worker session new -f ./my-prompt.txt -n test
358
- agent-worker send "Test case 1: ..." --to test
359
- agent-worker send "Test case 2: ..." --to test
360
- agent-worker history --to test
361
- agent-worker session end test
460
+ agent-worker new -m anthropic/claude-sonnet-4-5 # Gateway (recommended)
461
+ agent-worker new -m anthropic # Provider-only (frontier)
462
+ agent-worker new -m deepseek:deepseek-chat # Direct format
362
463
  ```
363
464
 
364
- ### Tool Development with Mocks
465
+ ---
365
466
 
366
- ```bash
367
- agent-worker session new -n dev
368
- agent-worker tool add my_api -d "Call my API" -p "endpoint:string"
369
- agent-worker tool mock my_api '{"status": "ok"}'
370
- agent-worker send "Call my API at /users"
371
- # Update mock, test error handling
372
- agent-worker tool mock my_api '{"status": "error", "code": 500}'
373
- agent-worker send "Call my API at /users"
374
- ```
467
+ ## 📚 Documentation
375
468
 
376
- ### Multi-Model Comparison
469
+ | Doc | Description |
470
+ |-----|-------------|
471
+ | [ARCHITECTURE.md](./ARCHITECTURE.md) | System architecture and modules |
472
+ | [docs/backends.md](./docs/backends.md) | Backend feature matrix |
473
+ | [docs/workflow/](./docs/workflow/) | Workflow system design |
474
+ | [TEST-ARCHITECTURE.md](./TEST-ARCHITECTURE.md) | Testing strategy |
377
475
 
378
- ```bash
379
- agent-worker session new -m anthropic/claude-sonnet-4-5 -n claude
380
- agent-worker session new -m openai/gpt-5.2 -n gpt
381
- agent-worker send "Explain recursion" --to claude
382
- agent-worker send "Explain recursion" --to gpt
383
- ```
476
+ ---
384
477
 
385
478
  ## Requirements
386
479
 
387
480
  - Node.js 18+ or Bun
388
- - API key for chosen provider (e.g., `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`)
481
+ - API key for chosen provider (e.g., `ANTHROPIC_API_KEY`)
482
+
483
+ ---
389
484
 
390
485
  ## License
391
486