feat: add monorepo support with dynamic project context

This commit is contained in:
sno 2026-02-17 19:37:06 +01:00
parent 1198c8b9b7
commit 0f37258d5c
24 changed files with 252 additions and 19 deletions

60
.github/copilot-instructions.md vendored Normal file
View File

@ -0,0 +1,60 @@
<!-- BMAD:START -->
# BMAD Method — Project Instructions
## Project Configuration
- **Project**: snowmain1
- **User**: Sergey
- **Communication Language**: English
- **Document Output Language**: English
- **User Skill Level**: expert
- **Output Folder**: {project-root}/\_bmad-output/{context} (Dynamic)
- **Planning Artifacts**: {project-root}/\_bmad-output/{context}/planning-artifacts
- **Implementation Artifacts**: {project-root}/\_bmad-output/{context}/implementation-artifacts
- **Project Knowledge**: {project-root}/docs
## BMAD Runtime Structure
- **Agent definitions**: `_bmad/bmm/agents/` (BMM module) and `_bmad/core/agents/` (core)
- **Workflow definitions**: `_bmad/bmm/workflows/` (organized by phase)
- **Core tasks**: `_bmad/core/tasks/` (help, editorial review, indexing, sharding, adversarial review)
- **Core workflows**: `_bmad/core/workflows/` (brainstorming, party-mode, advanced-elicitation)
- **Workflow engine**: `_bmad/core/tasks/workflow.xml` (executes YAML-based workflows)
- **Module configuration**: `_bmad/bmm/config.yaml`
- **Core configuration**: `_bmad/core/config.yaml`
- **Agent manifest**: `_bmad/_config/agent-manifest.csv`
- **Workflow manifest**: `_bmad/_config/workflow-manifest.csv`
- **Help manifest**: `_bmad/_config/bmad-help.csv`
- **Agent memory**: `_bmad/_memory/`
## Key Conventions
- Always load `_bmad/bmm/config.yaml` before any agent activation or workflow execution
- Store all config fields as session variables: `{user_name}`, `{communication_language}`, `{output_folder}`, `{planning_artifacts}`, `{implementation_artifacts}`, `{project_knowledge}`
- MD-based workflows execute directly — load and follow the `.md` file
- YAML-based workflows require the workflow engine — load `workflow.xml` first, then pass the `.yaml` config
- Follow step-based workflow execution: load steps JIT, never multiple at once
- Save outputs after EACH step when using the workflow engine
- The `{project-root}` variable resolves to the workspace root at runtime
## Available Agents
| Agent | Persona | Title | Capabilities |
| ------------------- | ----------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| bmad-master | BMad Master | BMad Master Executor, Knowledge Custodian, and Workflow Orchestrator | runtime resource management, workflow orchestration, task execution, knowledge custodian |
| analyst | Mary | Business Analyst | market research, competitive analysis, requirements elicitation, domain expertise |
| architect | Winston | Architect | distributed systems, cloud infrastructure, API design, scalable patterns |
| dev | Amelia | Developer Agent | story execution, test-driven development, code implementation |
| pm | John | Product Manager | PRD creation, requirements discovery, stakeholder alignment, user interviews |
| qa | Quinn | QA Engineer | test automation, API testing, E2E testing, coverage analysis |
| quick-flow-solo-dev | Barry | Quick Flow Solo Dev | rapid spec creation, lean implementation, minimum ceremony |
| sm | Bob | Scrum Master | sprint planning, story preparation, agile ceremonies, backlog management |
| tech-writer | Paige | Technical Writer | documentation, Mermaid diagrams, standards compliance, concept explanation |
| ux-designer | Sally | UX Designer | user research, interaction design, UI patterns, experience strategy |
## Slash Commands
Type `/bmad-` in Copilot Chat to see all available BMAD workflows and agent activators. Agents are also available in the agents dropdown.
<!-- BMAD:END -->

View File

