bmad-method 4.27.5 → 4.27.6
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/CHANGELOG.md +7 -0
- package/bmad-core/agents/analyst.md +3 -4
- package/bmad-core/agents/architect.md +3 -4
- package/bmad-core/agents/bmad-master.md +9 -31
- package/bmad-core/agents/bmad-orchestrator.md +3 -8
- package/bmad-core/agents/dev.md +3 -4
- package/bmad-core/agents/pm.md +3 -4
- package/bmad-core/agents/po.md +3 -4
- package/bmad-core/agents/qa.md +3 -4
- package/bmad-core/agents/sm.md +3 -4
- package/bmad-core/agents/ux-expert.md +3 -4
- package/bmad-core/tasks/create-next-story.md +0 -1
- package/bmad-core/tasks/validate-next-story.md +1 -1
- package/bmad-core/workflows/brownfield-fullstack.yaml +1 -1
- package/bmad-core/workflows/brownfield-service.yaml +1 -1
- package/bmad-core/workflows/brownfield-ui.yaml +1 -1
- package/bmad-core/workflows/greenfield-fullstack.yaml +1 -1
- package/bmad-core/workflows/greenfield-ui.yaml +1 -1
- package/dist/agents/analyst.txt +3 -3
- package/dist/agents/bmad-master.txt +7 -324
- package/dist/agents/bmad-orchestrator.txt +3 -229
- package/dist/agents/dev.txt +1 -1
- package/dist/agents/po.txt +1 -1
- package/dist/agents/sm.txt +0 -1
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +0 -226
- package/dist/teams/team-all.txt +9 -236
- package/dist/teams/team-fullstack.txt +9 -235
- package/dist/teams/team-ide-minimal.txt +4 -231
- package/dist/teams/team-no-ui.txt +5 -231
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +2 -3
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +2 -3
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +2 -3
- package/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.md +2 -3
- package/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.md +2 -3
- package/package.json +1 -1
- package/tools/installer/lib/file-manager.js +77 -2
- package/tools/installer/lib/installer.js +54 -25
- package/tools/installer/package.json +1 -1
- package/bmad-core/utils/plan-management.md +0 -219
|
@@ -63,9 +63,6 @@ CRITICAL: Read the full YAML, start activation to alter your state of being, fol
|
|
|
63
63
|
```yaml
|
|
64
64
|
activation-instructions:
|
|
65
65
|
- Mention *help shows all available commands and options
|
|
66
|
-
- Check for active workflow plan using .bmad-core/utils/plan-management.md
|
|
67
|
-
- 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.'
|
|
68
|
-
- 'If plan exists: Suggest next action based on plan progress'
|
|
69
66
|
- Assess user goal against available agents and workflows in this bundle
|
|
70
67
|
- If clear match to an agent's expertise, suggest transformation with *agent command
|
|
71
68
|
- If project-oriented, suggest *workflow-guidance to explore options
|
|
@@ -187,7 +184,6 @@ dependencies:
|
|
|
187
184
|
- bmad-kb.md
|
|
188
185
|
- elicitation-methods.md
|
|
189
186
|
utils:
|
|
190
|
-
- plan-management.md
|
|
191
187
|
- workflow-management.md
|
|
192
188
|
```
|
|
193
189
|
==================== END: .bmad-core/agents/bmad-orchestrator.md ====================
|
|
@@ -1988,7 +1984,7 @@ For full details, see `CONTRIBUTING.md`. Key points:
|
|
|
1988
1984
|
- Atomic commits - one logical change per commit
|
|
1989
1985
|
- Must align with guiding principles
|
|
1990
1986
|
|
|
1991
|
-
**Core Principles** (from GUIDING-PRINCIPLES.md):
|
|
1987
|
+
**Core Principles** (from docs/GUIDING-PRINCIPLES.md):
|
|
1992
1988
|
|
|
1993
1989
|
- **Dev Agents Must Be Lean**: Minimize dependencies, save context for code
|
|
1994
1990
|
- **Natural Language First**: Everything in markdown, no code in core
|
|
@@ -2058,8 +2054,8 @@ Use the **expansion-creator** pack to build your own:
|
|
|
2058
2054
|
|
|
2059
2055
|
## Getting Help
|
|
2060
2056
|
|
|
2061
|
-
- **Commands**: Use
|
|
2062
|
-
- **Agent Switching**: Use
|
|
2057
|
+
- **Commands**: Use `*/*help` in any environment to see available commands
|
|
2058
|
+
- **Agent Switching**: Use `*/*switch agent-name` with orchestrator for role changes
|
|
2063
2059
|
- **Documentation**: Check `docs/` folder for project-specific context
|
|
2064
2060
|
- **Community**: Discord and GitHub resources available for support
|
|
2065
2061
|
- **Contributing**: See `CONTRIBUTING.md` for full guidelines
|
|
@@ -2202,228 +2198,6 @@ Use the **expansion-creator** pack to build your own:
|
|
|
2202
2198
|
- Prepare to continue without additional elicitation
|
|
2203
2199
|
==================== END: .bmad-core/data/elicitation-methods.md ====================
|
|
2204
2200
|
|
|
2205
|
-
==================== START: .bmad-core/utils/plan-management.md ====================
|
|
2206
|
-
# Plan Management Utility
|
|
2207
|
-
|
|
2208
|
-
## Purpose
|
|
2209
|
-
|
|
2210
|
-
Provides utilities for agents and tasks to interact with workflow plans, check progress, update status, and ensure workflow steps are executed in the appropriate sequence.
|
|
2211
|
-
|
|
2212
|
-
## Core Functions
|
|
2213
|
-
|
|
2214
|
-
### 1. Check Plan Existence
|
|
2215
|
-
|
|
2216
|
-
Check for workflow plan:
|
|
2217
|
-
|
|
2218
|
-
1. Look for docs/workflow-plan.md (default location)
|
|
2219
|
-
2. Return plan status to user (exists/not exists) - if not exists then HALT.
|
|
2220
|
-
|
|
2221
|
-
### 2. Parse Plan Status
|
|
2222
|
-
|
|
2223
|
-
[[LLM: Extract current progress from the plan document]]
|
|
2224
|
-
|
|
2225
|
-
**Plan Parsing Logic:**
|
|
2226
|
-
|
|
2227
|
-
1. **Identify Step Structure**:
|
|
2228
|
-
- Look for checkbox lines: `- [ ]` or `- [x]`
|
|
2229
|
-
- Extract step IDs from comments: `<!-- step-id: X.Y -->`
|
|
2230
|
-
- Identify agent assignments: `<!-- agent: pm -->`
|
|
2231
|
-
|
|
2232
|
-
2. **Determine Current State**:
|
|
2233
|
-
- Last completed step (highest numbered `[x]`)
|
|
2234
|
-
- Next expected step (first `[ ]` after completed steps)
|
|
2235
|
-
- Overall progress percentage
|
|
2236
|
-
|
|
2237
|
-
3. **Extract Metadata**:
|
|
2238
|
-
- Workflow type from plan header
|
|
2239
|
-
- Decision points and their status
|
|
2240
|
-
- Any deviation notes
|
|
2241
|
-
|
|
2242
|
-
### 3. Sequence Validation
|
|
2243
|
-
|
|
2244
|
-
[[LLM: Check if requested action aligns with plan sequence]]
|
|
2245
|
-
|
|
2246
|
-
**Validation Rules:**
|
|
2247
|
-
|
|
2248
|
-
1. **Strict Mode** (enforceSequence: true):
|
|
2249
|
-
- Must complete steps in exact order
|
|
2250
|
-
- Warn and block if out of sequence
|
|
2251
|
-
- Require explicit override justification
|
|
2252
|
-
|
|
2253
|
-
2. **Flexible Mode** (enforceSequence: false):
|
|
2254
|
-
- Warn about sequence deviation
|
|
2255
|
-
- Allow with confirmation
|
|
2256
|
-
- Log deviation reason
|
|
2257
|
-
|
|
2258
|
-
**Warning Templates:**
|
|
2259
|
-
|
|
2260
|
-
```text
|
|
2261
|
-
SEQUENCE WARNING:
|
|
2262
|
-
The workflow plan shows you should complete "{expected_step}" next.
|
|
2263
|
-
You're attempting to: "{requested_action}"
|
|
2264
|
-
|
|
2265
|
-
In strict mode: Block and require plan update
|
|
2266
|
-
In flexible mode: Allow with confirmation
|
|
2267
|
-
```
|
|
2268
|
-
|
|
2269
|
-
### 4. Plan Update Operations
|
|
2270
|
-
|
|
2271
|
-
[[LLM: Provide consistent way to update plan progress]]
|
|
2272
|
-
|
|
2273
|
-
**Update Actions:**
|
|
2274
|
-
|
|
2275
|
-
1. **Mark Step Complete**:
|
|
2276
|
-
- Change `- [ ]` to `- [x]`
|
|
2277
|
-
- Add completion timestamp comment
|
|
2278
|
-
- Update any status metadata
|
|
2279
|
-
|
|
2280
|
-
2. **Add Deviation Note**:
|
|
2281
|
-
- Insert note explaining why sequence changed
|
|
2282
|
-
- Reference the deviation in plan
|
|
2283
|
-
|
|
2284
|
-
3. **Update Current Step Pointer**:
|
|
2285
|
-
- Add/move `<!-- current-step -->` marker
|
|
2286
|
-
- Update last-modified timestamp
|
|
2287
|
-
|
|
2288
|
-
### 5. Integration Instructions
|
|
2289
|
-
|
|
2290
|
-
[[LLM: How agents and tasks should use this utility]]
|
|
2291
|
-
|
|
2292
|
-
**For Agents (startup sequence)**:
|
|
2293
|
-
|
|
2294
|
-
```text
|
|
2295
|
-
1. Check if plan exists using this utility
|
|
2296
|
-
2. If exists:
|
|
2297
|
-
- Parse current status
|
|
2298
|
-
- Show user: "Active workflow plan detected. Current step: {X}"
|
|
2299
|
-
- Suggest: "Next recommended action: {next_step}"
|
|
2300
|
-
3. Continue with normal startup
|
|
2301
|
-
```
|
|
2302
|
-
|
|
2303
|
-
**For Tasks (pre-execution)**:
|
|
2304
|
-
|
|
2305
|
-
```text
|
|
2306
|
-
1. Check if plan exists
|
|
2307
|
-
2. If exists:
|
|
2308
|
-
- Verify this task aligns with plan
|
|
2309
|
-
- If not aligned:
|
|
2310
|
-
- In strict mode: Show warning and stop
|
|
2311
|
-
- In flexible mode: Show warning and ask for confirmation
|
|
2312
|
-
3. After task completion:
|
|
2313
|
-
- Update plan if task was a planned step
|
|
2314
|
-
- Add note if task was unplanned
|
|
2315
|
-
```
|
|
2316
|
-
|
|
2317
|
-
### 6. Plan Status Report Format
|
|
2318
|
-
|
|
2319
|
-
[[LLM: Standard format for showing plan status]]
|
|
2320
|
-
|
|
2321
|
-
```text
|
|
2322
|
-
📋 Workflow Plan Status
|
|
2323
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
2324
|
-
Workflow: {workflow_name}
|
|
2325
|
-
Progress: {X}% complete ({completed}/{total} steps)
|
|
2326
|
-
|
|
2327
|
-
✅ Completed:
|
|
2328
|
-
- {completed_step_1}
|
|
2329
|
-
- {completed_step_2}
|
|
2330
|
-
|
|
2331
|
-
🔄 Current Step:
|
|
2332
|
-
- {current_step_description}
|
|
2333
|
-
|
|
2334
|
-
📌 Upcoming:
|
|
2335
|
-
- {next_step_1}
|
|
2336
|
-
- {next_step_2}
|
|
2337
|
-
|
|
2338
|
-
⚠️ Notes:
|
|
2339
|
-
- {any_deviations_or_notes}
|
|
2340
|
-
```
|
|
2341
|
-
|
|
2342
|
-
### 7. Decision Point Handling
|
|
2343
|
-
|
|
2344
|
-
[[LLM: Special handling for workflow decision points]]
|
|
2345
|
-
|
|
2346
|
-
When encountering a decision point in the plan:
|
|
2347
|
-
|
|
2348
|
-
1. **Identify Decision Marker**: `<!-- decision: {decision_id} -->`
|
|
2349
|
-
2. **Check Decision Status**: Made/Pending
|
|
2350
|
-
3. **If Pending**:
|
|
2351
|
-
- Block progress until decision made
|
|
2352
|
-
- Show options to user
|
|
2353
|
-
- Record decision when made
|
|
2354
|
-
4. **If Made**:
|
|
2355
|
-
- Verify current path aligns with decision
|
|
2356
|
-
- Warn if attempting alternate path
|
|
2357
|
-
|
|
2358
|
-
### 8. Plan Abandonment
|
|
2359
|
-
|
|
2360
|
-
[[LLM: Graceful handling when user wants to stop following plan]]
|
|
2361
|
-
|
|
2362
|
-
If user wants to abandon plan:
|
|
2363
|
-
|
|
2364
|
-
1. Confirm abandonment intent
|
|
2365
|
-
2. Add abandonment note to plan
|
|
2366
|
-
3. Mark plan as "Abandoned" in header
|
|
2367
|
-
4. Stop plan checking for remainder of session
|
|
2368
|
-
5. Suggest creating new plan if needed
|
|
2369
|
-
|
|
2370
|
-
## Usage Examples
|
|
2371
|
-
|
|
2372
|
-
### Example 1: Agent Startup Check
|
|
2373
|
-
|
|
2374
|
-
```text
|
|
2375
|
-
BMad Master starting...
|
|
2376
|
-
|
|
2377
|
-
[Check for plan]
|
|
2378
|
-
Found active workflow plan: brownfield-fullstack
|
|
2379
|
-
Progress: 40% complete (4/10 steps)
|
|
2380
|
-
Current step: Create PRD (pm agent)
|
|
2381
|
-
|
|
2382
|
-
Suggestion: Based on your plan, you should work with the PM agent next.
|
|
2383
|
-
Use *agent pm to switch, or *plan-status to see full progress.
|
|
2384
|
-
```
|
|
2385
|
-
|
|
2386
|
-
### Example 2: Task Sequence Warning
|
|
2387
|
-
|
|
2388
|
-
```text
|
|
2389
|
-
User: *task create-next-story
|
|
2390
|
-
|
|
2391
|
-
[Plan check triggered]
|
|
2392
|
-
⚠️ SEQUENCE WARNING:
|
|
2393
|
-
Your workflow plan indicates the PRD hasn't been created yet.
|
|
2394
|
-
Creating stories before the PRD may lead to incomplete requirements.
|
|
2395
|
-
|
|
2396
|
-
Would you like to:
|
|
2397
|
-
1. Continue anyway (will note deviation in plan)
|
|
2398
|
-
2. Switch to creating PRD first (*agent pm)
|
|
2399
|
-
3. View plan status (*plan-status)
|
|
2400
|
-
```
|
|
2401
|
-
|
|
2402
|
-
### Example 3: Automatic Plan Update
|
|
2403
|
-
|
|
2404
|
-
```text
|
|
2405
|
-
[After completing create-doc task for PRD]
|
|
2406
|
-
|
|
2407
|
-
✅ Plan Updated: Marked "Create PRD" as complete
|
|
2408
|
-
📍 Next step: Create Architecture Document (architect agent)
|
|
2409
|
-
```
|
|
2410
|
-
|
|
2411
|
-
## Implementation Notes
|
|
2412
|
-
|
|
2413
|
-
- This utility should be lightweight and fast
|
|
2414
|
-
- Plan parsing should be resilient to format variations
|
|
2415
|
-
- Always preserve user agency - warnings not blocks (unless strict mode)
|
|
2416
|
-
- Plan updates should be atomic to prevent corruption
|
|
2417
|
-
- Consider plan versioning for rollback capability
|
|
2418
|
-
|
|
2419
|
-
## Error Handling
|
|
2420
|
-
|
|
2421
|
-
- Missing plan: Return null, don't error
|
|
2422
|
-
- Malformed plan: Warn but continue, treat as no plan
|
|
2423
|
-
- Update failures: Log but don't block task completion
|
|
2424
|
-
- Parse errors: Fallback to basic text search
|
|
2425
|
-
==================== END: .bmad-core/utils/plan-management.md ====================
|
|
2426
|
-
|
|
2427
2201
|
==================== START: .bmad-core/utils/workflow-management.md ====================
|
|
2428
2202
|
# Workflow Management
|
|
2429
2203
|
|
|
@@ -8574,7 +8348,7 @@ To comprehensively validate a story draft before implementation begins, ensuring
|
|
|
8574
8348
|
|
|
8575
8349
|
### 0. Load Core Configuration and Inputs
|
|
8576
8350
|
|
|
8577
|
-
- Load `.bmad-core/core-config.yaml`
|
|
8351
|
+
- Load `.bmad-core/core-config.yaml`
|
|
8578
8352
|
- If the file does not exist, HALT and inform the user: "core-config.yaml not found. This file is required for story validation."
|
|
8579
8353
|
- Extract key configurations: `devStoryLocation`, `prd.*`, `architecture.*`
|
|
8580
8354
|
- Identify and load the following inputs:
|
|
@@ -9624,7 +9398,7 @@ workflow:
|
|
|
9624
9398
|
All stories implemented and reviewed!
|
|
9625
9399
|
Project development phase complete.
|
|
9626
9400
|
|
|
9627
|
-
Reference: data
|
|
9401
|
+
Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow
|
|
9628
9402
|
|
|
9629
9403
|
flow_diagram: |
|
|
9630
9404
|
```mermaid
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:
|
|
4
4
|
|
|
5
5
|
```yaml
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
|
6
|
+
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}, type=folder (tasks/templates/checklists/data/utils), name=file-name.
|
|
7
|
+
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), ALWAYS ask for clarification if no clear match.
|
|
9
8
|
activation-instructions:
|
|
10
9
|
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
|
11
10
|
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:
|
|
4
4
|
|
|
5
5
|
```yaml
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
|
6
|
+
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}, type=folder (tasks/templates/checklists/data/utils), name=file-name.
|
|
7
|
+
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), ALWAYS ask for clarification if no clear match.
|
|
9
8
|
activation-instructions:
|
|
10
9
|
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
|
11
10
|
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:
|
|
4
4
|
|
|
5
5
|
```yaml
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
|
6
|
+
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}, type=folder (tasks/templates/checklists/data/utils), name=file-name.
|
|
7
|
+
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), ALWAYS ask for clarification if no clear match.
|
|
9
8
|
activation-instructions:
|
|
10
9
|
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
|
11
10
|
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:
|
|
4
4
|
|
|
5
5
|
```yaml
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
|
6
|
+
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}, type=folder (tasks/templates/checklists/data/utils), name=file-name.
|
|
7
|
+
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), ALWAYS ask for clarification if no clear match.
|
|
9
8
|
activation-instructions:
|
|
10
9
|
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
|
11
10
|
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:
|
|
4
4
|
|
|
5
5
|
```yaml
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
|
6
|
+
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}, type=folder (tasks/templates/checklists/data/utils), name=file-name.
|
|
7
|
+
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), ALWAYS ask for clarification if no clear match.
|
|
9
8
|
activation-instructions:
|
|
10
9
|
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
|
11
10
|
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
package/package.json
CHANGED
|
@@ -47,7 +47,7 @@ class FileManager {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
async copyGlobPattern(pattern, sourceDir, destDir) {
|
|
50
|
+
async copyGlobPattern(pattern, sourceDir, destDir, rootValue = null) {
|
|
51
51
|
const files = glob.sync(pattern, { cwd: sourceDir });
|
|
52
52
|
const copied = [];
|
|
53
53
|
|
|
@@ -55,7 +55,17 @@ class FileManager {
|
|
|
55
55
|
const sourcePath = path.join(sourceDir, file);
|
|
56
56
|
const destPath = path.join(destDir, file);
|
|
57
57
|
|
|
58
|
-
if
|
|
58
|
+
// Use root replacement if rootValue is provided and file needs it
|
|
59
|
+
const needsRootReplacement = rootValue && (file.endsWith('.md') || file.endsWith('.yaml') || file.endsWith('.yml'));
|
|
60
|
+
|
|
61
|
+
let success = false;
|
|
62
|
+
if (needsRootReplacement) {
|
|
63
|
+
success = await this.copyFileWithRootReplacement(sourcePath, destPath, rootValue);
|
|
64
|
+
} else {
|
|
65
|
+
success = await this.copyFile(sourcePath, destPath);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (success) {
|
|
59
69
|
copied.push(file);
|
|
60
70
|
}
|
|
61
71
|
}
|
|
@@ -299,6 +309,71 @@ class FileManager {
|
|
|
299
309
|
return false;
|
|
300
310
|
}
|
|
301
311
|
}
|
|
312
|
+
|
|
313
|
+
async copyFileWithRootReplacement(source, destination, rootValue) {
|
|
314
|
+
try {
|
|
315
|
+
// Read the source file content
|
|
316
|
+
const fs = require('fs').promises;
|
|
317
|
+
const content = await fs.readFile(source, 'utf8');
|
|
318
|
+
|
|
319
|
+
// Replace {root} with the specified root value
|
|
320
|
+
const updatedContent = content.replace(/\{root\}/g, rootValue);
|
|
321
|
+
|
|
322
|
+
// Ensure directory exists
|
|
323
|
+
await this.ensureDirectory(path.dirname(destination));
|
|
324
|
+
|
|
325
|
+
// Write the updated content
|
|
326
|
+
await fs.writeFile(destination, updatedContent, 'utf8');
|
|
327
|
+
|
|
328
|
+
return true;
|
|
329
|
+
} catch (error) {
|
|
330
|
+
await initializeModules();
|
|
331
|
+
console.error(chalk.red(`Failed to copy ${source} with root replacement:`), error.message);
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
async copyDirectoryWithRootReplacement(source, destination, rootValue, fileExtensions = ['.md', '.yaml', '.yml']) {
|
|
337
|
+
try {
|
|
338
|
+
await initializeModules(); // Ensure chalk is initialized
|
|
339
|
+
await this.ensureDirectory(destination);
|
|
340
|
+
|
|
341
|
+
// Get all files in source directory
|
|
342
|
+
const files = glob.sync('**/*', {
|
|
343
|
+
cwd: source,
|
|
344
|
+
nodir: true
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
let replacedCount = 0;
|
|
348
|
+
|
|
349
|
+
for (const file of files) {
|
|
350
|
+
const sourcePath = path.join(source, file);
|
|
351
|
+
const destPath = path.join(destination, file);
|
|
352
|
+
|
|
353
|
+
// Check if this file type should have {root} replacement
|
|
354
|
+
const shouldReplace = fileExtensions.some(ext => file.endsWith(ext));
|
|
355
|
+
|
|
356
|
+
if (shouldReplace) {
|
|
357
|
+
if (await this.copyFileWithRootReplacement(sourcePath, destPath, rootValue)) {
|
|
358
|
+
replacedCount++;
|
|
359
|
+
}
|
|
360
|
+
} else {
|
|
361
|
+
// Regular copy for files that don't need replacement
|
|
362
|
+
await this.copyFile(sourcePath, destPath);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (replacedCount > 0) {
|
|
367
|
+
console.log(chalk.dim(` Processed ${replacedCount} files with {root} replacement`));
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return true;
|
|
371
|
+
} catch (error) {
|
|
372
|
+
await initializeModules();
|
|
373
|
+
console.error(chalk.red(`Failed to copy directory ${source} with root replacement:`), error.message);
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
302
377
|
}
|
|
303
378
|
|
|
304
379
|
module.exports = new FileManager();
|
|
@@ -244,7 +244,7 @@ class Installer {
|
|
|
244
244
|
spinner.text = "Copying complete .bmad-core folder...";
|
|
245
245
|
const sourceDir = configLoader.getBmadCorePath();
|
|
246
246
|
const bmadCoreDestDir = path.join(installDir, ".bmad-core");
|
|
247
|
-
await fileManager.
|
|
247
|
+
await fileManager.copyDirectoryWithRootReplacement(sourceDir, bmadCoreDestDir, ".bmad-core");
|
|
248
248
|
|
|
249
249
|
// Copy common/ items to .bmad-core
|
|
250
250
|
spinner.text = "Copying common utilities...";
|
|
@@ -263,7 +263,7 @@ class Installer {
|
|
|
263
263
|
// Single agent installation
|
|
264
264
|
spinner.text = `Installing ${config.agent} agent...`;
|
|
265
265
|
|
|
266
|
-
// Copy agent file
|
|
266
|
+
// Copy agent file with {root} replacement
|
|
267
267
|
const agentPath = configLoader.getAgentPath(config.agent);
|
|
268
268
|
const destAgentPath = path.join(
|
|
269
269
|
installDir,
|
|
@@ -271,7 +271,7 @@ class Installer {
|
|
|
271
271
|
"agents",
|
|
272
272
|
`${config.agent}.md`
|
|
273
273
|
);
|
|
274
|
-
await fileManager.
|
|
274
|
+
await fileManager.copyFileWithRootReplacement(agentPath, destAgentPath, ".bmad-core");
|
|
275
275
|
files.push(`.bmad-core/agents/${config.agent}.md`);
|
|
276
276
|
|
|
277
277
|
// Copy dependencies
|
|
@@ -284,15 +284,16 @@ class Installer {
|
|
|
284
284
|
spinner.text = `Copying dependency: ${dep}`;
|
|
285
285
|
|
|
286
286
|
if (dep.includes("*")) {
|
|
287
|
-
// Handle glob patterns
|
|
287
|
+
// Handle glob patterns with {root} replacement
|
|
288
288
|
const copiedFiles = await fileManager.copyGlobPattern(
|
|
289
289
|
dep.replace(".bmad-core/", ""),
|
|
290
290
|
sourceBase,
|
|
291
|
-
path.join(installDir, ".bmad-core")
|
|
291
|
+
path.join(installDir, ".bmad-core"),
|
|
292
|
+
".bmad-core"
|
|
292
293
|
);
|
|
293
294
|
files.push(...copiedFiles.map(f => `.bmad-core/${f}`));
|
|
294
295
|
} else {
|
|
295
|
-
// Handle single files
|
|
296
|
+
// Handle single files with {root} replacement if needed
|
|
296
297
|
const sourcePath = path.join(
|
|
297
298
|
sourceBase,
|
|
298
299
|
dep.replace(".bmad-core/", "")
|
|
@@ -302,7 +303,16 @@ class Installer {
|
|
|
302
303
|
dep
|
|
303
304
|
);
|
|
304
305
|
|
|
305
|
-
|
|
306
|
+
const needsRootReplacement = dep.endsWith('.md') || dep.endsWith('.yaml') || dep.endsWith('.yml');
|
|
307
|
+
let success = false;
|
|
308
|
+
|
|
309
|
+
if (needsRootReplacement) {
|
|
310
|
+
success = await fileManager.copyFileWithRootReplacement(sourcePath, destPath, ".bmad-core");
|
|
311
|
+
} else {
|
|
312
|
+
success = await fileManager.copyFile(sourcePath, destPath);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (success) {
|
|
306
316
|
files.push(dep);
|
|
307
317
|
}
|
|
308
318
|
}
|
|
@@ -325,19 +335,29 @@ class Installer {
|
|
|
325
335
|
spinner.text = `Copying team dependency: ${dep}`;
|
|
326
336
|
|
|
327
337
|
if (dep.includes("*")) {
|
|
328
|
-
// Handle glob patterns
|
|
338
|
+
// Handle glob patterns with {root} replacement
|
|
329
339
|
const copiedFiles = await fileManager.copyGlobPattern(
|
|
330
340
|
dep.replace(".bmad-core/", ""),
|
|
331
341
|
sourceBase,
|
|
332
|
-
path.join(installDir, ".bmad-core")
|
|
342
|
+
path.join(installDir, ".bmad-core"),
|
|
343
|
+
".bmad-core"
|
|
333
344
|
);
|
|
334
345
|
files.push(...copiedFiles.map(f => `.bmad-core/${f}`));
|
|
335
346
|
} else {
|
|
336
|
-
// Handle single files
|
|
347
|
+
// Handle single files with {root} replacement if needed
|
|
337
348
|
const sourcePath = path.join(sourceBase, dep.replace(".bmad-core/", ""));
|
|
338
349
|
const destPath = path.join(installDir, dep);
|
|
339
350
|
|
|
340
|
-
|
|
351
|
+
const needsRootReplacement = dep.endsWith('.md') || dep.endsWith('.yaml') || dep.endsWith('.yml');
|
|
352
|
+
let success = false;
|
|
353
|
+
|
|
354
|
+
if (needsRootReplacement) {
|
|
355
|
+
success = await fileManager.copyFileWithRootReplacement(sourcePath, destPath, ".bmad-core");
|
|
356
|
+
} else {
|
|
357
|
+
success = await fileManager.copyFile(sourcePath, destPath);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (success) {
|
|
341
361
|
files.push(dep);
|
|
342
362
|
}
|
|
343
363
|
}
|
|
@@ -1172,32 +1192,41 @@ class Installer {
|
|
|
1172
1192
|
nodir: true
|
|
1173
1193
|
});
|
|
1174
1194
|
|
|
1175
|
-
// Copy each file to the expansion pack's dot folder
|
|
1195
|
+
// Copy each file to the expansion pack's dot folder with {root} replacement
|
|
1176
1196
|
for (const file of files) {
|
|
1177
1197
|
const sourcePath = path.join(sourceFolder, file);
|
|
1178
1198
|
const destPath = path.join(expansionDotFolder, folder, file);
|
|
1179
1199
|
|
|
1180
|
-
|
|
1200
|
+
const needsRootReplacement = file.endsWith('.md') || file.endsWith('.yaml') || file.endsWith('.yml');
|
|
1201
|
+
let success = false;
|
|
1202
|
+
|
|
1203
|
+
if (needsRootReplacement) {
|
|
1204
|
+
success = await fileManager.copyFileWithRootReplacement(sourcePath, destPath, `.${packId}`);
|
|
1205
|
+
} else {
|
|
1206
|
+
success = await fileManager.copyFile(sourcePath, destPath);
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
if (success) {
|
|
1181
1210
|
installedFiles.push(path.join(`.${packId}`, folder, file));
|
|
1182
1211
|
}
|
|
1183
1212
|
}
|
|
1184
1213
|
}
|
|
1185
1214
|
}
|
|
1186
1215
|
|
|
1187
|
-
// Copy config.yaml
|
|
1216
|
+
// Copy config.yaml with {root} replacement
|
|
1188
1217
|
const configPath = path.join(expansionPackDir, 'config.yaml');
|
|
1189
1218
|
if (await fileManager.pathExists(configPath)) {
|
|
1190
1219
|
const configDestPath = path.join(expansionDotFolder, 'config.yaml');
|
|
1191
|
-
if (await fileManager.
|
|
1220
|
+
if (await fileManager.copyFileWithRootReplacement(configPath, configDestPath, `.${packId}`)) {
|
|
1192
1221
|
installedFiles.push(path.join(`.${packId}`, 'config.yaml'));
|
|
1193
1222
|
}
|
|
1194
1223
|
}
|
|
1195
1224
|
|
|
1196
|
-
// Copy README if it exists
|
|
1225
|
+
// Copy README if it exists with {root} replacement
|
|
1197
1226
|
const readmePath = path.join(expansionPackDir, 'README.md');
|
|
1198
1227
|
if (await fileManager.pathExists(readmePath)) {
|
|
1199
1228
|
const readmeDestPath = path.join(expansionDotFolder, 'README.md');
|
|
1200
|
-
if (await fileManager.
|
|
1229
|
+
if (await fileManager.copyFileWithRootReplacement(readmePath, readmeDestPath, `.${packId}`)) {
|
|
1201
1230
|
installedFiles.push(path.join(`.${packId}`, 'README.md'));
|
|
1202
1231
|
}
|
|
1203
1232
|
}
|
|
@@ -1258,7 +1287,7 @@ class Installer {
|
|
|
1258
1287
|
const yamlContent = extractYamlFromAgent(agentContent);
|
|
1259
1288
|
if (yamlContent) {
|
|
1260
1289
|
try {
|
|
1261
|
-
const agentConfig = yaml.
|
|
1290
|
+
const agentConfig = yaml.load(yamlContent);
|
|
1262
1291
|
const dependencies = agentConfig.dependencies || {};
|
|
1263
1292
|
|
|
1264
1293
|
// Check for core dependencies (those that don't exist in the expansion pack)
|
|
@@ -1277,9 +1306,9 @@ class Installer {
|
|
|
1277
1306
|
if (await fileManager.pathExists(coreDepPath)) {
|
|
1278
1307
|
spinner.text = `Copying core dependency ${dep} for ${packId}...`;
|
|
1279
1308
|
|
|
1280
|
-
// Copy from core to expansion pack dot folder
|
|
1309
|
+
// Copy from core to expansion pack dot folder with {root} replacement
|
|
1281
1310
|
const destPath = path.join(expansionDotFolder, depType, depFileName);
|
|
1282
|
-
await fileManager.
|
|
1311
|
+
await fileManager.copyFileWithRootReplacement(coreDepPath, destPath, `.${packId}`);
|
|
1283
1312
|
|
|
1284
1313
|
console.log(chalk.dim(` Added core dependency: ${depType}/${depFileName}`));
|
|
1285
1314
|
} else {
|
|
@@ -1321,7 +1350,7 @@ class Installer {
|
|
|
1321
1350
|
const teamContent = await fs.readFile(teamPath, 'utf8');
|
|
1322
1351
|
|
|
1323
1352
|
try {
|
|
1324
|
-
const teamConfig = yaml.
|
|
1353
|
+
const teamConfig = yaml.load(teamContent);
|
|
1325
1354
|
const agents = teamConfig.agents || [];
|
|
1326
1355
|
|
|
1327
1356
|
// Add bmad-orchestrator if not present (required for all teams)
|
|
@@ -1338,9 +1367,9 @@ class Installer {
|
|
|
1338
1367
|
if (await fileManager.pathExists(coreAgentPath)) {
|
|
1339
1368
|
spinner.text = `Copying core agent ${agentId} for ${packId}...`;
|
|
1340
1369
|
|
|
1341
|
-
// Copy agent file
|
|
1370
|
+
// Copy agent file with {root} replacement
|
|
1342
1371
|
const destPath = path.join(expansionDotFolder, 'agents', `${agentId}.md`);
|
|
1343
|
-
await fileManager.
|
|
1372
|
+
await fileManager.copyFileWithRootReplacement(coreAgentPath, destPath, `.${packId}`);
|
|
1344
1373
|
existingAgents.add(agentId);
|
|
1345
1374
|
|
|
1346
1375
|
console.log(chalk.dim(` Added core agent: ${agentId}`));
|
|
@@ -1352,7 +1381,7 @@ class Installer {
|
|
|
1352
1381
|
if (yamlContent) {
|
|
1353
1382
|
try {
|
|
1354
1383
|
|
|
1355
|
-
const agentConfig = yaml.
|
|
1384
|
+
const agentConfig = yaml.load(yamlContent);
|
|
1356
1385
|
const dependencies = agentConfig.dependencies || {};
|
|
1357
1386
|
|
|
1358
1387
|
// Copy all dependencies for this agent
|
|
@@ -1370,7 +1399,7 @@ class Installer {
|
|
|
1370
1399
|
|
|
1371
1400
|
if (await fileManager.pathExists(coreDepPath)) {
|
|
1372
1401
|
const destDepPath = path.join(expansionDotFolder, depType, depFileName);
|
|
1373
|
-
await fileManager.
|
|
1402
|
+
await fileManager.copyFileWithRootReplacement(coreDepPath, destDepPath, `.${packId}`);
|
|
1374
1403
|
console.log(chalk.dim(` Added agent dependency: ${depType}/${depFileName}`));
|
|
1375
1404
|
} else {
|
|
1376
1405
|
// Try common folder
|