跳到正文
cccskills
免费在 GitHub 公开

kandev-protocol

Follow the core Office agent protocol on wakeup, including parsing KANDEV_* context, checking blockers, commenting progress, updating status, and using the CLI safely.

中文简介正在准备中。当前显示原文说明。

kdlbs/kandev星标 1,020(GitHub 1,020 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md8.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Kandev Protocol

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.

Environment Variables

These are injected into your session automatically. Do not hardcode them.

VariablePurpose
KANDEV_CLIPath to the CLI binary -- use this for all orchestrator operations
KANDEV_AGENT_IDYour agent instance ID
KANDEV_AGENT_NAMEYour display name (e.g. "CEO")
KANDEV_WORKSPACE_IDCurrent workspace scope
KANDEV_TASK_IDTask you are working on (if applicable)
KANDEV_RUN_IDCurrent run ID (included automatically by the CLI)
KANDEV_WAKE_REASONWhy you were woken (see wake reasons below)
KANDEV_WAKE_COMMENT_IDComment ID that triggered the wake (if applicable)
KANDEV_WAKE_PAYLOAD_JSONPre-computed task context -- parse this first
KANDEV_WAKE_PAYLOAD_PATHWorkspace-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.

Heartbeat Procedure

When you wake up, follow these steps in order.

Step 1: Read wake reason

Check $KANDEV_WAKE_REASON. Possible values:

  • task_assigned -- a new task was assigned to you
  • task_comment -- someone commented on your task
  • task_children_completed -- all child tasks are done
  • approval_resolved -- an approval you requested was decided
  • heartbeat -- periodic check-in (CEO agents only)

Step 2: Parse wake payload

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.

Step 3: Check blockers

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 tasks message --prompt "Blocked by tasks: KAN-43, KAN-44. Waiting for resolution."

Step 4: Do the work

Based on your role and the task description, implement what is needed. Read your instruction files (HEARTBEAT.md, SOUL.md) for role-specific guidance.

Step 5: Post progress comments

Always post a comment before changing task status. This creates an audit trail and keeps other agents informed.

$KANDEV_CLI kandev tasks message --prompt "Implemented OAuth2 login flow with Google provider. Tests pass."

For multiline comments, pipe via stdin:

cat <<'EOF' | $KANDEV_CLI kandev tasks message --prompt -
Implementation summary:
- Added Google OAuth2 provider with PKCE flow
- Wrote integration tests covering token refresh
- Updated user model with provider_id column
EOF

tasks message uses the signed runtime scope. The server verifies that the task is writable by this run and derives the agent attribution from the run token. Do not use another comment command or supply author fields yourself.

Step 6: Update task status

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.

Step 7: Create subtasks (if needed)

If the task is too large, decompose it into subtasks:

$KANDEV_CLI kandev task create --title "Implement Google OAuth provider" \
  --description "Add the provider flow, callback handling, and tests." \
  --parent "$KANDEV_TASK_ID" --assignee "worker-agent-id"

To find available agents for delegation:

$KANDEV_CLI kandev agents list

Step 8: Exit

Your session will end after you finish. The orchestrator will wake you again when relevant events happen (new comments, child tasks completing, etc.).

CLI Reference

All commands use $KANDEV_CLI kandev <command>. Authentication, run-ID, and agent-ID headers are handled automatically from environment variables.

task

task get [--id ID]                    Read task details (defaults to $KANDEV_TASK_ID)
task update [--id ID] --status S [--comment C]
                                      Update status with an optional status-change comment
task create --title T [--description D] Create a task or subtask
         [--parent ID] [--assignee A] [--project ID]

No other task creation options are supported by the Office runtime.

comment

tasks message [--id ID] --prompt P    Post an agent-authored comment
                                      Use --prompt - to read from stdin

agents

agents list [--role R] [--status S]   List agent instances in the workspace

memory

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

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

Error Handling

All CLI commands follow these conventions:

  • Exit code 0: success. JSON result on stdout.
  • Exit code 1: error. JSON error on stderr: {"error": "message"}.
  • HTTP 409 on checkout: task already claimed. Do not retry.

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

Critical Rules

  1. Never retry a 409 Conflict. This means another agent has claimed the task. Post a comment and move on.

  2. Always post a comment before changing task status. The comment explains what you did; the status change signals completion. Never change status silently.

  3. Do not work on blocked tasks. If blockedBy is non-empty, post a comment and exit. The orchestrator will wake you when blockers resolve.

  4. 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, cross-reference it, and mark your task blocked. The current CLI cannot create a blocker relationship, so recovery requires a normal human comment or task update. 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.

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

  6. Keep comments concise but informative. Other agents and humans read them. Include what you did, what changed, and any decisions you made.

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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

acp-debug

免费

Debug an ACP agent CLI by spawning it, speaking raw JSON-RPC, and capturing every frame to a JSONL file. Use when the user asks to probe an agent's capabilities, compare agents, test a prompt against an agent, inspect raw ACP wire frames, or investigate why an agent fails to initialize.

中文简介正在准备中。当前显示原文说明。

kdlbs/kandev10202026年10月26日 更新

Add a new third-party integration (Jira/Linear-style) — per-workspace credentials, 90s auth-health poller, settings page, link/import buttons. Use when scaffolding a new external service integration.

中文简介正在准备中。当前显示原文说明。

kdlbs/kandev10202026年10月26日 更新

Delete local branches whose remote has been deleted ([gone]), including their worktrees. Use for branch cleanup after merging PRs.

中文简介正在准备中。当前显示原文说明。

kdlbs/kandev10202026年10月26日 更新

Review changed code for quality, security, and architecture compliance. Use only when the user explicitly requests local review or a PR finding requires it.

中文简介正在准备中。当前显示原文说明。

kdlbs/kandev10202026年10月26日 更新

commit

免费

Stage and commit changes using Conventional Commits. Use when there are dirty/staged files to commit, the user says "commit", or before pushing a PR.

中文简介正在准备中。当前显示原文说明。

kdlbs/kandev10202026年10月26日 更新

Curate the right project context before coding or debugging. Use when starting a new session, switching areas of the codebase, output quality is drifting, a task spans backend/frontend/docs, or external instructions need to be reconciled with Kandev conventions.

中文简介正在准备中。当前显示原文说明。

kdlbs/kandev10202026年10月26日 更新

查看 kdlbs 的全部技能

报告此技能的问题