ccjk 3.7.3 → 3.8.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 +103 -896
- package/dist/chunks/ccr.mjs +1 -0
- package/dist/chunks/doctor.mjs +58 -0
- package/dist/chunks/index.mjs +6 -0
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/permissions.mjs +164 -342
- package/dist/chunks/thinking.mjs +615 -0
- package/dist/chunks/vim.mjs +891 -0
- package/dist/cli.mjs +49 -0
- package/dist/i18n/locales/en/configuration.json +97 -1
- package/dist/i18n/locales/en/lsp.json +78 -0
- package/dist/i18n/locales/en/mcp.json +11 -0
- package/dist/i18n/locales/en/permissions.json +53 -1
- package/dist/i18n/locales/en/thinking.json +65 -0
- package/dist/i18n/locales/en/vim.json +169 -0
- package/dist/i18n/locales/zh-CN/configuration.json +97 -1
- package/dist/i18n/locales/zh-CN/lsp.json +78 -0
- package/dist/i18n/locales/zh-CN/mcp.json +11 -0
- package/dist/i18n/locales/zh-CN/permissions.json +53 -1
- package/dist/i18n/locales/zh-CN/thinking.json +65 -0
- package/dist/i18n/locales/zh-CN/vim.json +169 -0
- package/dist/shared/ccjk.pi0nsyn3.mjs +1242 -0
- package/package.json +55 -55
- package/templates/claude-code/common/settings.json +63 -30
- package/templates/CLAUDE.md +0 -219
- package/templates/claude-code/CLAUDE.md +0 -250
- package/templates/claude-code/en/workflow/bmad/commands/bmad-init.md +0 -165
- package/templates/claude-code/en/workflow/common/agents/get-current-datetime.md +0 -29
- package/templates/claude-code/en/workflow/common/agents/init-architect.md +0 -114
- package/templates/claude-code/en/workflow/common/commands/init-project.md +0 -53
- package/templates/claude-code/en/workflow/essential/agents/get-current-datetime.md +0 -29
- package/templates/claude-code/en/workflow/essential/agents/init-architect.md +0 -114
- package/templates/claude-code/en/workflow/essential/agents/planner.md +0 -116
- package/templates/claude-code/en/workflow/essential/agents/ui-ux-designer.md +0 -91
- package/templates/claude-code/en/workflow/essential/commands/feat.md +0 -250
- package/templates/claude-code/en/workflow/essential/commands/init-project.md +0 -53
- package/templates/claude-code/en/workflow/plan/agents/planner.md +0 -116
- package/templates/claude-code/en/workflow/plan/agents/ui-ux-designer.md +0 -91
- package/templates/claude-code/en/workflow/plan/commands/feat.md +0 -105
- package/templates/claude-code/zh-CN/workflow/bmad/commands/bmad-init.md +0 -172
- package/templates/claude-code/zh-CN/workflow/common/agents/get-current-datetime.md +0 -29
- package/templates/claude-code/zh-CN/workflow/common/agents/init-architect.md +0 -114
- package/templates/claude-code/zh-CN/workflow/common/commands/init-project.md +0 -53
- package/templates/claude-code/zh-CN/workflow/essential/agents/get-current-datetime.md +0 -29
- package/templates/claude-code/zh-CN/workflow/essential/agents/init-architect.md +0 -114
- package/templates/claude-code/zh-CN/workflow/essential/agents/planner.md +0 -116
- package/templates/claude-code/zh-CN/workflow/essential/agents/ui-ux-designer.md +0 -91
- package/templates/claude-code/zh-CN/workflow/essential/commands/feat.md +0 -248
- package/templates/claude-code/zh-CN/workflow/essential/commands/init-project.md +0 -53
- package/templates/claude-code/zh-CN/workflow/plan/agents/planner.md +0 -116
- package/templates/claude-code/zh-CN/workflow/plan/agents/ui-ux-designer.md +0 -91
- package/templates/claude-code/zh-CN/workflow/plan/commands/feat.md +0 -105
- package/templates/codex/common/config.toml +0 -0
- package/templates/common/output-styles/en/casual-friendly.md +0 -97
- package/templates/common/output-styles/en/expert-concise.md +0 -93
- package/templates/common/output-styles/en/pair-programmer.md +0 -177
- package/templates/common/output-styles/en/senior-architect.md +0 -121
- package/templates/common/output-styles/en/speed-coder.md +0 -185
- package/templates/common/output-styles/en/teaching-mode.md +0 -102
- package/templates/common/output-styles/en/technical-precise.md +0 -101
- package/templates/common/output-styles/zh-CN/pair-programmer.md +0 -177
- package/templates/common/output-styles/zh-CN/senior-architect.md +0 -297
- package/templates/common/output-styles/zh-CN/speed-coder.md +0 -185
- package/templates/common/skills/code-review.md +0 -343
- package/templates/common/skills/en/agent-browser.md +0 -258
- package/templates/common/skills/en/brainstorming.md +0 -64
- package/templates/common/skills/en/code-review.md +0 -81
- package/templates/common/skills/en/documentation-gen.md +0 -808
- package/templates/common/skills/en/executing-plans.md +0 -75
- package/templates/common/skills/en/git-commit.md +0 -216
- package/templates/common/skills/en/interview.md +0 -223
- package/templates/common/skills/en/migration-assistant.md +0 -312
- package/templates/common/skills/en/performance-profiling.md +0 -576
- package/templates/common/skills/en/pr-review.md +0 -341
- package/templates/common/skills/en/refactoring.md +0 -384
- package/templates/common/skills/en/security-audit.md +0 -462
- package/templates/common/skills/en/systematic-debugging.md +0 -82
- package/templates/common/skills/en/tdd-workflow.md +0 -93
- package/templates/common/skills/en/verification.md +0 -81
- package/templates/common/skills/en/workflow.md +0 -370
- package/templates/common/skills/en/writing-plans.md +0 -78
- package/templates/common/skills/summarize.md +0 -312
- package/templates/common/skills/translate.md +0 -202
- package/templates/common/skills/zh-CN/agent-browser.md +0 -260
- package/templates/common/skills/zh-CN/documentation-gen.md +0 -807
- package/templates/common/skills/zh-CN/migration-assistant.md +0 -318
- package/templates/common/skills/zh-CN/performance-profiling.md +0 -746
- package/templates/common/skills/zh-CN/pr-review.md +0 -341
- package/templates/common/skills/zh-CN/refactoring.md +0 -384
- package/templates/common/skills/zh-CN/security-audit.md +0 -462
- package/templates/common/smart-guide/en/smart-guide.md +0 -72
- package/templates/common/smart-guide/zh-CN/smart-guide.md +0 -72
- package/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
- package/templates/common/workflow/git/en/git-commit.md +0 -205
- package/templates/common/workflow/git/en/git-rollback.md +0 -90
- package/templates/common/workflow/git/en/git-worktree.md +0 -276
- package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
- package/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
- package/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
- package/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
- package/templates/common/workflow/interview/en/interview.md +0 -212
- package/templates/common/workflow/interview/zh-CN/interview.md +0 -212
- package/templates/common/workflow/sixStep/en/workflow.md +0 -357
- package/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -357
- package/templates/industry/devops/en/ci-cd-pipeline.md +0 -410
- package/templates/industry/web-dev/en/api-design.md +0 -299
- package/templates/industry/web-dev/en/react-nextjs-setup.md +0 -236
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
# Templates Module
|
|
2
|
-
|
|
3
|
-
**Last Updated**: Mon Oct 27 19:39:26 CST 2025
|
|
4
|
-
[Root](../CLAUDE.md) > **templates**
|
|
5
|
-
|
|
6
|
-
## Module Responsibilities
|
|
7
|
-
|
|
8
|
-
Template configuration module providing multilingual configuration templates, workflow templates, and AI memory templates, supporting both Chinese and English environments for comprehensive Claude Code environment setup.
|
|
9
|
-
|
|
10
|
-
## Entry Points and Startup
|
|
11
|
-
|
|
12
|
-
- **Main Entry Points**:
|
|
13
|
-
- `common/` - Common configuration templates
|
|
14
|
-
- `zh-CN/` - Chinese template collection
|
|
15
|
-
- `en/` - English template collection
|
|
16
|
-
|
|
17
|
-
## External Interfaces
|
|
18
|
-
|
|
19
|
-
### Template Structure
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
templates/
|
|
23
|
-
├── common/ # Common configuration templates
|
|
24
|
-
│ ├── CLAUDE.md # Base CLAUDE.md template
|
|
25
|
-
│ └── settings.json # Claude settings template
|
|
26
|
-
├── zh-CN/ # Chinese template collection
|
|
27
|
-
│ ├── memory/ # AI memory templates
|
|
28
|
-
│ └── workflow/ # Workflow templates
|
|
29
|
-
└── en/ # English template collection
|
|
30
|
-
├── memory/ # AI memory templates
|
|
31
|
-
└── workflow/ # Workflow templates
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Template Category System
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
// Template categories
|
|
38
|
-
interface TemplateCategories {
|
|
39
|
-
memory: {
|
|
40
|
-
'mcp.md': string // MCP service guidance
|
|
41
|
-
'technical-guides.md': string // Technical implementation guides
|
|
42
|
-
'personality.md': string // AI personality configuration
|
|
43
|
-
'rules.md': string // Core programming principles
|
|
44
|
-
}
|
|
45
|
-
workflow: {
|
|
46
|
-
common: WorkflowCommands // Common tools workflow
|
|
47
|
-
plan: WorkflowCommands // Feature planning workflow
|
|
48
|
-
sixStep: WorkflowCommands // Six-step development workflow
|
|
49
|
-
bmad: WorkflowCommands // BMad enterprise workflow
|
|
50
|
-
git: WorkflowCommands // Git operation workflow
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Key Dependencies and Configuration
|
|
56
|
-
|
|
57
|
-
### Template Installation Process
|
|
58
|
-
|
|
59
|
-
- Templates are copied to `~/.claude/` directory during initialization
|
|
60
|
-
- Language-specific templates selected based on user configuration
|
|
61
|
-
- Automatic template merging and update mechanisms
|
|
62
|
-
- Template validation and consistency checking
|
|
63
|
-
|
|
64
|
-
### Configuration Files
|
|
65
|
-
|
|
66
|
-
- `common/settings.json` - Base Claude settings template
|
|
67
|
-
- `common/CLAUDE.md` - Project guidance template
|
|
68
|
-
- Language-specific memory and workflow templates
|
|
69
|
-
|
|
70
|
-
## Data Models
|
|
71
|
-
|
|
72
|
-
### Workflow Template Structure
|
|
73
|
-
|
|
74
|
-
#### Common Tools Workflow (`common/`)
|
|
75
|
-
|
|
76
|
-
- **Commands**: `init-project.md` - Project initialization command
|
|
77
|
-
- **Agents**: `init-architect.md`, `get-current-datetime.md` - Core utility agents
|
|
78
|
-
|
|
79
|
-
#### Feature Planning Workflow (`plan/`)
|
|
80
|
-
|
|
81
|
-
- **Commands**: `feat.md` - Feature development command
|
|
82
|
-
- **Agents**: `planner.md`, `ui-ux-designer.md` - Planning and design agents
|
|
83
|
-
|
|
84
|
-
#### Six-Step Development Workflow (`sixStep/`)
|
|
85
|
-
|
|
86
|
-
- **Commands**: `workflow.md` - Six-step development process
|
|
87
|
-
- **Agents**: None - Process-oriented workflow
|
|
88
|
-
|
|
89
|
-
#### BMad Enterprise Workflow (`bmad/`)
|
|
90
|
-
|
|
91
|
-
- **Commands**: `bmad-init.md` - BMad initialization
|
|
92
|
-
- **Agents**: Complete enterprise development team simulation
|
|
93
|
-
|
|
94
|
-
#### Git Workflow (`git/`)
|
|
95
|
-
|
|
96
|
-
- **Commands**: `git-commit.md`, `git-worktree.md`, `git-cleanBranches.md`, `git-rollback.md`
|
|
97
|
-
- **Agents**: None - Git operation commands
|
|
98
|
-
|
|
99
|
-
### Memory Template Structure
|
|
100
|
-
|
|
101
|
-
#### AI Memory Templates
|
|
102
|
-
|
|
103
|
-
- **mcp.md**: MCP service usage guidelines and best practices
|
|
104
|
-
- **technical-guides.md**: Technical execution guidelines and standards
|
|
105
|
-
- **personality.md**: AI assistant behavior and personality configuration
|
|
106
|
-
- **rules.md**: Core programming principles and workflow methodology
|
|
107
|
-
|
|
108
|
-
### Template Language Support
|
|
109
|
-
|
|
110
|
-
#### Chinese Templates (`zh-CN/`)
|
|
111
|
-
|
|
112
|
-
- Complete Chinese localization for all templates
|
|
113
|
-
- Chinese AI interaction patterns
|
|
114
|
-
- Chinese technical documentation standards
|
|
115
|
-
- Chinese workflow descriptions
|
|
116
|
-
|
|
117
|
-
#### English Templates (`en/`)
|
|
118
|
-
|
|
119
|
-
- Complete English localization for all templates
|
|
120
|
-
- English AI interaction patterns
|
|
121
|
-
- English technical documentation standards
|
|
122
|
-
- English workflow descriptions
|
|
123
|
-
|
|
124
|
-
## Testing and Quality
|
|
125
|
-
|
|
126
|
-
### Template Validation Strategy
|
|
127
|
-
|
|
128
|
-
- **Consistency Testing**: Verify Chinese-English template correspondence
|
|
129
|
-
- **Syntax Testing**: Validate markdown syntax and formatting
|
|
130
|
-
- **Content Testing**: Verify template completeness and accuracy
|
|
131
|
-
- **Integration Testing**: Test template installation and configuration
|
|
132
|
-
|
|
133
|
-
### Quality Metrics
|
|
134
|
-
|
|
135
|
-
#### ✅ Template Completeness
|
|
136
|
-
|
|
137
|
-
- Chinese-English template parity: **100%**
|
|
138
|
-
- Workflow category coverage: **5/5 categories**
|
|
139
|
-
- Memory template coverage: **4/4 templates**
|
|
140
|
-
- Command template coverage: **Complete**
|
|
141
|
-
|
|
142
|
-
#### ✅ Language Support
|
|
143
|
-
|
|
144
|
-
- Chinese localization: **Complete**
|
|
145
|
-
- English localization: **Complete**
|
|
146
|
-
- Template structure consistency: **Validated**
|
|
147
|
-
- Content accuracy: **Verified**
|
|
148
|
-
|
|
149
|
-
#### ✅ Installation Testing
|
|
150
|
-
|
|
151
|
-
- Template copying mechanism: **Tested**
|
|
152
|
-
- Language selection logic: **Verified**
|
|
153
|
-
- Template merging: **Functional**
|
|
154
|
-
- Update mechanism: **Working**
|
|
155
|
-
|
|
156
|
-
### Test Coverage
|
|
157
|
-
|
|
158
|
-
- **Template Tests**: `tests/templates/chinese-templates.test.ts`
|
|
159
|
-
- **Installation Tests**: Integration tests for template deployment
|
|
160
|
-
- **Validation Tests**: Template structure and content verification
|
|
161
|
-
|
|
162
|
-
## FAQ
|
|
163
|
-
|
|
164
|
-
### Q: How to add new workflow templates?
|
|
165
|
-
|
|
166
|
-
1. Add template files in both `zh-CN/workflow/` and `en/workflow/`
|
|
167
|
-
2. Update workflow configuration in `src/config/workflows.ts`
|
|
168
|
-
3. Add corresponding translation keys in i18n files
|
|
169
|
-
4. Test template installation and functionality
|
|
170
|
-
|
|
171
|
-
### Q: How to modify AI memory templates?
|
|
172
|
-
|
|
173
|
-
1. Update template files in both language directories
|
|
174
|
-
2. Ensure consistency between Chinese and English versions
|
|
175
|
-
3. Test AI behavior changes with modified templates
|
|
176
|
-
4. Update documentation if needed
|
|
177
|
-
|
|
178
|
-
### Q: How are templates installed during initialization?
|
|
179
|
-
|
|
180
|
-
Templates are copied from the package to `~/.claude/` directory based on user's language selection, with smart merging to preserve existing customizations.
|
|
181
|
-
|
|
182
|
-
### Q: How to maintain template version compatibility?
|
|
183
|
-
|
|
184
|
-
- Use semantic versioning for major template changes
|
|
185
|
-
- Provide migration guides for breaking changes
|
|
186
|
-
- Maintain backward compatibility when possible
|
|
187
|
-
- Test template updates with existing configurations
|
|
188
|
-
|
|
189
|
-
## Related File List
|
|
190
|
-
|
|
191
|
-
### Common Configuration Templates
|
|
192
|
-
|
|
193
|
-
- `common/CLAUDE.md` - Base project guidance template
|
|
194
|
-
- `common/settings.json` - Claude configuration template
|
|
195
|
-
|
|
196
|
-
### Chinese Templates (`zh-CN/`)
|
|
197
|
-
|
|
198
|
-
#### Memory Templates
|
|
199
|
-
|
|
200
|
-
- `memory/mcp.md` - MCP服务使用指南
|
|
201
|
-
- `memory/technical-guides.md` - 技术执行准则
|
|
202
|
-
- `memory/personality.md` - AI助手个性配置
|
|
203
|
-
- `memory/rules.md` - 核心编程原则
|
|
204
|
-
|
|
205
|
-
#### Workflow Templates
|
|
206
|
-
|
|
207
|
-
- `workflow/common/commands/init-project.md` - 项目初始化命令
|
|
208
|
-
- `workflow/common/agents/init-architect.md` - 初始化架构师
|
|
209
|
-
- `workflow/common/agents/get-current-datetime.md` - 时间工具
|
|
210
|
-
- `workflow/plan/commands/feat.md` - 功能开发命令
|
|
211
|
-
- `workflow/plan/agents/planner.md` - 规划师
|
|
212
|
-
- `workflow/plan/agents/ui-ux-designer.md` - UI/UX设计师
|
|
213
|
-
- `workflow/sixStep/commands/workflow.md` - 六步开发流程
|
|
214
|
-
- `workflow/bmad/commands/bmad-init.md` - BMad初始化
|
|
215
|
-
- `workflow/git/commands/` - Git操作命令集
|
|
216
|
-
|
|
217
|
-
### English Templates (`en/`)
|
|
218
|
-
|
|
219
|
-
#### Memory Templates
|
|
220
|
-
|
|
221
|
-
- `memory/mcp.md` - MCP Services Usage Guide
|
|
222
|
-
- `memory/technical-guides.md` - Technical Execution Guidelines
|
|
223
|
-
- `memory/personality.md` - AI Assistant Personality Configuration
|
|
224
|
-
- `memory/rules.md` - Core Programming Principles
|
|
225
|
-
|
|
226
|
-
#### Workflow Templates
|
|
227
|
-
|
|
228
|
-
- `workflow/common/commands/init-project.md` - Project initialization command
|
|
229
|
-
- `workflow/common/agents/init-architect.md` - Initialization architect
|
|
230
|
-
- `workflow/common/agents/get-current-datetime.md` - DateTime utility
|
|
231
|
-
- `workflow/plan/commands/feat.md` - Feature development command
|
|
232
|
-
- `workflow/plan/agents/planner.md` - Planner agent
|
|
233
|
-
- `workflow/plan/agents/ui-ux-designer.md` - UI/UX designer
|
|
234
|
-
- `workflow/sixStep/commands/workflow.md` - Six-step development workflow
|
|
235
|
-
- `workflow/bmad/commands/bmad-init.md` - BMad initialization
|
|
236
|
-
- `workflow/git/commands/` - Git operation commands
|
|
237
|
-
|
|
238
|
-
### Test Files
|
|
239
|
-
|
|
240
|
-
- `tests/templates/chinese-templates.test.ts` - Chinese template validation
|
|
241
|
-
- Template integration tests distributed across test suites
|
|
242
|
-
|
|
243
|
-
## Changelog
|
|
244
|
-
|
|
245
|
-
### 2025-08-20
|
|
246
|
-
|
|
247
|
-
- **Module Documentation Created**: Completed comprehensive documentation of templates module
|
|
248
|
-
- **Template Architecture Analysis**: Detailed analysis of bilingual template structure and workflow organization
|
|
249
|
-
- **Quality Assessment**: Verified complete Chinese-English template parity and coverage
|
|
250
|
-
- **Template Category Documentation**: Complete recording of 5 workflow categories and 4 memory templates
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
# /bmad-init Command
|
|
2
|
-
|
|
3
|
-
This command initializes BMad Method in your project.
|
|
4
|
-
|
|
5
|
-
## When this command is invoked:
|
|
6
|
-
|
|
7
|
-
1. Check if BMad is already installed by looking for `.bmad-core/install-manifest.yaml`
|
|
8
|
-
2. If installed, check version in manifest against latest version
|
|
9
|
-
3. If not installed or outdated, execute: `npx bmad-method@latest install -f -d . -i claude-code`
|
|
10
|
-
4. Display success message and prompt user to restart Claude Code
|
|
11
|
-
|
|
12
|
-
## Implementation
|
|
13
|
-
|
|
14
|
-
```javascript
|
|
15
|
-
const { execSync } = require('node:child_process')
|
|
16
|
-
const fs = require('node:fs')
|
|
17
|
-
const path = require('node:path')
|
|
18
|
-
|
|
19
|
-
// Check if expect tool is available
|
|
20
|
-
function checkExpectAvailability() {
|
|
21
|
-
try {
|
|
22
|
-
execSync('which expect', { stdio: 'ignore' })
|
|
23
|
-
return true
|
|
24
|
-
} catch (error) {
|
|
25
|
-
return false
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Use expect to automate interactive installation
|
|
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
|
-
// Fallback installation method
|
|
48
|
-
function fallbackInstallation() {
|
|
49
|
-
console.log('⚠️ expect tool not found, using interactive installation')
|
|
50
|
-
console.log('Please follow the installation prompts and select:')
|
|
51
|
-
console.log(' 1. Choose "Upgrade BMad core" when prompted')
|
|
52
|
-
console.log(' 2. Choose "Backup and overwrite modified files" when prompted')
|
|
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
|
-
// Check if already installed and get version
|
|
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
|
-
// Simple version check - just check if file exists
|
|
71
|
-
// Full YAML parsing would require js-yaml package
|
|
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
|
-
// Get latest version from npm
|
|
79
|
-
const latestVersion = execSync('npm view bmad-method version', { encoding: 'utf8' }).trim()
|
|
80
|
-
|
|
81
|
-
if (currentVersion === latestVersion) {
|
|
82
|
-
console.log(`✅ BMad Method is up to date (v${currentVersion})`)
|
|
83
|
-
console.log('You can use BMad commands to begin your workflow')
|
|
84
|
-
needsInstall = false
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
console.log(`🔄 BMad Method update available: v${currentVersion} → v${latestVersion}`)
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
console.log('⚠️ Could not verify BMad version, will reinstall')
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (needsInstall === false) {
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Install BMad - Using expect-first approach
|
|
100
|
-
console.log('🚀 Installing BMad Method...')
|
|
101
|
-
|
|
102
|
-
try {
|
|
103
|
-
const hasExpect = checkExpectAvailability()
|
|
104
|
-
|
|
105
|
-
if (hasExpect) {
|
|
106
|
-
console.log('📋 Using automated installation (expect tool available)')
|
|
107
|
-
installWithExpect()
|
|
108
|
-
} else {
|
|
109
|
-
fallbackInstallation()
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
console.log('')
|
|
113
|
-
console.log('✅ BMad Method installed successfully!')
|
|
114
|
-
console.log('')
|
|
115
|
-
console.log('═══════════════════════════════════════════════════════════════')
|
|
116
|
-
console.log('📌 IMPORTANT: Please restart Claude Code to load BMad agents')
|
|
117
|
-
console.log('═══════════════════════════════════════════════════════════════')
|
|
118
|
-
console.log('')
|
|
119
|
-
console.log('📂 Installation Details:')
|
|
120
|
-
console.log(' • All agents and task commands are installed in:')
|
|
121
|
-
console.log(' .claude/commands/BMad/')
|
|
122
|
-
console.log('')
|
|
123
|
-
console.log('🔧 Git Configuration (Optional):')
|
|
124
|
-
console.log(' If you prefer not to commit BMad workflow files, add these to .gitignore:')
|
|
125
|
-
console.log(' • .bmad-core')
|
|
126
|
-
console.log(' • .claude/commands/BMad')
|
|
127
|
-
console.log(' • docs/')
|
|
128
|
-
console.log('')
|
|
129
|
-
console.log('🚀 Getting Started:')
|
|
130
|
-
console.log(' 1. Restart Claude Code')
|
|
131
|
-
console.log(' 2. For first-time users, run:')
|
|
132
|
-
console.log(' /BMad:agents:bmad-orchestrator *help')
|
|
133
|
-
console.log(' This will start the BMad workflow guidance system')
|
|
134
|
-
console.log('')
|
|
135
|
-
console.log('💡 Tip: The BMad Orchestrator will help you choose the right workflow')
|
|
136
|
-
console.log(' and guide you through the entire development process.')
|
|
137
|
-
}
|
|
138
|
-
catch (error) {
|
|
139
|
-
console.error('❌ Installation failed:', error.message)
|
|
140
|
-
console.log('')
|
|
141
|
-
console.log('🛠️ Manual Installation Guide:')
|
|
142
|
-
console.log('Please run the following command and follow the prompts:')
|
|
143
|
-
console.log(' npx bmad-method@latest install -f -d . -i claude-code')
|
|
144
|
-
console.log('')
|
|
145
|
-
console.log('Installation Tips:')
|
|
146
|
-
console.log(' 1. When asked "What would you like to do?", choose the first option')
|
|
147
|
-
console.log(' 2. When asked "How would you like to proceed?", choose "Backup and overwrite"')
|
|
148
|
-
console.log('')
|
|
149
|
-
console.log('💡 Tip: For automated installation, consider installing expect tool:')
|
|
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
|
-
// Execute
|
|
157
|
-
initBmad()
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Notes
|
|
161
|
-
|
|
162
|
-
- This command requires npm/npx to be available
|
|
163
|
-
- The installation will download the latest BMad Method package
|
|
164
|
-
- User must restart Claude Code after installation for agents to load properly
|
|
165
|
-
- BMad Method includes its own built-in state tracking system
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: get-current-datetime
|
|
3
|
-
description: Execute date command and return ONLY the raw output. No formatting, headers, explanations, or parallel agents.
|
|
4
|
-
tools: Bash, Read, Write
|
|
5
|
-
color: cyan
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Execute `date` and return ONLY the command output.
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
date +'%Y-%m-%d %H:%M:%S'
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
DO NOT add any text, headers, formatting, or explanations.
|
|
15
|
-
DO NOT add markdown formatting or code blocks.
|
|
16
|
-
DO NOT add "Current date and time is:" or similar phrases.
|
|
17
|
-
DO NOT use parallel agents.
|
|
18
|
-
|
|
19
|
-
Just return the raw bash command output exactly as it appears.
|
|
20
|
-
|
|
21
|
-
Example response: `2025-07-28 23:59:42`
|
|
22
|
-
|
|
23
|
-
Format options if requested:
|
|
24
|
-
|
|
25
|
-
- Filename: Add `+"%Y-%m-%d_%H%M%S"`
|
|
26
|
-
- Readable: Add `+"%Y-%m-%d %H:%M:%S %Z"`
|
|
27
|
-
- ISO: Add `+"%Y-%m-%dT%H:%M:%S%z"`
|
|
28
|
-
|
|
29
|
-
Use the get-current-datetime agent to get accurate timestamps instead of manually writing time information.
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: init-architect
|
|
3
|
-
description: Adaptive initialization: concise at root + detailed at module level; staged traversal with coverage reporting
|
|
4
|
-
tools: Read, Write, Glob, Grep
|
|
5
|
-
color: orange
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Initialization Architect (Adaptive Version)
|
|
9
|
-
|
|
10
|
-
> No exposed parameters; internal adaptive three levels: quick summary / module scanning / deep supplementation. Ensures incremental updates and resumable runs with coverage reporting and next-step recommendations.
|
|
11
|
-
|
|
12
|
-
## I. General Constraints
|
|
13
|
-
|
|
14
|
-
- Do not modify source code; only generate/update documentation and `.claude/index.json`.
|
|
15
|
-
- **Ignore Rules Retrieval Strategy**:
|
|
16
|
-
1. Prioritize reading the `.gitignore` file from the project root directory
|
|
17
|
-
2. If `.gitignore` does not exist, use the following default ignore rules: `node_modules/**,.git/**,.github/**,dist/**,build/**,.next/**,__pycache__/**,*.lock,*.log,*.bin,*.pdf,*.png,*.jpg,*.jpeg,*.gif,*.mp4,*.zip,*.tar,*.gz`
|
|
18
|
-
3. Merge ignore patterns from `.gitignore` with default rules
|
|
19
|
-
- For large files/binaries, only record paths without reading content.
|
|
20
|
-
|
|
21
|
-
## II. Staged Strategy (Automatic Intensity Selection)
|
|
22
|
-
|
|
23
|
-
1. **Stage A: Repository Census (Lightweight)**
|
|
24
|
-
- Use multiple `Glob` calls in batches to get file inventory (avoid single-call limits), doing:
|
|
25
|
-
- File counting, language proportions, directory topology, module candidate discovery (package.json, pyproject.toml, go.mod, Cargo.toml, apps/_, packages/_, services/_, cmd/_, etc.).
|
|
26
|
-
- Generate `Module Candidate List`, annotating each candidate module with: language, entry file guesses, test directory existence, config file existence.
|
|
27
|
-
2. **Stage B: Module Priority Scanning (Medium)**
|
|
28
|
-
- For each module, try reading in the following order (batched, paginated):
|
|
29
|
-
- Entry and startup: `main.ts`/`index.ts`/`cmd/*/main.go`/`app.py`/`src/main.rs`, etc.
|
|
30
|
-
- External interfaces: routes, controllers, API definitions, proto/openapi
|
|
31
|
-
- Dependencies and scripts: `package.json scripts`, `pyproject.toml`, `go.mod`, `Cargo.toml`, config directories
|
|
32
|
-
- Data layer: `schema.sql`, `prisma/schema.prisma`, ORM models, migration directories
|
|
33
|
-
- Testing: `tests/**`, `__tests__/**`, `*_test.go`, `*.spec.ts`, etc.
|
|
34
|
-
- Quality tools: `eslint/ruff/golangci` configurations
|
|
35
|
-
- Form "module snapshots", extracting only high-signal fragments and paths, not pasting large code blocks.
|
|
36
|
-
3. **Stage C: Deep Supplementation (Triggered As Needed)**
|
|
37
|
-
- Trigger conditions (any one suffices):
|
|
38
|
-
- Repository overall small (fewer files) or single module small file count;
|
|
39
|
-
- After Stage B, still cannot determine key interfaces/data models/testing strategies;
|
|
40
|
-
- Root or module `CLAUDE.md` missing information items.
|
|
41
|
-
- Action: **Additional paginated reading** for target directories, filling gaps.
|
|
42
|
-
|
|
43
|
-
> Note: If pagination/attempts reach tool or time limits, must **write partial results early** and explain in summary "why stopped here" and "next-step recommended directory list".
|
|
44
|
-
|
|
45
|
-
## III. Artifacts and Incremental Updates
|
|
46
|
-
|
|
47
|
-
1. **Write Root-level `CLAUDE.md`**
|
|
48
|
-
- If exists, insert/update `Change Log (Changelog)` at the top.
|
|
49
|
-
- Root structure (concise yet global):
|
|
50
|
-
- Project Vision
|
|
51
|
-
- Architecture Overview
|
|
52
|
-
- **✨ New: Module Structure Diagram (Mermaid)**
|
|
53
|
-
- Above the "Module Index" table, generate a Mermaid `graph TD` tree diagram based on identified module paths.
|
|
54
|
-
- Each node should be clickable and link to the corresponding module's `CLAUDE.md` file.
|
|
55
|
-
- Example syntax:
|
|
56
|
-
|
|
57
|
-
```mermaid
|
|
58
|
-
graph TD
|
|
59
|
-
A["(Root) My Project"] --> 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" "View auth module docs"
|
|
66
|
-
click D "./packages/ui-library/CLAUDE.md" "View ui-library module docs"
|
|
67
|
-
click F "./services/audit-log/CLAUDE.md" "View audit-log module docs"
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
- Module Index (table format)
|
|
71
|
-
- Running and Development
|
|
72
|
-
- Testing Strategy
|
|
73
|
-
- Coding Standards
|
|
74
|
-
- AI Usage Guidelines
|
|
75
|
-
- Change Log (Changelog)
|
|
76
|
-
|
|
77
|
-
2. **Write Module-level `CLAUDE.md`**
|
|
78
|
-
- Place in each module directory, suggested structure:
|
|
79
|
-
- **✨ New: Relative Path Breadcrumbs**
|
|
80
|
-
- At the **top** of each module `CLAUDE.md`, insert a relative path breadcrumb line linking to parent directories and root `CLAUDE.md`.
|
|
81
|
-
- Example (located at `packages/auth/CLAUDE.md`):
|
|
82
|
-
`[Root Directory](../../CLAUDE.md) > [packages](../) > **auth**`
|
|
83
|
-
- Module Responsibilities
|
|
84
|
-
- Entry and Startup
|
|
85
|
-
- External Interfaces
|
|
86
|
-
- Key Dependencies and Configuration
|
|
87
|
-
- Data Models
|
|
88
|
-
- Testing and Quality
|
|
89
|
-
- Frequently Asked Questions (FAQ)
|
|
90
|
-
- Related File List
|
|
91
|
-
- Change Log (Changelog)
|
|
92
|
-
3. **`.claude/index.json`**
|
|
93
|
-
- Record: current timestamp (provided via parameters), root/module lists, entry/interface/test/important paths for each module, **scan coverage**, ignore statistics, whether truncated due to limits (`truncated: true`).
|
|
94
|
-
|
|
95
|
-
## IV. Coverage and Resumability
|
|
96
|
-
|
|
97
|
-
- Calculate and print each run:
|
|
98
|
-
- Estimated total files, scanned file count, coverage percentage;
|
|
99
|
-
- Coverage summary and gaps for each module (missing interfaces, tests, data models, etc.);
|
|
100
|
-
- Top ignored/skipped directories and reasons (ignore rules/large files/time or call limits).
|
|
101
|
-
- Write "gap list" to `index.json`, prioritize filling gaps on next run (**breakpoint resumable scanning**).
|
|
102
|
-
|
|
103
|
-
## V. Result Summary (Print to Main Dialog)
|
|
104
|
-
|
|
105
|
-
- Root/module `CLAUDE.md` creation or update status;
|
|
106
|
-
- Module list (path + one-sentence responsibility);
|
|
107
|
-
- Coverage and major gaps;
|
|
108
|
-
- If not fully read: explain "why stopped here" and list **recommended next steps** (e.g., "suggest priority supplemental scanning: packages/auth/src/controllers, services/audit/migrations").
|
|
109
|
-
|
|
110
|
-
## VI. Time Format and Usage
|
|
111
|
-
|
|
112
|
-
- Use relative paths;
|
|
113
|
-
- Time information: Use the timestamp provided via command parameters and write in ISO-8601 format in `index.json`.
|
|
114
|
-
- Do not manually write time information; use the provided timestamp parameter to ensure time accuracy.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Initialize project AI context, generate/update root-level and module-level CLAUDE.md indexes
|
|
3
|
-
allowed-tools: Read(**), Write(CLAUDE.md, **/CLAUDE.md)
|
|
4
|
-
argument-hint: <PROJECT_SUMMARY_OR_NAME>
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Usage
|
|
8
|
-
|
|
9
|
-
`/init-project <PROJECT_SUMMARY_OR_NAME>`
|
|
10
|
-
|
|
11
|
-
## Objective
|
|
12
|
-
|
|
13
|
-
Initialize project AI context using a mixed strategy of "concise at root + detailed at module level":
|
|
14
|
-
|
|
15
|
-
- Generate/update `CLAUDE.md` at repository root (high-level vision, architecture overview, module index, global standards).
|
|
16
|
-
- Generate/update local `CLAUDE.md` in identified module directories (interfaces, dependencies, entry points, tests, key files, etc.).
|
|
17
|
-
- ✨ **For improved readability, automatically generate Mermaid structure diagrams in the root `CLAUDE.md` and add navigation breadcrumbs to each module `CLAUDE.md`**.
|
|
18
|
-
|
|
19
|
-
## Orchestration Instructions
|
|
20
|
-
|
|
21
|
-
**Step 1**: Call the `get-current-datetime` sub-agent to obtain the current timestamp.
|
|
22
|
-
|
|
23
|
-
**Step 2**: Call the `init-architect` sub-agent once, with input:
|
|
24
|
-
|
|
25
|
-
- `project_summary`: $ARGUMENTS
|
|
26
|
-
- `current_timestamp`: (timestamp from step 1)
|
|
27
|
-
|
|
28
|
-
## Execution Strategy (Agent adapts automatically, no user parameters needed)
|
|
29
|
-
|
|
30
|
-
- **Stage A: Repository Census (Lightweight)**
|
|
31
|
-
Quickly count files and directories, identify module roots (package.json, pyproject.toml, go.mod, apps/_, packages/_, services/\*, etc.).
|
|
32
|
-
- **Stage B: Module Priority Scanning (Medium)**
|
|
33
|
-
For each module, perform targeted reading and sampling of "entry/interfaces/dependencies/tests/data models/quality tools".
|
|
34
|
-
- **Stage C: Deep Supplementation (As Needed)**
|
|
35
|
-
If repository is small or module scale is small, expand reading scope; if large, perform batch supplemental scanning on high-risk/high-value paths.
|
|
36
|
-
- **Coverage Measurement and Resumability**
|
|
37
|
-
Output "scanned files / estimated total files, covered module ratio, ignored/skipped reasons" and list "recommended next-step deep-dive sub-paths". When running `/init-project` repeatedly, perform **incremental updates** and **breakpoint resumable scanning** based on previous index.
|
|
38
|
-
|
|
39
|
-
## Security and Boundaries
|
|
40
|
-
|
|
41
|
-
- Only read/write documentation and indexes, do not modify source code.
|
|
42
|
-
- Ignore common generated artifacts and binary large files by default.
|
|
43
|
-
- Print "summary" in main dialog, write full content to repository.
|
|
44
|
-
|
|
45
|
-
## Output Requirements
|
|
46
|
-
|
|
47
|
-
- Print "Initialization Result Summary" in main dialog, including:
|
|
48
|
-
- Whether root-level `CLAUDE.md` was created/updated, major section overview.
|
|
49
|
-
- Number of identified modules and their path list.
|
|
50
|
-
- Generation/update status of each module's `CLAUDE.md`.
|
|
51
|
-
- ✨ **Explicitly mention "Generated Mermaid structure diagram" and "Added navigation breadcrumbs for N modules"**.
|
|
52
|
-
- Coverage and major gaps.
|
|
53
|
-
- If not fully read: explain "why stopped here" and list **recommended next steps** (e.g., "suggest priority supplemental scanning: packages/auth/src/controllers").
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: get-current-datetime
|
|
3
|
-
description: Execute date command and return ONLY the raw output. No formatting, headers, explanations, or parallel agents.
|
|
4
|
-
tools: Bash, Read, Write
|
|
5
|
-
color: cyan
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Execute `date` and return ONLY the command output.
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
date +'%Y-%m-%d %H:%M:%S'
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
DO NOT add any text, headers, formatting, or explanations.
|
|
15
|
-
DO NOT add markdown formatting or code blocks.
|
|
16
|
-
DO NOT add "Current date and time is:" or similar phrases.
|
|
17
|
-
DO NOT use parallel agents.
|
|
18
|
-
|
|
19
|
-
Just return the raw bash command output exactly as it appears.
|
|
20
|
-
|
|
21
|
-
Example response: `2025-07-28 23:59:42`
|
|
22
|
-
|
|
23
|
-
Format options if requested:
|
|
24
|
-
|
|
25
|
-
- Filename: Add `+"%Y-%m-%d_%H%M%S"`
|
|
26
|
-
- Readable: Add `+"%Y-%m-%d %H:%M:%S %Z"`
|
|
27
|
-
- ISO: Add `+"%Y-%m-%dT%H:%M:%S%z"`
|
|
28
|
-
|
|
29
|
-
Use the get-current-datetime agent to get accurate timestamps instead of manually writing time information.
|