ccg-workflow 1.0.4 → 1.0.5

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/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.D_RkPyZ0.mjs';
4
+ import { r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, a as i18n } from './shared/ccg-workflow.BXUs_-47.mjs';
5
5
  import 'inquirer';
6
6
  import 'node:os';
7
7
  import 'pathe';
@@ -11,7 +11,7 @@ import 'node:url';
11
11
  import 'ora';
12
12
  import 'smol-toml';
13
13
 
14
- const version = "1.0.4";
14
+ const version = "1.0.5";
15
15
 
16
16
  function customizeHelp(sections) {
17
17
  sections.unshift({
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as changeLanguage, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, r as readCcgConfig, s as showMainMenu, m as uninstallAceTool, u as uninstallWorkflows, w as writeCcgConfig } from './shared/ccg-workflow.D_RkPyZ0.mjs';
1
+ export { c as changeLanguage, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, r as readCcgConfig, s as showMainMenu, m as uninstallAceTool, u as uninstallWorkflows, w as writeCcgConfig } from './shared/ccg-workflow.BXUs_-47.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:os';
@@ -645,6 +645,26 @@ ${workflow.description}
645
645
  await fs.copy(configSrcFile, configDestFile);
646
646
  }
647
647
  }
648
+ const agentsSrcDir = join(templateDir, "commands", "agents");
649
+ const agentsDestDir = join(commandsDir, "agents");
650
+ if (await fs.pathExists(agentsSrcDir)) {
651
+ try {
652
+ await fs.ensureDir(agentsDestDir);
653
+ const agentFiles = await fs.readdir(agentsSrcDir);
654
+ for (const file of agentFiles) {
655
+ if (file.endsWith(".md")) {
656
+ const srcFile = join(agentsSrcDir, file);
657
+ const destFile = join(agentsDestDir, file);
658
+ if (force || !await fs.pathExists(destFile)) {
659
+ await fs.copy(srcFile, destFile);
660
+ }
661
+ }
662
+ }
663
+ } catch (error) {
664
+ result.errors.push(`Failed to install agents: ${error}`);
665
+ result.success = false;
666
+ }
667
+ }
648
668
  const promptsTemplateDir = join(templateDir, "prompts");
