ccg-workflow 1.7.75 → 1.7.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  [![npm version](https://img.shields.io/npm/v/ccg-workflow.svg)](https://www.npmjs.com/package/ccg-workflow)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Claude Code](https://img.shields.io/badge/Claude%20Code-Compatible-green.svg)](https://claude.ai/code)
8
+ [![Tests](https://img.shields.io/badge/Tests-131%20passed-brightgreen.svg)]()
8
9
 
9
10
  [简体中文](./README.zh-CN.md) | English
10
11
 
@@ -12,98 +13,136 @@
12
13
 
13
14
  A multi-model collaboration development system where Claude Code orchestrates Codex + Gemini. Frontend tasks route to Gemini, backend tasks route to Codex, and Claude handles orchestration and code review.
14
15
 
15
- ## Installation
16
+ ## Why CCG?
17
+
18
+ - **Zero-config model routing** — Frontend tasks automatically go to Gemini, backend tasks to Codex. No manual switching.
19
+ - **Security by design** — External models have no write access. They return patches; Claude reviews before applying.
20
+ - **26 slash commands** — From planning to execution, git workflow to code review, all accessible via `/ccg:*`.
21
+ - **Spec-driven development** — Integrates [OPSX](https://github.com/fission-ai/opsx) to turn vague requirements into verifiable constraints, eliminating AI improvisation.
22
+
23
+ ## Architecture
24
+
25
+ ```
26
+ Claude Code (Orchestrator)
27
+
28
+ ┌───┴───┐
29
+ ↓ ↓
30
+ Codex Gemini
31
+ (Backend) (Frontend)
32
+ │ │
33
+ └───┬───┘
34
+
35
+ Unified Patch
36
+ ```
37
+
38
+ External models have no write access — they only return patches, which Claude reviews before applying.
39
+
40
+ ## Quick Start
41
+
42
+ ### Prerequisites
43
+
44
+ | Dependency | Required | Notes |
45
+ |------------|----------|-------|
46
+ | **Node.js 20+** | Yes | `ora@9.x` requires Node >= 20. Node 18 causes `SyntaxError` |
47
+ | **Claude Code CLI** | Yes | [Install guide](#install-claude-code) |
48
+ | **jq** | Yes | Used for auto-authorization hook ([install](#install-jq)) |
49
+ | **Codex CLI** | No | Enables backend routing |
50
+ | **Gemini CLI** | No | Enables frontend routing |
51
+
52
+ ### Installation
16
53
 
17
54
  ```bash
18
55
  npx ccg-workflow
19
56
  ```
20
57
 
21
- **Requirements**: Claude Code CLI, Node.js 20+
58
+ On first run, CCG prompts you to select a language (English / Chinese). This preference is saved for all future sessions.
22
59
 
23
- > **Important**: This project depends on `ora@9.x` and `string-width@8.x`, which require Node.js >= 20. Using Node.js 18 will cause `SyntaxError: Invalid regular expression flags`. Please upgrade to Node.js 20 or higher.
60
+ ### Install jq
24
61
 
25
- **Optional**: Codex CLI (backend), Gemini CLI (frontend)
62
+ ```bash
63
+ # macOS
64
+ brew install jq
26
65
 
27
- ## First-Time Setup
66
+ # Linux (Debian/Ubuntu)
67
+ sudo apt install jq
28
68
 
29
- On first run, CCG will prompt you to select your preferred language (English or Chinese). This preference is saved and used for all subsequent sessions.
69
+ # Linux (RHEL/CentOS)
70
+ sudo yum install jq
30
71
 
31
- ## Commands
72
+ # Windows
73
+ choco install jq # or: scoop install jq
74
+ ```
32
75
 
33
- | Command | Description |
34
- |---------|-------------|
35
- | `/ccg:workflow` | Full 6-phase development workflow |
36
- | `/ccg:plan` | Multi-model collaborative planning (Phase 1-2) |
37
- | `/ccg:execute` | Multi-model collaborative execution (Phase 3-5) |
38
- | `/ccg:feat` | Smart feature development |
39
- | `/ccg:frontend` | Frontend tasks (Gemini) |
40
- | `/ccg:backend` | Backend tasks (Codex) |
41
- | `/ccg:analyze` | Technical analysis |
42
- | `/ccg:debug` | Problem diagnosis |
43
- | `/ccg:optimize` | Performance optimization |
44
- | `/ccg:test` | Test generation |
45
- | `/ccg:review` | Code review |
46
- | `/ccg:commit` | Git commit |
47
- | `/ccg:rollback` | Git rollback |
48
- | `/ccg:clean-branches` | Clean branches |
49
- | `/ccg:worktree` | Worktree management |
50
- | `/ccg:init` | Initialize CLAUDE.md |
51
- | `/ccg:enhance` | Prompt enhancement |
52
- | `/ccg:spec-init` | Initialize OPSX environment |
53
- | `/ccg:spec-research` | Requirements → Constraints |
54
- | `/ccg:spec-plan` | Constraints → Zero-decision plan |
55
- | `/ccg:spec-impl` | Execute plan + archive |
56
- | `/ccg:spec-review` | Dual-model cross-review |
57
- | `/ccg:team-research` | Agent Teams requirements → constraints |
58
- | `/ccg:team-plan` | Agent Teams constraints → parallel plan |
59
- | `/ccg:team-exec` | Agent Teams parallel execution |
60
- | `/ccg:team-review` | Agent Teams dual-model review |
61
- | `/ccg:codex-exec` | Codex full execution (plan → code → review) |
76
+ ### Install Claude Code
62
77
 
63
- ### OPSX Spec-Driven (v1.7.52+)
78
+ ```bash
79
+ npx ccg-workflow menu # Select "Install Claude Code"
80
+ ```
64
81
 
65
- Integrates [OPSX architecture](https://github.com/fission-ai/opsx) to turn requirements into constraints, eliminating AI improvisation:
82
+ Supports: npm, homebrew, curl, powershell, cmd.
66
83
 
67
- ```bash
68
- # Initialize OPSX environment
69
- /ccg:spec-init
84
+ ## Commands
70
85
 
71
- # Research requirements → output constraints
72
- /ccg:spec-research implement user authentication
86
+ ### Development Workflow
73
87
 
74
- # Parallel analysis zero-decision plan
75
- /ccg:spec-plan
88
+ | Command | Description | Model |
89
+ |---------|-------------|-------|
90
+ | `/ccg:workflow` | Full 6-phase development workflow | Codex + Gemini |
91
+ | `/ccg:plan` | Multi-model collaborative planning (Phase 1-2) | Codex + Gemini |
92
+ | `/ccg:execute` | Multi-model collaborative execution (Phase 3-5) | Codex + Gemini + Claude |
93
+ | `/ccg:codex-exec` | Codex full execution (plan → code → review) | Codex + multi-model review |
94
+ | `/ccg:feat` | Smart feature development | Auto-routed |
95
+ | `/ccg:frontend` | Frontend tasks (fast mode) | Gemini |
96
+ | `/ccg:backend` | Backend tasks (fast mode) | Codex |
76
97
 
77
- # Execute the plan
78
- /ccg:spec-impl
98
+ ### Analysis & Quality
79
99
 
80
- # Independent review (available anytime)
81
- /ccg:spec-review
82
- ```
100
+ | Command | Description | Model |
101
+ |---------|-------------|-------|
102
+ | `/ccg:analyze` | Technical analysis | Codex + Gemini |
103
+ | `/ccg:debug` | Problem diagnosis + fix | Codex + Gemini |
104
+ | `/ccg:optimize` | Performance optimization | Codex + Gemini |
105
+ | `/ccg:test` | Test generation | Auto-routed |
106
+ | `/ccg:review` | Code review (auto git diff) | Codex + Gemini |
107
+ | `/ccg:enhance` | Prompt enhancement | Built-in |
83
108
 
84
- **Note**: `/ccg:spec-*` commands are CCG's wrapper around OPSX, internally calling `/opsx:*` commands. You can `/clear` between phases — state is persisted in the `openspec/` directory, so context overflow is not a concern.
109
+ ### OPSX Spec-Driven
85
110
 
86
- ### Agent Teams Parallel Execution (v1.7.60+)
111
+ | Command | Description |
112
+ |---------|-------------|
113
+ | `/ccg:spec-init` | Initialize OPSX environment |
114
+ | `/ccg:spec-research` | Requirements → Constraints |
115
+ | `/ccg:spec-plan` | Constraints → Zero-decision plan |
116
+ | `/ccg:spec-impl` | Execute plan + archive |
117
+ | `/ccg:spec-review` | Dual-model cross-review |
87
118
 
88
- Leverage Claude Code Agent Teams experimental feature to spawn multiple Builder teammates for parallel coding:
119
+ ### Agent Teams (v1.7.60+)
89
120
 
90
- ```bash
91
- # 1. Requirements research → constraints (recommended for complex projects)
92
- /ccg:team-research implement real-time collaboration kanban API
121
+ | Command | Description |
122
+ |---------|-------------|
123
+ | `/ccg:team-research` | Requirements constraints (parallel exploration) |
124
+ | `/ccg:team-plan` | Constraints → parallel implementation plan |
125
+ | `/ccg:team-exec` | Spawn Builder teammates for parallel coding |
126
+ | `/ccg:team-review` | Dual-model cross-review |
93
127
 
94
- # 2. /clear then plan zero-decision parallel plan
95
- /ccg:team-plan kanban-api
128
+ > **Prerequisite**: Enable Agent Teams in `settings.json`: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`
96
129
 
97
- # 3. /clear then parallel execution → Builder teammates write code in parallel
98
- /ccg:team-exec
130
+ ### Git Tools
99
131
 
100
- # 4. /clear then review → dual-model cross-review
101
- /ccg:team-review
102
- ```
132
+ | Command | Description |
133
+ |---------|-------------|
134
+ | `/ccg:commit` | Smart commit (conventional commit format) |
135
+ | `/ccg:rollback` | Interactive rollback |
136
+ | `/ccg:clean-branches` | Clean merged branches |
137
+ | `/ccg:worktree` | Worktree management |
103
138
 
104
- **Prerequisite**: Manually enable Agent Teams (`settings.json`: set `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`)
139
+ ### Project Setup
105
140
 
106
- **vs Traditional Workflow**: Team series uses `/clear` between steps to isolate context, passing state through files. Builders work in parallel, ideal for tasks decomposable into 3+ independent modules.
141
+ | Command | Description |
142
+ |---------|-------------|
143
+ | `/ccg:init` | Initialize project CLAUDE.md |
144
+
145
+ ## Workflow Guides
107
146
 
108
147
  ### Planning & Execution Separation
109
148
 
@@ -121,31 +160,66 @@ Leverage Claude Code Agent Teams experimental feature to spawn multiple Builder
121
160
  /ccg:codex-exec .claude/plan/user-auth.md
122
161
  ```
123
162
 
163
+ ### OPSX Spec-Driven Workflow
164
+
165
+ Integrates [OPSX architecture](https://github.com/fission-ai/opsx) to turn requirements into constraints, eliminating AI improvisation:
166
+
167
+ ```bash
168
+ /ccg:spec-init # Initialize OPSX environment
169
+ /ccg:spec-research implement user auth # Research → constraints
170
+ /ccg:spec-plan # Parallel analysis → zero-decision plan
171
+ /ccg:spec-impl # Execute the plan
172
+ /ccg:spec-review # Independent review (anytime)
173
+ ```
174
+
175
+ > **Tip**: `/ccg:spec-*` commands internally call `/opsx:*`. You can `/clear` between phases — state is persisted in the `openspec/` directory.
176
+
177
+ ### Agent Teams Parallel Workflow
178
+
179
+ Leverage Claude Code Agent Teams to spawn multiple Builder teammates for parallel coding:
180
+
181
+ ```bash
182
+ /ccg:team-research implement kanban API # 1. Requirements → constraints
183
+ # /clear
184
+ /ccg:team-plan kanban-api # 2. Plan → parallel tasks
185
+ # /clear
186
+ /ccg:team-exec # 3. Builders code in parallel
187
+ # /clear
188
+ /ccg:team-review # 4. Dual-model cross-review
189
+ ```
190
+
191
+ > **vs Traditional Workflow**: Team series uses `/clear` between steps to isolate context, passing state through files. Ideal for tasks decomposable into 3+ independent modules.
192
+
124
193
  ## Configuration
125
194
 
126
195
  ### Directory Structure
127
196
 
128
197
  ```
129
198
  ~/.claude/
130
- ├── commands/ccg/ # Slash commands
199
+ ├── commands/ccg/ # 26 slash commands
131
200
  ├── agents/ccg/ # Sub-agents
132
- ├── skills/ # Quality gates + multi-agent orchestration
201
+ ├── skills/ccg/ # Quality gates + multi-agent orchestration
133
202
  ├── bin/codeagent-wrapper
134
203
  └── .ccg/
135
- ├── config.toml
136
- └── prompts/{codex,gemini}/
204
+ ├── config.toml # CCG configuration
205
+ └── prompts/
206
+ ├── codex/ # 6 Codex expert prompts
207
+ └── gemini/ # 7 Gemini expert prompts
137
208
  ```
138
209
 
139
210
  ### Environment Variables
140
211
 
141
- | Variable | Description | Default |
142
- |----------|-------------|---------|
143
- | `CODEAGENT_POST_MESSAGE_DELAY` | Wait time after Codex completion (seconds) | 5 |
144
- | `CODEX_TIMEOUT` | codeagent-wrapper execution timeout (seconds) | 7200 |
145
- | `BASH_DEFAULT_TIMEOUT_MS` | Claude Code Bash default timeout (ms) | 120000 |
146
- | `BASH_MAX_TIMEOUT_MS` | Claude Code Bash max timeout (ms) | 600000 |
212
+ Configure in `~/.claude/settings.json` under `"env"`:
213
+
214
+ | Variable | Description | Default | When to change |
215
+ |----------|-------------|---------|----------------|
216
+ | `CODEAGENT_POST_MESSAGE_DELAY` | Wait after Codex completion (sec) | `5` | Set to `1` if Codex process hangs |
217
+ | `CODEX_TIMEOUT` | Wrapper execution timeout (sec) | `7200` | Increase for very long tasks |
218
+ | `BASH_DEFAULT_TIMEOUT_MS` | Claude Code Bash timeout (ms) | `120000` | Increase if commands time out |
219
+ | `BASH_MAX_TIMEOUT_MS` | Claude Code Bash max timeout (ms) | `600000` | Increase for long builds |
147
220
 
148
- Configuration in `~/.claude/settings.json`:
221
+ <details>
222
+ <summary>Example settings.json</summary>
149
223
 
150
224
  ```json
151
225
  {
@@ -158,79 +232,32 @@ Configuration in `~/.claude/settings.json`:
158
232
  }
159
233
  ```
160
234
 
161
- ### codeagent-wrapper Auto-Authorization
162
-
163
- CCG automatically installs a Hook in `settings.json` to auto-authorize codeagent-wrapper commands, so you don't have to manually approve each collaboration call.
164
-
165
- **Requirement**: `jq` must be installed on your system.
166
-
167
- ```bash
168
- # macOS
169
- brew install jq
170
-
171
- # Linux (Debian/Ubuntu)
172
- sudo apt install jq
173
-
174
- # Linux (RHEL/CentOS)
175
- sudo yum install jq
176
-
177
- # Windows
178
- choco install jq
179
- # or
180
- scoop install jq
181
- ```
235
+ </details>
182
236
 
183
237
  ### MCP Configuration
184
238
 
185
- Code retrieval MCP (choose one):
186
- - **ace-tool** (recommended) - Code search via `search_context` (note: `enhance_prompt` is no longer available). [Official](https://augmentcode.com/) | [Third-party proxy (recommended)](https://acemcp.heroman.wtf/)
187
- - **ContextWeaver** (alternative) - Local hybrid search, requires SiliconFlow API Key (free)
188
-
189
- Optional MCP tools:
190
- - **Context7** - Latest library documentation
191
- - **Playwright** - Browser automation/testing
192
- - **DeepWiki** - Knowledge base queries
193
- - **Exa** - Search engine (requires API Key)
194
-
195
239
  ```bash
196
- # Configure MCP
197
240
  npx ccg-workflow menu # Select "Configure MCP"
198
241
  ```
199
242
 
200
- ## Tools
201
-
202
- ```bash
203
- npx ccg-workflow menu # Select "Tools"
204
- ```
205
-
206
- - **ccusage** - Claude Code usage analytics
207
- - **CCometixLine** - Status bar tool (Git + usage tracking)
208
-
209
- ## Install Claude Code
210
-
211
- ```bash
212
- npx ccg-workflow menu # Select "Install Claude Code"
213
- ```
214
-
215
- Supports multiple installation methods: npm, homebrew, curl, powershell, cmd
243
+ **Code retrieval** (choose one):
244
+ - **ace-tool** (recommended) — Code search via `search_context`. [Official](https://augmentcode.com/) | [Third-party proxy](https://acemcp.heroman.wtf/)
245
+ - **ContextWeaver** (alternative) — Local hybrid search, requires SiliconFlow API Key (free)
216
246
 
217
- ## Update / Uninstall
247
+ **Optional tools**:
248
+ - **Context7** — Latest library documentation (auto-installed)
249
+ - **Playwright** — Browser automation / testing
250
+ - **DeepWiki** — Knowledge base queries
251
+ - **Exa** — Search engine (requires API Key)
218
252
 
219
- ```bash
220
- # Update
221
- npx ccg-workflow@latest # npx users
222
- npm install -g ccg-workflow@latest # npm global users
223
-
224
- # Uninstall
225
- npx ccg-workflow # Select "Uninstall"
226
- npm uninstall -g ccg-workflow # npm global users need this extra step
227
- ```
253
+ ### Auto-Authorization Hook
228
254
 
229
- ## FAQ
255
+ CCG automatically installs a Hook to auto-authorize `codeagent-wrapper` commands (requires [jq](#install-jq)).
230
256
 
231
- ### 1. How to auto-authorize codeagent-wrapper without manual approval?
257
+ <details>
258
+ <summary>Manual setup (for versions before v1.7.71)</summary>
232
259
 
233
- CCG automatically installs the Hook during setup (v1.7.71+). If you installed an older version, add this to `~/.claude/settings.json`:
260
+ Add to `~/.claude/settings.json`:
234
261
 
235
262
  ```json
236
263
  {
@@ -251,37 +278,49 @@ CCG automatically installs the Hook during setup (v1.7.71+). If you installed an
251
278
  }
252
279
  ```
253
280
 
254
- > **Note**: Requires `jq` installed on your system. See [codeagent-wrapper Auto-Authorization](#codeagent-wrapper-auto-authorization) for install instructions.
281
+ </details>
255
282
 
256
- ### 2. Codex CLI 0.80.0 process does not exit
283
+ ## Utilities
257
284
 
258
- In `--json` mode, Codex does not automatically exit after output completion.
285
+ ```bash
286
+ npx ccg-workflow menu # Select "Tools"
287
+ ```
259
288
 
260
- Fix: Set `CODEAGENT_POST_MESSAGE_DELAY=1`
289
+ - **ccusage** — Claude Code usage analytics
290
+ - **CCometixLine** — Status bar tool (Git + usage tracking)
261
291
 
262
- ## Architecture
292
+ ## Update / Uninstall
263
293
 
264
- ```
265
- Claude Code (Orchestrator)
266
-
267
- ┌───┴───┐
268
- ↓ ↓
269
- Codex Gemini
270
- (Backend) (Frontend)
271
- │ │
272
- └───┬───┘
273
-
274
- Unified Patch
294
+ ```bash
295
+ # Update
296
+ npx ccg-workflow@latest # npx users
297
+ npm install -g ccg-workflow@latest # npm global users
298
+
299
+ # Uninstall
300
+ npx ccg-workflow # Select "Uninstall"
301
+ npm uninstall -g ccg-workflow # npm global users need this extra step
275
302
  ```
276
303
 
277
- External models have no write access — they only return patches, which Claude reviews before applying.
304
+ ## FAQ
305
+
306
+ ### Codex CLI 0.80.0 process does not exit
307
+
308
+ In `--json` mode, Codex does not automatically exit after output completion.
309
+
310
+ **Fix**: Set `CODEAGENT_POST_MESSAGE_DELAY=1` in your environment variables.
311
+
312
+ ## Contributing
313
+
314
+ We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
315
+
316
+ Looking for a place to start? Check out issues labeled [`good first issue`](https://github.com/fengshao1227/ccg-workflow/labels/good%20first%20issue).
278
317
 
279
318
  ## Credits
280
319
 
281
- - [cexll/myclaude](https://github.com/cexll/myclaude) - codeagent-wrapper
282
- - [UfoMiao/zcf](https://github.com/UfoMiao/zcf) - Git tools
283
- - [GudaStudio/skills](https://github.com/GuDaStudio/skills) - Routing design
284
- - [ace-tool](https://linux.do/t/topic/1344562) - MCP tool
320
+ - [cexll/myclaude](https://github.com/cexll/myclaude) codeagent-wrapper
321
+ - [UfoMiao/zcf](https://github.com/UfoMiao/zcf) Git tools
322
+ - [GudaStudio/skills](https://github.com/GuDaStudio/skills) Routing design
323
+ - [ace-tool](https://linux.do/t/topic/1344562) MCP tool
285
324
 
286
325
  ## Star History
287
326
 
@@ -293,4 +332,4 @@ MIT
293
332
 
294
333
  ---
295
334
 
296
- v1.7.75 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues)
335
+ v1.7.77 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
package/README.zh-CN.md CHANGED
@@ -1,10 +1,11 @@
1
- # CCG - Claude + Codex + Gemini Multi-Model Collaboration
1
+ # CCG - Claude + Codex + Gemini 多模型协作
2
2
 
3
3
  <div align="center">
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/ccg-workflow.svg)](https://www.npmjs.com/package/ccg-workflow)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Claude Code](https://img.shields.io/badge/Claude%20Code-Compatible-green.svg)](https://claude.ai/code)
8
+ [![Tests](https://img.shields.io/badge/Tests-131%20passed-brightgreen.svg)]()
8
9
 
9
10
  简体中文 | [English](./README.md)
10
11
 
@@ -12,102 +13,138 @@
12
13
 
13
14
  Claude Code 编排 Codex + Gemini 的多模型协作开发系统。前端任务路由至 Gemini,后端任务路由至 Codex,Claude 负责编排决策和代码审核。
14
15
 
15
- ## 安装
16
+ ## 为什么选择 CCG?
17
+
18
+ - **零配置模型路由** — 前端任务自动走 Gemini,后端任务自动走 Codex,无需手动切换。
19
+ - **安全设计** — 外部模型无写入权限,仅返回 Patch,由 Claude 审核后应用。
20
+ - **26 个斜杠命令** — 从规划到执行、Git 工作流到代码审查,通过 `/ccg:*` 一站式访问。
21
+ - **规范驱动开发** — 集成 [OPSX](https://github.com/fission-ai/opsx),将模糊需求变成可验证约束,让 AI 没法自由发挥。
22
+
23
+ ## 架构
24
+
25
+ ```
26
+ Claude Code (编排)
27
+
28
+ ┌───┴───┐
29
+ ↓ ↓
30
+ Codex Gemini
31
+ (后端) (前端)
32
+ │ │
33
+ └───┬───┘
34
+
35
+ Unified Patch
36
+ ```
37
+
38
+ 外部模型无写入权限,仅返回 Patch,由 Claude 审核后应用。
39
+
40
+ ## 快速开始
41
+
42
+ ### 前置条件
43
+
44
+ | 依赖 | 必需 | 说明 |
45
+ |------|------|------|
46
+ | **Node.js 20+** | 是 | `ora@9.x` 要求 Node >= 20,Node 18 会报 `SyntaxError` |
47
+ | **Claude Code CLI** | 是 | [安装方法](#安装-claude-code) |
48
+ | **jq** | 是 | 用于自动授权 Hook([安装方法](#安装-jq)) |
49
+ | **Codex CLI** | 否 | 启用后端路由 |
50
+ | **Gemini CLI** | 否 | 启用前端路由 |
51
+
52
+ ### 安装
16
53
 
17
54
  ```bash
18
55
  npx ccg-workflow
19
56
  ```
20
57
 
21
- **要求**:Claude Code CLI、Node.js 20+
58
+ 首次运行会提示选择语言(简体中文 / English),选择后自动保存,后续无需再选。
22
59
 
23
- > **重要**:本项目依赖 `ora@9.x` 和 `string-width@8.x`,这些包要求 Node.js >= 20。使用 Node.js 18 会导致 `SyntaxError: Invalid regular expression flags` 错误。请确保升级到 Node.js 20 或更高版本。
60
+ ### 安装 jq
24
61
 
25
- **可选**:Codex CLI(后端)、Gemini CLI(前端)
62
+ ```bash
63
+ # macOS
64
+ brew install jq
26
65
 
27
- ## 首次设置
66
+ # Linux (Debian/Ubuntu)
67
+ sudo apt install jq
28
68
 
29
- 首次运行时,CCG 会提示你选择语言(简体中文 / English)。选择后自动保存,后续使用无需再选。
69
+ # Linux (RHEL/CentOS)
70
+ sudo yum install jq
30
71
 
31
- ## 命令
72
+ # Windows
73
+ choco install jq # 或: scoop install jq
74
+ ```
32
75
 
33
- | 命令 | 说明 |
34
- |------|------|
35
- | `/ccg:workflow` | 6 阶段完整工作流 |
36
- | `/ccg:plan` | 多模型协作规划 (Phase 1-2) |
37
- | `/ccg:execute` | 多模型协作执行 (Phase 3-5) |
38
- | `/ccg:feat` | 新功能开发 |
39
- | `/ccg:frontend` | 前端任务 (Gemini) |
40
- | `/ccg:backend` | 后端任务 (Codex) |
41
- | `/ccg:analyze` | 技术分析 |
42
- | `/ccg:debug` | 问题诊断 |
43
- | `/ccg:optimize` | 性能优化 |
44
- | `/ccg:test` | 测试生成 |
45
- | `/ccg:review` | 代码审查 |
46
- | `/ccg:commit` | Git 提交 |
47
- | `/ccg:rollback` | Git 回滚 |
48
- | `/ccg:clean-branches` | 清理分支 |
49
- | `/ccg:worktree` | Worktree 管理 |
50
- | `/ccg:init` | 初始化 CLAUDE.md |
51
- | `/ccg:enhance` | Prompt 增强 |
52
- | `/ccg:spec-init` | 初始化 OPSX 环境 |
53
- | `/ccg:spec-research` | 需求 → 约束集 |
54
- | `/ccg:spec-plan` | 约束 → 零决策计划 |
55
- | `/ccg:spec-impl` | 按计划执行 + 归档 |
56
- | `/ccg:spec-review` | 双模型交叉审查 |
57
- | `/ccg:team-research` | Agent Teams 需求 → 约束集 |
58
- | `/ccg:team-plan` | Agent Teams 约束 → 并行计划 |
59
- | `/ccg:team-exec` | Agent Teams 并行实施 |
60
- | `/ccg:team-review` | Agent Teams 双模型审查 |
61
- | `/ccg:codex-exec` | Codex 全权执行(计划 → 代码 → 审核) |
76
+ ### 安装 Claude Code
62
77
 
63
- ### OPSX 规范驱动(v1.7.52+)
78
+ ```bash
79
+ npx ccg-workflow menu # 选择「安装 Claude Code」
80
+ ```
64
81
 
65
- 集成 [OPSX 架构](https://github.com/fission-ai/opsx),把需求变成约束,让 AI 没法自由发挥:
82
+ 支持:npm、homebrew、curl、powershell、cmd。
66
83
 
67
- ```bash
68
- # 初始化 OPSX 环境
69
- /ccg:spec-init
84
+ ## 命令
70
85
 
71
- # 研究需求 → 输出约束集
72
- /ccg:spec-research 实现用户认证
86
+ ### 开发工作流
73
87
 
74
- # 并行分析 零决策计划
75
- /ccg:spec-plan
88
+ | 命令 | 说明 | 模型 |
89
+ |------|------|------|
90
+ | `/ccg:workflow` | 6 阶段完整工作流 | Codex + Gemini |
91
+ | `/ccg:plan` | 多模型协作规划 (Phase 1-2) | Codex + Gemini |
92
+ | `/ccg:execute` | 多模型协作执行 (Phase 3-5) | Codex + Gemini + Claude |
93
+ | `/ccg:codex-exec` | Codex 全权执行(计划 → 代码 → 审核) | Codex + 多模型审核 |
94
+ | `/ccg:feat` | 智能功能开发 | 自动路由 |
95
+ | `/ccg:frontend` | 前端任务(快速模式) | Gemini |
96
+ | `/ccg:backend` | 后端任务(快速模式) | Codex |
76
97
 
77
- # 按计划执行
78
- /ccg:spec-impl
98
+ ### 分析与质量
79
99
 
80
- # 独立审查(随时可用)
81
- /ccg:spec-review
82
- ```
100
+ | 命令 | 说明 | 模型 |
101
+ |------|------|------|
102
+ | `/ccg:analyze` | 技术分析 | Codex + Gemini |
103
+ | `/ccg:debug` | 问题诊断 + 修复 | Codex + Gemini |
104
+ | `/ccg:optimize` | 性能优化 | Codex + Gemini |
105
+ | `/ccg:test` | 测试生成 | 自动路由 |
106
+ | `/ccg:review` | 代码审查(自动 git diff) | Codex + Gemini |
107
+ | `/ccg:enhance` | Prompt 增强 | 内置 |
83
108
 
84
- **说明**:`/ccg:spec-*` 命令是 CCG 对 OPSX 的封装,内部调用 `/opsx:*` 命令。每阶段之间可 `/clear`,状态存在 `openspec/` 目录,不怕上下文爆。
109
+ ### OPSX 规范驱动
85
110
 
86
- ### Agent Teams 并行实施(v1.7.60+)
111
+ | 命令 | 说明 |
112
+ |------|------|
113
+ | `/ccg:spec-init` | 初始化 OPSX 环境 |
114
+ | `/ccg:spec-research` | 需求 → 约束集 |
115
+ | `/ccg:spec-plan` | 约束 → 零决策计划 |
116
+ | `/ccg:spec-impl` | 按计划执行 + 归档 |
117
+ | `/ccg:spec-review` | 双模型交叉审查 |
87
118
 
88
- 利用 Claude Code Agent Teams 实验特性,spawn 多个 Builder teammates 并行写代码:
119
+ ### Agent Teams(v1.7.60+)
89
120
 
90
- ```bash
91
- # 1. 需求研究 → 约束集(复杂项目推荐,简单项目可跳过)
92
- /ccg:team-research 实现实时协作看板 API
121
+ | 命令 | 说明 |
122
+ |------|------|
123
+ | `/ccg:team-research` | 需求 → 约束集(并行探索) |
124
+ | `/ccg:team-plan` | 约束 → 并行实施计划 |
125
+ | `/ccg:team-exec` | spawn Builder teammates 并行写代码 |
126
+ | `/ccg:team-review` | 双模型交叉审查 |
93
127
 
94
- # 2. /clear 后规划 → 零决策并行计划
95
- /ccg:team-plan kanban-api
128
+ > **前置条件**:需在 `settings.json` 中启用:`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`
96
129
 
97
- # 3. /clear 后并行实施 → Builder teammates 并行写代码
98
- /ccg:team-exec
130
+ ### Git 工具
99
131
 
100
- # 4. /clear 后审查 → 双模型交叉审查
101
- /ccg:team-review
102
- ```
132
+ | 命令 | 说明 |
133
+ |------|------|
134
+ | `/ccg:commit` | 智能提交(conventional commit 格式) |
135
+ | `/ccg:rollback` | 交互式回滚 |
136
+ | `/ccg:clean-branches` | 清理已合并分支 |
137
+ | `/ccg:worktree` | Worktree 管理 |
103
138
 
104
- **前置条件**:需手动启用 Agent Teams(`settings.json` 中设置 `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`)
139
+ ### 项目管理
105
140
 
106
- **vs 传统工作流**:Team 系列每步 `/clear` 隔离上下文,通过文件传递状态。Builder 并行实施,适合可拆分为 3+ 独立模块的任务。
141
+ | 命令 | 说明 |
142
+ |------|------|
143
+ | `/ccg:init` | 初始化项目 CLAUDE.md |
107
144
 
108
- ### 规划与执行分离
145
+ ## 工作流指南
109
146
 
110
- v1.7.39 新增 `/ccg:plan` 和 `/ccg:execute` 命令,将规划与执行解耦:
147
+ ### 规划与执行分离
111
148
 
112
149
  ```bash
113
150
  # 1. 生成实施计划
@@ -123,31 +160,66 @@ v1.7.39 新增 `/ccg:plan` 和 `/ccg:execute` 命令,将规划与执行解耦
123
160
  /ccg:codex-exec .claude/plan/user-auth.md
124
161
  ```
125
162
 
163
+ ### OPSX 规范驱动工作流
164
+
165
+ 集成 [OPSX 架构](https://github.com/fission-ai/opsx),把需求变成约束,让 AI 没法自由发挥:
166
+
167
+ ```bash
168
+ /ccg:spec-init # 初始化 OPSX 环境
169
+ /ccg:spec-research 实现用户认证 # 研究需求 → 输出约束集
170
+ /ccg:spec-plan # 并行分析 → 零决策计划
171
+ /ccg:spec-impl # 按计划执行
172
+ /ccg:spec-review # 独立审查(随时可用)
173
+ ```
174
+
175
+ > **提示**:`/ccg:spec-*` 命令内部调用 `/opsx:*`。每阶段之间可 `/clear`,状态存在 `openspec/` 目录,不怕上下文爆。
176
+
177
+ ### Agent Teams 并行工作流
178
+
179
+ 利用 Claude Code Agent Teams 实验特性,spawn 多个 Builder teammates 并行写代码:
180
+
181
+ ```bash
182
+ /ccg:team-research 实现实时协作看板 API # 1. 需求 → 约束集
183
+ # /clear
184
+ /ccg:team-plan kanban-api # 2. 规划 → 并行计划
185
+ # /clear
186
+ /ccg:team-exec # 3. Builder 并行写代码
187
+ # /clear
188
+ /ccg:team-review # 4. 双模型交叉审查
189
+ ```
190
+
191
+ > **vs 传统工作流**:Team 系列每步 `/clear` 隔离上下文,通过文件传递状态。适合可拆分为 3+ 独立模块的任务。
192
+
126
193
  ## 配置
127
194
 
128
195
  ### 目录结构
129
196
 
130
197
  ```
131
198
  ~/.claude/
132
- ├── commands/ccg/ # 斜杠命令
199
+ ├── commands/ccg/ # 26 个斜杠命令
133
200
  ├── agents/ccg/ # 子智能体
134
- ├── skills/ # 质量关卡 + 多 Agent 协同
201
+ ├── skills/ccg/ # 质量关卡 + 多 Agent 协同
135
202
  ├── bin/codeagent-wrapper
136
203
  └── .ccg/
137
- ├── config.toml
138
- └── prompts/{codex,gemini}/
204
+ ├── config.toml # CCG 配置
205
+ └── prompts/
206
+ ├── codex/ # 6 个 Codex 专家提示词
207
+ └── gemini/ # 7 个 Gemini 专家提示词
139
208
  ```
140
209
 
141
210
  ### 环境变量
142
211
 
143
- | 变量 | 说明 | 默认值 |
144
- |------|------|--------|
145
- | `CODEAGENT_POST_MESSAGE_DELAY` | Codex 完成后等待时间(秒) | 5 |
146
- | `CODEX_TIMEOUT` | codeagent-wrapper 执行超时(秒) | 7200 |
147
- | `BASH_DEFAULT_TIMEOUT_MS` | Claude Code Bash 默认超时(毫秒) | 120000 |
148
- | `BASH_MAX_TIMEOUT_MS` | Claude Code Bash 最大超时(毫秒) | 600000 |
212
+ `~/.claude/settings.json` `"env"` 中配置:
213
+
214
+ | 变量 | 说明 | 默认值 | 何时修改 |
215
+ |------|------|--------|----------|
216
+ | `CODEAGENT_POST_MESSAGE_DELAY` | Codex 完成后等待时间(秒) | `5` | Codex 进程挂起时设为 `1` |
217
+ | `CODEX_TIMEOUT` | wrapper 执行超时(秒) | `7200` | 超长任务时增大 |
218
+ | `BASH_DEFAULT_TIMEOUT_MS` | Claude Code Bash 超时(毫秒) | `120000` | 命令超时时增大 |
219
+ | `BASH_MAX_TIMEOUT_MS` | Claude Code Bash 最大超时(毫秒) | `600000` | 长时间构建时增大 |
149
220
 
150
- 配置方式(`~/.claude/settings.json`):
221
+ <details>
222
+ <summary>settings.json 示例</summary>
151
223
 
152
224
  ```json
153
225
  {
@@ -160,79 +232,32 @@ v1.7.39 新增 `/ccg:plan` 和 `/ccg:execute` 命令,将规划与执行解耦
160
232
  }
161
233
  ```
162
234
 
163
- ### codeagent-wrapper 自动授权
164
-
165
- CCG 安装时会自动向 `settings.json` 写入 Hook 配置,自动授权 codeagent-wrapper 命令,无需每次手动确认。
166
-
167
- **前置条件**:需要系统安装 `jq` 命令。
168
-
169
- ```bash
170
- # macOS
171
- brew install jq
172
-
173
- # Linux (Debian/Ubuntu)
174
- sudo apt install jq
175
-
176
- # Linux (RHEL/CentOS)
177
- sudo yum install jq
178
-
179
- # Windows
180
- choco install jq
181
- # 或
182
- scoop install jq
183
- ```
235
+ </details>
184
236
 
185
237
  ### MCP 配置
186
238
 
187
- 代码检索 MCP(二选一):
188
- - **ace-tool**(推荐)- 代码检索 `search_context` 可用(注:`enhance_prompt` 已不可用)。[官方](https://augmentcode.com/) | [第三方中转(推荐)](https://acemcp.heroman.wtf/)
189
- - **ContextWeaver**(备选)- 本地混合搜索,需要硅基流动 API Key(免费)
190
-
191
- 辅助工具 MCP(可选):
192
- - **Context7** - 获取最新库文档
193
- - **Playwright** - 浏览器自动化/测试
194
- - **DeepWiki** - 知识库查询
195
- - **Exa** - 搜索引擎(需 API Key)
196
-
197
239
  ```bash
198
- # 配置 MCP
199
240
  npx ccg-workflow menu # 选择「配置 MCP」
200
241
  ```
201
242
 
202
- ## 实用工具
203
-
204
- ```bash
205
- npx ccg-workflow menu # 选择「实用工具」
206
- ```
207
-
208
- - **ccusage** - Claude Code 用量分析
209
- - **CCometixLine** - 状态栏工具(Git + 用量跟踪)
210
-
211
- ## 安装 Claude Code
243
+ **代码检索**(二选一):
244
+ - **ace-tool**(推荐)— 代码检索 `search_context` 可用。[官方](https://augmentcode.com/) | [第三方中转](https://acemcp.heroman.wtf/)
245
+ - **ContextWeaver**(备选)— 本地混合搜索,需要硅基流动 API Key(免费)
212
246
 
213
- ```bash
214
- npx ccg-workflow menu # 选择「安装 Claude Code」
215
- ```
216
-
217
- 支持多种安装方式:npm、homebrew、curl、powershell、cmd
218
-
219
- ## 更新 / 卸载
220
-
221
- ```bash
222
- # 更新
223
- npx ccg-workflow@latest # npx 用户
224
- npm install -g ccg-workflow@latest # npm 全局用户
247
+ **辅助工具**(可选):
248
+ - **Context7** 获取最新库文档(自动安装)
249
+ - **Playwright** — 浏览器自动化 / 测试
250
+ - **DeepWiki** — 知识库查询
251
+ - **Exa** — 搜索引擎(需 API Key)
225
252
 
226
- # 卸载
227
- npx ccg-workflow # 选择 "卸载工作流"
228
- npm uninstall -g ccg-workflow # npm 全局用户需额外执行
229
- ```
253
+ ### 自动授权 Hook
230
254
 
231
- ## 常见问题
255
+ CCG 安装时自动写入 Hook,自动授权 `codeagent-wrapper` 命令(需 [jq](#安装-jq))。
232
256
 
233
- ### 1. 如何让 codeagent-wrapper 无需手动同意即可运行?
257
+ <details>
258
+ <summary>手动配置(v1.7.71 之前的版本)</summary>
234
259
 
235
- v1.7.71+ 安装时会自动写入 Hook。如果你是旧版本用户,可手动在 `~/.claude/settings.json` 中添加:
260
+ `~/.claude/settings.json` 中添加:
236
261
 
237
262
  ```json
238
263
  {
@@ -243,7 +268,7 @@ v1.7.71+ 安装时会自动写入 Hook。如果你是旧版本用户,可手动
243
268
  "hooks": [
244
269
  {
245
270
  "type": "command",
246
- "command": "jq -r '.tool_input.command' | grep -q 'codeagent-wrapper' && echo '{\"hookSpecificOutput\": {\"hookEventName\": \"PreToolUse\", \"permissionDecision\": \"allow\", \"permissionDecisionReason\": \"codeagent-wrapper 命令自动通过\"}}' || exit 1",
271
+ "command": "jq -r '.tool_input.command' | grep -q 'codeagent-wrapper' && echo '{\"hookSpecificOutput\": {\"hookEventName\": \"PreToolUse\", \"permissionDecision\": \"allow\", \"permissionDecisionReason\": \"codeagent-wrapper auto-approved\"}}' || exit 1",
247
272
  "timeout": 1
248
273
  }
249
274
  ]
@@ -253,37 +278,49 @@ v1.7.71+ 安装时会自动写入 Hook。如果你是旧版本用户,可手动
253
278
  }
254
279
  ```
255
280
 
256
- > **注**:需要确保电脑已经安装了 `jq` 命令。安装方法见 [codeagent-wrapper 自动授权](#codeagent-wrapper-自动授权)。
281
+ </details>
257
282
 
258
- ### 2. Codex CLI 0.80.0 进程不退出
283
+ ## 实用工具
259
284
 
260
- `--json` 模式下 Codex 完成输出后进程不会自动退出。
285
+ ```bash
286
+ npx ccg-workflow menu # 选择「实用工具」
287
+ ```
261
288
 
262
- 解决:设置 `CODEAGENT_POST_MESSAGE_DELAY=1`
289
+ - **ccusage** — Claude Code 用量分析
290
+ - **CCometixLine** — 状态栏工具(Git + 用量跟踪)
263
291
 
264
- ## 架构
292
+ ## 更新 / 卸载
265
293
 
266
- ```
267
- Claude Code (编排)
268
-
269
- ┌───┴───┐
270
- ↓ ↓
271
- Codex Gemini
272
- (后端) (前端)
273
- │ │
274
- └───┬───┘
275
-
276
- Unified Patch
294
+ ```bash
295
+ # 更新
296
+ npx ccg-workflow@latest # npx 用户
297
+ npm install -g ccg-workflow@latest # npm 全局用户
298
+
299
+ # 卸载
300
+ npx ccg-workflow # 选择「卸载工作流」
301
+ npm uninstall -g ccg-workflow # npm 全局用户需额外执行
277
302
  ```
278
303
 
279
- 外部模型无写入权限,仅返回 Patch,由 Claude 审核后应用。
304
+ ## 常见问题
305
+
306
+ ### Codex CLI 0.80.0 进程不退出
307
+
308
+ `--json` 模式下 Codex 完成输出后进程不会自动退出。
309
+
310
+ **解决**:将 `CODEAGENT_POST_MESSAGE_DELAY` 设为 `1`,详见[环境变量](#环境变量)。
311
+
312
+ ## 参与贡献
313
+
314
+ 欢迎贡献!请阅读 [CONTRIBUTING.md](./CONTRIBUTING.md) 了解开发指南。
315
+
316
+ 想找一个入手点?查看标记为 [`good first issue`](https://github.com/fengshao1227/ccg-workflow/labels/good%20first%20issue) 的 Issue。
280
317
 
281
318
  ## 致谢
282
319
 
283
- - [cexll/myclaude](https://github.com/cexll/myclaude) - codeagent-wrapper
284
- - [UfoMiao/zcf](https://github.com/UfoMiao/zcf) - Git 工具
285
- - [GudaStudio/skills](https://github.com/GuDaStudio/skills) - 路由设计
286
- - [ace-tool](https://linux.do/t/topic/1344562) - MCP 工具
320
+ - [cexll/myclaude](https://github.com/cexll/myclaude) codeagent-wrapper
321
+ - [UfoMiao/zcf](https://github.com/UfoMiao/zcf) Git 工具
322
+ - [GudaStudio/skills](https://github.com/GuDaStudio/skills) 路由设计
323
+ - [ace-tool](https://linux.do/t/topic/1344562) MCP 工具
287
324
 
288
325
  ## Star History
289
326
 
@@ -295,4 +332,4 @@ MIT
295
332
 
296
333
  ---
297
334
 
298
- v1.7.75 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues)
335
+ v1.7.77 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [参与贡献](./CONTRIBUTING.md)
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import cac from 'cac';
3
3
  import ansis from 'ansis';
4
- import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.C09usDEA.mjs';
4
+ import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.Dgh3VYDe.mjs';
5
5
  import 'inquirer';
6
6
  import 'node:child_process';
7
7
  import 'node:util';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.C09usDEA.mjs';
1
+ export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.Dgh3VYDe.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:child_process';
@@ -10,7 +10,7 @@ import { parse, stringify } from 'smol-toml';
10
10
  import i18next from 'i18next';
11
11
  import ora from 'ora';
12
12
 
13
- const version = "1.7.75";
13
+ const version = "1.7.77";
14
14
 
15
15
  function isWindows() {
16
16
  return process.platform === "win32";
@@ -156,6 +156,9 @@ async function diagnoseMcpConfig() {
156
156
  return issues;
157
157
  }
158
158
 
159
+ const GITHUB_REPO = "fengshao1227/ccg-workflow";
160
+ const RELEASE_TAG = "preset";
161
+ const BINARY_DOWNLOAD_URL = `https://github.com/${GITHUB_REPO}/releases/download/${RELEASE_TAG}`;
159
162
  const __filename$2 = fileURLToPath(import.meta.url);
160
163
  const __dirname$2 = dirname(__filename$2);
161
164
  function findPackageRoot$1(startDir) {
@@ -169,6 +172,19 @@ function findPackageRoot$1(startDir) {
169
172
  return startDir;
170
173
  }
171
174
  const PACKAGE_ROOT$1 = findPackageRoot$1(__dirname$2);
175
+ async function downloadBinaryFromRelease(binaryName, destPath) {
176
+ const url = `${BINARY_DOWNLOAD_URL}/${binaryName}`;
177
+ const response = await fetch(url, { redirect: "follow" });
178
+ if (!response.ok) {
179
+ return false;
180
+ }
181
+ const buffer = Buffer.from(await response.arrayBuffer());
182
+ await fs.writeFile(destPath, buffer);
183
+ if (process.platform !== "win32") {
184
+ await fs.chmod(destPath, 493);
185
+ }
186
+ return true;
187
+ }
172
188
  const WORKFLOW_CONFIGS = [
173
189
  {
174
190
  id: "workflow",
@@ -729,13 +745,23 @@ ${workflow.description}
729
745
  result.configPath = commandsDir;
730
746
  return result;
731
747
  }
732
- const srcBinary = join(PACKAGE_ROOT$1, "bin", binaryName);
733
748
  const destBinary = join(binDir, platform === "win32" ? "codeagent-wrapper.exe" : "codeagent-wrapper");
734
- if (await fs.pathExists(srcBinary)) {
735
- await fs.copy(srcBinary, destBinary);
736
- if (platform !== "win32") {
737
- await fs.chmod(destBinary, 493);
749
+ let installed = false;
750
+ try {
751
+ installed = await downloadBinaryFromRelease(binaryName, destBinary);
752
+ } catch {
753
+ }
754
+ if (!installed) {
755
+ const srcBinary = join(PACKAGE_ROOT$1, "bin", binaryName);
756
+ if (await fs.pathExists(srcBinary)) {
757
+ await fs.copy(srcBinary, destBinary);
758
+ if (platform !== "win32") {
759
+ await fs.chmod(destBinary, 493);
760
+ }
761
+ installed = true;
738
762
  }
763
+ }
764
+ if (installed) {
739
765
  try {
740
766
  const { execSync } = await import('node:child_process');
741
767
  execSync(`"${destBinary}" --version`, { stdio: "pipe" });
@@ -746,7 +772,7 @@ ${workflow.description}
746
772
  result.success = false;
747
773
  }
748
774
  } else {
749
- result.errors.push(`Binary not found in package: ${binaryName}`);
775
+ result.errors.push(`Failed to obtain binary: ${binaryName} (download failed, no local fallback)`);
750
776
  result.success = false;
751
777
  }
752
778
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.7.75",
3
+ "version": "1.7.77",
4
4
  "description": "Claude + Codex + Gemini multi-model collaboration system - smart routing development workflow",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -25,7 +25,7 @@
25
25
  "module": "dist/index.mjs",
26
26
  "types": "dist/index.d.mts",
27
27
  "files": [
28
- "bin",
28
+ "bin/ccg.mjs",
29
29
  "dist",
30
30
  "templates/commands/analyze.md",
31
31
  "templates/commands/backend.md",
Binary file
Binary file
Binary file
Binary file