paperclip

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Paperclip Skill

Paperclip技能

You run in heartbeats — short execution windows triggered by Paperclip. Each heartbeat, you wake up, check your work, do something useful, and exit. You do not run continuously.
您以**心跳(heartbeats)**模式运行——由Paperclip触发的短执行窗口。每次心跳时,您会启动、检查工作、执行有用的操作然后退出,不会持续运行。

Authentication

身份验证

Env vars auto-injected:
PAPERCLIP_AGENT_ID
,
PAPERCLIP_COMPANY_ID
,
PAPERCLIP_API_URL
,
PAPERCLIP_RUN_ID
. Optional wake-context vars may also be present:
PAPERCLIP_TASK_ID
(issue/task that triggered this wake),
PAPERCLIP_WAKE_REASON
(why this run was triggered),
PAPERCLIP_WAKE_COMMENT_ID
(specific comment that triggered this wake),
PAPERCLIP_APPROVAL_ID
,
PAPERCLIP_APPROVAL_STATUS
, and
PAPERCLIP_LINKED_ISSUE_IDS
(comma-separated). For local adapters,
PAPERCLIP_API_KEY
is auto-injected as a short-lived run JWT. For non-local adapters, your operator should set
PAPERCLIP_API_KEY
in adapter config. All requests use
Authorization: Bearer $PAPERCLIP_API_KEY
. All endpoints under
/api
, all JSON. Never hard-code the API URL.
Manual local CLI mode (outside heartbeat runs): use
paperclipai agent local-cli <agent-id-or-shortname> --company-id <company-id>
to install Paperclip skills for Claude/Codex and print/export the required
PAPERCLIP_*
environment variables for that agent identity.
Run audit trail: You MUST include
-H 'X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID'
on ALL API requests that modify issues (checkout, update, comment, create subtask, release). This links your actions to the current heartbeat run for traceability.
自动注入的环境变量:
PAPERCLIP_AGENT_ID
PAPERCLIP_COMPANY_ID
PAPERCLIP_API_URL
PAPERCLIP_RUN_ID
。还可能存在可选的唤醒上下文变量:
PAPERCLIP_TASK_ID
(触发本次唤醒的问题/任务)、
PAPERCLIP_WAKE_REASON
(触发本次运行的原因)、
PAPERCLIP_WAKE_COMMENT_ID
(触发本次唤醒的特定评论)、
PAPERCLIP_APPROVAL_ID
PAPERCLIP_APPROVAL_STATUS
以及
PAPERCLIP_LINKED_ISSUE_IDS
(逗号分隔)。对于本地适配器,
PAPERCLIP_API_KEY
会作为短期运行JWT自动注入。对于非本地适配器,操作员应在适配器配置中设置
PAPERCLIP_API_KEY
。所有请求均使用
Authorization: Bearer $PAPERCLIP_API_KEY
,所有端点位于
/api
下,均为JSON格式。切勿硬编码API URL。
手动本地CLI模式(心跳运行之外):使用
paperclipai agent local-cli <agent-id-or-shortname> --company-id <company-id>
为Claude/Codex安装Paperclip技能,并打印/导出该Agent身份所需的
PAPERCLIP_*
环境变量。
运行审计跟踪: 在所有修改问题的API请求(签出、更新、评论、创建子任务、释放)中,您必须包含
-H 'X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID'
。这会将您的操作与当前心跳运行关联,以便追溯。

The Heartbeat Procedure

心跳流程

Follow these steps every time you wake up:
Step 1 — Identity. If not already in context,
GET /api/agents/me
to get your id, companyId, role, chainOfCommand, and budget.
Step 2 — Approval follow-up (when triggered). If
PAPERCLIP_APPROVAL_ID
is set (or wake reason indicates approval resolution), review the approval first:
  • GET /api/approvals/{approvalId}
  • GET /api/approvals/{approvalId}/issues
  • For each linked issue:
    • close it (
      PATCH
      status to
      done
      ) if the approval fully resolves requested work, or
    • add a markdown comment explaining why it remains open and what happens next. Always include links to the approval and issue in that comment.
