Files
knowledge-base/4 - Resources/Claude-Code/ECC 编排替代方案 (orchestrate 迁移).md
2026-04-07 22:50:27 +02:00

164 lines
5.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
created: "2026-04-06"
type: resource
tags: [resource, claude-code, AI-tools, orchestrate, migration, feature-dev, GSD, ECC, windows-compatible]
source: "https://github.com/affaan-m/everything-claude-code"
---
# ECC 编排替代方案 (orchestrate 迁移)
`/ecc:orchestrate` 已标记为 legacy shim。底层委托给 `dmux-workflows`(需 tmux`autonomous-agent-harness`(部分依赖 tmux。Windows 上基本不可用。本文档记录迁移路径。
相关笔记:[[Autonomous Agent Harness 自主代理框架]]、[[Everything Claude Code 完整指南]]
## orchestrate 做了什么
原来的 `/ecc:orchestrate feature "描述"` 内部流程:
1. Plan规划
2. TDD测试驱动开发
3. Code Review代码审查
4. Security Review安全审查
5. Verify验证
接受参数:`feature``bugfix``refactor``security``custom`
## 替代方案
### 路线 A单功能/任务 — `/ecc:feature-dev`(推荐)
**orchestrate 的最直接替代品。** 7 阶段全在 Claude Code 内部完成:
```
/ecc:feature-dev "add JWT authentication"
```
内部自动走:
1. **Discovery** — 读取需求,识别约束和验收标准
2. **Codebase Exploration** — 用 `code-explorer` 分析相关代码
3. **Clarifying Questions** — 提出设计/边界问题,等用户回答
4. **Architecture Design** — 用 `code-architect` 设计,等用户批准
5. **Implementation** — TDD 实现,小粒度提交
6. **Quality Review** — 用 `code-reviewer` 审查,修复 critical/high 问题
7. **Summary** — 总结构建内容,列出跟进项
### 路线 B手动拆步骤
如果想更精细控制每一步:
```
/ecc:plan "描述" # 规划,等确认
/ecc:tdd # RED → GREEN → REFACTOR
/ecc:code-review # 代码审查
/ecc:security-review # 安全审查(涉及 auth/支付时)
/ecc:verify # 构建 + 测试 + lint + 覆盖率
```
按工作类型选择组合:
| 工作类型 | 推荐组合 |
|----------|---------|
| 新功能 | `/ecc:feature-dev` 一条龙 |
| Bug 修复 | `/ecc:tdd``/ecc:code-review` |
| 重构 | `/ecc:plan``/ecc:tdd``/ecc:code-review` |
| 安全相关 | 任何组合 + `/ecc:security-review` |
| 最终验证 | `/ecc:verify` |
### 路线 C全项目多阶段 — GSD
GSDGet Shit Done是 ECC 集成的项目级编排系统Windows 原生可用。
**安装:**
```bash
npx get-shit-done-cc@latest
```
**单阶段执行:**
```
/gsd:discuss-phase 1 # 讨论实现决策
/gsd:plan-phase 1 # 研究 + 规划 + 验证
/gsd:execute-phase 1 # 按 wave 并行执行
/gsd:verify-work 1 # 验收测试
/gsd:ship 1 # 创建 PR
```
**全自动执行:**
```
/gsd:autonomous # 执行所有剩余阶段
/gsd:autonomous --from 6 # 从阶段 6 开始
```
**GSD 完整生命周期:**
```
/gsd:new-project # 初始化(研究 → 需求 → 路线图)
/gsd:plan-phase 1 # 规划阶段 1
/gsd:execute-phase 1 # 执行
/gsd:verify-work 1 # 验收
/gsd:next # 自动推进到下一步
... 重复 ...
/gsd:complete-milestone # 归档并打 tag
/gsd:new-milestone # 开始下一个版本
```
---
## 迁移对照表
| 旧命令 | 新命令 | 说明 |
| ---------------------------------- | --------------------------------------------- | ------------------------ |
| `/ecc:orchestrate feature "desc"` | `/ecc:feature-dev "desc"` | 单功能全流程 |
| `/ecc:orchestrate bugfix "desc"` | `/ecc:tdd` + `/ecc:code-review` | 先写失败测试再修 |
| `/ecc:orchestrate refactor "desc"` | `/ecc:plan` + `/ecc:tdd` + `/ecc:code-review` | 先规划再重构 |
| `/ecc:orchestrate security "desc"` | 任何路线 + `/ecc:security-review` | 加安全审查 |
| 多阶段自动执行 | `/gsd:autonomous` | GSD 接管 |
| 并行编排 | 不可用Windows | 用 Agent/Task tool 做进程内并行 |
## CLAUDE.md 更新
项目 CLAUDE.md 中 Step 2 应从:
```markdown
| New feature | `/ecc:orchestrate feature` |
```
改为:
```markdown
| New feature | `/ecc:feature-dev <desc>` |
| Bug fix | `/ecc:tdd` then `/ecc:code-review` |
| Refactor | `/ecc:plan` then `/ecc:tdd` then `/ecc:code-review` |
| Full phase | `/gsd:execute-phase N` |
| All phases | `/gsd:autonomous` |
```
---
## Windows 可用性总结
| 方案 | Windows | 原理 |
|------|---------|------|
| `/ecc:feature-dev` | 可用 | Claude Code 内部,不依赖外部工具 |
| `/ecc:plan` + `/ecc:tdd` + ... | 可用 | 同上 |
| `/gsd:autonomous` | 可用 | 用 Claude Code Task tool 做并行 |
| `/ecc:orchestrate` | **不可用** | Legacy底层依赖 tmux |
| `dmux-workflows` | **不可用** | 需要 tmux |
| `auto-pilot.sh` 脚本 | 可用 | Git Bash每阶段独立 `claude -p` |
---
## 什么时候需要外部脚本
大部分情况下 Claude Code 自己编排(`/ecc:feature-dev` 或 GSD就够了。外部脚本`auto-pilot.sh`)只在以下场景有价值:
1. **上下文窗口不够** — 一个 phase 太大,塞不进单次会话
2. **无人值守** — 睡觉前启动,醒来看结果
3. **消除作者偏见** — Reviewer 必须在不同会话Santa Method
4. **可审计** — 每步有独立日志文件
## Related
- [[Autonomous Agent Harness 自主代理框架]]
- [[Autonomous Loops 自主循环模式]]
- [[dmux 多Agent并行编排]]
- [[Everything Claude Code 完整指南]]
- [[GSD 方法论与最佳实践]]