@ -28,4 +28,5 @@ bmm,4-implementation,Create Story,CS,30,_bmad/bmm/workflows/4-implementation/cre
bmm,4-implementation,Dev Story,DS,40,_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml,bmad-bmm-dev-story,true,dev,Create Mode,"Story cycle: Execute story implementation tasks and tests then CR then back to DS if fixes needed",,,
bmm,4-implementation,Code Review,CR,50,_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml,bmad-bmm-code-review,false,dev,Create Mode,"Story cycle: If issues back to DS if approved then next CS or ER if epic complete",,,
bmm,4-implementation,QA Automation Test,QA,45,_bmad/bmm/workflows/qa/automate/workflow.yaml,bmad-bmm-qa-automate,false,qa,Create Mode,"Generate automated API and E2E tests for implemented code using the project's existing test framework (detects existing well known in use test frameworks). Use after implementation to add test coverage. NOT for code review or story validation - use CR for that.",implementation_artifacts,"test suite",
bmm,anytime,Set Project,SPJ,05,_bmad/bmm/workflows/0-context/set-project/workflow.md,bmad-set-project,false,bmad-master,Anytime,"Set or clear the current project context for monorepo support.",_bmad,.current_project,
bmm,4-implementation,Retrospective,ER,60,_bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml,bmad-bmm-retrospective,false,sm,Create Mode,"Optional at epic end: Review completed work lessons learned and next epic or if major issues consider CC",implementation_artifacts,retrospective,

1 module phase name code sequence workflow-file command required agent options description output-location outputs
28 bmm 4-implementation Dev Story DS 40 _bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml bmad-bmm-dev-story true dev Create Mode Story cycle: Execute story implementation tasks and tests then CR then back to DS if fixes needed
29 bmm 4-implementation Code Review CR 50 _bmad/bmm/workflows/4-implementation/code-review/workflow.yaml bmad-bmm-code-review false dev Create Mode Story cycle: If issues back to DS if approved then next CS or ER if epic complete
30 bmm 4-implementation QA Automation Test QA 45 _bmad/bmm/workflows/qa/automate/workflow.yaml bmad-bmm-qa-automate false qa Create Mode Generate automated API and E2E tests for implemented code using the project's existing test framework (detects existing well known in use test frameworks). Use after implementation to add test coverage. NOT for code review or story validation - use CR for that. implementation_artifacts test suite
31 bmm anytime Set Project SPJ 05 _bmad/bmm/workflows/0-context/set-project/workflow.md bmad-set-project false bmad-master Anytime Set or clear the current project context for monorepo support. _bmad .current_project
32 bmm 4-implementation Retrospective ER 60 _bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml bmad-bmm-retrospective false sm Create Mode Optional at epic end: Review completed work lessons learned and next epic or if major issues consider CC implementation_artifacts retrospective

View File

@ -0,0 +1,36 @@
---
name: set-project
description: Set the current project context for monorepo support
main_config: '{project-root}/_bmad/bmm/config.yaml'
---
# Set Project Context
**Goal:** Configure the active project path for BMAD artifacts.
**Your Role:** Configuration Assistant.
## WORKFLOW ARCHITECTURE
This is a single-step workflow that updates a local state file.
### 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
### 2. Context Management
1. **Ask User:** "Please enter the **project name** or path relative to `_bmad-output/` (e.g. `project-name` or `libs/auth-lib`). Enter `CLEAR` to reset to root."
2. **Wait for Input.**
3. **Process Input:**
- **Case: CLEAR**:
- Delete file: `_bmad/.current_project`
- Output: "✅ Project context cleared. Artifacts will go to root `_bmad-output/`."
- **Case: Path Provided**:
- **Sanitize:** Remove leading `/` or `_bmad-output/` if present in the input.
- Write file: `_bmad/.current_project` with content `<sanitized_path>`
- Output: "✅ Project context set to: `<sanitized_path>`. Artifacts will go to `_bmad-output/<sanitized_path>/`."
### 3. Verification
- Display the full resolved output path for confirmation.

View File