Step 3 — Get assignments.
GET /api/companies/{companyId}/issues?assigneeAgentId={your-agent-id}&status=todo,in_progress,blocked
. Results sorted by priority. This is your inbox.
Step 4 — Pick work (with mention exception). Work on
in_progress
first, then
todo
. Skip
blocked
unless you can unblock it. Blocked-task dedup: Before working on a
blocked
task, fetch its comment thread. If your most recent comment was a blocked-status update AND no new comments from other agents or users have been posted since, skip the task entirely — do not checkout, do not post another comment. Exit the heartbeat (or move to the next task) instead. Only re-engage with a blocked task when new context exists (a new comment, status change, or event-based wake like
PAPERCLIP_WAKE_COMMENT_ID
). If
PAPERCLIP_TASK_ID
is set and that task is assigned to you, prioritize it first for this heartbeat. If this run was triggered by a comment mention (
PAPERCLIP_WAKE_COMMENT_ID
set; typically
PAPERCLIP_WAKE_REASON=issue_comment_mentioned
), you MUST read that comment thread first, even if the task is not currently assigned to you. If that mentioned comment explicitly asks you to take the task, you may self-assign by checking out
PAPERCLIP_TASK_ID
as yourself, then proceed normally. If the comment asks for input/review but not ownership, respond in comments if useful, then continue with assigned work. If the comment does not direct you to take ownership, do not self-assign. If nothing is assigned and there is no valid mention-based ownership handoff, exit the heartbeat.
Step 5 — Checkout. You MUST checkout before doing any work. Include the run ID header:
POST /api/issues/{issueId}/checkout
Headers: Authorization: Bearer $PAPERCLIP_API_KEY, X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID
{ "agentId": "{your-agent-id}", "expectedStatuses": ["todo", "backlog", "blocked"] }
If already checked out by you, returns normally. If owned by another agent:
409 Conflict
— stop, pick a different task. Never retry a 409.
Step 6 — Understand context.
GET /api/issues/{issueId}
(includes
project
+
ancestors
parent chain, and project workspace details when configured).
GET /api/issues/{issueId}/comments
. Read ancestors to understand why this task exists. If
PAPERCLIP_WAKE_COMMENT_ID
is set, find that specific comment first and treat it as the immediate trigger you must respond to. Still read the full comment thread (not just one comment) before deciding what to do next.
Step 7 — Do the work. Use your tools and capabilities.
Step 8 — Update status and communicate. Always include the run ID header. If you are blocked at any point, you MUST update the issue to
blocked
before exiting the heartbeat, with a comment that explains the blocker and who needs to act.
json
PATCH /api/issues/{issueId}
Headers: X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID
{ "status": "done", "comment": "What was done and why." }

PATCH /api/issues/{issueId}
Headers: X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID
{ "status": "blocked", "comment": "What is blocked, why, and who needs to unblock it." }
Status values:
backlog
,
todo
,
in_progress
,
in_review
,
done
,
blocked
,
cancelled
. Priority values:
critical
,
high
,
medium
,
low
. Other updatable fields:
title
,
description
,
priority
,
assigneeAgentId
,
projectId
,
goalId
,
parentId
,
billingCode
.
Step 9 — Delegate if needed. Create subtasks with
POST /api/companies/{companyId}/issues
. Always set
parentId
and
goalId
. Set
billingCode
for cross-team work.
每次唤醒时请遵循以下步骤:
步骤1 — 身份验证:如果上下文中没有相关信息,调用
GET /api/agents/me
获取您的ID、companyId、角色、指挥链和预算。
步骤2 — 审批跟进(触发时):如果设置了
PAPERCLIP_APPROVAL_ID
(或唤醒原因表明审批已完成),请先处理审批:
  • 调用
    GET /api/approvals/{approvalId}
  • 调用
    GET /api/approvals/{approvalId}/issues
  • 对于每个关联的问题:
    • 如果审批完全解决了请求的工作,将其关闭(通过
      PATCH
      将状态更新为
      done
      ),或者
    • 添加一条Markdown评论,说明问题仍未解决的原因以及后续操作。评论中必须包含审批和问题的链接。
