ccjk 3.7.3 → 3.7.4

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.
Files changed (86) hide show
  1. package/dist/chunks/package.mjs +1 -1
  2. package/package.json +54 -54
  3. package/templates/CLAUDE.md +0 -219
  4. package/templates/claude-code/CLAUDE.md +0 -250
  5. package/templates/claude-code/common/settings.json +0 -37
  6. package/templates/claude-code/en/workflow/bmad/commands/bmad-init.md +0 -165
  7. package/templates/claude-code/en/workflow/common/agents/get-current-datetime.md +0 -29
  8. package/templates/claude-code/en/workflow/common/agents/init-architect.md +0 -114
  9. package/templates/claude-code/en/workflow/common/commands/init-project.md +0 -53
  10. package/templates/claude-code/en/workflow/essential/agents/get-current-datetime.md +0 -29
  11. package/templates/claude-code/en/workflow/essential/agents/init-architect.md +0 -114
  12. package/templates/claude-code/en/workflow/essential/agents/planner.md +0 -116
  13. package/templates/claude-code/en/workflow/essential/agents/ui-ux-designer.md +0 -91
  14. package/templates/claude-code/en/workflow/essential/commands/feat.md +0 -250
  15. package/templates/claude-code/en/workflow/essential/commands/init-project.md +0 -53
  16. package/templates/claude-code/en/workflow/plan/agents/planner.md +0 -116
  17. package/templates/claude-code/en/workflow/plan/agents/ui-ux-designer.md +0 -91
  18. package/templates/claude-code/en/workflow/plan/commands/feat.md +0 -105
  19. package/templates/claude-code/zh-CN/workflow/bmad/commands/bmad-init.md +0 -172
  20. package/templates/claude-code/zh-CN/workflow/common/agents/get-current-datetime.md +0 -29
  21. package/templates/claude-code/zh-CN/workflow/common/agents/init-architect.md +0 -114
  22. package/templates/claude-code/zh-CN/workflow/common/commands/init-project.md +0 -53
  23. package/templates/claude-code/zh-CN/workflow/essential/agents/get-current-datetime.md +0 -29
  24. package/templates/claude-code/zh-CN/workflow/essential/agents/init-architect.md +0 -114
  25. package/templates/claude-code/zh-CN/workflow/essential/agents/planner.md +0 -116
  26. package/templates/claude-code/zh-CN/workflow/essential/agents/ui-ux-designer.md +0 -91
  27. package/templates/claude-code/zh-CN/workflow/essential/commands/feat.md +0 -248
  28. package/templates/claude-code/zh-CN/workflow/essential/commands/init-project.md +0 -53
  29. package/templates/claude-code/zh-CN/workflow/plan/agents/planner.md +0 -116
  30. package/templates/claude-code/zh-CN/workflow/plan/agents/ui-ux-designer.md +0 -91
  31. package/templates/claude-code/zh-CN/workflow/plan/commands/feat.md +0 -105
  32. package/templates/codex/common/config.toml +0 -0
  33. package/templates/common/output-styles/en/casual-friendly.md +0 -97
  34. package/templates/common/output-styles/en/expert-concise.md +0 -93
  35. package/templates/common/output-styles/en/pair-programmer.md +0 -177
  36. package/templates/common/output-styles/en/senior-architect.md +0 -121
  37. package/templates/common/output-styles/en/speed-coder.md +0 -185
  38. package/templates/common/output-styles/en/teaching-mode.md +0 -102
  39. package/templates/common/output-styles/en/technical-precise.md +0 -101
  40. package/templates/common/output-styles/zh-CN/pair-programmer.md +0 -177
  41. package/templates/common/output-styles/zh-CN/senior-architect.md +0 -297
  42. package/templates/common/output-styles/zh-CN/speed-coder.md +0 -185
  43. package/templates/common/skills/code-review.md +0 -343
  44. package/templates/common/skills/en/agent-browser.md +0 -258
  45. package/templates/common/skills/en/brainstorming.md +0 -64
  46. package/templates/common/skills/en/code-review.md +0 -81
  47. package/templates/common/skills/en/documentation-gen.md +0 -808
  48. package/templates/common/skills/en/executing-plans.md +0 -75
  49. package/templates/common/skills/en/git-commit.md +0 -216
  50. package/templates/common/skills/en/interview.md +0 -223
  51. package/templates/common/skills/en/migration-assistant.md +0 -312
  52. package/templates/common/skills/en/performance-profiling.md +0 -576
  53. package/templates/common/skills/en/pr-review.md +0 -341
  54. package/templates/common/skills/en/refactoring.md +0 -384
  55. package/templates/common/skills/en/security-audit.md +0 -462
  56. package/templates/common/skills/en/systematic-debugging.md +0 -82
  57. package/templates/common/skills/en/tdd-workflow.md +0 -93
  58. package/templates/common/skills/en/verification.md +0 -81
  59. package/templates/common/skills/en/workflow.md +0 -370
  60. package/templates/common/skills/en/writing-plans.md +0 -78
  61. package/templates/common/skills/summarize.md +0 -312
  62. package/templates/common/skills/translate.md +0 -202
  63. package/templates/common/skills/zh-CN/agent-browser.md +0 -260
  64. package/templates/common/skills/zh-CN/documentation-gen.md +0 -807
  65. package/templates/common/skills/zh-CN/migration-assistant.md +0 -318
  66. package/templates/common/skills/zh-CN/performance-profiling.md +0 -746
  67. package/templates/common/skills/zh-CN/pr-review.md +0 -341
  68. package/templates/common/skills/zh-CN/refactoring.md +0 -384
  69. package/templates/common/skills/zh-CN/security-audit.md +0 -462
  70. package/templates/common/smart-guide/en/smart-guide.md +0 -72
  71. package/templates/common/smart-guide/zh-CN/smart-guide.md +0 -72
  72. package/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  73. package/templates/common/workflow/git/en/git-commit.md +0 -205
  74. package/templates/common/workflow/git/en/git-rollback.md +0 -90
  75. package/templates/common/workflow/git/en/git-worktree.md +0 -276
  76. package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  77. package/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  78. package/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  79. package/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  80. package/templates/common/workflow/interview/en/interview.md +0 -212
  81. package/templates/common/workflow/interview/zh-CN/interview.md +0 -212
  82. package/templates/common/workflow/sixStep/en/workflow.md +0 -357
  83. package/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -357
  84. package/templates/industry/devops/en/ci-cd-pipeline.md +0 -410
  85. package/templates/industry/web-dev/en/api-design.md +0 -299
  86. package/templates/industry/web-dev/en/react-nextjs-setup.md +0 -236
