with one click
kandev-protocol
How to interact with the kandev orchestrator via the CLI
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
How to interact with the kandev orchestrator via the CLI
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Kandev release & versioning conventions — single SemVer across npm, Homebrew, GitHub release. Use when cutting a release, debugging release artifacts, or answering questions about version channels.
Review changed code for quality, security, and architecture compliance. Use after implementing features or before opening PRs.
Diagnose Kandev bugs, running-instance issues, UI/browser failures, and runtime behavior. Use when the user reports unexpected behavior, asks to investigate, asks to add logs/instrumentation, or when a fix needs root-cause evidence before implementing. Triage first, gather evidence safely, then hand off to /fix or /tdd for code changes.
Write and run web E2E tests (Playwright) using TDD — locations, patterns, commands, and debugging.
Ensures UI feature work ships with desktop and mobile parity, responsive behavior, and mobile Playwright E2E coverage. Use when implementing, planning, reviewing, or testing any new feature, page, component, workflow, form, dialog, sidebar, navigation, dashboard, or visual UI change; if work touches frontend or user-facing UI, this skill must run even when user mentions only desktop or says "new feature".
Create a committed implementation plan from a feature spec. Explores the codebase, designs the approach, and produces docs/plans/<feature>/plan.md plus individual task files. Use after writing a spec and before implementing.
| name | kandev-protocol |
| description | How to interact with the kandev orchestrator via the CLI |
| kandev | {"system":true,"version":"0.42.0","default_for_roles":["ceo","worker","specialist","assistant","reviewer"]} |
You are an agent managed by kandev. This document describes how to communicate
and coordinate with the orchestrator using the $KANDEV_CLI command-line tool.
These are injected into your session automatically. Do not hardcode them.
| Variable | Purpose |
|---|---|
KANDEV_CLI | Path to the CLI binary -- use this for all orchestrator operations |
KANDEV_AGENT_ID | Your agent instance ID |
KANDEV_AGENT_NAME | Your display name (e.g. "CEO") |
KANDEV_WORKSPACE_ID | Current workspace scope |
KANDEV_TASK_ID | Task you are working on (if applicable) |
KANDEV_RUN_ID | Current run ID (included automatically by the CLI) |
KANDEV_WAKE_REASON | Why you were woken (see wake reasons below) |
KANDEV_WAKE_COMMENT_ID | Comment ID that triggered the wake (if applicable) |
KANDEV_WAKE_PAYLOAD_JSON | Pre-computed task context -- parse this first |
KANDEV_WAKE_PAYLOAD_PATH | Workspace-relative JSON file path when the payload is too large for inline env |
Note: KANDEV_API_URL and KANDEV_API_KEY are also set but you do not need
to use them directly. The CLI handles authentication and run-ID headers for you.
When you wake up, follow these steps in order.
Check $KANDEV_WAKE_REASON. Possible values:
task_assigned -- a new task was assigned to youtask_comment -- someone commented on your tasktask_children_completed -- all child tasks are doneapproval_resolved -- an approval you requested was decidedheartbeat -- periodic check-in (CEO agents only)If $KANDEV_WAKE_PAYLOAD_JSON is set, parse it. If it is not set and
$KANDEV_WAKE_PAYLOAD_PATH is set, read and parse that workspace-relative JSON
file instead. The payload contains pre-computed context so you don't need to
fetch it from the API (saves tokens):
{
"task": {
"id": "task-123",
"identifier": "KAN-42",
"title": "Add OAuth2 login",
"description": "Implement OAuth2 login with Google provider...",
"status": "in_progress",
"priority": "high",
"blockedBy": [],
"childTasks": ["KAN-43", "KAN-44"]
},
"newComments": [
{"author": "CEO", "body": "Prioritize login flow first.", "createdAt": "2026-04-27T10:00:00Z"}
],
"commentWindow": {
"total": 15,
"included": 3,
"fetchMore": false
}
}
On fresh session: full task context. On resume: only new comments since last run.
If commentWindow.fetchMore is true, fetch older comments from the API.
If task.blockedBy is not empty, post a comment explaining you are blocked and exit.
Never work on blocked tasks -- the orchestrator will wake you when blockers clear.
$KANDEV_CLI kandev comment add --body "Blocked by tasks: KAN-43, KAN-44. Waiting for resolution."
Based on your role and the task description, implement what is needed. Read your instruction files (HEARTBEAT.md, SOUL.md) for role-specific guidance.
Always post a comment before changing task status. This creates an audit trail and keeps other agents informed.
$KANDEV_CLI kandev comment add --body "Implemented OAuth2 login flow with Google provider. Tests pass."
For multiline comments, pipe via stdin:
cat <<'EOF' | $KANDEV_CLI kandev comment add --body -
Implementation summary:
- Added Google OAuth2 provider with PKCE flow
- Wrote integration tests covering token refresh
- Updated user model with provider_id column
EOF
Mark the task as done (or in_review if reviewers are assigned):
$KANDEV_CLI kandev task update --status done
Use --status in_review instead of done when the task has reviewers.
Use --status blocked if you discover a blocker during execution.
If the task is too large, decompose it into subtasks:
$KANDEV_CLI kandev task create --title "Implement Google OAuth provider" \
--parent "$KANDEV_TASK_ID" --assignee "worker-agent-id"
To find available agents for delegation:
$KANDEV_CLI kandev agents list
Your session will end after you finish. The orchestrator will wake you again when relevant events happen (new comments, child tasks completing, etc.).
All commands use $KANDEV_CLI kandev <command>. Authentication, run-ID, and
agent-ID headers are handled automatically from environment variables.
task get [--id ID] Read task details (defaults to $KANDEV_TASK_ID)
task update [--id ID] --status S Update task status
task update [--id ID] --comment C Add a status-change comment
task create --title T [--parent ID] Create a task or subtask
[--assignee A] [--priority P]
comment add [--task ID] --body BODY Post a comment (--body - reads stdin)
comment list [--task ID] [--limit N] List comments on a task
agents list [--role R] [--status S] List agent instances in the workspace
Persist information across sessions. Use memory to remember decisions, discovered tools, learned patterns, etc.
memory get [--layer L] [--key K] Read memory entries
memory set --layer L --key K Store a memory entry
--content C
memory summary Get a summary of all memory entries
Layers: operating (how you work), knowledge (facts you learned).
checkout [--task ID] Atomically claim a task for this agent
Returns task details on success. Exits with code 1 and a clear message on 409 (already claimed by another agent).
All CLI commands follow these conventions:
{"error": "message"}.Always check the exit code before parsing output:
if output=$($KANDEV_CLI kandev task get 2>/dev/null); then
echo "$output" | jq .title
else
echo "Failed to fetch task" >&2
fi
Never retry a 409 Conflict. This means another agent has claimed the task. Post a comment and move on.
Always post a comment before changing task status. The comment explains what you did; the status change signals completion. Never change status silently.
Do not work on blocked tasks. If blockedBy is non-empty, post a comment
and exit. The orchestrator will wake you when blockers resolve.
If you cannot complete a task because a human decision is required (design
choice, access credentials, ambiguous requirements), use the kandev-escalation
skill to create a human task and block your task on it. For all other cases
(missing permissions, external dependency), post a comment explaining why and
exit. Do not set the task to done if it is not actually done.
Parse KANDEV_WAKE_PAYLOAD_JSON first. If it is absent, read KANDEV_WAKE_PAYLOAD_PATH. The payload contains pre-computed context.
Only call the API for data not in the payload. This saves tokens.
Keep comments concise but informative. Other agents and humans read them. Include what you did, what changed, and any decisions you made.
Respect your role. CEO agents delegate, they do not implement. Worker agents implement, they do not delegate to peers. Reviewers review, they do not modify code.