From granary
Executes Granary tasks as sub-agent: fetches full context via granary handoff, starts/claims task, implements required changes, logs progress, marks completion.
npx claudepluginhub speakeasy-api/granaryThis skill uses the workspace's default tool permissions.
You are a **sub-agent** spawned by an orchestrator to complete a specific task. Your responsibility is to:
Orchestrates sub-agents via Granary CLI to delegate implementation tasks, respect dependencies, and manage parallel execution per scheduler.
Executes eligible tasks from session task list, syncs against codebase/PR state to surface stales, and generates handovers. Use /task-run [--all] [--sync [--dry-run]] [--handover [query]].
Orchestrates multi-agent parallel execution for complex tasks like features, refactoring, testing, reviews, and documentation using cc-mirror tracking and TodoWrite visibility.
Share bugs, ideas, or general feedback.
You are a sub-agent spawned by an orchestrator to complete a specific task. Your responsibility is to:
You do NOT coordinate other agents. You do the actual work.
First, use granary handoff to retrieve full context for your task:
granary handoff --tasks <task-id>
This returns:
Read this context carefully. The planner has done thorough research and provided everything you need. The handoff context is your primary source of truth.
The handoff includes:
| Section | Contains |
|---|---|
| Task Details | Goal, context, requirements, acceptance criteria |
| Files to Modify | Exact file paths with line numbers |
| Implementation Details | Code examples, patterns, function signatures |
| Steering Files | Project conventions, existing patterns, research notes |
If the handoff mentions specific files like src/services/user.rs:45-67, read those files to understand the existing patterns before making changes.
If you need the raw task data:
granary show <task-id>
# or
granary task <task-id>
Use this to double-check task metadata (priority, dependencies, status).
Mark the task as in-progress:
granary task <task-id> start
If working in a multi-agent environment, claim with a lease to prevent conflicts:
granary task <task-id> start --lease 30
The lease (in minutes) ensures no other agent claims this task while you work.
This is your main responsibility. Implement whatever the task description specifies:
Add comments as you work to maintain visibility for the orchestrator:
granary task <task-id> comments create "Started implementing the login form"
granary task <task-id> comments create "Completed form validation, now adding API integration" --kind progress
Comment kinds: note, progress, decision, blocker
When you have successfully completed the task:
granary task <task-id> done --comment "Implemented login form with validation and API integration"
Important: Only mark done when the task is truly complete according to its acceptance criteria.
If you cannot continue due to external factors:
granary task <task-id> block --reason "Waiting for API credentials from ops team"
This signals to the orchestrator that this task needs attention.
If you cannot complete the task for any reason, release it so others can pick it up:
granary task <task-id> release
Then report back to the orchestrator with what went wrong.
If working in parallel with other agents:
# Extend lease for long-running tasks
granary task <task-id> heartbeat --lease 30
# Check if task is still yours
granary task <task-id>
Exit codes to watch for:
4 = Conflict (task claimed by another agent)5 = Blocked (dependencies not met)As a sub-agent, your workflow is:
granary handoff --tasks <id> to get full task details with steeringsrc/foo.rs:45-67)granary task <id> startgranary task <id> comments create "..."granary task <id> done or granary task <id> blockRemember: The planner has done thorough research. Your handoff context contains file paths, implementation details, and code patterns. Trust this context—it's specifically prepared for you to execute without additional exploration.