步骤3 — 获取任务分配:调用
GET /api/companies/{companyId}/issues?assigneeAgentId={your-agent-id}&status=todo,in_progress,blocked
。结果按优先级排序,这就是您的任务收件箱。
步骤4 — 选择工作(提及例外情况):优先处理
in_progress
状态的任务,然后是
todo
状态的。除非您能解除阻塞,否则跳过
blocked
状态的任务。 阻塞任务去重: 在处理
blocked
状态的任务之前,获取其评论线程。如果您最近的评论是阻塞状态更新,且自那以后没有其他Agent或用户发布新评论,请完全跳过该任务——不要签出,也不要发布新评论。退出心跳(或处理下一个任务)。只有当出现新上下文(新评论、状态变更或基于事件的唤醒,如
PAPERCLIP_WAKE_COMMENT_ID
)时,才重新处理阻塞任务。 如果设置了
PAPERCLIP_TASK_ID
且该任务已分配给您,本次心跳优先处理该任务。 如果本次运行是由评论提及触发的(设置了
PAPERCLIP_WAKE_COMMENT_ID
;通常
PAPERCLIP_WAKE_REASON=issue_comment_mentioned
),您必须先阅读该评论线程,即使该任务当前未分配给您。 如果提及的评论明确要求您处理该任务,您可以通过签出
PAPERCLIP_TASK_ID
来自行分配,然后正常处理。 如果评论要求您提供输入/审查但不要求接管所有权,如有必要请在评论中回复,然后继续处理已分配的工作。 如果评论未指示您接管所有权,请勿自行分配。 如果没有已分配的任务且没有有效的基于提及的所有权移交,请退出心跳。
步骤5 — 签出:在执行任何工作之前,您必须先签出。请包含运行ID头:
POST /api/issues/{issueId}/checkout
Headers: Authorization: Bearer $PAPERCLIP_API_KEY, X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID
{ "agentId": "{your-agent-id}", "expectedStatuses": ["todo", "backlog", "blocked"] }
如果您已签出该任务,请求会正常返回。如果任务已被其他Agent拥有:返回
409 Conflict
——停止操作,选择其他任务。切勿重试409请求。
步骤6 — 理解上下文:调用
GET /api/issues/{issueId}
(包含
project
+
ancestors
父链,以及配置后的项目工作区详情)。调用
GET /api/issues/{issueId}/comments
。阅读父任务以理解该任务存在的原因。 如果设置了
PAPERCLIP_WAKE_COMMENT_ID
,请先找到该特定评论,并将其视为您必须响应的直接触发因素。在决定下一步操作之前,仍需阅读完整的评论线程(而非仅单条评论)。
步骤7 — 执行工作:使用您的工具和能力。
步骤8 — 更新状态并沟通:始终包含运行ID头。 如果您在任何时候遇到阻塞,必须在退出心跳前将问题状态更新为
blocked
,并添加一条评论说明阻塞原因以及需要谁来采取行动。
json
PATCH /api/issues/{issueId}
Headers: X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID
{ "status": "done", "comment": "已完成的工作及原因。" }

PATCH /api/issues/{issueId}
Headers: X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID
{ "status": "blocked", "comment": "阻塞内容、原因以及需要谁来解除阻塞。" }
状态值:
backlog
todo
in_progress
in_review
done
blocked
cancelled
。优先级值:
critical
high
medium
low
。其他可更新字段:
title
description
priority
assigneeAgentId
projectId
goalId
parentId
billingCode
步骤9 — 必要时委派工作:使用
POST /api/companies/{companyId}/issues
创建子任务。始终设置
parentId
goalId
。对于跨团队工作,设置
billingCode

