| Role | Responsibility | Does NOT |
|---|---|---|
| Coordinator | Analyzes task scope, creates implementation plan, delegates subtasks, tracks progress, reviews results | Write code directly, execute builds/tests |
| Cairo Developer | Implements Cairo contracts, writes snforge tests, follows OpenZeppelin patterns | Deploy to networks, modify TypeScript packages |
| TypeScript Developer | Implements MCP tools, A2A adapter, framework extensions, writes Vitest tests | Modify Cairo contracts, deploy contracts |
| Skills Author | Writes and refines SKILL.md files, ensures AgentSkills spec compliance | Write implementation code, modify contracts |
| Reviewer | Validates code quality, checks for security issues, verifies test coverage | Implement features, make architectural decisions |
- Read the task requirements
- Identify affected files and modules using
<implementation_status>in CLAUDE.md - Check current state: what exists vs. what's TODO
- Create a detailed plan with file paths, interface signatures, and test expectations
- Estimate complexity (S/M/L) and identify parallelizable subtasks
- Follow the plan from Phase 1 exactly
- Implement changes in the specified files
- Run builds and tests after each logical unit of work
- Report blockers immediately -- do not improvise around missing context
- Document any deviations from the plan
- Run full test suite for affected components
- Verify no regressions in unrelated tests
- Check that new code follows
<conventions>in CLAUDE.md - Confirm
<boundaries>are respected (no forbidden file modifications)
<task_states>
pending --> in_progress --> in_review --> done
\-> blocked
\-> cancelled
| Transition | Trigger |
|---|---|
| pending -> in_progress | Agent assigned, work started |
| in_progress -> in_review | Implementation complete, tests pass |
| in_progress -> blocked | Missing dependency, needs decision, or needs human input |
| in_review -> done | Review passed, merged |
| in_review -> in_progress | Review found issues, needs fixes |
| any -> cancelled | Task no longer relevant |
</task_states>
<task_template>
## [Type]: [Title]
**Complexity:** S / M / L
**Component:** Cairo | TypeScript | Skills | Docs
### Problem
[1-2 sentences: what needs to be solved]
### Context
- Affected files: [list paths]
- Related spec: [reference to docs/SPECIFICATION.md section]
- Dependencies: [other tasks or components this depends on]
### Implementation Plan
1. [Step with specific file path and what to change]
2. [Step]
3. [Step]
### Acceptance Criteria
- [ ] Implementation matches spec
- [ ] Tests written and passing
- [ ] No regressions in existing tests
- [ ] Follows project conventions
### Out of Scope
- [Explicit exclusions]</task_template>
- Cairo contract work + TypeScript package work (different languages, no shared files)
- Different skills in
skills/(independent SKILL.md files) - MCP server tools + A2A adapter (separate packages, no shared state)
- Test writing + documentation (different file types)
- Website work + any backend work (fully independent)
- Changes to the same Cairo contract file
- Changes to shared interfaces in
src/interfaces/ - TypeScript packages that import from each other
- Any task that depends on another task's output (e.g., "implement tool" then "write test for tool")
- Detect file overlap before starting parallel tasks
- If overlap found, serialize the conflicting tasks
- If discovered mid-execution: pause the later task, let the first complete
- Rebase the second task's changes and verify they still apply
<component_guidance>
- Always read existing contract code before modifying (understand component embedding pattern)
- Run
snforge testincontracts/erc8004-cairo/after every change - New contracts: follow the IdentityRegistry pattern for structure
- Test pattern:
declare->deploy-> call via dispatcher -> assert
- Read
docs/SPECIFICATION.mdSection 4 for tool definitions - Each tool: Zod schema + handler function + registration
- Use starknet.js
RpcProviderfor reads,Accountfor writes - Use
@avnu/avnu-sdkfor all DeFi operations (swaps, DCA, staking) - Transport: stdio (local) + HTTP+SSE (remote)
- Read
docs/SPECIFICATION.mdSection 5 for Agent Card generation - Maps on-chain ERC-8004 identity to A2A Agent Cards
- Task states map to transaction states (submitted->sent, working->pending, etc.)
- Read
references/agentskills/SPECS.mdfor format requirements - Read existing skills in
skills/for patterns - Frontmatter must include: name, description, keywords, allowed-tools, user-invocable
- Include starknet.js code examples with real token addresses
- Include error codes with recovery guidance
</component_guidance>
Escalate to human when:
- Task requires contract deployment (Sepolia or mainnet)
- Security vulnerability discovered in existing code
- Conflicting requirements between spec and implementation
- Need to modify protected files (
.env*,Scarb.lock, git submodules) - Breaking changes to deployed contract interfaces
- Blocked for more than 3 attempts without progress
## Escalation: [Title]
**Task:** [reference]
**Blocker:** [what's preventing progress]
**Options:**
1. [Option A] -- [tradeoffs]
2. [Option B] -- [tradeoffs]
**Recommendation:** [which option and why]- Coordinator reads spec, creates task with tool schema and expected behavior
- TypeScript Developer implements tool handler + Zod schema + registers tool
- TypeScript Developer writes Vitest tests
- Reviewer validates against spec and security model
- Coordinator reads spec, identifies interfaces and dependencies
- Cairo Developer implements contract with OpenZeppelin components
- Cairo Developer writes snforge tests (>90% coverage target)
- Skills Author creates or updates related SKILL.md (parallel with step 3)
- Reviewer checks security (reentrancy, access control, overflow)
- Coordinator creates plan with 3 parallel tracks
- Cairo Developer implements contract + tests (Track A)
- TypeScript Developer implements MCP tool using contract interface (Track B, starts after Track A interface is defined)
- Skills Author writes SKILL.md with usage patterns (Track C, parallel with B)
- Reviewer validates all three tracks