Skip to content
Agent Orchestration
Command

/init

初始化项目 AI 上下文:生成根级与模块级 CLAUDE.md 索引

From plugin
ccg
6k19 skills19 commands
> /plugin marketplace add fengshao1227/ccg-workflow
> /plugin install ccg@ccg

Command definition

init.md
description: '初始化项目 AI 上下文:生成根级与模块级 CLAUDE.md 索引'

Init - 初始化项目 AI 上下文

以「根级简明 + 模块级详尽」策略生成项目 AI 上下文文档。

使用方法

/init <项目摘要或名称>

上下文

  • 项目摘要:$ARGUMENTS
  • 生成/更新根级与模块级 `CLAUDE.md`
  • 自动生成 Mermaid 结构图和导航面包屑

你的角色

你是**协调者**,负责调用子智能体完成项目扫描与文档生成。

---

执行工作流

**⚠️ 必须按以下步骤执行,使用 Task 工具调用子智能体**

🕐 步骤 1:获取当前时间戳

**必须首先调用 `get-current-datetime` 子智能体**:

Task({
  subagent_type: "get-current-datetime",
  prompt: "获取当前日期时间,用于文档时间戳",
  description: "获取当前时间"
})

等待返回时间戳后,保存为 `$TIMESTAMP` 供后续使用。

🏗️ 步骤 2:调用初始化架构师

**使用 `init-architect` 子智能体执行完整扫描**:

Task({
  subagent_type: "init-architect",
  prompt: "扫描项目并生成 CLAUDE.md 文档。\n\n项目摘要:$ARGUMENTS\n当前时间戳:$TIMESTAMP\n工作目录:{{WORKDIR}}\n\n请执行:\n1. 阶段 A:全仓清点(文件统计、模块识别)\n2. 阶段 B:模块优先扫描(入口、接口、依赖、测试)\n3. 阶段 C:深度补捞(按需)\n4. 阶段 D:生成文档(根级 + 模块级 CLAUDE.md)\n\n输出覆盖率报告与推荐下一步。",
  description: "初始化项目文档"
})

📊 步骤 3:汇总结果

子智能体完成后,向用户展示:

## 初始化结果摘要

### 根级文档
- 状态:[创建/更新]
- 主要栏目:<列表>

### 模块识别
- 识别模块数:X
- 模块列表:
  1. <模块路径>
  2. ...

### 覆盖率
- 已扫描文件:X / Y
- 覆盖模块:X%
- 跳过原因:<如有>

### 生成内容
- ✅ Mermaid 结构图
- ✅ N 个模块导航面包屑

### 推荐下一步
- [ ] 补扫:<路径>

---

安全边界

1. **只读/写文档** – 不改源代码 2. **忽略生成物** – 跳过 `node_modules`、`dist`、二进制文件 3. **增量更新** – 重复运行时做断点续扫

关键规则

1. **必须使用 Task 工具**调用子智能体,不要自己执行扫描逻辑 2. 先调用 `get-current-datetime` 获取时间戳 3. 再调用 `init-architect` 执行完整扫描 4. 结果在主对话打印摘要,全文由子智能体写入仓库

@fengshao1227
Ships withccg

多模型协作工作流引擎 — /ccg:go 一个命令,AI 自动分析意图、选择策略、编排 Codex + Gemini + Claude 协作执行

Stars on GitHub

Momentum

stars in total
6.0k
Star history of fengshao1227/ccg-workflow on GitHub, a chart by star-history.com

Other commands on ccg.

init-architect

init-architect

Command

自适应初始化:根级简明 + 模块级详尽;分阶段遍历并回报覆盖率

@fengshao1227@fengshao1227Install Command
planner

planner

Command

📋 任务规划师 - 使用 WBS 方法论分解功能需求为可执行任务

@fengshao1227@fengshao1227Install Command
team-architect

team-architect

Command

🏗 架构师 - 扫描代码库,综合多模型分析,输出架构蓝图和文件分配矩阵

@fengshao1227@fengshao1227Install Command
team-qa

team-qa

Command

🧪 QA 工程师 - 检测测试框架,编写测试,运行全量测试 + lint + typecheck

@fengshao1227@fengshao1227Install Command
team-reviewer

team-reviewer

Command

🔬 代码审查员 - 综合 Codex/Gemini 审查结果,分级输出 Critical/Warning/Info

@fengshao1227@fengshao1227Install Command

More commands from other plugins.

COMMAND_COMPLIANCE_REPORT

COMMAND_COMPLIANCE_REP…

Command

Reviewed all command files in `.claude/commands/analysis/` directory to ensure proper usage of: - `mcp__claude-flow__*` tools…

@ruvnet@ruvnetInstall Command
ask

ask

Command

This compatibility command keeps `/oh-my-claudecode:ask` available without loading the full `ask` skill description in every…

@yeachan-heo@yeachan-heoInstall Command