ccg-workflow 1.4.4 → 1.5.0

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
@@ -28,9 +28,6 @@
28
28
 
29
29
  - ✅ **自动命令包装** - Windows 环境下 `npx` 自动包装为 `cmd /c npx`
30
30
  - ✅ **零手动操作** - 用户无需设置环境变量或修改配置
31
- - ✅ **自动备份** - 修改配置前自动备份到 `~/.claude/backup/`
32
- - ✅ **诊断工具** - `npx ccg diagnose-mcp` 验证配置
33
- - ✅ **一键修复** - `npx ccg fix-mcp` 修复现有配置
34
31
 
35
32
  ### 技术细节
36
33
 
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 { y as diagnoseMcpConfig, z as isWindows, A as readClaudeCodeConfig, B as fixWindowsMcpConfig, C as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, a as i18n } from './shared/ccg-workflow.BYScBcmv.mjs';
4
+ import { y as diagnoseMcpConfig, z as isWindows, A as readClaudeCodeConfig, B as fixWindowsMcpConfig, C as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, a as i18n } from './shared/ccg-workflow.DSwxPZjT.mjs';
5
5
  import 'inquirer';
6
6
  import 'node:os';
7
7
  import 'pathe';
@@ -13,7 +13,7 @@ import 'smol-toml';
13
13
  import 'node:child_process';
14
14
  import 'node:util';
15
15
 
16
- const version = "1.4.4";
16
+ const version = "1.5.0";
17
17
 