@ -48,7 +48,12 @@ This uses **step-file architecture** for disciplined execution:
### 1. Configuration Loading
Load and read full config from {project-root}/_bmad/bmm/config.yaml and resolve:
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project` exists.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
- `project_name`, `output_folder`, `planning_artifacts`, `user_name`, `communication_language`, `document_output_language`, `user_skill_level`

View File

@ -15,7 +15,15 @@ description: Conduct domain research covering industry analysis, regulations, te
## CONFIGURATION
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
### 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project` exists.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
- `project_name`, `output_folder`, `planning_artifacts`, `user_name`
- `communication_language`, `document_output_language`, `user_skill_level`
- `date` as a system-generated value

View File

@ -15,7 +15,15 @@ description: Conduct market research covering market size, growth, competition,
## CONFIGURATION
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
### 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project exists`.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
- `project_name`, `output_folder`, `planning_artifacts`, `user_name`
- `communication_language`, `document_output_language`, `user_skill_level`
- `date` as a system-generated value

View File

@ -15,6 +15,15 @@ description: Conduct technical research covering technology evaluation, architec
## CONFIGURATION
### 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project` exists.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
- `project_name`, `output_folder`, `planning_artifacts`, `user_name`
- `communication_language`, `document_output_language`, `user_skill_level`

View File

@ -48,7 +48,12 @@ This uses **step-file architecture** for disciplined execution:
### 1. Configuration Loading
Load and read full config from {main_config} and resolve:
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project` exists.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
- `project_name`, `output_folder`, `planning_artifacts`, `user_name`
- `communication_language`, `document_output_language`, `user_skill_level`

View File

@ -48,8 +48,12 @@ This uses **step-file architecture** for disciplined execution:
### 1. Configuration Loading
Load and read full config from {main_config} and resolve:
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project` exists.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
- `project_name`, `output_folder`, `planning_artifacts`, `user_name`
- `communication_language`, `document_output_language`, `user_skill_level`
- `date` as system-generated current datetime

View File

@ -48,7 +48,12 @@ This uses **step-file architecture** for disciplined execution:
### 1. Configuration Loading
Load and read full config from {main_config} and resolve:
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project` exists.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
- `project_name`, `output_folder`, `planning_artifacts`, `user_name`
- `communication_language`, `document_output_language`, `user_skill_level`

View File

@ -22,9 +22,14 @@ This uses **micro-file architecture** for disciplined execution:
## INITIALIZATION
### Configuration Loading
### 1. Configuration Loading
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project exists`.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
- `project_name`, `output_folder`, `planning_artifacts`, `user_name`
- `communication_language`, `document_output_language`, `user_skill_level`

View File

@ -25,7 +25,14 @@ This uses **micro-file architecture** for disciplined execution:
## INITIALIZATION
### Configuration Loading
### 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project` exists.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:

View File

@ -16,6 +16,11 @@
<step n="1" goal="Load story and discover changes">
<check if="_bmad/.current_project exists">
<action>Read content as project_suffix</action>
<action>Override output_folder to {project-root}/_bmad-output/{project_suffix}</action>
</check>
<action>Use provided {{story_path}} or ask user which story file to review</action>
<action>Read COMPLETE story file</action>
<action>Set {{story_key}} = extracted key from filename (e.g., "1-2-user-authentication.md" → "1-2-user-authentication") or story
@ -41,6 +46,7 @@
<invoke-protocol name="discover_inputs" />
<action>Load {project_context} for coding standards (if exists)</action>
</step>
<step n="2" goal="Build review attack plan">

View File

@ -18,6 +18,11 @@
<critical>🎯 ZERO USER INTERVENTION: Process should be fully automated except for initial epic/story selection or missing documents</critical>
<step n="1" goal="Determine target story">
<check if="_bmad/.current_project exists">
<action>Read content as project_suffix</action>
<action>Override output_folder to {project-root}/_bmad-output/{project_suffix}</action>
</check>
<check if="{{story_path}} is provided by user or user provided the epic and story number such as 2-4 or 1.6 or epic 1 story 5">
<action>Parse user-provided story path: extract epic_num, story_num, story_title from format like "1-2-user-auth"</action>
<action>Set {{epic_num}}, {{story_num}}, {{story_key}} from user input</action>

View File