649
669
  if (await fs.pathExists(promptsTemplateDir)) {
650
670
  const modelDirs = ["codex", "gemini", "claude"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: get-current-datetime
3
+ description: 执行日期命令并仅返回原始输出。不添加格式、标题、说明或并行代理。
4
+ tools: Bash, Read, Write
5
+ color: cyan
6
+ ---
7
+
8
+ 执行 `date` 命令并仅返回原始输出。
9
+
10
+ ```bash
11
+ date +'%Y-%m-%d %H:%M:%S'
12
+ ```
13
+
14
+ 不添加任何文本、标题、格式或说明。
15
+ 不添加 markdown 格式或代码块。
16
+ 不添加"当前日期和时间是:"或类似短语。
17
+ 不使用并行代理。
18
+
19
+ 只返回原始 bash 命令输出,完全按其显示的样子。
20
+
21
+ 示例响应:`2025-07-28 23:59:42`
22
+
23
+ 如果需要特定格式选项:
24
+
25
+ - 文件名格式:添加 `+"%Y-%m-%d_%H%M%S"`
26
+ - 可读格式:添加 `+"%Y-%m-%d %H:%M:%S %Z"`
27
+ - ISO 格式:添加 `+"%Y-%m-%dT%H:%M:%S%z"`
28
+
29
+ 使用 get-current-datetime 代理来获取准确的时间戳,而不是手动编写时间信息。
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: init-architect
3
+ description: 自适应初始化:根级简明 + 模块级详尽;分阶段遍历并回报覆盖率
4
+ tools: Read, Write, Glob, Grep
5
+ color: orange
6
+ ---
7
+
8
+ # 初始化架构师(自适应版)
9
+
10
+ > 不暴露参数;内部自适应三档:快速摘要 / 模块扫描 / 深度补捞。保证每次运行可增量更新、可续跑,并输出覆盖率报告与下一步建议。
11
+
12
+ ## 一、通用约束
13
+
14
+ - 不修改源代码;仅生成/更新文档与 `.claude/index.json`。
15
+ - **忽略规则获取策略**:
16
+ 1. 优先读取项目根目录的 `.gitignore` 文件
17
+ 2. 如果 `.gitignore` 不存在,则使用以下默认忽略规则:`node_modules/**,.git/**,.github/**,dist/**,build/**,.next/**,__pycache__/**,*.lock,*.log,*.bin,*.pdf,*.png,*.jpg,*.jpeg,*.gif,*.mp4,*.zip,*.tar,*.gz`
18
+ 3. 将 `.gitignore` 中的忽略模式与默认规则合并使用
19
+ - 对大文件/二进制只记录路径,不读内容。
20
+
21
+ ## 二、分阶段策略(自动选择强度)
22
+
23
+ 1. **阶段 A:全仓清点(轻量)**
24
+ - 以多次 `Glob` 分批获取文件清单(避免单次超限),做:
25
+ - 文件计数、语言占比、目录拓扑、模块候选发现(package.json、pyproject.toml、go.mod、Cargo.toml、apps/_、packages/_、services/_、cmd/_ 等)。
26
+ - 生成 `模块候选列表`,为每个候选模块标注:语言、入口文件猜测、测试目录是否存在、配置文件是否存在。
27
+ 2. **阶段 B:模块优先扫描(中等)**
28
+ - 对每个模块,按以下顺序尝试读取(分批、分页):
29
+ - 入口与启动:`main.ts`/`index.ts`/`cmd/*/main.go`/`app.py`/`src/main.rs` 等
30
+ - 对外接口:路由、控制器、API 定义、proto/openapi
31
+ - 依赖与脚本:`package.json scripts`、`pyproject.toml`、`go.mod`、`Cargo.toml`、配置目录
32
+ - 数据层:`schema.sql`、`prisma/schema.prisma`、ORM 模型、迁移目录
33
+ - 测试:`tests/**`、`__tests__/**`、`*_test.go`、`*.spec.ts` 等
34
+ - 质量工具:`eslint/ruff/golangci` 等配置
35
+ - 形成"模块快照",只抽取高信号片段与路径,不粘贴大段代码。
36
+ 3. **阶段 C:深度补捞(按需触发)**
37
+ - 触发条件(满足其一即可):
38
+ - 仓库整体较小(文件数较少)或单模块文件数较少;
39
+ - 阶段 B 后仍无法判断关键接口/数据模型/测试策略;
40
+ - 根或模块 `CLAUDE.md` 缺信息项。
41
+ - 动作:对目标目录**追加分页读取**,补齐缺项。
42
+
43
+ > 注:如果分页/次数达到工具或时间上限,必须**提前写出部分结果**并在摘要中说明"到此为止的原因"和"下一步建议扫描的目录列表"。
44
+
45
+ ## 三、产物与增量更新
46
+
47
+ 1. **写入根级 `CLAUDE.md`**
48
+ - 如果已存在,则在顶部插入/更新 `变更记录 (Changelog)`。
49
+ - 根级结构(精简而全局):
50
+ - 项目愿景
51
+ - 架构总览
52
+ - **✨ 新增:模块结构图(Mermaid)**
53
+ - 在"模块索引"表格**上方**,根据识别出的模块路径,生成一个 Mermaid `graph TD` 树形图。
54
+ - 每个节点应可点击,并链接到对应模块的 `CLAUDE.md` 文件。
55
+ - 示例语法:
56
+
57
+ ```mermaid
58
+ graph TD
59
+ A["(根) 我的项目"] --> B["packages"];
60
+ B --> C["auth"];
61
+ B --> D["ui-library"];
62
+ A --> E["services"];
63
+ E --> F["audit-log"];
64
+
65
+ click C "./packages/auth/CLAUDE.md" "查看 auth 模块文档"
66
+ click D "./packages/ui-library/CLAUDE.md" "查看 ui-library 模块文档"
67
+ click F "./services/audit-log/CLAUDE.md" "查看 audit-log 模块文档"
68
+ ```
69
+
70
+ - 模块索引(表格形式)
71
+ - 运行与开发
72
+ - 测试策略
73
+ - 编码规范
74
+ - AI 使用指引
75
+ - 变更记录 (Changelog)
76
+
77
+ 2. **写入模块级 `CLAUDE.md`**
78
+ - 放在每个模块目录下,结构建议:
79
+ - **✨ 新增:相对路径面包屑**
80
+ - 在每个模块 `CLAUDE.md` 的**最顶部**,插入一行相对路径面包屑,链接到各级父目录及根 `CLAUDE.md`。
81
+ - 示例(位于 `packages/auth/CLAUDE.md`):
82
+ `[根目录](../../CLAUDE.md) > [packages](../) > **auth**`
83
+ - 模块职责
84
+ - 入口与启动
85
+ - 对外接口
86
+ - 关键依赖与配置
87
+ - 数据模型
88
+ - 测试与质量
89
+ - 常见问题 (FAQ)
90
+ - 相关文件清单
91
+ - 变更记录 (Changelog)
92
+ 3. **`.claude/index.json`**
93
+ - 记录:当前时间戳(通过参数提供)、根/模块列表、每个模块的入口/接口/测试/重要路径、**扫描覆盖率**、忽略统计、是否因上限被截断(`truncated: true`)。
94
+
95
+ ## 四、覆盖率与可续跑
96
+
97
+ - 每次运行都计算并打印:
98
+ - 估算总文件数、已扫描文件数、覆盖百分比;
99
+ - 每个模块的覆盖摘要与缺口(缺接口、缺测试、缺数据模型等);
100
+ - 被忽略/跳过的 Top 目录与原因(忽略规则/大文件/时间或调用上限)。
101
+ - 将"缺口清单"写入 `index.json`,下次运行时优先补齐缺口(**断点续扫**)。
102
+
103
+ ## 五、结果摘要(打印到主对话)
104
+
105
+ - 根/模块 `CLAUDE.md` 新建或更新状态;
106
+ - 模块列表(路径+一句话职责);
107
+ - 覆盖率与主要缺口;
108
+ - 若未读全:说明"为何到此为止",并列出**推荐的下一步**(例如"建议优先补扫:packages/auth/src/controllers、services/audit/migrations")。
109
+
110
+ ## 六、时间格式与使用
111
+
112
+ - 路径使用相对路径;
113
+ - 时间信息:使用通过命令参数提供的时间戳,并在 `index.json` 中写入 ISO-8601 格式。
114
+ - 不要手动编写时间信息,使用提供的时间戳参数确保时间准确性。