| name | dynamic-workflow-mode |
| description | 为 Claude dynamic workflow mode 和其他自适应智能体 harness 设计 task-local harnesses、eval gates 和 reusable skill extraction。 |
| metadata | {"origin":"ECC"} |
Dynamic Workflow Mode
当 coding agent 可以生成或调整任务本地 harness,而不是只跟随静态命令流时,使用此技能。目标是把 dynamic workflow mode 变成有纪律的系统:一次性工作的临时 harness、重复工作的 shared skill extraction,以及团队可观察的 control pane checkpoints。
何时激活
- 用户提到 dynamic workflows、custom harnesses、harness-per-task、adaptive workflows 或 Claude Code dynamic workflow mode。
- 任务需要 custom loop、evaluator、crawler、fixture generator、watcher 或本地 dashboard。
- 多个智能体需要同一个可重复流程,但该流程尚未被捕获为 shared skill。
- 工作流需要 durable handoff artifacts、eval evidence,或合并前需要 operator approval。
核心合同
只有当 task-local harness 比手动驱动同样步骤更便宜、更安全时,dynamic workflow mode 才应生成它。harness 必须包含:
- Objective:它负责的结果,以及它明确不负责的结果。
- Inputs:files、URLs、prompts、data sources、credentials policy 和用户提供的 constraints。
- Outputs:commits、reports、screenshots、status files 或 control pane snapshots。
- Eval:至少一个与任务绑定的 pass/fail check,而不只是“它运行了”。
- Handoff:一个短 artifact,告诉下一个 operator 发生了什么、哪里阻塞、如何恢复。
Dynamic Harness 决策树
- One-shot task:保持 inline。不要发明 harness。
- Repeated task with changing inputs:创建 task-local harness,并放在临时或项目本地工作区。
- Repeated task across teammates or repos:把模式提取成 shared skill。
- Task with external state, queueing, or approvals:先添加 control pane 可见性,再添加更多自动化。
- Task with safety risk:在 autonomous execution 前添加 eval gate 和 human merge gate。
Task-Local Harness 模板
写代码前使用此结构:
# Dynamic Workflow Harness
Objective:
- Ship:
- Do not ship:
Inputs:
- Repo or workspace:
- External systems:
- Credentials policy:
Loop:
1. Discover current state.
2. Generate or update the smallest useful artifact.
3. Run eval checks.
4. Record status and handoff.
5. Stop on failed gate, unclear ownership, or unsafe external action.
Eval:
- Command:
- Expected pass signal:
- Failure owner:
Handoff:
- Status:
- Evidence:
- Next action:
Shared Skill Extraction
只有至少满足以下两项,才把 task-local harness 提升为 shared skill:
- 同一工作流出现在多个 sessions、repos、teams 或 launches 中。
- 工作流需要特定语言、工具或安全顺序。
- 因 operator 跳过 gate 或丢失上下文而反复失败。
- 工作流有稳定输入/输出合同。
- 工作流受益于 control pane、status board 或 team handoff。
提取时,先在 skills/<name>/SKILL.md 中写 skill。只有仍需要 legacy slash-entry surface 时才添加 command shims。
Control Pane Checkpoints
当 dynamic workflow mode 暴露状态时,团队才可用。任务跨越一个以上 session 时记录这些 checkpoints:
- Plan:objective、owner、acceptance criteria 和有风险的 external systems。
- Queue:work items、assigned agent role、branch/worktree 和 dependency edges。
- Run:active harness、当前 loop step、最近 eval result,以及可用时的 token/cost signal。
- Gate:test results、browser screenshots、security review 和 merge readiness。
- Handoff:已完成什么、失败了什么、需要什么 human decision。
如果 repo 已启用 ECC2 state,优先通过 ECC control pane 或 state-store-backed scripts 添加或读取 checkpoints,不要散落未追踪 notes。
Eval Gates
每个 dynamic harness 都需要 task-specific eval。选择最便宜可靠的 gate:
| 工作类型 | Eval Gate |
|---|
| Code feature | Focused test、lint、coverage 和一个 integration path |
| UI/control pane | Browser smoke,带 screenshot 和 overflow/error checks |
| Agent workflow | Fixture transcript 或 seeded work item,带 expected routing |
| Research/content | Source-neutral brief、claim checklist 和 publish-ready outline |
| Integration | Dry-run command、config validation 和 no-secret scan |
在 eval 可被另一个队友重跑之前,不要声称 dynamic workflow 可复用。
反模式
- 生成隐藏真实决策逻辑的 scripts。
- 把 dynamic workflow mode 当成跳过测试的许可。
- 当 shared skill 或 status artifact 才是真正产品时,却创建一次性 docs。
- 在没有 ownership、merge gate 或 conflict policy 的情况下运行多个智能体。
- 让原始私有研究数据泄漏到公开 docs。
输出标准
结束时包含:
- harness 或 skill path。
- eval commands 和 results。
- control pane 或 handoff artifact path。
- 下一个 reusable extraction candidate。