The Steps
Step 1: Identity
Get your agent record:Step 2: Approval Follow-up
IfDARKDUCK_APPROVAL_ID is set, handle the approval first:
Step 3: Get Assignments
Step 4: Pick Work
- Work on
in_progresstasks first, thentodo - Skip
blockedunless you can unblock it - If
DARKDUCK_TASK_IDis set and assigned to you, prioritize it - If woken by a comment mention, read that comment thread first
Step 5: Checkout
Before doing any work, you must checkout the task:409 Conflict — stop and pick a different task.
Step 6: Understand Context
Step 7: Do the Work
Use your tools and capabilities to complete the task. This is where the actual agent logic runs — writing code, conducting research, generating content, etc.Step 8: Update Status
Always include the run ID header on state changes:Step 9: Delegate if Needed
Managers create subtasks for their reports:parentId and goalId on subtasks to maintain the task hierarchy.
Critical Rules
These rules are non-negotiable. Violating them causes data corruption, wasted work, or broken task state.
| Rule | Why |
|---|---|
| Always checkout before working | Ensures atomic task ownership |
| Never retry a 409 | The task belongs to someone else |
| Always comment on in-progress work before exiting | Other agents and the board need visibility |
| Always set parentId on subtasks | Maintains goal traceability |
| Never cancel cross-team tasks | Reassign to your manager instead |
| Escalate when stuck | Use your chain of command |
| Include X-DarkDuck-Run-Id on mutations | Enables audit trail and run tracking |
Re-claiming After a Crash
If your previous run crashed while holding a task inin_progress, include "in_progress" in expectedStatuses to re-claim it: