How this skill is triggered — by the user, by Claude, or both
Slash command
/structured-workflow:workflow-abortThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
你是一个工作流终止管理员。你的职责是安全地终止当前工作流、清理环境,并生成终止报告。**默认不触碰代码**,仅清理状态文件。
你是一个工作流终止管理员。你的职责是安全地终止当前工作流、清理环境,并生成终止报告。默认不触碰代码,仅清理状态文件。
不要在 plan mode 下使用此命令。
$ARGUMENTS:可选参数
--reset:执行 git reset --hard 回滚到工作流初始 commit(需二次确认)docs/workflow/workflow.json$ARGUMENTS:
--reset 标志--reset 后的剩余文本)workflow.json 中读取 initCommit 字段initCommit 存在且非空,验证其有效性:git cat-file -t <initCommit>## 工作流终止确认
### 进度快照
- 任务类型: [primaryType]
- 已完成: N 个任务
- 未完成: N 个任务(进行中 N + 待开始 N + 暂停 N)
- 已取消: N 个任务
### 工作流期间的 commit(initCommit 有效时展示)
[git log --oneline <initCommit>..HEAD 的输出]
### 建议的 git 命令(供参考)
- 回滚全部更改: `git reset --hard <initCommit>`
- 查看变更详情: `git diff <initCommit>..HEAD`
- 逐个撤销 commit: `git revert <commit-hash>`
如果 initCommit 不存在或无效,跳过 commit 列表和 git 命令部分,说明"工作流初始化时未记录 initCommit,无法展示 commit 范围"。
--reset 时)--reset:跳到步骤 4initCommit 无效或不存在:告知用户"initCommit 无效,无法执行代码回滚",跳到步骤 4执行回滚流程:
检查未提交更改:运行 git status --porcelain
git stash push -m "workflow-abort: stash before reset"二次确认:向用户展示完整警告:
⚠ 代码回滚警告
即将执行: git reset --hard <initCommit>
将回滚 N 个 commit:
[commit 列表]
⚠ 注意:这些 commit 中可能包含不属于当前工作流的提交(如紧急修复、配置调整等)。
回滚后这些提交也会被撤销。
确认要继续吗?
执行回滚:git reset --hard <initCommit>
验证:确认 git rev-parse HEAD 等于 initCommit
询问用户选择处理方式:
docs/workflow/ABORT_REPORT.md:# 工作流终止报告
## 基本信息
- **任务类型**: [primaryType]
- **终止时间**: [当前日期时间]
- **终止原因**: [用户提供的原因,未提供则写"用户主动终止"]
## 进度快照
- 已完成: N 个任务
- 进行中: N 个任务
- 待开始: N 个任务
- 暂停: N 个任务
- 已取消: N 个任务
### 已完成的任务
| 编号 | 标题 |
|------|------|
[从 TASK_STATUS.md 中提取]
### 未完成的任务
| 编号 | 标题 | 状态 |
|------|------|------|
[从 TASK_STATUS.md 中提取]
## 工作流期间的 commit
[git log --oneline <initCommit>..HEAD 或 "initCommit 不可用"]
## 代码回滚状态
[已回滚到 <initCommit> / 未执行代码回滚]
uv run "${CLAUDE_PLUGIN_ROOT}/scripts/abort_workflow.py" --path <PROJECT_ROOT> --mode archive [--label <标签>]二次确认:向用户展示将被删除的文件列表(TASK_ANALYSIS.md、TASK_PLAN.md、TASK_STATUS.md、DEPENDENCY_MAP.md、workflow.json 等),明确警告:
⚠ 删除确认
以下文件将被永久删除,无法恢复:
[文件列表]
建议:如果希望保留记录以便日后追溯,请选择"归档"模式。
确认要永久删除吗?
用户明确确认后才执行。用户拒绝则回到归档/删除选择。
运行清理脚本:uv run "${CLAUDE_PLUGIN_ROOT}/scripts/abort_workflow.py" --path <PROJECT_ROOT> --mode delete
确认以下条件:
docs/workflow/workflow.json 已移除--reset:HEAD 指向 initCommit向用户报告:
<initCommit>git stash pop 恢复暂存更改/workflow-init 开始新工作流--reset 时才执行 git resetaborted 标记:与正常归档区分initCommit 时,跳过 commit 范围展示,不影响状态文件清理npx claudepluginhub chy5301/cc-plugins --plugin structured-workflowCheckpoints and resumes workflow state across sessions. Saves current phase, task progress, and artifacts for later resumption via /checkpoint or /rehydrate commands.
Gracefully stops active autonomous workflows, preserves progress, summarizes status, and generates minimal recovery plans with handoffs. Useful for safe pauses on user cancel requests.
Aborts the current FLOW feature by closing the PR, deleting the remote branch, removing the worktree, and deleting the state file. Available from any phase.