@@ -1,105 +0,0 @@
1
- ---
2
- description: Add New Feature
3
- ---
4
-
5
- $ARGUMENTS
6
-
7
- ## Core Workflow
8
-
9
- ### 1. Input Analysis and Type Determination
10
-
11
- When receiving user input, first perform type determination and clearly inform the user:
12
-
13
- **Determination Criteria:**
14
-
15
- - **Requirement Planning Type**: User proposes new feature requirements, project ideas, or needs to formulate plans
16
-
17
- - **Discussion Iteration Type**: User requests to continue discussion, modify, or refine existing planning
18
-
19
- - **Execution Implementation Type**: User confirms planning is complete and requests to start specific implementation work
20
-
21
- ### 2. Classification Processing Mechanism
22
-
23
- #### A. Requirement Planning Processing
24
-
25
- **Trigger Condition**: Identified as functional requirement input
26
-
27
- **Execution Actions**:
28
-
29
- - Enable Planner Agent
30
-
31
- - Generate detailed markdown planning document
32
-
33
- - Store document in `./.claude/plan` directory, named in plan/xxx.md format
34
-
35
- - Include: objective definition, feature breakdown, implementation steps, acceptance criteria
36
-
37
- #### B. Discussion Iteration Processing
38
-
39
- **Trigger Condition**: User requests to continue discussion or modify planning
40
-
41
- **Execution Actions**:
42
-
43
- - Retrieve and analyze previously generated planning files
44
-
45
- - Identify user feedback and confirmation content
46
-
47
- - Enable Planner Agent
48
-
49
- - Generate detailed markdown planning document
50
-
51
- - Create a new document, for example, if the last one was plan/xxx.md, then this time it's plan/xxx-1.md, if the last one was plan/xxx-1.md, then this time it's plan/xxx-2.md, and so on
52
-
53
- - Reorganize pending implementation task priorities
54
-
55
- #### C. Execution Implementation Processing
56
-
57
- **Trigger Condition**: User confirms planning is complete and requests to start execution
58
-
59
- **Execution Actions**:
60
-
61
- - Start task execution in the order of planning documents
62
-
63
- - Perform task type identification before each subtask begins
64
-
65
- - **Frontend Task Special Processing**:
66
-
67
- - Check if available UI design exists
68
-
69
- - If no design solution exists, must use UI-UX-Designer Agent
70
-
71
- - Complete UI design before proceeding with development implementation
72
-
73
- ### 3. Key Execution Principles
74
-
75
- #### Mandatory Response Requirements
76
-
77
- - **Must first state in every interaction**: "I determine this operation type as: [specific type]"
78
-
79
- - Type determination must be accurate and clearly communicated to users
80
-
81
- #### Task Execution Standards
82
-
83
- - Strictly execute according to documented planning
84
-
85
- - Must clarify task nature and dependencies before subtask startup
86
-
87
- - Frontend tasks must ensure UI design completeness
88
-
89
- #### State Management Mechanism
90
-
91
- - Maintain task completion status tracking
92
-
93
- - Timely update planning document status
94
-
95
- - Ensure user visibility of progress
96
-
97
- ## Quality Assurance Points
98
-
99
- 1. **Type Determination Accuracy**: Type identification at the beginning of each interaction must be accurate
100
-
101
- 2. **Document Consistency**: Planning documents and actual execution remain synchronized
102
-
103
- 3. **Dependency Management**: Pay special attention to UI design dependencies of frontend tasks
104
-
105
- 4. **Transparent User Communication**: All judgments and actions must be clearly communicated to users
@@ -1,172 +0,0 @@
1
- # /bmad-init 命令
2
-
3
- 此命令在您的项目中初始化 BMad-Method。
4
-
5
- ## 当调用此命令时:
6
-
7
- 1. 检查 `.bmad-core/install-manifest.yaml` 文件是否存在,判断 BMad 是否已安装
8
- 2. 如果已安装,检查 manifest 中的版本号与最新版本对比
9
- 3. 如果未安装或版本过旧,执行:`npx bmad-method@latest install -f -d . -i claude-code`
10
- 4. 显示成功消息并提示用户重启 Claude Code
11
-
12
- ## 实现
13
-
14
- ```javascript
15
- const { execSync } = require('node:child_process')
16
- const fs = require('node:fs')
17
- const path = require('node:path')
18
-
19
- // 检查 expect 工具是否可用
20
- function checkExpectAvailability() {
21
- try {
22
- execSync('which expect', { stdio: 'ignore' })
23
- return true
24
- } catch (error) {
25
- return false
26
- }
27
- }
28
-
29
- // 使用 expect 自动化交互式安装
30
- function installWithExpect() {
31
- const expectScript = `
32
- spawn npx bmad-method@latest install -f -d . -i claude-code
33
- expect "What would you like to do?"
34
- send "1\\r"
35
- expect "How would you like to proceed?"
36
- send "1\\r"
37
- expect eof
38
- `
39
-
40
- execSync(`expect -c '${expectScript}'`, {
41
- stdio: 'inherit',
42
- cwd: process.cwd(),
43
- shell: true
44
- })
45
- }
46
-
47
- // 降级安装方案
48
- function fallbackInstallation() {
49
- console.log('⚠️ 系统未安装 expect 工具,使用交互式安装')
50
- console.log('请根据安装程序的提示手动选择:')
51
- console.log(' 1. 选择 "Upgrade BMad core" (升级 BMad 核心)')
52
- console.log(' 2. 选择 "Backup and overwrite modified files" (备份并覆盖修改的文件)')
53
- console.log('')
54
-
55
- execSync('npx bmad-method@latest install -f -d . -i claude-code', {
56
- stdio: 'inherit',
57
- cwd: process.cwd(),
58
- shell: true
59
- })
60
- }
61
-
62
- async function initBmad() {
63
- // 检查是否已安装并获取版本
64
- const manifestPath = path.join(process.cwd(), '.bmad-core', 'install-manifest.yaml')
65
- let needsInstall = true
66
- let currentVersion = null
67
-
68
- if (fs.existsSync(manifestPath)) {
69
- try {
70
- // 简单版本检查 - 只检查文件是否存在
71
- // 完整的 YAML 解析需要 js-yaml 包
72
- const manifestContent = fs.readFileSync(manifestPath, 'utf8')
73
- const versionMatch = manifestContent.match(/version:\s*(.+)/)
74
- if (versionMatch) {
75
- currentVersion = versionMatch[1].trim()
76
- }
77
-
78
- // 从 npm 获取最新版本
79
- const latestVersion = execSync('npm view bmad-method version', { encoding: 'utf8' }).trim()
80
-
81
- if (currentVersion === latestVersion) {
82
- console.log(`✅ BMad-Method已是最新版本 (v${currentVersion})`)
83
- console.log('您可以使用 BMad 命令开始工作流')
84
- needsInstall = false
85
- }
86
- else {
87
- console.log(`🔄 BMad-Method有更新可用:v${currentVersion} → v${latestVersion}`)
88
- }
89
- }
90
- catch (error) {
91
- console.log('⚠️ 无法验证 BMad 版本,将重新安装')
92
- }
93
- }
94
-
95
- if (needsInstall === false) {
96
- return
97
- }
98
-
99
- // 安装 BMad - 使用 expect 优先方案
100
- console.log('🚀 正在安装 BMad-Method...')
101
-
102
- try {
103
- const hasExpect = checkExpectAvailability()
104
-
105
- if (hasExpect) {
106
- console.log('📋 使用自动化安装 (expect 工具可用)')
107
- installWithExpect()
108
- } else {
109
- fallbackInstallation()
110
- }
111
-
112
- console.log('')
113
- console.log('✅ BMad-Method已成功安装!')
114
- console.log('')
115
- console.log('═══════════════════════════════════════════════════════════════')
116
- console.log('📌 重要提示:请重启 Claude Code 以加载 BMad 扩展')
117
- console.log('═══════════════════════════════════════════════════════════════')
118
- console.log('')
119
- console.log('📂 安装详情:')
120
- console.log(' • 所有代理和任务命令都已安装在:')
121
- console.log(' .claude/commands/BMad/ 目录中')
122
- console.log('')
123
- console.log('🔧 Git 配置建议(可选):')
124
- console.log(' 如果您不希望将 BMad 工作流文件提交到 Git,请将以下内容添加到 .gitignore:')
125
- console.log(' • .bmad-core')
126
- console.log(' • .claude/commands/BMad')
127
- console.log(' • docs/')
128
- console.log('')
129
- console.log('🚀 快速开始:')
130
- console.log(' 1. 重启 Claude Code')
131
- console.log(' 2. 首次使用推荐运行:')
132
- console.log(' /BMad:agents:bmad-orchestrator *help')
133
- console.log(' 这将启动 BMad 工作流引导系统')
134
- console.log('')
135
- console.log('💡 提示:BMad Orchestrator 将帮助您选择合适的工作流程,')
136
- console.log(' 并引导您完成整个开发过程。')
137
- }
138
- catch (error) {
139
- console.error('❌ 安装失败:', error.message)
140
- console.log('')
141
- console.log('🛠️ 手动安装指南:')
142
- console.log('请手动运行以下命令并根据提示选择:')
143
- console.log(' npx bmad-method@latest install -f -d . -i claude-code')
144
- console.log('')
145
- console.log('安装提示:')
146
- console.log(' 1. 当询问 "What would you like to do?" 时,选择第一个选项')
147
- console.log(' 2. 当询问 "How would you like to proceed?" 时,选择 "Backup and overwrite"')
148
- console.log('')
149
- console.log('💡 提示:如果需要自动化安装,请考虑安装 expect 工具:')
150
- console.log(' • macOS: brew install expect')
151
- console.log(' • Ubuntu: sudo apt-get install expect')
152
- console.log(' • CentOS: sudo yum install expect')
153
- }
154
- }
155
-
156
- // 执行初始化
157
- initBmad()
158
- ```
159
-
160
- ## 用法
161
-
162
- 只需在 Claude Code 中键入:
163
-
164
- ```
165
- /bmad-init
166
- ```
167
-
168
- 此命令将:
169
-
170
- 1. 在您的项目中安装 BMad-Method 框架
171
- 2. 设置所有必要的配置
172
- 3. 提供如何开始使用 BMad 工作流的指导
@@ -1,29 +0,0 @@
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 代理来获取准确的时间戳,而不是手动编写时间信息。
@@ -1,114 +0,0 @@
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
- - 不要手动编写时间信息,使用提供的时间戳参数确保时间准确性。
@@ -1,53 +0,0 @@
1
- ---
2
- description: 初始化项目 AI 上下文,生成/更新根级与模块级 CLAUDE.md 索引
3
- allowed-tools: Read(**), Write(CLAUDE.md, **/CLAUDE.md)
4
- argument-hint: <项目摘要或名称>
5
- ---
6
-
7
- ## 用法
8
-
9
- `/init-project <项目摘要或名称>`
10
-
11
- ## 目标
12
-
13
- 以"根级简明 + 模块级详尽"的混合策略初始化项目 AI 上下文:
14
-
15
- - 在仓库根生成/更新 `CLAUDE.md`(高层愿景、架构总览、模块索引、全局规范)。
16
- - 在识别的各模块目录生成/更新本地 `CLAUDE.md`(接口、依赖、入口、测试、关键文件等)。
17
- - ✨ **为了提升可读性,会在根 `CLAUDE.md` 中自动生成 Mermaid 结构图,并为每个模块 `CLAUDE.md` 添加导航面包屑**。
18
-
19
- ## 编排说明
20
-
21
- **步骤 1**:调用 `get-current-datetime` 子智能体获取当前时间戳。
22
-
23
- **步骤 2**:调用一次 `init-architect` 子智能体,输入:
24
-
25
- - `project_summary`: $ARGUMENTS
26
- - `current_timestamp`: (来自步骤1的时间戳)
27
-
28
- ## 执行策略(由 Agent 自适应决定,不需要用户传参)
29
-
30
- - **阶段 A:全仓清点(轻量)**
31
- 快速统计文件与目录,识别模块根(package.json、pyproject.toml、go.mod、apps/_、packages/_、services/\* 等)。
32
- - **阶段 B:模块优先扫描(中等)**
33
- 对每个模块做"入口/接口/依赖/测试/数据模型/质量工具"的定点读取与样本抽取。
34
- - **阶段 C:深度补捞(按需)**
35
- 若仓库较小或模块规模较小,则扩大读取面;若较大,则对高风险/高价值路径分批追加扫描。
36
- - **覆盖率度量与可续跑**
37
- 输出"已扫描文件数 / 估算总文件数、已覆盖模块占比、被忽略/跳过原因",并列出"建议下一步深挖的子路径"。重复运行 `/init-project` 时按上次索引做**增量更新**与**断点续扫**。
38
-
39
- ## 安全与边界
40
-
41
- - 只读/写文档与索引,不改源代码。
42
- - 默认忽略常见生成物与二进制大文件。
43
- - 结果在主对话打印"摘要",全文写入仓库。
44
-
45
- ## 输出要求
46
-
47
- - 在主对话中打印"初始化结果摘要",包含:
48
- - 根级 `CLAUDE.md` 是否创建/更新、主要栏目概览。
49
- - 识别的模块数量及其路径列表。
50
- - 每个模块 `CLAUDE.md` 的生成/更新情况。
51
- - ✨ **明确提及"已生成 Mermaid 结构图"和"已为 N 个模块添加导航面包屑"**。
52
- - 覆盖率与主要缺口。
53
- - 若未读全:说明"为何到此为止",并列出**推荐的下一步**(例如"建议优先补扫:packages/auth/src/controllers")。
@@ -1,29 +0,0 @@
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 代理来获取准确的时间戳,而不是手动编写时间信息。
@@ -1,114 +0,0 @@
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
- - 不要手动编写时间信息,使用提供的时间戳参数确保时间准确性。