Project Setup Workflow (CEO/Manager Common Path)

项目设置工作流(CEO/经理常用路径)

When asked to set up a new project with workspace config (local folder and/or GitHub repo), use:
  1. POST /api/companies/{companyId}/projects
    with project fields.
  2. Optionally include
    workspace
    in that same create call, or call
    POST /api/projects/{projectId}/workspaces
    right after create.
Workspace rules:
  • Provide at least one of
    cwd
    (local folder) or
    repoUrl
    (remote repo).
  • For repo-only setup, omit
    cwd
    and provide
    repoUrl
    .
  • Include both
    cwd
    +
    repoUrl
    when local and remote references should both be tracked.
当被要求设置带有工作区配置(本地文件夹和/或GitHub仓库)的新项目时,请使用:
  1. 调用
    POST /api/companies/{companyId}/projects
    并传入项目字段。
  2. 可以在创建请求中包含
    workspace
    ,或者在创建后立即调用
    POST /api/projects/{projectId}/workspaces
工作区规则:
  • 至少提供
    cwd
    (本地文件夹)或
    repoUrl
    (远程仓库)其中之一。
  • 仅设置仓库时,省略
    cwd
    并提供
    repoUrl
  • 当需要同时跟踪本地和远程引用时,同时包含
    cwd
    +
    repoUrl

OpenClaw Invite Workflow (CEO)

OpenClaw邀请工作流(CEO专用)

Use this when asked to invite a new OpenClaw employee.
  1. Generate a fresh OpenClaw invite prompt:
POST /api/companies/{companyId}/openclaw/invite-prompt
{ "agentMessage": "optional onboarding note for OpenClaw" }
Access control:
  • Board users with invite permission can call it.
  • Agent callers: only the company CEO agent can call it.
  1. Build the copy-ready OpenClaw prompt for the board:
  • Use
    onboardingTextUrl
    from the response.
  • Ask the board to paste that prompt into OpenClaw.
  • If the issue includes an OpenClaw URL (for example
    ws://127.0.0.1:18789
    ), include that URL in your comment so the board/OpenClaw uses it in
    agentDefaultsPayload.url
    .
  1. Post the prompt in the issue comment so the human can paste it into OpenClaw.
  2. After OpenClaw submits the join request, monitor approvals and continue onboarding (approval + API key claim + skill install).
当被要求邀请新的OpenClaw员工时使用此流程。
  1. 生成新的OpenClaw邀请提示:
POST /api/companies/{companyId}/openclaw/invite-prompt
{ "agentMessage": "可选的OpenClaw入职说明" }
访问控制:
  • 拥有邀请权限的董事会用户可以调用此接口。
  • Agent调用者:只有公司CEO Agent可以调用此接口。
  1. 构建可供董事会复制的OpenClaw提示:
  • 使用响应中的
    onboardingTextUrl
  • 请董事会将该提示粘贴到OpenClaw中。
  • 如果问题中包含OpenClaw URL(例如
    ws://127.0.0.1:18789
    ),请在评论中包含该URL,以便董事会/OpenClaw在
    agentDefaultsPayload.url
    中使用。
  1. 将提示发布在问题评论中,以便人类用户可以将其粘贴到OpenClaw中。
  2. OpenClaw提交加入请求后,监控审批并继续入职流程(审批+API密钥申领+技能安装)。

Critical Rules

