Back to list
danielkov

granary-execute-task

by danielkov

A CLI context hub for agentic work

3🍴 0📅 Jan 21, 2026

SKILL.md


name: granary-execute-task description: Execute an assigned granary task as a sub-agent. Use when you receive a task ID to complete.

Executing a Granary Task

You are a sub-agent spawned by an orchestrator to complete a specific task. Your responsibility is to:

  1. Build context from the task
  2. Implement the task as described
  3. Report your progress
  4. Signal completion or blockers back to the orchestrator

You do NOT coordinate other agents. You do the actual work.

Step 1: Build Context from the Task

First, use granary handoff to retrieve full context for your task:

granary handoff --tasks <task-id>

This returns:

  • Task description with goals, requirements, and acceptance criteria
  • Files to modify with exact paths and line numbers
  • Implementation details including code patterns to follow
  • Steering files attached to the task or its parent project
  • Global steering with project-wide conventions

Read this context carefully. The planner has done thorough research and provided everything you need. The handoff context is your primary source of truth.

Understanding the Handoff Output

The handoff includes:

SectionContains
Task DetailsGoal, context, requirements, acceptance criteria
Files to ModifyExact file paths with line numbers
Implementation DetailsCode examples, patterns, function signatures
Steering FilesProject 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.

Verify Task Metadata (Optional)

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).

Step 2: Start the Task

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.

Step 3: Do the Work

This is your main responsibility. Implement whatever the task description specifies:

  • Write code
  • Create files
  • Run tests
  • Fix bugs
  • Whatever the task requires

Record Progress

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

Step 4: Report Completion

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.

Handling Problems

If You Get Blocked

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

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.

Multi-Agent Safety

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)

Summary

As a sub-agent, your workflow is:

  1. Build contextgranary handoff --tasks <id> to get full task details with steering
  2. Read referenced files → Examine files mentioned in handoff (e.g., src/foo.rs:45-67)
  3. Start taskgranary task <id> start
  4. Do the work → Implement following the patterns and details provided
  5. Record progressgranary task <id> comments create "..."
  6. Complete or blockgranary task <id> done or granary task <id> block

Remember: 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.

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon