ccg-workflow 1.4.0 → 1.4.2
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 +500 -483
- package/dist/cli.mjs +67 -2
- package/dist/index.mjs +1 -1
- package/dist/shared/{ccg-workflow.DaI-Qubz.mjs → ccg-workflow.DrRf2eRd.mjs} +152 -42
- package/package.json +1 -1
- package/templates/commands/analyze.md +5 -5
- package/templates/commands/backend.md +5 -5
- package/templates/commands/bugfix.md +4 -4
- package/templates/commands/code.md +6 -6
- package/templates/commands/debug.md +2 -2
- package/templates/commands/dev.md +7 -7
- package/templates/commands/feat.md +2 -2
- package/templates/commands/frontend.md +5 -5
- package/templates/commands/optimize.md +2 -2
- package/templates/commands/review.md +5 -5
- package/templates/commands/test.md +2 -2
- package/templates/commands/think.md +2 -2
- package/templates/config/shared-config.md +2 -2
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 { r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, a as i18n } from './shared/ccg-workflow.
|
|
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.DrRf2eRd.mjs';
|
|
5
5
|
import 'inquirer';
|
|
6
6
|
import 'node:os';
|
|
7
7
|
import 'pathe';
|
|
@@ -13,7 +13,66 @@ import 'smol-toml';
|
|
|
13
13
|
import 'node:child_process';
|
|
14
14
|
import 'node:util';
|
|
15
15
|
|
|
16
|
-
const version = "1.4.
|
|
16
|
+
const version = "1.4.2";
|
|
17
|
+
|
|
18
|
+
async function diagnoseMcp() {
|
|
19
|
+
console.log();
|
|
20
|
+
console.log(ansis.cyan.bold(" \u{1F50D} MCP Configuration Diagnostics"));
|
|
21
|
+
console.log();
|
|
22
|
+
const issues = await diagnoseMcpConfig();
|
|
23
|
+
console.log(ansis.bold(" Diagnostic Results:"));
|
|
24
|
+
console.log();
|
|
25
|
+
for (const issue of issues) {
|
|
26
|
+
if (issue.startsWith("\u2705")) {
|
|
27
|
+
console.log(ansis.green(` ${issue}`));
|
|
28
|
+
} else if (issue.startsWith("\u26A0\uFE0F")) {
|
|
29
|
+
console.log(ansis.yellow(` ${issue}`));
|
|
30
|
+
} else if (issue.startsWith("\u274C")) {
|
|
31
|
+
console.log(ansis.red(` ${issue}`));
|
|
32
|
+
} else {
|
|
33
|
+
console.log(` ${issue}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (isWindows() && issues.some((i) => i.includes("not properly wrapped"))) {
|
|
37
|
+
console.log();
|
|
38
|
+
console.log(ansis.yellow(" \u{1F4A1} Tip: Run the following command to fix Windows MCP configuration:"));
|
|
39
|
+
console.log(ansis.gray(" npx ccg fix-mcp"));
|
|
40
|
+
}
|
|
41
|
+
console.log();
|
|
42
|
+
}
|
|
43
|
+
async function fixMcp() {
|
|
44
|
+
console.log();
|
|
45
|
+
console.log(ansis.cyan.bold(" \u{1F527} Fixing MCP Configuration"));
|
|
46
|
+
console.log();
|
|
47
|
+
if (!isWindows()) {
|
|
48
|
+
console.log(ansis.yellow(" \u26A0\uFE0F This command is only needed on Windows"));
|
|
49
|
+
console.log();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const config = await readClaudeCodeConfig();
|
|
54
|
+
if (!config) {
|
|
55
|
+
console.log(ansis.red(" \u274C No ~/.claude.json found"));
|
|
56
|
+
console.log();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!config.mcpServers || Object.keys(config.mcpServers).length === 0) {
|
|
60
|
+
console.log(ansis.yellow(" \u26A0\uFE0F No MCP servers configured"));
|
|
61
|
+
console.log();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const fixedConfig = fixWindowsMcpConfig(config);
|
|
65
|
+
await writeClaudeCodeConfig(fixedConfig);
|
|
66
|
+
console.log(ansis.green(" \u2705 Windows MCP configuration fixed"));
|
|
67
|
+
console.log();
|
|
68
|
+
console.log(ansis.gray(" Run diagnostics again to verify:"));
|
|
69
|
+
console.log(ansis.gray(" npx ccg diagnose-mcp"));
|
|
70
|
+
console.log();
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.log(ansis.red(` \u274C Failed to fix MCP configuration: ${error}`));
|
|
73
|
+
console.log();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
17
76
|
|
|
18
77
|
function customizeHelp(sections) {
|
|
19
78
|
sections.unshift({
|
|
@@ -87,6 +146,12 @@ async function setupCommands(cli) {
|
|
|
87
146
|
}
|
|
88
147
|
await init(options);
|
|
89
148
|
});
|
|
149
|
+
cli.command("diagnose-mcp", "Diagnose MCP configuration issues").action(async () => {
|
|
150
|
+
await diagnoseMcp();
|
|
151
|
+
});
|
|
152
|
+
cli.command("fix-mcp", "Fix Windows MCP configuration issues").action(async () => {
|
|
153
|
+
await fixMcp();
|
|
154
|
+
});
|
|
90
155
|
cli.help((sections) => customizeHelp(sections));
|
|
91
156
|
cli.version(version);
|
|
92
157
|
}
|
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.
|
|
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.DrRf2eRd.mjs';
|
|
2
2
|
import 'ansis';
|
|
3
3
|
import 'inquirer';
|
|
4
4
|
import 'node:os';
|
|
@@ -10,6 +10,127 @@ import { parse, stringify } from 'smol-toml';
|
|
|
10
10
|
import { exec } from 'node:child_process';
|
|
11
11
|
import { promisify } from 'node:util';
|
|
12
12
|
|
|
13
|
+
function isWindows() {
|
|
14
|
+
return process.platform === "win32";
|
|
15
|
+
}
|
|
16
|
+
function getMcpCommand(command) {
|
|
17
|
+
const needsWrapping = ["npx", "uvx", "node", "npm", "pnpm", "yarn"];
|
|
18
|
+
if (isWindows() && needsWrapping.includes(command)) {
|
|
19
|
+
return ["cmd", "/c", command];
|
|
20
|
+
}
|
|
21
|
+
return [command];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getClaudeCodeConfigPath() {
|
|
25
|
+
return join(homedir(), ".claude.json");
|
|
26
|
+
}
|
|
27
|
+
async function readClaudeCodeConfig() {
|
|
28
|
+
const configPath = getClaudeCodeConfigPath();
|
|
29
|
+
try {
|
|
30
|
+
if (!await fs.pathExists(configPath)) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const content = await fs.readFile(configPath, "utf-8");
|
|
34
|
+
return JSON.parse(content);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error("Failed to read Claude Code config:", error);
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function writeClaudeCodeConfig(config) {
|
|
41
|
+
const configPath = getClaudeCodeConfigPath();
|
|
42
|
+
try {
|
|
43
|
+
await fs.writeFile(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
44
|
+
} catch (error) {
|
|
45
|
+
throw new Error(`Failed to write Claude Code config: ${error}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function applyPlatformCommand(config) {
|
|
49
|
+
if (isWindows() && config.command) {
|
|
50
|
+
const mcpCmd = getMcpCommand(config.command);
|
|
51
|
+
if (mcpCmd[0] === "cmd") {
|
|
52
|
+
const originalCommand = config.command;
|
|
53
|
+
const originalArgs = config.args || [];
|
|
54
|
+
config.command = mcpCmd[0];
|
|
55
|
+
config.args = [...mcpCmd.slice(1), originalCommand, ...originalArgs];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function buildMcpServerConfig(baseConfig, apiKey, placeholder = "YOUR_API_KEY", envVarName) {
|
|
60
|
+
const config = JSON.parse(JSON.stringify(baseConfig));
|
|
61
|
+
applyPlatformCommand(config);
|
|
62
|
+
{
|
|
63
|
+
return config;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function fixWindowsMcpConfig(config) {
|
|
67
|
+
if (!isWindows() || !config.mcpServers) {
|
|
68
|
+
return config;
|
|
69
|
+
}
|
|
70
|
+
const fixed = JSON.parse(JSON.stringify(config));
|
|
71
|
+
for (const [serverName, serverConfig] of Object.entries(fixed.mcpServers || {})) {
|
|
72
|
+
if (serverConfig && typeof serverConfig === "object" && "command" in serverConfig) {
|
|
73
|
+
applyPlatformCommand(serverConfig);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return fixed;
|
|
77
|
+
}
|
|
78
|
+
function mergeMcpServers(existing, newServers) {
|
|
79
|
+
const config = existing || { mcpServers: {} };
|
|
80
|
+
if (!config.mcpServers) {
|
|
81
|
+
config.mcpServers = {};
|
|
82
|
+
}
|
|
83
|
+
Object.assign(config.mcpServers, newServers);
|
|
84
|
+
return config;
|
|
85
|
+
}
|
|
86
|
+
async function backupClaudeCodeConfig() {
|
|
87
|
+
const configPath = getClaudeCodeConfigPath();
|
|
88
|
+
try {
|
|
89
|
+
if (!await fs.pathExists(configPath)) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
const backupDir = join(homedir(), ".claude", "backup");
|
|
93
|
+
await fs.ensureDir(backupDir);
|
|
94
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
95
|
+
const backupPath = join(backupDir, `claude-config-${timestamp}.json`);
|
|
96
|
+
await fs.copy(configPath, backupPath);
|
|
97
|
+
return backupPath;
|
|
98
|
+
} catch (error) {
|
|
99
|
+
console.error("Failed to backup Claude Code config:", error);
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async function diagnoseMcpConfig() {
|
|
104
|
+
const issues = [];
|
|
105
|
+
const configPath = getClaudeCodeConfigPath();
|
|
106
|
+
if (!await fs.pathExists(configPath)) {
|
|
107
|
+
issues.push("\u274C ~/.claude.json does not exist");
|
|
108
|
+
return issues;
|
|
109
|
+
}
|
|
110
|
+
const config = await readClaudeCodeConfig();
|
|
111
|
+
if (!config) {
|
|
112
|
+
issues.push("\u274C Failed to parse ~/.claude.json");
|
|
113
|
+
return issues;
|
|
114
|
+
}
|
|
115
|
+
if (!config.mcpServers || Object.keys(config.mcpServers).length === 0) {
|
|
116
|
+
issues.push("\u26A0\uFE0F No MCP servers configured");
|
|
117
|
+
return issues;
|
|
118
|
+
}
|
|
119
|
+
if (isWindows()) {
|
|
120
|
+
for (const [name, server] of Object.entries(config.mcpServers)) {
|
|
121
|
+
if (server.command && ["npx", "uvx", "node"].includes(server.command)) {
|
|
122
|
+
if (server.command !== "cmd") {
|
|
123
|
+
issues.push(`\u274C ${name}: Command not properly wrapped for Windows (should use cmd /c)`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (issues.length === 0) {
|
|
129
|
+
issues.push("\u2705 MCP configuration looks good");
|
|
130
|
+
}
|
|
131
|
+
return issues;
|
|
132
|
+
}
|
|
133
|
+
|
|
13
134
|
const i18n = i18next;
|
|
14
135
|
const zhCN = {
|
|
15
136
|
common: {
|
|
@@ -808,9 +929,6 @@ ${workflow.description}
|
|
|
808
929
|
result.configPath = commandsDir;
|
|
809
930
|
return result;
|
|
810
931
|
}
|
|
811
|
-
function getClaudeCodeConfigPath() {
|
|
812
|
-
return join(homedir(), ".claude.json");
|
|
813
|
-
}
|
|
814
932
|
async function uninstallWorkflows(installDir) {
|
|
815
933
|
const result = {
|
|
816
934
|
success: true,
|
|
@@ -857,32 +975,23 @@ async function uninstallWorkflows(installDir) {
|
|
|
857
975
|
return result;
|
|
858
976
|
}
|
|
859
977
|
async function uninstallAceTool() {
|
|
860
|
-
const mcpConfigPath = getClaudeCodeConfigPath();
|
|
861
978
|
try {
|
|
862
|
-
|
|
979
|
+
const existingConfig = await readClaudeCodeConfig();
|
|
980
|
+
if (!existingConfig) {
|
|
863
981
|
return {
|
|
864
982
|
success: true,
|
|
865
983
|
message: "No ~/.claude.json found, nothing to remove"
|
|
866
984
|
};
|
|
867
985
|
}
|
|
868
|
-
const content = await fs.readFile(mcpConfigPath, "utf-8");
|
|
869
|
-
let existingConfig;
|
|
870
|
-
try {
|
|
871
|
-
existingConfig = JSON.parse(content);
|
|
872
|
-
} catch {
|
|
873
|
-
return {
|
|
874
|
-
success: false,
|
|
875
|
-
message: "Failed to parse ~/.claude.json"
|
|
876
|
-
};
|
|
877
|
-
}
|
|
878
986
|
if (!existingConfig.mcpServers || !existingConfig.mcpServers["ace-tool"]) {
|
|
879
987
|
return {
|
|
880
988
|
success: true,
|
|
881
989
|
message: "ace-tool MCP not found in config"
|
|
882
990
|
};
|
|
883
991
|
}
|
|
992
|
+
await backupClaudeCodeConfig();
|
|
884
993
|
delete existingConfig.mcpServers["ace-tool"];
|
|
885
|
-
await
|
|
994
|
+
await writeClaudeCodeConfig(existingConfig);
|
|
886
995
|
return {
|
|
887
996
|
success: true,
|
|
888
997
|
message: "ace-tool MCP removed from ~/.claude.json"
|
|
@@ -896,40 +1005,41 @@ async function uninstallAceTool() {
|
|
|
896
1005
|
}
|
|
897
1006
|
async function installAceTool(config) {
|
|
898
1007
|
const { baseUrl, token } = config;
|
|
899
|
-
const args = ["-y", "ace-tool@latest"];
|
|
900
|
-
if (baseUrl) {
|
|
901
|
-
args.push("--base-url", baseUrl);
|
|
902
|
-
}
|
|
903
|
-
if (token) {
|
|
904
|
-
args.push("--token", token);
|
|
905
|
-
}
|
|
906
|
-
const mcpConfigPath = getClaudeCodeConfigPath();
|
|
907
1008
|
try {
|
|
908
|
-
let existingConfig =
|
|
909
|
-
if (
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
message: "Failed to parse existing ~/.claude.json - please check the file format"
|
|
917
|
-
};
|
|
1009
|
+
let existingConfig = await readClaudeCodeConfig();
|
|
1010
|
+
if (!existingConfig) {
|
|
1011
|
+
existingConfig = { mcpServers: {} };
|
|
1012
|
+
}
|
|
1013
|
+
if (existingConfig.mcpServers && Object.keys(existingConfig.mcpServers).length > 0) {
|
|
1014
|
+
const backupPath = await backupClaudeCodeConfig();
|
|
1015
|
+
if (backupPath) {
|
|
1016
|
+
console.log(` \u2713 Backup created: ${backupPath}`);
|
|
918
1017
|
}
|
|
919
1018
|
}
|
|
920
|
-
|
|
921
|
-
|
|
1019
|
+
const args = ["-y", "ace-tool@latest"];
|
|
1020
|
+
if (baseUrl) {
|
|
1021
|
+
args.push("--base-url", baseUrl);
|
|
922
1022
|
}
|
|
923
|
-
|
|
1023
|
+
if (token) {
|
|
1024
|
+
args.push("--token", token);
|
|
1025
|
+
}
|
|
1026
|
+
const aceToolConfig = buildMcpServerConfig({
|
|
924
1027
|
type: "stdio",
|
|
925
1028
|
command: "npx",
|
|
926
1029
|
args
|
|
927
|
-
};
|
|
928
|
-
|
|
1030
|
+
});
|
|
1031
|
+
let mergedConfig = mergeMcpServers(existingConfig, {
|
|
1032
|
+
"ace-tool": aceToolConfig
|
|
1033
|
+
});
|
|
1034
|
+
if (isWindows()) {
|
|
1035
|
+
mergedConfig = fixWindowsMcpConfig(mergedConfig);
|
|
1036
|
+
console.log(" \u2713 Applied Windows MCP configuration fixes");
|
|
1037
|
+
}
|
|
1038
|
+
await writeClaudeCodeConfig(mergedConfig);
|
|
929
1039
|
return {
|
|
930
1040
|
success: true,
|
|
931
|
-
message: "ace-tool MCP configured successfully
|
|
932
|
-
configPath:
|
|
1041
|
+
message: isWindows() ? "ace-tool MCP configured successfully with Windows compatibility" : "ace-tool MCP configured successfully",
|
|
1042
|
+
configPath: join(homedir(), ".claude.json")
|
|
933
1043
|
};
|
|
934
1044
|
} catch (error) {
|
|
935
1045
|
return {
|
|
@@ -1649,4 +1759,4 @@ async function uninstall() {
|
|
|
1649
1759
|
console.log();
|
|
1650
1760
|
}
|
|
1651
1761
|
|
|
1652
|
-
export { i18n as a, initI18n as b, changeLanguage as c, createDefaultConfig as d, createDefaultRouting as e, getConfigPath as f, getCcgDir as g, getWorkflowConfigs as h, init as i, getWorkflowById as j, installWorkflows as k, installAceTool as l, uninstallWorkflows as m, uninstallAceTool as n, migrateToV1_4_0 as o, needsMigration as p, getCurrentVersion as q, readCcgConfig as r, showMainMenu as s, getLatestVersion as t, update as u, checkForUpdates as v, writeCcgConfig as w, compareVersions as x };
|
|
1762
|
+
export { readClaudeCodeConfig as A, fixWindowsMcpConfig as B, writeClaudeCodeConfig as C, i18n as a, initI18n as b, changeLanguage as c, createDefaultConfig as d, createDefaultRouting as e, getConfigPath as f, getCcgDir as g, getWorkflowConfigs as h, init as i, getWorkflowById as j, installWorkflows as k, installAceTool as l, uninstallWorkflows as m, uninstallAceTool as n, migrateToV1_4_0 as o, needsMigration as p, getCurrentVersion as q, readCcgConfig as r, showMainMenu as s, getLatestVersion as t, update as u, checkForUpdates as v, writeCcgConfig as w, compareVersions as x, diagnoseMcpConfig as y, isWindows as z };
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ description: 多模型技术分析(根据配置并行),交叉验证后综
|
|
|
13
13
|
- Configured models provide perspectives for cross-validation.
|
|
14
14
|
|
|
15
15
|
## 配置
|
|
16
|
-
**首先读取 `~/.ccg/config.toml` 获取模型配置**:
|
|
16
|
+
**首先读取 `~/.claude/.ccg/config.toml` 获取模型配置**:
|
|
17
17
|
```toml
|
|
18
18
|
[routing.frontend]
|
|
19
19
|
models = ["gemini", "codex"]
|
|
@@ -34,7 +34,7 @@ You are the **Analysis Coordinator** orchestrating multi-model research. You dir
|
|
|
34
34
|
|
|
35
35
|
### Step 1: 读取配置 + 上下文检索
|
|
36
36
|
|
|
37
|
-
1. **读取 `~/.ccg/config.toml`** 获取模型配置
|
|
37
|
+
1. **读取 `~/.claude/.ccg/config.toml`** 获取模型配置
|
|
38
38
|
2. 合并 `routing.frontend.models` 和 `routing.backend.models` 获取分析模型列表
|
|
39
39
|
3. 如果配置不存在,默认使用 `["codex", "gemini"]`
|
|
40
40
|
4. Call `mcp__ace-tool__search_context` to understand relevant code:
|
|
@@ -51,7 +51,7 @@ You are the **Analysis Coordinator** orchestrating multi-model research. You dir
|
|
|
51
51
|
```bash
|
|
52
52
|
# Codex 技术分析
|
|
53
53
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
54
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
54
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/analyzer.md
|
|
55
55
|
|
|
56
56
|
<TASK>
|
|
57
57
|
分析任务: {{分析问题或任务}}
|
|
@@ -65,7 +65,7 @@ EOF
|
|
|
65
65
|
```bash
|
|
66
66
|
# Gemini 技术分析
|
|
67
67
|
codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
|
|
68
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
68
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/gemini/analyzer.md
|
|
69
69
|
|
|
70
70
|
<TASK>
|
|
71
71
|
分析任务: {{分析问题或任务}}
|
|
@@ -96,7 +96,7 @@ Present unified analysis combining all perspectives.
|
|
|
96
96
|
5. **Recommendations** – actionable next steps
|
|
97
97
|
|
|
98
98
|
## 注意事项
|
|
99
|
-
- **首先读取 `~/.ccg/config.toml` 获取模型配置**
|
|
99
|
+
- **首先读取 `~/.claude/.ccg/config.toml` 获取模型配置**
|
|
100
100
|
- This command is for analysis only, no code changes
|
|
101
101
|
- **Use `run_in_background: true` for parallel execution** to avoid blocking
|
|
102
102
|
- 多模型结果交叉验证,取长补短
|
|
@@ -13,7 +13,7 @@ description: 后端/逻辑/算法任务,自动路由到配置的后端模型
|
|
|
13
13
|
- Default authority for algorithms, APIs, and business logic.
|
|
14
14
|
|
|
15
15
|
## 配置
|
|
16
|
-
**首先读取 `~/.ccg/config.toml` 获取模型路由配置**:
|
|
16
|
+
**首先读取 `~/.claude/.ccg/config.toml` 获取模型路由配置**:
|
|
17
17
|
```toml
|
|
18
18
|
[routing.backend]
|
|
19
19
|
models = ["codex", "gemini"] # 用户配置的后端模型列表
|
|
@@ -30,7 +30,7 @@ You are the **Backend Orchestrator** specializing in server-side logic. You coor
|
|
|
30
30
|
## 流程
|
|
31
31
|
|
|
32
32
|
### Step 1: 读取配置
|
|
33
|
-
1. Read `~/.ccg/config.toml` to get backend model configuration
|
|
33
|
+
1. Read `~/.claude/.ccg/config.toml` to get backend model configuration
|
|
34
34
|
2. Identify which models to use based on `routing.backend.models`
|
|
35
35
|
3. If config doesn't exist, default to `codex`
|
|
36
36
|
|
|
@@ -52,7 +52,7 @@ You are the **Backend Orchestrator** specializing in server-side logic. You coor
|
|
|
52
52
|
```bash
|
|
53
53
|
# Codex 后端原型示例
|
|
54
54
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
55
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
55
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
|
|
56
56
|
|
|
57
57
|
<TASK>
|
|
58
58
|
实现后端功能: {{后端任务描述}}
|
|
@@ -66,7 +66,7 @@ EOF
|
|
|
66
66
|
```bash
|
|
67
67
|
# Gemini 后端原型示例(如配置中包含)
|
|
68
68
|
codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
|
|
69
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
69
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/gemini/analyzer.md
|
|
70
70
|
|
|
71
71
|
<TASK>
|
|
72
72
|
实现后端功能: {{后端任务描述}}
|
|
@@ -107,6 +107,6 @@ Call configured backend model(s) to review the final implementation:
|
|
|
107
107
|
## 注意事项
|
|
108
108
|
- Codex excels at complex logic and debugging
|
|
109
109
|
- Codex uses read-only sandbox by default
|
|
110
|
-
- Read `~/.ccg/config.toml` at start of execution
|
|
110
|
+
- Read `~/.claude/.ccg/config.toml` at start of execution
|
|
111
111
|
- Always request Unified Diff Patch format
|
|
112
112
|
- Use HEREDOC syntax (`<<'EOF'`) to avoid shell escaping issues
|
|
@@ -29,7 +29,7 @@ description: 质量门控修复(双模型交叉验证,90%+ 通过)
|
|
|
29
29
|
```bash
|
|
30
30
|
# Codex 后端诊断修复
|
|
31
31
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
32
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
32
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
|
|
33
33
|
|
|
34
34
|
<TASK>
|
|
35
35
|
Bug 修复: {{Bug 描述}}
|
|
@@ -43,7 +43,7 @@ EOF
|
|
|
43
43
|
```bash
|
|
44
44
|
# Gemini 前端诊断修复
|
|
45
45
|
codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
|
|
46
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
46
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/gemini/frontend.md
|
|
47
47
|
|
|
48
48
|
<TASK>
|
|
49
49
|
Bug 修复: {{Bug 描述}}
|
|
@@ -73,7 +73,7 @@ EOF
|
|
|
73
73
|
```bash
|
|
74
74
|
# Codex 审查修复
|
|
75
75
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
76
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
76
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/reviewer.md
|
|
77
77
|
|
|
78
78
|
<TASK>
|
|
79
79
|
审查修复: {{实施的修复代码}}
|
|
@@ -87,7 +87,7 @@ EOF
|
|
|
87
87
|
```bash
|
|
88
88
|
# Gemini 审查修复
|
|
89
89
|
codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
|
|
90
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
90
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/gemini/reviewer.md
|
|
91
91
|
|
|
92
92
|
<TASK>
|
|
93
93
|
审查修复: {{实施的修复代码}}
|
|
@@ -36,7 +36,7 @@ description: 三模型代码生成(Codex + Gemini + Claude 并行原型,集
|
|
|
36
36
|
```bash
|
|
37
37
|
# Codex 后端架构原型
|
|
38
38
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
39
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
39
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
|
|
40
40
|
|
|
41
41
|
<TASK>
|
|
42
42
|
生成原型: {{功能需求}}
|
|
@@ -50,7 +50,7 @@ EOF
|
|
|
50
50
|
```bash
|
|
51
51
|
# Gemini 前端 UI 原型
|
|
52
52
|
codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
|
|
53
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
53
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/gemini/frontend.md
|
|
54
54
|
|
|
55
55
|
<TASK>
|
|
56
56
|
生成原型: {{功能需求}}
|
|
@@ -64,7 +64,7 @@ EOF
|
|
|
64
64
|
```bash
|
|
65
65
|
# Claude 全栈整合原型
|
|
66
66
|
codeagent-wrapper --backend claude - $PROJECT_DIR <<'EOF'
|
|
67
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
67
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/claude/architect.md
|
|
68
68
|
|
|
69
69
|
<TASK>
|
|
70
70
|
生成原型: {{功能需求}}
|
|
@@ -123,7 +123,7 @@ API Contract:
|
|
|
123
123
|
```bash
|
|
124
124
|
# Codex 安全性审查
|
|
125
125
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
126
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
126
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/reviewer.md
|
|
127
127
|
|
|
128
128
|
<TASK>
|
|
129
129
|
审查代码: {{实施的代码变更}}
|
|
@@ -137,7 +137,7 @@ EOF
|
|
|
137
137
|
```bash
|
|
138
138
|
# Gemini 设计审查
|
|
139
139
|
codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
|
|
140
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
140
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/gemini/reviewer.md
|
|
141
141
|
|
|
142
142
|
<TASK>
|
|
143
143
|
审查代码: {{实施的代码变更}}
|
|
@@ -151,7 +151,7 @@ EOF
|
|
|
151
151
|
```bash
|
|
152
152
|
# Claude 集成审查
|
|
153
153
|
codeagent-wrapper --backend claude - $PROJECT_DIR <<'EOF'
|
|
154
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
154
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/claude/reviewer.md
|
|
155
155
|
|
|
156
156
|
<TASK>
|
|
157
157
|
审查代码: {{实施的代码变更}}
|
|
@@ -31,7 +31,7 @@ description: UltraThink 多模型调试(Codex 后端诊断 + Gemini 前端诊
|
|
|
31
31
|
```bash
|
|
32
32
|
# Codex 后端诊断
|
|
33
33
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
34
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
34
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/debugger.md
|
|
35
35
|
|
|
36
36
|
<TASK>
|
|
37
37
|
诊断问题: {{问题描述}}
|
|
@@ -45,7 +45,7 @@ EOF
|
|
|
45
45
|
```bash
|
|
46
46
|
# Gemini 前端诊断
|
|
47
47
|
codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
|
|
48
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
48
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/gemini/debugger.md
|
|
49
49
|
|
|
50
50
|
<TASK>
|
|
51
51
|
诊断问题: {{问题描述}}
|
|
@@ -10,10 +10,10 @@ description: 完整6阶段多模型协作工作流(Prompt增强 → 上下文
|
|
|
10
10
|
## 上下文
|
|
11
11
|
- 要实现的功能: $ARGUMENTS
|
|
12
12
|
- 此命令触发完整的 6 阶段多模型协作工作流
|
|
13
|
-
- 根据 `~/.ccg/config.toml` 配置路由模型
|
|
13
|
+
- 根据 `~/.claude/.ccg/config.toml` 配置路由模型
|
|
14
14
|
|
|
15
15
|
## 配置
|
|
16
|
-
**首先读取 `~/.ccg/config.toml` 获取模型路由配置**:
|
|
16
|
+
**首先读取 `~/.claude/.ccg/config.toml` 获取模型路由配置**:
|
|
17
17
|
```toml
|
|
18
18
|
[routing]
|
|
19
19
|
mode = "smart" # smart | parallel | sequential
|
|
@@ -48,7 +48,7 @@ strategy = "parallel"
|
|
|
48
48
|
## 流程
|
|
49
49
|
|
|
50
50
|
### 阶段 0: 读取配置 + Prompt 增强
|
|
51
|
-
1. **读取 `~/.ccg/config.toml`** 获取模型路由配置
|
|
51
|
+
1. **读取 `~/.claude/.ccg/config.toml`** 获取模型路由配置
|
|
52
52
|
2. 如果配置不存在,使用默认值:frontend=gemini, backend=codex
|
|
53
53
|
3. 调用 `mcp__ace-tool__enhance_prompt` 优化原始需求:
|
|
54
54
|
- `prompt`: 用户的原始需求 ($ARGUMENTS)
|
|
@@ -92,7 +92,7 @@ strategy = "parallel"
|
|
|
92
92
|
```bash
|
|
93
93
|
# 后端模型分析示例
|
|
94
94
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
95
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
95
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/analyzer.md
|
|
96
96
|
|
|
97
97
|
<TASK>
|
|
98
98
|
分析需求: {{增强后的需求}}
|
|
@@ -120,7 +120,7 @@ EOF
|
|
|
120
120
|
```bash
|
|
121
121
|
# Codex 后端原型示例
|
|
122
122
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
123
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
123
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
|
|
124
124
|
|
|
125
125
|
<TASK>
|
|
126
126
|
生成原型: {{功能需求}}
|
|
@@ -165,7 +165,7 @@ EOF
|
|
|
165
165
|
```bash
|
|
166
166
|
# Codex 代码审查示例
|
|
167
167
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
168
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
168
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/reviewer.md
|
|
169
169
|
|
|
170
170
|
<TASK>
|
|
171
171
|
审查代码: {{实施的代码变更}}
|
|
@@ -195,7 +195,7 @@ EOF
|
|
|
195
195
|
|
|
196
196
|
## 关键规则
|
|
197
197
|
- 未经用户批准不得跳过任何阶段
|
|
198
|
-
- **首先读取 `~/.ccg/config.toml` 获取模型配置**
|
|
198
|
+
- **首先读取 `~/.claude/.ccg/config.toml` 获取模型配置**
|
|
199
199
|
- **阶段 0 的 prompt 增强是强制性的** – 必须先展示增强后的 prompt
|
|
200
200
|
- 始终要求外部模型输出 Unified Diff Patch
|
|
201
201
|
- 外部模型对文件系统**零写入权限**
|
|
@@ -390,7 +390,7 @@ if [ "$TASK_TYPE" == "frontend" ] || [ "$TASK_TYPE" == "fullstack" ]; then
|
|
|
390
390
|
|
|
391
391
|
# 调用 codeagent-wrapper
|
|
392
392
|
codeagent-wrapper --backend gemini - "$PROJECT_DIR" <<'EOF'
|
|
393
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
393
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/gemini/frontend.md
|
|
394
394
|
|
|
395
395
|
<PROJECT_CONTEXT>
|
|
396
396
|
{{从 .claude/repo-context.md 提取的前端技术栈}}
|
|
@@ -435,7 +435,7 @@ if [ "$TASK_TYPE" == "backend" ] || [ "$TASK_TYPE" == "fullstack" ]; then
|
|
|
435
435
|
|
|
436
436
|
# 调用 codeagent-wrapper
|
|
437
437
|
codeagent-wrapper --backend codex - "$PROJECT_DIR" <<'EOF'
|
|
438
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
438
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
|
|
439
439
|
|
|
440
440
|
<PROJECT_CONTEXT>
|
|
441
441
|
{{从 .claude/repo-context.md 提取的后端技术栈}}
|
|
@@ -13,7 +13,7 @@ description: 前端/UI/样式任务,自动路由到配置的前端模型进行
|
|
|
13
13
|
- Default authority for CSS, React, Vue, and visual design.
|
|
14
14
|
|
|
15
15
|
## 配置
|
|
16
|
-
**首先读取 `~/.ccg/config.toml` 获取模型路由配置**:
|
|
16
|
+
**首先读取 `~/.claude/.ccg/config.toml` 获取模型路由配置**:
|
|
17
17
|
```toml
|
|
18
18
|
[routing.frontend]
|
|
19
19
|
models = ["gemini", "codex"] # 用户配置的前端模型列表
|
|
@@ -30,7 +30,7 @@ You are the **Frontend Orchestrator** specializing in UI/UX implementation. You
|
|
|
30
30
|
## 流程
|
|
31
31
|
|
|
32
32
|
### Step 1: 读取配置
|
|
33
|
-
1. Read `~/.ccg/config.toml` to get frontend model configuration
|
|
33
|
+
1. Read `~/.claude/.ccg/config.toml` to get frontend model configuration
|
|
34
34
|
2. Identify which models to use based on `routing.frontend.models`
|
|
35
35
|
3. If config doesn't exist, default to `gemini`
|
|
36
36
|
|
|
@@ -52,7 +52,7 @@ You are the **Frontend Orchestrator** specializing in UI/UX implementation. You
|
|
|
52
52
|
```bash
|
|
53
53
|
# Gemini 前端原型示例
|
|
54
54
|
codeagent-wrapper --backend gemini - $PROJECT_DIR <<'EOF'
|
|
55
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
55
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/gemini/frontend.md
|
|
56
56
|
|
|
57
57
|
<TASK>
|
|
58
58
|
实现 UI 功能: {{前端任务描述}}
|
|
@@ -66,7 +66,7 @@ EOF
|
|
|
66
66
|
```bash
|
|
67
67
|
# Codex 前端原型示例(如配置中包含)
|
|
68
68
|
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
69
|
-
ROLE_FILE: ~/.claude/prompts/
|
|
69
|
+
ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
|
|
70
70
|
|
|
71
71
|
<TASK>
|
|
72
72
|
实现 UI 功能: {{前端任务描述}}
|
|
@@ -106,6 +106,6 @@ Call configured frontend model(s) to review the final implementation:
|
|
|
106
106
|
|
|
107
107
|
## 注意事项
|
|
108
108
|
- Gemini context limit: < 32k tokens
|
|
109
|
-
- Read `~/.ccg/config.toml` at start of execution
|
|
109
|
+
- Read `~/.claude/.ccg/config.toml` at start of execution
|
|
110
110
|
- Always request Unified Diff Patch format
|
|
111
111
|
- Use HEREDOC syntax (`<<'EOF'`) to avoid shell escaping issues
|