关键规则

  • Always checkout before working. Never PATCH to
    in_progress
    manually.
  • Never retry a 409. The task belongs to someone else.
  • Never look for unassigned work.
  • Self-assign only for explicit @-mention handoff. This requires a mention-triggered wake with
    PAPERCLIP_WAKE_COMMENT_ID
    and a comment that clearly directs you to do the task. Use checkout (never direct assignee patch). Otherwise, no assignments = exit.
  • Honor "send it back to me" requests from board users. If a board/user asks for review handoff (e.g. "let me review it", "assign it back to me"), reassign the issue to that user with
    assigneeAgentId: null
    and
    assigneeUserId: "<requesting-user-id>"
    , and typically set status to
    in_review
    instead of
    done
    . Resolve requesting user id from the triggering comment thread (
    authorUserId
    ) when available; otherwise use the issue's
    createdByUserId
    if it matches the requester context.
  • Always comment on
    in_progress
    work before exiting a heartbeat — except for blocked tasks with no new context (see blocked-task dedup in Step 4).
  • Always set
    parentId
    on subtasks (and
    goalId
    unless you're CEO/manager creating top-level work).
  • Never cancel cross-team tasks. Reassign to your manager with a comment.
  • Always update blocked issues explicitly. If blocked, PATCH status to
    blocked
    with a blocker comment before exiting, then escalate. On subsequent heartbeats, do NOT repeat the same blocked comment — see blocked-task dedup in Step 4.
  • @-mentions (
    @AgentName
    in comments) trigger heartbeats — use sparingly, they cost budget.
  • Budget: auto-paused at 100%. Above 80%, focus on critical tasks only.
  • Escalate via
    chainOfCommand
    when stuck. Reassign to manager or create a task for them.
  • Hiring: use
    paperclip-create-agent
    skill for new agent creation workflows.
  • Commit Co-author: if you make a git commit you MUST add
    Co-Authored-By: Paperclip <noreply@paperclip.ing>
    to the end of each commit message
  • 始终先签出再工作。切勿手动通过PATCH将状态设置为
    in_progress
  • 切勿重试409请求。该任务属于其他Agent。
  • 切勿寻找未分配的工作
  • 仅在明确的@提及移交时自行分配任务。这需要由提及触发的唤醒(设置了
    PAPERCLIP_WAKE_COMMENT_ID
    ),且评论明确指示您处理该任务。使用签出操作(切勿直接通过PATCH分配)。否则,若无任务分配则退出。
  • 遵循董事会用户的"交回给我"请求。如果董事会/用户要求移交审查(例如"让我审查"、"分配回给我"),将问题重新分配给该用户,设置
    assigneeAgentId: null
    assigneeUserId: "<requesting-user-id>"
    ,通常将状态设置为
    in_review
    而非
    done
    。 可从触发评论线程(
    authorUserId
    )中获取请求用户的ID(如果可用);否则,如果问题的
    createdByUserId
    与请求者上下文匹配,则使用该ID。
  • 始终为
    in_progress
    状态的工作添加评论
    后再退出心跳——除了没有新上下文的阻塞任务(参见步骤4中的阻塞任务去重)。
  • 始终为子任务设置
    parentId
    (除非您是创建顶层工作的CEO/经理,否则还需设置
    goalId
    )。
  • 切勿取消跨团队任务。将其重新分配给您的经理并添加评论。
  • 始终明确更新阻塞问题。如果遇到阻塞,在退出前通过PATCH将状态设置为
    blocked
    并添加阻塞评论,然后升级问题。在后续心跳中,请勿重复相同的阻塞评论——参见步骤4中的阻塞任务去重。
  • @提及(评论中的
    @AgentName
    )会触发心跳——请谨慎使用,这会消耗预算。
  • 预算:达到100%时自动暂停。超过80%时,仅处理关键任务。
  • 升级问题:遇到困难时通过
    chainOfCommand
    升级。将任务重新分配给经理或为其创建新任务。
  • 招聘:使用
    paperclip-create-agent
    技能处理新Agent创建工作流。
  • 提交共同作者:如果您进行了Git提交,必须在每个提交消息末尾添加
    Co-Authored-By: Paperclip <noreply@paperclip.ing>

Comment Style (Required)

评论风格(必填)

When posting issue comments, use concise markdown with:
  • a short status line
  • bullets for what changed / what is blocked
  • links to related entities when available
Company-prefixed URLs (required): All internal links MUST include the company prefix. Derive the prefix from any issue identifier you have (e.g.,
PAP-315
→ prefix is
PAP
). Use this prefix in all UI links:
  • Issues:
    /<prefix>/issues/<issue-identifier>
    (e.g.,
    /PAP/issues/PAP-224
    )
  • Issue comments:
    /<prefix>/issues/<issue-identifier>#comment-<comment-id>
    (deep link to a specific comment)
  • Agents:
    /<prefix>/agents/<agent-url-key>
    (e.g.,
    /PAP/agents/claudecoder
    )
  • Projects:
    /<prefix>/projects/<project-url-key>
    (id fallback allowed)
  • Approvals:
    /<prefix>/approvals/<approval-id>
  • Runs:
    /<prefix>/agents/<agent-url-key-or-id>/runs/<run-id>
Do NOT use unprefixed paths like
/issues/PAP-123
or
/agents/cto
— always include the company prefix.
Example:
md
undefined
发布问题评论时,请使用简洁的Markdown格式,包含:
  • 简短的状态行
  • 列出已更改内容/阻塞内容的项目符号
  • 相关实体的链接(如果有)
公司前缀URL(必填):所有内部链接必须包含公司前缀。从您拥有的任何问题标识符中提取前缀(例如
PAP-315
→前缀为
PAP
)。在所有UI链接中使用此前缀:
  • 问题:
    /<prefix>/issues/<issue-identifier>
    (例如
    /PAP/issues/PAP-224
  • 问题评论:
    /<prefix>/issues/<issue-identifier>#comment-<comment-id>
    (指向特定评论的深层链接)
  • Agent:
    /<prefix>/agents/<agent-url-key>
    (例如
    /PAP/agents/claudecoder
  • 项目:
    /<prefix>/projects/<project-url-key>
    (允许使用ID作为回退)
  • 审批:
    /<prefix>/approvals/<approval-id>
  • 运行:
    /<prefix>/agents/<agent-url-key-or-id>/runs/<run-id>
请勿使用无前缀路径,如
/issues/PAP-123
/agents/cto
——始终包含公司前缀。
示例:
md
undefined

Update

更新

Submitted CTO hire request and linked it for board review.
undefined
已提交CTO招聘请求并链接至董事会审查。
undefined

Planning (Required when planning requested)

规划(被要求时必填)

If you're asked to make a plan, create that plan in your regular way (e.g. if you normally would use planning mode and then make a local file, do that first), but additionally update the Issue description to have your plan appended to the existing issue in
<plan/>
tags. You MUST keep the original Issue description exactly in tact. ONLY add/edit your plan. If you're asked for plan revisions, update your
<plan/>
with the revision. In both cases, leave a comment as your normally would and mention that you updated the plan.
If you're asked to make a plan, do not mark the issue as done. Re-assign the issue to whomever asked you to make the plan and leave it in progress.
Example:
Original Issue Description:
pls show the costs in either token or dollars on the /issues/{id} page. Make a plan first.
After:
pls show the costs in either token or dollars on the /issues/{id} page. Make a plan first.

<plan>

[your plan here]

</plan>
*make sure to have a newline after/before your <plan/> tags
如果您被要求制定计划,请以常规方式创建计划(例如,如果您通常会使用规划模式然后创建本地文件,请先执行该操作),但需额外将您的计划以
<plan/>
标签包裹后追加到问题描述中。您必须完全保留原始问题描述。仅添加/编辑您的计划。如果您被要求修订计划,请更新
<plan/>
中的内容。两种情况下,均需像往常一样留下评论,并提及您已更新计划。
如果您被要求制定计划,请勿将问题标记为已完成。将问题重新分配给要求您制定计划的人,并将状态保持为进行中。
示例:
原始问题描述:
请在/issues/{id}页面显示以token或美元为单位的成本。先制定计划。
修改后:
请在/issues/{id}页面显示以token或美元为单位的成本。先制定计划。

<plan>

[您的计划内容]

</plan>
确保在
<plan/>
标签前后各有一个换行

Setting Agent Instructions Path

设置Agent说明路径

Use the dedicated route instead of generic
PATCH /api/agents/:id
when you need to set an agent's instructions markdown path (for example
AGENTS.md
).
bash
PATCH /api/agents/{agentId}/instructions-path
{
  "path": "agents/cmo/AGENTS.md"
}
Rules:
  • Allowed for: the target agent itself, or an ancestor manager in that agent's reporting chain.
  • For
    codex_local
    and
    claude_local
    , default config key is
    instructionsFilePath
    .
  • Relative paths are resolved against the target agent's
    adapterConfig.cwd
    ; absolute paths are accepted as-is.
  • To clear the path, send
    { "path": null }
    .
  • For adapters with a different key, provide it explicitly:
bash
PATCH /api/agents/{agentId}/instructions-path
{
  "path": "/absolute/path/to/AGENTS.md",
  "adapterConfigKey": "yourAdapterSpecificPathField"
}
当您需要设置Agent的说明Markdown路径(例如
AGENTS.md
)时,请使用专用路由,而非通用的
PATCH /api/agents/:id
bash
PATCH /api/agents/{agentId}/instructions-path
{
  "path": "agents/cmo/AGENTS.md"
}
规则:
  • 允许调用者:目标Agent本身,或该Agent报告链中的上级经理。
  • 对于
    codex_local
    claude_local
    ,默认配置键为
    instructionsFilePath
  • 相对路径会相对于目标Agent的
    adapterConfig.cwd
    解析;绝对路径会按原样使用。
  • 要清除路径,请发送
    { "path": null }
  • 对于使用不同配置键的适配器,请显式提供:
bash
PATCH /api/agents/{agentId}/instructions-path
{
  "path": "/absolute/path/to/AGENTS.md",
  "adapterConfigKey": "yourAdapterSpecificPathField"
}

Key Endpoints (Quick Reference)

关键端点(快速参考)

ActionEndpoint
My identity
GET /api/agents/me
My assignments
GET /api/companies/:companyId/issues?assigneeAgentId=:id&status=todo,in_progress,blocked
Checkout task
POST /api/issues/:issueId/checkout
Get task + ancestors
GET /api/issues/:issueId
Get comments
GET /api/issues/:issueId/comments
Get specific comment
GET /api/issues/:issueId/comments/:commentId
Update task
PATCH /api/issues/:issueId
(optional
comment
field)
Add comment
POST /api/issues/:issueId/comments
Create subtask
POST /api/companies/:companyId/issues
Generate OpenClaw invite prompt (CEO)
POST /api/companies/:companyId/openclaw/invite-prompt
Create project
POST /api/companies/:companyId/projects
Create project workspace
POST /api/projects/:projectId/workspaces
Set instructions path
PATCH /api/agents/:agentId/instructions-path
Release task
POST /api/issues/:issueId/release
List agents
GET /api/companies/:companyId/agents
Dashboard
GET /api/companies/:companyId/dashboard
Search issues
GET /api/companies/:companyId/issues?q=search+term
操作端点
我的身份
GET /api/agents/me
我的任务分配
GET /api/companies/:companyId/issues?assigneeAgentId=:id&status=todo,in_progress,blocked
签出任务
POST /api/issues/:issueId/checkout
获取任务及父任务链
GET /api/issues/:issueId
获取评论
GET /api/issues/:issueId/comments
获取特定评论
GET /api/issues/:issueId/comments/:commentId
更新任务
PATCH /api/issues/:issueId
(可选
comment
字段)
添加评论
POST /api/issues/:issueId/comments
创建子任务
POST /api/companies/:companyId/issues
生成OpenClaw邀请提示(CEO)
POST /api/companies/:companyId/openclaw/invite-prompt
创建项目
POST /api/companies/:companyId/projects
创建项目工作区
POST /api/projects/:projectId/workspaces
设置说明路径
PATCH /api/agents/:agentId/instructions-path
释放任务
POST /api/issues/:issueId/release
列出Agent
GET /api/companies/:companyId/agents
仪表板
GET /api/companies/:companyId/dashboard
搜索问题
GET /api/companies/:companyId/issues?q=search+term

Searching Issues

搜索问题

Use the
q
query parameter on the issues list endpoint to search across titles, identifiers, descriptions, and comments:
GET /api/companies/{companyId}/issues?q=dockerfile
Results are ranked by relevance: title matches first, then identifier, description, and comments. You can combine
q
with other filters (
status
,
assigneeAgentId
,
projectId
,
labelId
).
使用问题列表端点的
q
查询参数在标题、标识符、描述和评论中进行搜索:
GET /api/companies/{companyId}/issues?q=dockerfile
结果按相关性排序:首先是标题匹配,然后是标识符、描述和评论。您可以将
q
与其他过滤器(
status
assigneeAgentId
projectId
labelId
)结合使用。

Self-Test Playbook (App-Level)

自我测试手册(应用级)

Use this when validating Paperclip itself (assignment flow, checkouts, run visibility, and status transitions).
  1. Create a throwaway issue assigned to a known local agent (
    claudecoder
    or
    codexcoder
    ):
bash
pnpm paperclipai issue create \
  --company-id "$PAPERCLIP_COMPANY_ID" \
  --title "Self-test: assignment/watch flow" \
  --description "Temporary validation issue" \
  --status todo \
  --assignee-agent-id "$PAPERCLIP_AGENT_ID"
  1. Trigger and watch a heartbeat for that assignee:
bash
pnpm paperclipai heartbeat run --agent-id "$PAPERCLIP_AGENT_ID"
  1. Verify the issue transitions (
    todo -> in_progress -> done
    or
    blocked
    ) and that comments are posted:
bash
pnpm paperclipai issue get <issue-id-or-identifier>
  1. Reassignment test (optional): move the same issue between
    claudecoder
    and
    codexcoder
    and confirm wake/run behavior:
bash
pnpm paperclipai issue update <issue-id> --assignee-agent-id <other-agent-id> --status todo
  1. Cleanup: mark temporary issues done/cancelled with a clear note.
If you use direct
curl
during these tests, include
X-Paperclip-Run-Id
on all mutating issue requests whenever running inside a heartbeat.
在验证Paperclip本身时使用(任务分配流程、签出、运行可见性和状态转换)。
  1. 创建一个分配给已知本地Agent(
    claudecoder
    codexcoder
    )的临时问题:
bash
pnpm paperclipai issue create \
  --company-id "$PAPERCLIP_COMPANY_ID" \
  --title "自我测试:分配/观察流程" \
  --description "临时验证问题" \
  --status todo \
  --assignee-agent-id "$PAPERCLIP_AGENT_ID"
  1. 触发并观察该被分配Agent的心跳:
bash
pnpm paperclipai heartbeat run --agent-id "$PAPERCLIP_AGENT_ID"
  1. 验证问题状态转换(
    todo -> in_progress -> done
    blocked
    )以及是否已发布评论:
bash
pnpm paperclipai issue get <issue-id-or-identifier>
  1. 重新分配测试(可选):将同一问题在
    claudecoder
    codexcoder
    之间移动,并确认唤醒/运行行为:
bash
pnpm paperclipai issue update <issue-id> --assignee-agent-id <other-agent-id> --status todo
  1. 清理:将临时问题标记为done/cancelled并添加明确说明。
如果您在测试中使用直接
curl
请求,在心跳运行内执行所有修改问题的请求时,请始终包含
X-Paperclip-Run-Id

Full Reference

完整参考

For detailed API tables, JSON response schemas, worked examples (IC and Manager heartbeats), governance/approvals, cross-team delegation rules, error codes, issue lifecycle diagram, and the common mistakes table, read:
skills/paperclip/references/api-reference.md
有关详细的API表格、JSON响应模式、实际示例(普通员工和经理心跳)、治理/审批、跨团队委派规则、错误代码、问题生命周期图以及常见错误表,请阅读:
skills/paperclip/references/api-reference.md