/aport-complete — Verify Before Done
Your APort passport defines what you must deliver before a task is complete.
This skill enforces that contract. Do not mark any task done without running this first.
When to use this skill
- - Before telling a user "I'm done" or "it's complete"
- Before closing a task, ticket, or GitHub issue
- Before opening a PR and considering work finished
- Before handing off to another agent
- Any time you would otherwise call a task complete
Prerequisites
You must have an APort passport with a deliverable contract.
If you don't have one, create a passport first:
- - Web: https://aport.id
- CLI: INLINECODE0
- Agent skill: Read https://aport.id/skill and follow the instructions
You need APORT_AGENT_ID in your environment. This is returned when you create
your passport and saved to aport-passport.json.
Step 1 — Compile your completion context
Before calling the API, gather:
| Field | Required | How to get it |
|---|
| INLINECODE3 | Yes | The task/ticket/issue identifier |
| INLINECODE4 |
Yes |
code,
document,
analysis,
plan,
data, or
other |
|
summary | If passport requires it | Write a clear summary of what you did |
|
tests_passing | If passport requires it | Run your test suite, report result |
|
author_agent_id | If reviewer required | Your own
APORT_AGENT_ID |
|
reviewer_agent_id | If reviewer required | The
agent_id of the reviewing agent |
|
criteria_attestations | Always | One entry per criterion in your passport |
|
output_content | If scan_output enabled | Your full output (for pattern scanning) |
Step 2 — Build your attestations
Your passport defines acceptance criteria as a list of descriptions.
Each criterion maps to a criterion_id — the description slugified to lowercase
with spaces replaced by hyphens.
Example:
CODEBLOCK0
For each criterion in your passport, you must submit:
CODEBLOCK1
Evidence must be non-empty. "I believe this is met" is not evidence.
Good evidence: PR #47 at github.com/org/repo/pull/47
Good evidence: grep -r "TODO" src/ returned 0 results
Good evidence: INLINECODE22
Step 3 — Call the verify endpoint
CODEBLOCK2
Note: agent_id goes inside context, alongside the policy-specific fields.
Step 4 — Handle the response
ALLOW response
{
"decision": {
"decision_id": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
"allow": true,
"reasons": [
{ "code": "capability_verified", "message": "...", "severity": "info" }
],
"created_at": "2026-03-13T09:00:00Z",
"signature": "...",
"policy_id": "deliverable.task.complete.v1",
"agent_id": "ap_..."
},
"request_id": "..."
}
The task is done. You may mark it complete, close the ticket, open the PR.
Reference the
decision_id in your completion message for the audit trail.
DENY response
CODEBLOCK4
Do not mark the task done. Check decision.reasons[].code for the deny code. Fix the issue and retry.
| deny_code | What it means | What to do |
|---|
| INLINECODE27 | Summary too short or missing | Rewrite summary with more detail |
| INLINECODE28 |
Tests failing or not submitted | Fix tests, resubmit with
tests_passing: true |
|
oap.criteria_not_met | A criterion has
met: false | Resolve the criterion, re-attest |
|
oap.evidence_missing | An attestation has no evidence | Add a concrete evidence string |
|
oap.criteria_incomplete | Missing attestation for a criterion | Add attestations for all passport criteria |
|
oap.self_review_not_allowed | Reviewer and author are the same | Get a different agent to review |
|
oap.blocked_pattern_detected | Output contains blocked content | Remove blocked patterns, resubmit |
|
oap.passport_suspended | Passport is suspended | Contact APort — your passport needs attention |
|
oap.unknown_capability | Passport missing deliverable.task.complete | Create a new passport with a deliverable contract |
Step 5 — Announce completion
Once you receive allow: true, tell the user:
- - What you completed
- The decision_id (if they want the audit trail)
- Any next steps
Do not say "done" before receiving allow: true. The contract defines done, not you.
Retry behaviour
The deny_code is designed for autonomous retry. If you receive:
- -
oap.summary_insufficient → rewrite your summary and retry immediately - INLINECODE41 → add evidence strings and retry immediately
- INLINECODE42 → attempt to fix the failing tests, then retry
- INLINECODE43 → remove the blocked content, then retry
- INLINECODE44 → this requires another agent — ask the user or route to reviewer
- INLINECODE45 → attempt to resolve the criterion, then retry
Maximum retries: 3. After 3 denials on the same task, surface the issue to the user.
Do not loop indefinitely.
Links
- - Create a passport: https://aport.id (web) or
npx aport-id (CLI) or https://aport.id/skill (agent) - Your passport: https://aport.id/passport/YOURSLUG
- Verify a decision: GET https://aport.io/api/verify/decisions/get/DECISIONID
- API docs: https://aport.io/api/documentation
/aport-complete — 完成前验证
您的APort通行证定义了任务完成前必须交付的内容。
此技能强制执行该契约。在未运行此技能前,不得将任何任务标记为完成。
何时使用此技能
- - 在告知用户我已完成或任务完成之前
- 在关闭任务、工单或GitHub Issue之前
- 在提交PR并认为工作已完成之前
- 在交接给其他代理之前
- 任何您认为任务已完成的时候
前置条件
您必须拥有包含可交付物契约的APort通行证。
如果没有通行证,请先创建一个:
- - 网页端: https://aport.id
- 命令行: npx aport-id
- 代理技能: 阅读 https://aport.id/skill 并按照说明操作
您需要在环境中设置 APORTAGENTID。该ID在创建通行证时返回,并保存到 aport-passport.json 文件中。
步骤 1 — 整理完成上下文
在调用API之前,请收集以下信息:
| 字段 | 是否必需 | 如何获取 |
|---|
| taskid | 是 | 任务/工单/Issue标识符 |
| outputtype |
是 | code、document、analysis、plan、data 或 other |
| summary | 如果通行证要求 | 清晰描述您完成的工作 |
| tests_passing | 如果通行证要求 | 运行测试套件,报告结果 |
| author
agentid | 如果需要审核人 | 您自己的 APORT
AGENTID |
| reviewer
agentid | 如果需要审核人 | 审核代理的 agent_id |
| criteria_attestations | 始终需要 | 通行证中每个标准对应一个条目 |
| output_content | 如果启用了输出扫描 | 您的完整输出(用于模式扫描) |
步骤 2 — 构建证明
您的通行证将验收标准定义为一系列描述。
每个标准对应一个 criterion_id — 将描述转换为小写,空格替换为连字符。
示例:
标准描述:必须生成具体的输出工件
criterion_id: 必须生成具体的输出工件
对于通行证中的每个标准,您必须提交:
json
{
criterion_id: 必须生成具体的输出工件,
met: true,
evidence: 具体证据 — 文件路径、PR链接、CI运行ID、命令输出
}
证据不能为空。我认为这已满足不是有效证据。
有效证据:PR #47 at github.com/org/repo/pull/47
有效证据:grep -r TODO src/ 返回 0 个结果
有效证据:CI运行 #1234 通过 — https://ci.example.com/runs/1234
步骤 3 — 调用验证接口
POST https://aport.io/api/verify/policy/deliverable.task.complete.v1
Content-Type: application/json
{
context: {
agentid: 您的APORTAGENT_ID,
task_id: 任务标识符,
output_type: code,
authoragentid: 您的APORTAGENTID,
summary: 您完成的工作 — 必须满足通行证中的最低字数要求,
tests_passing: true,
criteria_attestations: [
{
criterion_id: 标准-slug-此处,
met: true,
evidence: 具体证据字符串
}
]
}
}
注意:agent_id 放在 context 内部,与策略特定字段并列。
步骤 4 — 处理响应
ALLOW 响应
json
{
decision: {
decision_id: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx,
allow: true,
reasons: [
{ code: capability_verified, message: ..., severity: info }
],
created_at: 2026-03-13T09:00:00Z,
signature: ...,
policy_id: deliverable.task.complete.v1,
agent
id: ap...
},
request_id: ...
}
任务已完成。您可以将其标记为完成、关闭工单或提交PR。
在完成消息中引用 decision_id 以便审计追踪。
DENY 响应
json
{
decision: {
decision_id: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx,
allow: false,
reasons: [
{ code: oap.summary_insufficient, message: 需要提供摘要..., severity: error }
]
},
request_id: ...
}
不要将任务标记为完成。检查 decision.reasons[].code 获取拒绝代码。修复问题后重试。
| 拒绝代码 | 含义 | 操作 |
|---|
| oap.summaryinsufficient | 摘要过短或缺失 | 重写摘要,增加更多细节 |
| oap.testsnotpassing |
测试失败或未提交 | 修复测试,重新提交并设置 testspassing: true |
| oap.criteria
notmet | 某个标准的 met 为 false | 解决该标准问题,重新证明 |
| oap.evidence_missing | 证明缺少证据 | 添加具体证据字符串 |
| oap.criteria_incomplete | 缺少某个标准的证明 | 为所有通行证标准添加证明 |
| oap.self
reviewnot_allowed | 审核人与作者相同 | 请其他代理进行审核 |
| oap.blocked
patterndetected | 输出包含被阻止的内容 | 移除被阻止的模式,重新提交 |
| oap.passport_suspended | 通行证被暂停 | 联系APort — 您的通行证需要处理 |
| oap.unknown_capability | 通行证缺少 deliverable.task.complete | 创建包含可交付物契约的新通行证 |
步骤 5 — 宣布完成
一旦收到 allow: true,告知用户:
- - 您完成了什么
- decision_id(如果他们需要审计追踪)
- 任何后续步骤
在收到 allow: true 之前,不要说完成。契约定义了完成,而不是您。
重试行为
拒绝代码设计用于自主重试。如果您收到:
- - oap.summaryinsufficient → 重写摘要并立即重试
- oap.evidencemissing → 添加证据字符串并立即重试
- oap.testsnotpassing → 尝试修复失败的测试,然后重试
- oap.blockedpatterndetected → 移除被阻止的内容,然后重试
- oap.selfreviewnotallowed → 需要其他代理 — 询问用户或转给审核人
- oap.criterianot_met → 尝试解决该标准问题,然后重试
最大重试次数:3次。同一任务被拒绝3次后,将问题反馈给用户。
不要无限循环。
链接
- - 创建通行证:https://aport.id(网页端)或 npx aport-id(命令行)或 https://aport.id/skill(代理)
- 您的通行证:https://aport.id/passport/您的SLUG
- 验证决策:GET https://aport.io/api/verify/decisions/get/决策ID
- API文档:https://aport.io/api/documentation