feat: add Spawn1337 protocol docs to case template

New sessions had no awareness of the spawn1337 agent protocol because
the case-template.md (copied as CLAUDE.md into every new case) was
missing the documentation. Added full spawn protocol reference including
tag syntax, task spec format, monitoring commands, and resource limits.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-23 22:32:42 +01:00
co-authored by Claude Opus 4.5
parent 9c322f7506
commit 7c72802886
+84
View File
@@ -357,6 +357,90 @@ Instead: Fix the issue, verify, then complete. For time-aware loops: generate mo
---
## Spawn1337: Autonomous Agent Spawning
You can spawn autonomous child agents to handle subtasks in parallel. Each agent runs in its own Claude session with full capabilities.
### How to Spawn an Agent
1. **Write a task spec file** (anywhere in your working directory):
```markdown
---
agentId: my-agent-001
name: My Research Agent
type: explore
priority: normal
maxTokens: 150000
maxCost: 0.50
timeoutMinutes: 15
canModifyParentFiles: false
contextFiles: [src/auth.ts, src/types.ts]
completionPhrase: RESEARCH_DONE
outputFormat: structured
---
Your task instructions here. Be specific about what you want the agent to do
and what output format you expect.
```
2. **Output the spawn tag** to trigger the orchestrator:
```
<spawn1337>path/to/task-spec.md</spawn1337>
```
The orchestrator will read the file, create the agent's workspace, and start a new Claude session.
### Task Spec Fields
| Field | Required | Default | Description |
|-------|----------|---------|-------------|
| `agentId` | Yes | - | Unique identifier for the agent |
| `name` | Yes | - | Human-readable name |
| `type` | No | `general` | `explore\|implement\|test\|review\|refactor\|research\|generate\|fix\|general` |
| `priority` | No | `normal` | `low\|normal\|high\|critical` |
| `maxTokens` | No | 150000 | Token budget |
| `maxCost` | No | 0.50 | Cost budget in USD |
| `timeoutMinutes` | No | 30 | Max runtime (max: 120) |
| `canModifyParentFiles` | No | `false` | Whether agent can edit parent project files |
| `contextFiles` | No | `[]` | Files to symlink into agent workspace |
| `dependsOn` | No | `[]` | Agent IDs that must complete first |
| `completionPhrase` | No | `AGENT_DONE` | Phrase agent outputs when finished |
| `outputFormat` | No | `structured` | `markdown\|json\|code\|structured\|freeform` |
### Monitoring and Communication
```
<spawn1337-status agentId="my-agent-001"/>
```
Query an agent's current status and progress.
```
<spawn1337-message agentId="my-agent-001">
Please also check the error handling in auth.ts
</spawn1337-message>
```
Send a message to a running agent (written to its comms directory).
```
<spawn1337-cancel agentId="my-agent-001"/>
```
Cancel a running agent (graceful shutdown).
### Resource Limits
- Max concurrent agents: 5
- Max spawn depth: 3 (agents can spawn children)
- Budget warning at 80%, shutdown at 100%, force kill at 110%
- Default timeout: 30 min, max: 120 min
### Agent Results
When an agent completes, its result is written to `spawn-comms/result.md` in its workspace. The orchestrator notifies you via SSE events. Results include YAML frontmatter with status, summary, and files changed.
---
## Code Standards
### Before Writing