一键导入
workflow-engine
声明式工作流编排 — 读模板、管状态、调 Agent、断点恢复
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
声明式工作流编排 — 读模板、管状态、调 Agent、断点恢复
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | workflow-engine |
| description | 声明式工作流编排 — 读模板、管状态、调 Agent、断点恢复 |
| 路径 | 用途 |
|---|---|
~/mem/mem/workflows/templates/*.yaml | YAML 模板定义 |
~/mem/mem/workflows/runs/*.json | Run 状态文件 |
~/.claude/skills/workflow-engine/scripts/engine.py | 状态管理工具 |
# 解析模板,检查输入
python3 ~/.claude/skills/workflow-engine/scripts/engine.py parse {template_name}
# 创建 run 状态文件
python3 ~/.claude/skills/workflow-engine/scripts/engine.py create {template_name} key1=val1 key2=val2
记下返回的 run_path,后续所有操作都用它。
LOOP:
1. 获取下一批可执行 step:
python3 engine.py next {run_path}
2. 如果无可执行 step → 检查 run 状态:
python3 engine.py status {run_path}
- status=completed → 工作流完成,退出
- status=failed/paused → 通知用户,退出
3. 对每个 ready step:
a. 标记为 running:
python3 engine.py update {run_path} {step_id} running
b. 读取 agent 的 WhoAmI:
~/mem/mem/agents/{type}/{agent}/WhoAmI.md
c. 调用 Agent tool:
Agent(
description="{agent} | {step_id}",
model="sonnet",
prompt="你是 {agent}...{WhoAmI内容}\n\n## 任务\n{step.prompt}"
)
NOTE: 同一组内的多个 step 用并行 Agent 调用
d. Agent 完成后:
- 成功 → python3 engine.py update {run_path} {step_id} completed "结果摘要"
- 失败 → python3 engine.py update {run_path} {step_id} failed "错误信息"
python3 engine.py failure {run_path} {step_id}
根据返回的 action 执行:
- retry → 回到 3.c 重新调用
- goto → 回到 LOOP(engine 已重置目标 step)
- pause → 通知用户,退出循环
- skip → 继续下一个 step
- abort → 标记失败,退出
4. 回到 LOOP
会话开始时执行:
python3 ~/.claude/skills/workflow-engine/scripts/engine.py check
如果返回非空列表:
python3 engine.py update {run_path} {step_id} failed "用户放弃"| 命令 | 用法 | 返回 |
|---|---|---|
parse | engine.py parse <template> | 模板结构 + 拓扑排序组 |
create | engine.py create <template> [k=v ...] | {"run_path": "..."} |
next | engine.py next <run_path> | 可执行 step 列表(含 agent/type/prompt) |
update | engine.py update <run_path> <step> <status> [result] | {"ok": true} |
status | engine.py status <run_path> | run 概览(template/status/steps) |
check | engine.py check | 未完成 run 列表 |
failure | engine.py failure <run_path> <step> | 行动指令(retry/goto/pause/skip/abort) |
name: string # 模板名
description: string # 一句话描述
version: int # 版本号
inputs: # 输入参数
- name: string # 参数名
required: bool # 是否必需(默认 false)
default: string # 默认值
steps: # 步骤列表
- id: string # 唯一标识
agent: string # agent 名(如 tetsu, shin)
type: string # agent 类型(如 蚁工, Auditor)
depends_on: [id] # 依赖的 step id 列表(可选)
prompt_template: string # 任务提示(支持 {{ var }} 变量)
retry: # 重试配置(可选)
max_attempts: int
on_failure: pause | skip | abort
on_failure: # 失败处理(可选)
goto: step_id # 回退到指定 step
max_loops: int # 最大回退次数
| 变量 | 值 |
|---|---|
{{ today }} | 当前日期 YYYY-MM-DD |
{{ 输入参数名 }} | 用户传入或默认值 |
| 模板 | 描述 |
|---|---|
| fix-chain | 修复→审计→文档→提交 |
| define-chain | 角色定义→文档→提交 |
| feedback-chain | 反馈→吞食→文档→提交 |
| review-chain | 并行审查→修复→复审→提交 |
| audit-chain | CLAUDE.md 审计→修复→复审 |
| explore-chain | 并行探索→文档记录 |
| research-chain | 三路调研→归档 |
| daily-close-chain | 日记→changelog→提交 |
| project-init-chain | 创建项目→MOC→提交 |
| memory-chain | 记忆提取→关联→索引 |
| thesis-chain | 编辑→编译→审计→导出→提交 |
Technology scouting and evaluation for tools, frameworks, libraries, and technical approaches. Use when users need to evaluate technology options, compare frameworks, assess technical feasibility, scout emerging technologies, or make build-vs-buy decisions. Produces structured comparison matrices with objective criteria scoring.
使用 Semantic Scholar API 检索和验证学术论文。支持并发多关键词搜索、批量 ID/DOI 查询、引用分析、批量补全摘要、统一 Markdown 导出。覆盖 2.14 亿+ 学术论文,无需 API Key 即可使用。触发词:论文检索、论文验证、Semantic Scholar、S2 搜索、查论文、补全摘要、导出MD
中文/英文写作风格迁移与错误记忆工作流。适用于论文、学位论文、报告等场景,提供 style profile、error log、长期记忆与多智能体写作闭环。
Use when user sends /skill复盘 or /迭代清单, or asks to review skill usage and iteration suggestions from the current conversation.
汇总所有 Claude Code Skills 的目录与使用指南,支持检查 GitHub 更新。触发词:/skills、技能目录、skill列表、有哪些技能、检查更新
[由 collaborating-hub 路由] Codex CLI 后端实现。直接使用请通过 /collab 或 /codex 触发 collaborating-hub。