ccg-workflow 1.7.74 → 1.7.76
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 +198 -159
- package/README.zh-CN.md +200 -163
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{ccg-workflow.Cj1gMkci.mjs → ccg-workflow.Dt7J0_mT.mjs} +16 -3
- package/package.json +1 -1
- package/templates/commands/spec-impl.md +5 -1
- package/templates/commands/spec-plan.md +4 -0
- package/templates/commands/spec-research.md +4 -0
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/ccg-workflow)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
[](https://claude.ai/code)
|
|
8
|
+
[]()
|
|
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
|
-
##
|
|
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
|
-
|
|
58
|
+
On first run, CCG prompts you to select a language (English / Chinese). This preference is saved for all future sessions.
|
|
22
59
|
|
|
23
|
-
|
|
60
|
+
### Install jq
|
|
24
61
|
|
|
25
|
-
|
|
62
|
+
```bash
|
|
63
|
+
# macOS
|
|
64
|
+
brew install jq
|
|
26
65
|
|
|
27
|
-
|
|
66
|
+
# Linux (Debian/Ubuntu)
|
|
67
|
+
sudo apt install jq
|
|
28
68
|
|
|
29
|
-
|
|
69
|
+
# Linux (RHEL/CentOS)
|
|
70
|
+
sudo yum install jq
|
|
30
71
|
|
|
31
|
-
|
|
72
|
+
# Windows
|
|
73
|
+
choco install jq # or: scoop install jq
|
|
74
|
+
```
|
|
32
75
|
|
|
33
|
-
|
|
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
|
-
|
|
78
|
+
```bash
|
|
79
|
+
npx ccg-workflow menu # Select "Install Claude Code"
|
|
80
|
+
```
|
|
64
81
|
|
|
65
|
-
|
|
82
|
+
Supports: npm, homebrew, curl, powershell, cmd.
|
|
66
83
|
|
|
67
|
-
|
|
68
|
-
# Initialize OPSX environment
|
|
69
|
-
/ccg:spec-init
|
|
84
|
+
## Commands
|
|
70
85
|
|
|
71
|
-
|
|
72
|
-
/ccg:spec-research implement user authentication
|
|
86
|
+
### Development Workflow
|
|
73
87
|
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
78
|
-
/ccg:spec-impl
|
|
98
|
+
### Analysis & Quality
|
|
79
99
|
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
109
|
+
### OPSX Spec-Driven
|
|
85
110
|
|
|
86
|
-
|
|
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
|
-
|
|
119
|
+
### Agent Teams (v1.7.60+)
|
|
89
120
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
95
|
-
/ccg:team-plan kanban-api
|
|
128
|
+
> **Prerequisite**: Enable Agent Teams in `settings.json`: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`
|
|
96
129
|
|
|
97
|
-
|
|
98
|
-
/ccg:team-exec
|
|
130
|
+
### Git Tools
|
|
99
131
|
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
139
|
+
### Project Setup
|
|
105
140
|
|
|
106
|
-
|
|
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/ #
|
|
199
|
+
├── commands/ccg/ # 26 slash commands
|
|
131
200
|
├── agents/ccg/ # Sub-agents
|
|
132
|
-
├── skills/
|
|
201
|
+
├── skills/ccg/ # Quality gates + multi-agent orchestration
|
|
133
202
|
├── bin/codeagent-wrapper
|
|
134
203
|
└── .ccg/
|
|
135
|
-
├── config.toml
|
|
136
|
-
└── prompts/
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
|
144
|
-
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
255
|
+
CCG automatically installs a Hook to auto-authorize `codeagent-wrapper` commands (requires [jq](#install-jq)).
|
|
230
256
|
|
|
231
|
-
|
|
257
|
+
<details>
|
|
258
|
+
<summary>Manual setup (for versions before v1.7.71)</summary>
|
|
232
259
|
|
|
233
|
-
|
|
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
|
-
>
|
|
281
|
+
</details>
|
|
255
282
|
|
|
256
|
-
|
|
283
|
+
## Utilities
|
|
257
284
|
|
|
258
|
-
|
|
285
|
+
```bash
|
|
286
|
+
npx ccg-workflow menu # Select "Tools"
|
|
287
|
+
```
|
|
259
288
|
|
|
260
|
-
|
|
289
|
+
- **ccusage** — Claude Code usage analytics
|
|
290
|
+
- **CCometixLine** — Status bar tool (Git + usage tracking)
|
|
261
291
|
|
|
262
|
-
##
|
|
292
|
+
## Update / Uninstall
|
|
263
293
|
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
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)
|
|
282
|
-
- [UfoMiao/zcf](https://github.com/UfoMiao/zcf)
|
|
283
|
-
- [GudaStudio/skills](https://github.com/GuDaStudio/skills)
|
|
284
|
-
- [ace-tool](https://linux.do/t/topic/1344562)
|
|
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.
|
|
335
|
+
v1.7.76 | [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
|
|
1
|
+
# CCG - Claude + Codex + Gemini 多模型协作
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/ccg-workflow)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
[](https://claude.ai/code)
|
|
8
|
+
[]()
|
|
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
|
-
|
|
58
|
+
首次运行会提示选择语言(简体中文 / English),选择后自动保存,后续无需再选。
|
|
22
59
|
|
|
23
|
-
|
|
60
|
+
### 安装 jq
|
|
24
61
|
|
|
25
|
-
|
|
62
|
+
```bash
|
|
63
|
+
# macOS
|
|
64
|
+
brew install jq
|
|
26
65
|
|
|
27
|
-
|
|
66
|
+
# Linux (Debian/Ubuntu)
|
|
67
|
+
sudo apt install jq
|
|
28
68
|
|
|
29
|
-
|
|
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
|
-
|
|
78
|
+
```bash
|
|
79
|
+
npx ccg-workflow menu # 选择「安装 Claude Code」
|
|
80
|
+
```
|
|
64
81
|
|
|
65
|
-
|
|
82
|
+
支持:npm、homebrew、curl、powershell、cmd。
|
|
66
83
|
|
|
67
|
-
|
|
68
|
-
# 初始化 OPSX 环境
|
|
69
|
-
/ccg:spec-init
|
|
84
|
+
## 命令
|
|
70
85
|
|
|
71
|
-
|
|
72
|
-
/ccg:spec-research 实现用户认证
|
|
86
|
+
### 开发工作流
|
|
73
87
|
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
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
|
-
|
|
109
|
+
### OPSX 规范驱动
|
|
85
110
|
|
|
86
|
-
|
|
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
|
-
|
|
119
|
+
### Agent Teams(v1.7.60+)
|
|
89
120
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
121
|
+
| 命令 | 说明 |
|
|
122
|
+
|------|------|
|
|
123
|
+
| `/ccg:team-research` | 需求 → 约束集(并行探索) |
|
|
124
|
+
| `/ccg:team-plan` | 约束 → 并行实施计划 |
|
|
125
|
+
| `/ccg:team-exec` | spawn Builder teammates 并行写代码 |
|
|
126
|
+
| `/ccg:team-review` | 双模型交叉审查 |
|
|
93
127
|
|
|
94
|
-
|
|
95
|
-
/ccg:team-plan kanban-api
|
|
128
|
+
> **前置条件**:需在 `settings.json` 中启用:`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`
|
|
96
129
|
|
|
97
|
-
|
|
98
|
-
/ccg:team-exec
|
|
130
|
+
### Git 工具
|
|
99
131
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
132
|
+
| 命令 | 说明 |
|
|
133
|
+
|------|------|
|
|
134
|
+
| `/ccg:commit` | 智能提交(conventional commit 格式) |
|
|
135
|
+
| `/ccg:rollback` | 交互式回滚 |
|
|
136
|
+
| `/ccg:clean-branches` | 清理已合并分支 |
|
|
137
|
+
| `/ccg:worktree` | Worktree 管理 |
|
|
103
138
|
|
|
104
|
-
|
|
139
|
+
### 项目管理
|
|
105
140
|
|
|
106
|
-
|
|
141
|
+
| 命令 | 说明 |
|
|
142
|
+
|------|------|
|
|
143
|
+
| `/ccg:init` | 初始化项目 CLAUDE.md |
|
|
107
144
|
|
|
108
|
-
|
|
145
|
+
## 工作流指南
|
|
109
146
|
|
|
110
|
-
|
|
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/
|
|
201
|
+
├── skills/ccg/ # 质量关卡 + 多 Agent 协同
|
|
135
202
|
├── bin/codeagent-wrapper
|
|
136
203
|
└── .ccg/
|
|
137
|
-
├── config.toml
|
|
138
|
-
└── prompts/
|
|
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
|
-
|
|
|
146
|
-
|
|
147
|
-
| `
|
|
148
|
-
| `
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
257
|
+
<details>
|
|
258
|
+
<summary>手动配置(v1.7.71 之前的版本)</summary>
|
|
234
259
|
|
|
235
|
-
|
|
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
|
|
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
|
-
>
|
|
281
|
+
</details>
|
|
257
282
|
|
|
258
|
-
|
|
283
|
+
## 实用工具
|
|
259
284
|
|
|
260
|
-
|
|
285
|
+
```bash
|
|
286
|
+
npx ccg-workflow menu # 选择「实用工具」
|
|
287
|
+
```
|
|
261
288
|
|
|
262
|
-
|
|
289
|
+
- **ccusage** — Claude Code 用量分析
|
|
290
|
+
- **CCometixLine** — 状态栏工具(Git + 用量跟踪)
|
|
263
291
|
|
|
264
|
-
##
|
|
292
|
+
## 更新 / 卸载
|
|
265
293
|
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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
|
-
|
|
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)
|
|
284
|
-
- [UfoMiao/zcf](https://github.com/UfoMiao/zcf)
|
|
285
|
-
- [GudaStudio/skills](https://github.com/GuDaStudio/skills)
|
|
286
|
-
- [ace-tool](https://linux.do/t/topic/1344562)
|
|
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.
|
|
335
|
+
v1.7.76 | [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.
|
|
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.Dt7J0_mT.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.
|
|
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.Dt7J0_mT.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.
|
|
13
|
+
const version = "1.7.76";
|
|
14
14
|
|
|
15
15
|
function isWindows() {
|
|
16
16
|
return process.platform === "win32";
|
|
@@ -669,9 +669,22 @@ ${workflow.description}
|
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
const skillsTemplateDir = join(templateDir, "skills");
|
|
672
|
-
const skillsDestDir = join(installDir, "skills");
|
|
672
|
+
const skillsDestDir = join(installDir, "skills", "ccg");
|
|
673
673
|
if (await fs.pathExists(skillsTemplateDir)) {
|
|
674
674
|
try {
|
|
675
|
+
const oldSkillsRoot = join(installDir, "skills");
|
|
676
|
+
const ccgLegacyItems = ["tools", "orchestration", "SKILL.md", "run_skill.js"];
|
|
677
|
+
const needsMigration = !await fs.pathExists(skillsDestDir) && await fs.pathExists(join(oldSkillsRoot, "tools"));
|
|
678
|
+
if (needsMigration) {
|
|
679
|
+
await fs.ensureDir(skillsDestDir);
|
|
680
|
+
for (const item of ccgLegacyItems) {
|
|
681
|
+
const oldPath = join(oldSkillsRoot, item);
|
|
682
|
+
const newPath = join(skillsDestDir, item);
|
|
683
|
+
if (await fs.pathExists(oldPath)) {
|
|
684
|
+
await fs.move(oldPath, newPath, { overwrite: true });
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
675
688
|
await fs.copy(skillsTemplateDir, skillsDestDir, {
|
|
676
689
|
overwrite: force,
|
|
677
690
|
errorOnExist: false
|
|
@@ -756,7 +769,7 @@ async function uninstallWorkflows(installDir) {
|
|
|
756
769
|
const commandsDir = join(installDir, "commands", "ccg");
|
|
757
770
|
join(installDir, ".ccg", "prompts");
|
|
758
771
|
const agentsDir = join(installDir, "agents", "ccg");
|
|
759
|
-
const skillsDir = join(installDir, "skills");
|
|
772
|
+
const skillsDir = join(installDir, "skills", "ccg");
|
|
760
773
|
const binDir = join(installDir, "bin");
|
|
761
774
|
const ccgConfigDir = join(installDir, ".ccg");
|
|
762
775
|
if (await fs.pathExists(commandsDir)) {
|
package/package.json
CHANGED
|
@@ -22,13 +22,17 @@ description: '按规范执行 + 多模型协作 + 归档'
|
|
|
22
22
|
- Confirm with user which change ID to implement.
|
|
23
23
|
- Run `openspec status --change "<change_id>" --json` to review tasks.
|
|
24
24
|
|
|
25
|
-
2. **Apply OPSX Change**
|
|
25
|
+
2. **Apply OPSX Change (Pre-flight Check)**
|
|
26
26
|
- Call `/opsx:apply` internally to enter implementation mode:
|
|
27
27
|
```
|
|
28
28
|
/opsx:apply
|
|
29
29
|
```
|
|
30
30
|
- This will load the change context and guide you through the tasks defined in `tasks.md`.
|
|
31
31
|
- **Note**: This is an internal call. If this step fails, guide the user to re-run `/ccg:spec-impl`.
|
|
32
|
+
- **HARD GATE**: Check the returned `state` field:
|
|
33
|
+
- If `state: "blocked"` → STOP immediately. Inform the user which artifacts are missing and suggest: "Run `/ccg:spec-plan` to generate missing artifacts first."
|
|
34
|
+
- If `progress.total === 0` → STOP immediately. Inform: "tasks.md has no parseable tasks. Run `/ccg:spec-plan` to regenerate."
|
|
35
|
+
- Only proceed to Step 3 when `state: "ready"` and `progress.total > 0`.
|
|
32
36
|
|
|
33
37
|
3. **Identify Minimal Verifiable Phase**
|
|
34
38
|
- Review `tasks.md` and identify the **smallest verifiable phase**.
|
|
@@ -15,6 +15,7 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
|
|
|
15
15
|
- Refer to `openspec/config.yaml` for project conventions.
|
|
16
16
|
- **USER GUIDANCE RULE**: When suggesting next steps to the user, ALWAYS use CCG commands (`/ccg:spec-research`, `/ccg:spec-plan`, `/ccg:spec-impl`, `/ccg:spec-review`). NEVER suggest `/opsx:*` commands to the user. If OpenSpec CLI returns error messages referencing OPSX skills, translate them to CCG equivalents.
|
|
17
17
|
- **TASKS FORMAT RULE**: When generating or modifying `tasks.md`, ALL tasks MUST use checkbox format (`- [ ] X.Y description`). Heading+bullet format will cause OpenSpec CLI to parse 0 tasks and block the workflow.
|
|
18
|
+
- **PHASE BOUNDARY**: This phase ONLY generates OPSX artifacts (specs.md, design.md, tasks.md). Do NOT modify any source code. Do NOT proceed to implementation. After artifacts are generated, STOP and inform the user: "Plan complete. Run `/ccg:spec-impl` to start implementation."
|
|
18
19
|
|
|
19
20
|
**Steps**
|
|
20
21
|
1. **Select Change**
|
|
@@ -114,6 +115,9 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
|
|
|
114
115
|
```
|
|
115
116
|
- The OPSX skill will use the above summary to create specs.md, design.md, and tasks.md.
|
|
116
117
|
- **Note**: This is an internal call. If this step fails, guide the user to re-run `/ccg:spec-plan`.
|
|
118
|
+
- **STOP**: After artifacts are generated, verify they exist and inform user:
|
|
119
|
+
"Plan phase complete. Artifacts generated: specs.md, design.md, tasks.md. Run `/ccg:spec-impl` to start implementation."
|
|
120
|
+
Do NOT proceed to modify source code.
|
|
117
121
|
|
|
118
122
|
6. **Context Checkpoint**
|
|
119
123
|
- Report current context usage.
|
|
@@ -16,6 +16,7 @@ description: '需求 → 约束集(并行探索 + OPSX 提案)'
|
|
|
16
16
|
- Use `{{MCP_SEARCH_TOOL}}` to minimize grep/find operations.
|
|
17
17
|
- Do not make architectural decisions—surface constraints that guide decisions.
|
|
18
18
|
- **USER GUIDANCE RULE**: When suggesting next steps to the user, ALWAYS use CCG commands (`/ccg:spec-research`, `/ccg:spec-plan`, `/ccg:spec-impl`, `/ccg:spec-review`). NEVER suggest `/opsx:*` commands to the user. If OpenSpec CLI returns error messages referencing OPSX skills, translate them to CCG equivalents.
|
|
19
|
+
- **PHASE BOUNDARY**: This phase ONLY generates the OPSX proposal artifact. Do NOT modify any source code. Do NOT proceed to planning or implementation. After the proposal is generated, STOP and inform the user: "Research complete. Run `/ccg:spec-plan` to continue."
|
|
19
20
|
|
|
20
21
|
**Steps**
|
|
21
22
|
0. **MANDATORY: Enhance Requirement FIRST**
|
|
@@ -137,6 +138,9 @@ description: '需求 → 约束集(并行探索 + OPSX 提案)'
|
|
|
137
138
|
```
|
|
138
139
|
- The OPSX skill will use the above summary to write proposal.md.
|
|
139
140
|
- **Note**: This is an internal call. If this step fails, guide the user to re-run `/ccg:spec-research`.
|
|
141
|
+
- **STOP**: After proposal is generated, verify it exists and inform user:
|
|
142
|
+
"Research phase complete. Proposal generated. Run `/ccg:spec-plan` to continue planning."
|
|
143
|
+
Do NOT proceed to planning or implementation.
|
|
140
144
|
|
|
141
145
|
8. **Context Checkpoint**
|
|
142
146
|
- Report current context usage.
|