10cg/aria-plugin/phase-d-closer
Claude Code and agent skill by 10cg/aria-plugin
- community
Checking that the SKILL.md file is still in the repository.
十步循环 Phase D - 周期收尾阶段执行器,编排 D.1-D.3 步骤 (更新 cycle 进度 + 归档 Spec + 周期 handoff)。 使用场景:"Phase D"、"周期收尾"、"收尾阶段"、"更新进度并归档 Spec"、"更新 cycle 进度" 不适用 (用 session-closer): "对话收尾" / "会话收尾" / "写交接" / "session closeout" —— 那是会话维度收尾, 非开发周期收尾。
Install
npx vskill@latest install 10cg/aria-plugin/phase-d-closerSKILL.md
The same SKILL.md was published earlier as 10cg/aria-plugin/phase-d-closer.
Phase D - 收尾阶段 (Closer)
版本: 1.3.0 | 十步循环: D.1-D.4 (D.3 added by H0 2026-05-14; D.4 estimator capture by #18 2026-05-30; D.2 gate 扩展 tri-state verdict + BLOCK by #95 2026-07-05)
快速开始
我应该使用这个 Skill 吗?
使用场景:
- 需要更新 UPM 进度状态
- 需要归档完成的 OpenSpec
- 功能开发完成后的收尾阶段
- 里程碑完成时的状态同步
不使用场景:
- 无 UPM 配置 → 跳过 D.1
- 无活跃 OpenSpec → 跳过 D.2
- 快速修复 (Level 1) → 通常跳过整个 Phase D
核心功能
| 步骤 | Skill | 职责 | 输出 | |
|---|---|---|---|---|
| D.1 | progress-updater | 进度更新 | upm_updated | |
| D.2 | openspec-archive | Spec 归档 (#95 完成度 + C 分级证据闸 tri-state verdict, verdict=block 时本步 BLOCK) | spec_archived | |
| D.2b | release_gate CLI (state-scanner) | 本 cycle claim 释放 (coordination-claim-lifecycle Part C, advisory 非阻塞) | claim_released | |
| D.3 | session-handoff (本 Skill 内嵌) | 写 session handoff doc 到 docs/handoff/ | handoff_written | |
| D.4 | ai-native-estimator (capture) | 采集本 cycle token 工作量 (advisory, 非阻塞, #18 v1) | estimator_captured |
D.2b claim 释放 (coordination-claim-lifecycle-and-overlap Part C)
D.2 归档完成后 (或 D.2 跳过但本 session 曾在 Phase B-entry 经 phase1_gate 认领), 必须尝试释放本 cycle 的 claim —— 否则 claim 永久 active 累积 (defect c 根因: release_claim 按 session 定位, 收尾 session 的 fresh session_id 找不到原 claim; release_gate 按 track_id+container 定位, 专为 ship 场景设计):
- carry-id = A.1 认领时派生的那一串 —— 与 Phase B-entry 传给 phase1_gate 的是同一原始串 (归一在 CLI 内部, 两端一致); 重新拼一串会 release 不到自己那条。
--sweep-stale顺带扫全 ref 内 heartbeat 超阈的 active claim → abandoned。分层阈值 (Aria #233): 本容器 claim 24h / 其他容器 7d (SWEEP_TTL_CROSS) —— 例行收尾不再误伤心跳冻结的活跃邻居;--gc顺带归档超 retention 的 done claim —— 收尾是 GC 的自然挂载点, 无需独立调度。运维确知整 ref 死寂时可用--sweep-stale-all(全域单层 24h, 旧语义)。- advisory 契约: exit 1 (硬错) 只记录 warning 到收尾报告, 不阻断 D.3/D.4。
released.error三分 (Aria #233): claim_not_found→ benign (早已释放/未认领), exit 0;- `claim_swept` → 非 benign —— 本轨 claim 曾被
<swept_by>容器于<swept_at>扫成 abandoned (released.swept_by/swept_at带出处)。收尾报告记 ⚠️ 并请 owner 复议; 若该轨仍要继续 (非本 session 收尾场景), 恢复路径 =release_gate --raw-track-id <X> --restore(仅原 container 可恢复自己的 track); - 其他 error → 硬错处理 (warning + 复议)。
- 除 exit code 外还须看 `push_success` (review I2):
released.success=true但push_success=false= 释放只在本地生效, 远端/其他终端仍看到 active claim — 报告里注明 "本地已释放, 待下次 fetch/reconcile 收敛", 不要报成"已释放"完事。 - 本 session 未认领 (未走 phase1_gate) 时仍建议跑
--sweep-stale --gc(不带 --raw-track-id), 保持 ref 卫生。
执行流程
5 步: D.1 进度更新 (progress-updater skill, single-pass / milestone-driven 双模) → D.post post_closure audit (可选, audit.enabled+checkpoint enabled 时触发 convergence/max_rounds=1, 经验提取非阻塞) → D.2 Spec 归档 (openspec-archive skill) → D.2b claim 释放 (release_gate CLI, advisory — 见上表下方) → D.3 Session handoff (4-level fallback 触发, 路径硬编码 docs/handoff/)。
完整 step-by-step (输入 context schema + D.1/D.post/D.2/D.3 详细 action + 输出): 见 references/execution-steps.md。
跳过规则
| 条件 | 跳过步骤 | 检测方法 | |
|---|---|---|---|
| 无 UPM | D.1 | UPM 文档不存在 | |
| 无 OpenSpec | D.2 | openspec/changes/ 为空 | |
| Spec 未完成 (legacy) | D.2 (skip) | spec_complete.py --gate complete=false 且 verdict≠block (Level 2 无 tasks.md 走 Status 归一化) | |
| C-block 死代码判定 (#95) | D.2 (BLOCK, 非仅 skip) | spec_complete.py --gate verdict=block (可与 complete=true 共存 — 点名符号零生产语义引用) | |
| 触发条件未满足且 user prompt 拒绝 | D.3 | 见 §D.3 触发条件 | |
| Level 1 quick fix (无 spec, 单 commit) | D.3 | 启发式 — Level 标记或 changes.complexity |
跳过逻辑
动态子检查 (runtime_probe, #95 follow-up A): 上表 verdict 三态判定现覆盖**声明式可选动态子检查** —— spec 若在proposal.mdfrontmatter 声明runtime_probe:(partition/symbol/max_age_days/enabled_when), gate 会额外核验"该符号近期是否真被生产入口调用过", 结果按fail-toward-warn 折入同一verdict(绝不因此升级到 block; 已是 block 的不受影响)。声明是完全可选的 —— 无声明 spec 的 D.2 行为逐字节不变 (SC-1)。phase-d-closer 本身不解析该声明, 只按上表既有 verdict 路由消费折入后的结果; 声明 schema + 解析约束见折入裁决与归档写入契约见 [openspec-archive SKILL.md §Step1-2](../openspec-archive/SKILL.md) (本节不复制契约细节)。
输出格式
上图为 D.2 放行 (verdict∈{pass,warn}) 的正常路径展示。verdict=block (#95) 时 D.2 报告BLOCKED 而非"完成", D.1/D.3 仍可正常执行 — 完整 BLOCK 输出变体见
使用示例
3 个典型场景: (1) 完整收尾 (D.1+D.2 都跑) / (2) 仅更新进度 (D.2 跳过, 无关联 Spec) / (3) 全部跳过 (D.1+D.2 都跳过, 无 UPM 无 Spec)。
完整 YAML 示例 (输入 context / 执行过程 / 输出 schema): 见 references/usage-examples.md。
进度更新内容
D.1 支持 single-pass (默认, 完整 update) 和 milestone-driven (multi-PR cycle, C.2.6 增量追加 + D.1 finalize) 两种模式。UPMv2-STATE 5 字段更新 (cycleNumber/lastUpdateAt/stateToken/completedTasks/kpiSnapshot)。Spec 归档 4-step (验证 [x] / 更新 status / 移动 dir / 记录 commit info)。
完整模式对比表 + Milestone-driven 4-step finalize 职责 + UPMv2-STATE 字段定义 + Spec 归档操作: 见 references/progress-update-details.md。
错误处理
| 错误 | 原因 | 处理 | |
|---|---|---|---|
| UPM 更新失败 | 并发冲突 | 重新读取并合并 | |
| Spec 归档失败 (skip, legacy) | 任务未完成 (complete=false) | 列出未完成任务 (回显 complete_reason) | |
| Spec 归档 BLOCK (#95) | verdict=block — 点名符号零生产语义引用 (可与 complete=true 共存) | 回显 blocking_reasons; 不自动豁免 — 需 owner/AI 直接调用 openspec-archive skill 并显式带 --archive-design-only + reason 才能强制归档 | |
| 状态写入失败 | 文件权限 | 提示检查权限 |
并发冲突处理
§D.3 Session Handoff (2026-05-14, H0 spec)
session 结束时引导写 handoff doc, 让下一个 session zero-context 可恢复优先级 + carry-forward。
触发: 4-level fallback (workflow-state session_age > 4h / cycles_shipped ≥ 2 / phase_count ≥ 2 / user prompt)。 输出路径: docs/handoff/{YYYY-MM-DD}-{slug}.md (L5 hardcode, 绝对禁止 .aria/handoff/*)。 模板: aria/templates/session-handoff.md (9-section skeleton) + variable substitution。 latest.md 维护: 2 个 mechanical 子步骤 — 子步骤 1 History prepend (always) + 子步骤 2 Pointer 更新 (conditional by snapshot.tracks_multibranch multi-track detection)。
完整说明 (触发条件 4 级 fallback / 输出路径 slug 规则 / 模板 variable 字典 / latest.md 2 子步骤 + 3-row decision table + edge cases / Forbidden patterns): 见 references/handoff-mechanics.md。
§D.4 Estimator Capture (2026-05-30, #18 v1)
收尾末位子步 (D.3 之后), 自动采集本 cycle 的 token 工作量到 estimator 历史 (advisory, 非阻塞)。
触发: ai_native_estimator.enabled != false (config-loader)。
执行:
- 幂等: 无新 turn →
{"skipped": true}(watermark 空区间, 安全可重跑) - 非阻塞: 任何失败 (无 transcript / config disabled) → skip + warn, 不影响收尾闭环
- cycle_id 由 estimator 从 transcript range 末 uuid 生成 (phase-d 不传时刻)
完整数据模型 + 查询: 见 ai-native-estimator。
与其他 Phase 的关系
相关文档
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/phase-d-closer/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/10cg/aria-plugin/phase-d-closer)