@ -13,6 +13,11 @@
<critical>User skill level ({user_skill_level}) affects conversation style ONLY, not code updates.</critical>
<step n="1" goal="Find next ready story and load it" tag="sprint-status">
<check if="_bmad/.current_project exists">
<action>Read content as project_suffix</action>
<action>Override output_folder to {project-root}/_bmad-output/{project_suffix}</action>
</check>
<check if="{{story_path}} is provided">
<action>Use {{story_path}} directly</action>
<action>Read COMPLETE story file</action>
@ -376,8 +381,6 @@
<action>Communicate to {user_name} that story implementation is complete and ready for review</action>
<action>Summarize key accomplishments: story ID, story key, title, key changes made, tests added, files modified</action>
<action>Provide the story file path and current status (now "review")</action>
<action>Based on {user_skill_level}, ask if user needs any explanations about:
- What was implemented and how it works
- Why certain technical decisions were made

View File

@ -1,7 +1,17 @@
# Retrospective - Epic Completion Review Instructions
<critical>The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {project-root}/_bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
## 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project exists`.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
<critical>Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level}</critical>
<critical>Generate all documents in {document_output_language}</critical>
<critical>⚠️ ABSOLUTELY NO TIME ESTIMATES - NEVER mention hours, days, weeks, months, or ANY time-based predictions. AI has fundamentally changed development speed - what once took teams weeks/months can now be done by one person in hours. DO NOT give ANY time estimates whatsoever.</critical>

View File

@ -3,7 +3,17 @@
<critical>The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml</critical>
## 📚 Document Discovery - Full Epic Loading
## 📚 Document Discovery
### 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project exists`.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
- Full Epic Loading
**Strategy**: Sprint planning needs ALL epics and stories to build complete status tracking.

View File

@ -1,6 +1,15 @@
# Sprint Status - Multi-Mode Service
<critical>The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml</critical>
## 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project exists`.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
<critical>You MUST have already loaded and processed: {project-root}/_bmad/bmm/workflows/4-implementation/sprint-status/workflow.yaml</critical>
<critical>Modes: interactive (default), validate, data</critical>
<critical>⚠️ ABSOLUTELY NO TIME ESTIMATES. Do NOT mention hours, days, weeks, or timelines.</critical>

View File

@ -23,7 +23,14 @@ This uses **step-file architecture** for focused execution:
## INITIALIZATION
### Configuration Loading
### 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project exists`.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:

View File

@ -66,8 +66,14 @@ This uses **step-file architecture** for disciplined execution:
### 1. Configuration Loading
Load and read full config from `{main_config}` and resolve:
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project exists`.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
- `project_name`, `planning_artifacts`, `implementation_artifacts`, `user_name`
- `communication_language`, `document_output_language`, `user_skill_level`
- `date` as system-generated current datetime

View File

@ -25,7 +25,14 @@ This uses **micro-file architecture** for disciplined execution:
## INITIALIZATION
### Configuration Loading
### 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project exists`.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:

View File

@ -20,6 +20,11 @@
<flow>
<step n="1" title="Method Registry Loading">
<check if="_bmad/.current_project exists">
<action>Read content as project_suffix</action>
<action>Override output_folder to {project-root}/_bmad-output/{project_suffix}</action>
</check>
<action>Load and read {{methods}} and {{agent-party}}</action>
<csv-structure>

View File

@ -32,7 +32,14 @@ This uses **micro-file architecture** for disciplined execution:
## INITIALIZATION
### Configuration Loading
### 1. Configuration Loading
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project` exists.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
Load config from `{project-root}/_bmad/core/config.yaml` and resolve:

View File

@ -25,9 +25,14 @@ This uses **micro-file architecture** with **sequential conversation orchestrati
## INITIALIZATION
### Configuration Loading
### 1. Configuration Loading
Load config from `{project-root}/_bmad/core/config.yaml` and resolve:
Load and read full config from {main_config} and resolve basic variables.
**Monorepo Context Check:**
1. Check if `_bmad/.current_project` exists.
2. If it exists, read its content as `{project_suffix}` and override output folder:
- `output_folder`: `{project-root}/_bmad-output/{project_suffix}`
- `project_name`, `output_folder`, `user_name`
- `communication_language`, `document_output_language`, `user_skill_level`