18
18
  async function diagnoseMcp() {
19
19
  console.log();
package/dist/index.d.mts CHANGED
@@ -122,7 +122,23 @@ declare function createDefaultRouting(): ModelRouting;
122
122
 
123
123
  declare function getWorkflowConfigs(): WorkflowConfig[];
124
124
  declare function getWorkflowById(id: string): WorkflowConfig | undefined;
125
- declare function installWorkflows(workflowIds: string[], installDir: string, force?: boolean): Promise<InstallResult>;
125
+ declare function installWorkflows(workflowIds: string[], installDir: string, force?: boolean, config?: {
126
+ mcpProvider?: string;
127
+ routing?: {
128
+ mode?: string;
129
+ frontend?: {
130
+ models?: string[];
131
+ primary?: string;
132
+ };
133
+ backend?: {
134
+ models?: string[];
135
+ primary?: string;
136
+ };
137
+ review?: {
138
+ models?: string[];
139
+ };
140
+ };
141
+ }): Promise<InstallResult>;
126
142
  /**
127
143
  * Install and configure ace-tool MCP for Claude Code
128
144
  * Writes to ~/.claude.json (the correct config file for Claude Code CLI)
package/dist/index.d.ts CHANGED
@@ -122,7 +122,23 @@ declare function createDefaultRouting(): ModelRouting;
122
122
 
123
123
  declare function getWorkflowConfigs(): WorkflowConfig[];
124
124
  declare function getWorkflowById(id: string): WorkflowConfig | undefined;
125
- declare function installWorkflows(workflowIds: string[], installDir: string, force?: boolean): Promise<InstallResult>;
125
+ declare function installWorkflows(workflowIds: string[], installDir: string, force?: boolean, config?: {
126
+ mcpProvider?: string;
127
+ routing?: {
128
+ mode?: string;
129
+ frontend?: {
130
+ models?: string[];
131
+ primary?: string;
132
+ };
133
+ backend?: {
134
+ models?: string[];
135
+ primary?: string;
136
+ };
137
+ review?: {
138
+ models?: string[];
139
+ };
140
+ };
141
+ }): Promise<InstallResult>;
126
142
  /**
127
143
  * Install and configure ace-tool MCP for Claude Code
128
144
  * Writes to ~/.claude.json (the correct config file for Claude Code CLI)
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as changeLanguage, v as checkForUpdates, x as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, q as getCurrentVersion, t as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, o as migrateToV1_4_0, p as needsMigration, r as readCcgConfig, s as showMainMenu, n as uninstallAceTool, m as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.BYScBcmv.mjs';
1
+ export { c as changeLanguage, v as checkForUpdates, x as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, q as getCurrentVersion, t as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, o as migrateToV1_4_0, p as needsMigration, r as readCcgConfig, s as showMainMenu, n as uninstallAceTool, m as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.DSwxPZjT.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:os';
@@ -523,7 +523,7 @@ function createDefaultConfig(options) {
523
523
  code_search_ace: "mcp__ace-tool__search_context",
524
524
  code_search_auggie: "mcp__auggie-mcp__codebase-retrieval",
525
525
  prompt_enhance_ace: "mcp__ace-tool__enhance_prompt",
526
- prompt_enhance_auggie: "",
526
+ prompt_enhance_auggie: "mcp__auggie-mcp__enhance_prompt",
527
527
  query_param_ace: "query",
528
528
  query_param_auggie: "information_request"
529
529
  }
@@ -751,17 +751,6 @@ const WORKFLOW_CONFIGS = [
751
751
  description: "\u521D\u59CB\u5316\u9879\u76EE AI \u4E0A\u4E0B\u6587\uFF0C\u751F\u6210/\u66F4\u65B0\u6839\u7EA7\u4E0E\u6A21\u5757\u7EA7 CLAUDE.md \u7D22\u5F15",
752
752
  descriptionEn: "Initialize project AI context, generate/update root and module level CLAUDE.md index"
753
753
  },
754
- {
755
- id: "scan",
756
- name: "\u667A\u80FD\u4ED3\u5E93\u626B\u63CF",
757
- nameEn: "Smart Repository Scan",
758
- category: "planning",
759
- commands: ["scan"],
760
- defaultSelected: true,
761
- order: 31,
762
- description: "\u667A\u80FD\u4ED3\u5E93\u626B\u63CF - \u751F\u6210\u9879\u76EE\u4E0A\u4E0B\u6587\u62A5\u544A\uFF08\u6280\u672F\u6808\u3001API\u3001\u6570\u636E\u6A21\u578B\u3001\u7EC4\u4EF6\u7ED3\u6784\uFF09",
763
- descriptionEn: "Smart repository scan - generate project context report (tech stack, APIs, data models, components)"
764
- },
765
754
  {
766
755
  id: "feat",
767
756
  name: "\u667A\u80FD\u529F\u80FD\u5F00\u53D1",
@@ -780,6 +769,34 @@ function getWorkflowConfigs() {
780
769
  function getWorkflowById(id) {
781
770
  return WORKFLOW_CONFIGS.find((w) => w.id === id);
782
771
  }
772
+ function injectConfigVariables(content, config) {
773
+ let processed = content;
774
+ if (config.mcpProvider === "ace-tool") {
775
+ processed = processed.replace(/\{\{MCP_SEARCH_TOOL\}\}/g, "mcp__ace-tool__search_context");
776
+ processed = processed.replace(/\{\{MCP_ENHANCE_TOOL\}\}/g, "mcp__ace-tool__enhance_prompt");
777
+ processed = processed.replace(/\{\{MCP_SEARCH_PARAM\}\}/g, "query");
778
+ processed = processed.replace(/\{\{MCP_ENHANCE_PARAM\}\}/g, "prompt");
779
+ } else {
780
+ processed = processed.replace(/\{\{MCP_SEARCH_TOOL\}\}/g, "mcp__auggie-mcp__codebase-retrieval");
781
+ processed = processed.replace(/\{\{MCP_ENHANCE_TOOL\}\}/g, "mcp__auggie-mcp__enhance_prompt");
782
+ processed = processed.replace(/\{\{MCP_SEARCH_PARAM\}\}/g, "information_request");
783
+ processed = processed.replace(/\{\{MCP_ENHANCE_PARAM\}\}/g, "prompt");
784
+ }
785
+ const routing = config.routing || {};
786
+ const frontendModels = routing.frontend?.models || ["gemini"];
787
+ const frontendPrimary = routing.frontend?.primary || "gemini";
788
+ processed = processed.replace(/\{\{FRONTEND_MODELS\}\}/g, JSON.stringify(frontendModels));
789
+ processed = processed.replace(/\{\{FRONTEND_PRIMARY\}\}/g, frontendPrimary);
790
+ const backendModels = routing.backend?.models || ["codex"];
791
+ const backendPrimary = routing.backend?.primary || "codex";
792
+ processed = processed.replace(/\{\{BACKEND_MODELS\}\}/g, JSON.stringify(backendModels));
793
+ processed = processed.replace(/\{\{BACKEND_PRIMARY\}\}/g, backendPrimary);
794
+ const reviewModels = routing.review?.models || ["codex", "gemini"];
795
+ processed = processed.replace(/\{\{REVIEW_MODELS\}\}/g, JSON.stringify(reviewModels));
796
+ const routingMode = routing.mode || "smart";
797
+ processed = processed.replace(/\{\{ROUTING_MODE\}\}/g, routingMode);
798
+ return processed;
799
+ }
783
800
  function replaceHomePathsInTemplate(content, installDir) {
784
801
  const userHome = homedir();
785
802
  const ccgDir = join(installDir, ".ccg");
@@ -787,7 +804,16 @@ function replaceHomePathsInTemplate(content, installDir) {
787
804
  processed = processed.replace(/~\//g, `${userHome}/`);
788
805
  return processed;
789
806
  }
790
- async function installWorkflows(workflowIds, installDir, force = false) {
807
+ async function installWorkflows(workflowIds, installDir, force = false, config) {
808
+ const installConfig = {
809
+ mcpProvider: config?.mcpProvider || "auggie",
810
+ routing: config?.routing || {
811
+ mode: "smart",
812
+ frontend: { models: ["gemini"], primary: "gemini" },
813
+ backend: { models: ["codex"], primary: "codex" },
814
+ review: { models: ["codex", "gemini"] }
815
+ }
816
+ };
791
817
  const result = {
792
818
  success: true,
793
819
  installedCommands: [],
@@ -814,7 +840,8 @@ async function installWorkflows(workflowIds, installDir, force = false) {
814
840
  try {
815
841
  if (await fs.pathExists(srcFile)) {
816
842
  if (force || !await fs.pathExists(destFile)) {
817
- const templateContent = await fs.readFile(srcFile, "utf-8");
843
+ let templateContent = await fs.readFile(srcFile, "utf-8");
844
+ templateContent = injectConfigVariables(templateContent, installConfig);
818
845
  const processedContent = replaceHomePathsInTemplate(templateContent, installDir);
819
846
  await fs.writeFile(destFile, processedContent, "utf-8");
820
847
  result.installedCommands.push(cmd);
@@ -843,7 +870,8 @@ ${workflow.description}
843
870
  const sharedConfigDestFile = join(ccgConfigDir, "shared-config.md");
844
871
  if (await fs.pathExists(sharedConfigSrcFile)) {
845
872
  if (force || !await fs.pathExists(sharedConfigDestFile)) {
846
- const templateContent = await fs.readFile(sharedConfigSrcFile, "utf-8");
873
+ let templateContent = await fs.readFile(sharedConfigSrcFile, "utf-8");
874
+ templateContent = injectConfigVariables(templateContent, installConfig);
847
875
  const processedContent = replaceHomePathsInTemplate(templateContent, installDir);
848
876
  await fs.writeFile(sharedConfigDestFile, processedContent, "utf-8");
849
877
  }
@@ -859,7 +887,8 @@ ${workflow.description}
859
887
  const srcFile = join(agentsSrcDir, file);
860
888
  const destFile = join(agentsDestDir, file);
861
889
  if (force || !await fs.pathExists(destFile)) {
862
- const templateContent = await fs.readFile(srcFile, "utf-8");
890
+ let templateContent = await fs.readFile(srcFile, "utf-8");
891
+ templateContent = injectConfigVariables(templateContent, installConfig);
863
892
  const processedContent = replaceHomePathsInTemplate(templateContent, installDir);
864
893
  await fs.writeFile(destFile, processedContent, "utf-8");
865
894
  }
@@ -1398,7 +1427,10 @@ async function init(options = {}) {
1398
1427
  });
1399
1428
  await writeCcgConfig(config);
1400
1429
  const installDir = options.installDir || join(homedir(), ".claude");
1401
- const result = await installWorkflows(selectedWorkflows, installDir, options.force);
1430
+ const result = await installWorkflows(selectedWorkflows, installDir, options.force, {
1431
+ mcpProvider,
1432
+ routing
1433
+ });
1402
1434
  if (aceToolBaseUrl || aceToolToken) {
1403
1435
  spinner.text = i18n.t("init:aceTool.installing");
1404
1436
  const aceResult = await installAceTool({
@@ -1643,7 +1675,10 @@ async function performUpdate(fromVersion, toVersion) {
1643
1675
  const config = await readCcgConfig();
1644
1676
  const workflows = config?.workflows?.installed || [];
1645
1677
  const installDir = join(homedir(), ".claude");
1646
- const result = await installWorkflows(workflows, installDir, true);
1678
+ const result = await installWorkflows(workflows, installDir, true, {
1679
+ mcpProvider: config?.mcp?.provider || "auggie",
1680
+ routing: config?.routing
1681
+ });
1647
1682
  if (result.success) {
1648
1683
  spinner.succeed("\u547D\u4EE4\u6A21\u677F\u548C\u63D0\u793A\u8BCD\u66F4\u65B0\u6210\u529F");
1649
1684
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.4.4",
3
+ "version": "1.5.0",
4
4
  "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: planner
3
3
  description: 📋 任务规划师 - 使用 WBS 方法论分解功能需求为可执行任务
4
- tools: Read, Write, mcp__ace-tool__search_context
4
+ tools: Read, Write, {{MCP_SEARCH_TOOL}}
5
5
  color: blue
6
6
  ---
7
7
 
@@ -29,7 +29,7 @@ color: blue
29
29
  如果需要了解现有实现,使用 ace-tool 检索:
30
30
 
31
31
  ```
32
- mcp__ace-tool__search_context {
32
+ {{MCP_SEARCH_TOOL}} {
33
33
  "project_root_path": "{{项目路径}}",
34
34
  "query": "{{相关功能关键词}}"
35
35
  }
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ui-ux-designer
3
3
  description: 🎨 UI/UX 设计师 - 为前端功能生成页面结构、组件拆分和交互流程设计
4
- tools: Read, Write, mcp__ace-tool__search_context
4
+ tools: Read, Write, {{MCP_SEARCH_TOOL}}
5
5
  color: magenta
6
6
  ---
7
7
 
@@ -30,7 +30,7 @@ color: magenta
30
30
  如果项目已有组件库,使用 ace-tool 检索:
31
31
 
32
32
  ```
33
- mcp__ace-tool__search_context {
33
+ {{MCP_SEARCH_TOOL}} {
34
34
  "project_root_path": "{{项目路径}}",
35
35
  "query": "可复用的 UI 组件、按钮、表单、卡片、布局组件"
36
36
  }
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: 多模型技术分析(根据配置并行),交叉验证后综合见解
2
+ description: 多模型技术分析(并行执行),交叉验证后综合见解
3
3
  ---
4
4
 
5
5
  > 调用语法见 `_config.md`
@@ -12,18 +12,6 @@ description: 多模型技术分析(根据配置并行),交叉验证后综
12
12
  - This command triggers multi-model analysis without code changes.
13
13
  - Configured models provide perspectives for cross-validation.
14
14
 
15
- ## 配置
16
- **首先读取 `~/.claude/.ccg/config.toml` 获取模型配置**:
17
- ```toml
18
- [routing.frontend]
19
- models = ["gemini", "codex"]
20
-
21
- [routing.backend]
22
- models = ["codex", "gemini"]
23
- ```
24
-
25
- 分析任务使用 `routing.frontend.models` 和 `routing.backend.models` 的并集。
26
-
27
15
  ## 你的角色
28
16
  You are the **Analysis Coordinator** orchestrating multi-model research. You direct:
29
17
  1. **ace-tool** – for codebase context retrieval
@@ -32,52 +20,41 @@ You are the **Analysis Coordinator** orchestrating multi-model research. You dir
32
20
 
33
21
  ## 流程
34
22
 
35
- ### Step 1: 读取配置 + 上下文检索
23
+ ### Step 1: 上下文检索
36
24
 
37
- 1. **读取 `~/.claude/.ccg/config.toml`** 获取模型配置
38
- 2. 合并 `routing.frontend.models` 和 `routing.backend.models` 获取分析模型列表
39
- 3. 如果配置不存在,默认使用 `["codex", "gemini"]`
40
- 4. Call `mcp__ace-tool__search_context` to understand relevant code:
25
+ 1. Call `{{MCP_SEARCH_TOOL}}` to understand relevant code:
41
26
  - `project_root_path`: Project root directory absolute path
42
27
  - `query`: Natural language description of what to analyze
43
28
  5. Identify key files, patterns, and architecture
44
29
 
45
30
  ### Step 2: 并行分析
46
31
 
47
- **并行调用所有配置的分析模型**(使用 `run_in_background: true` 非阻塞执行):
32
+ **并行调用所有配置的分析模型**(使用 `run_in_background: true`):
48
33
 
49
- **调用方式**: 使用 `Bash` 工具调用 `codeagent-wrapper`
34
+ 遍历后端模型 {{BACKEND_MODELS}} 和前端模型 {{FRONTEND_MODELS}}(合并去重):
50
35
 
51
36
  ```bash
52
- # Codex 技术分析
53
- codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
54
- ROLE_FILE: ~/.claude/.ccg/prompts/codex/analyzer.md
55
-
56
- <TASK>
57
- 分析任务: {{分析问题或任务}}
58
- Context: {{从 ace-tool 获取的相关代码}}
59
- </TASK>
37
+ # 合并并去重后端和前端模型列表
38
+ BACKEND='{{BACKEND_MODELS}}'
39
+ FRONTEND='{{FRONTEND_MODELS}}'
40
+ ALL_MODELS=$(echo "$BACKEND $FRONTEND" | jq -s 'add | unique' | jq -r '.[]')
60
41
 
61
- OUTPUT: Detailed analysis with recommendations.
62
- EOF
63
- ```
64
-
65
- ```bash
66
- # Gemini 技术分析
67
- codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
68
- ROLE_FILE: ~/.claude/.ccg/prompts/gemini/analyzer.md
42
+ # 遍历所有分析模型
43
+ for model in $ALL_MODELS; do
44
+ codeagent-wrapper --backend $model - $PROJECT_DIR <<'EOF' &
45
+ ROLE_FILE: ~/.claude/.ccg/prompts/$model/analyzer.md
69
46
 
70
47
  <TASK>
71
48
  分析任务: {{分析问题或任务}}
72
- Context: {{从 ace-tool 获取的相关代码}}
49
+ Context: {{从 MCP 获取的相关代码}}
73
50
  </TASK>
74
51
 
75
52
  OUTPUT: Detailed analysis with recommendations.
76
53
  EOF
54
+ done
55
+ wait # 等待所有后台任务完成
77
56
  ```
78
57
 
79
- 遍历合并后的模型列表(去重),为每个模型动态生成上述调用,使用 `analyzer` 角色。
80
-
81
58
  ### Step 3: 交叉验证
82
59
  使用 `TaskOutput` 获取所有任务的结果,然后:
83
60
  1. Compare perspectives from all configured models
@@ -96,7 +73,6 @@ Present unified analysis combining all perspectives.
96
73
  5. **Recommendations** – actionable next steps
97
74
 
98
75
  ## 注意事项
99
- - **首先读取 `~/.claude/.ccg/config.toml` 获取模型配置**
100
76
  - This command is for analysis only, no code changes
101
77
  - **Use `run_in_background: true` for parallel execution** to avoid blocking
102
78
  - 多模型结果交叉验证,取长补短
@@ -12,15 +12,6 @@ description: 后端/逻辑/算法任务,自动路由到配置的后端模型
12
12
  - This command routes to your configured backend models.
13
13
  - Default authority for algorithms, APIs, and business logic.
14
14
 
15
- ## 配置
16
- **首先读取 `~/.claude/.ccg/config.toml` 获取模型路由配置**:
17
- ```toml
18
- [routing.backend]
19
- models = ["codex", "gemini"] # 用户配置的后端模型列表
20
- primary = "codex" # 主模型
21
- strategy = "parallel" # 路由策略: parallel | fallback | round-robin
22
- ```
23
-
24
15
  ## 你的角色
25
16
  You are the **Backend Orchestrator** specializing in server-side logic. You coordinate:
26
17
  1. **ace-tool** – for retrieving existing backend code and architecture
@@ -29,61 +20,29 @@ You are the **Backend Orchestrator** specializing in server-side logic. You coor
29
20
 
30
21
  ## 流程
31
22
 
32
- ### Step 1: 读取配置
33
- 1. Read `~/.claude/.ccg/config.toml` to get backend model configuration
34
- 2. Identify which models to use based on `routing.backend.models`
35
- 3. If config doesn't exist, default to `codex`
36
-
37
- ### Step 2: 上下文检索
38
- 1. Call `mcp__ace-tool__search_context` to understand existing architecture:
23
+ ### Step 1: 上下文检索
24
+ 1. Call `{{MCP_SEARCH_TOOL}}` to understand existing architecture:
39
25
  - `project_root_path`: Project root directory absolute path
40
26
  - `query`: Natural language description of the backend task
41
27
  2. Identify API patterns, data models, services, and dependencies
42
28
 
43
- ### Step 3: 模型原型生成
44
-
45
- **根据配置的 strategy 执行**:
46
- - **parallel**: 同时调用所有配置的后端模型,综合结果
47
- - **fallback**: 调用主模型,失败则调用次模型
48
- - **round-robin**: 轮询调用
49
-
50
- **调用方式**: 使用 `Bash` 工具调用 `codeagent-wrapper`
51
-
52
- ```bash
53
- # Codex 后端原型示例
54
- codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
55
- ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
56
-
57
- <TASK>
58
- 实现后端功能: {{后端任务描述}}
59
- Context: {{从 ace-tool 获取的 API 架构和数据模型}}
60
- </TASK>
29
+ ### Step 2: 调用后端模型生成原型
61
30
 
62
- OUTPUT: Unified Diff Patch ONLY. Strictly prohibit any actual modifications.
63
- EOF
64
- ```
31
+ 使用配置的后端主模型 ({{BACKEND_PRIMARY}}) 生成后端原型:
65
32
 
66
33
  ```bash
67
- # Gemini 后端原型示例(如配置中包含)
68
- codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
69
- ROLE_FILE: ~/.claude/.ccg/prompts/gemini/analyzer.md
34
+ codeagent-wrapper --backend {{BACKEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
35
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/architect.md
70
36
 
71
37
  <TASK>
72
38
  实现后端功能: {{后端任务描述}}
73
- Context: {{从 ace-tool 获取的 API 架构和数据模型}}
39
+ Context: {{从 MCP 获取的 API 架构和数据模型}}
74
40
  </TASK>
75
41
 
76
42
  OUTPUT: Unified Diff Patch ONLY. Strictly prohibit any actual modifications.
77
43
  EOF
78
44
  ```
79
45
 
80
- 遍历 `routing.backend.models`,为每个模型动态生成上述调用:
81
- - **Codex**: 使用 `architect` 角色
82
- - **Gemini**: 使用 `analyzer` 角色(Gemini 无专门后端角色)
83
-
84
- **如果 strategy = parallel 且有多个模型**:
85
- 使用 `run_in_background: true` 并行调用所有模型,然后用 `TaskOutput` 收集结果。
86
-
87
46
  ### Step 4: 重构与实施
88
47
  1. Review model prototype(s) as "dirty prototype"
89
48
  2. If multiple models, cross-validate and select best patterns
@@ -107,6 +66,5 @@ Call configured backend model(s) to review the final implementation:
107
66
  ## 注意事项
108
67
  - Codex excels at complex logic and debugging
109
68
  - Codex uses read-only sandbox by default
110
- - Read `~/.claude/.ccg/config.toml` at start of execution
111
69
  - Always request Unified Diff Patch format
112
70
  - Use HEREDOC syntax (`<<'EOF'`) to avoid shell escaping issues
@@ -15,7 +15,7 @@ description: 质量门控修复(双模型交叉验证,90%+ 通过)
15
15
  ## 流程
16
16
 
17
17
  ### Phase 1: Bug 分析
18
- 1. 调用 `mcp__ace-tool__search_context` 检索相关代码:
18
+ 1. 调用 `{{MCP_SEARCH_TOOL}}` 检索相关代码:
19
19
  - `project_root_path`: 项目根目录绝对路径
20
20
  - `query`: Bug 的自然语言描述
21
21
  2. 分析 bug 类型:前端/后端/全栈
@@ -28,8 +28,8 @@ description: 质量门控修复(双模型交叉验证,90%+ 通过)
28
28
 
29
29
  ```bash
30
30
  # Codex 后端诊断修复
31
- codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
32
- ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
31
+ codeagent-wrapper --backend {{BACKEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
32
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/architect.md
33
33
 
34
34
  <TASK>
35
35
  Bug 修复: {{Bug 描述}}
@@ -42,8 +42,8 @@ EOF
42
42
 
43
43
  ```bash
44
44
  # Gemini 前端诊断修复
45
- codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
46
- ROLE_FILE: ~/.claude/.ccg/prompts/gemini/frontend.md
45
+ codeagent-wrapper --backend {{FRONTEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
46
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/frontend.md
47
47
 
48
48
  <TASK>
49
49
  Bug 修复: {{Bug 描述}}
@@ -72,8 +72,8 @@ EOF
72
72
 
73
73
  ```bash
74
74
  # Codex 审查修复
75
- codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
76
- ROLE_FILE: ~/.claude/.ccg/prompts/codex/reviewer.md
75
+ codeagent-wrapper --backend {{BACKEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
76
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/reviewer.md
77
77
 
78
78
  <TASK>
79
79
  审查修复: {{实施的修复代码}}
@@ -86,8 +86,8 @@ EOF
86
86
 
87
87
  ```bash
88
88
  # Gemini 审查修复
89
- codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
90
- ROLE_FILE: ~/.claude/.ccg/prompts/gemini/reviewer.md
89
+ codeagent-wrapper --backend {{FRONTEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
90
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/reviewer.md
91
91
 
92
92
  <TASK>
93
93
  审查修复: {{实施的修复代码}}
@@ -16,7 +16,7 @@ description: 三模型代码生成(Codex + Gemini + Claude 并行原型,集
16
16
 
17
17
  ### Phase 1: 需求分析
18
18
 
19
- 1. 调用 `mcp__ace-tool__search_context` 检索:
19
+ 1. 调用 `{{MCP_SEARCH_TOOL}}` 检索:
20
20
  - `project_root_path`: 项目根目录绝对路径
21
21
  - `query`: 功能需求的自然语言描述
22
22
  - 相关模块和文件结构
@@ -35,8 +35,8 @@ description: 三模型代码生成(Codex + Gemini + Claude 并行原型,集
35
35
 
36
36
  ```bash
37
37
  # Codex 后端架构原型
38
- codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
39
- ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
38
+ codeagent-wrapper --backend {{BACKEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
39
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/architect.md
40
40
 
41
41
  <TASK>
42
42
  生成原型: {{功能需求}}
@@ -49,8 +49,8 @@ EOF
49
49
 
50
50
  ```bash
51
51
  # Gemini 前端 UI 原型
52
- codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
53
- ROLE_FILE: ~/.claude/.ccg/prompts/gemini/frontend.md
52
+ codeagent-wrapper --backend {{FRONTEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
53
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/frontend.md
54
54
 
55
55
  <TASK>
56
56
  生成原型: {{功能需求}}
@@ -122,8 +122,8 @@ API Contract:
122
122
 
123
123
  ```bash
124
124
  # Codex 安全性审查
125
- codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
126
- ROLE_FILE: ~/.claude/.ccg/prompts/codex/reviewer.md
125
+ codeagent-wrapper --backend {{BACKEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
126
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/reviewer.md
127
127
 
128
128
  <TASK>
129
129
  审查代码: {{实施的代码变更}}
@@ -136,8 +136,8 @@ EOF
136
136
 
137
137
  ```bash
138
138
  # Gemini 设计审查
139
- codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
140
- ROLE_FILE: ~/.claude/.ccg/prompts/gemini/reviewer.md
139
+ codeagent-wrapper --backend {{FRONTEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
140
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/reviewer.md
141
141
 
142
142
  <TASK>
143
143
  审查代码: {{实施的代码变更}}
@@ -16,7 +16,7 @@ description: UltraThink 多模型调试(Codex 后端诊断 + Gemini 前端诊
16
16
 
17
17
  ### Phase 1: 上下文检索
18
18
 
19
- 1. 调用 `mcp__ace-tool__search_context` 检索相关代码:
19
+ 1. 调用 `{{MCP_SEARCH_TOOL}}` 检索相关代码:
20
20
  - `project_root_path`: 项目根目录绝对路径
21
21
  - `query`: 问题的自然语言描述
22
22
  2. 收集错误日志、堆栈信息、复现步骤
@@ -30,8 +30,8 @@ description: UltraThink 多模型调试(Codex 后端诊断 + Gemini 前端诊
30
30
 
31
31
  ```bash
32
32
  # Codex 后端诊断
33
- codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
34
- ROLE_FILE: ~/.claude/.ccg/prompts/codex/debugger.md
33
+ codeagent-wrapper --backend {{BACKEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
34
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/debugger.md
35
35
 
36
36
  <TASK>
37
37
  诊断问题: {{问题描述}}
@@ -44,8 +44,8 @@ EOF
44
44
 
45
45
  ```bash
46
46
  # Gemini 前端诊断
47
- codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
48
- ROLE_FILE: ~/.claude/.ccg/prompts/gemini/debugger.md
47
+ codeagent-wrapper --backend {{FRONTEND_PRIMARY}} - $PROJECT_DIR <<'EOF'
48
+ ROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/debugger.md
49
49
 
50
50
  <TASK>
51
51
  诊断问题: {{问题描述}}