SuperAPI AI Directory

cx-summary

Deployment & operations

View repository

Updated 10-16 00:03

About this skill

cx-summary: Closure and Summary

Only responsible for wrapping up, does not participate in execution-state main control.

Read first:

  • ${CLAUDE_PLUGIN_ROOT}/core/workflow/README.md
  • ${CLAUDE_PLUGIN_ROOT}/core/workflow/protocols/summary.md

How to Use

/cx:cx-summary
/cx:cx-summary {功能名}

Mandatory Rules

All file reads and writes must use absolute paths. Do not use ../ relative paths. First use git rev-parse --show-toplevel to obtain the absolute path.

Operating Principles

  • Enter summary only after the feature is completed
  • cx:summary Not responsible for remedying execution issues
  • GitHub 为同步镜像, project-level 开发文档/CX工作流 + .cx is the truth
  • This is the cc adapter wrap-up action on the Claude Code side; it will not arbitrarily rewrite other runners' leases
  • After the user explicitly confirms "start wrapping up", the workflow is allowed to automatically transition into this skill

Core Steps

Step 0: Read closure inputs

  • The current feature's 状态.json
  • 需求.md / 设计.md / 架构决策.md / 总结.md
  • relevant git commits for this round

Step 1: Optional code review

If code_review=true,MUST (MUST) use the AskUserQuestion tool to ask:

{
  "questions": [
    {
      "question": "闭环前做代码审查吗?",
      "header": "Code Review",
      "multiSelect": false,
      "options": [
        {
          "label": "全面审查 (Recommended)",
          "description": "完整检查代码质量、契约一致性和测试覆盖"
        },
        {
          "label": "快速审查",
          "description": "只检查关键路径和明显问题"
        },
        {
          "label": "跳过",
          "description": "直接进入总结阶段"
        }
      ]
    }
  ]
}

This step is a pre-closure check, not execution-phase main control.

Step 2: Generate the summary document

Prefer to call the shared runner:

bash ${CLAUDE_PLUGIN_ROOT}/scripts/cx-workflow-summary.sh \
  --feature <feature-slug> \
  --runner cc \
  --session-id <session-id>

Output to:

开发文档/CX工作流/功能/{功能标题}/总结.md

The summary only answers these questions:

  • What was done
  • Were key contracts or designs adjusted
  • What are the final deliverables and verification results

Step 3: Sync the GitHub mirror

Decide whether to sync based on github_sync :

  • off: keep local only
  • local: lightweight sync of results
  • collab / full: sync key documents and closure results

But regardless of the mode, GitHub is not the source of execution truth.

Step 4: Branch merge and workspace cleanup

Check the feature's 状态.json in worktree.isolation_mode:

If isolation_mode = "worktree"(independent workspace):

MUST (MUST) use the AskUserQuestion tool to ask about the merge method:

{
  "questions": [
    {
      "question": "功能「{feature_title}」已完成,如何合并回主分支?",
      "header": "合并方式",
      "multiSelect": false,
      "options": [
        {
          "label": "创建 Pull Request (Recommended)",
          "description": "推送分支并创建 PR,适合需要 review 的场景"
        },
        {
          "label": "直接合并到主分支",
          "description": "将 worktree 分支合并回主分支并清理"
        },
        {
          "label": "暂不合并",
          "description": "保留工作区和分支,稍后手动处理"
        }
      ]
    }
  ]
}

Option 1 (Create PR):

git push -u origin worktree-{feature-slug}
gh pr create --title "feat: {feature_title}" --body "..."

Option 2 (Direct merge):

# 先退出 worktree 回到主目录
ExitWorktree(save: true)
# 在主分支合并
git merge worktree-{feature-slug}
# 清理 worktree 分支
git branch -d worktree-{feature-slug}

Option 3 (Do not merge for now):

  • Keep the worktree and branch
  • Remind the user that they can later use git worktree list to view

If isolation_mode = "inline"(developing directly on the current branch):

  • Skip the merge step; the code is already on the current branch

Step 4.5: Branch integration (Worktree mode)

If currently in a feature worktree (non-inline mode), provide integration options after the summary is completed:

Use AskUserQuestion:

{
  "questions": [{
    "question": "所有任务已完成,如何处理这个 feature 分支?",
    "header": "分支整合",
    "multiSelect": false,
    "options": [
      { "label": "Merge 回主分支", "description": "合并后删除分支和 worktree" },
      { "label": "Push + 创建 Pull Request", "description": "推送到远程,创建 PR 供审查" },
      { "label": "保留分支(稍后处理)", "description": "保持 worktree 和分支不变" },
      { "label": "丢弃(需确认)", "description": "删除分支和 worktree,放弃所有改动" }
    ]
  }]
}

Option 1 — Merge:

git checkout main && git pull && git merge {feature-branch}
# 验证测试通过后
bash ${CLAUDE_PLUGIN_ROOT}/scripts/cx-worktree.sh cleanup --feature {slug}
git branch -d {feature-branch}

Option 2 — PR:

git push -u origin {feature-branch}
gh pr create --title "{feature-title}" --body "..."

Option 3 — Keep: Do not perform any operation.

Option 4 — Discard: Use AskUserQuestion after secondary confirmation:

bash ${CLAUDE_PLUGIN_ROOT}/scripts/cx-worktree.sh cleanup --feature {slug} --force
git branch -D {feature-branch}

Step 5: Wrap-up status

After closure is completed:

  • The feature status is updated to summarized
  • 配置.json.current_feature cleared
  • Historical feature documents are fully retained
  • If an independent workspace was used and has been merged, the worktree information is marked as merged