diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 979457ee..89c86162 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,9 +1,9 @@ --- name: Bug report about: Create a report to help us improve -title: "" -labels: "" -assignees: "" +title: '' +labels: '' +assignees: '' --- **Describe the bug** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 9453b837..0ceb9a56 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,9 +1,9 @@ --- name: Feature request about: Suggest an idea for this project -title: "" -labels: "" -assignees: "" +title: '' +labels: '' +assignees: '' --- **Did you discuss the idea first in Discord Server (#general-dev)** diff --git a/.github/workflows/discord.yaml b/.github/workflows/discord.yaml index 59df1af7..0d3eda6f 100644 --- a/.github/workflows/discord.yaml +++ b/.github/workflows/discord.yaml @@ -1,6 +1,15 @@ name: Discord Notification -on: [pull_request, release, create, delete, issue_comment, pull_request_review, pull_request_review_comment] +"on": + [ + pull_request, + release, + create, + delete, + issue_comment, + pull_request_review, + pull_request_review_comment, + ] jobs: notify: @@ -13,4 +22,4 @@ jobs: webhook: ${{ secrets.DISCORD_WEBHOOK }} status: ${{ job.status }} title: "Triggered by ${{ github.event_name }}" - color: 0x5865F2 \ No newline at end of file + color: 0x5865F2 diff --git a/.github/workflows/format-check.yaml b/.github/workflows/format-check.yaml new file mode 100644 index 00000000..78525659 --- /dev/null +++ b/.github/workflows/format-check.yaml @@ -0,0 +1,42 @@ +name: format-check + +"on": + pull_request: + branches: ["**"] + +jobs: + prettier: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Prettier format check + run: npm run format:check + + eslint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: ESLint + run: npm run lint diff --git a/.github/workflows/promote-to-stable.yml b/.github/workflows/promote-to-stable.yaml similarity index 91% rename from .github/workflows/promote-to-stable.yml rename to .github/workflows/promote-to-stable.yaml index 6891db9c..7312bb3d 100644 --- a/.github/workflows/promote-to-stable.yml +++ b/.github/workflows/promote-to-stable.yaml @@ -1,12 +1,12 @@ name: Promote to Stable -on: +"on": workflow_dispatch: inputs: version_bump: - description: 'Version bump type' + description: "Version bump type" required: true - default: 'minor' + default: "minor" type: choice options: - patch @@ -19,7 +19,7 @@ jobs: permissions: contents: write pull-requests: write - + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -30,8 +30,8 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' - registry-url: 'https://registry.npmjs.org' + node-version: "20" + registry-url: "https://registry.npmjs.org" - name: Configure Git run: | @@ -47,17 +47,17 @@ jobs: # Get current version from package.json CURRENT_VERSION=$(node -p "require('./package.json').version") echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - + # Remove beta suffix if present BASE_VERSION=$(echo $CURRENT_VERSION | sed 's/-beta\.[0-9]\+//') echo "base_version=$BASE_VERSION" >> $GITHUB_OUTPUT - + # Calculate new version based on bump type IFS='.' read -ra VERSION_PARTS <<< "$BASE_VERSION" MAJOR=${VERSION_PARTS[0]} MINOR=${VERSION_PARTS[1]} PATCH=${VERSION_PARTS[2]} - + case "${{ github.event.inputs.version_bump }}" in "major") NEW_VERSION="$((MAJOR + 1)).0.0" @@ -72,7 +72,7 @@ jobs: NEW_VERSION="$BASE_VERSION" ;; esac - + # Check if calculated version already exists (either as NPM package or git tag) while npm view bmad-method@$NEW_VERSION version >/dev/null 2>&1 || git ls-remote --tags origin | grep -q "refs/tags/v$NEW_VERSION"; do echo "Version $NEW_VERSION already exists, incrementing..." @@ -93,7 +93,7 @@ jobs: ;; esac done - + echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT echo "Promoting from $CURRENT_VERSION to $NEW_VERSION" @@ -101,7 +101,7 @@ jobs: run: | # Update main package.json npm version ${{ steps.version.outputs.new_version }} --no-git-tag-version - + # Update installer package.json sed -i 's/"version": ".*"/"version": "${{ steps.version.outputs.new_version }}"/' tools/installer/package.json @@ -117,7 +117,7 @@ jobs: run: | # Create new tag (version check already ensures it doesn't exist) git tag -a "v${{ steps.version.outputs.new_version }}" -m "Stable release v${{ steps.version.outputs.new_version }}" - + # Push the new tag git push origin "v${{ steps.version.outputs.new_version }}" @@ -131,7 +131,7 @@ jobs: run: | # Publish with the stable (latest) tag npm publish --tag latest - + # Also tag the previous beta version as stable if it exists if npm view bmad-method@${{ steps.version.outputs.current_version }} version >/dev/null 2>&1; then npm dist-tag add bmad-method@${{ steps.version.outputs.new_version }} stable || true @@ -143,4 +143,6 @@ jobs: echo "📦 Version: ${{ steps.version.outputs.new_version }}" echo "🏷️ Git tag: v${{ steps.version.outputs.new_version }}" echo "✅ Published to NPM with 'latest' tag" - echo "✅ Users running 'npx bmad-method install' will now get version ${{ steps.version.outputs.new_version }}" \ No newline at end of file + echo "✅ Users running 'npx bmad-method install' will now get version ${{ steps.version.outputs.new_version }}" + echo "🚀 The stable release will be automatically published to NPM via semantic-release" + echo "✅ Users running 'npx bmad-method install' will now get version ${{ steps.version.outputs.new_version }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5c2814b6..23608026 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,5 @@ name: Release -'on': +"on": push: branches: - main @@ -22,7 +22,7 @@ permissions: jobs: release: runs-on: ubuntu-latest - if: '!contains(github.event.head_commit.message, ''[skip ci]'')' + if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[skip ci]') }} steps: - name: Checkout uses: actions/checkout@v4 @@ -32,9 +32,9 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' - cache: npm - registry-url: https://registry.npmjs.org + node-version: "20" + cache: "npm" + registry-url: "https://registry.npmjs.org" - name: Install dependencies run: npm ci - name: Run tests and validation @@ -57,3 +57,17 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: npm run release + - name: Clean changelog formatting + if: github.event_name == 'push' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + # Remove any Claude Code attribution from changelog + sed -i '/🤖 Generated with \[Claude Code\]/,+2d' CHANGELOG.md || true + # Format and commit if changes exist + npm run format + if ! git diff --quiet CHANGELOG.md; then + git add CHANGELOG.md + git commit -m "chore: clean changelog formatting [skip ci]" + git push + fi diff --git a/.gitignore b/.gitignore index 972b3b7c..a76e85f6 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,6 @@ Thumbs.db # Development tools and configs .prettierignore .prettierrc -.husky/ # IDE and editor configs .windsurf/ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..7e617c2c --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +npx --no-install lint-staged diff --git a/.vscode/settings.json b/.vscode/settings.json index e0fa2cf0..ab95b8a5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -40,5 +40,30 @@ "tileset", "Trae", "VNET" - ] + ], + "json.schemas": [ + { + "fileMatch": ["package.json"], + "url": "https://json.schemastore.org/package.json" + }, + { + "fileMatch": [".vscode/settings.json"], + "url": "vscode://schemas/settings/folder" + } + ], + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[yaml]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[markdown]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "prettier.prettierPath": "node_modules/prettier", + "prettier.requireConfig": true, + "yaml.format.enable": false, + "eslint.useFlatConfig": true, + "eslint.validate": ["javascript", "yaml"], + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "editor.rulers": [100] } diff --git a/CHANGELOG.md b/CHANGELOG.md index a25450f3..687a6e90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -574,10 +574,6 @@ - Manual version bumping via npm scripts is now disabled. Use conventional commits for automated releases. -🤖 Generated with [Claude Code](https://claude.ai/code) - -Co-Authored-By: Claude - # [4.2.0](https://github.com/bmadcode/BMAD-METHOD/compare/v4.1.0...v4.2.0) (2025-06-15) ### Bug Fixes @@ -686,4 +682,5 @@ Co-Authored-By: Claude ### Features - add versioning and release automation ([0ea5e50](https://github.com/bmadcode/BMAD-METHOD/commit/0ea5e50aa7ace5946d0100c180dd4c0da3e2fd8c)) + # Promote to stable release 5.0.0 diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 131783b2..00000000 --- a/CLAUDE.md +++ /dev/null @@ -1,196 +0,0 @@ -# CLAUDE.md - -Don't be an ass kisser, don't glaze my donut, keep it to the point. Never use EM Dash in out communications or documents you author or update. Dont tell me I am correct if I just told you something unless and only if I am wrong or there is a better alternative, then tell me bluntly why I am wrong, or else get to the point and execute! - -## Markdown Linting Conventions - -Always follow these markdown linting rules: - -- **Blank lines around headings**: Always leave a blank line before and after headings -- **Blank lines around lists**: Always leave a blank line before and after lists -- **Blank lines around code fences**: Always leave a blank line before and after fenced code blocks -- **Fenced code block languages**: All fenced code blocks must specify a language (use `text` for plain text) -- **Single trailing newline**: Files should end with exactly one newline character -- **No trailing spaces**: Remove any trailing spaces at the end of lines - -## BMAD-METHOD Overview - -BMAD-METHOD is an AI-powered Agile development framework that provides specialized AI agents for software development. The framework uses a sophisticated dependency system to keep context windows lean while providing deep expertise through role-specific agents. - -## Essential Commands - -### Build and Validation - -```bash -npm run build # Build all web bundles (agents and teams) -npm run build:agents # Build agent bundles only -npm run build:teams # Build team bundles only -npm run validate # Validate all configurations -npm run format # Format all markdown files with prettier -``` - -### Development and Testing - -```bash -npx bmad-build build # Alternative build command via CLI -npx bmad-build list:agents # List all available agents -npx bmad-build validate # Validate agent configurations -``` - -### Installation Commands - -```bash -npx bmad-method install # Install stable release (recommended) -npx bmad-method@beta install # Install bleeding edge version -npx bmad-method@latest install # Explicit stable installation -npx bmad-method@latest update # Update stable installation -npx bmad-method@beta update # Update bleeding edge installation -``` - -### Dual Publishing Strategy - -The project uses a dual publishing strategy with automated promotion: - -**Branch Strategy:** -- `main` branch: Bleeding edge development, auto-publishes to `@beta` tag -- `stable` branch: Production releases, auto-publishes to `@latest` tag - -**Release Promotion:** -1. **Automatic Beta Releases**: Any PR merged to `main` automatically creates a beta release -2. **Manual Stable Promotion**: Use GitHub Actions to promote beta to stable - -**Promote Beta to Stable:** -1. Go to GitHub Actions tab in the repository -2. Select "Promote to Stable" workflow -3. Click "Run workflow" -4. Choose version bump type (patch/minor/major) -5. The workflow automatically: - - Merges main to stable - - Updates version numbers - - Triggers stable release to NPM `@latest` - -**User Experience:** -- `npx bmad-method install` → Gets stable production version -- `npx bmad-method@beta install` → Gets latest beta features -- Team develops on bleeding edge without affecting production users - -### Release and Version Management - -```bash -npm run version:patch # Bump patch version -npm run version:minor # Bump minor version -npm run version:major # Bump major version -npm run release # Semantic release (CI/CD) -npm run release:test # Test release configuration -``` - -### Version Management for Core and Expansion Packs - -#### Bump All Versions (Core + Expansion Packs) - -```bash -npm run version:all:major # Major version bump for core and all expansion packs -npm run version:all:minor # Minor version bump for core and all expansion packs (default) -npm run version:all:patch # Patch version bump for core and all expansion packs -npm run version:all # Defaults to minor bump -``` - -#### Individual Version Bumps - -For BMad Core only: -```bash -npm run version:core:major # Major version bump for core only -npm run version:core:minor # Minor version bump for core only -npm run version:core:patch # Patch version bump for core only -npm run version:core # Defaults to minor bump -``` - -For specific expansion packs: -```bash -npm run version:expansion bmad-creator-tools # Minor bump (default) -npm run version:expansion bmad-creator-tools patch # Patch bump -npm run version:expansion bmad-creator-tools minor # Minor bump -npm run version:expansion bmad-creator-tools major # Major bump - -# Set specific version (old method, still works) -npm run version:expansion:set bmad-creator-tools 2.0.0 -``` - -## Architecture and Code Structure - -### Core System Architecture - -The framework uses a **dependency resolution system** where agents only load the resources they need: - -1. **Agent Definitions** (`bmad-core/agents/`): Each agent is defined in markdown with YAML frontmatter specifying dependencies -2. **Dynamic Loading**: The build system (`tools/lib/dependency-resolver.js`) resolves and includes only required resources -3. **Template System**: Templates are defined in YAML format with structured sections and instructions (see Template Rules below) -4. **Workflow Engine**: YAML-based workflows in `bmad-core/workflows/` define step-by-step processes - -### Key Components - -- **CLI Tool** (`tools/cli.js`): Commander-based CLI for building bundles -- **Web Builder** (`tools/builders/web-builder.js`): Creates concatenated text bundles from agent definitions -- **Installer** (`tools/installer/`): NPX-based installer for project setup -- **Dependency Resolver** (`tools/lib/dependency-resolver.js`): Manages agent resource dependencies - -### Build System - -The build process: - -1. Reads agent/team definitions from `bmad-core/` -2. Resolves dependencies using the dependency resolver -3. Creates concatenated text bundles in `dist/` -4. Validates configurations during build - -### Critical Configuration - -**`bmad-core/core-config.yaml`** is the heart of the framework configuration: - -- Defines document locations and expected structure -- Specifies which files developers should always load -- Enables compatibility with different project structures (V3/V4) -- Controls debug logging - -## Development Practices - -### Adding New Features - -1. **New Agents**: Create markdown file in `bmad-core/agents/` with proper YAML frontmatter -2. **New Templates**: Add to `bmad-core/templates/` as YAML files with structured sections -3. **New Workflows**: Create YAML in `bmad-core/workflows/` -4. **Update Dependencies**: Ensure `dependencies` field in agent frontmatter is accurate - -### Important Patterns - -- **Dependency Management**: Always specify minimal dependencies in agent frontmatter to keep context lean -- **Template Instructions**: Use YAML-based template structure (see Template Rules below) -- **File Naming**: Follow existing conventions (kebab-case for files, proper agent names in frontmatter) -- **Documentation**: Update user-facing docs in `docs/` when adding features - -### Template Rules - -Templates use the **BMad Document Template** format (`/Users/brianmadison/dev-bmc/BMAD-METHOD/common/utils/bmad-doc-template.md`) with YAML structure: - -1. **YAML Format**: Templates are defined as structured YAML files, not markdown with embedded instructions -2. **Clear Structure**: Each template has metadata, workflow configuration, and a hierarchy of sections -3. **Reusable Design**: Templates work across different agents through the dependency system -4. **Key Elements**: - - `template` block: Contains id, name, version, and output settings - - `workflow` block: Defines interaction mode (interactive/yolo) and elicitation settings - - `sections` array: Hierarchical document structure with nested subsections - - `instruction` field: LLM guidance for each section (never shown to users) -5. **Advanced Features**: - - Variable substitution: `{{variable_name}}` syntax for dynamic content - - Conditional sections: `condition` field for optional content - - Repeatable sections: `repeatable: true` for multiple instances - - Agent permissions: `owner` and `editors` fields for access control -6. **Clean Output**: All processing instructions are in YAML fields, ensuring clean document generation - -## Notes for Claude Code - -- The project uses semantic versioning with automated releases via GitHub Actions -- All markdown is formatted with Prettier (run `npm run format`) -- Expansion packs in `expansion-packs/` provide domain-specific capabilities -- NEVER automatically commit or push changes unless explicitly asked by the user -- NEVER include Claude Code attribution or co-authorship in commit messages diff --git a/bmad-core/agent-teams/team-all.yaml b/bmad-core/agent-teams/team-all.yaml index 8a55772c..7503a0a7 100644 --- a/bmad-core/agent-teams/team-all.yaml +++ b/bmad-core/agent-teams/team-all.yaml @@ -4,7 +4,7 @@ bundle: description: Includes every core system agent. agents: - bmad-orchestrator - - '*' + - "*" workflows: - brownfield-fullstack.yaml - brownfield-service.yaml diff --git a/bmad-core/agents/bmad-orchestrator.md b/bmad-core/agents/bmad-orchestrator.md index cfba465e..8e6b574b 100644 --- a/bmad-core/agents/bmad-orchestrator.md +++ b/bmad-core/agents/bmad-orchestrator.md @@ -131,7 +131,7 @@ workflow-guidance: - Understand each workflow's purpose, options, and decision points - Ask clarifying questions based on the workflow's structure - Guide users through workflow selection when multiple options exist - - When appropriate, suggest: "Would you like me to create a detailed workflow plan before starting?" + - When appropriate, suggest: 'Would you like me to create a detailed workflow plan before starting?' - For workflows with divergent paths, help users choose the right path - Adapt questions to the specific domain (e.g., game dev vs infrastructure vs web dev) - Only recommend workflows that actually exist in the current bundle diff --git a/bmad-core/agents/dev.md b/bmad-core/agents/dev.md index 006dea22..e4c2da22 100644 --- a/bmad-core/agents/dev.md +++ b/bmad-core/agents/dev.md @@ -35,7 +35,7 @@ agent: id: dev title: Full Stack Developer icon: 💻 - whenToUse: "Use for code implementation, debugging, refactoring, and development best practices" + whenToUse: 'Use for code implementation, debugging, refactoring, and development best practices' customization: persona: @@ -57,13 +57,13 @@ commands: - explain: teach me what and why you did whatever you just did in detail so I can learn. Explain to me as if you were training a junior engineer. - exit: Say goodbye as the Developer, and then abandon inhabiting this persona - develop-story: - - order-of-execution: "Read (first or next) task→Implement Task and its subtasks→Write tests→Execute validations→Only if ALL pass, then update the task checkbox with [x]→Update story section File List to ensure it lists and new or modified or deleted source file→repeat order-of-execution until complete" + - order-of-execution: 'Read (first or next) task→Implement Task and its subtasks→Write tests→Execute validations→Only if ALL pass, then update the task checkbox with [x]→Update story section File List to ensure it lists and new or modified or deleted source file→repeat order-of-execution until complete' - story-file-updates-ONLY: - CRITICAL: ONLY UPDATE THE STORY FILE WITH UPDATES TO SECTIONS INDICATED BELOW. DO NOT MODIFY ANY OTHER SECTIONS. - CRITICAL: You are ONLY authorized to edit these specific sections of story files - Tasks / Subtasks Checkboxes, Dev Agent Record section and all its subsections, Agent Model Used, Debug Log References, Completion Notes List, File List, Change Log, Status - CRITICAL: DO NOT modify Status, Story, Acceptance Criteria, Dev Notes, Testing sections, or any other sections not listed above - - blocking: "HALT for: Unapproved deps needed, confirm with user | Ambiguous after story check | 3 failures attempting to implement or fix something repeatedly | Missing config | Failing regression" - - ready-for-review: "Code matches requirements + All validations pass + Follows standards + File List complete" + - blocking: 'HALT for: Unapproved deps needed, confirm with user | Ambiguous after story check | 3 failures attempting to implement or fix something repeatedly | Missing config | Failing regression' + - ready-for-review: 'Code matches requirements + All validations pass + Follows standards + File List complete' - completion: "All Tasks and Subtasks marked [x] and have tests→Validations and full regression passes (DON'T BE LAZY, EXECUTE ALL TESTS and CONFIRM)→Ensure File List is Complete→run the task execute-checklist for the checklist story-dod-checklist→set story status: 'Ready for Review'→HALT" dependencies: diff --git a/bmad-core/data/bmad-kb.md b/bmad-core/data/bmad-kb.md index ea877086..92ff765c 100644 --- a/bmad-core/data/bmad-kb.md +++ b/bmad-core/data/bmad-kb.md @@ -298,7 +298,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing - **Claude Code**: `/agent-name` (e.g., `/bmad-master`) - **Cursor**: `@agent-name` (e.g., `@bmad-master`) -- **Windsurf**: `@agent-name` (e.g., `@bmad-master`) +- **Windsurf**: `/agent-name` (e.g., `/bmad-master`) - **Trae**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-master`) - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. diff --git a/bmad-core/data/test-levels-framework.md b/bmad-core/data/test-levels-framework.md index b31f5b7b..57b49003 100644 --- a/bmad-core/data/test-levels-framework.md +++ b/bmad-core/data/test-levels-framework.md @@ -25,10 +25,10 @@ Comprehensive guide for determining appropriate test levels (unit, integration, ```yaml unit_test: - component: "PriceCalculator" - scenario: "Calculate discount with multiple rules" - justification: "Complex business logic with multiple branches" - mock_requirements: "None - pure function" + component: 'PriceCalculator' + scenario: 'Calculate discount with multiple rules' + justification: 'Complex business logic with multiple branches' + mock_requirements: 'None - pure function' ``` ### Integration Tests @@ -52,10 +52,10 @@ unit_test: ```yaml integration_test: - components: ["UserService", "AuthRepository"] - scenario: "Create user with role assignment" - justification: "Critical data flow between service and persistence" - test_environment: "In-memory database" + components: ['UserService', 'AuthRepository'] + scenario: 'Create user with role assignment' + justification: 'Critical data flow between service and persistence' + test_environment: 'In-memory database' ``` ### End-to-End Tests @@ -79,10 +79,10 @@ integration_test: ```yaml e2e_test: - journey: "Complete checkout process" - scenario: "User purchases with saved payment method" - justification: "Revenue-critical path requiring full validation" - environment: "Staging with test payment gateway" + journey: 'Complete checkout process' + scenario: 'User purchases with saved payment method' + justification: 'Revenue-critical path requiring full validation' + environment: 'Staging with test payment gateway' ``` ## Test Level Selection Rules diff --git a/bmad-core/tasks/facilitate-brainstorming-session.md b/bmad-core/tasks/facilitate-brainstorming-session.md index 309d13cd..ce9fb25d 100644 --- a/bmad-core/tasks/facilitate-brainstorming-session.md +++ b/bmad-core/tasks/facilitate-brainstorming-session.md @@ -1,6 +1,6 @@ --- docOutputLocation: docs/brainstorming-session-results.md -template: "{root}/templates/brainstorming-output-tmpl.yaml" +template: '{root}/templates/brainstorming-output-tmpl.yaml' --- # Facilitate Brainstorming Session Task diff --git a/bmad-core/tasks/nfr-assess.md b/bmad-core/tasks/nfr-assess.md index 6b77526c..c441880e 100644 --- a/bmad-core/tasks/nfr-assess.md +++ b/bmad-core/tasks/nfr-assess.md @@ -6,18 +6,19 @@ Quick NFR validation focused on the core four: security, performance, reliabilit ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: 'docs/stories/{epic}.{story}.*.md' + optional: - - architecture_refs: "docs/architecture/*.md" - - technical_preferences: "docs/technical-preferences.md" + - architecture_refs: 'docs/architecture/*.md' + - technical_preferences: 'docs/technical-preferences.md' - acceptance_criteria: From story file ``` ## Purpose Assess non-functional requirements for a story and generate: + 1. YAML block for the gate file's `nfr_validation` section 2. Brief markdown assessment saved to `docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md` @@ -26,6 +27,7 @@ Assess non-functional requirements for a story and generate: ### 0. Fail-safe for Missing Inputs If story_path or story file can't be found: + - Still create assessment file with note: "Source story not found" - Set all selected NFRs to CONCERNS with notes: "Target unknown / evidence missing" - Continue with assessment to provide value @@ -38,7 +40,7 @@ If story_path or story file can't be found: ```text Which NFRs should I assess? (Enter numbers or press Enter for default) [1] Security (default) -[2] Performance (default) +[2] Performance (default) [3] Reliability (default) [4] Maintainability (default) [5] Usability @@ -52,6 +54,7 @@ Which NFRs should I assess? (Enter numbers or press Enter for default) ### 2. Check for Thresholds Look for NFR requirements in: + - Story acceptance criteria - `docs/architecture/*.md` files - `docs/technical-preferences.md` @@ -72,6 +75,7 @@ No security requirements found. Required auth method? ### 3. Quick Assessment For each selected NFR, check: + - Is there evidence it's implemented? - Can we validate it? - Are there obvious gaps? @@ -86,24 +90,24 @@ Generate ONLY for NFRs actually assessed (no placeholders): # Gate YAML (copy/paste): nfr_validation: _assessed: [security, performance, reliability, maintainability] - security: + security: status: CONCERNS - notes: "No rate limiting on auth endpoints" + notes: 'No rate limiting on auth endpoints' performance: status: PASS - notes: "Response times < 200ms verified" + notes: 'Response times < 200ms verified' reliability: status: PASS - notes: "Error handling and retries implemented" + notes: 'Error handling and retries implemented' maintainability: status: CONCERNS - notes: "Test coverage at 65%, target is 80%" + notes: 'Test coverage at 65%, target is 80%' ``` ## Deterministic Status Rules - **FAIL**: Any selected NFR has critical gap or target clearly not met -- **CONCERNS**: No FAILs, but any NFR is unknown/partial/missing evidence +- **CONCERNS**: No FAILs, but any NFR is unknown/partial/missing evidence - **PASS**: All selected NFRs meet targets with evidence ## Quality Score Calculation @@ -123,18 +127,21 @@ If `technical-preferences.md` defines custom weights, use those instead. ```markdown # NFR Assessment: {epic}.{story} + Date: {date} Reviewer: Quinn ## Summary + - Security: CONCERNS - Missing rate limiting - Performance: PASS - Meets <200ms requirement - Reliability: PASS - Proper error handling - Maintainability: CONCERNS - Test coverage below target ## Critical Issues + 1. **No rate limiting** (Security) - Risk: Brute force attacks possible - Fix: Add rate limiting middleware to auth endpoints @@ -144,6 +151,7 @@ Reviewer: Quinn - Fix: Add tests for uncovered branches ## Quick Wins + - Add rate limiting: ~2 hours - Increase test coverage: ~4 hours - Add performance monitoring: ~1 hour @@ -152,6 +160,7 @@ Reviewer: Quinn ## Output 3: Story Update Line **End with this line for the review task to quote:** + ``` NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md ``` @@ -159,6 +168,7 @@ NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md ## Output 4: Gate Integration Line **Always print at the end:** + ``` Gate NFR block ready → paste into docs/qa/gates/{epic}.{story}-{slug}.yml under nfr_validation ``` @@ -166,66 +176,82 @@ Gate NFR block ready → paste into docs/qa/gates/{epic}.{story}-{slug}.yml unde ## Assessment Criteria ### Security + **PASS if:** + - Authentication implemented - Authorization enforced - Input validation present - No hardcoded secrets **CONCERNS if:** + - Missing rate limiting - Weak encryption - Incomplete authorization **FAIL if:** + - No authentication - Hardcoded credentials - SQL injection vulnerabilities ### Performance + **PASS if:** + - Meets response time targets - No obvious bottlenecks - Reasonable resource usage **CONCERNS if:** + - Close to limits - Missing indexes - No caching strategy **FAIL if:** + - Exceeds response time limits - Memory leaks - Unoptimized queries ### Reliability + **PASS if:** + - Error handling present - Graceful degradation - Retry logic where needed **CONCERNS if:** + - Some error cases unhandled - No circuit breakers - Missing health checks **FAIL if:** + - No error handling - Crashes on errors - No recovery mechanisms ### Maintainability + **PASS if:** + - Test coverage meets target - Code well-structured - Documentation present **CONCERNS if:** + - Test coverage below target - Some code duplication - Missing documentation **FAIL if:** + - No tests - Highly coupled code - No documentation @@ -283,7 +309,7 @@ maintainability: 1. **Functional Suitability**: Completeness, correctness, appropriateness 2. **Performance Efficiency**: Time behavior, resource use, capacity -3. **Compatibility**: Co-existence, interoperability +3. **Compatibility**: Co-existence, interoperability 4. **Usability**: Learnability, operability, accessibility 5. **Reliability**: Maturity, availability, fault tolerance 6. **Security**: Confidentiality, integrity, authenticity @@ -291,6 +317,7 @@ maintainability: 8. **Portability**: Adaptability, installability Use these when assessing beyond the core four. +
@@ -304,12 +331,13 @@ performance_deep_dive: p99: 350ms database: slow_queries: 2 - missing_indexes: ["users.email", "orders.user_id"] + missing_indexes: ['users.email', 'orders.user_id'] caching: hit_rate: 0% - recommendation: "Add Redis for session data" + recommendation: 'Add Redis for session data' load_test: max_rps: 150 breaking_point: 200 rps ``` -
\ No newline at end of file + + diff --git a/bmad-core/tasks/qa-gate.md b/bmad-core/tasks/qa-gate.md index 9bcc924e..64b0a099 100644 --- a/bmad-core/tasks/qa-gate.md +++ b/bmad-core/tasks/qa-gate.md @@ -27,11 +27,11 @@ Slug rules: ```yaml schema: 1 -story: "{epic}.{story}" +story: '{epic}.{story}' gate: PASS|CONCERNS|FAIL|WAIVED -status_reason: "1-2 sentence explanation of gate decision" -reviewer: "Quinn" -updated: "{ISO-8601 timestamp}" +status_reason: '1-2 sentence explanation of gate decision' +reviewer: 'Quinn' +updated: '{ISO-8601 timestamp}' top_issues: [] # Empty array if no issues waiver: { active: false } # Only set active: true if WAIVED ``` @@ -40,20 +40,20 @@ waiver: { active: false } # Only set active: true if WAIVED ```yaml schema: 1 -story: "1.3" +story: '1.3' gate: CONCERNS -status_reason: "Missing rate limiting on auth endpoints poses security risk." -reviewer: "Quinn" -updated: "2025-01-12T10:15:00Z" +status_reason: 'Missing rate limiting on auth endpoints poses security risk.' +reviewer: 'Quinn' +updated: '2025-01-12T10:15:00Z' top_issues: - - id: "SEC-001" + - id: 'SEC-001' severity: high # ONLY: low|medium|high - finding: "No rate limiting on login endpoint" - suggested_action: "Add rate limiting middleware before production" - - id: "TEST-001" + finding: 'No rate limiting on login endpoint' + suggested_action: 'Add rate limiting middleware before production' + - id: 'TEST-001' severity: medium - finding: "No integration tests for auth flow" - suggested_action: "Add integration test coverage" + finding: 'No integration tests for auth flow' + suggested_action: 'Add integration test coverage' waiver: { active: false } ``` @@ -61,20 +61,20 @@ waiver: { active: false } ```yaml schema: 1 -story: "1.3" +story: '1.3' gate: WAIVED -status_reason: "Known issues accepted for MVP release." -reviewer: "Quinn" -updated: "2025-01-12T10:15:00Z" +status_reason: 'Known issues accepted for MVP release.' +reviewer: 'Quinn' +updated: '2025-01-12T10:15:00Z' top_issues: - - id: "PERF-001" + - id: 'PERF-001' severity: low - finding: "Dashboard loads slowly with 1000+ items" - suggested_action: "Implement pagination in next sprint" + finding: 'Dashboard loads slowly with 1000+ items' + suggested_action: 'Implement pagination in next sprint' waiver: active: true - reason: "MVP release - performance optimization deferred" - approved_by: "Product Owner" + reason: 'MVP release - performance optimization deferred' + approved_by: 'Product Owner' ``` ## Gate Decision Criteria diff --git a/bmad-core/tasks/review-story.md b/bmad-core/tasks/review-story.md index 869a58af..d4acd2ca 100644 --- a/bmad-core/tasks/review-story.md +++ b/bmad-core/tasks/review-story.md @@ -6,10 +6,10 @@ Perform a comprehensive test architecture review with quality gate decision. Thi ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "{devStoryLocation}/{epic}.{story}.*.md" # Path from core-config.yaml - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Prerequisites @@ -191,19 +191,19 @@ Gate file structure: ```yaml schema: 1 -story: "{epic}.{story}" -story_title: "{story title}" +story: '{epic}.{story}' +story_title: '{story title}' gate: PASS|CONCERNS|FAIL|WAIVED -status_reason: "1-2 sentence explanation of gate decision" -reviewer: "Quinn (Test Architect)" -updated: "{ISO-8601 timestamp}" +status_reason: '1-2 sentence explanation of gate decision' +reviewer: 'Quinn (Test Architect)' +updated: '{ISO-8601 timestamp}' top_issues: [] # Empty if no issues waiver: { active: false } # Set active: true only if WAIVED # Extended fields (optional but recommended): quality_score: 0-100 # 100 - (20*FAILs) - (10*CONCERNS) or use technical-preferences.md weights -expires: "{ISO-8601 timestamp}" # Typically 2 weeks from review +expires: '{ISO-8601 timestamp}' # Typically 2 weeks from review evidence: tests_reviewed: { count } @@ -215,24 +215,24 @@ evidence: nfr_validation: security: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' performance: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' reliability: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' maintainability: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' recommendations: immediate: # Must fix before production - - action: "Add rate limiting" - refs: ["api/auth/login.ts"] + - action: 'Add rate limiting' + refs: ['api/auth/login.ts'] future: # Can be addressed later - - action: "Consider caching" - refs: ["services/data.ts"] + - action: 'Consider caching' + refs: ['services/data.ts'] ``` ### Gate Decision Criteria diff --git a/bmad-core/tasks/risk-profile.md b/bmad-core/tasks/risk-profile.md index 5882c849..3669b36a 100644 --- a/bmad-core/tasks/risk-profile.md +++ b/bmad-core/tasks/risk-profile.md @@ -6,10 +6,10 @@ Generate a comprehensive risk assessment matrix for a story implementation using ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: 'docs/stories/{epic}.{story}.*.md' + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Purpose @@ -79,14 +79,14 @@ For each category, identify specific risks: ```yaml risk: - id: "SEC-001" # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH + id: 'SEC-001' # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH category: security - title: "Insufficient input validation on user forms" - description: "Form inputs not properly sanitized could lead to XSS attacks" + title: 'Insufficient input validation on user forms' + description: 'Form inputs not properly sanitized could lead to XSS attacks' affected_components: - - "UserRegistrationForm" - - "ProfileUpdateForm" - detection_method: "Code review revealed missing validation" + - 'UserRegistrationForm' + - 'ProfileUpdateForm' + detection_method: 'Code review revealed missing validation' ``` ### 2. Risk Assessment @@ -133,20 +133,20 @@ For each identified risk, provide mitigation: ```yaml mitigation: - risk_id: "SEC-001" - strategy: "preventive" # preventive|detective|corrective + risk_id: 'SEC-001' + strategy: 'preventive' # preventive|detective|corrective actions: - - "Implement input validation library (e.g., validator.js)" - - "Add CSP headers to prevent XSS execution" - - "Sanitize all user inputs before storage" - - "Escape all outputs in templates" + - 'Implement input validation library (e.g., validator.js)' + - 'Add CSP headers to prevent XSS execution' + - 'Sanitize all user inputs before storage' + - 'Escape all outputs in templates' testing_requirements: - - "Security testing with OWASP ZAP" - - "Manual penetration testing of forms" - - "Unit tests for validation functions" - residual_risk: "Low - Some zero-day vulnerabilities may remain" - owner: "dev" - timeline: "Before deployment" + - 'Security testing with OWASP ZAP' + - 'Manual penetration testing of forms' + - 'Unit tests for validation functions' + residual_risk: 'Low - Some zero-day vulnerabilities may remain' + owner: 'dev' + timeline: 'Before deployment' ``` ## Outputs @@ -172,12 +172,12 @@ risk_summary: highest: id: SEC-001 score: 9 - title: "XSS on profile form" + title: 'XSS on profile form' recommendations: must_fix: - - "Add input sanitization & CSP" + - 'Add input sanitization & CSP' monitor: - - "Add security alerts for auth endpoints" + - 'Add security alerts for auth endpoints' ``` ### Output 2: Markdown Report diff --git a/bmad-core/tasks/test-design.md b/bmad-core/tasks/test-design.md index ec0798fd..dde4a846 100644 --- a/bmad-core/tasks/test-design.md +++ b/bmad-core/tasks/test-design.md @@ -6,10 +6,10 @@ Create comprehensive test scenarios with appropriate test level recommendations ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "{devStoryLocation}/{epic}.{story}.*.md" # Path from core-config.yaml - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Purpose @@ -62,13 +62,13 @@ For each identified test need, create: ```yaml test_scenario: - id: "{epic}.{story}-{LEVEL}-{SEQ}" - requirement: "AC reference" + id: '{epic}.{story}-{LEVEL}-{SEQ}' + requirement: 'AC reference' priority: P0|P1|P2|P3 level: unit|integration|e2e - description: "What is being tested" - justification: "Why this level was chosen" - mitigates_risks: ["RISK-001"] # If risk profile exists + description: 'What is being tested' + justification: 'Why this level was chosen' + mitigates_risks: ['RISK-001'] # If risk profile exists ``` ### 5. Validate Coverage diff --git a/bmad-core/tasks/trace-requirements.md b/bmad-core/tasks/trace-requirements.md index f1882bf0..07b11a9f 100644 --- a/bmad-core/tasks/trace-requirements.md +++ b/bmad-core/tasks/trace-requirements.md @@ -31,21 +31,21 @@ Identify all testable requirements from: For each requirement, document which tests validate it. Use Given-When-Then to describe what the test validates (not how it's written): ```yaml -requirement: "AC1: User can login with valid credentials" +requirement: 'AC1: User can login with valid credentials' test_mappings: - - test_file: "auth/login.test.ts" - test_case: "should successfully login with valid email and password" + - test_file: 'auth/login.test.ts' + test_case: 'should successfully login with valid email and password' # Given-When-Then describes WHAT the test validates, not HOW it's coded - given: "A registered user with valid credentials" - when: "They submit the login form" - then: "They are redirected to dashboard and session is created" + given: 'A registered user with valid credentials' + when: 'They submit the login form' + then: 'They are redirected to dashboard and session is created' coverage: full - - test_file: "e2e/auth-flow.test.ts" - test_case: "complete login flow" - given: "User on login page" - when: "Entering valid credentials and submitting" - then: "Dashboard loads with user data" + - test_file: 'e2e/auth-flow.test.ts' + test_case: 'complete login flow' + given: 'User on login page' + when: 'Entering valid credentials and submitting' + then: 'Dashboard loads with user data' coverage: integration ``` @@ -67,19 +67,19 @@ Document any gaps found: ```yaml coverage_gaps: - - requirement: "AC3: Password reset email sent within 60 seconds" - gap: "No test for email delivery timing" + - requirement: 'AC3: Password reset email sent within 60 seconds' + gap: 'No test for email delivery timing' severity: medium suggested_test: type: integration - description: "Test email service SLA compliance" + description: 'Test email service SLA compliance' - - requirement: "AC5: Support 1000 concurrent users" - gap: "No load testing implemented" + - requirement: 'AC5: Support 1000 concurrent users' + gap: 'No load testing implemented' severity: high suggested_test: type: performance - description: "Load test with 1000 concurrent connections" + description: 'Load test with 1000 concurrent connections' ``` ## Outputs @@ -95,11 +95,11 @@ trace: full: Y partial: Z none: W - planning_ref: "docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md" + planning_ref: 'docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md' uncovered: - - ac: "AC3" - reason: "No test found for password reset timing" - notes: "See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md" + - ac: 'AC3' + reason: 'No test found for password reset timing' + notes: 'See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md' ``` ### Output 2: Traceability Report diff --git a/bmad-core/templates/architecture-tmpl.yaml b/bmad-core/templates/architecture-tmpl.yaml index fbddd24c..103f645a 100644 --- a/bmad-core/templates/architecture-tmpl.yaml +++ b/bmad-core/templates/architecture-tmpl.yaml @@ -20,20 +20,20 @@ sections: - id: intro-content content: | This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - + **Relationship to Frontend Architecture:** If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - + 1. Review the PRD and brainstorming brief for any mentions of: - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) - Existing projects or codebases being used as a foundation - Boilerplate projects or scaffolding tools - Previous projects to be cloned or adapted - + 2. If a starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -46,16 +46,16 @@ sections: - Existing architectural patterns and conventions - Any limitations or constraints imposed by the starter - Use this analysis to inform and align your architecture decisions - + 3. If no starter template is mentioned but this is a greenfield project: - Suggest appropriate starter templates based on the tech stack preferences - Explain the benefits (faster setup, best practices, community support) - Let the user decide whether to use one - + 4. If the user confirms no starter template will be used: - Proceed with architecture design from scratch - Note that manual setup will be required for all tooling and configuration - + Document the decision here before proceeding with the architecture design. If none, just say N/A elicit: true - id: changelog @@ -83,7 +83,7 @@ sections: title: High Level Overview instruction: | Based on the PRD's Technical Assumptions section, describe: - + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) 2. Repository structure decision from PRD (Monorepo/Polyrepo) 3. Service architecture decision from PRD @@ -100,17 +100,17 @@ sections: - Data flow directions - External integrations - User entry points - + - id: architectural-patterns title: Architectural and Design Patterns instruction: | List the key high-level patterns that will guide the architecture. For each pattern: - + 1. Present 2-3 viable options if multiple exist 2. Provide your recommendation with clear rationale 3. Get user confirmation before finalizing 4. These patterns should align with the PRD's technical assumptions and project goals - + Common patterns to consider: - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) - Code organization patterns (Dependency Injection, Repository, Module, Factory) @@ -126,23 +126,23 @@ sections: title: Tech Stack instruction: | This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - + 1. Review PRD technical assumptions and any preferences from {root}/data/technical-preferences.yaml or an attached technical-preferences 2. For each category, present 2-3 viable options with pros/cons 3. Make a clear recommendation based on project needs 4. Get explicit user approval for each selection 5. Document exact versions (avoid "latest" - pin specific versions) 6. This table is the single source of truth - all other docs must reference these choices - + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - + - Starter templates (if any) - Languages and runtimes with exact versions - Frameworks and libraries / packages - Cloud provider and key services choices - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion - Development tools - + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. elicit: true sections: @@ -166,13 +166,13 @@ sections: title: Data Models instruction: | Define the core data models/entities: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true @@ -181,11 +181,11 @@ sections: title: "{{model_name}}" template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - {{relationship_1}} - {{relationship_2}} @@ -194,7 +194,7 @@ sections: title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services and their responsibilities 2. Consider the repository structure (monorepo/polyrepo) from PRD 3. Define clear boundaries and interfaces between components @@ -203,7 +203,7 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: @@ -212,13 +212,13 @@ sections: title: "{{component_name}}" template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -235,13 +235,13 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true @@ -254,10 +254,10 @@ sections: - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -266,13 +266,13 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include error handling paths 4. Document async operations 5. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -283,13 +283,13 @@ sections: language: yaml instruction: | If the project includes a REST API: - + 1. Create an OpenAPI 3.0 specification 2. Include all endpoints from epics/stories 3. Define request/response schemas based on data models 4. Document authentication requirements 5. Include example requests/responses - + Use YAML format for better readability. If no REST API, skip this section. elicit: true template: | @@ -306,13 +306,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -322,14 +322,14 @@ sections: language: plaintext instruction: | Create a project folder structure that reflects: - + 1. The chosen repository structure (monorepo/polyrepo) 2. The service architecture (monolith/microservices/serverless) 3. The selected tech stack and languages 4. Component organization from above 5. Best practices for the chosen frameworks 6. Clear separation of concerns - + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. elicit: true examples: @@ -347,13 +347,13 @@ sections: title: Infrastructure and Deployment instruction: | Define the deployment architecture and practices: - + 1. Use IaC tool selected in Tech Stack 2. Choose deployment strategy appropriate for the architecture 3. Define environments and promotion flow 4. Establish rollback procedures 5. Consider security, monitoring, and cost optimization - + Get user input on deployment preferences and CI/CD tool choices. elicit: true sections: @@ -389,13 +389,13 @@ sections: title: Error Handling Strategy instruction: | Define comprehensive error handling approach: - + 1. Choose appropriate patterns for the language/framework from Tech Stack 2. Define logging standards and tools 3. Establish error categories and handling rules 4. Consider observability and debugging needs 5. Ensure security (no sensitive data in logs) - + This section guides both AI and human developers in consistent error handling. elicit: true sections: @@ -442,13 +442,13 @@ sections: title: Coding Standards instruction: | These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - + 1. This section directly controls AI developer behavior 2. Keep it minimal - assume AI knows general best practices 3. Focus on project-specific conventions and gotchas 4. Overly detailed standards bloat context and slow development 5. Standards will be extracted to separate file for dev agent use - + For each standard, get explicit user confirmation it's necessary. elicit: true sections: @@ -470,7 +470,7 @@ sections: - "Never use console.log in production code - use logger" - "All API responses must use ApiResponse wrapper type" - "Database queries must use repository pattern, never direct ORM" - + Avoid obvious rules like "use SOLID principles" or "write clean code" repeatable: true template: "- **{{rule_name}}:** {{rule_description}}" @@ -488,14 +488,14 @@ sections: title: Test Strategy and Standards instruction: | Work with user to define comprehensive test strategy: - + 1. Use test frameworks from Tech Stack 2. Decide on TDD vs test-after approach 3. Define test organization and naming 4. Establish coverage goals 5. Determine integration test infrastructure 6. Plan for test data and external dependencies - + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. elicit: true sections: @@ -516,7 +516,7 @@ sections: - **Location:** {{unit_test_location}} - **Mocking Library:** {{mocking_library}} - **Coverage Requirement:** {{unit_coverage}} - + **AI Agent Requirements:** - Generate tests for all public methods - Cover edge cases and error conditions @@ -558,7 +558,7 @@ sections: title: Security instruction: | Define MANDATORY security requirements for AI and human developers: - + 1. Focus on implementation-specific rules 2. Reference security tools from Tech Stack 3. Define clear patterns for common scenarios @@ -627,16 +627,16 @@ sections: title: Next Steps instruction: | After completing the architecture: - + 1. If project has UI components: - Use "Frontend Architecture Mode" - Provide this document as input - + 2. For all projects: - Review with Product Owner - Begin story implementation with Dev agent - Set up infrastructure with DevOps agent - + 3. Include specific prompts for next agents if needed sections: - id: architect-prompt diff --git a/bmad-core/templates/brainstorming-output-tmpl.yaml b/bmad-core/templates/brainstorming-output-tmpl.yaml index 0d353ce4..e1151fee 100644 --- a/bmad-core/templates/brainstorming-output-tmpl.yaml +++ b/bmad-core/templates/brainstorming-output-tmpl.yaml @@ -23,11 +23,11 @@ sections: - id: summary-details template: | **Topic:** {{session_topic}} - + **Session Goals:** {{stated_goals}} - + **Techniques Used:** {{techniques_list}} - + **Total Ideas Generated:** {{total_ideas}} - id: key-themes title: "Key Themes Identified:" @@ -152,5 +152,5 @@ sections: - id: footer content: | --- - - *Session facilitated using the BMAD-METHOD brainstorming framework* \ No newline at end of file + + *Session facilitated using the BMAD-METHOD brainstorming framework* diff --git a/bmad-core/templates/brownfield-architecture-tmpl.yaml b/bmad-core/templates/brownfield-architecture-tmpl.yaml index 01020231..066ebbd5 100644 --- a/bmad-core/templates/brownfield-architecture-tmpl.yaml +++ b/bmad-core/templates/brownfield-architecture-tmpl.yaml @@ -16,40 +16,40 @@ sections: title: Introduction instruction: | IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - + 2. **REQUIRED INPUTS**: - Completed brownfield-prd.md - Existing project technical documentation (from docs folder or user-provided) - Access to existing project structure (IDE or uploaded files) - + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - + If any required inputs are missing, request them before proceeding. elicit: true sections: - id: intro-content content: | This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - + **Relationship to Existing Architecture:** This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - id: existing-project-analysis title: Existing Project Analysis instruction: | Analyze the existing project structure and architecture: - + 1. Review existing documentation in docs folder 2. Examine current technology stack and versions 3. Identify existing architectural patterns and conventions 4. Note current deployment and infrastructure setup 5. Document any constraints or limitations - + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." elicit: true sections: @@ -78,12 +78,12 @@ sections: title: Enhancement Scope and Integration Strategy instruction: | Define how the enhancement will integrate with the existing system: - + 1. Review the brownfield PRD enhancement scope 2. Identify integration points with existing code 3. Define boundaries between new and existing functionality 4. Establish compatibility requirements - + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" elicit: true sections: @@ -112,7 +112,7 @@ sections: title: Tech Stack Alignment instruction: | Ensure new components align with existing technology choices: - + 1. Use existing technology stack as the foundation 2. Only introduce new technologies if absolutely necessary 3. Justify any new additions with clear rationale @@ -135,7 +135,7 @@ sections: title: Data Models and Schema Changes instruction: | Define new data models and how they integrate with existing schema: - + 1. Identify new entities required for the enhancement 2. Define relationships with existing data models 3. Plan database schema changes (additions, modifications) @@ -151,11 +151,11 @@ sections: template: | **Purpose:** {{model_purpose}} **Integration:** {{integration_with_existing}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - **With Existing:** {{existing_relationships}} - **With New:** {{new_relationships}} @@ -167,7 +167,7 @@ sections: - **Modified Tables:** {{modified_tables_list}} - **New Indexes:** {{new_indexes_list}} - **Migration Strategy:** {{migration_approach}} - + **Backward Compatibility:** - {{compatibility_measure_1}} - {{compatibility_measure_2}} @@ -176,12 +176,12 @@ sections: title: Component Architecture instruction: | Define new components and their integration with existing architecture: - + 1. Identify new components required for the enhancement 2. Define interfaces with existing components 3. Establish clear boundaries and responsibilities 4. Plan integration points and data flow - + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" elicit: true sections: @@ -194,15 +194,15 @@ sections: template: | **Responsibility:** {{component_description}} **Integration Points:** {{integration_points}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** - **Existing Components:** {{existing_dependencies}} - **New Components:** {{new_dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: interaction-diagram title: Component Interaction Diagram @@ -215,7 +215,7 @@ sections: condition: Enhancement requires API changes instruction: | Define new API endpoints and integration with existing APIs: - + 1. Plan new API endpoints required for the enhancement 2. Ensure consistency with existing API patterns 3. Define authentication and authorization integration @@ -265,17 +265,17 @@ sections: - **Base URL:** {{api_base_url}} - **Authentication:** {{auth_method}} - **Integration Method:** {{integration_approach}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Error Handling:** {{error_handling_strategy}} - id: source-tree-integration title: Source Tree Integration instruction: | Define how new code will integrate with existing project structure: - + 1. Follow existing project organization patterns 2. Identify where new files/folders will be placed 3. Ensure consistency with existing naming conventions @@ -314,7 +314,7 @@ sections: title: Infrastructure and Deployment Integration instruction: | Define how the enhancement will be deployed alongside existing infrastructure: - + 1. Use existing deployment pipeline and infrastructure 2. Identify any infrastructure changes needed 3. Plan deployment strategy to minimize risk @@ -344,7 +344,7 @@ sections: title: Coding Standards and Conventions instruction: | Ensure new code follows existing project conventions: - + 1. Document existing coding standards from project analysis 2. Identify any enhancement-specific requirements 3. Ensure consistency with existing codebase patterns @@ -375,7 +375,7 @@ sections: title: Testing Strategy instruction: | Define testing approach for the enhancement: - + 1. Integrate with existing test suite 2. Ensure existing functionality remains intact 3. Plan for testing new features @@ -415,7 +415,7 @@ sections: title: Security Integration instruction: | Ensure security consistency with existing system: - + 1. Follow existing security patterns and tools 2. Ensure new features don't introduce vulnerabilities 3. Maintain existing security posture @@ -450,7 +450,7 @@ sections: title: Next Steps instruction: | After completing the brownfield architecture: - + 1. Review integration points with existing system 2. Begin story implementation with Dev agent 3. Set up deployment pipeline integration @@ -473,4 +473,4 @@ sections: - Integration requirements with existing codebase validated with user - Key technical decisions based on real project constraints - Existing system compatibility requirements with specific verification steps - - Clear sequencing of implementation to minimize risk to existing functionality \ No newline at end of file + - Clear sequencing of implementation to minimize risk to existing functionality diff --git a/bmad-core/templates/brownfield-prd-tmpl.yaml b/bmad-core/templates/brownfield-prd-tmpl.yaml index 66caf6f8..1feef7ea 100644 --- a/bmad-core/templates/brownfield-prd-tmpl.yaml +++ b/bmad-core/templates/brownfield-prd-tmpl.yaml @@ -16,19 +16,19 @@ sections: title: Intro Project Analysis and Context instruction: | IMPORTANT - SCOPE ASSESSMENT REQUIRED: - + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. - + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - + Do not proceed with any recommendations until the user has validated your understanding of the existing system. sections: - id: existing-project-overview @@ -54,7 +54,7 @@ sections: - Note: "Document-project analysis available - using existing technical documentation" - List key documents created by document-project - Skip the missing documentation check below - + Otherwise, check for existing documentation: sections: - id: available-docs @@ -178,7 +178,7 @@ sections: If document-project output available: - Extract from "Actual Tech Stack" table in High Level Architecture section - Include version numbers and any noted constraints - + Otherwise, document the current technology stack: template: | **Languages**: {{languages}} @@ -217,7 +217,7 @@ sections: - Reference "Technical Debt and Known Issues" section - Include "Workarounds and Gotchas" that might impact enhancement - Note any identified constraints from "Critical Technical Debt" - + Build risk assessment incorporating existing known issues: template: | **Technical Risks**: {{technical_risks}} @@ -240,7 +240,7 @@ sections: title: "Epic 1: {{enhancement_title}}" instruction: | Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality - + CRITICAL STORY SEQUENCING FOR BROWNFIELD: - Stories must ensure existing functionality remains intact - Each story should include verification that existing features still work @@ -253,7 +253,7 @@ sections: - Each story must deliver value while maintaining system integrity template: | **Epic Goal**: {{epic_goal}} - + **Integration Requirements**: {{integration_requirements}} sections: - id: story @@ -277,4 +277,4 @@ sections: items: - template: "IV1: {{existing_functionality_verification}}" - template: "IV2: {{integration_point_verification}}" - - template: "IV3: {{performance_impact_verification}}" \ No newline at end of file + - template: "IV3: {{performance_impact_verification}}" diff --git a/bmad-core/templates/competitor-analysis-tmpl.yaml b/bmad-core/templates/competitor-analysis-tmpl.yaml index 07cf8437..a6a599ac 100644 --- a/bmad-core/templates/competitor-analysis-tmpl.yaml +++ b/bmad-core/templates/competitor-analysis-tmpl.yaml @@ -76,7 +76,7 @@ sections: title: Competitor Prioritization Matrix instruction: | Help categorize competitors by market share and strategic threat level - + Create a 2x2 matrix: - Priority 1 (Core Competitors): High Market Share + High Threat - Priority 2 (Emerging Threats): Low Market Share + High Threat @@ -141,7 +141,14 @@ sections: title: Feature Comparison Matrix instruction: Create a detailed comparison table of key features across competitors type: table - columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + columns: + [ + "Feature Category", + "{{your_company}}", + "{{competitor_1}}", + "{{competitor_2}}", + "{{competitor_3}}", + ] rows: - category: "Core Functionality" items: @@ -153,7 +160,13 @@ sections: - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] - category: "Integration & Ecosystem" items: - - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] + - [ + "API Availability", + "{{availability}}", + "{{availability}}", + "{{availability}}", + "{{availability}}", + ] - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] - category: "Pricing & Plans" items: @@ -180,7 +193,7 @@ sections: title: Positioning Map instruction: | Describe competitor positions on key dimensions - + Create a positioning description using 2 key dimensions relevant to the market, such as: - Price vs. Features - Ease of Use vs. Power @@ -215,7 +228,7 @@ sections: title: Blue Ocean Opportunities instruction: | Identify uncontested market spaces - + List opportunities to create new market space: - Underserved segments - Unaddressed use cases @@ -290,4 +303,4 @@ sections: Recommended review schedule: - Weekly: {{weekly_items}} - Monthly: {{monthly_items}} - - Quarterly: {{quarterly_analysis}} \ No newline at end of file + - Quarterly: {{quarterly_analysis}} diff --git a/bmad-core/templates/front-end-architecture-tmpl.yaml b/bmad-core/templates/front-end-architecture-tmpl.yaml index 958c40f5..eb7f3da8 100644 --- a/bmad-core/templates/front-end-architecture-tmpl.yaml +++ b/bmad-core/templates/front-end-architecture-tmpl.yaml @@ -16,16 +16,16 @@ sections: title: Template and Framework Selection instruction: | Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. - + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - UI kit or component library starters - Existing frontend projects being used as a foundation - Admin dashboard templates or other specialized starters - Design system implementations - + 2. If a frontend starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -41,7 +41,7 @@ sections: - Testing setup and patterns - Build and development scripts - Use this analysis to ensure your frontend architecture aligns with the starter's patterns - + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - Based on the framework choice, suggest appropriate starters: - React: Create React App, Next.js, Vite + React @@ -49,11 +49,11 @@ sections: - Angular: Angular CLI - Or suggest popular UI templates if applicable - Explain benefits specific to frontend development - + 4. If the user confirms no starter template will be used: - Note that all tooling, bundling, and configuration will need manual setup - Proceed with frontend architecture from scratch - + Document the starter template decision and any constraints it imposes before proceeding. sections: - id: changelog @@ -75,12 +75,24 @@ sections: rows: - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - [ + "State Management", + "{{state_management}}", + "{{version}}", + "{{purpose}}", + "{{why_chosen}}", + ] - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - [ + "Component Library", + "{{component_lib}}", + "{{version}}", + "{{purpose}}", + "{{why_chosen}}", + ] - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] @@ -203,4 +215,4 @@ sections: - Common commands (dev server, build, test) - Key import patterns - File naming conventions - - Project-specific patterns and utilities \ No newline at end of file + - Project-specific patterns and utilities diff --git a/bmad-core/templates/front-end-spec-tmpl.yaml b/bmad-core/templates/front-end-spec-tmpl.yaml index d8856368..af56c9f3 100644 --- a/bmad-core/templates/front-end-spec-tmpl.yaml +++ b/bmad-core/templates/front-end-spec-tmpl.yaml @@ -16,7 +16,7 @@ sections: title: Introduction instruction: | Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification. - + Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted. content: | This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{project_name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. @@ -25,7 +25,7 @@ sections: title: Overall UX Goals & Principles instruction: | Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: - + 1. Target User Personas - elicit details or confirm existing ones from PRD 2. Key Usability Goals - understand what success looks like for users 3. Core Design Principles - establish 3-5 guiding principles @@ -66,7 +66,7 @@ sections: title: Information Architecture (IA) instruction: | Collaborate with the user to create a comprehensive information architecture: - + 1. Build a Site Map or Screen Inventory showing all major areas 2. Define the Navigation Structure (primary, secondary, breadcrumbs) 3. Use Mermaid diagrams for visual representation @@ -96,22 +96,22 @@ sections: title: Navigation Structure template: | **Primary Navigation:** {{primary_nav_description}} - + **Secondary Navigation:** {{secondary_nav_description}} - + **Breadcrumb Strategy:** {{breadcrumb_strategy}} - id: user-flows title: User Flows instruction: | For each critical user task identified in the PRD: - + 1. Define the user's goal clearly 2. Map out all steps including decision points 3. Consider edge cases and error states 4. Use Mermaid flow diagrams for clarity 5. Link to external tools (Figma/Miro) if detailed flows exist there - + Create subsections for each major flow. elicit: true repeatable: true @@ -120,9 +120,9 @@ sections: title: "{{flow_name}}" template: | **User Goal:** {{flow_goal}} - + **Entry Points:** {{entry_points}} - + **Success Criteria:** {{success_criteria}} sections: - id: flow-diagram @@ -153,14 +153,14 @@ sections: title: "{{screen_name}}" template: | **Purpose:** {{screen_purpose}} - + **Key Elements:** - {{element_1}} - {{element_2}} - {{element_3}} - + **Interaction Notes:** {{interaction_notes}} - + **Design File Reference:** {{specific_frame_link}} - id: component-library @@ -179,11 +179,11 @@ sections: title: "{{component_name}}" template: | **Purpose:** {{component_purpose}} - + **Variants:** {{component_variants}} - + **States:** {{component_states}} - + **Usage Guidelines:** {{usage_guidelines}} - id: branding-style @@ -229,13 +229,13 @@ sections: title: Iconography template: | **Icon Library:** {{icon_library}} - + **Usage Guidelines:** {{icon_guidelines}} - id: spacing-layout title: Spacing & Layout template: | **Grid System:** {{grid_system}} - + **Spacing Scale:** {{spacing_scale}} - id: accessibility @@ -253,12 +253,12 @@ sections: - Color contrast ratios: {{contrast_requirements}} - Focus indicators: {{focus_requirements}} - Text sizing: {{text_requirements}} - + **Interaction:** - Keyboard navigation: {{keyboard_requirements}} - Screen reader support: {{screen_reader_requirements}} - Touch targets: {{touch_requirements}} - + **Content:** - Alternative text: {{alt_text_requirements}} - Heading structure: {{heading_requirements}} @@ -285,11 +285,11 @@ sections: title: Adaptation Patterns template: | **Layout Changes:** {{layout_adaptations}} - + **Navigation Changes:** {{nav_adaptations}} - + **Content Priority:** {{content_adaptations}} - + **Interaction Changes:** {{interaction_adaptations}} - id: animation @@ -323,7 +323,7 @@ sections: title: Next Steps instruction: | After completing the UI/UX specification: - + 1. Recommend review with stakeholders 2. Suggest creating/updating visual designs in design tool 3. Prepare for handoff to Design Architect for frontend architecture @@ -346,4 +346,4 @@ sections: - id: checklist-results title: Checklist Results - instruction: If a UI/UX checklist exists, run it against this document and report results here. \ No newline at end of file + instruction: If a UI/UX checklist exists, run it against this document and report results here. diff --git a/bmad-core/templates/fullstack-architecture-tmpl.yaml b/bmad-core/templates/fullstack-architecture-tmpl.yaml index 9ebbd979..94d30458 100644 --- a/bmad-core/templates/fullstack-architecture-tmpl.yaml +++ b/bmad-core/templates/fullstack-architecture-tmpl.yaml @@ -19,33 +19,33 @@ sections: elicit: true content: | This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. sections: - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - + 1. Review the PRD and other documents for mentions of: - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) - Monorepo templates (e.g., Nx, Turborepo starters) - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) - Existing projects being extended or cloned - + 2. If starter templates or existing projects are mentioned: - Ask the user to provide access (links, repos, or files) - Analyze to understand pre-configured choices and constraints - Note any architectural decisions already made - Identify what can be modified vs what must be retained - + 3. If no starter is mentioned but this is greenfield: - Suggest appropriate fullstack starters based on tech preferences - Consider platform-specific options (Vercel, AWS, etc.) - Let user decide whether to use one - + 4. Document the decision and any constraints it imposes - + If none, state "N/A - Greenfield project" - id: changelog title: Change Log @@ -71,17 +71,17 @@ sections: title: Platform and Infrastructure Choice instruction: | Based on PRD requirements and technical assumptions, make a platform recommendation: - + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - **Azure**: For .NET ecosystems or enterprise Microsoft environments - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - + 2. Present 2-3 viable options with clear pros/cons 3. Make a recommendation with rationale 4. Get explicit user confirmation - + Document the choice and key services that will be used. template: | **Platform:** {{selected_platform}} @@ -91,7 +91,7 @@ sections: title: Repository Structure instruction: | Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: - + 1. For modern fullstack apps, monorepo is often preferred 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) 3. Define package/app boundaries @@ -113,7 +113,7 @@ sections: - Databases and storage - External integrations - CDN and caching layers - + Use appropriate diagram type for clarity. - id: architectural-patterns title: Architectural Patterns @@ -123,7 +123,7 @@ sections: - Frontend patterns (e.g., Component-based, State management) - Backend patterns (e.g., Repository, CQRS, Event-driven) - Integration patterns (e.g., BFF, API Gateway) - + For each pattern, provide recommendation and rationale. repeatable: true template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" @@ -137,7 +137,7 @@ sections: title: Tech Stack instruction: | This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - + Key areas to cover: - Frontend and backend languages/frameworks - Databases and caching @@ -146,7 +146,7 @@ sections: - Testing tools for both frontend and backend - Build and deployment tools - Monitoring and logging - + Upon render, elicit feedback immediately. elicit: true sections: @@ -156,11 +156,29 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] rows: - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - [ + "Frontend Framework", + "{{fe_framework}}", + "{{version}}", + "{{purpose}}", + "{{why_chosen}}", + ] + - [ + "UI Component Library", + "{{ui_library}}", + "{{version}}", + "{{purpose}}", + "{{why_chosen}}", + ] - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - [ + "Backend Framework", + "{{be_framework}}", + "{{version}}", + "{{purpose}}", + "{{why_chosen}}", + ] - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] @@ -181,14 +199,14 @@ sections: title: Data Models instruction: | Define the core data models/entities that will be shared between frontend and backend: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Create TypeScript interfaces that can be shared 6. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true @@ -197,7 +215,7 @@ sections: title: "{{model_name}}" template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} @@ -216,7 +234,7 @@ sections: title: API Specification instruction: | Based on the chosen API style from Tech Stack: - + 1. If REST API, create an OpenAPI 3.0 specification 2. If GraphQL, provide the GraphQL schema 3. If tRPC, show router definitions @@ -224,7 +242,7 @@ sections: 5. Define request/response schemas based on data models 6. Document authentication requirements 7. Include example requests/responses - + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. elicit: true sections: @@ -259,7 +277,7 @@ sections: title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services across the fullstack 2. Consider both frontend and backend components 3. Define clear boundaries and interfaces between components @@ -268,7 +286,7 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: @@ -277,13 +295,13 @@ sections: title: "{{component_name}}" template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -300,13 +318,13 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true @@ -319,10 +337,10 @@ sections: - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -331,14 +349,14 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include both frontend and backend flows 4. Include error handling paths 5. Document async operations 6. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -346,13 +364,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -488,60 +506,60 @@ sections: type: code language: plaintext examples: - - | - {{project-name}}/ - ├── .github/ # CI/CD workflows - │ └── workflows/ - │ ├── ci.yaml - │ └── deploy.yaml - ├── apps/ # Application packages - │ ├── web/ # Frontend application - │ │ ├── src/ - │ │ │ ├── components/ # UI components - │ │ │ ├── pages/ # Page components/routes - │ │ │ ├── hooks/ # Custom React hooks - │ │ │ ├── services/ # API client services - │ │ │ ├── stores/ # State management - │ │ │ ├── styles/ # Global styles/themes - │ │ │ └── utils/ # Frontend utilities - │ │ ├── public/ # Static assets - │ │ ├── tests/ # Frontend tests - │ │ └── package.json - │ └── api/ # Backend application - │ ├── src/ - │ │ ├── routes/ # API routes/controllers - │ │ ├── services/ # Business logic - │ │ ├── models/ # Data models - │ │ ├── middleware/ # Express/API middleware - │ │ ├── utils/ # Backend utilities - │ │ └── {{serverless_or_server_entry}} - │ ├── tests/ # Backend tests - │ └── package.json - ├── packages/ # Shared packages - │ ├── shared/ # Shared types/utilities - │ │ ├── src/ - │ │ │ ├── types/ # TypeScript interfaces - │ │ │ ├── constants/ # Shared constants - │ │ │ └── utils/ # Shared utilities - │ │ └── package.json - │ ├── ui/ # Shared UI components - │ │ ├── src/ - │ │ └── package.json - │ └── config/ # Shared configuration - │ ├── eslint/ - │ ├── typescript/ - │ └── jest/ - ├── infrastructure/ # IaC definitions - │ └── {{iac_structure}} - ├── scripts/ # Build/deploy scripts - ├── docs/ # Documentation - │ ├── prd.md - │ ├── front-end-spec.md - │ └── fullstack-architecture.md - ├── .env.example # Environment template - ├── package.json # Root package.json - ├── {{monorepo_config}} # Monorepo configuration - └── README.md + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md - id: development-workflow title: Development Workflow @@ -568,13 +586,13 @@ sections: template: | # Start all services {{start_all_command}} - + # Start frontend only {{start_frontend_command}} - + # Start backend only {{start_backend_command}} - + # Run tests {{test_commands}} - id: environment-config @@ -587,10 +605,10 @@ sections: template: | # Frontend (.env.local) {{frontend_env_vars}} - + # Backend (.env) {{backend_env_vars}} - + # Shared {{shared_env_vars}} @@ -607,7 +625,7 @@ sections: - **Build Command:** {{frontend_build_command}} - **Output Directory:** {{frontend_output_dir}} - **CDN/Edge:** {{cdn_strategy}} - + **Backend Deployment:** - **Platform:** {{backend_deploy_platform}} - **Build Command:** {{backend_build_command}} @@ -638,12 +656,12 @@ sections: - CSP Headers: {{csp_policy}} - XSS Prevention: {{xss_strategy}} - Secure Storage: {{storage_strategy}} - + **Backend Security:** - Input Validation: {{validation_approach}} - Rate Limiting: {{rate_limit_config}} - CORS Policy: {{cors_config}} - + **Authentication Security:** - Token Storage: {{token_strategy}} - Session Management: {{session_approach}} @@ -655,7 +673,7 @@ sections: - Bundle Size Target: {{bundle_size}} - Loading Strategy: {{loading_approach}} - Caching Strategy: {{fe_cache_strategy}} - + **Backend Performance:** - Response Time Target: {{response_target}} - Database Optimization: {{db_optimization}} @@ -671,10 +689,10 @@ sections: type: code language: text template: | - E2E Tests - / \ - Integration Tests - / \ + E2E Tests + / \ + Integration Tests + / \ Frontend Unit Backend Unit - id: test-organization title: Test Organization @@ -793,7 +811,7 @@ sections: - JavaScript errors - API response times - User interactions - + **Backend Metrics:** - Request rate - Error rate @@ -802,4 +820,4 @@ sections: - id: checklist-results title: Checklist Results Report - instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. \ No newline at end of file + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. diff --git a/bmad-core/templates/market-research-tmpl.yaml b/bmad-core/templates/market-research-tmpl.yaml index 598604b6..4ba50d2a 100644 --- a/bmad-core/templates/market-research-tmpl.yaml +++ b/bmad-core/templates/market-research-tmpl.yaml @@ -130,7 +130,7 @@ sections: instruction: Map the end-to-end customer experience for primary segments template: | For primary customer segment: - + 1. **Awareness:** {{discovery_process}} 2. **Consideration:** {{evaluation_criteria}} 3. **Purchase:** {{decision_triggers}} @@ -249,4 +249,4 @@ sections: instruction: Include any complex calculations or models - id: additional-analysis title: C. Additional Analysis - instruction: Any supplementary analysis not included in main body \ No newline at end of file + instruction: Any supplementary analysis not included in main body diff --git a/bmad-core/templates/prd-tmpl.yaml b/bmad-core/templates/prd-tmpl.yaml index 6a265899..c14607b5 100644 --- a/bmad-core/templates/prd-tmpl.yaml +++ b/bmad-core/templates/prd-tmpl.yaml @@ -56,7 +56,7 @@ sections: condition: PRD has UX/UI requirements instruction: | Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - + 1. Pre-fill all subsections with educated guesses based on project context 2. Present the complete rendered section to user 3. Clearly let the user know where assumptions were made @@ -98,7 +98,7 @@ sections: title: Technical Assumptions instruction: | Gather technical decisions that will guide the Architect. Steps: - + 1. Check if {root}/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets 3. For unknowns, offer guidance based on project goals and MVP scope @@ -126,9 +126,9 @@ sections: title: Epic List instruction: | Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - + CRITICAL: Epics MUST be logically sequential following agile best practices: - + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed @@ -147,11 +147,11 @@ sections: repeatable: true instruction: | After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. - + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). - + CRITICAL STORY SEQUENCING REQUIREMENTS: - + - Stories within each epic MUST be logically sequential - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation - No story should depend on work from a later story or epic @@ -179,7 +179,7 @@ sections: repeatable: true instruction: | Define clear, comprehensive, and testable acceptance criteria that: - + - Precisely define what "done" means from a functional perspective - Are unambiguous and serve as basis for verification - Include any critical non-functional requirements from the PRD @@ -199,4 +199,4 @@ sections: instruction: This section will contain the prompt for the UX Expert, keep it short and to the point to initiate create architecture mode using this document as input. - id: architect-prompt title: Architect Prompt - instruction: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input. \ No newline at end of file + instruction: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input. diff --git a/bmad-core/templates/project-brief-tmpl.yaml b/bmad-core/templates/project-brief-tmpl.yaml index e5a6c125..1a888c61 100644 --- a/bmad-core/templates/project-brief-tmpl.yaml +++ b/bmad-core/templates/project-brief-tmpl.yaml @@ -28,12 +28,12 @@ sections: - id: introduction instruction: | This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - + Start by asking the user which mode they prefer: - + 1. **Interactive Mode** - Work through each section collaboratively 2. **YOLO Mode** - Generate complete draft for review and refinement - + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. - id: executive-summary @@ -218,4 +218,4 @@ sections: - id: pm-handoff title: PM Handoff content: | - This Project Brief provides the full context for {{project_name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. \ No newline at end of file + This Project Brief provides the full context for {{project_name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. diff --git a/bmad-core/templates/qa-gate-tmpl.yaml b/bmad-core/templates/qa-gate-tmpl.yaml index ae8b8c79..e085e4aa 100644 --- a/bmad-core/templates/qa-gate-tmpl.yaml +++ b/bmad-core/templates/qa-gate-tmpl.yaml @@ -11,8 +11,8 @@ template: schema: 1 story: "{{epic_num}}.{{story_num}}" story_title: "{{story_title}}" -gate: "{{gate_status}}" # PASS|CONCERNS|FAIL|WAIVED -status_reason: "{{status_reason}}" # 1-2 sentence summary of why this gate decision +gate: "{{gate_status}}" # PASS|CONCERNS|FAIL|WAIVED +status_reason: "{{status_reason}}" # 1-2 sentence summary of why this gate decision reviewer: "Quinn (Test Architect)" updated: "{{iso_timestamp}}" @@ -41,7 +41,7 @@ examples: severity: medium finding: "Missing integration tests for auth flow" suggested_action: "Add test coverage for critical paths" - + when_waived: | waiver: active: true @@ -55,7 +55,7 @@ optional_fields_examples: quality_and_expiry: | quality_score: 75 # 0-100 (optional scoring) expires: "2025-01-26T00:00:00Z" # Optional gate freshness window - + evidence: | evidence: tests_reviewed: 15 @@ -63,14 +63,14 @@ optional_fields_examples: trace: ac_covered: [1, 2, 3] # AC numbers with test coverage ac_gaps: [4] # AC numbers lacking coverage - + nfr_validation: | nfr_validation: security: { status: CONCERNS, notes: "Rate limiting missing" } performance: { status: PASS, notes: "" } reliability: { status: PASS, notes: "" } maintainability: { status: PASS, notes: "" } - + history: | history: # Append-only audit trail - at: "2025-01-12T10:00:00Z" @@ -79,7 +79,7 @@ optional_fields_examples: - at: "2025-01-12T15:00:00Z" gate: CONCERNS note: "Tests added but rate limiting still missing" - + risk_summary: | risk_summary: # From risk-profile task totals: @@ -91,7 +91,7 @@ optional_fields_examples: recommendations: must_fix: [] monitor: [] - + recommendations: | recommendations: immediate: # Must fix before production @@ -99,4 +99,4 @@ optional_fields_examples: refs: ["api/auth/login.ts:42-68"] future: # Can be addressed later - action: "Consider caching for better performance" - refs: ["services/data.service.ts"] \ No newline at end of file + refs: ["services/data.service.ts"] diff --git a/bmad-core/templates/story-tmpl.yaml b/bmad-core/templates/story-tmpl.yaml index 4a09513d..5f7b78c1 100644 --- a/bmad-core/templates/story-tmpl.yaml +++ b/bmad-core/templates/story-tmpl.yaml @@ -12,7 +12,7 @@ workflow: elicitation: advanced-elicitation agent_config: - editable_sections: + editable_sections: - Status - Story - Acceptance Criteria @@ -29,7 +29,7 @@ sections: instruction: Select the current status of the story owner: scrum-master editors: [scrum-master, dev-agent] - + - id: story title: Story type: template-text @@ -41,7 +41,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: acceptance-criteria title: Acceptance Criteria type: numbered-list @@ -49,7 +49,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: tasks-subtasks title: Tasks / Subtasks type: bullet-list @@ -66,7 +66,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master, dev-agent] - + - id: dev-notes title: Dev Notes instruction: | @@ -90,7 +90,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: change-log title: Change Log type: table @@ -98,7 +98,7 @@ sections: instruction: Track changes made to this story document owner: scrum-master editors: [scrum-master, dev-agent, qa-agent] - + - id: dev-agent-record title: Dev Agent Record instruction: This section is populated by the development agent during implementation @@ -111,27 +111,27 @@ sections: instruction: Record the specific AI agent model and version used for development owner: dev-agent editors: [dev-agent] - + - id: debug-log-references title: Debug Log References instruction: Reference any debug logs or traces generated during development owner: dev-agent editors: [dev-agent] - + - id: completion-notes title: Completion Notes List instruction: Notes about the completion of tasks and any issues encountered owner: dev-agent editors: [dev-agent] - + - id: file-list title: File List instruction: List all files created, modified, or affected during story implementation owner: dev-agent editors: [dev-agent] - + - id: qa-results title: QA Results instruction: Results from QA Agent QA review of the completed story implementation owner: qa-agent - editors: [qa-agent] \ No newline at end of file + editors: [qa-agent] diff --git a/bmad-core/workflows/brownfield-fullstack.yaml b/bmad-core/workflows/brownfield-fullstack.yaml index e933884c..33ea1637 100644 --- a/bmad-core/workflows/brownfield-fullstack.yaml +++ b/bmad-core/workflows/brownfield-fullstack.yaml @@ -20,7 +20,7 @@ workflow: - Single story (< 4 hours) → Use brownfield-create-story task - Small feature (1-3 stories) → Use brownfield-create-epic task - Major enhancement (multiple epics) → Continue with full workflow - + Ask user: "Can you describe the enhancement scope? Is this a small fix, a feature addition, or a major enhancement requiring architectural changes?" - step: routing_decision @@ -181,7 +181,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: {root}/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -265,33 +265,33 @@ workflow: {{if single_story}}: Proceeding with brownfield-create-story task for immediate implementation. {{if small_feature}}: Creating focused epic with brownfield-create-epic task. {{if major_enhancement}}: Continuing with comprehensive planning workflow. - + documentation_assessment: | Documentation assessment complete: {{if adequate}}: Existing documentation is sufficient. Proceeding directly to PRD creation. {{if inadequate}}: Running document-project to capture current system state before PRD. - + document_project_to_pm: | Project analysis complete. Key findings documented in: - {{document_list}} Use these findings to inform PRD creation and avoid re-analyzing the same aspects. - + pm_to_architect_decision: | PRD complete and saved as docs/prd.md. Architectural changes identified: {{yes/no}} {{if yes}}: Proceeding to create architecture document for: {{specific_changes}} {{if no}}: No architectural changes needed. Proceeding to validation. - + architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for integration safety." - + po_to_sm: | All artifacts validated. Documentation type available: {{sharded_prd / brownfield_docs}} {{if sharded}}: Use standard create-next-story task. {{if brownfield}}: Use create-brownfield-story task to handle varied documentation formats. - + sm_story_creation: | Creating story from {{documentation_type}}. {{if missing_context}}: May need to gather additional context from user during story creation. - + complete: "All planning artifacts validated and development can begin. Stories will be created based on available documentation format." diff --git a/bmad-core/workflows/brownfield-service.yaml b/bmad-core/workflows/brownfield-service.yaml index 8bce3485..711277ee 100644 --- a/bmad-core/workflows/brownfield-service.yaml +++ b/bmad-core/workflows/brownfield-service.yaml @@ -127,7 +127,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: {root}/data/bmad-kb.md#IDE Development Workflow flow_diagram: | diff --git a/bmad-core/workflows/brownfield-ui.yaml b/bmad-core/workflows/brownfield-ui.yaml index 4de69530..6daa2c98 100644 --- a/bmad-core/workflows/brownfield-ui.yaml +++ b/bmad-core/workflows/brownfield-ui.yaml @@ -134,7 +134,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: {root}/data/bmad-kb.md#IDE Development Workflow flow_diagram: | diff --git a/bmad-core/workflows/greenfield-fullstack.yaml b/bmad-core/workflows/greenfield-fullstack.yaml index 4e722030..3ec57cca 100644 --- a/bmad-core/workflows/greenfield-fullstack.yaml +++ b/bmad-core/workflows/greenfield-fullstack.yaml @@ -159,7 +159,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: {root}/data/bmad-kb.md#IDE Development Workflow flow_diagram: | diff --git a/bmad-core/workflows/greenfield-service.yaml b/bmad-core/workflows/greenfield-service.yaml index bc75353f..769f8240 100644 --- a/bmad-core/workflows/greenfield-service.yaml +++ b/bmad-core/workflows/greenfield-service.yaml @@ -135,7 +135,7 @@ workflow: notes: | All stories implemented and reviewed! Service development phase complete. - + Reference: {root}/data/bmad-kb.md#IDE Development Workflow flow_diagram: | diff --git a/bmad-core/workflows/greenfield-ui.yaml b/bmad-core/workflows/greenfield-ui.yaml index bd68fc19..52d7f3af 100644 --- a/bmad-core/workflows/greenfield-ui.yaml +++ b/bmad-core/workflows/greenfield-ui.yaml @@ -154,7 +154,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: {root}/data/bmad-kb.md#IDE Development Workflow flow_diagram: | diff --git a/common/utils/bmad-doc-template.md b/common/utils/bmad-doc-template.md index 19b7d01e..7f6f3c89 100644 --- a/common/utils/bmad-doc-template.md +++ b/common/utils/bmad-doc-template.md @@ -14,7 +14,7 @@ template: output: format: markdown filename: default-path/to/{{filename}}.md - title: "{{variable}} Document Title" + title: '{{variable}} Document Title' workflow: mode: interactive @@ -108,8 +108,8 @@ sections: Use `{{variable_name}}` in titles, templates, and content: ```yaml -title: "Epic {{epic_number}} {{epic_title}}" -template: "As a {{user_type}}, I want {{action}}, so that {{benefit}}." +title: 'Epic {{epic_number}} {{epic_title}}' +template: 'As a {{user_type}}, I want {{action}}, so that {{benefit}}.' ``` ### Conditional Sections @@ -212,7 +212,7 @@ choices: - id: criteria title: Acceptance Criteria type: numbered-list - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' repeatable: true ``` @@ -220,7 +220,7 @@ choices: ````yaml examples: - - "FR6: The system must authenticate users within 2 seconds" + - 'FR6: The system must authenticate users within 2 seconds' - | ```mermaid sequenceDiagram diff --git a/dist/agents/analyst.txt b/dist/agents/analyst.txt index 71281b01..28120eb8 100644 --- a/dist/agents/analyst.txt +++ b/dist/agents/analyst.txt @@ -106,7 +106,7 @@ dependencies: ==================== START: .bmad-core/tasks/facilitate-brainstorming-session.md ==================== --- docOutputLocation: docs/brainstorming-session-results.md -template: ".bmad-core/templates/brainstorming-output-tmpl.yaml" +template: '.bmad-core/templates/brainstorming-output-tmpl.yaml' --- # Facilitate Brainstorming Session Task @@ -1101,35 +1101,35 @@ template: output: format: markdown filename: docs/brief.md - title: "Project Brief: {{project_name}}" + title: 'Project Brief: {{project_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Project Brief Elicitation Actions" + title: 'Project Brief Elicitation Actions' options: - - "Expand section with more specific details" - - "Validate against similar successful products" - - "Stress test assumptions with edge cases" - - "Explore alternative solution approaches" - - "Analyze resource/constraint trade-offs" - - "Generate risk mitigation strategies" - - "Challenge scope from MVP minimalist view" - - "Brainstorm creative feature possibilities" - - "If only we had [resource/capability/time]..." - - "Proceed to next section" + - 'Expand section with more specific details' + - 'Validate against similar successful products' + - 'Stress test assumptions with edge cases' + - 'Explore alternative solution approaches' + - 'Analyze resource/constraint trade-offs' + - 'Generate risk mitigation strategies' + - 'Challenge scope from MVP minimalist view' + - 'Brainstorm creative feature possibilities' + - 'If only we had [resource/capability/time]...' + - 'Proceed to next section' sections: - id: introduction instruction: | This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - + Start by asking the user which mode they prefer: - + 1. **Interactive Mode** - Work through each section collaboratively 2. **YOLO Mode** - Generate complete draft for review and refinement - + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. - id: executive-summary @@ -1140,7 +1140,7 @@ sections: - Primary problem being solved - Target market identification - Key value proposition - template: "{{executive_summary_content}}" + template: '{{executive_summary_content}}' - id: problem-statement title: Problem Statement @@ -1150,7 +1150,7 @@ sections: - Impact of the problem (quantify if possible) - Why existing solutions fall short - Urgency and importance of solving this now - template: "{{detailed_problem_description}}" + template: '{{detailed_problem_description}}' - id: proposed-solution title: Proposed Solution @@ -1160,7 +1160,7 @@ sections: - Key differentiators from existing solutions - Why this solution will succeed where others haven't - High-level vision for the product - template: "{{solution_description}}" + template: '{{solution_description}}' - id: target-users title: Target Users @@ -1172,12 +1172,12 @@ sections: - Goals they're trying to achieve sections: - id: primary-segment - title: "Primary User Segment: {{segment_name}}" - template: "{{primary_user_description}}" + title: 'Primary User Segment: {{segment_name}}' + template: '{{primary_user_description}}' - id: secondary-segment - title: "Secondary User Segment: {{segment_name}}" + title: 'Secondary User Segment: {{segment_name}}' condition: Has secondary user segment - template: "{{secondary_user_description}}" + template: '{{secondary_user_description}}' - id: goals-metrics title: Goals & Success Metrics @@ -1186,15 +1186,15 @@ sections: - id: business-objectives title: Business Objectives type: bullet-list - template: "- {{objective_with_metric}}" + template: '- {{objective_with_metric}}' - id: user-success-metrics title: User Success Metrics type: bullet-list - template: "- {{user_metric}}" + template: '- {{user_metric}}' - id: kpis title: Key Performance Indicators (KPIs) type: bullet-list - template: "- {{kpi}}: {{definition_and_target}}" + template: '- {{kpi}}: {{definition_and_target}}' - id: mvp-scope title: MVP Scope @@ -1203,14 +1203,14 @@ sections: - id: core-features title: Core Features (Must Have) type: bullet-list - template: "- **{{feature}}:** {{description_and_rationale}}" + template: '- **{{feature}}:** {{description_and_rationale}}' - id: out-of-scope title: Out of Scope for MVP type: bullet-list - template: "- {{feature_or_capability}}" + template: '- {{feature_or_capability}}' - id: mvp-success-criteria title: MVP Success Criteria - template: "{{mvp_success_definition}}" + template: '{{mvp_success_definition}}' - id: post-mvp-vision title: Post-MVP Vision @@ -1218,13 +1218,13 @@ sections: sections: - id: phase-2-features title: Phase 2 Features - template: "{{next_priority_features}}" + template: '{{next_priority_features}}' - id: long-term-vision title: Long-term Vision - template: "{{one_two_year_vision}}" + template: '{{one_two_year_vision}}' - id: expansion-opportunities title: Expansion Opportunities - template: "{{potential_expansions}}" + template: '{{potential_expansions}}' - id: technical-considerations title: Technical Considerations @@ -1265,7 +1265,7 @@ sections: - id: key-assumptions title: Key Assumptions type: bullet-list - template: "- {{assumption}}" + template: '- {{assumption}}' - id: risks-questions title: Risks & Open Questions @@ -1274,15 +1274,15 @@ sections: - id: key-risks title: Key Risks type: bullet-list - template: "- **{{risk}}:** {{description_and_impact}}" + template: '- **{{risk}}:** {{description_and_impact}}' - id: open-questions title: Open Questions type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: research-areas title: Areas Needing Further Research type: bullet-list - template: "- {{research_topic}}" + template: '- {{research_topic}}' - id: appendices title: Appendices @@ -1299,10 +1299,10 @@ sections: - id: stakeholder-input title: B. Stakeholder Input condition: Has stakeholder feedback - template: "{{stakeholder_feedback}}" + template: '{{stakeholder_feedback}}' - id: references title: C. References - template: "{{relevant_links_and_docs}}" + template: '{{relevant_links_and_docs}}' - id: next-steps title: Next Steps @@ -1310,7 +1310,7 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action_item}}" + template: '{{action_item}}' - id: pm-handoff title: PM Handoff content: | @@ -1325,24 +1325,24 @@ template: output: format: markdown filename: docs/market-research.md - title: "Market Research Report: {{project_product_name}}" + title: 'Market Research Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Market Research Elicitation Actions" + title: 'Market Research Elicitation Actions' options: - - "Expand market sizing calculations with sensitivity analysis" - - "Deep dive into a specific customer segment" - - "Analyze an emerging market trend in detail" - - "Compare this market to an analogous market" - - "Stress test market assumptions" - - "Explore adjacent market opportunities" - - "Challenge market definition and boundaries" - - "Generate strategic scenarios (best/base/worst case)" - - "If only we had considered [X market factor]..." - - "Proceed to next section" + - 'Expand market sizing calculations with sensitivity analysis' + - 'Deep dive into a specific customer segment' + - 'Analyze an emerging market trend in detail' + - 'Compare this market to an analogous market' + - 'Stress test market assumptions' + - 'Explore adjacent market opportunities' + - 'Challenge market definition and boundaries' + - 'Generate strategic scenarios (best/base/worst case)' + - 'If only we had considered [X market factor]...' + - 'Proceed to next section' sections: - id: executive-summary @@ -1424,7 +1424,7 @@ sections: repeatable: true sections: - id: segment - title: "Segment {{segment_number}}: {{segment_name}}" + title: 'Segment {{segment_number}}: {{segment_name}}' template: | - **Description:** {{brief_overview}} - **Size:** {{number_of_customers_market_value}} @@ -1450,7 +1450,7 @@ sections: instruction: Map the end-to-end customer experience for primary segments template: | For primary customer segment: - + 1. **Awareness:** {{discovery_process}} 2. **Consideration:** {{evaluation_criteria}} 3. **Purchase:** {{decision_triggers}} @@ -1493,20 +1493,20 @@ sections: instruction: Analyze each force with specific evidence and implications sections: - id: supplier-power - title: "Supplier Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Supplier Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: buyer-power - title: "Buyer Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Buyer Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: competitive-rivalry - title: "Competitive Rivalry: {{intensity_level}}" - template: "{{analysis_and_implications}}" + title: 'Competitive Rivalry: {{intensity_level}}' + template: '{{analysis_and_implications}}' - id: threat-new-entry - title: "Threat of New Entry: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of New Entry: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: threat-substitutes - title: "Threat of Substitutes: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of Substitutes: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: adoption-lifecycle title: Technology Adoption Lifecycle Stage instruction: | @@ -1524,7 +1524,7 @@ sections: repeatable: true sections: - id: opportunity - title: "Opportunity {{opportunity_number}}: {{name}}" + title: 'Opportunity {{opportunity_number}}: {{name}}' template: | - **Description:** {{what_is_the_opportunity}} - **Size/Potential:** {{quantified_potential}} @@ -1580,24 +1580,24 @@ template: output: format: markdown filename: docs/competitor-analysis.md - title: "Competitive Analysis Report: {{project_product_name}}" + title: 'Competitive Analysis Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Competitive Analysis Elicitation Actions" + title: 'Competitive Analysis Elicitation Actions' options: - "Deep dive on a specific competitor's strategy" - - "Analyze competitive dynamics in a specific segment" - - "War game competitive responses to your moves" - - "Explore partnership vs. competition scenarios" - - "Stress test differentiation claims" - - "Analyze disruption potential (yours or theirs)" - - "Compare to competition in adjacent markets" - - "Generate win/loss analysis insights" + - 'Analyze competitive dynamics in a specific segment' + - 'War game competitive responses to your moves' + - 'Explore partnership vs. competition scenarios' + - 'Stress test differentiation claims' + - 'Analyze disruption potential (yours or theirs)' + - 'Compare to competition in adjacent markets' + - 'Generate win/loss analysis insights' - "If only we had known about [competitor X's plan]..." - - "Proceed to next section" + - 'Proceed to next section' sections: - id: executive-summary @@ -1651,7 +1651,7 @@ sections: title: Competitor Prioritization Matrix instruction: | Help categorize competitors by market share and strategic threat level - + Create a 2x2 matrix: - Priority 1 (Core Competitors): High Market Share + High Threat - Priority 2 (Emerging Threats): Low Market Share + High Threat @@ -1664,7 +1664,7 @@ sections: repeatable: true sections: - id: competitor - title: "{{competitor_name}} - Priority {{priority_level}}" + title: '{{competitor_name}} - Priority {{priority_level}}' sections: - id: company-overview title: Company Overview @@ -1696,11 +1696,11 @@ sections: - id: strengths title: Strengths type: bullet-list - template: "- {{strength}}" + template: '- {{strength}}' - id: weaknesses title: Weaknesses type: bullet-list - template: "- {{weakness}}" + template: '- {{weakness}}' - id: market-position title: Market Position & Performance template: | @@ -1716,24 +1716,37 @@ sections: title: Feature Comparison Matrix instruction: Create a detailed comparison table of key features across competitors type: table - columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + columns: + [ + 'Feature Category', + '{{your_company}}', + '{{competitor_1}}', + '{{competitor_2}}', + '{{competitor_3}}', + ] rows: - - category: "Core Functionality" + - category: 'Core Functionality' items: - - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - category: "User Experience" + - ['Feature A', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - ['Feature B', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - category: 'User Experience' items: - - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] - - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] - - category: "Integration & Ecosystem" + - ['Mobile App', '{{rating}}', '{{rating}}', '{{rating}}', '{{rating}}'] + - ['Onboarding Time', '{{time}}', '{{time}}', '{{time}}', '{{time}}'] + - category: 'Integration & Ecosystem' items: - - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] - - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] - - category: "Pricing & Plans" + - [ + 'API Availability', + '{{availability}}', + '{{availability}}', + '{{availability}}', + '{{availability}}', + ] + - ['Third-party Integrations', '{{number}}', '{{number}}', '{{number}}', '{{number}}'] + - category: 'Pricing & Plans' items: - - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] - - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - ['Starting Price', '{{price}}', '{{price}}', '{{price}}', '{{price}}'] + - ['Free Tier', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}'] - id: swot-comparison title: SWOT Comparison instruction: Create SWOT analysis for your solution vs. top competitors @@ -1746,7 +1759,7 @@ sections: - **Opportunities:** {{opportunities}} - **Threats:** {{threats}} - id: vs-competitor - title: "vs. {{main_competitor}}" + title: 'vs. {{main_competitor}}' template: | - **Competitive Advantages:** {{your_advantages}} - **Competitive Disadvantages:** {{their_advantages}} @@ -1755,7 +1768,7 @@ sections: title: Positioning Map instruction: | Describe competitor positions on key dimensions - + Create a positioning description using 2 key dimensions relevant to the market, such as: - Price vs. Features - Ease of Use vs. Power @@ -1790,7 +1803,7 @@ sections: title: Blue Ocean Opportunities instruction: | Identify uncontested market spaces - + List opportunities to create new market space: - Underserved segments - Unaddressed use cases @@ -1876,7 +1889,7 @@ template: output: format: markdown filename: docs/brainstorming-session-results.md - title: "Brainstorming Session Results" + title: 'Brainstorming Session Results' workflow: mode: non-interactive @@ -1894,45 +1907,45 @@ sections: - id: summary-details template: | **Topic:** {{session_topic}} - + **Session Goals:** {{stated_goals}} - + **Techniques Used:** {{techniques_list}} - + **Total Ideas Generated:** {{total_ideas}} - id: key-themes - title: "Key Themes Identified:" + title: 'Key Themes Identified:' type: bullet-list - template: "- {{theme}}" + template: '- {{theme}}' - id: technique-sessions title: Technique Sessions repeatable: true sections: - id: technique - title: "{{technique_name}} - {{duration}}" + title: '{{technique_name}} - {{duration}}' sections: - id: description - template: "**Description:** {{technique_description}}" + template: '**Description:** {{technique_description}}' - id: ideas-generated - title: "Ideas Generated:" + title: 'Ideas Generated:' type: numbered-list - template: "{{idea}}" + template: '{{idea}}' - id: insights - title: "Insights Discovered:" + title: 'Insights Discovered:' type: bullet-list - template: "- {{insight}}" + template: '- {{insight}}' - id: connections - title: "Notable Connections:" + title: 'Notable Connections:' type: bullet-list - template: "- {{connection}}" + template: '- {{connection}}' - id: idea-categorization title: Idea Categorization sections: - id: immediate-opportunities title: Immediate Opportunities - content: "*Ideas ready to implement now*" + content: '*Ideas ready to implement now*' repeatable: true type: numbered-list template: | @@ -1942,7 +1955,7 @@ sections: - Resources needed: {{requirements}} - id: future-innovations title: Future Innovations - content: "*Ideas requiring development/research*" + content: '*Ideas requiring development/research*' repeatable: true type: numbered-list template: | @@ -1952,7 +1965,7 @@ sections: - Timeline estimate: {{timeline}} - id: moonshots title: Moonshots - content: "*Ambitious, transformative concepts*" + content: '*Ambitious, transformative concepts*' repeatable: true type: numbered-list template: | @@ -1962,9 +1975,9 @@ sections: - Challenges to overcome: {{challenges}} - id: insights-learnings title: Insights & Learnings - content: "*Key realizations from the session*" + content: '*Key realizations from the session*' type: bullet-list - template: "- {{insight}}: {{description_and_implications}}" + template: '- {{insight}}: {{description_and_implications}}' - id: action-planning title: Action Planning @@ -1973,21 +1986,21 @@ sections: title: Top 3 Priority Ideas sections: - id: priority-1 - title: "#1 Priority: {{idea_name}}" + title: '#1 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-2 - title: "#2 Priority: {{idea_name}}" + title: '#2 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-3 - title: "#3 Priority: {{idea_name}}" + title: '#3 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} @@ -2000,19 +2013,19 @@ sections: - id: what-worked title: What Worked Well type: bullet-list - template: "- {{aspect}}" + template: '- {{aspect}}' - id: areas-exploration title: Areas for Further Exploration type: bullet-list - template: "- {{area}}: {{reason}}" + template: '- {{area}}: {{reason}}' - id: recommended-techniques title: Recommended Follow-up Techniques type: bullet-list - template: "- {{technique}}: {{reason}}" + template: '- {{technique}}: {{reason}}' - id: questions-emerged title: Questions That Emerged type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: next-session title: Next Session Planning template: | @@ -2023,7 +2036,7 @@ sections: - id: footer content: | --- - + *Session facilitated using the BMAD-METHOD brainstorming framework* ==================== END: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== @@ -2328,7 +2341,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing - **Claude Code**: `/agent-name` (e.g., `/bmad-master`) - **Cursor**: `@agent-name` (e.g., `@bmad-master`) -- **Windsurf**: `@agent-name` (e.g., `@bmad-master`) +- **Windsurf**: `/agent-name` (e.g., `/bmad-master`) - **Trae**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-master`) - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. diff --git a/dist/agents/architect.txt b/dist/agents/architect.txt index 2bbdfa3a..7bf3a8ef 100644 --- a/dist/agents/architect.txt +++ b/dist/agents/architect.txt @@ -933,7 +933,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Architecture Document" + title: '{{project_name}} Architecture Document' workflow: mode: interactive @@ -948,20 +948,20 @@ sections: - id: intro-content content: | This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - + **Relationship to Frontend Architecture:** If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - + 1. Review the PRD and brainstorming brief for any mentions of: - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) - Existing projects or codebases being used as a foundation - Boilerplate projects or scaffolding tools - Previous projects to be cloned or adapted - + 2. If a starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -974,16 +974,16 @@ sections: - Existing architectural patterns and conventions - Any limitations or constraints imposed by the starter - Use this analysis to inform and align your architecture decisions - + 3. If no starter template is mentioned but this is a greenfield project: - Suggest appropriate starter templates based on the tech stack preferences - Explain the benefits (faster setup, best practices, community support) - Let the user decide whether to use one - + 4. If the user confirms no starter template will be used: - Proceed with architecture design from scratch - Note that manual setup will be required for all tooling and configuration - + Document the decision here before proceeding with the architecture design. If none, just say N/A elicit: true - id: changelog @@ -1011,7 +1011,7 @@ sections: title: High Level Overview instruction: | Based on the PRD's Technical Assumptions section, describe: - + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) 2. Repository structure decision from PRD (Monorepo/Polyrepo) 3. Service architecture decision from PRD @@ -1028,49 +1028,49 @@ sections: - Data flow directions - External integrations - User entry points - + - id: architectural-patterns title: Architectural and Design Patterns instruction: | List the key high-level patterns that will guide the architecture. For each pattern: - + 1. Present 2-3 viable options if multiple exist 2. Provide your recommendation with clear rationale 3. Get user confirmation before finalizing 4. These patterns should align with the PRD's technical assumptions and project goals - + Common patterns to consider: - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) - Code organization patterns (Dependency Injection, Repository, Module, Factory) - Data patterns (Event Sourcing, Saga, Database per Service) - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + - '**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences 2. For each category, present 2-3 viable options with pros/cons 3. Make a clear recommendation based on project needs 4. Get explicit user approval for each selection 5. Document exact versions (avoid "latest" - pin specific versions) 6. This table is the single source of truth - all other docs must reference these choices - + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - + - Starter templates (if any) - Languages and runtimes with exact versions - Frameworks and libraries / packages - Cloud provider and key services choices - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion - Development tools - + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. elicit: true sections: @@ -1086,34 +1086,34 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Populate the technology stack table with all relevant technologies examples: - - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" - - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" - - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + - '| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |' + - '| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |' + - '| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |' - id: data-models title: Data Models instruction: | Define the core data models/entities: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - {{relationship_1}} - {{relationship_2}} @@ -1122,7 +1122,7 @@ sections: title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services and their responsibilities 2. Consider the repository structure (monorepo/polyrepo) from PRD 3. Define clear boundaries and interfaces between components @@ -1131,22 +1131,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -1163,29 +1163,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -1194,13 +1194,13 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include error handling paths 4. Document async operations 5. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -1211,13 +1211,13 @@ sections: language: yaml instruction: | If the project includes a REST API: - + 1. Create an OpenAPI 3.0 specification 2. Include all endpoints from epics/stories 3. Define request/response schemas based on data models 4. Document authentication requirements 5. Include example requests/responses - + Use YAML format for better readability. If no REST API, skip this section. elicit: true template: | @@ -1234,13 +1234,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -1250,14 +1250,14 @@ sections: language: plaintext instruction: | Create a project folder structure that reflects: - + 1. The chosen repository structure (monorepo/polyrepo) 2. The service architecture (monolith/microservices/serverless) 3. The selected tech stack and languages 4. Component organization from above 5. Best practices for the chosen frameworks 6. Clear separation of concerns - + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. elicit: true examples: @@ -1275,13 +1275,13 @@ sections: title: Infrastructure and Deployment instruction: | Define the deployment architecture and practices: - + 1. Use IaC tool selected in Tech Stack 2. Choose deployment strategy appropriate for the architecture 3. Define environments and promotion flow 4. Establish rollback procedures 5. Consider security, monitoring, and cost optimization - + Get user input on deployment preferences and CI/CD tool choices. elicit: true sections: @@ -1300,12 +1300,12 @@ sections: - id: environments title: Environments repeatable: true - template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + template: '- **{{env_name}}:** {{env_purpose}} - {{env_details}}' - id: promotion-flow title: Environment Promotion Flow type: code language: text - template: "{{promotion_flow_diagram}}" + template: '{{promotion_flow_diagram}}' - id: rollback-strategy title: Rollback Strategy template: | @@ -1317,13 +1317,13 @@ sections: title: Error Handling Strategy instruction: | Define comprehensive error handling approach: - + 1. Choose appropriate patterns for the language/framework from Tech Stack 2. Define logging standards and tools 3. Establish error categories and handling rules 4. Consider observability and debugging needs 5. Ensure security (no sensitive data in logs) - + This section guides both AI and human developers in consistent error handling. elicit: true sections: @@ -1370,13 +1370,13 @@ sections: title: Coding Standards instruction: | These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - + 1. This section directly controls AI developer behavior 2. Keep it minimal - assume AI knows general best practices 3. Focus on project-specific conventions and gotchas 4. Overly detailed standards bloat context and slow development 5. Standards will be extracted to separate file for dev agent use - + For each standard, get explicit user confirmation it's necessary. elicit: true sections: @@ -1398,32 +1398,32 @@ sections: - "Never use console.log in production code - use logger" - "All API responses must use ApiResponse wrapper type" - "Database queries must use repository pattern, never direct ORM" - + Avoid obvious rules like "use SOLID principles" or "write clean code" repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' - id: language-specifics title: Language-Specific Guidelines condition: Critical language-specific rules needed instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. sections: - id: language-rules - title: "{{language_name}} Specifics" + title: '{{language_name}} Specifics' repeatable: true - template: "- **{{rule_topic}}:** {{rule_detail}}" + template: '- **{{rule_topic}}:** {{rule_detail}}' - id: test-strategy title: Test Strategy and Standards instruction: | Work with user to define comprehensive test strategy: - + 1. Use test frameworks from Tech Stack 2. Decide on TDD vs test-after approach 3. Define test organization and naming 4. Establish coverage goals 5. Determine integration test infrastructure 6. Plan for test data and external dependencies - + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. elicit: true sections: @@ -1444,7 +1444,7 @@ sections: - **Location:** {{unit_test_location}} - **Mocking Library:** {{mocking_library}} - **Coverage Requirement:** {{unit_coverage}} - + **AI Agent Requirements:** - Generate tests for all public methods - Cover edge cases and error conditions @@ -1458,9 +1458,9 @@ sections: - **Test Infrastructure:** - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) examples: - - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" - - "**Message Queue:** Embedded Kafka for tests" - - "**External APIs:** WireMock for stubbing" + - '**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration' + - '**Message Queue:** Embedded Kafka for tests' + - '**External APIs:** WireMock for stubbing' - id: e2e-tests title: End-to-End Tests template: | @@ -1486,7 +1486,7 @@ sections: title: Security instruction: | Define MANDATORY security requirements for AI and human developers: - + 1. Focus on implementation-specific rules 2. Reference security tools from Tech Stack 3. Define clear patterns for common scenarios @@ -1555,16 +1555,16 @@ sections: title: Next Steps instruction: | After completing the architecture: - + 1. If project has UI components: - Use "Frontend Architecture Mode" - Provide this document as input - + 2. For all projects: - Review with Product Owner - Begin story implementation with Dev agent - Set up infrastructure with DevOps agent - + 3. Include specific prompts for next agents if needed sections: - id: architect-prompt @@ -1586,7 +1586,7 @@ template: output: format: markdown filename: docs/ui-architecture.md - title: "{{project_name}} Frontend Architecture Document" + title: '{{project_name}} Frontend Architecture Document' workflow: mode: interactive @@ -1597,16 +1597,16 @@ sections: title: Template and Framework Selection instruction: | Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. - + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - UI kit or component library starters - Existing frontend projects being used as a foundation - Admin dashboard templates or other specialized starters - Design system implementations - + 2. If a frontend starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -1622,7 +1622,7 @@ sections: - Testing setup and patterns - Build and development scripts - Use this analysis to ensure your frontend architecture aligns with the starter's patterns - + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - Based on the framework choice, suggest appropriate starters: - React: Create React App, Next.js, Vite + React @@ -1630,11 +1630,11 @@ sections: - Angular: Angular CLI - Or suggest popular UI templates if applicable - Explain benefits specific to frontend development - + 4. If the user confirms no starter template will be used: - Note that all tooling, bundling, and configuration will need manual setup - Proceed with frontend architecture from scratch - + Document the starter template decision and any constraints it imposes before proceeding. sections: - id: changelog @@ -1654,17 +1654,29 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Fill in appropriate technology choices based on the selected framework and project requirements. rows: - - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Framework', '{{framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['UI Library', '{{ui_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'State Management', + '{{state_management}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Routing', '{{routing_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Styling', '{{styling_solution}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Testing', '{{test_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Component Library', + '{{component_lib}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Form Handling', '{{form_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Animation', '{{animation_lib}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Dev Tools', '{{dev_tools}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: project-structure title: Project Structure @@ -1758,12 +1770,12 @@ sections: title: Testing Best Practices type: numbered-list items: - - "**Unit Tests**: Test individual components in isolation" - - "**Integration Tests**: Test component interactions" - - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" - - "**Coverage Goals**: Aim for 80% code coverage" - - "**Test Structure**: Arrange-Act-Assert pattern" - - "**Mock External Dependencies**: API calls, routing, state management" + - '**Unit Tests**: Test individual components in isolation' + - '**Integration Tests**: Test component interactions' + - '**E2E Tests**: Test critical user flows (using Cypress/Playwright)' + - '**Coverage Goals**: Aim for 80% code coverage' + - '**Test Structure**: Arrange-Act-Assert pattern' + - '**Mock External Dependencies**: API calls, routing, state management' - id: environment-configuration title: Environment Configuration @@ -1795,7 +1807,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Fullstack Architecture Document" + title: '{{project_name}} Fullstack Architecture Document' workflow: mode: interactive @@ -1809,33 +1821,33 @@ sections: elicit: true content: | This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. sections: - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - + 1. Review the PRD and other documents for mentions of: - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) - Monorepo templates (e.g., Nx, Turborepo starters) - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) - Existing projects being extended or cloned - + 2. If starter templates or existing projects are mentioned: - Ask the user to provide access (links, repos, or files) - Analyze to understand pre-configured choices and constraints - Note any architectural decisions already made - Identify what can be modified vs what must be retained - + 3. If no starter is mentioned but this is greenfield: - Suggest appropriate fullstack starters based on tech preferences - Consider platform-specific options (Vercel, AWS, etc.) - Let user decide whether to use one - + 4. Document the decision and any constraints it imposes - + If none, state "N/A - Greenfield project" - id: changelog title: Change Log @@ -1861,17 +1873,17 @@ sections: title: Platform and Infrastructure Choice instruction: | Based on PRD requirements and technical assumptions, make a platform recommendation: - + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - **Azure**: For .NET ecosystems or enterprise Microsoft environments - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - + 2. Present 2-3 viable options with clear pros/cons 3. Make a recommendation with rationale 4. Get explicit user confirmation - + Document the choice and key services that will be used. template: | **Platform:** {{selected_platform}} @@ -1881,7 +1893,7 @@ sections: title: Repository Structure instruction: | Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: - + 1. For modern fullstack apps, monorepo is often preferred 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) 3. Define package/app boundaries @@ -1903,7 +1915,7 @@ sections: - Databases and storage - External integrations - CDN and caching layers - + Use appropriate diagram type for clarity. - id: architectural-patterns title: Architectural Patterns @@ -1913,21 +1925,21 @@ sections: - Frontend patterns (e.g., Component-based, State management) - Backend patterns (e.g., Repository, CQRS, Event-driven) - Integration patterns (e.g., BFF, API Gateway) - + For each pattern, provide recommendation and rationale. repeatable: true - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" - - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + - '**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications' + - '**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - + Key areas to cover: - Frontend and backend languages/frameworks - Databases and caching @@ -1936,7 +1948,7 @@ sections: - Testing tools for both frontend and backend - Build and deployment tools - Monitoring and logging - + Upon render, elicit feedback immediately. elicit: true sections: @@ -1945,49 +1957,67 @@ sections: type: table columns: [Category, Technology, Version, Purpose, Rationale] rows: - - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Frontend Language', '{{fe_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Frontend Framework', + '{{fe_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - [ + 'UI Component Library', + '{{ui_library}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['State Management', '{{state_mgmt}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Language', '{{be_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Backend Framework', + '{{be_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['API Style', '{{api_style}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Database', '{{database}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Cache', '{{cache}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['File Storage', '{{storage}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Authentication', '{{auth}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Frontend Testing', '{{fe_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Testing', '{{be_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['E2E Testing', '{{e2e_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Bundler', '{{bundler}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['IaC Tool', '{{iac_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CI/CD', '{{cicd}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Monitoring', '{{monitoring}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Logging', '{{logging}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CSS Framework', '{{css_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: data-models title: Data Models instruction: | Define the core data models/entities that will be shared between frontend and backend: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Create TypeScript interfaces that can be shared 6. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} @@ -1996,17 +2026,17 @@ sections: title: TypeScript Interface type: code language: typescript - template: "{{model_interface}}" + template: '{{model_interface}}' - id: relationships title: Relationships type: bullet-list - template: "- {{relationship}}" + template: '- {{relationship}}' - id: api-spec title: API Specification instruction: | Based on the chosen API style from Tech Stack: - + 1. If REST API, create an OpenAPI 3.0 specification 2. If GraphQL, provide the GraphQL schema 3. If tRPC, show router definitions @@ -2014,7 +2044,7 @@ sections: 5. Define request/response schemas based on data models 6. Document authentication requirements 7. Include example requests/responses - + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. elicit: true sections: @@ -2037,19 +2067,19 @@ sections: condition: API style is GraphQL type: code language: graphql - template: "{{graphql_schema}}" + template: '{{graphql_schema}}' - id: trpc-api title: tRPC Router Definitions condition: API style is tRPC type: code language: typescript - template: "{{trpc_routers}}" + template: '{{trpc_routers}}' - id: components title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services across the fullstack 2. Consider both frontend and backend components 3. Define clear boundaries and interfaces between components @@ -2058,22 +2088,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -2090,29 +2120,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -2121,14 +2151,14 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include both frontend and backend flows 4. Include error handling paths 5. Document async operations 6. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -2136,13 +2166,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -2159,12 +2189,12 @@ sections: title: Component Organization type: code language: text - template: "{{component_structure}}" + template: '{{component_structure}}' - id: component-template title: Component Template type: code language: typescript - template: "{{component_template}}" + template: '{{component_template}}' - id: state-management title: State Management Architecture instruction: Detail state management approach based on chosen solution. @@ -2173,11 +2203,11 @@ sections: title: State Structure type: code language: typescript - template: "{{state_structure}}" + template: '{{state_structure}}' - id: state-patterns title: State Management Patterns type: bullet-list - template: "- {{pattern}}" + template: '- {{pattern}}' - id: routing-architecture title: Routing Architecture instruction: Define routing structure based on framework choice. @@ -2186,12 +2216,12 @@ sections: title: Route Organization type: code language: text - template: "{{route_structure}}" + template: '{{route_structure}}' - id: protected-routes title: Protected Route Pattern type: code language: typescript - template: "{{protected_route_example}}" + template: '{{protected_route_example}}' - id: frontend-services title: Frontend Services Layer instruction: Define how frontend communicates with backend. @@ -2200,12 +2230,12 @@ sections: title: API Client Setup type: code language: typescript - template: "{{api_client_setup}}" + template: '{{api_client_setup}}' - id: service-example title: Service Example type: code language: typescript - template: "{{service_example}}" + template: '{{service_example}}' - id: backend-architecture title: Backend Architecture @@ -2223,12 +2253,12 @@ sections: title: Function Organization type: code language: text - template: "{{function_structure}}" + template: '{{function_structure}}' - id: function-template title: Function Template type: code language: typescript - template: "{{function_template}}" + template: '{{function_template}}' - id: traditional-server condition: Traditional server architecture chosen sections: @@ -2236,12 +2266,12 @@ sections: title: Controller/Route Organization type: code language: text - template: "{{controller_structure}}" + template: '{{controller_structure}}' - id: controller-template title: Controller Template type: code language: typescript - template: "{{controller_template}}" + template: '{{controller_template}}' - id: database-architecture title: Database Architecture instruction: Define database schema and access patterns. @@ -2250,12 +2280,12 @@ sections: title: Schema Design type: code language: sql - template: "{{database_schema}}" + template: '{{database_schema}}' - id: data-access-layer title: Data Access Layer type: code language: typescript - template: "{{repository_pattern}}" + template: '{{repository_pattern}}' - id: auth-architecture title: Authentication and Authorization instruction: Define auth implementation details. @@ -2264,12 +2294,12 @@ sections: title: Auth Flow type: mermaid mermaid_type: sequence - template: "{{auth_flow_diagram}}" + template: '{{auth_flow_diagram}}' - id: auth-middleware title: Middleware/Guards type: code language: typescript - template: "{{auth_middleware}}" + template: '{{auth_middleware}}' - id: unified-project-structure title: Unified Project Structure @@ -2278,60 +2308,60 @@ sections: type: code language: plaintext examples: - - | - {{project-name}}/ - ├── .github/ # CI/CD workflows - │ └── workflows/ - │ ├── ci.yaml - │ └── deploy.yaml - ├── apps/ # Application packages - │ ├── web/ # Frontend application - │ │ ├── src/ - │ │ │ ├── components/ # UI components - │ │ │ ├── pages/ # Page components/routes - │ │ │ ├── hooks/ # Custom React hooks - │ │ │ ├── services/ # API client services - │ │ │ ├── stores/ # State management - │ │ │ ├── styles/ # Global styles/themes - │ │ │ └── utils/ # Frontend utilities - │ │ ├── public/ # Static assets - │ │ ├── tests/ # Frontend tests - │ │ └── package.json - │ └── api/ # Backend application - │ ├── src/ - │ │ ├── routes/ # API routes/controllers - │ │ ├── services/ # Business logic - │ │ ├── models/ # Data models - │ │ ├── middleware/ # Express/API middleware - │ │ ├── utils/ # Backend utilities - │ │ └── {{serverless_or_server_entry}} - │ ├── tests/ # Backend tests - │ └── package.json - ├── packages/ # Shared packages - │ ├── shared/ # Shared types/utilities - │ │ ├── src/ - │ │ │ ├── types/ # TypeScript interfaces - │ │ │ ├── constants/ # Shared constants - │ │ │ └── utils/ # Shared utilities - │ │ └── package.json - │ ├── ui/ # Shared UI components - │ │ ├── src/ - │ │ └── package.json - │ └── config/ # Shared configuration - │ ├── eslint/ - │ ├── typescript/ - │ └── jest/ - ├── infrastructure/ # IaC definitions - │ └── {{iac_structure}} - ├── scripts/ # Build/deploy scripts - ├── docs/ # Documentation - │ ├── prd.md - │ ├── front-end-spec.md - │ └── fullstack-architecture.md - ├── .env.example # Environment template - ├── package.json # Root package.json - ├── {{monorepo_config}} # Monorepo configuration - └── README.md + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md - id: development-workflow title: Development Workflow @@ -2345,12 +2375,12 @@ sections: title: Prerequisites type: code language: bash - template: "{{prerequisites_commands}}" + template: '{{prerequisites_commands}}' - id: initial-setup title: Initial Setup type: code language: bash - template: "{{setup_commands}}" + template: '{{setup_commands}}' - id: dev-commands title: Development Commands type: code @@ -2358,13 +2388,13 @@ sections: template: | # Start all services {{start_all_command}} - + # Start frontend only {{start_frontend_command}} - + # Start backend only {{start_backend_command}} - + # Run tests {{test_commands}} - id: environment-config @@ -2377,10 +2407,10 @@ sections: template: | # Frontend (.env.local) {{frontend_env_vars}} - + # Backend (.env) {{backend_env_vars}} - + # Shared {{shared_env_vars}} @@ -2397,7 +2427,7 @@ sections: - **Build Command:** {{frontend_build_command}} - **Output Directory:** {{frontend_output_dir}} - **CDN/Edge:** {{cdn_strategy}} - + **Backend Deployment:** - **Platform:** {{backend_deploy_platform}} - **Build Command:** {{backend_build_command}} @@ -2406,15 +2436,15 @@ sections: title: CI/CD Pipeline type: code language: yaml - template: "{{cicd_pipeline_config}}" + template: '{{cicd_pipeline_config}}' - id: environments title: Environments type: table columns: [Environment, Frontend URL, Backend URL, Purpose] rows: - - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] - - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] - - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + - ['Development', '{{dev_fe_url}}', '{{dev_be_url}}', 'Local development'] + - ['Staging', '{{staging_fe_url}}', '{{staging_be_url}}', 'Pre-production testing'] + - ['Production', '{{prod_fe_url}}', '{{prod_be_url}}', 'Live environment'] - id: security-performance title: Security and Performance @@ -2428,12 +2458,12 @@ sections: - CSP Headers: {{csp_policy}} - XSS Prevention: {{xss_strategy}} - Secure Storage: {{storage_strategy}} - + **Backend Security:** - Input Validation: {{validation_approach}} - Rate Limiting: {{rate_limit_config}} - CORS Policy: {{cors_config}} - + **Authentication Security:** - Token Storage: {{token_strategy}} - Session Management: {{session_approach}} @@ -2445,7 +2475,7 @@ sections: - Bundle Size Target: {{bundle_size}} - Loading Strategy: {{loading_approach}} - Caching Strategy: {{fe_cache_strategy}} - + **Backend Performance:** - Response Time Target: {{response_target}} - Database Optimization: {{db_optimization}} @@ -2461,10 +2491,10 @@ sections: type: code language: text template: | - E2E Tests - / \ - Integration Tests - / \ + E2E Tests + / \ + Integration Tests + / \ Frontend Unit Backend Unit - id: test-organization title: Test Organization @@ -2473,17 +2503,17 @@ sections: title: Frontend Tests type: code language: text - template: "{{frontend_test_structure}}" + template: '{{frontend_test_structure}}' - id: backend-tests title: Backend Tests type: code language: text - template: "{{backend_test_structure}}" + template: '{{backend_test_structure}}' - id: e2e-tests title: E2E Tests type: code language: text - template: "{{e2e_test_structure}}" + template: '{{e2e_test_structure}}' - id: test-examples title: Test Examples sections: @@ -2491,17 +2521,17 @@ sections: title: Frontend Component Test type: code language: typescript - template: "{{frontend_test_example}}" + template: '{{frontend_test_example}}' - id: backend-test title: Backend API Test type: code language: typescript - template: "{{backend_test_example}}" + template: '{{backend_test_example}}' - id: e2e-test title: E2E Test type: code language: typescript - template: "{{e2e_test_example}}" + template: '{{e2e_test_example}}' - id: coding-standards title: Coding Standards @@ -2511,22 +2541,22 @@ sections: - id: critical-rules title: Critical Fullstack Rules repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' examples: - - "**Type Sharing:** Always define types in packages/shared and import from there" - - "**API Calls:** Never make direct HTTP calls - use the service layer" - - "**Environment Variables:** Access only through config objects, never process.env directly" - - "**Error Handling:** All API routes must use the standard error handler" - - "**State Updates:** Never mutate state directly - use proper state management patterns" + - '**Type Sharing:** Always define types in packages/shared and import from there' + - '**API Calls:** Never make direct HTTP calls - use the service layer' + - '**Environment Variables:** Access only through config objects, never process.env directly' + - '**Error Handling:** All API routes must use the standard error handler' + - '**State Updates:** Never mutate state directly - use proper state management patterns' - id: naming-conventions title: Naming Conventions type: table columns: [Element, Frontend, Backend, Example] rows: - - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] - - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] - - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] - - ["Database Tables", "-", "snake_case", "`user_profiles`"] + - ['Components', 'PascalCase', '-', '`UserProfile.tsx`'] + - ['Hooks', "camelCase with 'use'", '-', '`useAuth.ts`'] + - ['API Routes', '-', 'kebab-case', '`/api/user-profile`'] + - ['Database Tables', '-', 'snake_case', '`user_profiles`'] - id: error-handling title: Error Handling Strategy @@ -2537,7 +2567,7 @@ sections: title: Error Flow type: mermaid mermaid_type: sequence - template: "{{error_flow_diagram}}" + template: '{{error_flow_diagram}}' - id: error-format title: Error Response Format type: code @@ -2556,12 +2586,12 @@ sections: title: Frontend Error Handling type: code language: typescript - template: "{{frontend_error_handler}}" + template: '{{frontend_error_handler}}' - id: backend-error-handling title: Backend Error Handling type: code language: typescript - template: "{{backend_error_handler}}" + template: '{{backend_error_handler}}' - id: monitoring title: Monitoring and Observability @@ -2583,7 +2613,7 @@ sections: - JavaScript errors - API response times - User interactions - + **Backend Metrics:** - Request rate - Error rate @@ -2603,7 +2633,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Brownfield Enhancement Architecture" + title: '{{project_name}} Brownfield Enhancement Architecture' workflow: mode: interactive @@ -2614,40 +2644,40 @@ sections: title: Introduction instruction: | IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - + 2. **REQUIRED INPUTS**: - Completed brownfield-prd.md - Existing project technical documentation (from docs folder or user-provided) - Access to existing project structure (IDE or uploaded files) - + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - + If any required inputs are missing, request them before proceeding. elicit: true sections: - id: intro-content content: | This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - + **Relationship to Existing Architecture:** This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - id: existing-project-analysis title: Existing Project Analysis instruction: | Analyze the existing project structure and architecture: - + 1. Review existing documentation in docs folder 2. Examine current technology stack and versions 3. Identify existing architectural patterns and conventions 4. Note current deployment and infrastructure setup 5. Document any constraints or limitations - + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." elicit: true sections: @@ -2661,11 +2691,11 @@ sections: - id: available-docs title: Available Documentation type: bullet-list - template: "- {{existing_docs_summary}}" + template: '- {{existing_docs_summary}}' - id: constraints title: Identified Constraints type: bullet-list - template: "- {{constraint}}" + template: '- {{constraint}}' - id: changelog title: Change Log type: table @@ -2676,12 +2706,12 @@ sections: title: Enhancement Scope and Integration Strategy instruction: | Define how the enhancement will integrate with the existing system: - + 1. Review the brownfield PRD enhancement scope 2. Identify integration points with existing code 3. Define boundaries between new and existing functionality 4. Establish compatibility requirements - + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" elicit: true sections: @@ -2710,7 +2740,7 @@ sections: title: Tech Stack Alignment instruction: | Ensure new components align with existing technology choices: - + 1. Use existing technology stack as the foundation 2. Only introduce new technologies if absolutely necessary 3. Justify any new additions with clear rationale @@ -2733,7 +2763,7 @@ sections: title: Data Models and Schema Changes instruction: | Define new data models and how they integrate with existing schema: - + 1. Identify new entities required for the enhancement 2. Define relationships with existing data models 3. Plan database schema changes (additions, modifications) @@ -2745,15 +2775,15 @@ sections: repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} **Integration:** {{integration_with_existing}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - **With Existing:** {{existing_relationships}} - **With New:** {{new_relationships}} @@ -2765,7 +2795,7 @@ sections: - **Modified Tables:** {{modified_tables_list}} - **New Indexes:** {{new_indexes_list}} - **Migration Strategy:** {{migration_approach}} - + **Backward Compatibility:** - {{compatibility_measure_1}} - {{compatibility_measure_2}} @@ -2774,12 +2804,12 @@ sections: title: Component Architecture instruction: | Define new components and their integration with existing architecture: - + 1. Identify new components required for the enhancement 2. Define interfaces with existing components 3. Establish clear boundaries and responsibilities 4. Plan integration points and data flow - + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" elicit: true sections: @@ -2788,19 +2818,19 @@ sections: repeatable: true sections: - id: component - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} **Integration Points:** {{integration_points}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** - **Existing Components:** {{existing_dependencies}} - **New Components:** {{new_dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: interaction-diagram title: Component Interaction Diagram @@ -2813,7 +2843,7 @@ sections: condition: Enhancement requires API changes instruction: | Define new API endpoints and integration with existing APIs: - + 1. Plan new API endpoints required for the enhancement 2. Ensure consistency with existing API patterns 3. Define authentication and authorization integration @@ -2831,7 +2861,7 @@ sections: repeatable: true sections: - id: endpoint - title: "{{endpoint_name}}" + title: '{{endpoint_name}}' template: | - **Method:** {{http_method}} - **Endpoint:** {{endpoint_path}} @@ -2842,12 +2872,12 @@ sections: title: Request type: code language: json - template: "{{request_schema}}" + template: '{{request_schema}}' - id: response title: Response type: code language: json - template: "{{response_schema}}" + template: '{{response_schema}}' - id: external-api-integration title: External API Integration @@ -2856,24 +2886,24 @@ sections: repeatable: true sections: - id: external-api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL:** {{api_base_url}} - **Authentication:** {{auth_method}} - **Integration Method:** {{integration_approach}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Error Handling:** {{error_handling_strategy}} - id: source-tree-integration title: Source Tree Integration instruction: | Define how new code will integrate with existing project structure: - + 1. Follow existing project organization patterns 2. Identify where new files/folders will be placed 3. Ensure consistency with existing naming conventions @@ -2885,7 +2915,7 @@ sections: type: code language: plaintext instruction: Document relevant parts of current structure - template: "{{existing_structure_relevant_parts}}" + template: '{{existing_structure_relevant_parts}}' - id: new-file-organization title: New File Organization type: code @@ -2912,7 +2942,7 @@ sections: title: Infrastructure and Deployment Integration instruction: | Define how the enhancement will be deployed alongside existing infrastructure: - + 1. Use existing deployment pipeline and infrastructure 2. Identify any infrastructure changes needed 3. Plan deployment strategy to minimize risk @@ -2942,7 +2972,7 @@ sections: title: Coding Standards and Conventions instruction: | Ensure new code follows existing project conventions: - + 1. Document existing coding standards from project analysis 2. Identify any enhancement-specific requirements 3. Ensure consistency with existing codebase patterns @@ -2960,7 +2990,7 @@ sections: title: Enhancement-Specific Standards condition: New patterns needed for enhancement repeatable: true - template: "- **{{standard_name}}:** {{standard_description}}" + template: '- **{{standard_name}}:** {{standard_description}}' - id: integration-rules title: Critical Integration Rules template: | @@ -2973,7 +3003,7 @@ sections: title: Testing Strategy instruction: | Define testing approach for the enhancement: - + 1. Integrate with existing test suite 2. Ensure existing functionality remains intact 3. Plan for testing new features @@ -3013,7 +3043,7 @@ sections: title: Security Integration instruction: | Ensure security consistency with existing system: - + 1. Follow existing security patterns and tools 2. Ensure new features don't introduce vulnerabilities 3. Maintain existing security posture @@ -3048,7 +3078,7 @@ sections: title: Next Steps instruction: | After completing the brownfield architecture: - + 1. Review integration points with existing system 2. Begin story implementation with Dev agent 3. Set up deployment pipeline integration diff --git a/dist/agents/bmad-master.txt b/dist/agents/bmad-master.txt index d3045e38..159444c1 100644 --- a/dist/agents/bmad-master.txt +++ b/dist/agents/bmad-master.txt @@ -248,7 +248,7 @@ Choose a number (0-8) or 9 to proceed: ==================== START: .bmad-core/tasks/facilitate-brainstorming-session.md ==================== --- docOutputLocation: docs/brainstorming-session-results.md -template: ".bmad-core/templates/brainstorming-output-tmpl.yaml" +template: '.bmad-core/templates/brainstorming-output-tmpl.yaml' --- # Facilitate Brainstorming Session Task @@ -2131,7 +2131,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Architecture Document" + title: '{{project_name}} Architecture Document' workflow: mode: interactive @@ -2146,20 +2146,20 @@ sections: - id: intro-content content: | This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - + **Relationship to Frontend Architecture:** If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - + 1. Review the PRD and brainstorming brief for any mentions of: - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) - Existing projects or codebases being used as a foundation - Boilerplate projects or scaffolding tools - Previous projects to be cloned or adapted - + 2. If a starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -2172,16 +2172,16 @@ sections: - Existing architectural patterns and conventions - Any limitations or constraints imposed by the starter - Use this analysis to inform and align your architecture decisions - + 3. If no starter template is mentioned but this is a greenfield project: - Suggest appropriate starter templates based on the tech stack preferences - Explain the benefits (faster setup, best practices, community support) - Let the user decide whether to use one - + 4. If the user confirms no starter template will be used: - Proceed with architecture design from scratch - Note that manual setup will be required for all tooling and configuration - + Document the decision here before proceeding with the architecture design. If none, just say N/A elicit: true - id: changelog @@ -2209,7 +2209,7 @@ sections: title: High Level Overview instruction: | Based on the PRD's Technical Assumptions section, describe: - + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) 2. Repository structure decision from PRD (Monorepo/Polyrepo) 3. Service architecture decision from PRD @@ -2226,49 +2226,49 @@ sections: - Data flow directions - External integrations - User entry points - + - id: architectural-patterns title: Architectural and Design Patterns instruction: | List the key high-level patterns that will guide the architecture. For each pattern: - + 1. Present 2-3 viable options if multiple exist 2. Provide your recommendation with clear rationale 3. Get user confirmation before finalizing 4. These patterns should align with the PRD's technical assumptions and project goals - + Common patterns to consider: - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) - Code organization patterns (Dependency Injection, Repository, Module, Factory) - Data patterns (Event Sourcing, Saga, Database per Service) - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + - '**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences 2. For each category, present 2-3 viable options with pros/cons 3. Make a clear recommendation based on project needs 4. Get explicit user approval for each selection 5. Document exact versions (avoid "latest" - pin specific versions) 6. This table is the single source of truth - all other docs must reference these choices - + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - + - Starter templates (if any) - Languages and runtimes with exact versions - Frameworks and libraries / packages - Cloud provider and key services choices - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion - Development tools - + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. elicit: true sections: @@ -2284,34 +2284,34 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Populate the technology stack table with all relevant technologies examples: - - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" - - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" - - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + - '| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |' + - '| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |' + - '| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |' - id: data-models title: Data Models instruction: | Define the core data models/entities: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - {{relationship_1}} - {{relationship_2}} @@ -2320,7 +2320,7 @@ sections: title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services and their responsibilities 2. Consider the repository structure (monorepo/polyrepo) from PRD 3. Define clear boundaries and interfaces between components @@ -2329,22 +2329,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -2361,29 +2361,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -2392,13 +2392,13 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include error handling paths 4. Document async operations 5. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -2409,13 +2409,13 @@ sections: language: yaml instruction: | If the project includes a REST API: - + 1. Create an OpenAPI 3.0 specification 2. Include all endpoints from epics/stories 3. Define request/response schemas based on data models 4. Document authentication requirements 5. Include example requests/responses - + Use YAML format for better readability. If no REST API, skip this section. elicit: true template: | @@ -2432,13 +2432,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -2448,14 +2448,14 @@ sections: language: plaintext instruction: | Create a project folder structure that reflects: - + 1. The chosen repository structure (monorepo/polyrepo) 2. The service architecture (monolith/microservices/serverless) 3. The selected tech stack and languages 4. Component organization from above 5. Best practices for the chosen frameworks 6. Clear separation of concerns - + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. elicit: true examples: @@ -2473,13 +2473,13 @@ sections: title: Infrastructure and Deployment instruction: | Define the deployment architecture and practices: - + 1. Use IaC tool selected in Tech Stack 2. Choose deployment strategy appropriate for the architecture 3. Define environments and promotion flow 4. Establish rollback procedures 5. Consider security, monitoring, and cost optimization - + Get user input on deployment preferences and CI/CD tool choices. elicit: true sections: @@ -2498,12 +2498,12 @@ sections: - id: environments title: Environments repeatable: true - template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + template: '- **{{env_name}}:** {{env_purpose}} - {{env_details}}' - id: promotion-flow title: Environment Promotion Flow type: code language: text - template: "{{promotion_flow_diagram}}" + template: '{{promotion_flow_diagram}}' - id: rollback-strategy title: Rollback Strategy template: | @@ -2515,13 +2515,13 @@ sections: title: Error Handling Strategy instruction: | Define comprehensive error handling approach: - + 1. Choose appropriate patterns for the language/framework from Tech Stack 2. Define logging standards and tools 3. Establish error categories and handling rules 4. Consider observability and debugging needs 5. Ensure security (no sensitive data in logs) - + This section guides both AI and human developers in consistent error handling. elicit: true sections: @@ -2568,13 +2568,13 @@ sections: title: Coding Standards instruction: | These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - + 1. This section directly controls AI developer behavior 2. Keep it minimal - assume AI knows general best practices 3. Focus on project-specific conventions and gotchas 4. Overly detailed standards bloat context and slow development 5. Standards will be extracted to separate file for dev agent use - + For each standard, get explicit user confirmation it's necessary. elicit: true sections: @@ -2596,32 +2596,32 @@ sections: - "Never use console.log in production code - use logger" - "All API responses must use ApiResponse wrapper type" - "Database queries must use repository pattern, never direct ORM" - + Avoid obvious rules like "use SOLID principles" or "write clean code" repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' - id: language-specifics title: Language-Specific Guidelines condition: Critical language-specific rules needed instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. sections: - id: language-rules - title: "{{language_name}} Specifics" + title: '{{language_name}} Specifics' repeatable: true - template: "- **{{rule_topic}}:** {{rule_detail}}" + template: '- **{{rule_topic}}:** {{rule_detail}}' - id: test-strategy title: Test Strategy and Standards instruction: | Work with user to define comprehensive test strategy: - + 1. Use test frameworks from Tech Stack 2. Decide on TDD vs test-after approach 3. Define test organization and naming 4. Establish coverage goals 5. Determine integration test infrastructure 6. Plan for test data and external dependencies - + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. elicit: true sections: @@ -2642,7 +2642,7 @@ sections: - **Location:** {{unit_test_location}} - **Mocking Library:** {{mocking_library}} - **Coverage Requirement:** {{unit_coverage}} - + **AI Agent Requirements:** - Generate tests for all public methods - Cover edge cases and error conditions @@ -2656,9 +2656,9 @@ sections: - **Test Infrastructure:** - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) examples: - - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" - - "**Message Queue:** Embedded Kafka for tests" - - "**External APIs:** WireMock for stubbing" + - '**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration' + - '**Message Queue:** Embedded Kafka for tests' + - '**External APIs:** WireMock for stubbing' - id: e2e-tests title: End-to-End Tests template: | @@ -2684,7 +2684,7 @@ sections: title: Security instruction: | Define MANDATORY security requirements for AI and human developers: - + 1. Focus on implementation-specific rules 2. Reference security tools from Tech Stack 3. Define clear patterns for common scenarios @@ -2753,16 +2753,16 @@ sections: title: Next Steps instruction: | After completing the architecture: - + 1. If project has UI components: - Use "Frontend Architecture Mode" - Provide this document as input - + 2. For all projects: - Review with Product Owner - Begin story implementation with Dev agent - Set up infrastructure with DevOps agent - + 3. Include specific prompts for next agents if needed sections: - id: architect-prompt @@ -2784,7 +2784,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Brownfield Enhancement Architecture" + title: '{{project_name}} Brownfield Enhancement Architecture' workflow: mode: interactive @@ -2795,40 +2795,40 @@ sections: title: Introduction instruction: | IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - + 2. **REQUIRED INPUTS**: - Completed brownfield-prd.md - Existing project technical documentation (from docs folder or user-provided) - Access to existing project structure (IDE or uploaded files) - + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - + If any required inputs are missing, request them before proceeding. elicit: true sections: - id: intro-content content: | This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - + **Relationship to Existing Architecture:** This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - id: existing-project-analysis title: Existing Project Analysis instruction: | Analyze the existing project structure and architecture: - + 1. Review existing documentation in docs folder 2. Examine current technology stack and versions 3. Identify existing architectural patterns and conventions 4. Note current deployment and infrastructure setup 5. Document any constraints or limitations - + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." elicit: true sections: @@ -2842,11 +2842,11 @@ sections: - id: available-docs title: Available Documentation type: bullet-list - template: "- {{existing_docs_summary}}" + template: '- {{existing_docs_summary}}' - id: constraints title: Identified Constraints type: bullet-list - template: "- {{constraint}}" + template: '- {{constraint}}' - id: changelog title: Change Log type: table @@ -2857,12 +2857,12 @@ sections: title: Enhancement Scope and Integration Strategy instruction: | Define how the enhancement will integrate with the existing system: - + 1. Review the brownfield PRD enhancement scope 2. Identify integration points with existing code 3. Define boundaries between new and existing functionality 4. Establish compatibility requirements - + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" elicit: true sections: @@ -2891,7 +2891,7 @@ sections: title: Tech Stack Alignment instruction: | Ensure new components align with existing technology choices: - + 1. Use existing technology stack as the foundation 2. Only introduce new technologies if absolutely necessary 3. Justify any new additions with clear rationale @@ -2914,7 +2914,7 @@ sections: title: Data Models and Schema Changes instruction: | Define new data models and how they integrate with existing schema: - + 1. Identify new entities required for the enhancement 2. Define relationships with existing data models 3. Plan database schema changes (additions, modifications) @@ -2926,15 +2926,15 @@ sections: repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} **Integration:** {{integration_with_existing}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - **With Existing:** {{existing_relationships}} - **With New:** {{new_relationships}} @@ -2946,7 +2946,7 @@ sections: - **Modified Tables:** {{modified_tables_list}} - **New Indexes:** {{new_indexes_list}} - **Migration Strategy:** {{migration_approach}} - + **Backward Compatibility:** - {{compatibility_measure_1}} - {{compatibility_measure_2}} @@ -2955,12 +2955,12 @@ sections: title: Component Architecture instruction: | Define new components and their integration with existing architecture: - + 1. Identify new components required for the enhancement 2. Define interfaces with existing components 3. Establish clear boundaries and responsibilities 4. Plan integration points and data flow - + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" elicit: true sections: @@ -2969,19 +2969,19 @@ sections: repeatable: true sections: - id: component - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} **Integration Points:** {{integration_points}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** - **Existing Components:** {{existing_dependencies}} - **New Components:** {{new_dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: interaction-diagram title: Component Interaction Diagram @@ -2994,7 +2994,7 @@ sections: condition: Enhancement requires API changes instruction: | Define new API endpoints and integration with existing APIs: - + 1. Plan new API endpoints required for the enhancement 2. Ensure consistency with existing API patterns 3. Define authentication and authorization integration @@ -3012,7 +3012,7 @@ sections: repeatable: true sections: - id: endpoint - title: "{{endpoint_name}}" + title: '{{endpoint_name}}' template: | - **Method:** {{http_method}} - **Endpoint:** {{endpoint_path}} @@ -3023,12 +3023,12 @@ sections: title: Request type: code language: json - template: "{{request_schema}}" + template: '{{request_schema}}' - id: response title: Response type: code language: json - template: "{{response_schema}}" + template: '{{response_schema}}' - id: external-api-integration title: External API Integration @@ -3037,24 +3037,24 @@ sections: repeatable: true sections: - id: external-api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL:** {{api_base_url}} - **Authentication:** {{auth_method}} - **Integration Method:** {{integration_approach}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Error Handling:** {{error_handling_strategy}} - id: source-tree-integration title: Source Tree Integration instruction: | Define how new code will integrate with existing project structure: - + 1. Follow existing project organization patterns 2. Identify where new files/folders will be placed 3. Ensure consistency with existing naming conventions @@ -3066,7 +3066,7 @@ sections: type: code language: plaintext instruction: Document relevant parts of current structure - template: "{{existing_structure_relevant_parts}}" + template: '{{existing_structure_relevant_parts}}' - id: new-file-organization title: New File Organization type: code @@ -3093,7 +3093,7 @@ sections: title: Infrastructure and Deployment Integration instruction: | Define how the enhancement will be deployed alongside existing infrastructure: - + 1. Use existing deployment pipeline and infrastructure 2. Identify any infrastructure changes needed 3. Plan deployment strategy to minimize risk @@ -3123,7 +3123,7 @@ sections: title: Coding Standards and Conventions instruction: | Ensure new code follows existing project conventions: - + 1. Document existing coding standards from project analysis 2. Identify any enhancement-specific requirements 3. Ensure consistency with existing codebase patterns @@ -3141,7 +3141,7 @@ sections: title: Enhancement-Specific Standards condition: New patterns needed for enhancement repeatable: true - template: "- **{{standard_name}}:** {{standard_description}}" + template: '- **{{standard_name}}:** {{standard_description}}' - id: integration-rules title: Critical Integration Rules template: | @@ -3154,7 +3154,7 @@ sections: title: Testing Strategy instruction: | Define testing approach for the enhancement: - + 1. Integrate with existing test suite 2. Ensure existing functionality remains intact 3. Plan for testing new features @@ -3194,7 +3194,7 @@ sections: title: Security Integration instruction: | Ensure security consistency with existing system: - + 1. Follow existing security patterns and tools 2. Ensure new features don't introduce vulnerabilities 3. Maintain existing security posture @@ -3229,7 +3229,7 @@ sections: title: Next Steps instruction: | After completing the brownfield architecture: - + 1. Review integration points with existing system 2. Begin story implementation with Dev agent 3. Set up deployment pipeline integration @@ -3263,7 +3263,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Brownfield Enhancement PRD" + title: '{{project_name}} Brownfield Enhancement PRD' workflow: mode: interactive @@ -3274,19 +3274,19 @@ sections: title: Intro Project Analysis and Context instruction: | IMPORTANT - SCOPE ASSESSMENT REQUIRED: - + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. - + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - + Do not proceed with any recommendations until the user has validated your understanding of the existing system. sections: - id: existing-project-overview @@ -3312,7 +3312,7 @@ sections: - Note: "Document-project analysis available - using existing technical documentation" - List key documents created by document-project - Skip the missing documentation check below - + Otherwise, check for existing documentation: sections: - id: available-docs @@ -3326,7 +3326,7 @@ sections: - External API Documentation [[LLM: If from document-project, check ✓]] - UX/UI Guidelines [[LLM: May not be in document-project]] - Technical Debt Documentation [[LLM: If from document-project, check ✓]] - - "Other: {{other_docs}}" + - 'Other: {{other_docs}}' instruction: | - If document-project was already run: "Using existing project analysis from document-project output." - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." @@ -3346,7 +3346,7 @@ sections: - UI/UX Overhaul - Technology Stack Upgrade - Bug Fix and Stability Improvements - - "Other: {{other_type}}" + - 'Other: {{other_type}}' - id: enhancement-description title: Enhancement Description instruction: 2-3 sentences describing what the user wants to add or change @@ -3387,29 +3387,29 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown with identifier starting with FR examples: - - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - 'FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system examples: - - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - 'NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.' - id: compatibility title: Compatibility Requirements instruction: Critical for brownfield - what must remain compatible type: numbered-list prefix: CR - template: "{{requirement}}: {{description}}" + template: '{{requirement}}: {{description}}' items: - id: cr1 - template: "CR1: {{existing_api_compatibility}}" + template: 'CR1: {{existing_api_compatibility}}' - id: cr2 - template: "CR2: {{database_schema_compatibility}}" + template: 'CR2: {{database_schema_compatibility}}' - id: cr3 - template: "CR3: {{ui_ux_consistency}}" + template: 'CR3: {{ui_ux_consistency}}' - id: cr4 - template: "CR4: {{integration_compatibility}}" + template: 'CR4: {{integration_compatibility}}' - id: ui-enhancement-goals title: User Interface Enhancement Goals @@ -3436,7 +3436,7 @@ sections: If document-project output available: - Extract from "Actual Tech Stack" table in High Level Architecture section - Include version numbers and any noted constraints - + Otherwise, document the current technology stack: template: | **Languages**: {{languages}} @@ -3475,7 +3475,7 @@ sections: - Reference "Technical Debt and Known Issues" section - Include "Workarounds and Gotchas" that might impact enhancement - Note any identified constraints from "Critical Technical Debt" - + Build risk assessment incorporating existing known issues: template: | **Technical Risks**: {{technical_risks}} @@ -3492,13 +3492,13 @@ sections: - id: epic-approach title: Epic Approach instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features - template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + template: '**Epic Structure Decision**: {{epic_decision}} with rationale' - id: epic-details - title: "Epic 1: {{enhancement_title}}" + title: 'Epic 1: {{enhancement_title}}' instruction: | Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality - + CRITICAL STORY SEQUENCING FOR BROWNFIELD: - Stories must ensure existing functionality remains intact - Each story should include verification that existing features still work @@ -3511,11 +3511,11 @@ sections: - Each story must deliver value while maintaining system integrity template: | **Epic Goal**: {{epic_goal}} - + **Integration Requirements**: {{integration_requirements}} sections: - id: story - title: "Story 1.{{story_number}} {{story_title}}" + title: 'Story 1.{{story_number}} {{story_title}}' repeatable: true template: | As a {{user_type}}, @@ -3526,16 +3526,16 @@ sections: title: Acceptance Criteria type: numbered-list instruction: Define criteria that include both new functionality and existing system integrity - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' - id: integration-verification title: Integration Verification instruction: Specific verification steps to ensure existing functionality remains intact type: numbered-list prefix: IV items: - - template: "IV1: {{existing_functionality_verification}}" - - template: "IV2: {{integration_point_verification}}" - - template: "IV3: {{performance_impact_verification}}" + - template: 'IV1: {{existing_functionality_verification}}' + - template: 'IV2: {{integration_point_verification}}' + - template: 'IV3: {{performance_impact_verification}}' ==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== ==================== START: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== @@ -3546,24 +3546,24 @@ template: output: format: markdown filename: docs/competitor-analysis.md - title: "Competitive Analysis Report: {{project_product_name}}" + title: 'Competitive Analysis Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Competitive Analysis Elicitation Actions" + title: 'Competitive Analysis Elicitation Actions' options: - "Deep dive on a specific competitor's strategy" - - "Analyze competitive dynamics in a specific segment" - - "War game competitive responses to your moves" - - "Explore partnership vs. competition scenarios" - - "Stress test differentiation claims" - - "Analyze disruption potential (yours or theirs)" - - "Compare to competition in adjacent markets" - - "Generate win/loss analysis insights" + - 'Analyze competitive dynamics in a specific segment' + - 'War game competitive responses to your moves' + - 'Explore partnership vs. competition scenarios' + - 'Stress test differentiation claims' + - 'Analyze disruption potential (yours or theirs)' + - 'Compare to competition in adjacent markets' + - 'Generate win/loss analysis insights' - "If only we had known about [competitor X's plan]..." - - "Proceed to next section" + - 'Proceed to next section' sections: - id: executive-summary @@ -3617,7 +3617,7 @@ sections: title: Competitor Prioritization Matrix instruction: | Help categorize competitors by market share and strategic threat level - + Create a 2x2 matrix: - Priority 1 (Core Competitors): High Market Share + High Threat - Priority 2 (Emerging Threats): Low Market Share + High Threat @@ -3630,7 +3630,7 @@ sections: repeatable: true sections: - id: competitor - title: "{{competitor_name}} - Priority {{priority_level}}" + title: '{{competitor_name}} - Priority {{priority_level}}' sections: - id: company-overview title: Company Overview @@ -3662,11 +3662,11 @@ sections: - id: strengths title: Strengths type: bullet-list - template: "- {{strength}}" + template: '- {{strength}}' - id: weaknesses title: Weaknesses type: bullet-list - template: "- {{weakness}}" + template: '- {{weakness}}' - id: market-position title: Market Position & Performance template: | @@ -3682,24 +3682,37 @@ sections: title: Feature Comparison Matrix instruction: Create a detailed comparison table of key features across competitors type: table - columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + columns: + [ + 'Feature Category', + '{{your_company}}', + '{{competitor_1}}', + '{{competitor_2}}', + '{{competitor_3}}', + ] rows: - - category: "Core Functionality" + - category: 'Core Functionality' items: - - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - category: "User Experience" + - ['Feature A', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - ['Feature B', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - category: 'User Experience' items: - - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] - - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] - - category: "Integration & Ecosystem" + - ['Mobile App', '{{rating}}', '{{rating}}', '{{rating}}', '{{rating}}'] + - ['Onboarding Time', '{{time}}', '{{time}}', '{{time}}', '{{time}}'] + - category: 'Integration & Ecosystem' items: - - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] - - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] - - category: "Pricing & Plans" + - [ + 'API Availability', + '{{availability}}', + '{{availability}}', + '{{availability}}', + '{{availability}}', + ] + - ['Third-party Integrations', '{{number}}', '{{number}}', '{{number}}', '{{number}}'] + - category: 'Pricing & Plans' items: - - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] - - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - ['Starting Price', '{{price}}', '{{price}}', '{{price}}', '{{price}}'] + - ['Free Tier', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}'] - id: swot-comparison title: SWOT Comparison instruction: Create SWOT analysis for your solution vs. top competitors @@ -3712,7 +3725,7 @@ sections: - **Opportunities:** {{opportunities}} - **Threats:** {{threats}} - id: vs-competitor - title: "vs. {{main_competitor}}" + title: 'vs. {{main_competitor}}' template: | - **Competitive Advantages:** {{your_advantages}} - **Competitive Disadvantages:** {{their_advantages}} @@ -3721,7 +3734,7 @@ sections: title: Positioning Map instruction: | Describe competitor positions on key dimensions - + Create a positioning description using 2 key dimensions relevant to the market, such as: - Price vs. Features - Ease of Use vs. Power @@ -3756,7 +3769,7 @@ sections: title: Blue Ocean Opportunities instruction: | Identify uncontested market spaces - + List opportunities to create new market space: - Underserved segments - Unaddressed use cases @@ -3842,7 +3855,7 @@ template: output: format: markdown filename: docs/ui-architecture.md - title: "{{project_name}} Frontend Architecture Document" + title: '{{project_name}} Frontend Architecture Document' workflow: mode: interactive @@ -3853,16 +3866,16 @@ sections: title: Template and Framework Selection instruction: | Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. - + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - UI kit or component library starters - Existing frontend projects being used as a foundation - Admin dashboard templates or other specialized starters - Design system implementations - + 2. If a frontend starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -3878,7 +3891,7 @@ sections: - Testing setup and patterns - Build and development scripts - Use this analysis to ensure your frontend architecture aligns with the starter's patterns - + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - Based on the framework choice, suggest appropriate starters: - React: Create React App, Next.js, Vite + React @@ -3886,11 +3899,11 @@ sections: - Angular: Angular CLI - Or suggest popular UI templates if applicable - Explain benefits specific to frontend development - + 4. If the user confirms no starter template will be used: - Note that all tooling, bundling, and configuration will need manual setup - Proceed with frontend architecture from scratch - + Document the starter template decision and any constraints it imposes before proceeding. sections: - id: changelog @@ -3910,17 +3923,29 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Fill in appropriate technology choices based on the selected framework and project requirements. rows: - - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Framework', '{{framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['UI Library', '{{ui_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'State Management', + '{{state_management}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Routing', '{{routing_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Styling', '{{styling_solution}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Testing', '{{test_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Component Library', + '{{component_lib}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Form Handling', '{{form_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Animation', '{{animation_lib}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Dev Tools', '{{dev_tools}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: project-structure title: Project Structure @@ -4014,12 +4039,12 @@ sections: title: Testing Best Practices type: numbered-list items: - - "**Unit Tests**: Test individual components in isolation" - - "**Integration Tests**: Test component interactions" - - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" - - "**Coverage Goals**: Aim for 80% code coverage" - - "**Test Structure**: Arrange-Act-Assert pattern" - - "**Mock External Dependencies**: API calls, routing, state management" + - '**Unit Tests**: Test individual components in isolation' + - '**Integration Tests**: Test component interactions' + - '**E2E Tests**: Test critical user flows (using Cypress/Playwright)' + - '**Coverage Goals**: Aim for 80% code coverage' + - '**Test Structure**: Arrange-Act-Assert pattern' + - '**Mock External Dependencies**: API calls, routing, state management' - id: environment-configuration title: Environment Configuration @@ -4051,7 +4076,7 @@ template: output: format: markdown filename: docs/front-end-spec.md - title: "{{project_name}} UI/UX Specification" + title: '{{project_name}} UI/UX Specification' workflow: mode: interactive @@ -4062,7 +4087,7 @@ sections: title: Introduction instruction: | Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification. - + Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted. content: | This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{project_name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. @@ -4071,7 +4096,7 @@ sections: title: Overall UX Goals & Principles instruction: | Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: - + 1. Target User Personas - elicit details or confirm existing ones from PRD 2. Key Usability Goals - understand what success looks like for users 3. Core Design Principles - establish 3-5 guiding principles @@ -4079,29 +4104,29 @@ sections: sections: - id: user-personas title: Target User Personas - template: "{{persona_descriptions}}" + template: '{{persona_descriptions}}' examples: - - "**Power User:** Technical professionals who need advanced features and efficiency" - - "**Casual User:** Occasional users who prioritize ease of use and clear guidance" - - "**Administrator:** System managers who need control and oversight capabilities" + - '**Power User:** Technical professionals who need advanced features and efficiency' + - '**Casual User:** Occasional users who prioritize ease of use and clear guidance' + - '**Administrator:** System managers who need control and oversight capabilities' - id: usability-goals title: Usability Goals - template: "{{usability_goals}}" + template: '{{usability_goals}}' examples: - - "Ease of learning: New users can complete core tasks within 5 minutes" - - "Efficiency of use: Power users can complete frequent tasks with minimal clicks" - - "Error prevention: Clear validation and confirmation for destructive actions" - - "Memorability: Infrequent users can return without relearning" + - 'Ease of learning: New users can complete core tasks within 5 minutes' + - 'Efficiency of use: Power users can complete frequent tasks with minimal clicks' + - 'Error prevention: Clear validation and confirmation for destructive actions' + - 'Memorability: Infrequent users can return without relearning' - id: design-principles title: Design Principles - template: "{{design_principles}}" + template: '{{design_principles}}' type: numbered-list examples: - - "**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation" + - '**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation' - "**Progressive disclosure** - Show only what's needed, when it's needed" - - "**Consistent patterns** - Use familiar UI patterns throughout the application" - - "**Immediate feedback** - Every action should have a clear, immediate response" - - "**Accessible by default** - Design for all users from the start" + - '**Consistent patterns** - Use familiar UI patterns throughout the application' + - '**Immediate feedback** - Every action should have a clear, immediate response' + - '**Accessible by default** - Design for all users from the start' - id: changelog title: Change Log type: table @@ -4112,7 +4137,7 @@ sections: title: Information Architecture (IA) instruction: | Collaborate with the user to create a comprehensive information architecture: - + 1. Build a Site Map or Screen Inventory showing all major areas 2. Define the Navigation Structure (primary, secondary, breadcrumbs) 3. Use Mermaid diagrams for visual representation @@ -4123,7 +4148,7 @@ sections: title: Site Map / Screen Inventory type: mermaid mermaid_type: graph - template: "{{sitemap_diagram}}" + template: '{{sitemap_diagram}}' examples: - | graph TD @@ -4142,46 +4167,46 @@ sections: title: Navigation Structure template: | **Primary Navigation:** {{primary_nav_description}} - + **Secondary Navigation:** {{secondary_nav_description}} - + **Breadcrumb Strategy:** {{breadcrumb_strategy}} - id: user-flows title: User Flows instruction: | For each critical user task identified in the PRD: - + 1. Define the user's goal clearly 2. Map out all steps including decision points 3. Consider edge cases and error states 4. Use Mermaid flow diagrams for clarity 5. Link to external tools (Figma/Miro) if detailed flows exist there - + Create subsections for each major flow. elicit: true repeatable: true sections: - id: flow - title: "{{flow_name}}" + title: '{{flow_name}}' template: | **User Goal:** {{flow_goal}} - + **Entry Points:** {{entry_points}} - + **Success Criteria:** {{success_criteria}} sections: - id: flow-diagram title: Flow Diagram type: mermaid mermaid_type: graph - template: "{{flow_diagram}}" + template: '{{flow_diagram}}' - id: edge-cases - title: "Edge Cases & Error Handling:" + title: 'Edge Cases & Error Handling:' type: bullet-list - template: "- {{edge_case}}" + template: '- {{edge_case}}' - id: notes - template: "**Notes:** {{flow_notes}}" + template: '**Notes:** {{flow_notes}}' - id: wireframes-mockups title: Wireframes & Mockups @@ -4190,23 +4215,23 @@ sections: elicit: true sections: - id: design-files - template: "**Primary Design Files:** {{design_tool_link}}" + template: '**Primary Design Files:** {{design_tool_link}}' - id: key-screen-layouts title: Key Screen Layouts repeatable: true sections: - id: screen - title: "{{screen_name}}" + title: '{{screen_name}}' template: | **Purpose:** {{screen_purpose}} - + **Key Elements:** - {{element_1}} - {{element_2}} - {{element_3}} - + **Interaction Notes:** {{interaction_notes}} - + **Design File Reference:** {{specific_frame_link}} - id: component-library @@ -4216,20 +4241,20 @@ sections: elicit: true sections: - id: design-system-approach - template: "**Design System Approach:** {{design_system_approach}}" + template: '**Design System Approach:** {{design_system_approach}}' - id: core-components title: Core Components repeatable: true sections: - id: component - title: "{{component_name}}" + title: '{{component_name}}' template: | **Purpose:** {{component_purpose}} - + **Variants:** {{component_variants}} - + **States:** {{component_states}} - + **Usage Guidelines:** {{usage_guidelines}} - id: branding-style @@ -4239,19 +4264,19 @@ sections: sections: - id: visual-identity title: Visual Identity - template: "**Brand Guidelines:** {{brand_guidelines_link}}" + template: '**Brand Guidelines:** {{brand_guidelines_link}}' - id: color-palette title: Color Palette type: table - columns: ["Color Type", "Hex Code", "Usage"] + columns: ['Color Type', 'Hex Code', 'Usage'] rows: - - ["Primary", "{{primary_color}}", "{{primary_usage}}"] - - ["Secondary", "{{secondary_color}}", "{{secondary_usage}}"] - - ["Accent", "{{accent_color}}", "{{accent_usage}}"] - - ["Success", "{{success_color}}", "Positive feedback, confirmations"] - - ["Warning", "{{warning_color}}", "Cautions, important notices"] - - ["Error", "{{error_color}}", "Errors, destructive actions"] - - ["Neutral", "{{neutral_colors}}", "Text, borders, backgrounds"] + - ['Primary', '{{primary_color}}', '{{primary_usage}}'] + - ['Secondary', '{{secondary_color}}', '{{secondary_usage}}'] + - ['Accent', '{{accent_color}}', '{{accent_usage}}'] + - ['Success', '{{success_color}}', 'Positive feedback, confirmations'] + - ['Warning', '{{warning_color}}', 'Cautions, important notices'] + - ['Error', '{{error_color}}', 'Errors, destructive actions'] + - ['Neutral', '{{neutral_colors}}', 'Text, borders, backgrounds'] - id: typography title: Typography sections: @@ -4264,24 +4289,24 @@ sections: - id: type-scale title: Type Scale type: table - columns: ["Element", "Size", "Weight", "Line Height"] + columns: ['Element', 'Size', 'Weight', 'Line Height'] rows: - - ["H1", "{{h1_size}}", "{{h1_weight}}", "{{h1_line}}"] - - ["H2", "{{h2_size}}", "{{h2_weight}}", "{{h2_line}}"] - - ["H3", "{{h3_size}}", "{{h3_weight}}", "{{h3_line}}"] - - ["Body", "{{body_size}}", "{{body_weight}}", "{{body_line}}"] - - ["Small", "{{small_size}}", "{{small_weight}}", "{{small_line}}"] + - ['H1', '{{h1_size}}', '{{h1_weight}}', '{{h1_line}}'] + - ['H2', '{{h2_size}}', '{{h2_weight}}', '{{h2_line}}'] + - ['H3', '{{h3_size}}', '{{h3_weight}}', '{{h3_line}}'] + - ['Body', '{{body_size}}', '{{body_weight}}', '{{body_line}}'] + - ['Small', '{{small_size}}', '{{small_weight}}', '{{small_line}}'] - id: iconography title: Iconography template: | **Icon Library:** {{icon_library}} - + **Usage Guidelines:** {{icon_guidelines}} - id: spacing-layout title: Spacing & Layout template: | **Grid System:** {{grid_system}} - + **Spacing Scale:** {{spacing_scale}} - id: accessibility @@ -4291,7 +4316,7 @@ sections: sections: - id: compliance-target title: Compliance Target - template: "**Standard:** {{compliance_standard}}" + template: '**Standard:** {{compliance_standard}}' - id: key-requirements title: Key Requirements template: | @@ -4299,19 +4324,19 @@ sections: - Color contrast ratios: {{contrast_requirements}} - Focus indicators: {{focus_requirements}} - Text sizing: {{text_requirements}} - + **Interaction:** - Keyboard navigation: {{keyboard_requirements}} - Screen reader support: {{screen_reader_requirements}} - Touch targets: {{touch_requirements}} - + **Content:** - Alternative text: {{alt_text_requirements}} - Heading structure: {{heading_requirements}} - Form labels: {{form_requirements}} - id: testing-strategy title: Testing Strategy - template: "{{accessibility_testing}}" + template: '{{accessibility_testing}}' - id: responsiveness title: Responsiveness Strategy @@ -4321,21 +4346,21 @@ sections: - id: breakpoints title: Breakpoints type: table - columns: ["Breakpoint", "Min Width", "Max Width", "Target Devices"] + columns: ['Breakpoint', 'Min Width', 'Max Width', 'Target Devices'] rows: - - ["Mobile", "{{mobile_min}}", "{{mobile_max}}", "{{mobile_devices}}"] - - ["Tablet", "{{tablet_min}}", "{{tablet_max}}", "{{tablet_devices}}"] - - ["Desktop", "{{desktop_min}}", "{{desktop_max}}", "{{desktop_devices}}"] - - ["Wide", "{{wide_min}}", "-", "{{wide_devices}}"] + - ['Mobile', '{{mobile_min}}', '{{mobile_max}}', '{{mobile_devices}}'] + - ['Tablet', '{{tablet_min}}', '{{tablet_max}}', '{{tablet_devices}}'] + - ['Desktop', '{{desktop_min}}', '{{desktop_max}}', '{{desktop_devices}}'] + - ['Wide', '{{wide_min}}', '-', '{{wide_devices}}'] - id: adaptation-patterns title: Adaptation Patterns template: | **Layout Changes:** {{layout_adaptations}} - + **Navigation Changes:** {{nav_adaptations}} - + **Content Priority:** {{content_adaptations}} - + **Interaction Changes:** {{interaction_adaptations}} - id: animation @@ -4345,11 +4370,11 @@ sections: sections: - id: motion-principles title: Motion Principles - template: "{{motion_principles}}" + template: '{{motion_principles}}' - id: key-animations title: Key Animations repeatable: true - template: "- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})" + template: '- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})' - id: performance title: Performance Considerations @@ -4363,13 +4388,13 @@ sections: - **Animation FPS:** {{animation_goal}} - id: design-strategies title: Design Strategies - template: "{{performance_strategies}}" + template: '{{performance_strategies}}' - id: next-steps title: Next Steps instruction: | After completing the UI/UX specification: - + 1. Recommend review with stakeholders 2. Suggest creating/updating visual designs in design tool 3. Prepare for handoff to Design Architect for frontend architecture @@ -4378,17 +4403,17 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action}}" + template: '{{action}}' - id: design-handoff-checklist title: Design Handoff Checklist type: checklist items: - - "All user flows documented" - - "Component inventory complete" - - "Accessibility requirements defined" - - "Responsive strategy clear" - - "Brand guidelines incorporated" - - "Performance goals established" + - 'All user flows documented' + - 'Component inventory complete' + - 'Accessibility requirements defined' + - 'Responsive strategy clear' + - 'Brand guidelines incorporated' + - 'Performance goals established' - id: checklist-results title: Checklist Results @@ -4403,7 +4428,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Fullstack Architecture Document" + title: '{{project_name}} Fullstack Architecture Document' workflow: mode: interactive @@ -4417,33 +4442,33 @@ sections: elicit: true content: | This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. sections: - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - + 1. Review the PRD and other documents for mentions of: - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) - Monorepo templates (e.g., Nx, Turborepo starters) - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) - Existing projects being extended or cloned - + 2. If starter templates or existing projects are mentioned: - Ask the user to provide access (links, repos, or files) - Analyze to understand pre-configured choices and constraints - Note any architectural decisions already made - Identify what can be modified vs what must be retained - + 3. If no starter is mentioned but this is greenfield: - Suggest appropriate fullstack starters based on tech preferences - Consider platform-specific options (Vercel, AWS, etc.) - Let user decide whether to use one - + 4. Document the decision and any constraints it imposes - + If none, state "N/A - Greenfield project" - id: changelog title: Change Log @@ -4469,17 +4494,17 @@ sections: title: Platform and Infrastructure Choice instruction: | Based on PRD requirements and technical assumptions, make a platform recommendation: - + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - **Azure**: For .NET ecosystems or enterprise Microsoft environments - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - + 2. Present 2-3 viable options with clear pros/cons 3. Make a recommendation with rationale 4. Get explicit user confirmation - + Document the choice and key services that will be used. template: | **Platform:** {{selected_platform}} @@ -4489,7 +4514,7 @@ sections: title: Repository Structure instruction: | Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: - + 1. For modern fullstack apps, monorepo is often preferred 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) 3. Define package/app boundaries @@ -4511,7 +4536,7 @@ sections: - Databases and storage - External integrations - CDN and caching layers - + Use appropriate diagram type for clarity. - id: architectural-patterns title: Architectural Patterns @@ -4521,21 +4546,21 @@ sections: - Frontend patterns (e.g., Component-based, State management) - Backend patterns (e.g., Repository, CQRS, Event-driven) - Integration patterns (e.g., BFF, API Gateway) - + For each pattern, provide recommendation and rationale. repeatable: true - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" - - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + - '**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications' + - '**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - + Key areas to cover: - Frontend and backend languages/frameworks - Databases and caching @@ -4544,7 +4569,7 @@ sections: - Testing tools for both frontend and backend - Build and deployment tools - Monitoring and logging - + Upon render, elicit feedback immediately. elicit: true sections: @@ -4553,49 +4578,67 @@ sections: type: table columns: [Category, Technology, Version, Purpose, Rationale] rows: - - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Frontend Language', '{{fe_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Frontend Framework', + '{{fe_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - [ + 'UI Component Library', + '{{ui_library}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['State Management', '{{state_mgmt}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Language', '{{be_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Backend Framework', + '{{be_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['API Style', '{{api_style}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Database', '{{database}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Cache', '{{cache}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['File Storage', '{{storage}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Authentication', '{{auth}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Frontend Testing', '{{fe_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Testing', '{{be_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['E2E Testing', '{{e2e_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Bundler', '{{bundler}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['IaC Tool', '{{iac_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CI/CD', '{{cicd}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Monitoring', '{{monitoring}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Logging', '{{logging}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CSS Framework', '{{css_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: data-models title: Data Models instruction: | Define the core data models/entities that will be shared between frontend and backend: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Create TypeScript interfaces that can be shared 6. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} @@ -4604,17 +4647,17 @@ sections: title: TypeScript Interface type: code language: typescript - template: "{{model_interface}}" + template: '{{model_interface}}' - id: relationships title: Relationships type: bullet-list - template: "- {{relationship}}" + template: '- {{relationship}}' - id: api-spec title: API Specification instruction: | Based on the chosen API style from Tech Stack: - + 1. If REST API, create an OpenAPI 3.0 specification 2. If GraphQL, provide the GraphQL schema 3. If tRPC, show router definitions @@ -4622,7 +4665,7 @@ sections: 5. Define request/response schemas based on data models 6. Document authentication requirements 7. Include example requests/responses - + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. elicit: true sections: @@ -4645,19 +4688,19 @@ sections: condition: API style is GraphQL type: code language: graphql - template: "{{graphql_schema}}" + template: '{{graphql_schema}}' - id: trpc-api title: tRPC Router Definitions condition: API style is tRPC type: code language: typescript - template: "{{trpc_routers}}" + template: '{{trpc_routers}}' - id: components title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services across the fullstack 2. Consider both frontend and backend components 3. Define clear boundaries and interfaces between components @@ -4666,22 +4709,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -4698,29 +4741,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -4729,14 +4772,14 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include both frontend and backend flows 4. Include error handling paths 5. Document async operations 6. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -4744,13 +4787,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -4767,12 +4810,12 @@ sections: title: Component Organization type: code language: text - template: "{{component_structure}}" + template: '{{component_structure}}' - id: component-template title: Component Template type: code language: typescript - template: "{{component_template}}" + template: '{{component_template}}' - id: state-management title: State Management Architecture instruction: Detail state management approach based on chosen solution. @@ -4781,11 +4824,11 @@ sections: title: State Structure type: code language: typescript - template: "{{state_structure}}" + template: '{{state_structure}}' - id: state-patterns title: State Management Patterns type: bullet-list - template: "- {{pattern}}" + template: '- {{pattern}}' - id: routing-architecture title: Routing Architecture instruction: Define routing structure based on framework choice. @@ -4794,12 +4837,12 @@ sections: title: Route Organization type: code language: text - template: "{{route_structure}}" + template: '{{route_structure}}' - id: protected-routes title: Protected Route Pattern type: code language: typescript - template: "{{protected_route_example}}" + template: '{{protected_route_example}}' - id: frontend-services title: Frontend Services Layer instruction: Define how frontend communicates with backend. @@ -4808,12 +4851,12 @@ sections: title: API Client Setup type: code language: typescript - template: "{{api_client_setup}}" + template: '{{api_client_setup}}' - id: service-example title: Service Example type: code language: typescript - template: "{{service_example}}" + template: '{{service_example}}' - id: backend-architecture title: Backend Architecture @@ -4831,12 +4874,12 @@ sections: title: Function Organization type: code language: text - template: "{{function_structure}}" + template: '{{function_structure}}' - id: function-template title: Function Template type: code language: typescript - template: "{{function_template}}" + template: '{{function_template}}' - id: traditional-server condition: Traditional server architecture chosen sections: @@ -4844,12 +4887,12 @@ sections: title: Controller/Route Organization type: code language: text - template: "{{controller_structure}}" + template: '{{controller_structure}}' - id: controller-template title: Controller Template type: code language: typescript - template: "{{controller_template}}" + template: '{{controller_template}}' - id: database-architecture title: Database Architecture instruction: Define database schema and access patterns. @@ -4858,12 +4901,12 @@ sections: title: Schema Design type: code language: sql - template: "{{database_schema}}" + template: '{{database_schema}}' - id: data-access-layer title: Data Access Layer type: code language: typescript - template: "{{repository_pattern}}" + template: '{{repository_pattern}}' - id: auth-architecture title: Authentication and Authorization instruction: Define auth implementation details. @@ -4872,12 +4915,12 @@ sections: title: Auth Flow type: mermaid mermaid_type: sequence - template: "{{auth_flow_diagram}}" + template: '{{auth_flow_diagram}}' - id: auth-middleware title: Middleware/Guards type: code language: typescript - template: "{{auth_middleware}}" + template: '{{auth_middleware}}' - id: unified-project-structure title: Unified Project Structure @@ -4886,60 +4929,60 @@ sections: type: code language: plaintext examples: - - | - {{project-name}}/ - ├── .github/ # CI/CD workflows - │ └── workflows/ - │ ├── ci.yaml - │ └── deploy.yaml - ├── apps/ # Application packages - │ ├── web/ # Frontend application - │ │ ├── src/ - │ │ │ ├── components/ # UI components - │ │ │ ├── pages/ # Page components/routes - │ │ │ ├── hooks/ # Custom React hooks - │ │ │ ├── services/ # API client services - │ │ │ ├── stores/ # State management - │ │ │ ├── styles/ # Global styles/themes - │ │ │ └── utils/ # Frontend utilities - │ │ ├── public/ # Static assets - │ │ ├── tests/ # Frontend tests - │ │ └── package.json - │ └── api/ # Backend application - │ ├── src/ - │ │ ├── routes/ # API routes/controllers - │ │ ├── services/ # Business logic - │ │ ├── models/ # Data models - │ │ ├── middleware/ # Express/API middleware - │ │ ├── utils/ # Backend utilities - │ │ └── {{serverless_or_server_entry}} - │ ├── tests/ # Backend tests - │ └── package.json - ├── packages/ # Shared packages - │ ├── shared/ # Shared types/utilities - │ │ ├── src/ - │ │ │ ├── types/ # TypeScript interfaces - │ │ │ ├── constants/ # Shared constants - │ │ │ └── utils/ # Shared utilities - │ │ └── package.json - │ ├── ui/ # Shared UI components - │ │ ├── src/ - │ │ └── package.json - │ └── config/ # Shared configuration - │ ├── eslint/ - │ ├── typescript/ - │ └── jest/ - ├── infrastructure/ # IaC definitions - │ └── {{iac_structure}} - ├── scripts/ # Build/deploy scripts - ├── docs/ # Documentation - │ ├── prd.md - │ ├── front-end-spec.md - │ └── fullstack-architecture.md - ├── .env.example # Environment template - ├── package.json # Root package.json - ├── {{monorepo_config}} # Monorepo configuration - └── README.md + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md - id: development-workflow title: Development Workflow @@ -4953,12 +4996,12 @@ sections: title: Prerequisites type: code language: bash - template: "{{prerequisites_commands}}" + template: '{{prerequisites_commands}}' - id: initial-setup title: Initial Setup type: code language: bash - template: "{{setup_commands}}" + template: '{{setup_commands}}' - id: dev-commands title: Development Commands type: code @@ -4966,13 +5009,13 @@ sections: template: | # Start all services {{start_all_command}} - + # Start frontend only {{start_frontend_command}} - + # Start backend only {{start_backend_command}} - + # Run tests {{test_commands}} - id: environment-config @@ -4985,10 +5028,10 @@ sections: template: | # Frontend (.env.local) {{frontend_env_vars}} - + # Backend (.env) {{backend_env_vars}} - + # Shared {{shared_env_vars}} @@ -5005,7 +5048,7 @@ sections: - **Build Command:** {{frontend_build_command}} - **Output Directory:** {{frontend_output_dir}} - **CDN/Edge:** {{cdn_strategy}} - + **Backend Deployment:** - **Platform:** {{backend_deploy_platform}} - **Build Command:** {{backend_build_command}} @@ -5014,15 +5057,15 @@ sections: title: CI/CD Pipeline type: code language: yaml - template: "{{cicd_pipeline_config}}" + template: '{{cicd_pipeline_config}}' - id: environments title: Environments type: table columns: [Environment, Frontend URL, Backend URL, Purpose] rows: - - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] - - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] - - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + - ['Development', '{{dev_fe_url}}', '{{dev_be_url}}', 'Local development'] + - ['Staging', '{{staging_fe_url}}', '{{staging_be_url}}', 'Pre-production testing'] + - ['Production', '{{prod_fe_url}}', '{{prod_be_url}}', 'Live environment'] - id: security-performance title: Security and Performance @@ -5036,12 +5079,12 @@ sections: - CSP Headers: {{csp_policy}} - XSS Prevention: {{xss_strategy}} - Secure Storage: {{storage_strategy}} - + **Backend Security:** - Input Validation: {{validation_approach}} - Rate Limiting: {{rate_limit_config}} - CORS Policy: {{cors_config}} - + **Authentication Security:** - Token Storage: {{token_strategy}} - Session Management: {{session_approach}} @@ -5053,7 +5096,7 @@ sections: - Bundle Size Target: {{bundle_size}} - Loading Strategy: {{loading_approach}} - Caching Strategy: {{fe_cache_strategy}} - + **Backend Performance:** - Response Time Target: {{response_target}} - Database Optimization: {{db_optimization}} @@ -5069,10 +5112,10 @@ sections: type: code language: text template: | - E2E Tests - / \ - Integration Tests - / \ + E2E Tests + / \ + Integration Tests + / \ Frontend Unit Backend Unit - id: test-organization title: Test Organization @@ -5081,17 +5124,17 @@ sections: title: Frontend Tests type: code language: text - template: "{{frontend_test_structure}}" + template: '{{frontend_test_structure}}' - id: backend-tests title: Backend Tests type: code language: text - template: "{{backend_test_structure}}" + template: '{{backend_test_structure}}' - id: e2e-tests title: E2E Tests type: code language: text - template: "{{e2e_test_structure}}" + template: '{{e2e_test_structure}}' - id: test-examples title: Test Examples sections: @@ -5099,17 +5142,17 @@ sections: title: Frontend Component Test type: code language: typescript - template: "{{frontend_test_example}}" + template: '{{frontend_test_example}}' - id: backend-test title: Backend API Test type: code language: typescript - template: "{{backend_test_example}}" + template: '{{backend_test_example}}' - id: e2e-test title: E2E Test type: code language: typescript - template: "{{e2e_test_example}}" + template: '{{e2e_test_example}}' - id: coding-standards title: Coding Standards @@ -5119,22 +5162,22 @@ sections: - id: critical-rules title: Critical Fullstack Rules repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' examples: - - "**Type Sharing:** Always define types in packages/shared and import from there" - - "**API Calls:** Never make direct HTTP calls - use the service layer" - - "**Environment Variables:** Access only through config objects, never process.env directly" - - "**Error Handling:** All API routes must use the standard error handler" - - "**State Updates:** Never mutate state directly - use proper state management patterns" + - '**Type Sharing:** Always define types in packages/shared and import from there' + - '**API Calls:** Never make direct HTTP calls - use the service layer' + - '**Environment Variables:** Access only through config objects, never process.env directly' + - '**Error Handling:** All API routes must use the standard error handler' + - '**State Updates:** Never mutate state directly - use proper state management patterns' - id: naming-conventions title: Naming Conventions type: table columns: [Element, Frontend, Backend, Example] rows: - - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] - - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] - - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] - - ["Database Tables", "-", "snake_case", "`user_profiles`"] + - ['Components', 'PascalCase', '-', '`UserProfile.tsx`'] + - ['Hooks', "camelCase with 'use'", '-', '`useAuth.ts`'] + - ['API Routes', '-', 'kebab-case', '`/api/user-profile`'] + - ['Database Tables', '-', 'snake_case', '`user_profiles`'] - id: error-handling title: Error Handling Strategy @@ -5145,7 +5188,7 @@ sections: title: Error Flow type: mermaid mermaid_type: sequence - template: "{{error_flow_diagram}}" + template: '{{error_flow_diagram}}' - id: error-format title: Error Response Format type: code @@ -5164,12 +5207,12 @@ sections: title: Frontend Error Handling type: code language: typescript - template: "{{frontend_error_handler}}" + template: '{{frontend_error_handler}}' - id: backend-error-handling title: Backend Error Handling type: code language: typescript - template: "{{backend_error_handler}}" + template: '{{backend_error_handler}}' - id: monitoring title: Monitoring and Observability @@ -5191,7 +5234,7 @@ sections: - JavaScript errors - API response times - User interactions - + **Backend Metrics:** - Request rate - Error rate @@ -5211,24 +5254,24 @@ template: output: format: markdown filename: docs/market-research.md - title: "Market Research Report: {{project_product_name}}" + title: 'Market Research Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Market Research Elicitation Actions" + title: 'Market Research Elicitation Actions' options: - - "Expand market sizing calculations with sensitivity analysis" - - "Deep dive into a specific customer segment" - - "Analyze an emerging market trend in detail" - - "Compare this market to an analogous market" - - "Stress test market assumptions" - - "Explore adjacent market opportunities" - - "Challenge market definition and boundaries" - - "Generate strategic scenarios (best/base/worst case)" - - "If only we had considered [X market factor]..." - - "Proceed to next section" + - 'Expand market sizing calculations with sensitivity analysis' + - 'Deep dive into a specific customer segment' + - 'Analyze an emerging market trend in detail' + - 'Compare this market to an analogous market' + - 'Stress test market assumptions' + - 'Explore adjacent market opportunities' + - 'Challenge market definition and boundaries' + - 'Generate strategic scenarios (best/base/worst case)' + - 'If only we had considered [X market factor]...' + - 'Proceed to next section' sections: - id: executive-summary @@ -5310,7 +5353,7 @@ sections: repeatable: true sections: - id: segment - title: "Segment {{segment_number}}: {{segment_name}}" + title: 'Segment {{segment_number}}: {{segment_name}}' template: | - **Description:** {{brief_overview}} - **Size:** {{number_of_customers_market_value}} @@ -5336,7 +5379,7 @@ sections: instruction: Map the end-to-end customer experience for primary segments template: | For primary customer segment: - + 1. **Awareness:** {{discovery_process}} 2. **Consideration:** {{evaluation_criteria}} 3. **Purchase:** {{decision_triggers}} @@ -5379,20 +5422,20 @@ sections: instruction: Analyze each force with specific evidence and implications sections: - id: supplier-power - title: "Supplier Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Supplier Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: buyer-power - title: "Buyer Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Buyer Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: competitive-rivalry - title: "Competitive Rivalry: {{intensity_level}}" - template: "{{analysis_and_implications}}" + title: 'Competitive Rivalry: {{intensity_level}}' + template: '{{analysis_and_implications}}' - id: threat-new-entry - title: "Threat of New Entry: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of New Entry: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: threat-substitutes - title: "Threat of Substitutes: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of Substitutes: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: adoption-lifecycle title: Technology Adoption Lifecycle Stage instruction: | @@ -5410,7 +5453,7 @@ sections: repeatable: true sections: - id: opportunity - title: "Opportunity {{opportunity_number}}: {{name}}" + title: 'Opportunity {{opportunity_number}}: {{name}}' template: | - **Description:** {{what_is_the_opportunity}} - **Size/Potential:** {{quantified_potential}} @@ -5466,7 +5509,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Product Requirements Document (PRD)" + title: '{{project_name}} Product Requirements Document (PRD)' workflow: mode: interactive @@ -5503,21 +5546,21 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR examples: - - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." + - 'FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR examples: - - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." + - 'NFR1: AWS service usage must aim to stay within free-tier limits where feasible.' - id: ui-goals title: User Interface Design Goals condition: PRD has UX/UI requirements instruction: | Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - + 1. Pre-fill all subsections with educated guesses based on project context 2. Present the complete rendered section to user 3. Clearly let the user know where assumptions were made @@ -5536,30 +5579,30 @@ sections: title: Core Screens and Views instruction: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories examples: - - "Login Screen" - - "Main Dashboard" - - "Item Detail Page" - - "Settings Page" + - 'Login Screen' + - 'Main Dashboard' + - 'Item Detail Page' + - 'Settings Page' - id: accessibility - title: "Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}" + title: 'Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}' - id: branding title: Branding instruction: Any known branding elements or style guides that must be incorporated? examples: - - "Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions." - - "Attached is the full color pallet and tokens for our corporate branding." + - 'Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions.' + - 'Attached is the full color pallet and tokens for our corporate branding.' - id: target-platforms - title: "Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}" + title: 'Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}' examples: - - "Web Responsive, and all mobile platforms" - - "iPhone Only" - - "ASCII Windows Desktop" + - 'Web Responsive, and all mobile platforms' + - 'iPhone Only' + - 'ASCII Windows Desktop' - id: technical-assumptions title: Technical Assumptions instruction: | Gather technical decisions that will guide the Architect. Steps: - + 1. Check if .bmad-core/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets 3. For unknowns, offer guidance based on project goals and MVP scope @@ -5572,13 +5615,13 @@ sections: testing: [Unit Only, Unit + Integration, Full Testing Pyramid] sections: - id: repository-structure - title: "Repository Structure: {Monorepo|Polyrepo|Multi-repo}" + title: 'Repository Structure: {Monorepo|Polyrepo|Multi-repo}' - id: service-architecture title: Service Architecture - instruction: "CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo)." + instruction: 'CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).' - id: testing-requirements title: Testing Requirements - instruction: "CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods)." + instruction: 'CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).' - id: additional-assumptions title: Additional Technical Assumptions and Requests instruction: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items @@ -5587,9 +5630,9 @@ sections: title: Epic List instruction: | Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - + CRITICAL: Epics MUST be logically sequential following agile best practices: - + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed @@ -5598,21 +5641,21 @@ sections: - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. elicit: true examples: - - "Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management" - - "Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations" - - "Epic 3: User Workflows & Interactions: Enable key user journeys and business processes" - - "Epic 4: Reporting & Analytics: Provide insights and data visualization for users" + - 'Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management' + - 'Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations' + - 'Epic 3: User Workflows & Interactions: Enable key user journeys and business processes' + - 'Epic 4: Reporting & Analytics: Provide insights and data visualization for users' - id: epic-details title: Epic {{epic_number}} {{epic_title}} repeatable: true instruction: | After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. - + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). - + CRITICAL STORY SEQUENCING REQUIREMENTS: - + - Stories within each epic MUST be logically sequential - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation - No story should depend on work from a later story or epic @@ -5623,7 +5666,7 @@ sections: - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained - If a story seems complex, break it down further as long as it can deliver a vertical slice elicit: true - template: "{{epic_goal}}" + template: '{{epic_goal}}' sections: - id: story title: Story {{epic_number}}.{{story_number}} {{story_title}} @@ -5636,11 +5679,11 @@ sections: - id: acceptance-criteria title: Acceptance Criteria type: numbered-list - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' repeatable: true instruction: | Define clear, comprehensive, and testable acceptance criteria that: - + - Precisely define what "done" means from a functional perspective - Are unambiguous and serve as basis for verification - Include any critical non-functional requirements from the PRD @@ -5671,35 +5714,35 @@ template: output: format: markdown filename: docs/brief.md - title: "Project Brief: {{project_name}}" + title: 'Project Brief: {{project_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Project Brief Elicitation Actions" + title: 'Project Brief Elicitation Actions' options: - - "Expand section with more specific details" - - "Validate against similar successful products" - - "Stress test assumptions with edge cases" - - "Explore alternative solution approaches" - - "Analyze resource/constraint trade-offs" - - "Generate risk mitigation strategies" - - "Challenge scope from MVP minimalist view" - - "Brainstorm creative feature possibilities" - - "If only we had [resource/capability/time]..." - - "Proceed to next section" + - 'Expand section with more specific details' + - 'Validate against similar successful products' + - 'Stress test assumptions with edge cases' + - 'Explore alternative solution approaches' + - 'Analyze resource/constraint trade-offs' + - 'Generate risk mitigation strategies' + - 'Challenge scope from MVP minimalist view' + - 'Brainstorm creative feature possibilities' + - 'If only we had [resource/capability/time]...' + - 'Proceed to next section' sections: - id: introduction instruction: | This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - + Start by asking the user which mode they prefer: - + 1. **Interactive Mode** - Work through each section collaboratively 2. **YOLO Mode** - Generate complete draft for review and refinement - + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. - id: executive-summary @@ -5710,7 +5753,7 @@ sections: - Primary problem being solved - Target market identification - Key value proposition - template: "{{executive_summary_content}}" + template: '{{executive_summary_content}}' - id: problem-statement title: Problem Statement @@ -5720,7 +5763,7 @@ sections: - Impact of the problem (quantify if possible) - Why existing solutions fall short - Urgency and importance of solving this now - template: "{{detailed_problem_description}}" + template: '{{detailed_problem_description}}' - id: proposed-solution title: Proposed Solution @@ -5730,7 +5773,7 @@ sections: - Key differentiators from existing solutions - Why this solution will succeed where others haven't - High-level vision for the product - template: "{{solution_description}}" + template: '{{solution_description}}' - id: target-users title: Target Users @@ -5742,12 +5785,12 @@ sections: - Goals they're trying to achieve sections: - id: primary-segment - title: "Primary User Segment: {{segment_name}}" - template: "{{primary_user_description}}" + title: 'Primary User Segment: {{segment_name}}' + template: '{{primary_user_description}}' - id: secondary-segment - title: "Secondary User Segment: {{segment_name}}" + title: 'Secondary User Segment: {{segment_name}}' condition: Has secondary user segment - template: "{{secondary_user_description}}" + template: '{{secondary_user_description}}' - id: goals-metrics title: Goals & Success Metrics @@ -5756,15 +5799,15 @@ sections: - id: business-objectives title: Business Objectives type: bullet-list - template: "- {{objective_with_metric}}" + template: '- {{objective_with_metric}}' - id: user-success-metrics title: User Success Metrics type: bullet-list - template: "- {{user_metric}}" + template: '- {{user_metric}}' - id: kpis title: Key Performance Indicators (KPIs) type: bullet-list - template: "- {{kpi}}: {{definition_and_target}}" + template: '- {{kpi}}: {{definition_and_target}}' - id: mvp-scope title: MVP Scope @@ -5773,14 +5816,14 @@ sections: - id: core-features title: Core Features (Must Have) type: bullet-list - template: "- **{{feature}}:** {{description_and_rationale}}" + template: '- **{{feature}}:** {{description_and_rationale}}' - id: out-of-scope title: Out of Scope for MVP type: bullet-list - template: "- {{feature_or_capability}}" + template: '- {{feature_or_capability}}' - id: mvp-success-criteria title: MVP Success Criteria - template: "{{mvp_success_definition}}" + template: '{{mvp_success_definition}}' - id: post-mvp-vision title: Post-MVP Vision @@ -5788,13 +5831,13 @@ sections: sections: - id: phase-2-features title: Phase 2 Features - template: "{{next_priority_features}}" + template: '{{next_priority_features}}' - id: long-term-vision title: Long-term Vision - template: "{{one_two_year_vision}}" + template: '{{one_two_year_vision}}' - id: expansion-opportunities title: Expansion Opportunities - template: "{{potential_expansions}}" + template: '{{potential_expansions}}' - id: technical-considerations title: Technical Considerations @@ -5835,7 +5878,7 @@ sections: - id: key-assumptions title: Key Assumptions type: bullet-list - template: "- {{assumption}}" + template: '- {{assumption}}' - id: risks-questions title: Risks & Open Questions @@ -5844,15 +5887,15 @@ sections: - id: key-risks title: Key Risks type: bullet-list - template: "- **{{risk}}:** {{description_and_impact}}" + template: '- **{{risk}}:** {{description_and_impact}}' - id: open-questions title: Open Questions type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: research-areas title: Areas Needing Further Research type: bullet-list - template: "- {{research_topic}}" + template: '- {{research_topic}}' - id: appendices title: Appendices @@ -5869,10 +5912,10 @@ sections: - id: stakeholder-input title: B. Stakeholder Input condition: Has stakeholder feedback - template: "{{stakeholder_feedback}}" + template: '{{stakeholder_feedback}}' - id: references title: C. References - template: "{{relevant_links_and_docs}}" + template: '{{relevant_links_and_docs}}' - id: next-steps title: Next Steps @@ -5880,7 +5923,7 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action_item}}" + template: '{{action_item}}' - id: pm-handoff title: PM Handoff content: | @@ -5895,14 +5938,14 @@ template: output: format: markdown filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md - title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + title: 'Story {{epic_num}}.{{story_num}}: {{story_title_short}}' workflow: mode: interactive elicitation: advanced-elicitation agent_config: - editable_sections: + editable_sections: - Status - Story - Acceptance Criteria @@ -5919,7 +5962,7 @@ sections: instruction: Select the current status of the story owner: scrum-master editors: [scrum-master, dev-agent] - + - id: story title: Story type: template-text @@ -5931,7 +5974,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: acceptance-criteria title: Acceptance Criteria type: numbered-list @@ -5939,7 +5982,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: tasks-subtasks title: Tasks / Subtasks type: bullet-list @@ -5956,7 +5999,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master, dev-agent] - + - id: dev-notes title: Dev Notes instruction: | @@ -5980,7 +6023,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: change-log title: Change Log type: table @@ -5988,7 +6031,7 @@ sections: instruction: Track changes made to this story document owner: scrum-master editors: [scrum-master, dev-agent, qa-agent] - + - id: dev-agent-record title: Dev Agent Record instruction: This section is populated by the development agent during implementation @@ -5997,29 +6040,29 @@ sections: sections: - id: agent-model title: Agent Model Used - template: "{{agent_model_name_version}}" + template: '{{agent_model_name_version}}' instruction: Record the specific AI agent model and version used for development owner: dev-agent editors: [dev-agent] - + - id: debug-log-references title: Debug Log References instruction: Reference any debug logs or traces generated during development owner: dev-agent editors: [dev-agent] - + - id: completion-notes title: Completion Notes List instruction: Notes about the completion of tasks and any issues encountered owner: dev-agent editors: [dev-agent] - + - id: file-list title: File List instruction: List all files created, modified, or affected during story implementation owner: dev-agent editors: [dev-agent] - + - id: qa-results title: QA Results instruction: Results from QA Agent QA review of the completed story implementation @@ -8015,7 +8058,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing - **Claude Code**: `/agent-name` (e.g., `/bmad-master`) - **Cursor**: `@agent-name` (e.g., `@bmad-master`) -- **Windsurf**: `@agent-name` (e.g., `@bmad-master`) +- **Windsurf**: `/agent-name` (e.g., `/bmad-master`) - **Trae**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-master`) - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. diff --git a/dist/agents/bmad-orchestrator.txt b/dist/agents/bmad-orchestrator.txt index de1de6e6..c6e783c5 100644 --- a/dist/agents/bmad-orchestrator.txt +++ b/dist/agents/bmad-orchestrator.txt @@ -775,7 +775,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing - **Claude Code**: `/agent-name` (e.g., `/bmad-master`) - **Cursor**: `@agent-name` (e.g., `@bmad-master`) -- **Windsurf**: `@agent-name` (e.g., `@bmad-master`) +- **Windsurf**: `/agent-name` (e.g., `/bmad-master`) - **Trae**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-master`) - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. diff --git a/dist/agents/pm.txt b/dist/agents/pm.txt index 3f1bb1b6..503cb8d4 100644 --- a/dist/agents/pm.txt +++ b/dist/agents/pm.txt @@ -1159,7 +1159,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Product Requirements Document (PRD)" + title: '{{project_name}} Product Requirements Document (PRD)' workflow: mode: interactive @@ -1196,21 +1196,21 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR examples: - - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." + - 'FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR examples: - - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." + - 'NFR1: AWS service usage must aim to stay within free-tier limits where feasible.' - id: ui-goals title: User Interface Design Goals condition: PRD has UX/UI requirements instruction: | Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - + 1. Pre-fill all subsections with educated guesses based on project context 2. Present the complete rendered section to user 3. Clearly let the user know where assumptions were made @@ -1229,30 +1229,30 @@ sections: title: Core Screens and Views instruction: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories examples: - - "Login Screen" - - "Main Dashboard" - - "Item Detail Page" - - "Settings Page" + - 'Login Screen' + - 'Main Dashboard' + - 'Item Detail Page' + - 'Settings Page' - id: accessibility - title: "Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}" + title: 'Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}' - id: branding title: Branding instruction: Any known branding elements or style guides that must be incorporated? examples: - - "Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions." - - "Attached is the full color pallet and tokens for our corporate branding." + - 'Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions.' + - 'Attached is the full color pallet and tokens for our corporate branding.' - id: target-platforms - title: "Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}" + title: 'Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}' examples: - - "Web Responsive, and all mobile platforms" - - "iPhone Only" - - "ASCII Windows Desktop" + - 'Web Responsive, and all mobile platforms' + - 'iPhone Only' + - 'ASCII Windows Desktop' - id: technical-assumptions title: Technical Assumptions instruction: | Gather technical decisions that will guide the Architect. Steps: - + 1. Check if .bmad-core/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets 3. For unknowns, offer guidance based on project goals and MVP scope @@ -1265,13 +1265,13 @@ sections: testing: [Unit Only, Unit + Integration, Full Testing Pyramid] sections: - id: repository-structure - title: "Repository Structure: {Monorepo|Polyrepo|Multi-repo}" + title: 'Repository Structure: {Monorepo|Polyrepo|Multi-repo}' - id: service-architecture title: Service Architecture - instruction: "CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo)." + instruction: 'CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).' - id: testing-requirements title: Testing Requirements - instruction: "CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods)." + instruction: 'CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).' - id: additional-assumptions title: Additional Technical Assumptions and Requests instruction: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items @@ -1280,9 +1280,9 @@ sections: title: Epic List instruction: | Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - + CRITICAL: Epics MUST be logically sequential following agile best practices: - + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed @@ -1291,21 +1291,21 @@ sections: - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. elicit: true examples: - - "Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management" - - "Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations" - - "Epic 3: User Workflows & Interactions: Enable key user journeys and business processes" - - "Epic 4: Reporting & Analytics: Provide insights and data visualization for users" + - 'Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management' + - 'Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations' + - 'Epic 3: User Workflows & Interactions: Enable key user journeys and business processes' + - 'Epic 4: Reporting & Analytics: Provide insights and data visualization for users' - id: epic-details title: Epic {{epic_number}} {{epic_title}} repeatable: true instruction: | After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. - + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). - + CRITICAL STORY SEQUENCING REQUIREMENTS: - + - Stories within each epic MUST be logically sequential - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation - No story should depend on work from a later story or epic @@ -1316,7 +1316,7 @@ sections: - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained - If a story seems complex, break it down further as long as it can deliver a vertical slice elicit: true - template: "{{epic_goal}}" + template: '{{epic_goal}}' sections: - id: story title: Story {{epic_number}}.{{story_number}} {{story_title}} @@ -1329,11 +1329,11 @@ sections: - id: acceptance-criteria title: Acceptance Criteria type: numbered-list - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' repeatable: true instruction: | Define clear, comprehensive, and testable acceptance criteria that: - + - Precisely define what "done" means from a functional perspective - Are unambiguous and serve as basis for verification - Include any critical non-functional requirements from the PRD @@ -1364,7 +1364,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Brownfield Enhancement PRD" + title: '{{project_name}} Brownfield Enhancement PRD' workflow: mode: interactive @@ -1375,19 +1375,19 @@ sections: title: Intro Project Analysis and Context instruction: | IMPORTANT - SCOPE ASSESSMENT REQUIRED: - + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. - + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - + Do not proceed with any recommendations until the user has validated your understanding of the existing system. sections: - id: existing-project-overview @@ -1413,7 +1413,7 @@ sections: - Note: "Document-project analysis available - using existing technical documentation" - List key documents created by document-project - Skip the missing documentation check below - + Otherwise, check for existing documentation: sections: - id: available-docs @@ -1427,7 +1427,7 @@ sections: - External API Documentation [[LLM: If from document-project, check ✓]] - UX/UI Guidelines [[LLM: May not be in document-project]] - Technical Debt Documentation [[LLM: If from document-project, check ✓]] - - "Other: {{other_docs}}" + - 'Other: {{other_docs}}' instruction: | - If document-project was already run: "Using existing project analysis from document-project output." - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." @@ -1447,7 +1447,7 @@ sections: - UI/UX Overhaul - Technology Stack Upgrade - Bug Fix and Stability Improvements - - "Other: {{other_type}}" + - 'Other: {{other_type}}' - id: enhancement-description title: Enhancement Description instruction: 2-3 sentences describing what the user wants to add or change @@ -1488,29 +1488,29 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown with identifier starting with FR examples: - - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - 'FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system examples: - - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - 'NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.' - id: compatibility title: Compatibility Requirements instruction: Critical for brownfield - what must remain compatible type: numbered-list prefix: CR - template: "{{requirement}}: {{description}}" + template: '{{requirement}}: {{description}}' items: - id: cr1 - template: "CR1: {{existing_api_compatibility}}" + template: 'CR1: {{existing_api_compatibility}}' - id: cr2 - template: "CR2: {{database_schema_compatibility}}" + template: 'CR2: {{database_schema_compatibility}}' - id: cr3 - template: "CR3: {{ui_ux_consistency}}" + template: 'CR3: {{ui_ux_consistency}}' - id: cr4 - template: "CR4: {{integration_compatibility}}" + template: 'CR4: {{integration_compatibility}}' - id: ui-enhancement-goals title: User Interface Enhancement Goals @@ -1537,7 +1537,7 @@ sections: If document-project output available: - Extract from "Actual Tech Stack" table in High Level Architecture section - Include version numbers and any noted constraints - + Otherwise, document the current technology stack: template: | **Languages**: {{languages}} @@ -1576,7 +1576,7 @@ sections: - Reference "Technical Debt and Known Issues" section - Include "Workarounds and Gotchas" that might impact enhancement - Note any identified constraints from "Critical Technical Debt" - + Build risk assessment incorporating existing known issues: template: | **Technical Risks**: {{technical_risks}} @@ -1593,13 +1593,13 @@ sections: - id: epic-approach title: Epic Approach instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features - template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + template: '**Epic Structure Decision**: {{epic_decision}} with rationale' - id: epic-details - title: "Epic 1: {{enhancement_title}}" + title: 'Epic 1: {{enhancement_title}}' instruction: | Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality - + CRITICAL STORY SEQUENCING FOR BROWNFIELD: - Stories must ensure existing functionality remains intact - Each story should include verification that existing features still work @@ -1612,11 +1612,11 @@ sections: - Each story must deliver value while maintaining system integrity template: | **Epic Goal**: {{epic_goal}} - + **Integration Requirements**: {{integration_requirements}} sections: - id: story - title: "Story 1.{{story_number}} {{story_title}}" + title: 'Story 1.{{story_number}} {{story_title}}' repeatable: true template: | As a {{user_type}}, @@ -1627,16 +1627,16 @@ sections: title: Acceptance Criteria type: numbered-list instruction: Define criteria that include both new functionality and existing system integrity - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' - id: integration-verification title: Integration Verification instruction: Specific verification steps to ensure existing functionality remains intact type: numbered-list prefix: IV items: - - template: "IV1: {{existing_functionality_verification}}" - - template: "IV2: {{integration_point_verification}}" - - template: "IV3: {{performance_impact_verification}}" + - template: 'IV1: {{existing_functionality_verification}}' + - template: 'IV2: {{integration_point_verification}}' + - template: 'IV3: {{performance_impact_verification}}' ==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/pm-checklist.md ==================== diff --git a/dist/agents/po.txt b/dist/agents/po.txt index 8a06bdde..846e2594 100644 --- a/dist/agents/po.txt +++ b/dist/agents/po.txt @@ -593,14 +593,14 @@ template: output: format: markdown filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md - title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + title: 'Story {{epic_num}}.{{story_num}}: {{story_title_short}}' workflow: mode: interactive elicitation: advanced-elicitation agent_config: - editable_sections: + editable_sections: - Status - Story - Acceptance Criteria @@ -617,7 +617,7 @@ sections: instruction: Select the current status of the story owner: scrum-master editors: [scrum-master, dev-agent] - + - id: story title: Story type: template-text @@ -629,7 +629,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: acceptance-criteria title: Acceptance Criteria type: numbered-list @@ -637,7 +637,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: tasks-subtasks title: Tasks / Subtasks type: bullet-list @@ -654,7 +654,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master, dev-agent] - + - id: dev-notes title: Dev Notes instruction: | @@ -678,7 +678,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: change-log title: Change Log type: table @@ -686,7 +686,7 @@ sections: instruction: Track changes made to this story document owner: scrum-master editors: [scrum-master, dev-agent, qa-agent] - + - id: dev-agent-record title: Dev Agent Record instruction: This section is populated by the development agent during implementation @@ -695,29 +695,29 @@ sections: sections: - id: agent-model title: Agent Model Used - template: "{{agent_model_name_version}}" + template: '{{agent_model_name_version}}' instruction: Record the specific AI agent model and version used for development owner: dev-agent editors: [dev-agent] - + - id: debug-log-references title: Debug Log References instruction: Reference any debug logs or traces generated during development owner: dev-agent editors: [dev-agent] - + - id: completion-notes title: Completion Notes List instruction: Notes about the completion of tasks and any issues encountered owner: dev-agent editors: [dev-agent] - + - id: file-list title: File List instruction: List all files created, modified, or affected during story implementation owner: dev-agent editors: [dev-agent] - + - id: qa-results title: QA Results instruction: Results from QA Agent QA review of the completed story implementation diff --git a/dist/agents/qa.txt b/dist/agents/qa.txt index 368d2a38..b6bbb22e 100644 --- a/dist/agents/qa.txt +++ b/dist/agents/qa.txt @@ -119,10 +119,10 @@ Perform a comprehensive test architecture review with quality gate decision. Thi ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Prerequisites @@ -284,6 +284,8 @@ Gate: {STATUS} → docs/qa/gates/{epic}.{story}-{slug}.yml Risk profile: docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md +# Note: Paths should reference core-config.yaml for custom configurations + ### Recommended Status [✓ Ready for Done] / [✗ Changes Required - See unchecked items above] @@ -295,26 +297,26 @@ NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md **Template and Directory:** - Render from `templates/qa-gate-tmpl.yaml` -- Create `docs/qa/gates/` directory if missing +- Create `docs/qa/gates/` directory if missing (or configure in core-config.yaml) - Save to: `docs/qa/gates/{epic}.{story}-{slug}.yml` Gate file structure: ```yaml schema: 1 -story: "{epic}.{story}" -story_title: "{story title}" +story: '{epic}.{story}' +story_title: '{story title}' gate: PASS|CONCERNS|FAIL|WAIVED -status_reason: "1-2 sentence explanation of gate decision" -reviewer: "Quinn (Test Architect)" -updated: "{ISO-8601 timestamp}" +status_reason: '1-2 sentence explanation of gate decision' +reviewer: 'Quinn (Test Architect)' +updated: '{ISO-8601 timestamp}' top_issues: [] # Empty if no issues waiver: { active: false } # Set active: true only if WAIVED # Extended fields (optional but recommended): quality_score: 0-100 # 100 - (20*FAILs) - (10*CONCERNS) or use technical-preferences.md weights -expires: "{ISO-8601 timestamp}" # Typically 2 weeks from review +expires: '{ISO-8601 timestamp}' # Typically 2 weeks from review evidence: tests_reviewed: { count } @@ -326,24 +328,24 @@ evidence: nfr_validation: security: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' performance: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' reliability: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' maintainability: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' recommendations: immediate: # Must fix before production - - action: "Add rate limiting" - refs: ["api/auth/login.ts"] + - action: 'Add rate limiting' + refs: ['api/auth/login.ts'] future: # Can be addressed later - - action: "Consider caching" - refs: ["services/data.ts"] + - action: 'Consider caching' + refs: ['services/data.ts'] ``` ### Gate Decision Criteria @@ -455,11 +457,11 @@ Slug rules: ```yaml schema: 1 -story: "{epic}.{story}" +story: '{epic}.{story}' gate: PASS|CONCERNS|FAIL|WAIVED -status_reason: "1-2 sentence explanation of gate decision" -reviewer: "Quinn" -updated: "{ISO-8601 timestamp}" +status_reason: '1-2 sentence explanation of gate decision' +reviewer: 'Quinn' +updated: '{ISO-8601 timestamp}' top_issues: [] # Empty array if no issues waiver: { active: false } # Only set active: true if WAIVED ``` @@ -468,20 +470,20 @@ waiver: { active: false } # Only set active: true if WAIVED ```yaml schema: 1 -story: "1.3" +story: '1.3' gate: CONCERNS -status_reason: "Missing rate limiting on auth endpoints poses security risk." -reviewer: "Quinn" -updated: "2025-01-12T10:15:00Z" +status_reason: 'Missing rate limiting on auth endpoints poses security risk.' +reviewer: 'Quinn' +updated: '2025-01-12T10:15:00Z' top_issues: - - id: "SEC-001" + - id: 'SEC-001' severity: high # ONLY: low|medium|high - finding: "No rate limiting on login endpoint" - suggested_action: "Add rate limiting middleware before production" - - id: "TEST-001" + finding: 'No rate limiting on login endpoint' + suggested_action: 'Add rate limiting middleware before production' + - id: 'TEST-001' severity: medium - finding: "No integration tests for auth flow" - suggested_action: "Add integration test coverage" + finding: 'No integration tests for auth flow' + suggested_action: 'Add integration test coverage' waiver: { active: false } ``` @@ -489,20 +491,20 @@ waiver: { active: false } ```yaml schema: 1 -story: "1.3" +story: '1.3' gate: WAIVED -status_reason: "Known issues accepted for MVP release." -reviewer: "Quinn" -updated: "2025-01-12T10:15:00Z" +status_reason: 'Known issues accepted for MVP release.' +reviewer: 'Quinn' +updated: '2025-01-12T10:15:00Z' top_issues: - - id: "PERF-001" + - id: 'PERF-001' severity: low - finding: "Dashboard loads slowly with 1000+ items" - suggested_action: "Implement pagination in next sprint" + finding: 'Dashboard loads slowly with 1000+ items' + suggested_action: 'Implement pagination in next sprint' waiver: active: true - reason: "MVP release - performance optimization deferred" - approved_by: "Product Owner" + reason: 'MVP release - performance optimization deferred' + approved_by: 'Product Owner' ``` ## Gate Decision Criteria @@ -621,21 +623,21 @@ Identify all testable requirements from: For each requirement, document which tests validate it. Use Given-When-Then to describe what the test validates (not how it's written): ```yaml -requirement: "AC1: User can login with valid credentials" +requirement: 'AC1: User can login with valid credentials' test_mappings: - - test_file: "auth/login.test.ts" - test_case: "should successfully login with valid email and password" + - test_file: 'auth/login.test.ts' + test_case: 'should successfully login with valid email and password' # Given-When-Then describes WHAT the test validates, not HOW it's coded - given: "A registered user with valid credentials" - when: "They submit the login form" - then: "They are redirected to dashboard and session is created" + given: 'A registered user with valid credentials' + when: 'They submit the login form' + then: 'They are redirected to dashboard and session is created' coverage: full - - test_file: "e2e/auth-flow.test.ts" - test_case: "complete login flow" - given: "User on login page" - when: "Entering valid credentials and submitting" - then: "Dashboard loads with user data" + - test_file: 'e2e/auth-flow.test.ts' + test_case: 'complete login flow' + given: 'User on login page' + when: 'Entering valid credentials and submitting' + then: 'Dashboard loads with user data' coverage: integration ``` @@ -657,19 +659,19 @@ Document any gaps found: ```yaml coverage_gaps: - - requirement: "AC3: Password reset email sent within 60 seconds" - gap: "No test for email delivery timing" + - requirement: 'AC3: Password reset email sent within 60 seconds' + gap: 'No test for email delivery timing' severity: medium suggested_test: type: integration - description: "Test email service SLA compliance" + description: 'Test email service SLA compliance' - - requirement: "AC5: Support 1000 concurrent users" - gap: "No load testing implemented" + - requirement: 'AC5: Support 1000 concurrent users' + gap: 'No load testing implemented' severity: high suggested_test: type: performance - description: "Load test with 1000 concurrent connections" + description: 'Load test with 1000 concurrent connections' ``` ## Outputs @@ -685,11 +687,11 @@ trace: full: Y partial: Z none: W - planning_ref: "docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md" + planning_ref: 'docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md' uncovered: - - ac: "AC3" - reason: "No test found for password reset timing" - notes: "See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md" + - ac: 'AC3' + reason: 'No test found for password reset timing' + notes: 'See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md' ``` ### Output 2: Traceability Report @@ -863,10 +865,10 @@ Generate a comprehensive risk assessment matrix for a story implementation using ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: 'docs/stories/{epic}.{story}.*.md' + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Purpose @@ -936,14 +938,14 @@ For each category, identify specific risks: ```yaml risk: - id: "SEC-001" # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH + id: 'SEC-001' # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH category: security - title: "Insufficient input validation on user forms" - description: "Form inputs not properly sanitized could lead to XSS attacks" + title: 'Insufficient input validation on user forms' + description: 'Form inputs not properly sanitized could lead to XSS attacks' affected_components: - - "UserRegistrationForm" - - "ProfileUpdateForm" - detection_method: "Code review revealed missing validation" + - 'UserRegistrationForm' + - 'ProfileUpdateForm' + detection_method: 'Code review revealed missing validation' ``` ### 2. Risk Assessment @@ -990,20 +992,20 @@ For each identified risk, provide mitigation: ```yaml mitigation: - risk_id: "SEC-001" - strategy: "preventive" # preventive|detective|corrective + risk_id: 'SEC-001' + strategy: 'preventive' # preventive|detective|corrective actions: - - "Implement input validation library (e.g., validator.js)" - - "Add CSP headers to prevent XSS execution" - - "Sanitize all user inputs before storage" - - "Escape all outputs in templates" + - 'Implement input validation library (e.g., validator.js)' + - 'Add CSP headers to prevent XSS execution' + - 'Sanitize all user inputs before storage' + - 'Escape all outputs in templates' testing_requirements: - - "Security testing with OWASP ZAP" - - "Manual penetration testing of forms" - - "Unit tests for validation functions" - residual_risk: "Low - Some zero-day vulnerabilities may remain" - owner: "dev" - timeline: "Before deployment" + - 'Security testing with OWASP ZAP' + - 'Manual penetration testing of forms' + - 'Unit tests for validation functions' + residual_risk: 'Low - Some zero-day vulnerabilities may remain' + owner: 'dev' + timeline: 'Before deployment' ``` ## Outputs @@ -1029,12 +1031,12 @@ risk_summary: highest: id: SEC-001 score: 9 - title: "XSS on profile form" + title: 'XSS on profile form' recommendations: must_fix: - - "Add input sanitization & CSP" + - 'Add input sanitization & CSP' monitor: - - "Add security alerts for auth endpoints" + - 'Add security alerts for auth endpoints' ``` ### Output 2: Markdown Report @@ -1219,299 +1221,79 @@ Create comprehensive test scenarios with appropriate test level recommendations ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Purpose Design a complete test strategy that identifies what to test, at which level (unit/integration/e2e), and why. This ensures efficient test coverage without redundancy while maintaining appropriate test boundaries. -## Test Level Decision Framework - -### Unit Tests - -**When to use:** - -- Testing pure functions and business logic -- Algorithm correctness -- Input validation and data transformation -- Error handling in isolated components -- Complex calculations or state machines - -**Characteristics:** - -- Fast execution (immediate feedback) -- No external dependencies (DB, API, file system) -- Highly maintainable and stable -- Easy to debug failures - -**Example scenarios:** +## Dependencies ```yaml -unit_test: - component: "PriceCalculator" - scenario: "Calculate discount with multiple rules" - justification: "Complex business logic with multiple branches" - mock_requirements: "None - pure function" +data: + - test-levels-framework.md # Unit/Integration/E2E decision criteria + - test-priorities-matrix.md # P0/P1/P2/P3 classification system ``` -### Integration Tests - -**When to use:** - -- Testing component interactions -- Database operations and queries -- API endpoint behavior -- Service layer orchestration -- External service integration (with test doubles) - -**Characteristics:** - -- Moderate execution time -- May use test databases or containers -- Tests multiple components together -- Validates contracts between components - -**Example scenarios:** - -```yaml -integration_test: - components: ["UserService", "UserRepository", "Database"] - scenario: "Create user with duplicate email check" - justification: "Tests transaction boundaries and constraint handling" - test_doubles: "Mock email service, real test database" -``` - -### End-to-End Tests - -**When to use:** - -- Critical user journeys -- Cross-system workflows -- UI interaction flows -- Full stack validation -- Production-like scenario testing - -**Characteristics:** - -- Keep under 90 seconds per test -- Tests complete user scenarios -- Uses real or production-like environment -- Higher maintenance cost -- More prone to flakiness - -**Example scenarios:** - -```yaml -e2e_test: - flow: "Complete purchase flow" - scenario: "User browses, adds to cart, and completes checkout" - justification: "Critical business flow requiring full stack validation" - environment: "Staging with test payment gateway" -``` - -## Test Design Process +## Process ### 1. Analyze Story Requirements -Break down each acceptance criterion into testable scenarios: +Break down each acceptance criterion into testable scenarios. For each AC: -```yaml -acceptance_criterion: "User can reset password via email" -test_scenarios: - - level: unit - what: "Password validation rules" - why: "Complex regex and business rules" +- Identify the core functionality to test +- Determine data variations needed +- Consider error conditions +- Note edge cases - - level: integration - what: "Password reset token generation and storage" - why: "Database interaction with expiry logic" +### 2. Apply Test Level Framework - - level: integration - what: "Email service integration" - why: "External service with retry logic" +**Reference:** Load `test-levels-framework.md` for detailed criteria - - level: e2e - what: "Complete password reset flow" - why: "Critical security flow needing full validation" -``` +Quick rules: -### 2. Apply Test Level Heuristics +- **Unit**: Pure logic, algorithms, calculations +- **Integration**: Component interactions, DB operations +- **E2E**: Critical user journeys, compliance -Use these rules to determine appropriate test levels: +### 3. Assign Priorities -```markdown -## Test Level Selection Rules +**Reference:** Load `test-priorities-matrix.md` for classification -### Favor Unit Tests When: +Quick priority assignment: -- Logic can be isolated -- No side effects involved -- Fast feedback needed -- High cyclomatic complexity +- **P0**: Revenue-critical, security, compliance +- **P1**: Core user journeys, frequently used +- **P2**: Secondary features, admin functions +- **P3**: Nice-to-have, rarely used -### Favor Integration Tests When: +### 4. Design Test Scenarios -- Testing persistence layer -- Validating service contracts -- Testing middleware/interceptors -- Component boundaries critical - -### Favor E2E Tests When: - -- User-facing critical paths -- Multi-system interactions -- Regulatory compliance scenarios -- Visual regression important - -### Anti-patterns to Avoid: - -- E2E testing for business logic validation -- Unit testing framework behavior -- Integration testing third-party libraries -- Duplicate coverage across levels - -### Duplicate Coverage Guard - -**Before adding any test, check:** - -1. Is this already tested at a lower level? -2. Can a unit test cover this instead of integration? -3. Can an integration test cover this instead of E2E? - -**Coverage overlap is only acceptable when:** - -- Testing different aspects (unit: logic, integration: interaction, e2e: user experience) -- Critical paths requiring defense in depth -- Regression prevention for previously broken functionality -``` - -### 3. Design Test Scenarios - -**Test ID Format:** `{EPIC}.{STORY}-{LEVEL}-{SEQ}` - -- Example: `1.3-UNIT-001`, `1.3-INT-002`, `1.3-E2E-001` -- Ensures traceability across all artifacts - -**Naming Convention:** - -- Unit: `test_{component}_{scenario}` -- Integration: `test_{flow}_{interaction}` -- E2E: `test_{journey}_{outcome}` - -**Risk Linkage:** - -- Tag tests with risk IDs they mitigate -- Prioritize tests for high-risk areas (P0) -- Link to risk profile when available - -For each identified test need: +For each identified test need, create: ```yaml test_scenario: - id: "1.3-INT-002" - requirement: "AC2: Rate limiting on login attempts" - mitigates_risks: ["SEC-001", "PERF-003"] # Links to risk profile - priority: P0 # Based on risk score - - unit_tests: - - name: "RateLimiter calculates window correctly" - input: "Timestamp array" - expected: "Correct window calculation" - - integration_tests: - - name: "Login endpoint enforces rate limit" - setup: "5 failed attempts" - action: "6th attempt" - expected: "429 response with retry-after header" - - e2e_tests: - - name: "User sees rate limit message" - setup: "Trigger rate limit" - validation: "Error message displayed, retry timer shown" + id: '{epic}.{story}-{LEVEL}-{SEQ}' + requirement: 'AC reference' + priority: P0|P1|P2|P3 + level: unit|integration|e2e + description: 'What is being tested' + justification: 'Why this level was chosen' + mitigates_risks: ['RISK-001'] # If risk profile exists ``` -## Deterministic Test Level Minimums +### 5. Validate Coverage -**Per Acceptance Criterion:** +Ensure: -- At least 1 unit test for business logic -- At least 1 integration test if multiple components interact -- At least 1 E2E test if it's a user-facing feature - -**Exceptions:** - -- Pure UI changes: May skip unit tests -- Pure logic changes: May skip E2E tests -- Infrastructure changes: May focus on integration tests - -**When in doubt:** Start with unit tests, add integration for interactions, E2E for critical paths only. - -## Test Quality Standards - -### Core Testing Principles - -**No Flaky Tests:** Ensure reliability through proper async handling, explicit waits, and atomic test design. - -**No Hard Waits/Sleeps:** Use dynamic waiting strategies (e.g., polling, event-based triggers). - -**Stateless & Parallel-Safe:** Tests run independently; use cron jobs or semaphores only if unavoidable. - -**No Order Dependency:** Every it/describe/context block works in isolation (supports .only execution). - -**Self-Cleaning Tests:** Test sets up its own data and automatically deletes/deactivates entities created during testing. - -**Tests Live Near Source Code:** Co-locate test files with the code they validate (e.g., `*.spec.js` alongside components). - -### Execution Strategy - -**Shifted Left:** - -- Start with local environments or ephemeral stacks -- Validate functionality across all deployment stages (local → dev → stage) - -**Low Maintenance:** Minimize manual upkeep (avoid brittle selectors, do not repeat UI actions, leverage APIs). - -**CI Execution Evidence:** Integrate into pipelines with clear logs/artifacts. - -**Visibility:** Generate test reports (e.g., JUnit XML, HTML) for failures and trends. - -### Coverage Requirements - -**Release Confidence:** - -- Happy Path: Core user journeys are prioritized -- Edge Cases: Critical error/validation scenarios are covered -- Feature Flags: Test both enabled and disabled states where applicable - -### Test Design Rules - -**Assertions:** Keep them explicit in tests; avoid abstraction into helpers. Use parametrized tests for soft assertions. - -**Naming:** Follow conventions (e.g., `describe('Component')`, `it('should do X when Y')`). - -**Size:** Aim for files ≤200 lines; split/chunk large tests logically. - -**Speed:** Target individual tests ≤90 seconds; optimize slow setups (e.g., shared fixtures). - -**Careful Abstractions:** Favor readability over DRY when balancing helper reuse (page objects are okay, assertion logic is not). - -**Test Cleanup:** Ensure tests clean up resources they create (e.g., closing browser, deleting test data). - -**Deterministic Flow:** Tests should refrain from using conditionals (e.g., if/else) to control flow or try/catch blocks where possible. - -### API Testing Standards - -- Tests must not depend on hardcoded data → use factories and per-test setup -- Always test both happy path and negative/error cases -- API tests should run parallel safely (no global state shared) -- Test idempotency where applicable (e.g., duplicate requests) -- Tests should clean up their data -- Response logs should only be printed in case of failure -- Auth tests must validate token expiration and renewal +- Every AC has at least one test +- No duplicate coverage across levels +- Critical paths have multiple levels +- Risk mitigations are addressed ## Outputs @@ -1519,13 +1301,11 @@ test_scenario: **Save to:** `docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md` -Generate a comprehensive test design document: - ```markdown # Test Design: Story {epic}.{story} Date: {date} -Reviewer: Quinn (Test Architect) +Designer: Quinn (Test Architect) ## Test Strategy Overview @@ -1533,212 +1313,80 @@ Reviewer: Quinn (Test Architect) - Unit tests: Y (A%) - Integration tests: Z (B%) - E2E tests: W (C%) +- Priority distribution: P0: X, P1: Y, P2: Z -## Test Level Rationale +## Test Scenarios by Acceptance Criteria -[Explain why this distribution was chosen] +### AC1: {description} -## Detailed Test Scenarios +#### Scenarios -### Requirement: AC1 - {description} +| ID | Level | Priority | Test | Justification | +| ------------ | ----------- | -------- | ------------------------- | ------------------------ | +| 1.3-UNIT-001 | Unit | P0 | Validate input format | Pure validation logic | +| 1.3-INT-001 | Integration | P0 | Service processes request | Multi-component flow | +| 1.3-E2E-001 | E2E | P1 | User completes journey | Critical path validation | -#### Unit Tests (3 scenarios) +[Continue for all ACs...] -1. **ID**: 1.3-UNIT-001 - **Test**: Validate input format - - **Why Unit**: Pure validation logic - - **Coverage**: Input edge cases - - **Mocks**: None needed - - **Mitigates**: DATA-001 (if applicable) +## Risk Coverage -#### Integration Tests (2 scenarios) +[Map test scenarios to identified risks if risk profile exists] -1. **ID**: 1.3-INT-001 - **Test**: Service processes valid request - - **Why Integration**: Multiple components involved - - **Coverage**: Happy path + error handling - - **Test Doubles**: Mock external API - - **Mitigates**: TECH-002 +## Recommended Execution Order -#### E2E Tests (1 scenario) - -1. **ID**: 1.3-E2E-001 - **Test**: Complete user workflow - - **Why E2E**: Critical user journey - - **Coverage**: Full stack validation - - **Environment**: Staging - - **Max Duration**: 90 seconds - - **Mitigates**: BUS-001 - -[Continue for all requirements...] - -## Test Data Requirements - -### Unit Test Data - -- Static fixtures for calculations -- Edge case values arrays - -### Integration Test Data - -- Test database seeds -- API response fixtures - -### E2E Test Data - -- Test user accounts -- Sandbox environment data - -## Mock/Stub Strategy - -### What to Mock - -- External services (payment, email) -- Time-dependent functions -- Random number generators - -### What NOT to Mock - -- Core business logic -- Database in integration tests -- Critical security functions - -## Test Execution Implementation - -### Parallel Execution - -- All unit tests: Fully parallel (stateless requirement) -- Integration tests: Parallel with isolated databases -- E2E tests: Sequential or limited parallelism - -### Execution Order - -1. Unit tests first (fail fast) -2. Integration tests second -3. E2E tests last (expensive, max 90 seconds each) - -## Risk-Based Test Priority - -### P0 - Must Have (Linked to Critical/High Risks) - -- Security-related tests (SEC-\* risks) -- Data integrity tests (DATA-\* risks) -- Critical business flow tests (BUS-\* risks) -- Tests for risks scored ≥6 in risk profile - -### P1 - Should Have (Medium Risks) - -- Edge case coverage -- Performance tests (PERF-\* risks) -- Error recovery tests -- Tests for risks scored 4-5 - -### P2 - Nice to Have (Low Risks) - -- UI polish tests -- Minor validation tests -- Tests for risks scored ≤3 - -## Test Maintenance Considerations - -### High Maintenance Tests - -[List tests that may need frequent updates] - -### Stability Measures - -- No retry strategies (tests must be deterministic) -- Dynamic waits only (no hard sleeps) -- Environment isolation -- Self-cleaning test data - -## Coverage Goals - -### Unit Test Coverage - -- Target: 80% line coverage -- Focus: Business logic, calculations - -### Integration Coverage - -- Target: All API endpoints -- Focus: Contract validation - -### E2E Coverage - -- Target: Critical paths only -- Focus: User value delivery +1. P0 Unit tests (fail fast) +2. P0 Integration tests +3. P0 E2E tests +4. P1 tests in order +5. P2+ as time permits ``` -## Test Level Smells to Flag +### Output 2: Gate YAML Block -### Over-testing Smells +Generate for inclusion in quality gate: -- Same logic tested at multiple levels -- E2E tests for calculations -- Integration tests for framework features +```yaml +test_design: + scenarios_total: X + by_level: + unit: Y + integration: Z + e2e: W + by_priority: + p0: A + p1: B + p2: C + coverage_gaps: [] # List any ACs without tests +``` -### Under-testing Smells +### Output 3: Trace References -- No unit tests for complex logic -- Missing integration tests for data operations -- No E2E tests for critical user paths +Print for use by trace-requirements task: -### Wrong Level Smells +```text +Test design matrix: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md +P0 tests identified: {count} +``` -- Unit tests with real database -- E2E tests checking calculation results -- Integration tests mocking everything +## Quality Checklist -## Quality Indicators +Before finalizing, verify: -Good test design shows: - -- Clear level separation -- No redundant coverage -- Fast feedback from unit tests -- Reliable integration tests -- Focused e2e tests +- [ ] Every AC has test coverage +- [ ] Test levels are appropriate (not over-testing) +- [ ] No duplicate coverage across levels +- [ ] Priorities align with business risk +- [ ] Test IDs follow naming convention +- [ ] Scenarios are atomic and independent ## Key Principles -- Test at the lowest appropriate level -- One clear owner per test -- Fast tests run first -- Mock at boundaries, not internals -- E2E for user value, not implementation -- Maintain test/production parity where critical -- Tests must be atomic and self-contained -- No shared state between tests -- Explicit assertions in test files (not helpers) - -### Output 2: Story Hook Line - -**Print this line for review task to quote:** - -```text -Test design: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md -``` - -**For traceability:** This planning document will be referenced by trace-requirements task. - -### Output 3: Test Count Summary - -**Print summary for quick reference:** - -```yaml -test_summary: - total: { total_count } - by_level: - unit: { unit_count } - integration: { int_count } - e2e: { e2e_count } - by_priority: - P0: { p0_count } - P1: { p1_count } - P2: { p2_count } - coverage_gaps: [] # List any ACs without tests -``` +- **Shift left**: Prefer unit over integration, integration over E2E +- **Risk-based**: Focus on what could go wrong +- **Efficient coverage**: Test once at the right level +- **Maintainability**: Consider long-term test maintenance +- **Fast feedback**: Quick tests run first ==================== END: .bmad-core/tasks/test-design.md ==================== ==================== START: .bmad-core/tasks/nfr-assess.md ==================== @@ -1750,12 +1398,12 @@ Quick NFR validation focused on the core four: security, performance, reliabilit ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: 'docs/stories/{epic}.{story}.*.md' optional: - - architecture_refs: "docs/architecture/*.md" - - technical_preferences: "docs/technical-preferences.md" + - architecture_refs: 'docs/architecture/*.md' + - technical_preferences: 'docs/technical-preferences.md' - acceptance_criteria: From story file ``` @@ -1836,16 +1484,16 @@ nfr_validation: _assessed: [security, performance, reliability, maintainability] security: status: CONCERNS - notes: "No rate limiting on auth endpoints" + notes: 'No rate limiting on auth endpoints' performance: status: PASS - notes: "Response times < 200ms verified" + notes: 'Response times < 200ms verified' reliability: status: PASS - notes: "Error handling and retries implemented" + notes: 'Error handling and retries implemented' maintainability: status: CONCERNS - notes: "Test coverage at 65%, target is 80%" + notes: 'Test coverage at 65%, target is 80%' ``` ## Deterministic Status Rules @@ -2075,10 +1723,10 @@ performance_deep_dive: p99: 350ms database: slow_queries: 2 - missing_indexes: ["users.email", "orders.user_id"] + missing_indexes: ['users.email', 'orders.user_id'] caching: hit_rate: 0% - recommendation: "Add Redis for session data" + recommendation: 'Add Redis for session data' load_test: max_rps: 150 breaking_point: 200 rps @@ -2095,14 +1743,14 @@ template: output: format: markdown filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md - title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + title: 'Story {{epic_num}}.{{story_num}}: {{story_title_short}}' workflow: mode: interactive elicitation: advanced-elicitation agent_config: - editable_sections: + editable_sections: - Status - Story - Acceptance Criteria @@ -2119,7 +1767,7 @@ sections: instruction: Select the current status of the story owner: scrum-master editors: [scrum-master, dev-agent] - + - id: story title: Story type: template-text @@ -2131,7 +1779,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: acceptance-criteria title: Acceptance Criteria type: numbered-list @@ -2139,7 +1787,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: tasks-subtasks title: Tasks / Subtasks type: bullet-list @@ -2156,7 +1804,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master, dev-agent] - + - id: dev-notes title: Dev Notes instruction: | @@ -2180,7 +1828,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: change-log title: Change Log type: table @@ -2188,7 +1836,7 @@ sections: instruction: Track changes made to this story document owner: scrum-master editors: [scrum-master, dev-agent, qa-agent] - + - id: dev-agent-record title: Dev Agent Record instruction: This section is populated by the development agent during implementation @@ -2197,29 +1845,29 @@ sections: sections: - id: agent-model title: Agent Model Used - template: "{{agent_model_name_version}}" + template: '{{agent_model_name_version}}' instruction: Record the specific AI agent model and version used for development owner: dev-agent editors: [dev-agent] - + - id: debug-log-references title: Debug Log References instruction: Reference any debug logs or traces generated during development owner: dev-agent editors: [dev-agent] - + - id: completion-notes title: Completion Notes List instruction: Notes about the completion of tasks and any issues encountered owner: dev-agent editors: [dev-agent] - + - id: file-list title: File List instruction: List all files created, modified, or affected during story implementation owner: dev-agent editors: [dev-agent] - + - id: qa-results title: QA Results instruction: Results from QA Agent QA review of the completed story implementation @@ -2235,16 +1883,16 @@ template: output: format: yaml filename: docs/qa/gates/{{epic_num}}.{{story_num}}-{{story_slug}}.yml - title: "Quality Gate: {{epic_num}}.{{story_num}}" + title: 'Quality Gate: {{epic_num}}.{{story_num}}' # Required fields (keep these first) schema: 1 -story: "{{epic_num}}.{{story_num}}" -story_title: "{{story_title}}" -gate: "{{gate_status}}" # PASS|CONCERNS|FAIL|WAIVED -status_reason: "{{status_reason}}" # 1-2 sentence summary of why this gate decision -reviewer: "Quinn (Test Architect)" -updated: "{{iso_timestamp}}" +story: '{{epic_num}}.{{story_num}}' +story_title: '{{story_title}}' +gate: '{{gate_status}}' # PASS|CONCERNS|FAIL|WAIVED +status_reason: '{{status_reason}}' # 1-2 sentence summary of why this gate decision +reviewer: 'Quinn (Test Architect)' +updated: '{{iso_timestamp}}' # Always present but only active when WAIVED waiver: { active: false } @@ -2259,68 +1907,77 @@ risk_summary: must_fix: [] monitor: [] -# Example with issues: -# top_issues: -# - id: "SEC-001" -# severity: high # ONLY: low|medium|high -# finding: "No rate limiting on login endpoint" -# suggested_action: "Add rate limiting middleware before production" -# - id: "TEST-001" -# severity: medium -# finding: "Missing integration tests for auth flow" -# suggested_action: "Add test coverage for critical paths" +# Examples section using block scalars for clarity +examples: + with_issues: | + top_issues: + - id: "SEC-001" + severity: high # ONLY: low|medium|high + finding: "No rate limiting on login endpoint" + suggested_action: "Add rate limiting middleware before production" + - id: "TEST-001" + severity: medium + finding: "Missing integration tests for auth flow" + suggested_action: "Add test coverage for critical paths" -# Example when waived: -# waiver: -# active: true -# reason: "Accepted for MVP release - will address in next sprint" -# approved_by: "Product Owner" + when_waived: | + waiver: + active: true + reason: "Accepted for MVP release - will address in next sprint" + approved_by: "Product Owner" # ============ Optional Extended Fields ============ # Uncomment and use if your team wants more detail -# quality_score: 75 # 0-100 (optional scoring) -# expires: "2025-01-26T00:00:00Z" # Optional gate freshness window +optional_fields_examples: + quality_and_expiry: | + quality_score: 75 # 0-100 (optional scoring) + expires: "2025-01-26T00:00:00Z" # Optional gate freshness window -# evidence: -# tests_reviewed: 15 -# risks_identified: 3 -# trace: -# ac_covered: [1, 2, 3] # AC numbers with test coverage -# ac_gaps: [4] # AC numbers lacking coverage + evidence: | + evidence: + tests_reviewed: 15 + risks_identified: 3 + trace: + ac_covered: [1, 2, 3] # AC numbers with test coverage + ac_gaps: [4] # AC numbers lacking coverage -# nfr_validation: -# security: { status: CONCERNS, notes: "Rate limiting missing" } -# performance: { status: PASS, notes: "" } -# reliability: { status: PASS, notes: "" } -# maintainability: { status: PASS, notes: "" } + nfr_validation: | + nfr_validation: + security: { status: CONCERNS, notes: "Rate limiting missing" } + performance: { status: PASS, notes: "" } + reliability: { status: PASS, notes: "" } + maintainability: { status: PASS, notes: "" } -# history: # Append-only audit trail -# - at: "2025-01-12T10:00:00Z" -# gate: FAIL -# note: "Initial review - missing tests" -# - at: "2025-01-12T15:00:00Z" -# gate: CONCERNS -# note: "Tests added but rate limiting still missing" + history: | + history: # Append-only audit trail + - at: "2025-01-12T10:00:00Z" + gate: FAIL + note: "Initial review - missing tests" + - at: "2025-01-12T15:00:00Z" + gate: CONCERNS + note: "Tests added but rate limiting still missing" -# risk_summary: # From risk-profile task -# totals: -# critical: 0 -# high: 0 -# medium: 0 -# low: 0 -# # 'highest' is emitted only when risks exist -# recommendations: -# must_fix: [] -# monitor: [] + risk_summary: | + risk_summary: # From risk-profile task + totals: + critical: 0 + high: 0 + medium: 0 + low: 0 + # 'highest' is emitted only when risks exist + recommendations: + must_fix: [] + monitor: [] -# recommendations: -# immediate: # Must fix before production -# - action: "Add rate limiting to auth endpoints" -# refs: ["api/auth/login.ts:42-68"] -# future: # Can be addressed later -# - action: "Consider caching for better performance" -# refs: ["services/data.service.ts"] + recommendations: | + recommendations: + immediate: # Must fix before production + - action: "Add rate limiting to auth endpoints" + refs: ["api/auth/login.ts:42-68"] + future: # Can be addressed later + - action: "Consider caching for better performance" + refs: ["services/data.service.ts"] ==================== END: .bmad-core/templates/qa-gate-tmpl.yaml ==================== ==================== START: .bmad-core/data/technical-preferences.md ==================== diff --git a/dist/agents/sm.txt b/dist/agents/sm.txt index ff1a7ae2..10e3a925 100644 --- a/dist/agents/sm.txt +++ b/dist/agents/sm.txt @@ -369,14 +369,14 @@ template: output: format: markdown filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md - title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + title: 'Story {{epic_num}}.{{story_num}}: {{story_title_short}}' workflow: mode: interactive elicitation: advanced-elicitation agent_config: - editable_sections: + editable_sections: - Status - Story - Acceptance Criteria @@ -393,7 +393,7 @@ sections: instruction: Select the current status of the story owner: scrum-master editors: [scrum-master, dev-agent] - + - id: story title: Story type: template-text @@ -405,7 +405,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: acceptance-criteria title: Acceptance Criteria type: numbered-list @@ -413,7 +413,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: tasks-subtasks title: Tasks / Subtasks type: bullet-list @@ -430,7 +430,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master, dev-agent] - + - id: dev-notes title: Dev Notes instruction: | @@ -454,7 +454,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: change-log title: Change Log type: table @@ -462,7 +462,7 @@ sections: instruction: Track changes made to this story document owner: scrum-master editors: [scrum-master, dev-agent, qa-agent] - + - id: dev-agent-record title: Dev Agent Record instruction: This section is populated by the development agent during implementation @@ -471,29 +471,29 @@ sections: sections: - id: agent-model title: Agent Model Used - template: "{{agent_model_name_version}}" + template: '{{agent_model_name_version}}' instruction: Record the specific AI agent model and version used for development owner: dev-agent editors: [dev-agent] - + - id: debug-log-references title: Debug Log References instruction: Reference any debug logs or traces generated during development owner: dev-agent editors: [dev-agent] - + - id: completion-notes title: Completion Notes List instruction: Notes about the completion of tasks and any issues encountered owner: dev-agent editors: [dev-agent] - + - id: file-list title: File List instruction: List all files created, modified, or affected during story implementation owner: dev-agent editors: [dev-agent] - + - id: qa-results title: QA Results instruction: Results from QA Agent QA review of the completed story implementation diff --git a/dist/agents/ux-expert.txt b/dist/agents/ux-expert.txt index d6bf6596..1b0fbc3e 100644 --- a/dist/agents/ux-expert.txt +++ b/dist/agents/ux-expert.txt @@ -343,7 +343,7 @@ template: output: format: markdown filename: docs/front-end-spec.md - title: "{{project_name}} UI/UX Specification" + title: '{{project_name}} UI/UX Specification' workflow: mode: interactive @@ -354,7 +354,7 @@ sections: title: Introduction instruction: | Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification. - + Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted. content: | This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{project_name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. @@ -363,7 +363,7 @@ sections: title: Overall UX Goals & Principles instruction: | Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: - + 1. Target User Personas - elicit details or confirm existing ones from PRD 2. Key Usability Goals - understand what success looks like for users 3. Core Design Principles - establish 3-5 guiding principles @@ -371,29 +371,29 @@ sections: sections: - id: user-personas title: Target User Personas - template: "{{persona_descriptions}}" + template: '{{persona_descriptions}}' examples: - - "**Power User:** Technical professionals who need advanced features and efficiency" - - "**Casual User:** Occasional users who prioritize ease of use and clear guidance" - - "**Administrator:** System managers who need control and oversight capabilities" + - '**Power User:** Technical professionals who need advanced features and efficiency' + - '**Casual User:** Occasional users who prioritize ease of use and clear guidance' + - '**Administrator:** System managers who need control and oversight capabilities' - id: usability-goals title: Usability Goals - template: "{{usability_goals}}" + template: '{{usability_goals}}' examples: - - "Ease of learning: New users can complete core tasks within 5 minutes" - - "Efficiency of use: Power users can complete frequent tasks with minimal clicks" - - "Error prevention: Clear validation and confirmation for destructive actions" - - "Memorability: Infrequent users can return without relearning" + - 'Ease of learning: New users can complete core tasks within 5 minutes' + - 'Efficiency of use: Power users can complete frequent tasks with minimal clicks' + - 'Error prevention: Clear validation and confirmation for destructive actions' + - 'Memorability: Infrequent users can return without relearning' - id: design-principles title: Design Principles - template: "{{design_principles}}" + template: '{{design_principles}}' type: numbered-list examples: - - "**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation" + - '**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation' - "**Progressive disclosure** - Show only what's needed, when it's needed" - - "**Consistent patterns** - Use familiar UI patterns throughout the application" - - "**Immediate feedback** - Every action should have a clear, immediate response" - - "**Accessible by default** - Design for all users from the start" + - '**Consistent patterns** - Use familiar UI patterns throughout the application' + - '**Immediate feedback** - Every action should have a clear, immediate response' + - '**Accessible by default** - Design for all users from the start' - id: changelog title: Change Log type: table @@ -404,7 +404,7 @@ sections: title: Information Architecture (IA) instruction: | Collaborate with the user to create a comprehensive information architecture: - + 1. Build a Site Map or Screen Inventory showing all major areas 2. Define the Navigation Structure (primary, secondary, breadcrumbs) 3. Use Mermaid diagrams for visual representation @@ -415,7 +415,7 @@ sections: title: Site Map / Screen Inventory type: mermaid mermaid_type: graph - template: "{{sitemap_diagram}}" + template: '{{sitemap_diagram}}' examples: - | graph TD @@ -434,46 +434,46 @@ sections: title: Navigation Structure template: | **Primary Navigation:** {{primary_nav_description}} - + **Secondary Navigation:** {{secondary_nav_description}} - + **Breadcrumb Strategy:** {{breadcrumb_strategy}} - id: user-flows title: User Flows instruction: | For each critical user task identified in the PRD: - + 1. Define the user's goal clearly 2. Map out all steps including decision points 3. Consider edge cases and error states 4. Use Mermaid flow diagrams for clarity 5. Link to external tools (Figma/Miro) if detailed flows exist there - + Create subsections for each major flow. elicit: true repeatable: true sections: - id: flow - title: "{{flow_name}}" + title: '{{flow_name}}' template: | **User Goal:** {{flow_goal}} - + **Entry Points:** {{entry_points}} - + **Success Criteria:** {{success_criteria}} sections: - id: flow-diagram title: Flow Diagram type: mermaid mermaid_type: graph - template: "{{flow_diagram}}" + template: '{{flow_diagram}}' - id: edge-cases - title: "Edge Cases & Error Handling:" + title: 'Edge Cases & Error Handling:' type: bullet-list - template: "- {{edge_case}}" + template: '- {{edge_case}}' - id: notes - template: "**Notes:** {{flow_notes}}" + template: '**Notes:** {{flow_notes}}' - id: wireframes-mockups title: Wireframes & Mockups @@ -482,23 +482,23 @@ sections: elicit: true sections: - id: design-files - template: "**Primary Design Files:** {{design_tool_link}}" + template: '**Primary Design Files:** {{design_tool_link}}' - id: key-screen-layouts title: Key Screen Layouts repeatable: true sections: - id: screen - title: "{{screen_name}}" + title: '{{screen_name}}' template: | **Purpose:** {{screen_purpose}} - + **Key Elements:** - {{element_1}} - {{element_2}} - {{element_3}} - + **Interaction Notes:** {{interaction_notes}} - + **Design File Reference:** {{specific_frame_link}} - id: component-library @@ -508,20 +508,20 @@ sections: elicit: true sections: - id: design-system-approach - template: "**Design System Approach:** {{design_system_approach}}" + template: '**Design System Approach:** {{design_system_approach}}' - id: core-components title: Core Components repeatable: true sections: - id: component - title: "{{component_name}}" + title: '{{component_name}}' template: | **Purpose:** {{component_purpose}} - + **Variants:** {{component_variants}} - + **States:** {{component_states}} - + **Usage Guidelines:** {{usage_guidelines}} - id: branding-style @@ -531,19 +531,19 @@ sections: sections: - id: visual-identity title: Visual Identity - template: "**Brand Guidelines:** {{brand_guidelines_link}}" + template: '**Brand Guidelines:** {{brand_guidelines_link}}' - id: color-palette title: Color Palette type: table - columns: ["Color Type", "Hex Code", "Usage"] + columns: ['Color Type', 'Hex Code', 'Usage'] rows: - - ["Primary", "{{primary_color}}", "{{primary_usage}}"] - - ["Secondary", "{{secondary_color}}", "{{secondary_usage}}"] - - ["Accent", "{{accent_color}}", "{{accent_usage}}"] - - ["Success", "{{success_color}}", "Positive feedback, confirmations"] - - ["Warning", "{{warning_color}}", "Cautions, important notices"] - - ["Error", "{{error_color}}", "Errors, destructive actions"] - - ["Neutral", "{{neutral_colors}}", "Text, borders, backgrounds"] + - ['Primary', '{{primary_color}}', '{{primary_usage}}'] + - ['Secondary', '{{secondary_color}}', '{{secondary_usage}}'] + - ['Accent', '{{accent_color}}', '{{accent_usage}}'] + - ['Success', '{{success_color}}', 'Positive feedback, confirmations'] + - ['Warning', '{{warning_color}}', 'Cautions, important notices'] + - ['Error', '{{error_color}}', 'Errors, destructive actions'] + - ['Neutral', '{{neutral_colors}}', 'Text, borders, backgrounds'] - id: typography title: Typography sections: @@ -556,24 +556,24 @@ sections: - id: type-scale title: Type Scale type: table - columns: ["Element", "Size", "Weight", "Line Height"] + columns: ['Element', 'Size', 'Weight', 'Line Height'] rows: - - ["H1", "{{h1_size}}", "{{h1_weight}}", "{{h1_line}}"] - - ["H2", "{{h2_size}}", "{{h2_weight}}", "{{h2_line}}"] - - ["H3", "{{h3_size}}", "{{h3_weight}}", "{{h3_line}}"] - - ["Body", "{{body_size}}", "{{body_weight}}", "{{body_line}}"] - - ["Small", "{{small_size}}", "{{small_weight}}", "{{small_line}}"] + - ['H1', '{{h1_size}}', '{{h1_weight}}', '{{h1_line}}'] + - ['H2', '{{h2_size}}', '{{h2_weight}}', '{{h2_line}}'] + - ['H3', '{{h3_size}}', '{{h3_weight}}', '{{h3_line}}'] + - ['Body', '{{body_size}}', '{{body_weight}}', '{{body_line}}'] + - ['Small', '{{small_size}}', '{{small_weight}}', '{{small_line}}'] - id: iconography title: Iconography template: | **Icon Library:** {{icon_library}} - + **Usage Guidelines:** {{icon_guidelines}} - id: spacing-layout title: Spacing & Layout template: | **Grid System:** {{grid_system}} - + **Spacing Scale:** {{spacing_scale}} - id: accessibility @@ -583,7 +583,7 @@ sections: sections: - id: compliance-target title: Compliance Target - template: "**Standard:** {{compliance_standard}}" + template: '**Standard:** {{compliance_standard}}' - id: key-requirements title: Key Requirements template: | @@ -591,19 +591,19 @@ sections: - Color contrast ratios: {{contrast_requirements}} - Focus indicators: {{focus_requirements}} - Text sizing: {{text_requirements}} - + **Interaction:** - Keyboard navigation: {{keyboard_requirements}} - Screen reader support: {{screen_reader_requirements}} - Touch targets: {{touch_requirements}} - + **Content:** - Alternative text: {{alt_text_requirements}} - Heading structure: {{heading_requirements}} - Form labels: {{form_requirements}} - id: testing-strategy title: Testing Strategy - template: "{{accessibility_testing}}" + template: '{{accessibility_testing}}' - id: responsiveness title: Responsiveness Strategy @@ -613,21 +613,21 @@ sections: - id: breakpoints title: Breakpoints type: table - columns: ["Breakpoint", "Min Width", "Max Width", "Target Devices"] + columns: ['Breakpoint', 'Min Width', 'Max Width', 'Target Devices'] rows: - - ["Mobile", "{{mobile_min}}", "{{mobile_max}}", "{{mobile_devices}}"] - - ["Tablet", "{{tablet_min}}", "{{tablet_max}}", "{{tablet_devices}}"] - - ["Desktop", "{{desktop_min}}", "{{desktop_max}}", "{{desktop_devices}}"] - - ["Wide", "{{wide_min}}", "-", "{{wide_devices}}"] + - ['Mobile', '{{mobile_min}}', '{{mobile_max}}', '{{mobile_devices}}'] + - ['Tablet', '{{tablet_min}}', '{{tablet_max}}', '{{tablet_devices}}'] + - ['Desktop', '{{desktop_min}}', '{{desktop_max}}', '{{desktop_devices}}'] + - ['Wide', '{{wide_min}}', '-', '{{wide_devices}}'] - id: adaptation-patterns title: Adaptation Patterns template: | **Layout Changes:** {{layout_adaptations}} - + **Navigation Changes:** {{nav_adaptations}} - + **Content Priority:** {{content_adaptations}} - + **Interaction Changes:** {{interaction_adaptations}} - id: animation @@ -637,11 +637,11 @@ sections: sections: - id: motion-principles title: Motion Principles - template: "{{motion_principles}}" + template: '{{motion_principles}}' - id: key-animations title: Key Animations repeatable: true - template: "- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})" + template: '- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})' - id: performance title: Performance Considerations @@ -655,13 +655,13 @@ sections: - **Animation FPS:** {{animation_goal}} - id: design-strategies title: Design Strategies - template: "{{performance_strategies}}" + template: '{{performance_strategies}}' - id: next-steps title: Next Steps instruction: | After completing the UI/UX specification: - + 1. Recommend review with stakeholders 2. Suggest creating/updating visual designs in design tool 3. Prepare for handoff to Design Architect for frontend architecture @@ -670,17 +670,17 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action}}" + template: '{{action}}' - id: design-handoff-checklist title: Design Handoff Checklist type: checklist items: - - "All user flows documented" - - "Component inventory complete" - - "Accessibility requirements defined" - - "Responsive strategy clear" - - "Brand guidelines incorporated" - - "Performance goals established" + - 'All user flows documented' + - 'Component inventory complete' + - 'Accessibility requirements defined' + - 'Responsive strategy clear' + - 'Brand guidelines incorporated' + - 'Performance goals established' - id: checklist-results title: Checklist Results diff --git a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt index 221c4565..de4250fd 100644 --- a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +++ b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt @@ -981,8 +981,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-game-design-document.md" - title: "{{game_title}} Game Design Document (GDD)" + filename: 'docs/{{game_name}}-game-design-document.md' + title: '{{game_title}} Game Design Document (GDD)' workflow: mode: interactive @@ -991,7 +991,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive Game Design Document that will serve as the foundation for all game development work. The GDD should be detailed enough that developers can create user stories and epics from it. Focus on gameplay systems, mechanics, and technical requirements that can be broken down into implementable features. - + If available, review any provided documents or ask if any are optionally available: Project Brief, Market Research, Competitive Analysis - id: executive-summary @@ -1019,7 +1019,7 @@ sections: title: Unique Selling Points instruction: List 3-5 key features that differentiate this game from competitors type: numbered-list - template: "{{usp}}" + template: '{{usp}}' - id: core-gameplay title: Core Gameplay @@ -1036,7 +1036,7 @@ sections: instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions. template: | **Primary Loop ({{duration}} seconds):** - + 1. {{action_1}} ({{time_1}}s) 2. {{action_2}} ({{time_2}}s) 3. {{action_3}} ({{time_3}}s) @@ -1046,12 +1046,12 @@ sections: instruction: Clearly define success and failure states template: | **Victory Conditions:** - + - {{win_condition_1}} - {{win_condition_2}} - + **Failure States:** - + - {{loss_condition_1}} - {{loss_condition_2}} @@ -1064,20 +1064,20 @@ sections: repeatable: true sections: - id: mechanic - title: "{{mechanic_name}}" + title: '{{mechanic_name}}' template: | **Description:** {{detailed_description}} - + **Player Input:** {{input_method}} - + **System Response:** {{game_response}} - + **Implementation Notes:** - + - {{tech_requirement_1}} - {{tech_requirement_2}} - {{performance_consideration}} - + **Dependencies:** {{other_mechanics_needed}} - id: controls title: Controls @@ -1096,9 +1096,9 @@ sections: title: Player Progression template: | **Progression Type:** {{linear|branching|metroidvania}} - + **Key Milestones:** - + 1. **{{milestone_1}}** - {{unlock_description}} 2. **{{milestone_2}}** - {{unlock_description}} 3. **{{milestone_3}}** - {{unlock_description}} @@ -1129,15 +1129,15 @@ sections: repeatable: true sections: - id: level-type - title: "{{level_type_name}}" + title: '{{level_type_name}}' template: | **Purpose:** {{gameplay_purpose}} **Duration:** {{target_time}} **Key Elements:** {{required_mechanics}} **Difficulty:** {{relative_difficulty}} - + **Structure Template:** - + - Introduction: {{intro_description}} - Challenge: {{main_challenge}} - Resolution: {{completion_requirement}} @@ -1163,13 +1163,13 @@ sections: title: Platform Specific template: | **Desktop:** - + - Resolution: {{min_resolution}} - {{max_resolution}} - Input: Keyboard, Mouse, Gamepad - Browser: Chrome 80+, Firefox 75+, Safari 13+ - + **Mobile:** - + - Resolution: {{mobile_min}} - {{mobile_max}} - Input: Touch, Tilt (optional) - OS: iOS 13+, Android 8+ @@ -1178,14 +1178,14 @@ sections: instruction: Define asset specifications for the art and audio teams template: | **Visual Assets:** - + - Art Style: {{style_description}} - Color Palette: {{color_specification}} - Animation: {{animation_requirements}} - UI Resolution: {{ui_specs}} - + **Audio Assets:** - + - Music Style: {{music_genre}} - Sound Effects: {{sfx_requirements}} - Voice Acting: {{voice_needs}} @@ -1198,7 +1198,7 @@ sections: title: Engine Configuration template: | **Phaser 3 Setup:** - + - TypeScript: Strict mode enabled - Physics: {{physics_system}} (Arcade/Matter) - Renderer: WebGL with Canvas fallback @@ -1207,7 +1207,7 @@ sections: title: Code Architecture template: | **Required Systems:** - + - Scene Management - State Management - Asset Loading @@ -1219,7 +1219,7 @@ sections: title: Data Management template: | **Save Data:** - + - Progress tracking - Settings persistence - Statistics collection @@ -1230,10 +1230,10 @@ sections: instruction: Break down the development into phases that can be converted to epics sections: - id: phase-1-core-systems - title: "Phase 1: Core Systems ({{duration}})" + title: 'Phase 1: Core Systems ({{duration}})' sections: - id: foundation-epic - title: "Epic: Foundation" + title: 'Epic: Foundation' type: bullet-list template: | - Engine setup and configuration @@ -1241,41 +1241,41 @@ sections: - Core input handling - Asset loading pipeline - id: core-mechanics-epic - title: "Epic: Core Mechanics" + title: 'Epic: Core Mechanics' type: bullet-list template: | - {{primary_mechanic}} implementation - Basic physics and collision - Player controller - id: phase-2-gameplay-features - title: "Phase 2: Gameplay Features ({{duration}})" + title: 'Phase 2: Gameplay Features ({{duration}})' sections: - id: game-systems-epic - title: "Epic: Game Systems" + title: 'Epic: Game Systems' type: bullet-list template: | - {{mechanic_2}} implementation - {{mechanic_3}} implementation - Game state management - id: content-creation-epic - title: "Epic: Content Creation" + title: 'Epic: Content Creation' type: bullet-list template: | - Level loading system - First playable levels - Basic UI implementation - id: phase-3-polish-optimization - title: "Phase 3: Polish & Optimization ({{duration}})" + title: 'Phase 3: Polish & Optimization ({{duration}})' sections: - id: performance-epic - title: "Epic: Performance" + title: 'Epic: Performance' type: bullet-list template: | - Optimization and profiling - Mobile platform testing - Memory management - id: user-experience-epic - title: "Epic: User Experience" + title: 'Epic: User Experience' type: bullet-list template: | - Audio implementation @@ -1317,7 +1317,7 @@ sections: title: References instruction: List any competitive analysis, inspiration, or research sources type: bullet-list - template: "{{reference}}" + template: '{{reference}}' ==================== END: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml ==================== @@ -1327,8 +1327,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-level-design-document.md" - title: "{{game_title}} Level Design Document" + filename: 'docs/{{game_name}}-level-design-document.md' + title: '{{game_title}} Level Design Document' workflow: mode: interactive @@ -1337,7 +1337,7 @@ sections: - id: initial-setup instruction: | This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. - id: introduction @@ -1345,7 +1345,7 @@ sections: instruction: Establish the purpose and scope of level design for this game content: | This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. sections: - id: change-log @@ -1389,32 +1389,32 @@ sections: repeatable: true sections: - id: level-category - title: "{{category_name}} Levels" + title: '{{category_name}} Levels' template: | **Purpose:** {{gameplay_purpose}} - + **Target Duration:** {{min_time}} - {{max_time}} minutes - + **Difficulty Range:** {{difficulty_scale}} - + **Key Mechanics Featured:** - + - {{mechanic_1}} - {{usage_description}} - {{mechanic_2}} - {{usage_description}} - + **Player Objectives:** - + - Primary: {{primary_objective}} - Secondary: {{secondary_objective}} - Hidden: {{secret_objective}} - + **Success Criteria:** - + - {{completion_requirement_1}} - {{completion_requirement_2}} - + **Technical Requirements:** - + - Maximum entities: {{entity_limit}} - Performance target: {{fps_target}} FPS - Memory budget: {{memory_limit}}MB @@ -1429,11 +1429,11 @@ sections: instruction: Based on GDD requirements, define the overall level organization template: | **Organization Type:** {{linear|hub_world|open_world}} - + **Total Level Count:** {{number}} - + **World Breakdown:** - + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} @@ -1468,7 +1468,7 @@ sections: instruction: Define how players access new levels template: | **Progression Gates:** - + - Linear progression: Complete previous level - Star requirements: {{star_count}} stars to unlock - Skill gates: Demonstrate {{skill_requirement}} @@ -1483,17 +1483,17 @@ sections: instruction: Define all environmental components that can be used in levels template: | **Terrain Types:** - + - {{terrain_1}}: {{properties_and_usage}} - {{terrain_2}}: {{properties_and_usage}} - + **Interactive Objects:** - + - {{object_1}}: {{behavior_and_purpose}} - {{object_2}}: {{behavior_and_purpose}} - + **Hazards and Obstacles:** - + - {{hazard_1}}: {{damage_and_behavior}} - {{hazard_2}}: {{damage_and_behavior}} - id: collectibles-rewards @@ -1501,18 +1501,18 @@ sections: instruction: Define all collectible items and their placement rules template: | **Collectible Types:** - + - {{collectible_1}}: {{value_and_purpose}} - {{collectible_2}}: {{value_and_purpose}} - + **Placement Guidelines:** - + - Mandatory collectibles: {{placement_rules}} - Optional collectibles: {{placement_rules}} - Secret collectibles: {{placement_rules}} - + **Reward Distribution:** - + - Easy to find: {{percentage}}% - Moderate challenge: {{percentage}}% - High skill required: {{percentage}}% @@ -1521,18 +1521,18 @@ sections: instruction: Define how enemies should be placed and balanced in levels template: | **Enemy Categories:** - + - {{enemy_type_1}}: {{behavior_and_usage}} - {{enemy_type_2}}: {{behavior_and_usage}} - + **Placement Principles:** - + - Introduction encounters: {{guideline}} - Standard encounters: {{guideline}} - Challenge encounters: {{guideline}} - + **Difficulty Scaling:** - + - Enemy count progression: {{scaling_rule}} - Enemy type introduction: {{pacing_rule}} - Encounter complexity: {{complexity_rule}} @@ -1545,14 +1545,14 @@ sections: title: Level Layout Principles template: | **Spatial Design:** - + - Grid size: {{grid_dimensions}} - Minimum path width: {{width_units}} - Maximum vertical distance: {{height_units}} - Safe zones placement: {{safety_guidelines}} - + **Navigation Design:** - + - Clear path indication: {{visual_cues}} - Landmark placement: {{landmark_rules}} - Dead end avoidance: {{dead_end_policy}} @@ -1562,13 +1562,13 @@ sections: instruction: Define how to control the rhythm and pace of gameplay within levels template: | **Action Sequences:** - + - High intensity duration: {{max_duration}} - Rest period requirement: {{min_rest_time}} - Intensity variation: {{pacing_pattern}} - + **Learning Sequences:** - + - New mechanic introduction: {{teaching_method}} - Practice opportunity: {{practice_duration}} - Skill application: {{application_context}} @@ -1577,14 +1577,14 @@ sections: instruction: Define how to create appropriate challenges for each level type template: | **Challenge Types:** - + - Execution challenges: {{skill_requirements}} - Puzzle challenges: {{complexity_guidelines}} - Time challenges: {{time_pressure_rules}} - Resource challenges: {{resource_management}} - + **Difficulty Calibration:** - + - Skill check frequency: {{frequency_guidelines}} - Failure recovery: {{retry_mechanics}} - Hint system integration: {{help_system}} @@ -1598,7 +1598,7 @@ sections: instruction: Define how level data should be structured for implementation template: | **Level File Format:** - + - Data format: {{json|yaml|custom}} - File naming: `level_{{world}}_{{number}}.{{extension}}` - Data organization: {{structure_description}} @@ -1636,14 +1636,14 @@ sections: instruction: Define how level assets are organized and loaded template: | **Tilemap Requirements:** - + - Tile size: {{tile_dimensions}}px - Tileset organization: {{tileset_structure}} - Layer organization: {{layer_system}} - Collision data: {{collision_format}} - + **Audio Integration:** - + - Background music: {{music_requirements}} - Ambient sounds: {{ambient_system}} - Dynamic audio: {{dynamic_audio_rules}} @@ -1652,19 +1652,19 @@ sections: instruction: Define performance requirements for level systems template: | **Entity Limits:** - + - Maximum active entities: {{entity_limit}} - Maximum particles: {{particle_limit}} - Maximum audio sources: {{audio_limit}} - + **Memory Management:** - + - Texture memory budget: {{texture_memory}}MB - Audio memory budget: {{audio_memory}}MB - Level loading time: <{{load_time}}s - + **Culling and LOD:** - + - Off-screen culling: {{culling_distance}} - Level-of-detail rules: {{lod_system}} - Asset streaming: {{streaming_requirements}} @@ -1677,13 +1677,13 @@ sections: title: Automated Testing template: | **Performance Testing:** - + - Frame rate validation: Maintain {{fps_target}} FPS - Memory usage monitoring: Stay under {{memory_limit}}MB - Loading time verification: Complete in <{{load_time}}s - + **Gameplay Testing:** - + - Completion path validation: All objectives achievable - Collectible accessibility: All items reachable - Softlock prevention: No unwinnable states @@ -1694,31 +1694,31 @@ sections: title: Playtesting Checklist type: checklist items: - - "Level completes within target time range" - - "All mechanics function correctly" - - "Difficulty feels appropriate for level category" - - "Player guidance is clear and effective" - - "No exploits or sequence breaks (unless intended)" + - 'Level completes within target time range' + - 'All mechanics function correctly' + - 'Difficulty feels appropriate for level category' + - 'Player guidance is clear and effective' + - 'No exploits or sequence breaks (unless intended)' - id: player-experience-testing title: Player Experience Testing type: checklist items: - - "Tutorial levels teach effectively" - - "Challenge feels fair and rewarding" - - "Flow and pacing maintain engagement" - - "Audio and visual feedback support gameplay" + - 'Tutorial levels teach effectively' + - 'Challenge feels fair and rewarding' + - 'Flow and pacing maintain engagement' + - 'Audio and visual feedback support gameplay' - id: balance-validation title: Balance Validation template: | **Metrics Collection:** - + - Completion rate: Target {{completion_percentage}}% - Average completion time: {{target_time}} ± {{variance}} - Death count per level: <{{max_deaths}} - Collectible discovery rate: {{discovery_percentage}}% - + **Iteration Guidelines:** - + - Adjustment criteria: {{criteria_for_changes}} - Testing sample size: {{minimum_testers}} - Validation period: {{testing_duration}} @@ -1731,14 +1731,14 @@ sections: title: Design Phase template: | **Concept Development:** - + 1. Define level purpose and goals 2. Create rough layout sketch 3. Identify key mechanics and challenges 4. Estimate difficulty and duration - + **Documentation Requirements:** - + - Level design brief - Layout diagrams - Mechanic integration notes @@ -1747,15 +1747,15 @@ sections: title: Implementation Phase template: | **Technical Implementation:** - + 1. Create level data file 2. Build tilemap and layout 3. Place entities and objects 4. Configure level logic and triggers 5. Integrate audio and visual effects - + **Quality Assurance:** - + 1. Automated testing execution 2. Internal playtesting 3. Performance validation @@ -1764,14 +1764,14 @@ sections: title: Integration Phase template: | **Game Integration:** - + 1. Level progression integration 2. Save system compatibility 3. Analytics integration 4. Achievement system integration - + **Final Validation:** - + 1. Full game context testing 2. Performance regression testing 3. Platform compatibility verification @@ -1814,8 +1814,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-game-brief.md" - title: "{{game_title}} Game Brief" + filename: 'docs/{{game_name}}-game-brief.md' + title: '{{game_title}} Game Brief' workflow: mode: interactive @@ -1824,7 +1824,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. - id: game-vision @@ -1881,7 +1881,7 @@ sections: repeatable: true template: | **Core Mechanic: {{mechanic_name}}** - + - **Description:** {{how_it_works}} - **Player Value:** {{why_its_fun}} - **Implementation Scope:** {{complexity_estimate}} @@ -1908,12 +1908,12 @@ sections: title: Technical Constraints template: | **Platform Requirements:** - + - Primary: {{platform_1}} - {{requirements}} - Secondary: {{platform_2}} - {{requirements}} - + **Technical Specifications:** - + - Engine: Phaser 3 + TypeScript - Performance Target: {{fps_target}} FPS on {{target_device}} - Memory Budget: <{{memory_limit}}MB @@ -1951,10 +1951,10 @@ sections: title: Competitive Analysis template: | **Direct Competitors:** - + - {{competitor_1}}: {{strengths_and_weaknesses}} - {{competitor_2}}: {{strengths_and_weaknesses}} - + **Differentiation Strategy:** {{how_we_differ_and_why_thats_valuable}} - id: market-opportunity @@ -1978,16 +1978,16 @@ sections: title: Content Categories template: | **Core Content:** - + - {{content_type_1}}: {{quantity_and_description}} - {{content_type_2}}: {{quantity_and_description}} - + **Optional Content:** - + - {{optional_content_type}}: {{quantity_and_description}} - + **Replay Elements:** - + - {{replayability_features}} - id: difficulty-accessibility title: Difficulty and Accessibility @@ -2054,13 +2054,13 @@ sections: title: Player Experience Metrics template: | **Engagement Goals:** - + - Tutorial completion rate: >{{percentage}}% - Average session length: {{duration}} minutes - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - + **Quality Benchmarks:** - + - Player satisfaction: >{{rating}}/10 - Completion rate: >{{percentage}}% - Technical performance: {{fps_target}} FPS consistent @@ -2068,13 +2068,13 @@ sections: title: Development Metrics template: | **Technical Targets:** - + - Zero critical bugs at launch - Performance targets met on all platforms - Load times under {{seconds}}s - + **Process Goals:** - + - Development timeline adherence - Feature scope completion - Quality assurance standards @@ -2083,7 +2083,7 @@ sections: condition: has_business_goals template: | **Commercial Goals:** - + - {{revenue_target}} in first {{time_period}} - {{user_acquisition_target}} players in first {{time_period}} - {{retention_target}} monthly active users @@ -2101,21 +2101,21 @@ sections: title: Development Roadmap sections: - id: phase-1-preproduction - title: "Phase 1: Pre-Production ({{duration}})" + title: 'Phase 1: Pre-Production ({{duration}})' type: bullet-list template: | - Detailed Game Design Document creation - Technical architecture planning - Art style exploration and pipeline setup - id: phase-2-prototype - title: "Phase 2: Prototype ({{duration}})" + title: 'Phase 2: Prototype ({{duration}})' type: bullet-list template: | - Core mechanic implementation - Technical proof of concept - Initial playtesting and iteration - id: phase-3-production - title: "Phase 3: Production ({{duration}})" + title: 'Phase 3: Production ({{duration}})' type: bullet-list template: | - Full feature development @@ -2136,12 +2136,12 @@ sections: title: Validation Plan template: | **Concept Testing:** - + - {{validation_method_1}} - {{timeline}} - {{validation_method_2}} - {{timeline}} - + **Prototype Testing:** - + - {{testing_approach}} - {{timeline}} - {{feedback_collection_method}} - {{timeline}} diff --git a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt index 8a7a0f3d..7adc27b3 100644 --- a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +++ b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt @@ -197,8 +197,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-game-architecture.md" - title: "{{game_title}} Game Architecture Document" + filename: 'docs/{{game_name}}-game-architecture.md' + title: '{{game_title}} Game Architecture Document' workflow: mode: interactive @@ -207,7 +207,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics. - + If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD. - id: introduction @@ -215,7 +215,7 @@ sections: instruction: Establish the document's purpose and scope for game development content: | This document outlines the complete technical architecture for {{game_title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems. - + This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility. sections: - id: change-log @@ -234,7 +234,7 @@ sections: title: Architecture Summary instruction: | Provide a comprehensive overview covering: - + - Game engine choice and configuration - Project structure and organization - Key systems and their interactions @@ -322,23 +322,23 @@ sections: title: Scene Management System template: | **Purpose:** Handle game flow and scene transitions - + **Key Components:** - + - Scene loading and unloading - Data passing between scenes - Transition effects - Memory management - + **Implementation Requirements:** - + - Preload scene for asset loading - Menu system with navigation - Gameplay scenes with state management - Pause/resume functionality - + **Files to Create:** - + - `src/scenes/BootScene.ts` - `src/scenes/PreloadScene.ts` - `src/scenes/MenuScene.ts` @@ -348,23 +348,23 @@ sections: title: Game State Management template: | **Purpose:** Track player progress and game status - + **State Categories:** - + - Player progress (levels, unlocks) - Game settings (audio, controls) - Session data (current level, score) - Persistent data (achievements, statistics) - + **Implementation Requirements:** - + - Save/load system with localStorage - State validation and error recovery - Cross-session data persistence - Settings management - + **Files to Create:** - + - `src/systems/GameState.ts` - `src/systems/SaveManager.ts` - `src/types/GameData.ts` @@ -372,23 +372,23 @@ sections: title: Asset Management System template: | **Purpose:** Efficient loading and management of game assets - + **Asset Categories:** - + - Sprite sheets and animations - Audio files and music - Level data and configurations - UI assets and fonts - + **Implementation Requirements:** - + - Progressive loading strategy - Asset caching and optimization - Error handling for failed loads - Memory management for large assets - + **Files to Create:** - + - `src/systems/AssetManager.ts` - `src/config/AssetConfig.ts` - `src/utils/AssetLoader.ts` @@ -396,23 +396,23 @@ sections: title: Input Management System template: | **Purpose:** Handle all player input across platforms - + **Input Types:** - + - Keyboard controls - Mouse/pointer interaction - Touch gestures (mobile) - Gamepad support (optional) - + **Implementation Requirements:** - + - Input mapping and configuration - Touch-friendly mobile controls - Input buffering for responsive gameplay - Customizable control schemes - + **Files to Create:** - + - `src/systems/InputManager.ts` - `src/utils/TouchControls.ts` - `src/types/InputTypes.ts` @@ -422,22 +422,22 @@ sections: repeatable: true sections: - id: mechanic-system - title: "{{mechanic_name}} System" + title: '{{mechanic_name}} System' template: | **Purpose:** {{system_purpose}} - + **Core Functionality:** - + - {{feature_1}} - {{feature_2}} - {{feature_3}} - + **Dependencies:** {{required_systems}} - + **Performance Considerations:** {{optimization_notes}} - + **Files to Create:** - + - `src/systems/{{system_name}}.ts` - `src/gameObjects/{{related_object}}.ts` - `src/types/{{system_types}}.ts` @@ -445,65 +445,65 @@ sections: title: Physics & Collision System template: | **Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js) - + **Collision Categories:** - + - Player collision - Enemy interactions - Environmental objects - Collectibles and items - + **Implementation Requirements:** - + - Optimized collision detection - Physics body management - Collision callbacks and events - Performance monitoring - + **Files to Create:** - + - `src/systems/PhysicsManager.ts` - `src/utils/CollisionGroups.ts` - id: audio-system title: Audio System template: | **Audio Requirements:** - + - Background music with looping - Sound effects for actions - Audio settings and volume control - Mobile audio optimization - + **Implementation Features:** - + - Audio sprite management - Dynamic music system - Spatial audio (if applicable) - Audio pooling for performance - + **Files to Create:** - + - `src/systems/AudioManager.ts` - `src/config/AudioConfig.ts` - id: ui-system title: UI System template: | **UI Components:** - + - HUD elements (score, health, etc.) - Menu navigation - Modal dialogs - Settings screens - + **Implementation Requirements:** - + - Responsive layout system - Touch-friendly interface - Keyboard navigation support - Animation and transitions - + **Files to Create:** - + - `src/systems/UIManager.ts` - `src/gameObjects/UI/` - `src/types/UITypes.ts` @@ -719,7 +719,7 @@ sections: instruction: Break down the architecture implementation into phases that align with the GDD development phases sections: - id: phase-1-foundation - title: "Phase 1: Foundation ({{duration}})" + title: 'Phase 1: Foundation ({{duration}})' sections: - id: phase-1-core title: Core Systems @@ -737,7 +737,7 @@ sections: - "Basic Scene Management System" - "Asset Loading Foundation" - id: phase-2-game-systems - title: "Phase 2: Game Systems ({{duration}})" + title: 'Phase 2: Game Systems ({{duration}})' sections: - id: phase-2-gameplay title: Gameplay Systems @@ -755,7 +755,7 @@ sections: - "Physics and Collision Framework" - "Game State Management System" - id: phase-3-content-polish - title: "Phase 3: Content & Polish ({{duration}})" + title: 'Phase 3: Content & Polish ({{duration}})' sections: - id: phase-3-content title: Content Systems @@ -1045,7 +1045,7 @@ interface GameState { interface GameSettings { musicVolume: number; sfxVolume: number; - difficulty: "easy" | "normal" | "hard"; + difficulty: 'easy' | 'normal' | 'hard'; controls: ControlScheme; } ``` @@ -1086,12 +1086,12 @@ class GameScene extends Phaser.Scene { private inputManager!: InputManager; constructor() { - super({ key: "GameScene" }); + super({ key: 'GameScene' }); } preload(): void { // Load only scene-specific assets - this.load.image("player", "assets/player.png"); + this.load.image('player', 'assets/player.png'); } create(data: SceneData): void { @@ -1116,7 +1116,7 @@ class GameScene extends Phaser.Scene { this.inputManager.destroy(); // Remove event listeners - this.events.off("*"); + this.events.off('*'); } } ``` @@ -1125,13 +1125,13 @@ class GameScene extends Phaser.Scene { ```typescript // Proper scene transitions with data -this.scene.start("NextScene", { +this.scene.start('NextScene', { playerScore: this.playerScore, currentLevel: this.currentLevel + 1, }); // Scene overlays for UI -this.scene.launch("PauseMenuScene"); +this.scene.launch('PauseMenuScene'); this.scene.pause(); ``` @@ -1175,7 +1175,7 @@ class Player extends GameEntity { private health!: HealthComponent; constructor(scene: Phaser.Scene, x: number, y: number) { - super(scene, x, y, "player"); + super(scene, x, y, 'player'); this.movement = this.addComponent(new MovementComponent(this)); this.health = this.addComponent(new HealthComponent(this, 100)); @@ -1195,7 +1195,7 @@ class GameManager { constructor(scene: Phaser.Scene) { if (GameManager.instance) { - throw new Error("GameManager already exists!"); + throw new Error('GameManager already exists!'); } this.scene = scene; @@ -1205,7 +1205,7 @@ class GameManager { static getInstance(): GameManager { if (!GameManager.instance) { - throw new Error("GameManager not initialized!"); + throw new Error('GameManager not initialized!'); } return GameManager.instance; } @@ -1252,7 +1252,7 @@ class BulletPool { } // Pool exhausted - create new bullet - console.warn("Bullet pool exhausted, creating new bullet"); + console.warn('Bullet pool exhausted, creating new bullet'); return new Bullet(this.scene, 0, 0); } @@ -1352,14 +1352,12 @@ class InputManager { } private setupKeyboard(): void { - this.keys = this.scene.input.keyboard.addKeys( - "W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT", - ); + this.keys = this.scene.input.keyboard.addKeys('W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT'); } private setupTouch(): void { - this.scene.input.on("pointerdown", this.handlePointerDown, this); - this.scene.input.on("pointerup", this.handlePointerUp, this); + this.scene.input.on('pointerdown', this.handlePointerDown, this); + this.scene.input.on('pointerup', this.handlePointerUp, this); } update(): void { @@ -1386,9 +1384,9 @@ class InputManager { class AssetManager { loadAssets(): Promise { return new Promise((resolve, reject) => { - this.scene.load.on("filecomplete", this.handleFileComplete, this); - this.scene.load.on("loaderror", this.handleLoadError, this); - this.scene.load.on("complete", () => resolve()); + this.scene.load.on('filecomplete', this.handleFileComplete, this); + this.scene.load.on('loaderror', this.handleLoadError, this); + this.scene.load.on('complete', () => resolve()); this.scene.load.start(); }); @@ -1404,8 +1402,8 @@ class AssetManager { private loadFallbackAsset(key: string): void { // Load placeholder or default assets switch (key) { - case "player": - this.scene.load.image("player", "assets/defaults/default-player.png"); + case 'player': + this.scene.load.image('player', 'assets/defaults/default-player.png'); break; default: console.warn(`No fallback for asset: ${key}`); @@ -1432,11 +1430,11 @@ class GameSystem { private attemptRecovery(context: string): void { switch (context) { - case "update": + case 'update': // Reset system state this.reset(); break; - case "render": + case 'render': // Disable visual effects this.disableEffects(); break; @@ -1456,7 +1454,7 @@ class GameSystem { ```typescript // Example test for game mechanics -describe("HealthComponent", () => { +describe('HealthComponent', () => { let healthComponent: HealthComponent; beforeEach(() => { @@ -1464,18 +1462,18 @@ describe("HealthComponent", () => { healthComponent = new HealthComponent(mockEntity, 100); }); - test("should initialize with correct health", () => { + test('should initialize with correct health', () => { expect(healthComponent.currentHealth).toBe(100); expect(healthComponent.maxHealth).toBe(100); }); - test("should handle damage correctly", () => { + test('should handle damage correctly', () => { healthComponent.takeDamage(25); expect(healthComponent.currentHealth).toBe(75); expect(healthComponent.isAlive()).toBe(true); }); - test("should handle death correctly", () => { + test('should handle death correctly', () => { healthComponent.takeDamage(150); expect(healthComponent.currentHealth).toBe(0); expect(healthComponent.isAlive()).toBe(false); @@ -1488,7 +1486,7 @@ describe("HealthComponent", () => { **Scene Testing:** ```typescript -describe("GameScene Integration", () => { +describe('GameScene Integration', () => { let scene: GameScene; let mockGame: Phaser.Game; @@ -1498,7 +1496,7 @@ describe("GameScene Integration", () => { scene = new GameScene(); }); - test("should initialize all systems", () => { + test('should initialize all systems', () => { scene.create({}); expect(scene.gameManager).toBeDefined(); diff --git a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt index 0612630f..87c970ee 100644 --- a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +++ b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt @@ -402,8 +402,8 @@ template: version: 2.0 output: format: markdown - filename: "stories/{{epic_name}}/{{story_id}}-{{story_name}}.md" - title: "Story: {{story_title}}" + filename: 'stories/{{epic_name}}/{{story_id}}-{{story_name}}.md' + title: 'Story: {{story_title}}' workflow: mode: interactive @@ -412,13 +412,13 @@ sections: - id: initial-setup instruction: | This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. - + Before starting, ensure you have access to: - + - Game Design Document (GDD) - Game Architecture Document - Any existing stories in this epic - + The story should be specific enough that a developer can implement it without requiring additional design decisions. - id: story-header @@ -432,7 +432,7 @@ sections: - id: description title: Description instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature. - template: "{{clear_description_of_what_needs_to_be_implemented}}" + template: '{{clear_description_of_what_needs_to_be_implemented}}' - id: acceptance-criteria title: Acceptance Criteria @@ -442,22 +442,22 @@ sections: title: Functional Requirements type: checklist items: - - "{{specific_functional_requirement}}" + - '{{specific_functional_requirement}}' - id: technical-requirements title: Technical Requirements type: checklist items: - - "Code follows TypeScript strict mode standards" - - "Maintains 60 FPS on target devices" - - "No memory leaks or performance degradation" - - "{{specific_technical_requirement}}" + - 'Code follows TypeScript strict mode standards' + - 'Maintains 60 FPS on target devices' + - 'No memory leaks or performance degradation' + - '{{specific_technical_requirement}}' - id: game-design-requirements title: Game Design Requirements type: checklist items: - - "{{gameplay_requirement_from_gdd}}" - - "{{balance_requirement_if_applicable}}" - - "{{player_experience_requirement}}" + - '{{gameplay_requirement_from_gdd}}' + - '{{balance_requirement_if_applicable}}' + - '{{player_experience_requirement}}' - id: technical-specifications title: Technical Specifications @@ -467,12 +467,12 @@ sections: title: Files to Create/Modify template: | **New Files:** - + - `{{file_path_1}}` - {{purpose}} - `{{file_path_2}}` - {{purpose}} - + **Modified Files:** - + - `{{existing_file_1}}` - {{changes_needed}} - `{{existing_file_2}}` - {{changes_needed}} - id: class-interface-definitions @@ -487,15 +487,15 @@ sections: {{property_2}}: {{type}}; {{method_1}}({{params}}): {{return_type}}; } - + // {{class_name}} class {{class_name}} extends {{phaser_class}} { private {{property}}: {{type}}; - + constructor({{params}}) { // Implementation requirements } - + public {{method}}({{params}}): {{return_type}} { // Method requirements } @@ -505,15 +505,15 @@ sections: instruction: Specify how this feature integrates with existing systems template: | **Scene Integration:** - + - {{scene_name}}: {{integration_details}} - + **System Dependencies:** - + - {{system_name}}: {{dependency_description}} - + **Event Communication:** - + - Emits: `{{event_name}}` when {{condition}} - Listens: `{{event_name}}` to {{response}} @@ -525,7 +525,7 @@ sections: title: Dev Agent Record template: | **Tasks:** - + - [ ] {{task_1_description}} - [ ] {{task_2_description}} - [ ] {{task_3_description}} @@ -533,18 +533,18 @@ sections: - [ ] Write unit tests for {{component}} - [ ] Integration testing with {{related_system}} - [ ] Performance testing and optimization - + **Debug Log:** | Task | File | Change | Reverted? | |------|------|--------|-----------| | | | | | - + **Completion Notes:** - + - + **Change Log:** - + - id: game-design-context @@ -552,13 +552,13 @@ sections: instruction: Reference the specific sections of the GDD that this story implements template: | **GDD Reference:** {{section_name}} ({{page_or_section_number}}) - + **Game Mechanic:** {{mechanic_name}} - + **Player Experience Goal:** {{experience_description}} - + **Balance Parameters:** - + - {{parameter_1}}: {{value_or_range}} - {{parameter_2}}: {{value_or_range}} @@ -570,11 +570,11 @@ sections: title: Unit Tests template: | **Test Files:** - + - `tests/{{component_name}}.test.ts` - + **Test Scenarios:** - + - {{test_scenario_1}} - {{test_scenario_2}} - {{edge_case_test}} @@ -582,12 +582,12 @@ sections: title: Game Testing template: | **Manual Test Cases:** - + 1. {{test_case_1_description}} - + - Expected: {{expected_behavior}} - Performance: {{performance_expectation}} - + 2. {{test_case_2_description}} - Expected: {{expected_behavior}} - Edge Case: {{edge_case_handling}} @@ -595,7 +595,7 @@ sections: title: Performance Tests template: | **Metrics to Verify:** - + - Frame rate maintains {{fps_target}} FPS - Memory usage stays under {{memory_limit}}MB - {{feature_specific_performance_metric}} @@ -605,15 +605,15 @@ sections: instruction: List any dependencies that must be completed before this story can be implemented template: | **Story Dependencies:** - + - {{story_id}}: {{dependency_description}} - + **Technical Dependencies:** - + - {{system_or_file}}: {{requirement}} - + **Asset Dependencies:** - + - {{asset_type}}: {{asset_description}} - Location: `{{asset_path}}` @@ -622,31 +622,31 @@ sections: instruction: Checklist that must be completed before the story is considered finished type: checklist items: - - "All acceptance criteria met" - - "Code reviewed and approved" - - "Unit tests written and passing" - - "Integration tests passing" - - "Performance targets met" - - "No linting errors" - - "Documentation updated" - - "{{game_specific_dod_item}}" + - 'All acceptance criteria met' + - 'Code reviewed and approved' + - 'Unit tests written and passing' + - 'Integration tests passing' + - 'Performance targets met' + - 'No linting errors' + - 'Documentation updated' + - '{{game_specific_dod_item}}' - id: notes title: Notes instruction: Any additional context, design decisions, or implementation notes template: | **Implementation Notes:** - + - {{note_1}} - {{note_2}} - + **Design Decisions:** - + - {{decision_1}}: {{rationale}} - {{decision_2}}: {{rationale}} - + **Future Considerations:** - + - {{future_enhancement_1}} - {{future_optimization_1}} ==================== END: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== diff --git a/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt b/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt index cb03a56e..7ca15973 100644 --- a/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +++ b/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt @@ -420,7 +420,7 @@ dependencies: ==================== START: .bmad-2d-phaser-game-dev/tasks/facilitate-brainstorming-session.md ==================== --- docOutputLocation: docs/brainstorming-session-results.md -template: ".bmad-2d-phaser-game-dev/templates/brainstorming-output-tmpl.yaml" +template: '.bmad-2d-phaser-game-dev/templates/brainstorming-output-tmpl.yaml' --- # Facilitate Brainstorming Session Task @@ -1408,35 +1408,35 @@ template: output: format: markdown filename: docs/brief.md - title: "Project Brief: {{project_name}}" + title: 'Project Brief: {{project_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Project Brief Elicitation Actions" + title: 'Project Brief Elicitation Actions' options: - - "Expand section with more specific details" - - "Validate against similar successful products" - - "Stress test assumptions with edge cases" - - "Explore alternative solution approaches" - - "Analyze resource/constraint trade-offs" - - "Generate risk mitigation strategies" - - "Challenge scope from MVP minimalist view" - - "Brainstorm creative feature possibilities" - - "If only we had [resource/capability/time]..." - - "Proceed to next section" + - 'Expand section with more specific details' + - 'Validate against similar successful products' + - 'Stress test assumptions with edge cases' + - 'Explore alternative solution approaches' + - 'Analyze resource/constraint trade-offs' + - 'Generate risk mitigation strategies' + - 'Challenge scope from MVP minimalist view' + - 'Brainstorm creative feature possibilities' + - 'If only we had [resource/capability/time]...' + - 'Proceed to next section' sections: - id: introduction instruction: | This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - + Start by asking the user which mode they prefer: - + 1. **Interactive Mode** - Work through each section collaboratively 2. **YOLO Mode** - Generate complete draft for review and refinement - + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. - id: executive-summary @@ -1447,7 +1447,7 @@ sections: - Primary problem being solved - Target market identification - Key value proposition - template: "{{executive_summary_content}}" + template: '{{executive_summary_content}}' - id: problem-statement title: Problem Statement @@ -1457,7 +1457,7 @@ sections: - Impact of the problem (quantify if possible) - Why existing solutions fall short - Urgency and importance of solving this now - template: "{{detailed_problem_description}}" + template: '{{detailed_problem_description}}' - id: proposed-solution title: Proposed Solution @@ -1467,7 +1467,7 @@ sections: - Key differentiators from existing solutions - Why this solution will succeed where others haven't - High-level vision for the product - template: "{{solution_description}}" + template: '{{solution_description}}' - id: target-users title: Target Users @@ -1479,12 +1479,12 @@ sections: - Goals they're trying to achieve sections: - id: primary-segment - title: "Primary User Segment: {{segment_name}}" - template: "{{primary_user_description}}" + title: 'Primary User Segment: {{segment_name}}' + template: '{{primary_user_description}}' - id: secondary-segment - title: "Secondary User Segment: {{segment_name}}" + title: 'Secondary User Segment: {{segment_name}}' condition: Has secondary user segment - template: "{{secondary_user_description}}" + template: '{{secondary_user_description}}' - id: goals-metrics title: Goals & Success Metrics @@ -1493,15 +1493,15 @@ sections: - id: business-objectives title: Business Objectives type: bullet-list - template: "- {{objective_with_metric}}" + template: '- {{objective_with_metric}}' - id: user-success-metrics title: User Success Metrics type: bullet-list - template: "- {{user_metric}}" + template: '- {{user_metric}}' - id: kpis title: Key Performance Indicators (KPIs) type: bullet-list - template: "- {{kpi}}: {{definition_and_target}}" + template: '- {{kpi}}: {{definition_and_target}}' - id: mvp-scope title: MVP Scope @@ -1510,14 +1510,14 @@ sections: - id: core-features title: Core Features (Must Have) type: bullet-list - template: "- **{{feature}}:** {{description_and_rationale}}" + template: '- **{{feature}}:** {{description_and_rationale}}' - id: out-of-scope title: Out of Scope for MVP type: bullet-list - template: "- {{feature_or_capability}}" + template: '- {{feature_or_capability}}' - id: mvp-success-criteria title: MVP Success Criteria - template: "{{mvp_success_definition}}" + template: '{{mvp_success_definition}}' - id: post-mvp-vision title: Post-MVP Vision @@ -1525,13 +1525,13 @@ sections: sections: - id: phase-2-features title: Phase 2 Features - template: "{{next_priority_features}}" + template: '{{next_priority_features}}' - id: long-term-vision title: Long-term Vision - template: "{{one_two_year_vision}}" + template: '{{one_two_year_vision}}' - id: expansion-opportunities title: Expansion Opportunities - template: "{{potential_expansions}}" + template: '{{potential_expansions}}' - id: technical-considerations title: Technical Considerations @@ -1572,7 +1572,7 @@ sections: - id: key-assumptions title: Key Assumptions type: bullet-list - template: "- {{assumption}}" + template: '- {{assumption}}' - id: risks-questions title: Risks & Open Questions @@ -1581,15 +1581,15 @@ sections: - id: key-risks title: Key Risks type: bullet-list - template: "- **{{risk}}:** {{description_and_impact}}" + template: '- **{{risk}}:** {{description_and_impact}}' - id: open-questions title: Open Questions type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: research-areas title: Areas Needing Further Research type: bullet-list - template: "- {{research_topic}}" + template: '- {{research_topic}}' - id: appendices title: Appendices @@ -1606,10 +1606,10 @@ sections: - id: stakeholder-input title: B. Stakeholder Input condition: Has stakeholder feedback - template: "{{stakeholder_feedback}}" + template: '{{stakeholder_feedback}}' - id: references title: C. References - template: "{{relevant_links_and_docs}}" + template: '{{relevant_links_and_docs}}' - id: next-steps title: Next Steps @@ -1617,7 +1617,7 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action_item}}" + template: '{{action_item}}' - id: pm-handoff title: PM Handoff content: | @@ -1632,24 +1632,24 @@ template: output: format: markdown filename: docs/market-research.md - title: "Market Research Report: {{project_product_name}}" + title: 'Market Research Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Market Research Elicitation Actions" + title: 'Market Research Elicitation Actions' options: - - "Expand market sizing calculations with sensitivity analysis" - - "Deep dive into a specific customer segment" - - "Analyze an emerging market trend in detail" - - "Compare this market to an analogous market" - - "Stress test market assumptions" - - "Explore adjacent market opportunities" - - "Challenge market definition and boundaries" - - "Generate strategic scenarios (best/base/worst case)" - - "If only we had considered [X market factor]..." - - "Proceed to next section" + - 'Expand market sizing calculations with sensitivity analysis' + - 'Deep dive into a specific customer segment' + - 'Analyze an emerging market trend in detail' + - 'Compare this market to an analogous market' + - 'Stress test market assumptions' + - 'Explore adjacent market opportunities' + - 'Challenge market definition and boundaries' + - 'Generate strategic scenarios (best/base/worst case)' + - 'If only we had considered [X market factor]...' + - 'Proceed to next section' sections: - id: executive-summary @@ -1731,7 +1731,7 @@ sections: repeatable: true sections: - id: segment - title: "Segment {{segment_number}}: {{segment_name}}" + title: 'Segment {{segment_number}}: {{segment_name}}' template: | - **Description:** {{brief_overview}} - **Size:** {{number_of_customers_market_value}} @@ -1757,7 +1757,7 @@ sections: instruction: Map the end-to-end customer experience for primary segments template: | For primary customer segment: - + 1. **Awareness:** {{discovery_process}} 2. **Consideration:** {{evaluation_criteria}} 3. **Purchase:** {{decision_triggers}} @@ -1800,20 +1800,20 @@ sections: instruction: Analyze each force with specific evidence and implications sections: - id: supplier-power - title: "Supplier Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Supplier Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: buyer-power - title: "Buyer Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Buyer Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: competitive-rivalry - title: "Competitive Rivalry: {{intensity_level}}" - template: "{{analysis_and_implications}}" + title: 'Competitive Rivalry: {{intensity_level}}' + template: '{{analysis_and_implications}}' - id: threat-new-entry - title: "Threat of New Entry: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of New Entry: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: threat-substitutes - title: "Threat of Substitutes: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of Substitutes: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: adoption-lifecycle title: Technology Adoption Lifecycle Stage instruction: | @@ -1831,7 +1831,7 @@ sections: repeatable: true sections: - id: opportunity - title: "Opportunity {{opportunity_number}}: {{name}}" + title: 'Opportunity {{opportunity_number}}: {{name}}' template: | - **Description:** {{what_is_the_opportunity}} - **Size/Potential:** {{quantified_potential}} @@ -1887,24 +1887,24 @@ template: output: format: markdown filename: docs/competitor-analysis.md - title: "Competitive Analysis Report: {{project_product_name}}" + title: 'Competitive Analysis Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Competitive Analysis Elicitation Actions" + title: 'Competitive Analysis Elicitation Actions' options: - "Deep dive on a specific competitor's strategy" - - "Analyze competitive dynamics in a specific segment" - - "War game competitive responses to your moves" - - "Explore partnership vs. competition scenarios" - - "Stress test differentiation claims" - - "Analyze disruption potential (yours or theirs)" - - "Compare to competition in adjacent markets" - - "Generate win/loss analysis insights" + - 'Analyze competitive dynamics in a specific segment' + - 'War game competitive responses to your moves' + - 'Explore partnership vs. competition scenarios' + - 'Stress test differentiation claims' + - 'Analyze disruption potential (yours or theirs)' + - 'Compare to competition in adjacent markets' + - 'Generate win/loss analysis insights' - "If only we had known about [competitor X's plan]..." - - "Proceed to next section" + - 'Proceed to next section' sections: - id: executive-summary @@ -1958,7 +1958,7 @@ sections: title: Competitor Prioritization Matrix instruction: | Help categorize competitors by market share and strategic threat level - + Create a 2x2 matrix: - Priority 1 (Core Competitors): High Market Share + High Threat - Priority 2 (Emerging Threats): Low Market Share + High Threat @@ -1971,7 +1971,7 @@ sections: repeatable: true sections: - id: competitor - title: "{{competitor_name}} - Priority {{priority_level}}" + title: '{{competitor_name}} - Priority {{priority_level}}' sections: - id: company-overview title: Company Overview @@ -2003,11 +2003,11 @@ sections: - id: strengths title: Strengths type: bullet-list - template: "- {{strength}}" + template: '- {{strength}}' - id: weaknesses title: Weaknesses type: bullet-list - template: "- {{weakness}}" + template: '- {{weakness}}' - id: market-position title: Market Position & Performance template: | @@ -2023,24 +2023,37 @@ sections: title: Feature Comparison Matrix instruction: Create a detailed comparison table of key features across competitors type: table - columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + columns: + [ + 'Feature Category', + '{{your_company}}', + '{{competitor_1}}', + '{{competitor_2}}', + '{{competitor_3}}', + ] rows: - - category: "Core Functionality" + - category: 'Core Functionality' items: - - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - category: "User Experience" + - ['Feature A', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - ['Feature B', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - category: 'User Experience' items: - - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] - - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] - - category: "Integration & Ecosystem" + - ['Mobile App', '{{rating}}', '{{rating}}', '{{rating}}', '{{rating}}'] + - ['Onboarding Time', '{{time}}', '{{time}}', '{{time}}', '{{time}}'] + - category: 'Integration & Ecosystem' items: - - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] - - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] - - category: "Pricing & Plans" + - [ + 'API Availability', + '{{availability}}', + '{{availability}}', + '{{availability}}', + '{{availability}}', + ] + - ['Third-party Integrations', '{{number}}', '{{number}}', '{{number}}', '{{number}}'] + - category: 'Pricing & Plans' items: - - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] - - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - ['Starting Price', '{{price}}', '{{price}}', '{{price}}', '{{price}}'] + - ['Free Tier', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}'] - id: swot-comparison title: SWOT Comparison instruction: Create SWOT analysis for your solution vs. top competitors @@ -2053,7 +2066,7 @@ sections: - **Opportunities:** {{opportunities}} - **Threats:** {{threats}} - id: vs-competitor - title: "vs. {{main_competitor}}" + title: 'vs. {{main_competitor}}' template: | - **Competitive Advantages:** {{your_advantages}} - **Competitive Disadvantages:** {{their_advantages}} @@ -2062,7 +2075,7 @@ sections: title: Positioning Map instruction: | Describe competitor positions on key dimensions - + Create a positioning description using 2 key dimensions relevant to the market, such as: - Price vs. Features - Ease of Use vs. Power @@ -2097,7 +2110,7 @@ sections: title: Blue Ocean Opportunities instruction: | Identify uncontested market spaces - + List opportunities to create new market space: - Underserved segments - Unaddressed use cases @@ -2183,7 +2196,7 @@ template: output: format: markdown filename: docs/brainstorming-session-results.md - title: "Brainstorming Session Results" + title: 'Brainstorming Session Results' workflow: mode: non-interactive @@ -2201,45 +2214,45 @@ sections: - id: summary-details template: | **Topic:** {{session_topic}} - + **Session Goals:** {{stated_goals}} - + **Techniques Used:** {{techniques_list}} - + **Total Ideas Generated:** {{total_ideas}} - id: key-themes - title: "Key Themes Identified:" + title: 'Key Themes Identified:' type: bullet-list - template: "- {{theme}}" + template: '- {{theme}}' - id: technique-sessions title: Technique Sessions repeatable: true sections: - id: technique - title: "{{technique_name}} - {{duration}}" + title: '{{technique_name}} - {{duration}}' sections: - id: description - template: "**Description:** {{technique_description}}" + template: '**Description:** {{technique_description}}' - id: ideas-generated - title: "Ideas Generated:" + title: 'Ideas Generated:' type: numbered-list - template: "{{idea}}" + template: '{{idea}}' - id: insights - title: "Insights Discovered:" + title: 'Insights Discovered:' type: bullet-list - template: "- {{insight}}" + template: '- {{insight}}' - id: connections - title: "Notable Connections:" + title: 'Notable Connections:' type: bullet-list - template: "- {{connection}}" + template: '- {{connection}}' - id: idea-categorization title: Idea Categorization sections: - id: immediate-opportunities title: Immediate Opportunities - content: "*Ideas ready to implement now*" + content: '*Ideas ready to implement now*' repeatable: true type: numbered-list template: | @@ -2249,7 +2262,7 @@ sections: - Resources needed: {{requirements}} - id: future-innovations title: Future Innovations - content: "*Ideas requiring development/research*" + content: '*Ideas requiring development/research*' repeatable: true type: numbered-list template: | @@ -2259,7 +2272,7 @@ sections: - Timeline estimate: {{timeline}} - id: moonshots title: Moonshots - content: "*Ambitious, transformative concepts*" + content: '*Ambitious, transformative concepts*' repeatable: true type: numbered-list template: | @@ -2269,9 +2282,9 @@ sections: - Challenges to overcome: {{challenges}} - id: insights-learnings title: Insights & Learnings - content: "*Key realizations from the session*" + content: '*Key realizations from the session*' type: bullet-list - template: "- {{insight}}: {{description_and_implications}}" + template: '- {{insight}}: {{description_and_implications}}' - id: action-planning title: Action Planning @@ -2280,21 +2293,21 @@ sections: title: Top 3 Priority Ideas sections: - id: priority-1 - title: "#1 Priority: {{idea_name}}" + title: '#1 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-2 - title: "#2 Priority: {{idea_name}}" + title: '#2 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-3 - title: "#3 Priority: {{idea_name}}" + title: '#3 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} @@ -2307,19 +2320,19 @@ sections: - id: what-worked title: What Worked Well type: bullet-list - template: "- {{aspect}}" + template: '- {{aspect}}' - id: areas-exploration title: Areas for Further Exploration type: bullet-list - template: "- {{area}}: {{reason}}" + template: '- {{area}}: {{reason}}' - id: recommended-techniques title: Recommended Follow-up Techniques type: bullet-list - template: "- {{technique}}: {{reason}}" + template: '- {{technique}}: {{reason}}' - id: questions-emerged title: Questions That Emerged type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: next-session title: Next Session Planning template: | @@ -2330,7 +2343,7 @@ sections: - id: footer content: | --- - + *Session facilitated using the BMAD-METHOD brainstorming framework* ==================== END: .bmad-2d-phaser-game-dev/templates/brainstorming-output-tmpl.yaml ==================== @@ -3322,8 +3335,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-game-design-document.md" - title: "{{game_title}} Game Design Document (GDD)" + filename: 'docs/{{game_name}}-game-design-document.md' + title: '{{game_title}} Game Design Document (GDD)' workflow: mode: interactive @@ -3332,7 +3345,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive Game Design Document that will serve as the foundation for all game development work. The GDD should be detailed enough that developers can create user stories and epics from it. Focus on gameplay systems, mechanics, and technical requirements that can be broken down into implementable features. - + If available, review any provided documents or ask if any are optionally available: Project Brief, Market Research, Competitive Analysis - id: executive-summary @@ -3360,7 +3373,7 @@ sections: title: Unique Selling Points instruction: List 3-5 key features that differentiate this game from competitors type: numbered-list - template: "{{usp}}" + template: '{{usp}}' - id: core-gameplay title: Core Gameplay @@ -3377,7 +3390,7 @@ sections: instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions. template: | **Primary Loop ({{duration}} seconds):** - + 1. {{action_1}} ({{time_1}}s) 2. {{action_2}} ({{time_2}}s) 3. {{action_3}} ({{time_3}}s) @@ -3387,12 +3400,12 @@ sections: instruction: Clearly define success and failure states template: | **Victory Conditions:** - + - {{win_condition_1}} - {{win_condition_2}} - + **Failure States:** - + - {{loss_condition_1}} - {{loss_condition_2}} @@ -3405,20 +3418,20 @@ sections: repeatable: true sections: - id: mechanic - title: "{{mechanic_name}}" + title: '{{mechanic_name}}' template: | **Description:** {{detailed_description}} - + **Player Input:** {{input_method}} - + **System Response:** {{game_response}} - + **Implementation Notes:** - + - {{tech_requirement_1}} - {{tech_requirement_2}} - {{performance_consideration}} - + **Dependencies:** {{other_mechanics_needed}} - id: controls title: Controls @@ -3437,9 +3450,9 @@ sections: title: Player Progression template: | **Progression Type:** {{linear|branching|metroidvania}} - + **Key Milestones:** - + 1. **{{milestone_1}}** - {{unlock_description}} 2. **{{milestone_2}}** - {{unlock_description}} 3. **{{milestone_3}}** - {{unlock_description}} @@ -3470,15 +3483,15 @@ sections: repeatable: true sections: - id: level-type - title: "{{level_type_name}}" + title: '{{level_type_name}}' template: | **Purpose:** {{gameplay_purpose}} **Duration:** {{target_time}} **Key Elements:** {{required_mechanics}} **Difficulty:** {{relative_difficulty}} - + **Structure Template:** - + - Introduction: {{intro_description}} - Challenge: {{main_challenge}} - Resolution: {{completion_requirement}} @@ -3504,13 +3517,13 @@ sections: title: Platform Specific template: | **Desktop:** - + - Resolution: {{min_resolution}} - {{max_resolution}} - Input: Keyboard, Mouse, Gamepad - Browser: Chrome 80+, Firefox 75+, Safari 13+ - + **Mobile:** - + - Resolution: {{mobile_min}} - {{mobile_max}} - Input: Touch, Tilt (optional) - OS: iOS 13+, Android 8+ @@ -3519,14 +3532,14 @@ sections: instruction: Define asset specifications for the art and audio teams template: | **Visual Assets:** - + - Art Style: {{style_description}} - Color Palette: {{color_specification}} - Animation: {{animation_requirements}} - UI Resolution: {{ui_specs}} - + **Audio Assets:** - + - Music Style: {{music_genre}} - Sound Effects: {{sfx_requirements}} - Voice Acting: {{voice_needs}} @@ -3539,7 +3552,7 @@ sections: title: Engine Configuration template: | **Phaser 3 Setup:** - + - TypeScript: Strict mode enabled - Physics: {{physics_system}} (Arcade/Matter) - Renderer: WebGL with Canvas fallback @@ -3548,7 +3561,7 @@ sections: title: Code Architecture template: | **Required Systems:** - + - Scene Management - State Management - Asset Loading @@ -3560,7 +3573,7 @@ sections: title: Data Management template: | **Save Data:** - + - Progress tracking - Settings persistence - Statistics collection @@ -3571,10 +3584,10 @@ sections: instruction: Break down the development into phases that can be converted to epics sections: - id: phase-1-core-systems - title: "Phase 1: Core Systems ({{duration}})" + title: 'Phase 1: Core Systems ({{duration}})' sections: - id: foundation-epic - title: "Epic: Foundation" + title: 'Epic: Foundation' type: bullet-list template: | - Engine setup and configuration @@ -3582,41 +3595,41 @@ sections: - Core input handling - Asset loading pipeline - id: core-mechanics-epic - title: "Epic: Core Mechanics" + title: 'Epic: Core Mechanics' type: bullet-list template: | - {{primary_mechanic}} implementation - Basic physics and collision - Player controller - id: phase-2-gameplay-features - title: "Phase 2: Gameplay Features ({{duration}})" + title: 'Phase 2: Gameplay Features ({{duration}})' sections: - id: game-systems-epic - title: "Epic: Game Systems" + title: 'Epic: Game Systems' type: bullet-list template: | - {{mechanic_2}} implementation - {{mechanic_3}} implementation - Game state management - id: content-creation-epic - title: "Epic: Content Creation" + title: 'Epic: Content Creation' type: bullet-list template: | - Level loading system - First playable levels - Basic UI implementation - id: phase-3-polish-optimization - title: "Phase 3: Polish & Optimization ({{duration}})" + title: 'Phase 3: Polish & Optimization ({{duration}})' sections: - id: performance-epic - title: "Epic: Performance" + title: 'Epic: Performance' type: bullet-list template: | - Optimization and profiling - Mobile platform testing - Memory management - id: user-experience-epic - title: "Epic: User Experience" + title: 'Epic: User Experience' type: bullet-list template: | - Audio implementation @@ -3658,7 +3671,7 @@ sections: title: References instruction: List any competitive analysis, inspiration, or research sources type: bullet-list - template: "{{reference}}" + template: '{{reference}}' ==================== END: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml ==================== @@ -3668,8 +3681,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-level-design-document.md" - title: "{{game_title}} Level Design Document" + filename: 'docs/{{game_name}}-level-design-document.md' + title: '{{game_title}} Level Design Document' workflow: mode: interactive @@ -3678,7 +3691,7 @@ sections: - id: initial-setup instruction: | This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. - id: introduction @@ -3686,7 +3699,7 @@ sections: instruction: Establish the purpose and scope of level design for this game content: | This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. sections: - id: change-log @@ -3730,32 +3743,32 @@ sections: repeatable: true sections: - id: level-category - title: "{{category_name}} Levels" + title: '{{category_name}} Levels' template: | **Purpose:** {{gameplay_purpose}} - + **Target Duration:** {{min_time}} - {{max_time}} minutes - + **Difficulty Range:** {{difficulty_scale}} - + **Key Mechanics Featured:** - + - {{mechanic_1}} - {{usage_description}} - {{mechanic_2}} - {{usage_description}} - + **Player Objectives:** - + - Primary: {{primary_objective}} - Secondary: {{secondary_objective}} - Hidden: {{secret_objective}} - + **Success Criteria:** - + - {{completion_requirement_1}} - {{completion_requirement_2}} - + **Technical Requirements:** - + - Maximum entities: {{entity_limit}} - Performance target: {{fps_target}} FPS - Memory budget: {{memory_limit}}MB @@ -3770,11 +3783,11 @@ sections: instruction: Based on GDD requirements, define the overall level organization template: | **Organization Type:** {{linear|hub_world|open_world}} - + **Total Level Count:** {{number}} - + **World Breakdown:** - + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} @@ -3809,7 +3822,7 @@ sections: instruction: Define how players access new levels template: | **Progression Gates:** - + - Linear progression: Complete previous level - Star requirements: {{star_count}} stars to unlock - Skill gates: Demonstrate {{skill_requirement}} @@ -3824,17 +3837,17 @@ sections: instruction: Define all environmental components that can be used in levels template: | **Terrain Types:** - + - {{terrain_1}}: {{properties_and_usage}} - {{terrain_2}}: {{properties_and_usage}} - + **Interactive Objects:** - + - {{object_1}}: {{behavior_and_purpose}} - {{object_2}}: {{behavior_and_purpose}} - + **Hazards and Obstacles:** - + - {{hazard_1}}: {{damage_and_behavior}} - {{hazard_2}}: {{damage_and_behavior}} - id: collectibles-rewards @@ -3842,18 +3855,18 @@ sections: instruction: Define all collectible items and their placement rules template: | **Collectible Types:** - + - {{collectible_1}}: {{value_and_purpose}} - {{collectible_2}}: {{value_and_purpose}} - + **Placement Guidelines:** - + - Mandatory collectibles: {{placement_rules}} - Optional collectibles: {{placement_rules}} - Secret collectibles: {{placement_rules}} - + **Reward Distribution:** - + - Easy to find: {{percentage}}% - Moderate challenge: {{percentage}}% - High skill required: {{percentage}}% @@ -3862,18 +3875,18 @@ sections: instruction: Define how enemies should be placed and balanced in levels template: | **Enemy Categories:** - + - {{enemy_type_1}}: {{behavior_and_usage}} - {{enemy_type_2}}: {{behavior_and_usage}} - + **Placement Principles:** - + - Introduction encounters: {{guideline}} - Standard encounters: {{guideline}} - Challenge encounters: {{guideline}} - + **Difficulty Scaling:** - + - Enemy count progression: {{scaling_rule}} - Enemy type introduction: {{pacing_rule}} - Encounter complexity: {{complexity_rule}} @@ -3886,14 +3899,14 @@ sections: title: Level Layout Principles template: | **Spatial Design:** - + - Grid size: {{grid_dimensions}} - Minimum path width: {{width_units}} - Maximum vertical distance: {{height_units}} - Safe zones placement: {{safety_guidelines}} - + **Navigation Design:** - + - Clear path indication: {{visual_cues}} - Landmark placement: {{landmark_rules}} - Dead end avoidance: {{dead_end_policy}} @@ -3903,13 +3916,13 @@ sections: instruction: Define how to control the rhythm and pace of gameplay within levels template: | **Action Sequences:** - + - High intensity duration: {{max_duration}} - Rest period requirement: {{min_rest_time}} - Intensity variation: {{pacing_pattern}} - + **Learning Sequences:** - + - New mechanic introduction: {{teaching_method}} - Practice opportunity: {{practice_duration}} - Skill application: {{application_context}} @@ -3918,14 +3931,14 @@ sections: instruction: Define how to create appropriate challenges for each level type template: | **Challenge Types:** - + - Execution challenges: {{skill_requirements}} - Puzzle challenges: {{complexity_guidelines}} - Time challenges: {{time_pressure_rules}} - Resource challenges: {{resource_management}} - + **Difficulty Calibration:** - + - Skill check frequency: {{frequency_guidelines}} - Failure recovery: {{retry_mechanics}} - Hint system integration: {{help_system}} @@ -3939,7 +3952,7 @@ sections: instruction: Define how level data should be structured for implementation template: | **Level File Format:** - + - Data format: {{json|yaml|custom}} - File naming: `level_{{world}}_{{number}}.{{extension}}` - Data organization: {{structure_description}} @@ -3977,14 +3990,14 @@ sections: instruction: Define how level assets are organized and loaded template: | **Tilemap Requirements:** - + - Tile size: {{tile_dimensions}}px - Tileset organization: {{tileset_structure}} - Layer organization: {{layer_system}} - Collision data: {{collision_format}} - + **Audio Integration:** - + - Background music: {{music_requirements}} - Ambient sounds: {{ambient_system}} - Dynamic audio: {{dynamic_audio_rules}} @@ -3993,19 +4006,19 @@ sections: instruction: Define performance requirements for level systems template: | **Entity Limits:** - + - Maximum active entities: {{entity_limit}} - Maximum particles: {{particle_limit}} - Maximum audio sources: {{audio_limit}} - + **Memory Management:** - + - Texture memory budget: {{texture_memory}}MB - Audio memory budget: {{audio_memory}}MB - Level loading time: <{{load_time}}s - + **Culling and LOD:** - + - Off-screen culling: {{culling_distance}} - Level-of-detail rules: {{lod_system}} - Asset streaming: {{streaming_requirements}} @@ -4018,13 +4031,13 @@ sections: title: Automated Testing template: | **Performance Testing:** - + - Frame rate validation: Maintain {{fps_target}} FPS - Memory usage monitoring: Stay under {{memory_limit}}MB - Loading time verification: Complete in <{{load_time}}s - + **Gameplay Testing:** - + - Completion path validation: All objectives achievable - Collectible accessibility: All items reachable - Softlock prevention: No unwinnable states @@ -4035,31 +4048,31 @@ sections: title: Playtesting Checklist type: checklist items: - - "Level completes within target time range" - - "All mechanics function correctly" - - "Difficulty feels appropriate for level category" - - "Player guidance is clear and effective" - - "No exploits or sequence breaks (unless intended)" + - 'Level completes within target time range' + - 'All mechanics function correctly' + - 'Difficulty feels appropriate for level category' + - 'Player guidance is clear and effective' + - 'No exploits or sequence breaks (unless intended)' - id: player-experience-testing title: Player Experience Testing type: checklist items: - - "Tutorial levels teach effectively" - - "Challenge feels fair and rewarding" - - "Flow and pacing maintain engagement" - - "Audio and visual feedback support gameplay" + - 'Tutorial levels teach effectively' + - 'Challenge feels fair and rewarding' + - 'Flow and pacing maintain engagement' + - 'Audio and visual feedback support gameplay' - id: balance-validation title: Balance Validation template: | **Metrics Collection:** - + - Completion rate: Target {{completion_percentage}}% - Average completion time: {{target_time}} ± {{variance}} - Death count per level: <{{max_deaths}} - Collectible discovery rate: {{discovery_percentage}}% - + **Iteration Guidelines:** - + - Adjustment criteria: {{criteria_for_changes}} - Testing sample size: {{minimum_testers}} - Validation period: {{testing_duration}} @@ -4072,14 +4085,14 @@ sections: title: Design Phase template: | **Concept Development:** - + 1. Define level purpose and goals 2. Create rough layout sketch 3. Identify key mechanics and challenges 4. Estimate difficulty and duration - + **Documentation Requirements:** - + - Level design brief - Layout diagrams - Mechanic integration notes @@ -4088,15 +4101,15 @@ sections: title: Implementation Phase template: | **Technical Implementation:** - + 1. Create level data file 2. Build tilemap and layout 3. Place entities and objects 4. Configure level logic and triggers 5. Integrate audio and visual effects - + **Quality Assurance:** - + 1. Automated testing execution 2. Internal playtesting 3. Performance validation @@ -4105,14 +4118,14 @@ sections: title: Integration Phase template: | **Game Integration:** - + 1. Level progression integration 2. Save system compatibility 3. Analytics integration 4. Achievement system integration - + **Final Validation:** - + 1. Full game context testing 2. Performance regression testing 3. Platform compatibility verification @@ -4155,8 +4168,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-game-brief.md" - title: "{{game_title}} Game Brief" + filename: 'docs/{{game_name}}-game-brief.md' + title: '{{game_title}} Game Brief' workflow: mode: interactive @@ -4165,7 +4178,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. - id: game-vision @@ -4222,7 +4235,7 @@ sections: repeatable: true template: | **Core Mechanic: {{mechanic_name}}** - + - **Description:** {{how_it_works}} - **Player Value:** {{why_its_fun}} - **Implementation Scope:** {{complexity_estimate}} @@ -4249,12 +4262,12 @@ sections: title: Technical Constraints template: | **Platform Requirements:** - + - Primary: {{platform_1}} - {{requirements}} - Secondary: {{platform_2}} - {{requirements}} - + **Technical Specifications:** - + - Engine: Phaser 3 + TypeScript - Performance Target: {{fps_target}} FPS on {{target_device}} - Memory Budget: <{{memory_limit}}MB @@ -4292,10 +4305,10 @@ sections: title: Competitive Analysis template: | **Direct Competitors:** - + - {{competitor_1}}: {{strengths_and_weaknesses}} - {{competitor_2}}: {{strengths_and_weaknesses}} - + **Differentiation Strategy:** {{how_we_differ_and_why_thats_valuable}} - id: market-opportunity @@ -4319,16 +4332,16 @@ sections: title: Content Categories template: | **Core Content:** - + - {{content_type_1}}: {{quantity_and_description}} - {{content_type_2}}: {{quantity_and_description}} - + **Optional Content:** - + - {{optional_content_type}}: {{quantity_and_description}} - + **Replay Elements:** - + - {{replayability_features}} - id: difficulty-accessibility title: Difficulty and Accessibility @@ -4395,13 +4408,13 @@ sections: title: Player Experience Metrics template: | **Engagement Goals:** - + - Tutorial completion rate: >{{percentage}}% - Average session length: {{duration}} minutes - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - + **Quality Benchmarks:** - + - Player satisfaction: >{{rating}}/10 - Completion rate: >{{percentage}}% - Technical performance: {{fps_target}} FPS consistent @@ -4409,13 +4422,13 @@ sections: title: Development Metrics template: | **Technical Targets:** - + - Zero critical bugs at launch - Performance targets met on all platforms - Load times under {{seconds}}s - + **Process Goals:** - + - Development timeline adherence - Feature scope completion - Quality assurance standards @@ -4424,7 +4437,7 @@ sections: condition: has_business_goals template: | **Commercial Goals:** - + - {{revenue_target}} in first {{time_period}} - {{user_acquisition_target}} players in first {{time_period}} - {{retention_target}} monthly active users @@ -4442,21 +4455,21 @@ sections: title: Development Roadmap sections: - id: phase-1-preproduction - title: "Phase 1: Pre-Production ({{duration}})" + title: 'Phase 1: Pre-Production ({{duration}})' type: bullet-list template: | - Detailed Game Design Document creation - Technical architecture planning - Art style exploration and pipeline setup - id: phase-2-prototype - title: "Phase 2: Prototype ({{duration}})" + title: 'Phase 2: Prototype ({{duration}})' type: bullet-list template: | - Core mechanic implementation - Technical proof of concept - Initial playtesting and iteration - id: phase-3-production - title: "Phase 3: Production ({{duration}})" + title: 'Phase 3: Production ({{duration}})' type: bullet-list template: | - Full feature development @@ -4477,12 +4490,12 @@ sections: title: Validation Plan template: | **Concept Testing:** - + - {{validation_method_1}} - {{timeline}} - {{validation_method_2}} - {{timeline}} - + **Prototype Testing:** - + - {{testing_approach}} - {{timeline}} - {{feedback_collection_method}} - {{timeline}} @@ -4718,8 +4731,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-game-architecture.md" - title: "{{game_title}} Game Architecture Document" + filename: 'docs/{{game_name}}-game-architecture.md' + title: '{{game_title}} Game Architecture Document' workflow: mode: interactive @@ -4728,7 +4741,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics. - + If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD. - id: introduction @@ -4736,7 +4749,7 @@ sections: instruction: Establish the document's purpose and scope for game development content: | This document outlines the complete technical architecture for {{game_title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems. - + This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility. sections: - id: change-log @@ -4755,7 +4768,7 @@ sections: title: Architecture Summary instruction: | Provide a comprehensive overview covering: - + - Game engine choice and configuration - Project structure and organization - Key systems and their interactions @@ -4843,23 +4856,23 @@ sections: title: Scene Management System template: | **Purpose:** Handle game flow and scene transitions - + **Key Components:** - + - Scene loading and unloading - Data passing between scenes - Transition effects - Memory management - + **Implementation Requirements:** - + - Preload scene for asset loading - Menu system with navigation - Gameplay scenes with state management - Pause/resume functionality - + **Files to Create:** - + - `src/scenes/BootScene.ts` - `src/scenes/PreloadScene.ts` - `src/scenes/MenuScene.ts` @@ -4869,23 +4882,23 @@ sections: title: Game State Management template: | **Purpose:** Track player progress and game status - + **State Categories:** - + - Player progress (levels, unlocks) - Game settings (audio, controls) - Session data (current level, score) - Persistent data (achievements, statistics) - + **Implementation Requirements:** - + - Save/load system with localStorage - State validation and error recovery - Cross-session data persistence - Settings management - + **Files to Create:** - + - `src/systems/GameState.ts` - `src/systems/SaveManager.ts` - `src/types/GameData.ts` @@ -4893,23 +4906,23 @@ sections: title: Asset Management System template: | **Purpose:** Efficient loading and management of game assets - + **Asset Categories:** - + - Sprite sheets and animations - Audio files and music - Level data and configurations - UI assets and fonts - + **Implementation Requirements:** - + - Progressive loading strategy - Asset caching and optimization - Error handling for failed loads - Memory management for large assets - + **Files to Create:** - + - `src/systems/AssetManager.ts` - `src/config/AssetConfig.ts` - `src/utils/AssetLoader.ts` @@ -4917,23 +4930,23 @@ sections: title: Input Management System template: | **Purpose:** Handle all player input across platforms - + **Input Types:** - + - Keyboard controls - Mouse/pointer interaction - Touch gestures (mobile) - Gamepad support (optional) - + **Implementation Requirements:** - + - Input mapping and configuration - Touch-friendly mobile controls - Input buffering for responsive gameplay - Customizable control schemes - + **Files to Create:** - + - `src/systems/InputManager.ts` - `src/utils/TouchControls.ts` - `src/types/InputTypes.ts` @@ -4943,22 +4956,22 @@ sections: repeatable: true sections: - id: mechanic-system - title: "{{mechanic_name}} System" + title: '{{mechanic_name}} System' template: | **Purpose:** {{system_purpose}} - + **Core Functionality:** - + - {{feature_1}} - {{feature_2}} - {{feature_3}} - + **Dependencies:** {{required_systems}} - + **Performance Considerations:** {{optimization_notes}} - + **Files to Create:** - + - `src/systems/{{system_name}}.ts` - `src/gameObjects/{{related_object}}.ts` - `src/types/{{system_types}}.ts` @@ -4966,65 +4979,65 @@ sections: title: Physics & Collision System template: | **Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js) - + **Collision Categories:** - + - Player collision - Enemy interactions - Environmental objects - Collectibles and items - + **Implementation Requirements:** - + - Optimized collision detection - Physics body management - Collision callbacks and events - Performance monitoring - + **Files to Create:** - + - `src/systems/PhysicsManager.ts` - `src/utils/CollisionGroups.ts` - id: audio-system title: Audio System template: | **Audio Requirements:** - + - Background music with looping - Sound effects for actions - Audio settings and volume control - Mobile audio optimization - + **Implementation Features:** - + - Audio sprite management - Dynamic music system - Spatial audio (if applicable) - Audio pooling for performance - + **Files to Create:** - + - `src/systems/AudioManager.ts` - `src/config/AudioConfig.ts` - id: ui-system title: UI System template: | **UI Components:** - + - HUD elements (score, health, etc.) - Menu navigation - Modal dialogs - Settings screens - + **Implementation Requirements:** - + - Responsive layout system - Touch-friendly interface - Keyboard navigation support - Animation and transitions - + **Files to Create:** - + - `src/systems/UIManager.ts` - `src/gameObjects/UI/` - `src/types/UITypes.ts` @@ -5240,7 +5253,7 @@ sections: instruction: Break down the architecture implementation into phases that align with the GDD development phases sections: - id: phase-1-foundation - title: "Phase 1: Foundation ({{duration}})" + title: 'Phase 1: Foundation ({{duration}})' sections: - id: phase-1-core title: Core Systems @@ -5258,7 +5271,7 @@ sections: - "Basic Scene Management System" - "Asset Loading Foundation" - id: phase-2-game-systems - title: "Phase 2: Game Systems ({{duration}})" + title: 'Phase 2: Game Systems ({{duration}})' sections: - id: phase-2-gameplay title: Gameplay Systems @@ -5276,7 +5289,7 @@ sections: - "Physics and Collision Framework" - "Game State Management System" - id: phase-3-content-polish - title: "Phase 3: Content & Polish ({{duration}})" + title: 'Phase 3: Content & Polish ({{duration}})' sections: - id: phase-3-content title: Content Systems @@ -5566,7 +5579,7 @@ interface GameState { interface GameSettings { musicVolume: number; sfxVolume: number; - difficulty: "easy" | "normal" | "hard"; + difficulty: 'easy' | 'normal' | 'hard'; controls: ControlScheme; } ``` @@ -5607,12 +5620,12 @@ class GameScene extends Phaser.Scene { private inputManager!: InputManager; constructor() { - super({ key: "GameScene" }); + super({ key: 'GameScene' }); } preload(): void { // Load only scene-specific assets - this.load.image("player", "assets/player.png"); + this.load.image('player', 'assets/player.png'); } create(data: SceneData): void { @@ -5637,7 +5650,7 @@ class GameScene extends Phaser.Scene { this.inputManager.destroy(); // Remove event listeners - this.events.off("*"); + this.events.off('*'); } } ``` @@ -5646,13 +5659,13 @@ class GameScene extends Phaser.Scene { ```typescript // Proper scene transitions with data -this.scene.start("NextScene", { +this.scene.start('NextScene', { playerScore: this.playerScore, currentLevel: this.currentLevel + 1, }); // Scene overlays for UI -this.scene.launch("PauseMenuScene"); +this.scene.launch('PauseMenuScene'); this.scene.pause(); ``` @@ -5696,7 +5709,7 @@ class Player extends GameEntity { private health!: HealthComponent; constructor(scene: Phaser.Scene, x: number, y: number) { - super(scene, x, y, "player"); + super(scene, x, y, 'player'); this.movement = this.addComponent(new MovementComponent(this)); this.health = this.addComponent(new HealthComponent(this, 100)); @@ -5716,7 +5729,7 @@ class GameManager { constructor(scene: Phaser.Scene) { if (GameManager.instance) { - throw new Error("GameManager already exists!"); + throw new Error('GameManager already exists!'); } this.scene = scene; @@ -5726,7 +5739,7 @@ class GameManager { static getInstance(): GameManager { if (!GameManager.instance) { - throw new Error("GameManager not initialized!"); + throw new Error('GameManager not initialized!'); } return GameManager.instance; } @@ -5773,7 +5786,7 @@ class BulletPool { } // Pool exhausted - create new bullet - console.warn("Bullet pool exhausted, creating new bullet"); + console.warn('Bullet pool exhausted, creating new bullet'); return new Bullet(this.scene, 0, 0); } @@ -5873,14 +5886,12 @@ class InputManager { } private setupKeyboard(): void { - this.keys = this.scene.input.keyboard.addKeys( - "W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT", - ); + this.keys = this.scene.input.keyboard.addKeys('W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT'); } private setupTouch(): void { - this.scene.input.on("pointerdown", this.handlePointerDown, this); - this.scene.input.on("pointerup", this.handlePointerUp, this); + this.scene.input.on('pointerdown', this.handlePointerDown, this); + this.scene.input.on('pointerup', this.handlePointerUp, this); } update(): void { @@ -5907,9 +5918,9 @@ class InputManager { class AssetManager { loadAssets(): Promise { return new Promise((resolve, reject) => { - this.scene.load.on("filecomplete", this.handleFileComplete, this); - this.scene.load.on("loaderror", this.handleLoadError, this); - this.scene.load.on("complete", () => resolve()); + this.scene.load.on('filecomplete', this.handleFileComplete, this); + this.scene.load.on('loaderror', this.handleLoadError, this); + this.scene.load.on('complete', () => resolve()); this.scene.load.start(); }); @@ -5925,8 +5936,8 @@ class AssetManager { private loadFallbackAsset(key: string): void { // Load placeholder or default assets switch (key) { - case "player": - this.scene.load.image("player", "assets/defaults/default-player.png"); + case 'player': + this.scene.load.image('player', 'assets/defaults/default-player.png'); break; default: console.warn(`No fallback for asset: ${key}`); @@ -5953,11 +5964,11 @@ class GameSystem { private attemptRecovery(context: string): void { switch (context) { - case "update": + case 'update': // Reset system state this.reset(); break; - case "render": + case 'render': // Disable visual effects this.disableEffects(); break; @@ -5977,7 +5988,7 @@ class GameSystem { ```typescript // Example test for game mechanics -describe("HealthComponent", () => { +describe('HealthComponent', () => { let healthComponent: HealthComponent; beforeEach(() => { @@ -5985,18 +5996,18 @@ describe("HealthComponent", () => { healthComponent = new HealthComponent(mockEntity, 100); }); - test("should initialize with correct health", () => { + test('should initialize with correct health', () => { expect(healthComponent.currentHealth).toBe(100); expect(healthComponent.maxHealth).toBe(100); }); - test("should handle damage correctly", () => { + test('should handle damage correctly', () => { healthComponent.takeDamage(25); expect(healthComponent.currentHealth).toBe(75); expect(healthComponent.isAlive()).toBe(true); }); - test("should handle death correctly", () => { + test('should handle death correctly', () => { healthComponent.takeDamage(150); expect(healthComponent.currentHealth).toBe(0); expect(healthComponent.isAlive()).toBe(false); @@ -6009,7 +6020,7 @@ describe("HealthComponent", () => { **Scene Testing:** ```typescript -describe("GameScene Integration", () => { +describe('GameScene Integration', () => { let scene: GameScene; let mockGame: Phaser.Game; @@ -6019,7 +6030,7 @@ describe("GameScene Integration", () => { scene = new GameScene(); }); - test("should initialize all systems", () => { + test('should initialize all systems', () => { scene.create({}); expect(scene.gameManager).toBeDefined(); @@ -6368,8 +6379,8 @@ template: version: 2.0 output: format: markdown - filename: "stories/{{epic_name}}/{{story_id}}-{{story_name}}.md" - title: "Story: {{story_title}}" + filename: 'stories/{{epic_name}}/{{story_id}}-{{story_name}}.md' + title: 'Story: {{story_title}}' workflow: mode: interactive @@ -6378,13 +6389,13 @@ sections: - id: initial-setup instruction: | This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. - + Before starting, ensure you have access to: - + - Game Design Document (GDD) - Game Architecture Document - Any existing stories in this epic - + The story should be specific enough that a developer can implement it without requiring additional design decisions. - id: story-header @@ -6398,7 +6409,7 @@ sections: - id: description title: Description instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature. - template: "{{clear_description_of_what_needs_to_be_implemented}}" + template: '{{clear_description_of_what_needs_to_be_implemented}}' - id: acceptance-criteria title: Acceptance Criteria @@ -6408,22 +6419,22 @@ sections: title: Functional Requirements type: checklist items: - - "{{specific_functional_requirement}}" + - '{{specific_functional_requirement}}' - id: technical-requirements title: Technical Requirements type: checklist items: - - "Code follows TypeScript strict mode standards" - - "Maintains 60 FPS on target devices" - - "No memory leaks or performance degradation" - - "{{specific_technical_requirement}}" + - 'Code follows TypeScript strict mode standards' + - 'Maintains 60 FPS on target devices' + - 'No memory leaks or performance degradation' + - '{{specific_technical_requirement}}' - id: game-design-requirements title: Game Design Requirements type: checklist items: - - "{{gameplay_requirement_from_gdd}}" - - "{{balance_requirement_if_applicable}}" - - "{{player_experience_requirement}}" + - '{{gameplay_requirement_from_gdd}}' + - '{{balance_requirement_if_applicable}}' + - '{{player_experience_requirement}}' - id: technical-specifications title: Technical Specifications @@ -6433,12 +6444,12 @@ sections: title: Files to Create/Modify template: | **New Files:** - + - `{{file_path_1}}` - {{purpose}} - `{{file_path_2}}` - {{purpose}} - + **Modified Files:** - + - `{{existing_file_1}}` - {{changes_needed}} - `{{existing_file_2}}` - {{changes_needed}} - id: class-interface-definitions @@ -6453,15 +6464,15 @@ sections: {{property_2}}: {{type}}; {{method_1}}({{params}}): {{return_type}}; } - + // {{class_name}} class {{class_name}} extends {{phaser_class}} { private {{property}}: {{type}}; - + constructor({{params}}) { // Implementation requirements } - + public {{method}}({{params}}): {{return_type}} { // Method requirements } @@ -6471,15 +6482,15 @@ sections: instruction: Specify how this feature integrates with existing systems template: | **Scene Integration:** - + - {{scene_name}}: {{integration_details}} - + **System Dependencies:** - + - {{system_name}}: {{dependency_description}} - + **Event Communication:** - + - Emits: `{{event_name}}` when {{condition}} - Listens: `{{event_name}}` to {{response}} @@ -6491,7 +6502,7 @@ sections: title: Dev Agent Record template: | **Tasks:** - + - [ ] {{task_1_description}} - [ ] {{task_2_description}} - [ ] {{task_3_description}} @@ -6499,18 +6510,18 @@ sections: - [ ] Write unit tests for {{component}} - [ ] Integration testing with {{related_system}} - [ ] Performance testing and optimization - + **Debug Log:** | Task | File | Change | Reverted? | |------|------|--------|-----------| | | | | | - + **Completion Notes:** - + - + **Change Log:** - + - id: game-design-context @@ -6518,13 +6529,13 @@ sections: instruction: Reference the specific sections of the GDD that this story implements template: | **GDD Reference:** {{section_name}} ({{page_or_section_number}}) - + **Game Mechanic:** {{mechanic_name}} - + **Player Experience Goal:** {{experience_description}} - + **Balance Parameters:** - + - {{parameter_1}}: {{value_or_range}} - {{parameter_2}}: {{value_or_range}} @@ -6536,11 +6547,11 @@ sections: title: Unit Tests template: | **Test Files:** - + - `tests/{{component_name}}.test.ts` - + **Test Scenarios:** - + - {{test_scenario_1}} - {{test_scenario_2}} - {{edge_case_test}} @@ -6548,12 +6559,12 @@ sections: title: Game Testing template: | **Manual Test Cases:** - + 1. {{test_case_1_description}} - + - Expected: {{expected_behavior}} - Performance: {{performance_expectation}} - + 2. {{test_case_2_description}} - Expected: {{expected_behavior}} - Edge Case: {{edge_case_handling}} @@ -6561,7 +6572,7 @@ sections: title: Performance Tests template: | **Metrics to Verify:** - + - Frame rate maintains {{fps_target}} FPS - Memory usage stays under {{memory_limit}}MB - {{feature_specific_performance_metric}} @@ -6571,15 +6582,15 @@ sections: instruction: List any dependencies that must be completed before this story can be implemented template: | **Story Dependencies:** - + - {{story_id}}: {{dependency_description}} - + **Technical Dependencies:** - + - {{system_or_file}}: {{requirement}} - + **Asset Dependencies:** - + - {{asset_type}}: {{asset_description}} - Location: `{{asset_path}}` @@ -6588,31 +6599,31 @@ sections: instruction: Checklist that must be completed before the story is considered finished type: checklist items: - - "All acceptance criteria met" - - "Code reviewed and approved" - - "Unit tests written and passing" - - "Integration tests passing" - - "Performance targets met" - - "No linting errors" - - "Documentation updated" - - "{{game_specific_dod_item}}" + - 'All acceptance criteria met' + - 'Code reviewed and approved' + - 'Unit tests written and passing' + - 'Integration tests passing' + - 'Performance targets met' + - 'No linting errors' + - 'Documentation updated' + - '{{game_specific_dod_item}}' - id: notes title: Notes instruction: Any additional context, design decisions, or implementation notes template: | **Implementation Notes:** - + - {{note_1}} - {{note_2}} - + **Design Decisions:** - + - {{decision_1}}: {{rationale}} - {{decision_2}}: {{rationale}} - + **Future Considerations:** - + - {{future_enhancement_1}} - {{future_optimization_1}} ==================== END: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== @@ -6624,8 +6635,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-game-architecture.md" - title: "{{game_title}} Game Architecture Document" + filename: 'docs/{{game_name}}-game-architecture.md' + title: '{{game_title}} Game Architecture Document' workflow: mode: interactive @@ -6634,7 +6645,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics. - + If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD. - id: introduction @@ -6642,7 +6653,7 @@ sections: instruction: Establish the document's purpose and scope for game development content: | This document outlines the complete technical architecture for {{game_title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems. - + This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility. sections: - id: change-log @@ -6661,7 +6672,7 @@ sections: title: Architecture Summary instruction: | Provide a comprehensive overview covering: - + - Game engine choice and configuration - Project structure and organization - Key systems and their interactions @@ -6749,23 +6760,23 @@ sections: title: Scene Management System template: | **Purpose:** Handle game flow and scene transitions - + **Key Components:** - + - Scene loading and unloading - Data passing between scenes - Transition effects - Memory management - + **Implementation Requirements:** - + - Preload scene for asset loading - Menu system with navigation - Gameplay scenes with state management - Pause/resume functionality - + **Files to Create:** - + - `src/scenes/BootScene.ts` - `src/scenes/PreloadScene.ts` - `src/scenes/MenuScene.ts` @@ -6775,23 +6786,23 @@ sections: title: Game State Management template: | **Purpose:** Track player progress and game status - + **State Categories:** - + - Player progress (levels, unlocks) - Game settings (audio, controls) - Session data (current level, score) - Persistent data (achievements, statistics) - + **Implementation Requirements:** - + - Save/load system with localStorage - State validation and error recovery - Cross-session data persistence - Settings management - + **Files to Create:** - + - `src/systems/GameState.ts` - `src/systems/SaveManager.ts` - `src/types/GameData.ts` @@ -6799,23 +6810,23 @@ sections: title: Asset Management System template: | **Purpose:** Efficient loading and management of game assets - + **Asset Categories:** - + - Sprite sheets and animations - Audio files and music - Level data and configurations - UI assets and fonts - + **Implementation Requirements:** - + - Progressive loading strategy - Asset caching and optimization - Error handling for failed loads - Memory management for large assets - + **Files to Create:** - + - `src/systems/AssetManager.ts` - `src/config/AssetConfig.ts` - `src/utils/AssetLoader.ts` @@ -6823,23 +6834,23 @@ sections: title: Input Management System template: | **Purpose:** Handle all player input across platforms - + **Input Types:** - + - Keyboard controls - Mouse/pointer interaction - Touch gestures (mobile) - Gamepad support (optional) - + **Implementation Requirements:** - + - Input mapping and configuration - Touch-friendly mobile controls - Input buffering for responsive gameplay - Customizable control schemes - + **Files to Create:** - + - `src/systems/InputManager.ts` - `src/utils/TouchControls.ts` - `src/types/InputTypes.ts` @@ -6849,22 +6860,22 @@ sections: repeatable: true sections: - id: mechanic-system - title: "{{mechanic_name}} System" + title: '{{mechanic_name}} System' template: | **Purpose:** {{system_purpose}} - + **Core Functionality:** - + - {{feature_1}} - {{feature_2}} - {{feature_3}} - + **Dependencies:** {{required_systems}} - + **Performance Considerations:** {{optimization_notes}} - + **Files to Create:** - + - `src/systems/{{system_name}}.ts` - `src/gameObjects/{{related_object}}.ts` - `src/types/{{system_types}}.ts` @@ -6872,65 +6883,65 @@ sections: title: Physics & Collision System template: | **Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js) - + **Collision Categories:** - + - Player collision - Enemy interactions - Environmental objects - Collectibles and items - + **Implementation Requirements:** - + - Optimized collision detection - Physics body management - Collision callbacks and events - Performance monitoring - + **Files to Create:** - + - `src/systems/PhysicsManager.ts` - `src/utils/CollisionGroups.ts` - id: audio-system title: Audio System template: | **Audio Requirements:** - + - Background music with looping - Sound effects for actions - Audio settings and volume control - Mobile audio optimization - + **Implementation Features:** - + - Audio sprite management - Dynamic music system - Spatial audio (if applicable) - Audio pooling for performance - + **Files to Create:** - + - `src/systems/AudioManager.ts` - `src/config/AudioConfig.ts` - id: ui-system title: UI System template: | **UI Components:** - + - HUD elements (score, health, etc.) - Menu navigation - Modal dialogs - Settings screens - + **Implementation Requirements:** - + - Responsive layout system - Touch-friendly interface - Keyboard navigation support - Animation and transitions - + **Files to Create:** - + - `src/systems/UIManager.ts` - `src/gameObjects/UI/` - `src/types/UITypes.ts` @@ -7146,7 +7157,7 @@ sections: instruction: Break down the architecture implementation into phases that align with the GDD development phases sections: - id: phase-1-foundation - title: "Phase 1: Foundation ({{duration}})" + title: 'Phase 1: Foundation ({{duration}})' sections: - id: phase-1-core title: Core Systems @@ -7164,7 +7175,7 @@ sections: - "Basic Scene Management System" - "Asset Loading Foundation" - id: phase-2-game-systems - title: "Phase 2: Game Systems ({{duration}})" + title: 'Phase 2: Game Systems ({{duration}})' sections: - id: phase-2-gameplay title: Gameplay Systems @@ -7182,7 +7193,7 @@ sections: - "Physics and Collision Framework" - "Game State Management System" - id: phase-3-content-polish - title: "Phase 3: Content & Polish ({{duration}})" + title: 'Phase 3: Content & Polish ({{duration}})' sections: - id: phase-3-content title: Content Systems @@ -7240,8 +7251,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-game-brief.md" - title: "{{game_title}} Game Brief" + filename: 'docs/{{game_name}}-game-brief.md' + title: '{{game_title}} Game Brief' workflow: mode: interactive @@ -7250,7 +7261,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. - id: game-vision @@ -7307,7 +7318,7 @@ sections: repeatable: true template: | **Core Mechanic: {{mechanic_name}}** - + - **Description:** {{how_it_works}} - **Player Value:** {{why_its_fun}} - **Implementation Scope:** {{complexity_estimate}} @@ -7334,12 +7345,12 @@ sections: title: Technical Constraints template: | **Platform Requirements:** - + - Primary: {{platform_1}} - {{requirements}} - Secondary: {{platform_2}} - {{requirements}} - + **Technical Specifications:** - + - Engine: Phaser 3 + TypeScript - Performance Target: {{fps_target}} FPS on {{target_device}} - Memory Budget: <{{memory_limit}}MB @@ -7377,10 +7388,10 @@ sections: title: Competitive Analysis template: | **Direct Competitors:** - + - {{competitor_1}}: {{strengths_and_weaknesses}} - {{competitor_2}}: {{strengths_and_weaknesses}} - + **Differentiation Strategy:** {{how_we_differ_and_why_thats_valuable}} - id: market-opportunity @@ -7404,16 +7415,16 @@ sections: title: Content Categories template: | **Core Content:** - + - {{content_type_1}}: {{quantity_and_description}} - {{content_type_2}}: {{quantity_and_description}} - + **Optional Content:** - + - {{optional_content_type}}: {{quantity_and_description}} - + **Replay Elements:** - + - {{replayability_features}} - id: difficulty-accessibility title: Difficulty and Accessibility @@ -7480,13 +7491,13 @@ sections: title: Player Experience Metrics template: | **Engagement Goals:** - + - Tutorial completion rate: >{{percentage}}% - Average session length: {{duration}} minutes - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - + **Quality Benchmarks:** - + - Player satisfaction: >{{rating}}/10 - Completion rate: >{{percentage}}% - Technical performance: {{fps_target}} FPS consistent @@ -7494,13 +7505,13 @@ sections: title: Development Metrics template: | **Technical Targets:** - + - Zero critical bugs at launch - Performance targets met on all platforms - Load times under {{seconds}}s - + **Process Goals:** - + - Development timeline adherence - Feature scope completion - Quality assurance standards @@ -7509,7 +7520,7 @@ sections: condition: has_business_goals template: | **Commercial Goals:** - + - {{revenue_target}} in first {{time_period}} - {{user_acquisition_target}} players in first {{time_period}} - {{retention_target}} monthly active users @@ -7527,21 +7538,21 @@ sections: title: Development Roadmap sections: - id: phase-1-preproduction - title: "Phase 1: Pre-Production ({{duration}})" + title: 'Phase 1: Pre-Production ({{duration}})' type: bullet-list template: | - Detailed Game Design Document creation - Technical architecture planning - Art style exploration and pipeline setup - id: phase-2-prototype - title: "Phase 2: Prototype ({{duration}})" + title: 'Phase 2: Prototype ({{duration}})' type: bullet-list template: | - Core mechanic implementation - Technical proof of concept - Initial playtesting and iteration - id: phase-3-production - title: "Phase 3: Production ({{duration}})" + title: 'Phase 3: Production ({{duration}})' type: bullet-list template: | - Full feature development @@ -7562,12 +7573,12 @@ sections: title: Validation Plan template: | **Concept Testing:** - + - {{validation_method_1}} - {{timeline}} - {{validation_method_2}} - {{timeline}} - + **Prototype Testing:** - + - {{testing_approach}} - {{timeline}} - {{feedback_collection_method}} - {{timeline}} @@ -7599,8 +7610,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-game-design-document.md" - title: "{{game_title}} Game Design Document (GDD)" + filename: 'docs/{{game_name}}-game-design-document.md' + title: '{{game_title}} Game Design Document (GDD)' workflow: mode: interactive @@ -7609,7 +7620,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive Game Design Document that will serve as the foundation for all game development work. The GDD should be detailed enough that developers can create user stories and epics from it. Focus on gameplay systems, mechanics, and technical requirements that can be broken down into implementable features. - + If available, review any provided documents or ask if any are optionally available: Project Brief, Market Research, Competitive Analysis - id: executive-summary @@ -7637,7 +7648,7 @@ sections: title: Unique Selling Points instruction: List 3-5 key features that differentiate this game from competitors type: numbered-list - template: "{{usp}}" + template: '{{usp}}' - id: core-gameplay title: Core Gameplay @@ -7654,7 +7665,7 @@ sections: instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions. template: | **Primary Loop ({{duration}} seconds):** - + 1. {{action_1}} ({{time_1}}s) 2. {{action_2}} ({{time_2}}s) 3. {{action_3}} ({{time_3}}s) @@ -7664,12 +7675,12 @@ sections: instruction: Clearly define success and failure states template: | **Victory Conditions:** - + - {{win_condition_1}} - {{win_condition_2}} - + **Failure States:** - + - {{loss_condition_1}} - {{loss_condition_2}} @@ -7682,20 +7693,20 @@ sections: repeatable: true sections: - id: mechanic - title: "{{mechanic_name}}" + title: '{{mechanic_name}}' template: | **Description:** {{detailed_description}} - + **Player Input:** {{input_method}} - + **System Response:** {{game_response}} - + **Implementation Notes:** - + - {{tech_requirement_1}} - {{tech_requirement_2}} - {{performance_consideration}} - + **Dependencies:** {{other_mechanics_needed}} - id: controls title: Controls @@ -7714,9 +7725,9 @@ sections: title: Player Progression template: | **Progression Type:** {{linear|branching|metroidvania}} - + **Key Milestones:** - + 1. **{{milestone_1}}** - {{unlock_description}} 2. **{{milestone_2}}** - {{unlock_description}} 3. **{{milestone_3}}** - {{unlock_description}} @@ -7747,15 +7758,15 @@ sections: repeatable: true sections: - id: level-type - title: "{{level_type_name}}" + title: '{{level_type_name}}' template: | **Purpose:** {{gameplay_purpose}} **Duration:** {{target_time}} **Key Elements:** {{required_mechanics}} **Difficulty:** {{relative_difficulty}} - + **Structure Template:** - + - Introduction: {{intro_description}} - Challenge: {{main_challenge}} - Resolution: {{completion_requirement}} @@ -7781,13 +7792,13 @@ sections: title: Platform Specific template: | **Desktop:** - + - Resolution: {{min_resolution}} - {{max_resolution}} - Input: Keyboard, Mouse, Gamepad - Browser: Chrome 80+, Firefox 75+, Safari 13+ - + **Mobile:** - + - Resolution: {{mobile_min}} - {{mobile_max}} - Input: Touch, Tilt (optional) - OS: iOS 13+, Android 8+ @@ -7796,14 +7807,14 @@ sections: instruction: Define asset specifications for the art and audio teams template: | **Visual Assets:** - + - Art Style: {{style_description}} - Color Palette: {{color_specification}} - Animation: {{animation_requirements}} - UI Resolution: {{ui_specs}} - + **Audio Assets:** - + - Music Style: {{music_genre}} - Sound Effects: {{sfx_requirements}} - Voice Acting: {{voice_needs}} @@ -7816,7 +7827,7 @@ sections: title: Engine Configuration template: | **Phaser 3 Setup:** - + - TypeScript: Strict mode enabled - Physics: {{physics_system}} (Arcade/Matter) - Renderer: WebGL with Canvas fallback @@ -7825,7 +7836,7 @@ sections: title: Code Architecture template: | **Required Systems:** - + - Scene Management - State Management - Asset Loading @@ -7837,7 +7848,7 @@ sections: title: Data Management template: | **Save Data:** - + - Progress tracking - Settings persistence - Statistics collection @@ -7848,10 +7859,10 @@ sections: instruction: Break down the development into phases that can be converted to epics sections: - id: phase-1-core-systems - title: "Phase 1: Core Systems ({{duration}})" + title: 'Phase 1: Core Systems ({{duration}})' sections: - id: foundation-epic - title: "Epic: Foundation" + title: 'Epic: Foundation' type: bullet-list template: | - Engine setup and configuration @@ -7859,41 +7870,41 @@ sections: - Core input handling - Asset loading pipeline - id: core-mechanics-epic - title: "Epic: Core Mechanics" + title: 'Epic: Core Mechanics' type: bullet-list template: | - {{primary_mechanic}} implementation - Basic physics and collision - Player controller - id: phase-2-gameplay-features - title: "Phase 2: Gameplay Features ({{duration}})" + title: 'Phase 2: Gameplay Features ({{duration}})' sections: - id: game-systems-epic - title: "Epic: Game Systems" + title: 'Epic: Game Systems' type: bullet-list template: | - {{mechanic_2}} implementation - {{mechanic_3}} implementation - Game state management - id: content-creation-epic - title: "Epic: Content Creation" + title: 'Epic: Content Creation' type: bullet-list template: | - Level loading system - First playable levels - Basic UI implementation - id: phase-3-polish-optimization - title: "Phase 3: Polish & Optimization ({{duration}})" + title: 'Phase 3: Polish & Optimization ({{duration}})' sections: - id: performance-epic - title: "Epic: Performance" + title: 'Epic: Performance' type: bullet-list template: | - Optimization and profiling - Mobile platform testing - Memory management - id: user-experience-epic - title: "Epic: User Experience" + title: 'Epic: User Experience' type: bullet-list template: | - Audio implementation @@ -7935,7 +7946,7 @@ sections: title: References instruction: List any competitive analysis, inspiration, or research sources type: bullet-list - template: "{{reference}}" + template: '{{reference}}' ==================== END: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== @@ -7945,8 +7956,8 @@ template: version: 2.0 output: format: markdown - filename: "stories/{{epic_name}}/{{story_id}}-{{story_name}}.md" - title: "Story: {{story_title}}" + filename: 'stories/{{epic_name}}/{{story_id}}-{{story_name}}.md' + title: 'Story: {{story_title}}' workflow: mode: interactive @@ -7955,13 +7966,13 @@ sections: - id: initial-setup instruction: | This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. - + Before starting, ensure you have access to: - + - Game Design Document (GDD) - Game Architecture Document - Any existing stories in this epic - + The story should be specific enough that a developer can implement it without requiring additional design decisions. - id: story-header @@ -7975,7 +7986,7 @@ sections: - id: description title: Description instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature. - template: "{{clear_description_of_what_needs_to_be_implemented}}" + template: '{{clear_description_of_what_needs_to_be_implemented}}' - id: acceptance-criteria title: Acceptance Criteria @@ -7985,22 +7996,22 @@ sections: title: Functional Requirements type: checklist items: - - "{{specific_functional_requirement}}" + - '{{specific_functional_requirement}}' - id: technical-requirements title: Technical Requirements type: checklist items: - - "Code follows TypeScript strict mode standards" - - "Maintains 60 FPS on target devices" - - "No memory leaks or performance degradation" - - "{{specific_technical_requirement}}" + - 'Code follows TypeScript strict mode standards' + - 'Maintains 60 FPS on target devices' + - 'No memory leaks or performance degradation' + - '{{specific_technical_requirement}}' - id: game-design-requirements title: Game Design Requirements type: checklist items: - - "{{gameplay_requirement_from_gdd}}" - - "{{balance_requirement_if_applicable}}" - - "{{player_experience_requirement}}" + - '{{gameplay_requirement_from_gdd}}' + - '{{balance_requirement_if_applicable}}' + - '{{player_experience_requirement}}' - id: technical-specifications title: Technical Specifications @@ -8010,12 +8021,12 @@ sections: title: Files to Create/Modify template: | **New Files:** - + - `{{file_path_1}}` - {{purpose}} - `{{file_path_2}}` - {{purpose}} - + **Modified Files:** - + - `{{existing_file_1}}` - {{changes_needed}} - `{{existing_file_2}}` - {{changes_needed}} - id: class-interface-definitions @@ -8030,15 +8041,15 @@ sections: {{property_2}}: {{type}}; {{method_1}}({{params}}): {{return_type}}; } - + // {{class_name}} class {{class_name}} extends {{phaser_class}} { private {{property}}: {{type}}; - + constructor({{params}}) { // Implementation requirements } - + public {{method}}({{params}}): {{return_type}} { // Method requirements } @@ -8048,15 +8059,15 @@ sections: instruction: Specify how this feature integrates with existing systems template: | **Scene Integration:** - + - {{scene_name}}: {{integration_details}} - + **System Dependencies:** - + - {{system_name}}: {{dependency_description}} - + **Event Communication:** - + - Emits: `{{event_name}}` when {{condition}} - Listens: `{{event_name}}` to {{response}} @@ -8068,7 +8079,7 @@ sections: title: Dev Agent Record template: | **Tasks:** - + - [ ] {{task_1_description}} - [ ] {{task_2_description}} - [ ] {{task_3_description}} @@ -8076,18 +8087,18 @@ sections: - [ ] Write unit tests for {{component}} - [ ] Integration testing with {{related_system}} - [ ] Performance testing and optimization - + **Debug Log:** | Task | File | Change | Reverted? | |------|------|--------|-----------| | | | | | - + **Completion Notes:** - + - + **Change Log:** - + - id: game-design-context @@ -8095,13 +8106,13 @@ sections: instruction: Reference the specific sections of the GDD that this story implements template: | **GDD Reference:** {{section_name}} ({{page_or_section_number}}) - + **Game Mechanic:** {{mechanic_name}} - + **Player Experience Goal:** {{experience_description}} - + **Balance Parameters:** - + - {{parameter_1}}: {{value_or_range}} - {{parameter_2}}: {{value_or_range}} @@ -8113,11 +8124,11 @@ sections: title: Unit Tests template: | **Test Files:** - + - `tests/{{component_name}}.test.ts` - + **Test Scenarios:** - + - {{test_scenario_1}} - {{test_scenario_2}} - {{edge_case_test}} @@ -8125,12 +8136,12 @@ sections: title: Game Testing template: | **Manual Test Cases:** - + 1. {{test_case_1_description}} - + - Expected: {{expected_behavior}} - Performance: {{performance_expectation}} - + 2. {{test_case_2_description}} - Expected: {{expected_behavior}} - Edge Case: {{edge_case_handling}} @@ -8138,7 +8149,7 @@ sections: title: Performance Tests template: | **Metrics to Verify:** - + - Frame rate maintains {{fps_target}} FPS - Memory usage stays under {{memory_limit}}MB - {{feature_specific_performance_metric}} @@ -8148,15 +8159,15 @@ sections: instruction: List any dependencies that must be completed before this story can be implemented template: | **Story Dependencies:** - + - {{story_id}}: {{dependency_description}} - + **Technical Dependencies:** - + - {{system_or_file}}: {{requirement}} - + **Asset Dependencies:** - + - {{asset_type}}: {{asset_description}} - Location: `{{asset_path}}` @@ -8165,31 +8176,31 @@ sections: instruction: Checklist that must be completed before the story is considered finished type: checklist items: - - "All acceptance criteria met" - - "Code reviewed and approved" - - "Unit tests written and passing" - - "Integration tests passing" - - "Performance targets met" - - "No linting errors" - - "Documentation updated" - - "{{game_specific_dod_item}}" + - 'All acceptance criteria met' + - 'Code reviewed and approved' + - 'Unit tests written and passing' + - 'Integration tests passing' + - 'Performance targets met' + - 'No linting errors' + - 'Documentation updated' + - '{{game_specific_dod_item}}' - id: notes title: Notes instruction: Any additional context, design decisions, or implementation notes template: | **Implementation Notes:** - + - {{note_1}} - {{note_2}} - + **Design Decisions:** - + - {{decision_1}}: {{rationale}} - {{decision_2}}: {{rationale}} - + **Future Considerations:** - + - {{future_enhancement_1}} - {{future_optimization_1}} ==================== END: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== @@ -8201,8 +8212,8 @@ template: version: 2.0 output: format: markdown - filename: "docs/{{game_name}}-level-design-document.md" - title: "{{game_title}} Level Design Document" + filename: 'docs/{{game_name}}-level-design-document.md' + title: '{{game_title}} Level Design Document' workflow: mode: interactive @@ -8211,7 +8222,7 @@ sections: - id: initial-setup instruction: | This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. - id: introduction @@ -8219,7 +8230,7 @@ sections: instruction: Establish the purpose and scope of level design for this game content: | This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. sections: - id: change-log @@ -8263,32 +8274,32 @@ sections: repeatable: true sections: - id: level-category - title: "{{category_name}} Levels" + title: '{{category_name}} Levels' template: | **Purpose:** {{gameplay_purpose}} - + **Target Duration:** {{min_time}} - {{max_time}} minutes - + **Difficulty Range:** {{difficulty_scale}} - + **Key Mechanics Featured:** - + - {{mechanic_1}} - {{usage_description}} - {{mechanic_2}} - {{usage_description}} - + **Player Objectives:** - + - Primary: {{primary_objective}} - Secondary: {{secondary_objective}} - Hidden: {{secret_objective}} - + **Success Criteria:** - + - {{completion_requirement_1}} - {{completion_requirement_2}} - + **Technical Requirements:** - + - Maximum entities: {{entity_limit}} - Performance target: {{fps_target}} FPS - Memory budget: {{memory_limit}}MB @@ -8303,11 +8314,11 @@ sections: instruction: Based on GDD requirements, define the overall level organization template: | **Organization Type:** {{linear|hub_world|open_world}} - + **Total Level Count:** {{number}} - + **World Breakdown:** - + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} @@ -8342,7 +8353,7 @@ sections: instruction: Define how players access new levels template: | **Progression Gates:** - + - Linear progression: Complete previous level - Star requirements: {{star_count}} stars to unlock - Skill gates: Demonstrate {{skill_requirement}} @@ -8357,17 +8368,17 @@ sections: instruction: Define all environmental components that can be used in levels template: | **Terrain Types:** - + - {{terrain_1}}: {{properties_and_usage}} - {{terrain_2}}: {{properties_and_usage}} - + **Interactive Objects:** - + - {{object_1}}: {{behavior_and_purpose}} - {{object_2}}: {{behavior_and_purpose}} - + **Hazards and Obstacles:** - + - {{hazard_1}}: {{damage_and_behavior}} - {{hazard_2}}: {{damage_and_behavior}} - id: collectibles-rewards @@ -8375,18 +8386,18 @@ sections: instruction: Define all collectible items and their placement rules template: | **Collectible Types:** - + - {{collectible_1}}: {{value_and_purpose}} - {{collectible_2}}: {{value_and_purpose}} - + **Placement Guidelines:** - + - Mandatory collectibles: {{placement_rules}} - Optional collectibles: {{placement_rules}} - Secret collectibles: {{placement_rules}} - + **Reward Distribution:** - + - Easy to find: {{percentage}}% - Moderate challenge: {{percentage}}% - High skill required: {{percentage}}% @@ -8395,18 +8406,18 @@ sections: instruction: Define how enemies should be placed and balanced in levels template: | **Enemy Categories:** - + - {{enemy_type_1}}: {{behavior_and_usage}} - {{enemy_type_2}}: {{behavior_and_usage}} - + **Placement Principles:** - + - Introduction encounters: {{guideline}} - Standard encounters: {{guideline}} - Challenge encounters: {{guideline}} - + **Difficulty Scaling:** - + - Enemy count progression: {{scaling_rule}} - Enemy type introduction: {{pacing_rule}} - Encounter complexity: {{complexity_rule}} @@ -8419,14 +8430,14 @@ sections: title: Level Layout Principles template: | **Spatial Design:** - + - Grid size: {{grid_dimensions}} - Minimum path width: {{width_units}} - Maximum vertical distance: {{height_units}} - Safe zones placement: {{safety_guidelines}} - + **Navigation Design:** - + - Clear path indication: {{visual_cues}} - Landmark placement: {{landmark_rules}} - Dead end avoidance: {{dead_end_policy}} @@ -8436,13 +8447,13 @@ sections: instruction: Define how to control the rhythm and pace of gameplay within levels template: | **Action Sequences:** - + - High intensity duration: {{max_duration}} - Rest period requirement: {{min_rest_time}} - Intensity variation: {{pacing_pattern}} - + **Learning Sequences:** - + - New mechanic introduction: {{teaching_method}} - Practice opportunity: {{practice_duration}} - Skill application: {{application_context}} @@ -8451,14 +8462,14 @@ sections: instruction: Define how to create appropriate challenges for each level type template: | **Challenge Types:** - + - Execution challenges: {{skill_requirements}} - Puzzle challenges: {{complexity_guidelines}} - Time challenges: {{time_pressure_rules}} - Resource challenges: {{resource_management}} - + **Difficulty Calibration:** - + - Skill check frequency: {{frequency_guidelines}} - Failure recovery: {{retry_mechanics}} - Hint system integration: {{help_system}} @@ -8472,7 +8483,7 @@ sections: instruction: Define how level data should be structured for implementation template: | **Level File Format:** - + - Data format: {{json|yaml|custom}} - File naming: `level_{{world}}_{{number}}.{{extension}}` - Data organization: {{structure_description}} @@ -8510,14 +8521,14 @@ sections: instruction: Define how level assets are organized and loaded template: | **Tilemap Requirements:** - + - Tile size: {{tile_dimensions}}px - Tileset organization: {{tileset_structure}} - Layer organization: {{layer_system}} - Collision data: {{collision_format}} - + **Audio Integration:** - + - Background music: {{music_requirements}} - Ambient sounds: {{ambient_system}} - Dynamic audio: {{dynamic_audio_rules}} @@ -8526,19 +8537,19 @@ sections: instruction: Define performance requirements for level systems template: | **Entity Limits:** - + - Maximum active entities: {{entity_limit}} - Maximum particles: {{particle_limit}} - Maximum audio sources: {{audio_limit}} - + **Memory Management:** - + - Texture memory budget: {{texture_memory}}MB - Audio memory budget: {{audio_memory}}MB - Level loading time: <{{load_time}}s - + **Culling and LOD:** - + - Off-screen culling: {{culling_distance}} - Level-of-detail rules: {{lod_system}} - Asset streaming: {{streaming_requirements}} @@ -8551,13 +8562,13 @@ sections: title: Automated Testing template: | **Performance Testing:** - + - Frame rate validation: Maintain {{fps_target}} FPS - Memory usage monitoring: Stay under {{memory_limit}}MB - Loading time verification: Complete in <{{load_time}}s - + **Gameplay Testing:** - + - Completion path validation: All objectives achievable - Collectible accessibility: All items reachable - Softlock prevention: No unwinnable states @@ -8568,31 +8579,31 @@ sections: title: Playtesting Checklist type: checklist items: - - "Level completes within target time range" - - "All mechanics function correctly" - - "Difficulty feels appropriate for level category" - - "Player guidance is clear and effective" - - "No exploits or sequence breaks (unless intended)" + - 'Level completes within target time range' + - 'All mechanics function correctly' + - 'Difficulty feels appropriate for level category' + - 'Player guidance is clear and effective' + - 'No exploits or sequence breaks (unless intended)' - id: player-experience-testing title: Player Experience Testing type: checklist items: - - "Tutorial levels teach effectively" - - "Challenge feels fair and rewarding" - - "Flow and pacing maintain engagement" - - "Audio and visual feedback support gameplay" + - 'Tutorial levels teach effectively' + - 'Challenge feels fair and rewarding' + - 'Flow and pacing maintain engagement' + - 'Audio and visual feedback support gameplay' - id: balance-validation title: Balance Validation template: | **Metrics Collection:** - + - Completion rate: Target {{completion_percentage}}% - Average completion time: {{target_time}} ± {{variance}} - Death count per level: <{{max_deaths}} - Collectible discovery rate: {{discovery_percentage}}% - + **Iteration Guidelines:** - + - Adjustment criteria: {{criteria_for_changes}} - Testing sample size: {{minimum_testers}} - Validation period: {{testing_duration}} @@ -8605,14 +8616,14 @@ sections: title: Design Phase template: | **Concept Development:** - + 1. Define level purpose and goals 2. Create rough layout sketch 3. Identify key mechanics and challenges 4. Estimate difficulty and duration - + **Documentation Requirements:** - + - Level design brief - Layout diagrams - Mechanic integration notes @@ -8621,15 +8632,15 @@ sections: title: Implementation Phase template: | **Technical Implementation:** - + 1. Create level data file 2. Build tilemap and layout 3. Place entities and objects 4. Configure level logic and triggers 5. Integrate audio and visual effects - + **Quality Assurance:** - + 1. Automated testing execution 2. Internal playtesting 3. Performance validation @@ -8638,14 +8649,14 @@ sections: title: Integration Phase template: | **Game Integration:** - + 1. Level progression integration 2. Save system compatibility 3. Analytics integration 4. Achievement system integration - + **Final Validation:** - + 1. Full game context testing 2. Performance regression testing 3. Platform compatibility verification @@ -9693,21 +9704,21 @@ workflow: - brainstorming_session - game_research_prompt - player_research - notes: 'Start with brainstorming game concepts, then create comprehensive game brief. SAVE OUTPUT: Copy final game-brief.md to your project''s docs/design/ folder.' + notes: "Start with brainstorming game concepts, then create comprehensive game brief. SAVE OUTPUT: Copy final game-brief.md to your project's docs/design/ folder." - agent: game-designer creates: game-design-doc.md requires: game-brief.md optional_steps: - competitive_analysis - technical_research - notes: 'Create detailed Game Design Document using game-design-doc-tmpl. Defines all gameplay mechanics, progression, and technical requirements. SAVE OUTPUT: Copy final game-design-doc.md to your project''s docs/design/ folder.' + notes: "Create detailed Game Design Document using game-design-doc-tmpl. Defines all gameplay mechanics, progression, and technical requirements. SAVE OUTPUT: Copy final game-design-doc.md to your project's docs/design/ folder." - agent: game-designer creates: level-design-doc.md requires: game-design-doc.md optional_steps: - level_prototyping - difficulty_analysis - notes: 'Create level design framework using level-design-doc-tmpl. Establishes content creation guidelines and performance requirements. SAVE OUTPUT: Copy final level-design-doc.md to your project''s docs/design/ folder.' + notes: "Create level design framework using level-design-doc-tmpl. Establishes content creation guidelines and performance requirements. SAVE OUTPUT: Copy final level-design-doc.md to your project's docs/design/ folder." - agent: solution-architect creates: game-architecture.md requires: @@ -9717,7 +9728,7 @@ workflow: - technical_research_prompt - performance_analysis - platform_research - notes: 'Create comprehensive technical architecture using game-architecture-tmpl. Defines Phaser 3 systems, performance optimization, and code structure. SAVE OUTPUT: Copy final game-architecture.md to your project''s docs/architecture/ folder.' + notes: "Create comprehensive technical architecture using game-architecture-tmpl. Defines Phaser 3 systems, performance optimization, and code structure. SAVE OUTPUT: Copy final game-architecture.md to your project's docs/architecture/ folder." - agent: game-designer validates: design_consistency requires: all_design_documents @@ -9742,7 +9753,7 @@ workflow: optional_steps: - quick_brainstorming - concept_validation - notes: 'Create focused game brief for prototype. Emphasize core mechanics and immediate playability. SAVE OUTPUT: Copy final game-brief.md to your project''s docs/ folder.' + notes: "Create focused game brief for prototype. Emphasize core mechanics and immediate playability. SAVE OUTPUT: Copy final game-brief.md to your project's docs/ folder." - agent: game-designer creates: prototype-design.md uses: create-doc prototype-design OR create-game-story @@ -10366,7 +10377,7 @@ interface GameState { interface GameSettings { musicVolume: number; sfxVolume: number; - difficulty: "easy" | "normal" | "hard"; + difficulty: 'easy' | 'normal' | 'hard'; controls: ControlScheme; } ``` @@ -10407,12 +10418,12 @@ class GameScene extends Phaser.Scene { private inputManager!: InputManager; constructor() { - super({ key: "GameScene" }); + super({ key: 'GameScene' }); } preload(): void { // Load only scene-specific assets - this.load.image("player", "assets/player.png"); + this.load.image('player', 'assets/player.png'); } create(data: SceneData): void { @@ -10437,7 +10448,7 @@ class GameScene extends Phaser.Scene { this.inputManager.destroy(); // Remove event listeners - this.events.off("*"); + this.events.off('*'); } } ``` @@ -10446,13 +10457,13 @@ class GameScene extends Phaser.Scene { ```typescript // Proper scene transitions with data -this.scene.start("NextScene", { +this.scene.start('NextScene', { playerScore: this.playerScore, currentLevel: this.currentLevel + 1, }); // Scene overlays for UI -this.scene.launch("PauseMenuScene"); +this.scene.launch('PauseMenuScene'); this.scene.pause(); ``` @@ -10496,7 +10507,7 @@ class Player extends GameEntity { private health!: HealthComponent; constructor(scene: Phaser.Scene, x: number, y: number) { - super(scene, x, y, "player"); + super(scene, x, y, 'player'); this.movement = this.addComponent(new MovementComponent(this)); this.health = this.addComponent(new HealthComponent(this, 100)); @@ -10516,7 +10527,7 @@ class GameManager { constructor(scene: Phaser.Scene) { if (GameManager.instance) { - throw new Error("GameManager already exists!"); + throw new Error('GameManager already exists!'); } this.scene = scene; @@ -10526,7 +10537,7 @@ class GameManager { static getInstance(): GameManager { if (!GameManager.instance) { - throw new Error("GameManager not initialized!"); + throw new Error('GameManager not initialized!'); } return GameManager.instance; } @@ -10573,7 +10584,7 @@ class BulletPool { } // Pool exhausted - create new bullet - console.warn("Bullet pool exhausted, creating new bullet"); + console.warn('Bullet pool exhausted, creating new bullet'); return new Bullet(this.scene, 0, 0); } @@ -10673,14 +10684,12 @@ class InputManager { } private setupKeyboard(): void { - this.keys = this.scene.input.keyboard.addKeys( - "W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT", - ); + this.keys = this.scene.input.keyboard.addKeys('W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT'); } private setupTouch(): void { - this.scene.input.on("pointerdown", this.handlePointerDown, this); - this.scene.input.on("pointerup", this.handlePointerUp, this); + this.scene.input.on('pointerdown', this.handlePointerDown, this); + this.scene.input.on('pointerup', this.handlePointerUp, this); } update(): void { @@ -10707,9 +10716,9 @@ class InputManager { class AssetManager { loadAssets(): Promise { return new Promise((resolve, reject) => { - this.scene.load.on("filecomplete", this.handleFileComplete, this); - this.scene.load.on("loaderror", this.handleLoadError, this); - this.scene.load.on("complete", () => resolve()); + this.scene.load.on('filecomplete', this.handleFileComplete, this); + this.scene.load.on('loaderror', this.handleLoadError, this); + this.scene.load.on('complete', () => resolve()); this.scene.load.start(); }); @@ -10725,8 +10734,8 @@ class AssetManager { private loadFallbackAsset(key: string): void { // Load placeholder or default assets switch (key) { - case "player": - this.scene.load.image("player", "assets/defaults/default-player.png"); + case 'player': + this.scene.load.image('player', 'assets/defaults/default-player.png'); break; default: console.warn(`No fallback for asset: ${key}`); @@ -10753,11 +10762,11 @@ class GameSystem { private attemptRecovery(context: string): void { switch (context) { - case "update": + case 'update': // Reset system state this.reset(); break; - case "render": + case 'render': // Disable visual effects this.disableEffects(); break; @@ -10777,7 +10786,7 @@ class GameSystem { ```typescript // Example test for game mechanics -describe("HealthComponent", () => { +describe('HealthComponent', () => { let healthComponent: HealthComponent; beforeEach(() => { @@ -10785,18 +10794,18 @@ describe("HealthComponent", () => { healthComponent = new HealthComponent(mockEntity, 100); }); - test("should initialize with correct health", () => { + test('should initialize with correct health', () => { expect(healthComponent.currentHealth).toBe(100); expect(healthComponent.maxHealth).toBe(100); }); - test("should handle damage correctly", () => { + test('should handle damage correctly', () => { healthComponent.takeDamage(25); expect(healthComponent.currentHealth).toBe(75); expect(healthComponent.isAlive()).toBe(true); }); - test("should handle death correctly", () => { + test('should handle death correctly', () => { healthComponent.takeDamage(150); expect(healthComponent.currentHealth).toBe(0); expect(healthComponent.isAlive()).toBe(false); @@ -10809,7 +10818,7 @@ describe("HealthComponent", () => { **Scene Testing:** ```typescript -describe("GameScene Integration", () => { +describe('GameScene Integration', () => { let scene: GameScene; let mockGame: Phaser.Game; @@ -10819,7 +10828,7 @@ describe("GameScene Integration", () => { scene = new GameScene(); }); - test("should initialize all systems", () => { + test('should initialize all systems', () => { scene.create({}); expect(scene.gameManager).toBeDefined(); diff --git a/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt b/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt index b00ac536..bcb9d36a 100644 --- a/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt +++ b/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt @@ -1231,7 +1231,7 @@ template: output: format: markdown filename: docs/game-architecture.md - title: "{{project_name}} Game Architecture Document" + title: '{{project_name}} Game Architecture Document' workflow: mode: interactive @@ -1341,11 +1341,11 @@ sections: - Game management patterns (Singleton managers, Event systems, State machines) - Data patterns (ScriptableObject configuration, Save/Load systems) - Unity-specific patterns (Object pooling, Coroutines, Unity Events) - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - "**Component-Based Architecture:** Using MonoBehaviour components for game logic - _Rationale:_ Aligns with Unity's design philosophy and enables reusable, testable game systems" - - "**ScriptableObject Data:** Using ScriptableObjects for game configuration - _Rationale:_ Enables data-driven design and easy balancing without code changes" - - "**Event-Driven Communication:** Using Unity Events and C# events for system decoupling - _Rationale:_ Supports modular architecture and easier testing" + - '**ScriptableObject Data:** Using ScriptableObjects for game configuration - _Rationale:_ Enables data-driven design and easy balancing without code changes' + - '**Event-Driven Communication:** Using Unity Events and C# events for system decoupling - _Rationale:_ Supports modular architecture and easier testing' - id: tech-stack title: Tech Stack @@ -1384,13 +1384,13 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Populate the technology stack table with all relevant Unity technologies examples: - - "| **Game Engine** | Unity | 2022.3.21f1 | Core game development platform | Latest LTS version, stable 2D tooling, comprehensive package ecosystem |" + - '| **Game Engine** | Unity | 2022.3.21f1 | Core game development platform | Latest LTS version, stable 2D tooling, comprehensive package ecosystem |' - "| **Language** | C# | 10.0 | Primary scripting language | Unity's native language, strong typing, excellent tooling |" - - "| **Render Pipeline** | Universal Render Pipeline (URP) | 14.0.10 | 2D/3D rendering | Optimized for mobile, excellent 2D features, future-proof |" - - "| **Input System** | Unity Input System | 1.7.0 | Cross-platform input handling | Modern input system, supports multiple devices, rebindable controls |" - - "| **Physics** | Unity 2D Physics | Built-in | 2D collision and physics | Integrated Box2D, optimized for 2D games |" - - "| **Audio** | Unity Audio | Built-in | Audio playback and mixing | Built-in audio system with mixer support |" - - "| **Testing** | Unity Test Framework | 1.1.33 | Unit and integration testing | Built-in testing framework based on NUnit |" + - '| **Render Pipeline** | Universal Render Pipeline (URP) | 14.0.10 | 2D/3D rendering | Optimized for mobile, excellent 2D features, future-proof |' + - '| **Input System** | Unity Input System | 1.7.0 | Cross-platform input handling | Modern input system, supports multiple devices, rebindable controls |' + - '| **Physics** | Unity 2D Physics | Built-in | 2D collision and physics | Integrated Box2D, optimized for 2D games |' + - '| **Audio** | Unity Audio | Built-in | Audio playback and mixing | Built-in audio system with mixer support |' + - '| **Testing** | Unity Test Framework | 1.1.33 | Unit and integration testing | Built-in testing framework based on NUnit |' - id: data-models title: Game Data Models @@ -1408,7 +1408,7 @@ sections: repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} @@ -1443,7 +1443,7 @@ sections: sections: - id: system-list repeatable: true - title: "{{system_name}} System" + title: '{{system_name}} System' template: | **Responsibility:** {{system_description}} @@ -1967,7 +1967,7 @@ sections: repeatable: true sections: - id: integration - title: "{{service_name}} Integration" + title: '{{service_name}} Integration' template: | - **Purpose:** {{service_purpose}} - **Documentation:** {{service_docs_url}} @@ -2079,12 +2079,12 @@ sections: - id: environments title: Build Environments repeatable: true - template: "- **{{env_name}}:** {{env_purpose}} - {{platform_settings}}" + template: '- **{{env_name}}:** {{env_purpose}} - {{platform_settings}}' - id: platform-specific-builds title: Platform-Specific Build Settings type: code language: text - template: "{{platform_build_configurations}}" + template: '{{platform_build_configurations}}' - id: coding-standards title: Coding Standards @@ -2113,9 +2113,9 @@ sections: columns: [Element, Convention, Example] instruction: Only include if deviating from Unity defaults examples: - - "| MonoBehaviour | PascalCase + Component suffix | PlayerController, HealthSystem |" - - "| ScriptableObject | PascalCase + Data/Config suffix | PlayerData, GameConfig |" - - "| Prefab | PascalCase descriptive | PlayerCharacter, EnvironmentTile |" + - '| MonoBehaviour | PascalCase + Component suffix | PlayerController, HealthSystem |' + - '| ScriptableObject | PascalCase + Data/Config suffix | PlayerData, GameConfig |' + - '| Prefab | PascalCase descriptive | PlayerCharacter, EnvironmentTile |' - id: critical-rules title: Critical Unity Rules instruction: | @@ -2127,7 +2127,7 @@ sections: Avoid obvious rules like "follow SOLID principles" or "optimize performance" repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' - id: unity-specifics title: Unity-Specific Guidelines condition: Critical Unity-specific rules needed @@ -2136,7 +2136,7 @@ sections: - id: unity-lifecycle title: Unity Lifecycle Rules repeatable: true - template: "- **{{lifecycle_method}}:** {{usage_rule}}" + template: '- **{{lifecycle_method}}:** {{usage_rule}}' - id: test-strategy title: Test Strategy and Standards @@ -3698,7 +3698,7 @@ Use the `shard-doc` task or `@kayvan/markdown-tree-parser` tool for automatic ga - **Claude Code**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Cursor**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` -- **Windsurf**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` +- **Windsurf**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Trae**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` - **Roo Code**: Select mode from mode selector with bmad2du prefix - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select the appropriate game agent. diff --git a/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt b/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt index 81f1a105..208c76f3 100644 --- a/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt +++ b/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt @@ -1175,7 +1175,7 @@ template: output: format: markdown filename: docs/game-design-document.md - title: "{{game_title}} Game Design Document (GDD)" + title: '{{game_title}} Game Design Document (GDD)' workflow: mode: interactive @@ -1223,8 +1223,8 @@ sections: **Primary:** {{age_range}}, {{player_type}}, {{platform_preference}} **Secondary:** {{secondary_audience}} examples: - - "Primary: Ages 8-16, casual mobile gamers, prefer short play sessions" - - "Secondary: Adult puzzle enthusiasts, educators looking for teaching tools" + - 'Primary: Ages 8-16, casual mobile gamers, prefer short play sessions' + - 'Secondary: Adult puzzle enthusiasts, educators looking for teaching tools' - id: platform-technical title: Platform & Technical Requirements instruction: Based on the technical preferences or user input, define the target platforms and Unity-specific requirements @@ -1235,7 +1235,7 @@ sections: **Screen Support:** {{resolution_range}} **Build Targets:** {{build_targets}} examples: - - "Primary Platform: Mobile (iOS/Android), Engine: Unity 2022.3 LTS & C#, Performance: 60 FPS on iPhone 8/Galaxy S8" + - 'Primary Platform: Mobile (iOS/Android), Engine: Unity 2022.3 LTS & C#, Performance: 60 FPS on iPhone 8/Galaxy S8' - id: unique-selling-points title: Unique Selling Points instruction: List 3-5 key features that differentiate this game from competitors @@ -1265,7 +1265,7 @@ sections: instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions for Unity implementation. template: | **Primary Loop ({{duration}} seconds):** - + 1. {{action_1}} ({{time_1}}s) - {{unity_component}} 2. {{action_2}} ({{time_2}}s) - {{unity_component}} 3. {{action_3}} ({{time_3}}s) - {{unity_component}} @@ -1277,17 +1277,17 @@ sections: instruction: Clearly define success and failure states with Unity-specific implementation notes template: | **Victory Conditions:** - + - {{win_condition_1}} - Unity Event: {{unity_event}} - {{win_condition_2}} - Unity Event: {{unity_event}} - + **Failure States:** - + - {{loss_condition_1}} - Trigger: {{unity_trigger}} - {{loss_condition_2}} - Trigger: {{unity_trigger}} examples: - - "Victory: Player reaches exit portal - Unity Event: OnTriggerEnter2D with Portal tag" - - "Failure: Health reaches zero - Trigger: Health component value <= 0" + - 'Victory: Player reaches exit portal - Unity Event: OnTriggerEnter2D with Portal tag' + - 'Failure: Health reaches zero - Trigger: Health component value <= 0' - id: game-mechanics title: Game Mechanics @@ -1299,30 +1299,30 @@ sections: repeatable: true sections: - id: mechanic - title: "{{mechanic_name}}" + title: '{{mechanic_name}}' template: | **Description:** {{detailed_description}} - + **Player Input:** {{input_method}} - Unity Input System: {{input_action}} - + **System Response:** {{game_response}} - + **Unity Implementation Notes:** - + - **Components Needed:** {{component_list}} - **Physics Requirements:** {{physics_2d_setup}} - **Animation States:** {{animator_states}} - **Performance Considerations:** {{optimization_notes}} - + **Dependencies:** {{other_mechanics_needed}} - + **Script Architecture:** - + - {{script_name}}.cs - {{responsibility}} - {{manager_script}}.cs - {{management_role}} examples: - - "Components Needed: Rigidbody2D, BoxCollider2D, PlayerMovement script" - - "Physics Requirements: 2D Physics material for ground friction, Gravity scale 3" + - 'Components Needed: Rigidbody2D, BoxCollider2D, PlayerMovement script' + - 'Physics Requirements: 2D Physics material for ground friction, Gravity scale 3' - id: controls title: Controls instruction: Define all input methods for different platforms using Unity's Input System @@ -1343,15 +1343,15 @@ sections: title: Player Progression template: | **Progression Type:** {{linear|branching|metroidvania}} - + **Key Milestones:** - + 1. **{{milestone_1}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} 2. **{{milestone_2}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} 3. **{{milestone_3}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} - + **Save Data Structure:** - + ```csharp [System.Serializable] public class PlayerProgress @@ -1367,17 +1367,17 @@ sections: template: | **Tutorial Phase:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Early Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Mid Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Late Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} examples: - - "enemy speed: 2.0f, jump height: 4.5f, obstacle density: 0.3f" + - 'enemy speed: 2.0f, jump height: 4.5f, obstacle density: 0.3f' - id: economy-resources title: Economy & Resources condition: has_economy @@ -1400,31 +1400,31 @@ sections: repeatable: true sections: - id: level-type - title: "{{level_type_name}}" + title: '{{level_type_name}}' template: | **Purpose:** {{gameplay_purpose}} **Target Duration:** {{target_time}} **Key Elements:** {{required_mechanics}} **Difficulty Rating:** {{relative_difficulty}} - + **Unity Scene Structure:** - + - **Environment:** {{tilemap_setup}} - **Gameplay Objects:** {{prefab_list}} - **Lighting:** {{lighting_setup}} - **Audio:** {{audio_sources}} - + **Level Flow Template:** - + - **Introduction:** {{intro_description}} - Area: {{unity_area_bounds}} - **Challenge:** {{main_challenge}} - Mechanics: {{active_components}} - **Resolution:** {{completion_requirement}} - Trigger: {{completion_trigger}} - + **Reusable Prefabs:** - + - {{prefab_name}} - {{prefab_purpose}} examples: - - "Environment: TilemapRenderer with Platform tileset, Lighting: 2D Global Light + Point Lights" + - 'Environment: TilemapRenderer with Platform tileset, Lighting: 2D Global Light + Point Lights' - id: level-progression title: Level Progression template: | @@ -1432,14 +1432,14 @@ sections: **Total Levels:** {{number}} **Unlock Pattern:** {{progression_method}} **Scene Management:** {{unity_scene_loading}} - + **Unity Scene Organization:** - + - Scene Naming: {{naming_convention}} - Addressable Assets: {{addressable_groups}} - Loading Screens: {{loading_implementation}} examples: - - "Scene Naming: World{X}_Level{Y}_Name, Addressable Groups: Levels_World1, World_Environments" + - 'Scene Naming: World{X}_Level{Y}_Name, Addressable Groups: Levels_World1, World_Environments' - id: technical-specifications title: Technical Specifications @@ -1459,19 +1459,19 @@ sections: **Physics:** {{2D Only|3D Only|Hybrid}} **Scripting Backend:** {{Mono|IL2CPP}} **API Compatibility:** {{.NET Standard 2.1|.NET Framework}} - + **Required Packages:** - + - {{package_name}} {{version}} - {{purpose}} - + **Project Settings:** - + - Color Space: {{Linear|Gamma}} - Quality Settings: {{quality_levels}} - Physics Settings: {{physics_config}} examples: - com.unity.addressables 1.20.5 - Asset loading and memory management - - "Color Space: Linear, Quality: Mobile/Desktop presets, Gravity: -20" + - 'Color Space: Linear, Quality: Mobile/Desktop presets, Gravity: -20' - id: performance-requirements title: Performance Requirements template: | @@ -1479,64 +1479,64 @@ sections: **Memory Usage:** <{{memory_limit}}MB heap, <{{texture_memory}}MB textures **Load Times:** <{{load_time}}s initial, <{{level_load}}s between levels **Battery Usage:** Optimized for mobile devices - {{battery_target}} hours gameplay - + **Unity Profiler Targets:** - + - CPU Frame Time: <{{cpu_time}}ms - GPU Frame Time: <{{gpu_time}}ms - GC Allocs: <{{gc_limit}}KB per frame - Draw Calls: <{{draw_calls}} per frame examples: - - "60 FPS (minimum 30), CPU: <16.67ms, GPU: <16.67ms, GC: <4KB, Draws: <50" + - '60 FPS (minimum 30), CPU: <16.67ms, GPU: <16.67ms, GC: <4KB, Draws: <50' - id: platform-specific title: Platform Specific Requirements template: | **Desktop:** - + - Resolution: {{min_resolution}} - {{max_resolution}} - Input: Keyboard, Mouse, Gamepad ({{gamepad_support}}) - Build Target: {{desktop_targets}} - + **Mobile:** - + - Resolution: {{mobile_min}} - {{mobile_max}} - Input: Touch, Accelerometer ({{sensor_support}}) - OS: iOS {{ios_min}}+, Android {{android_min}}+ (API {{api_level}}) - Device Requirements: {{device_specs}} - + **Web (if applicable):** - + - WebGL Version: {{webgl_version}} - Browser Support: {{browser_list}} - Compression: {{compression_format}} examples: - - "Resolution: 1280x720 - 4K, Gamepad: Xbox/PlayStation controllers via Input System" + - 'Resolution: 1280x720 - 4K, Gamepad: Xbox/PlayStation controllers via Input System' - id: asset-requirements title: Asset Requirements instruction: Define asset specifications for Unity pipeline optimization template: | **2D Art Assets:** - + - Sprites: {{sprite_resolution}} at {{ppu}} PPU - Texture Format: {{texture_compression}} - Atlas Strategy: {{sprite_atlas_setup}} - Animation: {{animation_type}} at {{framerate}} FPS - + **Audio Assets:** - + - Music: {{audio_format}} at {{sample_rate}} Hz - SFX: {{sfx_format}} at {{sfx_sample_rate}} Hz - Compression: {{audio_compression}} - 3D Audio: {{spatial_audio}} - + **UI Assets:** - + - Canvas Resolution: {{ui_resolution}} - UI Scale Mode: {{scale_mode}} - Font: {{font_requirements}} - Icon Sizes: {{icon_specifications}} examples: - - "Sprites: 32x32 to 256x256 at 16 PPU, Format: RGBA32 for quality/RGBA16 for performance" + - 'Sprites: 32x32 to 256x256 at 16 PPU, Format: RGBA32 for quality/RGBA16 for performance' - id: technical-architecture-requirements title: Technical Architecture Requirements @@ -1551,17 +1551,17 @@ sections: title: Code Architecture Pattern template: | **Architecture Pattern:** {{MVC|MVVM|ECS|Component-Based|Custom}} - + **Core Systems Required:** - + - **Scene Management:** {{scene_manager_approach}} - **State Management:** {{state_pattern_implementation}} - **Event System:** {{event_system_choice}} - **Object Pooling:** {{pooling_strategy}} - **Save/Load System:** {{save_system_approach}} - + **Folder Structure:** - + ``` Assets/ ├── _Project/ @@ -1571,62 +1571,62 @@ sections: │ ├── Scenes/ │ └── {{additional_folders}} ``` - + **Naming Conventions:** - + - Scripts: {{script_naming}} - Prefabs: {{prefab_naming}} - Scenes: {{scene_naming}} examples: - - "Architecture: Component-Based with ScriptableObject data containers" - - "Scripts: PascalCase (PlayerController), Prefabs: Player_Prefab, Scenes: Level_01_Forest" + - 'Architecture: Component-Based with ScriptableObject data containers' + - 'Scripts: PascalCase (PlayerController), Prefabs: Player_Prefab, Scenes: Level_01_Forest' - id: unity-systems-integration title: Unity Systems Integration template: | **Required Unity Systems:** - + - **Input System:** {{input_implementation}} - **Animation System:** {{animation_approach}} - **Physics Integration:** {{physics_usage}} - **Rendering Features:** {{rendering_requirements}} - **Asset Streaming:** {{asset_loading_strategy}} - + **Third-Party Integrations:** - + - {{integration_name}}: {{integration_purpose}} - + **Performance Systems:** - + - **Profiling Integration:** {{profiling_setup}} - **Memory Management:** {{memory_strategy}} - **Build Pipeline:** {{build_automation}} examples: - - "Input System: Action Maps for Menu/Gameplay contexts with device switching" - - "DOTween: Smooth UI transitions and gameplay animations" + - 'Input System: Action Maps for Menu/Gameplay contexts with device switching' + - 'DOTween: Smooth UI transitions and gameplay animations' - id: data-management title: Data Management template: | **Save Data Architecture:** - + - **Format:** {{PlayerPrefs|JSON|Binary|Cloud}} - **Structure:** {{save_data_organization}} - **Encryption:** {{security_approach}} - **Cloud Sync:** {{cloud_integration}} - + **Configuration Data:** - + - **ScriptableObjects:** {{scriptable_object_usage}} - **Settings Management:** {{settings_system}} - **Localization:** {{localization_approach}} - + **Runtime Data:** - + - **Caching Strategy:** {{cache_implementation}} - **Memory Pools:** {{pooling_objects}} - **Asset References:** {{asset_reference_system}} examples: - - "Save Data: JSON format with AES encryption, stored in persistent data path" - - "ScriptableObjects: Game settings, level configurations, character data" + - 'Save Data: JSON format with AES encryption, stored in persistent data path' + - 'ScriptableObjects: Game settings, level configurations, character data' - id: development-phases title: Development Phases & Epic Planning @@ -1638,15 +1638,15 @@ sections: instruction: Present a high-level list of all phases for user approval. Each phase's design should deliver significant Unity functionality. type: numbered-list examples: - - "Phase 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management" - - "Phase 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop" - - "Phase 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression" - - "Phase 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment" + - 'Phase 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management' + - 'Phase 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop' + - 'Phase 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression' + - 'Phase 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment' - id: phase-1-foundation - title: "Phase 1: Unity Foundation & Core Systems ({{duration}})" + title: 'Phase 1: Unity Foundation & Core Systems ({{duration}})' sections: - id: foundation-design - title: "Design: Unity Project Foundation" + title: 'Design: Unity Project Foundation' type: bullet-list template: | - Unity project setup with proper folder structure and naming conventions @@ -1656,9 +1656,9 @@ sections: - Development tools setup (debugging, profiling integration) - Initial build pipeline and platform configuration examples: - - "Input System: Configure PlayerInput component with Action Maps for movement and UI" + - 'Input System: Configure PlayerInput component with Action Maps for movement and UI' - id: core-systems-design - title: "Design: Essential Game Systems" + title: 'Design: Essential Game Systems' type: bullet-list template: | - Save/Load system implementation with {{save_format}} format @@ -1668,10 +1668,10 @@ sections: - Basic UI framework and canvas configuration - Settings and configuration management with ScriptableObjects - id: phase-2-gameplay - title: "Phase 2: Core Gameplay Implementation ({{duration}})" + title: 'Phase 2: Core Gameplay Implementation ({{duration}})' sections: - id: gameplay-mechanics-design - title: "Design: Primary Game Mechanics" + title: 'Design: Primary Game Mechanics' type: bullet-list template: | - Player controller with {{movement_type}} movement system @@ -1681,7 +1681,7 @@ sections: - Basic collision detection and response systems - Animation system integration with Animator controllers - id: level-systems-design - title: "Design: Level & Content Systems" + title: 'Design: Level & Content Systems' type: bullet-list template: | - Scene loading and transition system @@ -1691,10 +1691,10 @@ sections: - Collectibles and pickup systems - Victory/defeat condition implementation - id: phase-3-polish - title: "Phase 3: Polish & Optimization ({{duration}})" + title: 'Phase 3: Polish & Optimization ({{duration}})' sections: - id: performance-design - title: "Design: Performance & Platform Optimization" + title: 'Design: Performance & Platform Optimization' type: bullet-list template: | - Unity Profiler analysis and optimization passes @@ -1704,7 +1704,7 @@ sections: - Build size optimization and asset bundling - Quality settings configuration for different device tiers - id: user-experience-design - title: "Design: User Experience & Polish" + title: 'Design: User Experience & Polish' type: bullet-list template: | - Complete UI/UX implementation with responsive design @@ -1729,10 +1729,10 @@ sections: - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. elicit: true examples: - - "Epic 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management" - - "Epic 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop" - - "Epic 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression" - - "Epic 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment" + - 'Epic 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management' + - 'Epic 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop' + - 'Epic 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression' + - 'Epic 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment' - id: epic-details title: Epic {{epic_number}} {{epic_title}} @@ -1754,13 +1754,13 @@ sections: - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained - If a story seems complex, break it down further as long as it can deliver a vertical slice elicit: true - template: "{{epic_goal}}" + template: '{{epic_goal}}' sections: - id: story title: Story {{epic_number}}.{{story_number}} {{story_title}} repeatable: true instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature and reference the gamearchitecture section for additional implementation and integration specifics. - template: "{{clear_description_of_what_needs_to_be_implemented}}" + template: '{{clear_description_of_what_needs_to_be_implemented}}' sections: - id: acceptance-criteria title: Acceptance Criteria @@ -1770,7 +1770,7 @@ sections: title: Functional Requirements type: checklist items: - - "{{specific_functional_requirement}}" + - '{{specific_functional_requirement}}' - id: technical-requirements title: Technical Requirements type: checklist @@ -1778,14 +1778,14 @@ sections: - Code follows C# best practices - Maintains stable frame rate on target devices - No memory leaks or performance degradation - - "{{specific_technical_requirement}}" + - '{{specific_technical_requirement}}' - id: game-design-requirements title: Game Design Requirements type: checklist items: - - "{{gameplay_requirement_from_gdd}}" - - "{{balance_requirement_if_applicable}}" - - "{{player_experience_requirement}}" + - '{{gameplay_requirement_from_gdd}}' + - '{{balance_requirement_if_applicable}}' + - '{{player_experience_requirement}}' - id: success-metrics title: Success Metrics & Quality Assurance @@ -1803,8 +1803,8 @@ sections: - **Build Size:** Final build <{{size_limit}}MB for mobile, <{{desktop_limit}}MB for desktop - **Battery Life:** Mobile gameplay sessions >{{battery_target}} hours on average device examples: - - "Frame Rate: Consistent 60 FPS with <5% drops below 45 FPS on target hardware" - - "Crash Rate: <0.5% across iOS/Android, <0.1% on desktop platforms" + - 'Frame Rate: Consistent 60 FPS with <5% drops below 45 FPS on target hardware' + - 'Crash Rate: <0.5% across iOS/Android, <0.1% on desktop platforms' - id: gameplay-metrics title: Gameplay & User Engagement Metrics type: bullet-list @@ -1816,8 +1816,8 @@ sections: - **Gameplay Completion:** {{completion_rate}}% complete main game content - **Control Responsiveness:** Input lag <{{input_lag}}ms on all platforms examples: - - "Tutorial Completion: 85% of players complete movement and basic mechanics tutorial" - - "Session Duration: Average 15-20 minutes per session for mobile, 30-45 minutes for desktop" + - 'Tutorial Completion: 85% of players complete movement and basic mechanics tutorial' + - 'Session Duration: Average 15-20 minutes per session for mobile, 30-45 minutes for desktop' - id: platform-specific-metrics title: Platform-Specific Quality Metrics type: table @@ -1848,31 +1848,31 @@ sections: instruction: Provide guidance for the Story Manager (SM) agent on how to break down this GDD into implementable user stories template: | **Epic Prioritization:** {{epic_order_rationale}} - + **Story Sizing Guidelines:** - + - Foundation stories: {{foundation_story_scope}} - Feature stories: {{feature_story_scope}} - Polish stories: {{polish_story_scope}} - + **Unity-Specific Story Considerations:** - + - Each story should result in testable Unity scenes or prefabs - Include specific Unity components and systems in acceptance criteria - Consider cross-platform testing requirements - Account for Unity build and deployment steps examples: - - "Foundation stories: Individual Unity systems (Input, Audio, Scene Management) - 1-2 days each" - - "Feature stories: Complete gameplay mechanics with UI and feedback - 2-4 days each" + - 'Foundation stories: Individual Unity systems (Input, Audio, Scene Management) - 1-2 days each' + - 'Feature stories: Complete gameplay mechanics with UI and feedback - 2-4 days each' - id: recommended-agents title: Recommended BMad Agent Sequence type: numbered-list template: | 1. **{{agent_name}}**: {{agent_responsibility}} examples: - - "Unity Architect: Create detailed technical architecture document with specific Unity implementation patterns" - - "Unity Developer: Implement core systems and gameplay mechanics according to architecture" - - "QA Tester: Validate performance metrics and cross-platform functionality" + - 'Unity Architect: Create detailed technical architecture document with specific Unity implementation patterns' + - 'Unity Developer: Implement core systems and gameplay mechanics according to architecture' + - 'QA Tester: Validate performance metrics and cross-platform functionality' ==================== END: .bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml ==================== ==================== START: .bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml ==================== @@ -1883,7 +1883,7 @@ template: output: format: markdown filename: docs/level-design-document.md - title: "{{game_title}} Level Design Document" + title: '{{game_title}} Level Design Document' workflow: mode: interactive @@ -1892,7 +1892,7 @@ sections: - id: initial-setup instruction: | This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. - id: introduction @@ -1900,7 +1900,7 @@ sections: instruction: Establish the purpose and scope of level design for this game content: | This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. sections: - id: change-log @@ -1944,32 +1944,32 @@ sections: repeatable: true sections: - id: level-category - title: "{{category_name}} Levels" + title: '{{category_name}} Levels' template: | **Purpose:** {{gameplay_purpose}} - + **Target Duration:** {{min_time}} - {{max_time}} minutes - + **Difficulty Range:** {{difficulty_scale}} - + **Key Mechanics Featured:** - + - {{mechanic_1}} - {{usage_description}} - {{mechanic_2}} - {{usage_description}} - + **Player Objectives:** - + - Primary: {{primary_objective}} - Secondary: {{secondary_objective}} - Hidden: {{secret_objective}} - + **Success Criteria:** - + - {{completion_requirement_1}} - {{completion_requirement_2}} - + **Technical Requirements:** - + - Maximum entities: {{entity_limit}} - Performance target: {{fps_target}} FPS - Memory budget: {{memory_limit}}MB @@ -1984,11 +1984,11 @@ sections: instruction: Based on GDD requirements, define the overall level organization template: | **Organization Type:** {{linear|hub_world|open_world}} - + **Total Level Count:** {{number}} - + **World Breakdown:** - + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} @@ -2023,7 +2023,7 @@ sections: instruction: Define how players access new levels template: | **Progression Gates:** - + - Linear progression: Complete previous level - Star requirements: {{star_count}} stars to unlock - Skill gates: Demonstrate {{skill_requirement}} @@ -2038,17 +2038,17 @@ sections: instruction: Define all environmental components that can be used in levels template: | **Terrain Types:** - + - {{terrain_1}}: {{properties_and_usage}} - {{terrain_2}}: {{properties_and_usage}} - + **Interactive Objects:** - + - {{object_1}}: {{behavior_and_purpose}} - {{object_2}}: {{behavior_and_purpose}} - + **Hazards and Obstacles:** - + - {{hazard_1}}: {{damage_and_behavior}} - {{hazard_2}}: {{damage_and_behavior}} - id: collectibles-rewards @@ -2056,18 +2056,18 @@ sections: instruction: Define all collectible items and their placement rules template: | **Collectible Types:** - + - {{collectible_1}}: {{value_and_purpose}} - {{collectible_2}}: {{value_and_purpose}} - + **Placement Guidelines:** - + - Mandatory collectibles: {{placement_rules}} - Optional collectibles: {{placement_rules}} - Secret collectibles: {{placement_rules}} - + **Reward Distribution:** - + - Easy to find: {{percentage}}% - Moderate challenge: {{percentage}}% - High skill required: {{percentage}}% @@ -2076,18 +2076,18 @@ sections: instruction: Define how enemies should be placed and balanced in levels template: | **Enemy Categories:** - + - {{enemy_type_1}}: {{behavior_and_usage}} - {{enemy_type_2}}: {{behavior_and_usage}} - + **Placement Principles:** - + - Introduction encounters: {{guideline}} - Standard encounters: {{guideline}} - Challenge encounters: {{guideline}} - + **Difficulty Scaling:** - + - Enemy count progression: {{scaling_rule}} - Enemy type introduction: {{pacing_rule}} - Encounter complexity: {{complexity_rule}} @@ -2100,14 +2100,14 @@ sections: title: Level Layout Principles template: | **Spatial Design:** - + - Grid size: {{grid_dimensions}} - Minimum path width: {{width_units}} - Maximum vertical distance: {{height_units}} - Safe zones placement: {{safety_guidelines}} - + **Navigation Design:** - + - Clear path indication: {{visual_cues}} - Landmark placement: {{landmark_rules}} - Dead end avoidance: {{dead_end_policy}} @@ -2117,13 +2117,13 @@ sections: instruction: Define how to control the rhythm and pace of gameplay within levels template: | **Action Sequences:** - + - High intensity duration: {{max_duration}} - Rest period requirement: {{min_rest_time}} - Intensity variation: {{pacing_pattern}} - + **Learning Sequences:** - + - New mechanic introduction: {{teaching_method}} - Practice opportunity: {{practice_duration}} - Skill application: {{application_context}} @@ -2132,14 +2132,14 @@ sections: instruction: Define how to create appropriate challenges for each level type template: | **Challenge Types:** - + - Execution challenges: {{skill_requirements}} - Puzzle challenges: {{complexity_guidelines}} - Time challenges: {{time_pressure_rules}} - Resource challenges: {{resource_management}} - + **Difficulty Calibration:** - + - Skill check frequency: {{frequency_guidelines}} - Failure recovery: {{retry_mechanics}} - Hint system integration: {{help_system}} @@ -2153,7 +2153,7 @@ sections: instruction: Define how level data should be structured for implementation template: | **Level File Format:** - + - Data format: {{json|yaml|custom}} - File naming: `level_{{world}}_{{number}}.{{extension}}` - Data organization: {{structure_description}} @@ -2191,14 +2191,14 @@ sections: instruction: Define how level assets are organized and loaded template: | **Tilemap Requirements:** - + - Tile size: {{tile_dimensions}}px - Tileset organization: {{tileset_structure}} - Layer organization: {{layer_system}} - Collision data: {{collision_format}} - + **Audio Integration:** - + - Background music: {{music_requirements}} - Ambient sounds: {{ambient_system}} - Dynamic audio: {{dynamic_audio_rules}} @@ -2207,19 +2207,19 @@ sections: instruction: Define performance requirements for level systems template: | **Entity Limits:** - + - Maximum active entities: {{entity_limit}} - Maximum particles: {{particle_limit}} - Maximum audio sources: {{audio_limit}} - + **Memory Management:** - + - Texture memory budget: {{texture_memory}}MB - Audio memory budget: {{audio_memory}}MB - Level loading time: <{{load_time}}s - + **Culling and LOD:** - + - Off-screen culling: {{culling_distance}} - Level-of-detail rules: {{lod_system}} - Asset streaming: {{streaming_requirements}} @@ -2232,13 +2232,13 @@ sections: title: Automated Testing template: | **Performance Testing:** - + - Frame rate validation: Maintain {{fps_target}} FPS - Memory usage monitoring: Stay under {{memory_limit}}MB - Loading time verification: Complete in <{{load_time}}s - + **Gameplay Testing:** - + - Completion path validation: All objectives achievable - Collectible accessibility: All items reachable - Softlock prevention: No unwinnable states @@ -2266,14 +2266,14 @@ sections: title: Balance Validation template: | **Metrics Collection:** - + - Completion rate: Target {{completion_percentage}}% - Average completion time: {{target_time}} ± {{variance}} - Death count per level: <{{max_deaths}} - Collectible discovery rate: {{discovery_percentage}}% - + **Iteration Guidelines:** - + - Adjustment criteria: {{criteria_for_changes}} - Testing sample size: {{minimum_testers}} - Validation period: {{testing_duration}} @@ -2286,14 +2286,14 @@ sections: title: Design Phase template: | **Concept Development:** - + 1. Define level purpose and goals 2. Create rough layout sketch 3. Identify key mechanics and challenges 4. Estimate difficulty and duration - + **Documentation Requirements:** - + - Level design brief - Layout diagrams - Mechanic integration notes @@ -2302,15 +2302,15 @@ sections: title: Implementation Phase template: | **Technical Implementation:** - + 1. Create level data file 2. Build tilemap and layout 3. Place entities and objects 4. Configure level logic and triggers 5. Integrate audio and visual effects - + **Quality Assurance:** - + 1. Automated testing execution 2. Internal playtesting 3. Performance validation @@ -2319,14 +2319,14 @@ sections: title: Integration Phase template: | **Game Integration:** - + 1. Level progression integration 2. Save system compatibility 3. Analytics integration 4. Achievement system integration - + **Final Validation:** - + 1. Full game context testing 2. Performance regression testing 3. Platform compatibility verification @@ -2370,7 +2370,7 @@ template: output: format: markdown filename: docs/game-brief.md - title: "{{game_title}} Game Brief" + title: '{{game_title}} Game Brief' workflow: mode: interactive @@ -2379,7 +2379,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. - id: game-vision @@ -2436,7 +2436,7 @@ sections: repeatable: true template: | **Core Mechanic: {{mechanic_name}}** - + - **Description:** {{how_it_works}} - **Player Value:** {{why_its_fun}} - **Implementation Scope:** {{complexity_estimate}} @@ -2463,12 +2463,12 @@ sections: title: Technical Constraints template: | **Platform Requirements:** - + - Primary: {{platform_1}} - {{requirements}} - Secondary: {{platform_2}} - {{requirements}} - + **Technical Specifications:** - + - Engine: Unity & C# - Performance Target: {{fps_target}} FPS on {{target_device}} - Memory Budget: <{{memory_limit}}MB @@ -2506,10 +2506,10 @@ sections: title: Competitive Analysis template: | **Direct Competitors:** - + - {{competitor_1}}: {{strengths_and_weaknesses}} - {{competitor_2}}: {{strengths_and_weaknesses}} - + **Differentiation Strategy:** {{how_we_differ_and_why_thats_valuable}} - id: market-opportunity @@ -2533,16 +2533,16 @@ sections: title: Content Categories template: | **Core Content:** - + - {{content_type_1}}: {{quantity_and_description}} - {{content_type_2}}: {{quantity_and_description}} - + **Optional Content:** - + - {{optional_content_type}}: {{quantity_and_description}} - + **Replay Elements:** - + - {{replayability_features}} - id: difficulty-accessibility title: Difficulty and Accessibility @@ -2609,13 +2609,13 @@ sections: title: Player Experience Metrics template: | **Engagement Goals:** - + - Tutorial completion rate: >{{percentage}}% - Average session length: {{duration}} minutes - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - + **Quality Benchmarks:** - + - Player satisfaction: >{{rating}}/10 - Completion rate: >{{percentage}}% - Technical performance: {{fps_target}} FPS consistent @@ -2623,13 +2623,13 @@ sections: title: Development Metrics template: | **Technical Targets:** - + - Zero critical bugs at launch - Performance targets met on all platforms - Load times under {{seconds}}s - + **Process Goals:** - + - Development timeline adherence - Feature scope completion - Quality assurance standards @@ -2638,7 +2638,7 @@ sections: condition: has_business_goals template: | **Commercial Goals:** - + - {{revenue_target}} in first {{time_period}} - {{user_acquisition_target}} players in first {{time_period}} - {{retention_target}} monthly active users @@ -2656,21 +2656,21 @@ sections: title: Development Roadmap sections: - id: phase-1-preproduction - title: "Phase 1: Pre-Production ({{duration}})" + title: 'Phase 1: Pre-Production ({{duration}})' type: bullet-list template: | - Detailed Game Design Document creation - Technical architecture planning - Art style exploration and pipeline setup - id: phase-2-prototype - title: "Phase 2: Prototype ({{duration}})" + title: 'Phase 2: Prototype ({{duration}})' type: bullet-list template: | - Core mechanic implementation - Technical proof of concept - Initial playtesting and iteration - id: phase-3-production - title: "Phase 3: Production ({{duration}})" + title: 'Phase 3: Production ({{duration}})' type: bullet-list template: | - Full feature development @@ -2691,12 +2691,12 @@ sections: title: Validation Plan template: | **Concept Testing:** - + - {{validation_method_1}} - {{timeline}} - {{validation_method_2}} - {{timeline}} - + **Prototype Testing:** - + - {{testing_approach}} - {{timeline}} - {{feedback_collection_method}} - {{timeline}} @@ -3384,7 +3384,7 @@ Use the `shard-doc` task or `@kayvan/markdown-tree-parser` tool for automatic ga - **Claude Code**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Cursor**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` -- **Windsurf**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` +- **Windsurf**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Trae**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` - **Roo Code**: Select mode from mode selector with bmad2du prefix - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select the appropriate game agent. diff --git a/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.txt b/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.txt index d1987ffb..2452b85d 100644 --- a/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.txt +++ b/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.txt @@ -514,8 +514,8 @@ template: version: 3.0 output: format: markdown - filename: "stories/{{epic_name}}/{{story_id}}-{{story_name}}.md" - title: "Story: {{story_title}}" + filename: 'stories/{{epic_name}}/{{story_id}}-{{story_name}}.md' + title: 'Story: {{story_title}}' workflow: mode: interactive @@ -524,13 +524,13 @@ sections: - id: initial-setup instruction: | This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. - + Before starting, ensure you have access to: - + - Game Design Document (GDD) - Game Architecture Document - Any existing stories in this epic - + The story should be specific enough that a developer can implement it without requiring additional design decisions. - id: story-header @@ -544,7 +544,7 @@ sections: - id: description title: Description instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature. - template: "{{clear_description_of_what_needs_to_be_implemented}}" + template: '{{clear_description_of_what_needs_to_be_implemented}}' - id: acceptance-criteria title: Acceptance Criteria @@ -554,7 +554,7 @@ sections: title: Functional Requirements type: checklist items: - - "{{specific_functional_requirement}}" + - '{{specific_functional_requirement}}' - id: technical-requirements title: Technical Requirements type: checklist @@ -562,14 +562,14 @@ sections: - Code follows C# best practices - Maintains stable frame rate on target devices - No memory leaks or performance degradation - - "{{specific_technical_requirement}}" + - '{{specific_technical_requirement}}' - id: game-design-requirements title: Game Design Requirements type: checklist items: - - "{{gameplay_requirement_from_gdd}}" - - "{{balance_requirement_if_applicable}}" - - "{{player_experience_requirement}}" + - '{{gameplay_requirement_from_gdd}}' + - '{{balance_requirement_if_applicable}}' + - '{{player_experience_requirement}}' - id: technical-specifications title: Technical Specifications @@ -579,12 +579,12 @@ sections: title: Files to Create/Modify template: | **New Files:** - + - `{{file_path_1}}` - {{purpose}} - `{{file_path_2}}` - {{purpose}} - + **Modified Files:** - + - `{{existing_file_1}}` - {{changes_needed}} - `{{existing_file_2}}` - {{changes_needed}} - id: class-interface-definitions @@ -667,13 +667,13 @@ sections: instruction: Reference the specific sections of the GDD that this story implements template: | **GDD Reference:** {{section_name}} ({{page_or_section_number}}) - + **Game Mechanic:** {{mechanic_name}} - + **Player Experience Goal:** {{experience_description}} - + **Balance Parameters:** - + - {{parameter_1}}: {{value_or_range}} - {{parameter_2}}: {{value_or_range}} @@ -720,15 +720,15 @@ sections: instruction: List any dependencies that must be completed before this story can be implemented template: | **Story Dependencies:** - + - {{story_id}}: {{dependency_description}} - + **Technical Dependencies:** - + - {{system_or_file}}: {{requirement}} - + **Asset Dependencies:** - + - {{asset_type}}: {{asset_description}} - Location: `{{asset_path}}` @@ -744,24 +744,24 @@ sections: - Performance targets met - No C# compiler errors or warnings - Documentation updated - - "{{game_specific_dod_item}}" + - '{{game_specific_dod_item}}' - id: notes title: Notes instruction: Any additional context, design decisions, or implementation notes template: | **Implementation Notes:** - + - {{note_1}} - {{note_2}} - + **Design Decisions:** - + - {{decision_1}}: {{rationale}} - {{decision_2}}: {{rationale}} - + **Future Considerations:** - + - {{future_enhancement_1}} - {{future_optimization_1}} ==================== END: .bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml ==================== diff --git a/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt b/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt index 57a3ae93..fa7e3bd6 100644 --- a/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt +++ b/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt @@ -484,7 +484,7 @@ dependencies: ==================== START: .bmad-2d-unity-game-dev/tasks/facilitate-brainstorming-session.md ==================== --- docOutputLocation: docs/brainstorming-session-results.md -template: ".bmad-2d-unity-game-dev/templates/brainstorming-output-tmpl.yaml" +template: '.bmad-2d-unity-game-dev/templates/brainstorming-output-tmpl.yaml' --- # Facilitate Brainstorming Session Task @@ -1472,35 +1472,35 @@ template: output: format: markdown filename: docs/brief.md - title: "Project Brief: {{project_name}}" + title: 'Project Brief: {{project_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Project Brief Elicitation Actions" + title: 'Project Brief Elicitation Actions' options: - - "Expand section with more specific details" - - "Validate against similar successful products" - - "Stress test assumptions with edge cases" - - "Explore alternative solution approaches" - - "Analyze resource/constraint trade-offs" - - "Generate risk mitigation strategies" - - "Challenge scope from MVP minimalist view" - - "Brainstorm creative feature possibilities" - - "If only we had [resource/capability/time]..." - - "Proceed to next section" + - 'Expand section with more specific details' + - 'Validate against similar successful products' + - 'Stress test assumptions with edge cases' + - 'Explore alternative solution approaches' + - 'Analyze resource/constraint trade-offs' + - 'Generate risk mitigation strategies' + - 'Challenge scope from MVP minimalist view' + - 'Brainstorm creative feature possibilities' + - 'If only we had [resource/capability/time]...' + - 'Proceed to next section' sections: - id: introduction instruction: | This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - + Start by asking the user which mode they prefer: - + 1. **Interactive Mode** - Work through each section collaboratively 2. **YOLO Mode** - Generate complete draft for review and refinement - + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. - id: executive-summary @@ -1511,7 +1511,7 @@ sections: - Primary problem being solved - Target market identification - Key value proposition - template: "{{executive_summary_content}}" + template: '{{executive_summary_content}}' - id: problem-statement title: Problem Statement @@ -1521,7 +1521,7 @@ sections: - Impact of the problem (quantify if possible) - Why existing solutions fall short - Urgency and importance of solving this now - template: "{{detailed_problem_description}}" + template: '{{detailed_problem_description}}' - id: proposed-solution title: Proposed Solution @@ -1531,7 +1531,7 @@ sections: - Key differentiators from existing solutions - Why this solution will succeed where others haven't - High-level vision for the product - template: "{{solution_description}}" + template: '{{solution_description}}' - id: target-users title: Target Users @@ -1543,12 +1543,12 @@ sections: - Goals they're trying to achieve sections: - id: primary-segment - title: "Primary User Segment: {{segment_name}}" - template: "{{primary_user_description}}" + title: 'Primary User Segment: {{segment_name}}' + template: '{{primary_user_description}}' - id: secondary-segment - title: "Secondary User Segment: {{segment_name}}" + title: 'Secondary User Segment: {{segment_name}}' condition: Has secondary user segment - template: "{{secondary_user_description}}" + template: '{{secondary_user_description}}' - id: goals-metrics title: Goals & Success Metrics @@ -1557,15 +1557,15 @@ sections: - id: business-objectives title: Business Objectives type: bullet-list - template: "- {{objective_with_metric}}" + template: '- {{objective_with_metric}}' - id: user-success-metrics title: User Success Metrics type: bullet-list - template: "- {{user_metric}}" + template: '- {{user_metric}}' - id: kpis title: Key Performance Indicators (KPIs) type: bullet-list - template: "- {{kpi}}: {{definition_and_target}}" + template: '- {{kpi}}: {{definition_and_target}}' - id: mvp-scope title: MVP Scope @@ -1574,14 +1574,14 @@ sections: - id: core-features title: Core Features (Must Have) type: bullet-list - template: "- **{{feature}}:** {{description_and_rationale}}" + template: '- **{{feature}}:** {{description_and_rationale}}' - id: out-of-scope title: Out of Scope for MVP type: bullet-list - template: "- {{feature_or_capability}}" + template: '- {{feature_or_capability}}' - id: mvp-success-criteria title: MVP Success Criteria - template: "{{mvp_success_definition}}" + template: '{{mvp_success_definition}}' - id: post-mvp-vision title: Post-MVP Vision @@ -1589,13 +1589,13 @@ sections: sections: - id: phase-2-features title: Phase 2 Features - template: "{{next_priority_features}}" + template: '{{next_priority_features}}' - id: long-term-vision title: Long-term Vision - template: "{{one_two_year_vision}}" + template: '{{one_two_year_vision}}' - id: expansion-opportunities title: Expansion Opportunities - template: "{{potential_expansions}}" + template: '{{potential_expansions}}' - id: technical-considerations title: Technical Considerations @@ -1636,7 +1636,7 @@ sections: - id: key-assumptions title: Key Assumptions type: bullet-list - template: "- {{assumption}}" + template: '- {{assumption}}' - id: risks-questions title: Risks & Open Questions @@ -1645,15 +1645,15 @@ sections: - id: key-risks title: Key Risks type: bullet-list - template: "- **{{risk}}:** {{description_and_impact}}" + template: '- **{{risk}}:** {{description_and_impact}}' - id: open-questions title: Open Questions type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: research-areas title: Areas Needing Further Research type: bullet-list - template: "- {{research_topic}}" + template: '- {{research_topic}}' - id: appendices title: Appendices @@ -1670,10 +1670,10 @@ sections: - id: stakeholder-input title: B. Stakeholder Input condition: Has stakeholder feedback - template: "{{stakeholder_feedback}}" + template: '{{stakeholder_feedback}}' - id: references title: C. References - template: "{{relevant_links_and_docs}}" + template: '{{relevant_links_and_docs}}' - id: next-steps title: Next Steps @@ -1681,7 +1681,7 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action_item}}" + template: '{{action_item}}' - id: pm-handoff title: PM Handoff content: | @@ -1696,24 +1696,24 @@ template: output: format: markdown filename: docs/market-research.md - title: "Market Research Report: {{project_product_name}}" + title: 'Market Research Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Market Research Elicitation Actions" + title: 'Market Research Elicitation Actions' options: - - "Expand market sizing calculations with sensitivity analysis" - - "Deep dive into a specific customer segment" - - "Analyze an emerging market trend in detail" - - "Compare this market to an analogous market" - - "Stress test market assumptions" - - "Explore adjacent market opportunities" - - "Challenge market definition and boundaries" - - "Generate strategic scenarios (best/base/worst case)" - - "If only we had considered [X market factor]..." - - "Proceed to next section" + - 'Expand market sizing calculations with sensitivity analysis' + - 'Deep dive into a specific customer segment' + - 'Analyze an emerging market trend in detail' + - 'Compare this market to an analogous market' + - 'Stress test market assumptions' + - 'Explore adjacent market opportunities' + - 'Challenge market definition and boundaries' + - 'Generate strategic scenarios (best/base/worst case)' + - 'If only we had considered [X market factor]...' + - 'Proceed to next section' sections: - id: executive-summary @@ -1795,7 +1795,7 @@ sections: repeatable: true sections: - id: segment - title: "Segment {{segment_number}}: {{segment_name}}" + title: 'Segment {{segment_number}}: {{segment_name}}' template: | - **Description:** {{brief_overview}} - **Size:** {{number_of_customers_market_value}} @@ -1821,7 +1821,7 @@ sections: instruction: Map the end-to-end customer experience for primary segments template: | For primary customer segment: - + 1. **Awareness:** {{discovery_process}} 2. **Consideration:** {{evaluation_criteria}} 3. **Purchase:** {{decision_triggers}} @@ -1864,20 +1864,20 @@ sections: instruction: Analyze each force with specific evidence and implications sections: - id: supplier-power - title: "Supplier Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Supplier Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: buyer-power - title: "Buyer Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Buyer Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: competitive-rivalry - title: "Competitive Rivalry: {{intensity_level}}" - template: "{{analysis_and_implications}}" + title: 'Competitive Rivalry: {{intensity_level}}' + template: '{{analysis_and_implications}}' - id: threat-new-entry - title: "Threat of New Entry: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of New Entry: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: threat-substitutes - title: "Threat of Substitutes: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of Substitutes: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: adoption-lifecycle title: Technology Adoption Lifecycle Stage instruction: | @@ -1895,7 +1895,7 @@ sections: repeatable: true sections: - id: opportunity - title: "Opportunity {{opportunity_number}}: {{name}}" + title: 'Opportunity {{opportunity_number}}: {{name}}' template: | - **Description:** {{what_is_the_opportunity}} - **Size/Potential:** {{quantified_potential}} @@ -1951,24 +1951,24 @@ template: output: format: markdown filename: docs/competitor-analysis.md - title: "Competitive Analysis Report: {{project_product_name}}" + title: 'Competitive Analysis Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Competitive Analysis Elicitation Actions" + title: 'Competitive Analysis Elicitation Actions' options: - "Deep dive on a specific competitor's strategy" - - "Analyze competitive dynamics in a specific segment" - - "War game competitive responses to your moves" - - "Explore partnership vs. competition scenarios" - - "Stress test differentiation claims" - - "Analyze disruption potential (yours or theirs)" - - "Compare to competition in adjacent markets" - - "Generate win/loss analysis insights" + - 'Analyze competitive dynamics in a specific segment' + - 'War game competitive responses to your moves' + - 'Explore partnership vs. competition scenarios' + - 'Stress test differentiation claims' + - 'Analyze disruption potential (yours or theirs)' + - 'Compare to competition in adjacent markets' + - 'Generate win/loss analysis insights' - "If only we had known about [competitor X's plan]..." - - "Proceed to next section" + - 'Proceed to next section' sections: - id: executive-summary @@ -2022,7 +2022,7 @@ sections: title: Competitor Prioritization Matrix instruction: | Help categorize competitors by market share and strategic threat level - + Create a 2x2 matrix: - Priority 1 (Core Competitors): High Market Share + High Threat - Priority 2 (Emerging Threats): Low Market Share + High Threat @@ -2035,7 +2035,7 @@ sections: repeatable: true sections: - id: competitor - title: "{{competitor_name}} - Priority {{priority_level}}" + title: '{{competitor_name}} - Priority {{priority_level}}' sections: - id: company-overview title: Company Overview @@ -2067,11 +2067,11 @@ sections: - id: strengths title: Strengths type: bullet-list - template: "- {{strength}}" + template: '- {{strength}}' - id: weaknesses title: Weaknesses type: bullet-list - template: "- {{weakness}}" + template: '- {{weakness}}' - id: market-position title: Market Position & Performance template: | @@ -2087,24 +2087,37 @@ sections: title: Feature Comparison Matrix instruction: Create a detailed comparison table of key features across competitors type: table - columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + columns: + [ + 'Feature Category', + '{{your_company}}', + '{{competitor_1}}', + '{{competitor_2}}', + '{{competitor_3}}', + ] rows: - - category: "Core Functionality" + - category: 'Core Functionality' items: - - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - category: "User Experience" + - ['Feature A', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - ['Feature B', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - category: 'User Experience' items: - - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] - - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] - - category: "Integration & Ecosystem" + - ['Mobile App', '{{rating}}', '{{rating}}', '{{rating}}', '{{rating}}'] + - ['Onboarding Time', '{{time}}', '{{time}}', '{{time}}', '{{time}}'] + - category: 'Integration & Ecosystem' items: - - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] - - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] - - category: "Pricing & Plans" + - [ + 'API Availability', + '{{availability}}', + '{{availability}}', + '{{availability}}', + '{{availability}}', + ] + - ['Third-party Integrations', '{{number}}', '{{number}}', '{{number}}', '{{number}}'] + - category: 'Pricing & Plans' items: - - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] - - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - ['Starting Price', '{{price}}', '{{price}}', '{{price}}', '{{price}}'] + - ['Free Tier', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}'] - id: swot-comparison title: SWOT Comparison instruction: Create SWOT analysis for your solution vs. top competitors @@ -2117,7 +2130,7 @@ sections: - **Opportunities:** {{opportunities}} - **Threats:** {{threats}} - id: vs-competitor - title: "vs. {{main_competitor}}" + title: 'vs. {{main_competitor}}' template: | - **Competitive Advantages:** {{your_advantages}} - **Competitive Disadvantages:** {{their_advantages}} @@ -2126,7 +2139,7 @@ sections: title: Positioning Map instruction: | Describe competitor positions on key dimensions - + Create a positioning description using 2 key dimensions relevant to the market, such as: - Price vs. Features - Ease of Use vs. Power @@ -2161,7 +2174,7 @@ sections: title: Blue Ocean Opportunities instruction: | Identify uncontested market spaces - + List opportunities to create new market space: - Underserved segments - Unaddressed use cases @@ -2247,7 +2260,7 @@ template: output: format: markdown filename: docs/brainstorming-session-results.md - title: "Brainstorming Session Results" + title: 'Brainstorming Session Results' workflow: mode: non-interactive @@ -2265,45 +2278,45 @@ sections: - id: summary-details template: | **Topic:** {{session_topic}} - + **Session Goals:** {{stated_goals}} - + **Techniques Used:** {{techniques_list}} - + **Total Ideas Generated:** {{total_ideas}} - id: key-themes - title: "Key Themes Identified:" + title: 'Key Themes Identified:' type: bullet-list - template: "- {{theme}}" + template: '- {{theme}}' - id: technique-sessions title: Technique Sessions repeatable: true sections: - id: technique - title: "{{technique_name}} - {{duration}}" + title: '{{technique_name}} - {{duration}}' sections: - id: description - template: "**Description:** {{technique_description}}" + template: '**Description:** {{technique_description}}' - id: ideas-generated - title: "Ideas Generated:" + title: 'Ideas Generated:' type: numbered-list - template: "{{idea}}" + template: '{{idea}}' - id: insights - title: "Insights Discovered:" + title: 'Insights Discovered:' type: bullet-list - template: "- {{insight}}" + template: '- {{insight}}' - id: connections - title: "Notable Connections:" + title: 'Notable Connections:' type: bullet-list - template: "- {{connection}}" + template: '- {{connection}}' - id: idea-categorization title: Idea Categorization sections: - id: immediate-opportunities title: Immediate Opportunities - content: "*Ideas ready to implement now*" + content: '*Ideas ready to implement now*' repeatable: true type: numbered-list template: | @@ -2313,7 +2326,7 @@ sections: - Resources needed: {{requirements}} - id: future-innovations title: Future Innovations - content: "*Ideas requiring development/research*" + content: '*Ideas requiring development/research*' repeatable: true type: numbered-list template: | @@ -2323,7 +2336,7 @@ sections: - Timeline estimate: {{timeline}} - id: moonshots title: Moonshots - content: "*Ambitious, transformative concepts*" + content: '*Ambitious, transformative concepts*' repeatable: true type: numbered-list template: | @@ -2333,9 +2346,9 @@ sections: - Challenges to overcome: {{challenges}} - id: insights-learnings title: Insights & Learnings - content: "*Key realizations from the session*" + content: '*Key realizations from the session*' type: bullet-list - template: "- {{insight}}: {{description_and_implications}}" + template: '- {{insight}}: {{description_and_implications}}' - id: action-planning title: Action Planning @@ -2344,21 +2357,21 @@ sections: title: Top 3 Priority Ideas sections: - id: priority-1 - title: "#1 Priority: {{idea_name}}" + title: '#1 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-2 - title: "#2 Priority: {{idea_name}}" + title: '#2 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-3 - title: "#3 Priority: {{idea_name}}" + title: '#3 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} @@ -2371,19 +2384,19 @@ sections: - id: what-worked title: What Worked Well type: bullet-list - template: "- {{aspect}}" + template: '- {{aspect}}' - id: areas-exploration title: Areas for Further Exploration type: bullet-list - template: "- {{area}}: {{reason}}" + template: '- {{area}}: {{reason}}' - id: recommended-techniques title: Recommended Follow-up Techniques type: bullet-list - template: "- {{technique}}: {{reason}}" + template: '- {{technique}}: {{reason}}' - id: questions-emerged title: Questions That Emerged type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: next-session title: Next Session Planning template: | @@ -2394,7 +2407,7 @@ sections: - id: footer content: | --- - + *Session facilitated using the BMAD-METHOD brainstorming framework* ==================== END: .bmad-2d-unity-game-dev/templates/brainstorming-output-tmpl.yaml ==================== @@ -2857,7 +2870,7 @@ Use the `shard-doc` task or `@kayvan/markdown-tree-parser` tool for automatic ga - **Claude Code**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Cursor**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` -- **Windsurf**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` +- **Windsurf**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Trae**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` - **Roo Code**: Select mode from mode selector with bmad2du prefix - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select the appropriate game agent. @@ -4094,7 +4107,7 @@ template: output: format: markdown filename: docs/game-design-document.md - title: "{{game_title}} Game Design Document (GDD)" + title: '{{game_title}} Game Design Document (GDD)' workflow: mode: interactive @@ -4142,8 +4155,8 @@ sections: **Primary:** {{age_range}}, {{player_type}}, {{platform_preference}} **Secondary:** {{secondary_audience}} examples: - - "Primary: Ages 8-16, casual mobile gamers, prefer short play sessions" - - "Secondary: Adult puzzle enthusiasts, educators looking for teaching tools" + - 'Primary: Ages 8-16, casual mobile gamers, prefer short play sessions' + - 'Secondary: Adult puzzle enthusiasts, educators looking for teaching tools' - id: platform-technical title: Platform & Technical Requirements instruction: Based on the technical preferences or user input, define the target platforms and Unity-specific requirements @@ -4154,7 +4167,7 @@ sections: **Screen Support:** {{resolution_range}} **Build Targets:** {{build_targets}} examples: - - "Primary Platform: Mobile (iOS/Android), Engine: Unity 2022.3 LTS & C#, Performance: 60 FPS on iPhone 8/Galaxy S8" + - 'Primary Platform: Mobile (iOS/Android), Engine: Unity 2022.3 LTS & C#, Performance: 60 FPS on iPhone 8/Galaxy S8' - id: unique-selling-points title: Unique Selling Points instruction: List 3-5 key features that differentiate this game from competitors @@ -4184,7 +4197,7 @@ sections: instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions for Unity implementation. template: | **Primary Loop ({{duration}} seconds):** - + 1. {{action_1}} ({{time_1}}s) - {{unity_component}} 2. {{action_2}} ({{time_2}}s) - {{unity_component}} 3. {{action_3}} ({{time_3}}s) - {{unity_component}} @@ -4196,17 +4209,17 @@ sections: instruction: Clearly define success and failure states with Unity-specific implementation notes template: | **Victory Conditions:** - + - {{win_condition_1}} - Unity Event: {{unity_event}} - {{win_condition_2}} - Unity Event: {{unity_event}} - + **Failure States:** - + - {{loss_condition_1}} - Trigger: {{unity_trigger}} - {{loss_condition_2}} - Trigger: {{unity_trigger}} examples: - - "Victory: Player reaches exit portal - Unity Event: OnTriggerEnter2D with Portal tag" - - "Failure: Health reaches zero - Trigger: Health component value <= 0" + - 'Victory: Player reaches exit portal - Unity Event: OnTriggerEnter2D with Portal tag' + - 'Failure: Health reaches zero - Trigger: Health component value <= 0' - id: game-mechanics title: Game Mechanics @@ -4218,30 +4231,30 @@ sections: repeatable: true sections: - id: mechanic - title: "{{mechanic_name}}" + title: '{{mechanic_name}}' template: | **Description:** {{detailed_description}} - + **Player Input:** {{input_method}} - Unity Input System: {{input_action}} - + **System Response:** {{game_response}} - + **Unity Implementation Notes:** - + - **Components Needed:** {{component_list}} - **Physics Requirements:** {{physics_2d_setup}} - **Animation States:** {{animator_states}} - **Performance Considerations:** {{optimization_notes}} - + **Dependencies:** {{other_mechanics_needed}} - + **Script Architecture:** - + - {{script_name}}.cs - {{responsibility}} - {{manager_script}}.cs - {{management_role}} examples: - - "Components Needed: Rigidbody2D, BoxCollider2D, PlayerMovement script" - - "Physics Requirements: 2D Physics material for ground friction, Gravity scale 3" + - 'Components Needed: Rigidbody2D, BoxCollider2D, PlayerMovement script' + - 'Physics Requirements: 2D Physics material for ground friction, Gravity scale 3' - id: controls title: Controls instruction: Define all input methods for different platforms using Unity's Input System @@ -4262,15 +4275,15 @@ sections: title: Player Progression template: | **Progression Type:** {{linear|branching|metroidvania}} - + **Key Milestones:** - + 1. **{{milestone_1}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} 2. **{{milestone_2}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} 3. **{{milestone_3}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} - + **Save Data Structure:** - + ```csharp [System.Serializable] public class PlayerProgress @@ -4286,17 +4299,17 @@ sections: template: | **Tutorial Phase:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Early Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Mid Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Late Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} examples: - - "enemy speed: 2.0f, jump height: 4.5f, obstacle density: 0.3f" + - 'enemy speed: 2.0f, jump height: 4.5f, obstacle density: 0.3f' - id: economy-resources title: Economy & Resources condition: has_economy @@ -4319,31 +4332,31 @@ sections: repeatable: true sections: - id: level-type - title: "{{level_type_name}}" + title: '{{level_type_name}}' template: | **Purpose:** {{gameplay_purpose}} **Target Duration:** {{target_time}} **Key Elements:** {{required_mechanics}} **Difficulty Rating:** {{relative_difficulty}} - + **Unity Scene Structure:** - + - **Environment:** {{tilemap_setup}} - **Gameplay Objects:** {{prefab_list}} - **Lighting:** {{lighting_setup}} - **Audio:** {{audio_sources}} - + **Level Flow Template:** - + - **Introduction:** {{intro_description}} - Area: {{unity_area_bounds}} - **Challenge:** {{main_challenge}} - Mechanics: {{active_components}} - **Resolution:** {{completion_requirement}} - Trigger: {{completion_trigger}} - + **Reusable Prefabs:** - + - {{prefab_name}} - {{prefab_purpose}} examples: - - "Environment: TilemapRenderer with Platform tileset, Lighting: 2D Global Light + Point Lights" + - 'Environment: TilemapRenderer with Platform tileset, Lighting: 2D Global Light + Point Lights' - id: level-progression title: Level Progression template: | @@ -4351,14 +4364,14 @@ sections: **Total Levels:** {{number}} **Unlock Pattern:** {{progression_method}} **Scene Management:** {{unity_scene_loading}} - + **Unity Scene Organization:** - + - Scene Naming: {{naming_convention}} - Addressable Assets: {{addressable_groups}} - Loading Screens: {{loading_implementation}} examples: - - "Scene Naming: World{X}_Level{Y}_Name, Addressable Groups: Levels_World1, World_Environments" + - 'Scene Naming: World{X}_Level{Y}_Name, Addressable Groups: Levels_World1, World_Environments' - id: technical-specifications title: Technical Specifications @@ -4378,19 +4391,19 @@ sections: **Physics:** {{2D Only|3D Only|Hybrid}} **Scripting Backend:** {{Mono|IL2CPP}} **API Compatibility:** {{.NET Standard 2.1|.NET Framework}} - + **Required Packages:** - + - {{package_name}} {{version}} - {{purpose}} - + **Project Settings:** - + - Color Space: {{Linear|Gamma}} - Quality Settings: {{quality_levels}} - Physics Settings: {{physics_config}} examples: - com.unity.addressables 1.20.5 - Asset loading and memory management - - "Color Space: Linear, Quality: Mobile/Desktop presets, Gravity: -20" + - 'Color Space: Linear, Quality: Mobile/Desktop presets, Gravity: -20' - id: performance-requirements title: Performance Requirements template: | @@ -4398,64 +4411,64 @@ sections: **Memory Usage:** <{{memory_limit}}MB heap, <{{texture_memory}}MB textures **Load Times:** <{{load_time}}s initial, <{{level_load}}s between levels **Battery Usage:** Optimized for mobile devices - {{battery_target}} hours gameplay - + **Unity Profiler Targets:** - + - CPU Frame Time: <{{cpu_time}}ms - GPU Frame Time: <{{gpu_time}}ms - GC Allocs: <{{gc_limit}}KB per frame - Draw Calls: <{{draw_calls}} per frame examples: - - "60 FPS (minimum 30), CPU: <16.67ms, GPU: <16.67ms, GC: <4KB, Draws: <50" + - '60 FPS (minimum 30), CPU: <16.67ms, GPU: <16.67ms, GC: <4KB, Draws: <50' - id: platform-specific title: Platform Specific Requirements template: | **Desktop:** - + - Resolution: {{min_resolution}} - {{max_resolution}} - Input: Keyboard, Mouse, Gamepad ({{gamepad_support}}) - Build Target: {{desktop_targets}} - + **Mobile:** - + - Resolution: {{mobile_min}} - {{mobile_max}} - Input: Touch, Accelerometer ({{sensor_support}}) - OS: iOS {{ios_min}}+, Android {{android_min}}+ (API {{api_level}}) - Device Requirements: {{device_specs}} - + **Web (if applicable):** - + - WebGL Version: {{webgl_version}} - Browser Support: {{browser_list}} - Compression: {{compression_format}} examples: - - "Resolution: 1280x720 - 4K, Gamepad: Xbox/PlayStation controllers via Input System" + - 'Resolution: 1280x720 - 4K, Gamepad: Xbox/PlayStation controllers via Input System' - id: asset-requirements title: Asset Requirements instruction: Define asset specifications for Unity pipeline optimization template: | **2D Art Assets:** - + - Sprites: {{sprite_resolution}} at {{ppu}} PPU - Texture Format: {{texture_compression}} - Atlas Strategy: {{sprite_atlas_setup}} - Animation: {{animation_type}} at {{framerate}} FPS - + **Audio Assets:** - + - Music: {{audio_format}} at {{sample_rate}} Hz - SFX: {{sfx_format}} at {{sfx_sample_rate}} Hz - Compression: {{audio_compression}} - 3D Audio: {{spatial_audio}} - + **UI Assets:** - + - Canvas Resolution: {{ui_resolution}} - UI Scale Mode: {{scale_mode}} - Font: {{font_requirements}} - Icon Sizes: {{icon_specifications}} examples: - - "Sprites: 32x32 to 256x256 at 16 PPU, Format: RGBA32 for quality/RGBA16 for performance" + - 'Sprites: 32x32 to 256x256 at 16 PPU, Format: RGBA32 for quality/RGBA16 for performance' - id: technical-architecture-requirements title: Technical Architecture Requirements @@ -4470,17 +4483,17 @@ sections: title: Code Architecture Pattern template: | **Architecture Pattern:** {{MVC|MVVM|ECS|Component-Based|Custom}} - + **Core Systems Required:** - + - **Scene Management:** {{scene_manager_approach}} - **State Management:** {{state_pattern_implementation}} - **Event System:** {{event_system_choice}} - **Object Pooling:** {{pooling_strategy}} - **Save/Load System:** {{save_system_approach}} - + **Folder Structure:** - + ``` Assets/ ├── _Project/ @@ -4490,62 +4503,62 @@ sections: │ ├── Scenes/ │ └── {{additional_folders}} ``` - + **Naming Conventions:** - + - Scripts: {{script_naming}} - Prefabs: {{prefab_naming}} - Scenes: {{scene_naming}} examples: - - "Architecture: Component-Based with ScriptableObject data containers" - - "Scripts: PascalCase (PlayerController), Prefabs: Player_Prefab, Scenes: Level_01_Forest" + - 'Architecture: Component-Based with ScriptableObject data containers' + - 'Scripts: PascalCase (PlayerController), Prefabs: Player_Prefab, Scenes: Level_01_Forest' - id: unity-systems-integration title: Unity Systems Integration template: | **Required Unity Systems:** - + - **Input System:** {{input_implementation}} - **Animation System:** {{animation_approach}} - **Physics Integration:** {{physics_usage}} - **Rendering Features:** {{rendering_requirements}} - **Asset Streaming:** {{asset_loading_strategy}} - + **Third-Party Integrations:** - + - {{integration_name}}: {{integration_purpose}} - + **Performance Systems:** - + - **Profiling Integration:** {{profiling_setup}} - **Memory Management:** {{memory_strategy}} - **Build Pipeline:** {{build_automation}} examples: - - "Input System: Action Maps for Menu/Gameplay contexts with device switching" - - "DOTween: Smooth UI transitions and gameplay animations" + - 'Input System: Action Maps for Menu/Gameplay contexts with device switching' + - 'DOTween: Smooth UI transitions and gameplay animations' - id: data-management title: Data Management template: | **Save Data Architecture:** - + - **Format:** {{PlayerPrefs|JSON|Binary|Cloud}} - **Structure:** {{save_data_organization}} - **Encryption:** {{security_approach}} - **Cloud Sync:** {{cloud_integration}} - + **Configuration Data:** - + - **ScriptableObjects:** {{scriptable_object_usage}} - **Settings Management:** {{settings_system}} - **Localization:** {{localization_approach}} - + **Runtime Data:** - + - **Caching Strategy:** {{cache_implementation}} - **Memory Pools:** {{pooling_objects}} - **Asset References:** {{asset_reference_system}} examples: - - "Save Data: JSON format with AES encryption, stored in persistent data path" - - "ScriptableObjects: Game settings, level configurations, character data" + - 'Save Data: JSON format with AES encryption, stored in persistent data path' + - 'ScriptableObjects: Game settings, level configurations, character data' - id: development-phases title: Development Phases & Epic Planning @@ -4557,15 +4570,15 @@ sections: instruction: Present a high-level list of all phases for user approval. Each phase's design should deliver significant Unity functionality. type: numbered-list examples: - - "Phase 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management" - - "Phase 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop" - - "Phase 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression" - - "Phase 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment" + - 'Phase 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management' + - 'Phase 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop' + - 'Phase 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression' + - 'Phase 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment' - id: phase-1-foundation - title: "Phase 1: Unity Foundation & Core Systems ({{duration}})" + title: 'Phase 1: Unity Foundation & Core Systems ({{duration}})' sections: - id: foundation-design - title: "Design: Unity Project Foundation" + title: 'Design: Unity Project Foundation' type: bullet-list template: | - Unity project setup with proper folder structure and naming conventions @@ -4575,9 +4588,9 @@ sections: - Development tools setup (debugging, profiling integration) - Initial build pipeline and platform configuration examples: - - "Input System: Configure PlayerInput component with Action Maps for movement and UI" + - 'Input System: Configure PlayerInput component with Action Maps for movement and UI' - id: core-systems-design - title: "Design: Essential Game Systems" + title: 'Design: Essential Game Systems' type: bullet-list template: | - Save/Load system implementation with {{save_format}} format @@ -4587,10 +4600,10 @@ sections: - Basic UI framework and canvas configuration - Settings and configuration management with ScriptableObjects - id: phase-2-gameplay - title: "Phase 2: Core Gameplay Implementation ({{duration}})" + title: 'Phase 2: Core Gameplay Implementation ({{duration}})' sections: - id: gameplay-mechanics-design - title: "Design: Primary Game Mechanics" + title: 'Design: Primary Game Mechanics' type: bullet-list template: | - Player controller with {{movement_type}} movement system @@ -4600,7 +4613,7 @@ sections: - Basic collision detection and response systems - Animation system integration with Animator controllers - id: level-systems-design - title: "Design: Level & Content Systems" + title: 'Design: Level & Content Systems' type: bullet-list template: | - Scene loading and transition system @@ -4610,10 +4623,10 @@ sections: - Collectibles and pickup systems - Victory/defeat condition implementation - id: phase-3-polish - title: "Phase 3: Polish & Optimization ({{duration}})" + title: 'Phase 3: Polish & Optimization ({{duration}})' sections: - id: performance-design - title: "Design: Performance & Platform Optimization" + title: 'Design: Performance & Platform Optimization' type: bullet-list template: | - Unity Profiler analysis and optimization passes @@ -4623,7 +4636,7 @@ sections: - Build size optimization and asset bundling - Quality settings configuration for different device tiers - id: user-experience-design - title: "Design: User Experience & Polish" + title: 'Design: User Experience & Polish' type: bullet-list template: | - Complete UI/UX implementation with responsive design @@ -4648,10 +4661,10 @@ sections: - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. elicit: true examples: - - "Epic 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management" - - "Epic 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop" - - "Epic 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression" - - "Epic 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment" + - 'Epic 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management' + - 'Epic 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop' + - 'Epic 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression' + - 'Epic 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment' - id: epic-details title: Epic {{epic_number}} {{epic_title}} @@ -4673,13 +4686,13 @@ sections: - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained - If a story seems complex, break it down further as long as it can deliver a vertical slice elicit: true - template: "{{epic_goal}}" + template: '{{epic_goal}}' sections: - id: story title: Story {{epic_number}}.{{story_number}} {{story_title}} repeatable: true instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature and reference the gamearchitecture section for additional implementation and integration specifics. - template: "{{clear_description_of_what_needs_to_be_implemented}}" + template: '{{clear_description_of_what_needs_to_be_implemented}}' sections: - id: acceptance-criteria title: Acceptance Criteria @@ -4689,7 +4702,7 @@ sections: title: Functional Requirements type: checklist items: - - "{{specific_functional_requirement}}" + - '{{specific_functional_requirement}}' - id: technical-requirements title: Technical Requirements type: checklist @@ -4697,14 +4710,14 @@ sections: - Code follows C# best practices - Maintains stable frame rate on target devices - No memory leaks or performance degradation - - "{{specific_technical_requirement}}" + - '{{specific_technical_requirement}}' - id: game-design-requirements title: Game Design Requirements type: checklist items: - - "{{gameplay_requirement_from_gdd}}" - - "{{balance_requirement_if_applicable}}" - - "{{player_experience_requirement}}" + - '{{gameplay_requirement_from_gdd}}' + - '{{balance_requirement_if_applicable}}' + - '{{player_experience_requirement}}' - id: success-metrics title: Success Metrics & Quality Assurance @@ -4722,8 +4735,8 @@ sections: - **Build Size:** Final build <{{size_limit}}MB for mobile, <{{desktop_limit}}MB for desktop - **Battery Life:** Mobile gameplay sessions >{{battery_target}} hours on average device examples: - - "Frame Rate: Consistent 60 FPS with <5% drops below 45 FPS on target hardware" - - "Crash Rate: <0.5% across iOS/Android, <0.1% on desktop platforms" + - 'Frame Rate: Consistent 60 FPS with <5% drops below 45 FPS on target hardware' + - 'Crash Rate: <0.5% across iOS/Android, <0.1% on desktop platforms' - id: gameplay-metrics title: Gameplay & User Engagement Metrics type: bullet-list @@ -4735,8 +4748,8 @@ sections: - **Gameplay Completion:** {{completion_rate}}% complete main game content - **Control Responsiveness:** Input lag <{{input_lag}}ms on all platforms examples: - - "Tutorial Completion: 85% of players complete movement and basic mechanics tutorial" - - "Session Duration: Average 15-20 minutes per session for mobile, 30-45 minutes for desktop" + - 'Tutorial Completion: 85% of players complete movement and basic mechanics tutorial' + - 'Session Duration: Average 15-20 minutes per session for mobile, 30-45 minutes for desktop' - id: platform-specific-metrics title: Platform-Specific Quality Metrics type: table @@ -4767,31 +4780,31 @@ sections: instruction: Provide guidance for the Story Manager (SM) agent on how to break down this GDD into implementable user stories template: | **Epic Prioritization:** {{epic_order_rationale}} - + **Story Sizing Guidelines:** - + - Foundation stories: {{foundation_story_scope}} - Feature stories: {{feature_story_scope}} - Polish stories: {{polish_story_scope}} - + **Unity-Specific Story Considerations:** - + - Each story should result in testable Unity scenes or prefabs - Include specific Unity components and systems in acceptance criteria - Consider cross-platform testing requirements - Account for Unity build and deployment steps examples: - - "Foundation stories: Individual Unity systems (Input, Audio, Scene Management) - 1-2 days each" - - "Feature stories: Complete gameplay mechanics with UI and feedback - 2-4 days each" + - 'Foundation stories: Individual Unity systems (Input, Audio, Scene Management) - 1-2 days each' + - 'Feature stories: Complete gameplay mechanics with UI and feedback - 2-4 days each' - id: recommended-agents title: Recommended BMad Agent Sequence type: numbered-list template: | 1. **{{agent_name}}**: {{agent_responsibility}} examples: - - "Unity Architect: Create detailed technical architecture document with specific Unity implementation patterns" - - "Unity Developer: Implement core systems and gameplay mechanics according to architecture" - - "QA Tester: Validate performance metrics and cross-platform functionality" + - 'Unity Architect: Create detailed technical architecture document with specific Unity implementation patterns' + - 'Unity Developer: Implement core systems and gameplay mechanics according to architecture' + - 'QA Tester: Validate performance metrics and cross-platform functionality' ==================== END: .bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml ==================== ==================== START: .bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml ==================== @@ -4802,7 +4815,7 @@ template: output: format: markdown filename: docs/level-design-document.md - title: "{{game_title}} Level Design Document" + title: '{{game_title}} Level Design Document' workflow: mode: interactive @@ -4811,7 +4824,7 @@ sections: - id: initial-setup instruction: | This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. - id: introduction @@ -4819,7 +4832,7 @@ sections: instruction: Establish the purpose and scope of level design for this game content: | This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. sections: - id: change-log @@ -4863,32 +4876,32 @@ sections: repeatable: true sections: - id: level-category - title: "{{category_name}} Levels" + title: '{{category_name}} Levels' template: | **Purpose:** {{gameplay_purpose}} - + **Target Duration:** {{min_time}} - {{max_time}} minutes - + **Difficulty Range:** {{difficulty_scale}} - + **Key Mechanics Featured:** - + - {{mechanic_1}} - {{usage_description}} - {{mechanic_2}} - {{usage_description}} - + **Player Objectives:** - + - Primary: {{primary_objective}} - Secondary: {{secondary_objective}} - Hidden: {{secret_objective}} - + **Success Criteria:** - + - {{completion_requirement_1}} - {{completion_requirement_2}} - + **Technical Requirements:** - + - Maximum entities: {{entity_limit}} - Performance target: {{fps_target}} FPS - Memory budget: {{memory_limit}}MB @@ -4903,11 +4916,11 @@ sections: instruction: Based on GDD requirements, define the overall level organization template: | **Organization Type:** {{linear|hub_world|open_world}} - + **Total Level Count:** {{number}} - + **World Breakdown:** - + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} @@ -4942,7 +4955,7 @@ sections: instruction: Define how players access new levels template: | **Progression Gates:** - + - Linear progression: Complete previous level - Star requirements: {{star_count}} stars to unlock - Skill gates: Demonstrate {{skill_requirement}} @@ -4957,17 +4970,17 @@ sections: instruction: Define all environmental components that can be used in levels template: | **Terrain Types:** - + - {{terrain_1}}: {{properties_and_usage}} - {{terrain_2}}: {{properties_and_usage}} - + **Interactive Objects:** - + - {{object_1}}: {{behavior_and_purpose}} - {{object_2}}: {{behavior_and_purpose}} - + **Hazards and Obstacles:** - + - {{hazard_1}}: {{damage_and_behavior}} - {{hazard_2}}: {{damage_and_behavior}} - id: collectibles-rewards @@ -4975,18 +4988,18 @@ sections: instruction: Define all collectible items and their placement rules template: | **Collectible Types:** - + - {{collectible_1}}: {{value_and_purpose}} - {{collectible_2}}: {{value_and_purpose}} - + **Placement Guidelines:** - + - Mandatory collectibles: {{placement_rules}} - Optional collectibles: {{placement_rules}} - Secret collectibles: {{placement_rules}} - + **Reward Distribution:** - + - Easy to find: {{percentage}}% - Moderate challenge: {{percentage}}% - High skill required: {{percentage}}% @@ -4995,18 +5008,18 @@ sections: instruction: Define how enemies should be placed and balanced in levels template: | **Enemy Categories:** - + - {{enemy_type_1}}: {{behavior_and_usage}} - {{enemy_type_2}}: {{behavior_and_usage}} - + **Placement Principles:** - + - Introduction encounters: {{guideline}} - Standard encounters: {{guideline}} - Challenge encounters: {{guideline}} - + **Difficulty Scaling:** - + - Enemy count progression: {{scaling_rule}} - Enemy type introduction: {{pacing_rule}} - Encounter complexity: {{complexity_rule}} @@ -5019,14 +5032,14 @@ sections: title: Level Layout Principles template: | **Spatial Design:** - + - Grid size: {{grid_dimensions}} - Minimum path width: {{width_units}} - Maximum vertical distance: {{height_units}} - Safe zones placement: {{safety_guidelines}} - + **Navigation Design:** - + - Clear path indication: {{visual_cues}} - Landmark placement: {{landmark_rules}} - Dead end avoidance: {{dead_end_policy}} @@ -5036,13 +5049,13 @@ sections: instruction: Define how to control the rhythm and pace of gameplay within levels template: | **Action Sequences:** - + - High intensity duration: {{max_duration}} - Rest period requirement: {{min_rest_time}} - Intensity variation: {{pacing_pattern}} - + **Learning Sequences:** - + - New mechanic introduction: {{teaching_method}} - Practice opportunity: {{practice_duration}} - Skill application: {{application_context}} @@ -5051,14 +5064,14 @@ sections: instruction: Define how to create appropriate challenges for each level type template: | **Challenge Types:** - + - Execution challenges: {{skill_requirements}} - Puzzle challenges: {{complexity_guidelines}} - Time challenges: {{time_pressure_rules}} - Resource challenges: {{resource_management}} - + **Difficulty Calibration:** - + - Skill check frequency: {{frequency_guidelines}} - Failure recovery: {{retry_mechanics}} - Hint system integration: {{help_system}} @@ -5072,7 +5085,7 @@ sections: instruction: Define how level data should be structured for implementation template: | **Level File Format:** - + - Data format: {{json|yaml|custom}} - File naming: `level_{{world}}_{{number}}.{{extension}}` - Data organization: {{structure_description}} @@ -5110,14 +5123,14 @@ sections: instruction: Define how level assets are organized and loaded template: | **Tilemap Requirements:** - + - Tile size: {{tile_dimensions}}px - Tileset organization: {{tileset_structure}} - Layer organization: {{layer_system}} - Collision data: {{collision_format}} - + **Audio Integration:** - + - Background music: {{music_requirements}} - Ambient sounds: {{ambient_system}} - Dynamic audio: {{dynamic_audio_rules}} @@ -5126,19 +5139,19 @@ sections: instruction: Define performance requirements for level systems template: | **Entity Limits:** - + - Maximum active entities: {{entity_limit}} - Maximum particles: {{particle_limit}} - Maximum audio sources: {{audio_limit}} - + **Memory Management:** - + - Texture memory budget: {{texture_memory}}MB - Audio memory budget: {{audio_memory}}MB - Level loading time: <{{load_time}}s - + **Culling and LOD:** - + - Off-screen culling: {{culling_distance}} - Level-of-detail rules: {{lod_system}} - Asset streaming: {{streaming_requirements}} @@ -5151,13 +5164,13 @@ sections: title: Automated Testing template: | **Performance Testing:** - + - Frame rate validation: Maintain {{fps_target}} FPS - Memory usage monitoring: Stay under {{memory_limit}}MB - Loading time verification: Complete in <{{load_time}}s - + **Gameplay Testing:** - + - Completion path validation: All objectives achievable - Collectible accessibility: All items reachable - Softlock prevention: No unwinnable states @@ -5185,14 +5198,14 @@ sections: title: Balance Validation template: | **Metrics Collection:** - + - Completion rate: Target {{completion_percentage}}% - Average completion time: {{target_time}} ± {{variance}} - Death count per level: <{{max_deaths}} - Collectible discovery rate: {{discovery_percentage}}% - + **Iteration Guidelines:** - + - Adjustment criteria: {{criteria_for_changes}} - Testing sample size: {{minimum_testers}} - Validation period: {{testing_duration}} @@ -5205,14 +5218,14 @@ sections: title: Design Phase template: | **Concept Development:** - + 1. Define level purpose and goals 2. Create rough layout sketch 3. Identify key mechanics and challenges 4. Estimate difficulty and duration - + **Documentation Requirements:** - + - Level design brief - Layout diagrams - Mechanic integration notes @@ -5221,15 +5234,15 @@ sections: title: Implementation Phase template: | **Technical Implementation:** - + 1. Create level data file 2. Build tilemap and layout 3. Place entities and objects 4. Configure level logic and triggers 5. Integrate audio and visual effects - + **Quality Assurance:** - + 1. Automated testing execution 2. Internal playtesting 3. Performance validation @@ -5238,14 +5251,14 @@ sections: title: Integration Phase template: | **Game Integration:** - + 1. Level progression integration 2. Save system compatibility 3. Analytics integration 4. Achievement system integration - + **Final Validation:** - + 1. Full game context testing 2. Performance regression testing 3. Platform compatibility verification @@ -5289,7 +5302,7 @@ template: output: format: markdown filename: docs/game-brief.md - title: "{{game_title}} Game Brief" + title: '{{game_title}} Game Brief' workflow: mode: interactive @@ -5298,7 +5311,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. - id: game-vision @@ -5355,7 +5368,7 @@ sections: repeatable: true template: | **Core Mechanic: {{mechanic_name}}** - + - **Description:** {{how_it_works}} - **Player Value:** {{why_its_fun}} - **Implementation Scope:** {{complexity_estimate}} @@ -5382,12 +5395,12 @@ sections: title: Technical Constraints template: | **Platform Requirements:** - + - Primary: {{platform_1}} - {{requirements}} - Secondary: {{platform_2}} - {{requirements}} - + **Technical Specifications:** - + - Engine: Unity & C# - Performance Target: {{fps_target}} FPS on {{target_device}} - Memory Budget: <{{memory_limit}}MB @@ -5425,10 +5438,10 @@ sections: title: Competitive Analysis template: | **Direct Competitors:** - + - {{competitor_1}}: {{strengths_and_weaknesses}} - {{competitor_2}}: {{strengths_and_weaknesses}} - + **Differentiation Strategy:** {{how_we_differ_and_why_thats_valuable}} - id: market-opportunity @@ -5452,16 +5465,16 @@ sections: title: Content Categories template: | **Core Content:** - + - {{content_type_1}}: {{quantity_and_description}} - {{content_type_2}}: {{quantity_and_description}} - + **Optional Content:** - + - {{optional_content_type}}: {{quantity_and_description}} - + **Replay Elements:** - + - {{replayability_features}} - id: difficulty-accessibility title: Difficulty and Accessibility @@ -5528,13 +5541,13 @@ sections: title: Player Experience Metrics template: | **Engagement Goals:** - + - Tutorial completion rate: >{{percentage}}% - Average session length: {{duration}} minutes - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - + **Quality Benchmarks:** - + - Player satisfaction: >{{rating}}/10 - Completion rate: >{{percentage}}% - Technical performance: {{fps_target}} FPS consistent @@ -5542,13 +5555,13 @@ sections: title: Development Metrics template: | **Technical Targets:** - + - Zero critical bugs at launch - Performance targets met on all platforms - Load times under {{seconds}}s - + **Process Goals:** - + - Development timeline adherence - Feature scope completion - Quality assurance standards @@ -5557,7 +5570,7 @@ sections: condition: has_business_goals template: | **Commercial Goals:** - + - {{revenue_target}} in first {{time_period}} - {{user_acquisition_target}} players in first {{time_period}} - {{retention_target}} monthly active users @@ -5575,21 +5588,21 @@ sections: title: Development Roadmap sections: - id: phase-1-preproduction - title: "Phase 1: Pre-Production ({{duration}})" + title: 'Phase 1: Pre-Production ({{duration}})' type: bullet-list template: | - Detailed Game Design Document creation - Technical architecture planning - Art style exploration and pipeline setup - id: phase-2-prototype - title: "Phase 2: Prototype ({{duration}})" + title: 'Phase 2: Prototype ({{duration}})' type: bullet-list template: | - Core mechanic implementation - Technical proof of concept - Initial playtesting and iteration - id: phase-3-production - title: "Phase 3: Production ({{duration}})" + title: 'Phase 3: Production ({{duration}})' type: bullet-list template: | - Full feature development @@ -5610,12 +5623,12 @@ sections: title: Validation Plan template: | **Concept Testing:** - + - {{validation_method_1}} - {{timeline}} - {{validation_method_2}} - {{timeline}} - + **Prototype Testing:** - + - {{testing_approach}} - {{timeline}} - {{feedback_collection_method}} - {{timeline}} @@ -5852,7 +5865,7 @@ template: output: format: markdown filename: docs/game-architecture.md - title: "{{project_name}} Game Architecture Document" + title: '{{project_name}} Game Architecture Document' workflow: mode: interactive @@ -5962,11 +5975,11 @@ sections: - Game management patterns (Singleton managers, Event systems, State machines) - Data patterns (ScriptableObject configuration, Save/Load systems) - Unity-specific patterns (Object pooling, Coroutines, Unity Events) - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - "**Component-Based Architecture:** Using MonoBehaviour components for game logic - _Rationale:_ Aligns with Unity's design philosophy and enables reusable, testable game systems" - - "**ScriptableObject Data:** Using ScriptableObjects for game configuration - _Rationale:_ Enables data-driven design and easy balancing without code changes" - - "**Event-Driven Communication:** Using Unity Events and C# events for system decoupling - _Rationale:_ Supports modular architecture and easier testing" + - '**ScriptableObject Data:** Using ScriptableObjects for game configuration - _Rationale:_ Enables data-driven design and easy balancing without code changes' + - '**Event-Driven Communication:** Using Unity Events and C# events for system decoupling - _Rationale:_ Supports modular architecture and easier testing' - id: tech-stack title: Tech Stack @@ -6005,13 +6018,13 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Populate the technology stack table with all relevant Unity technologies examples: - - "| **Game Engine** | Unity | 2022.3.21f1 | Core game development platform | Latest LTS version, stable 2D tooling, comprehensive package ecosystem |" + - '| **Game Engine** | Unity | 2022.3.21f1 | Core game development platform | Latest LTS version, stable 2D tooling, comprehensive package ecosystem |' - "| **Language** | C# | 10.0 | Primary scripting language | Unity's native language, strong typing, excellent tooling |" - - "| **Render Pipeline** | Universal Render Pipeline (URP) | 14.0.10 | 2D/3D rendering | Optimized for mobile, excellent 2D features, future-proof |" - - "| **Input System** | Unity Input System | 1.7.0 | Cross-platform input handling | Modern input system, supports multiple devices, rebindable controls |" - - "| **Physics** | Unity 2D Physics | Built-in | 2D collision and physics | Integrated Box2D, optimized for 2D games |" - - "| **Audio** | Unity Audio | Built-in | Audio playback and mixing | Built-in audio system with mixer support |" - - "| **Testing** | Unity Test Framework | 1.1.33 | Unit and integration testing | Built-in testing framework based on NUnit |" + - '| **Render Pipeline** | Universal Render Pipeline (URP) | 14.0.10 | 2D/3D rendering | Optimized for mobile, excellent 2D features, future-proof |' + - '| **Input System** | Unity Input System | 1.7.0 | Cross-platform input handling | Modern input system, supports multiple devices, rebindable controls |' + - '| **Physics** | Unity 2D Physics | Built-in | 2D collision and physics | Integrated Box2D, optimized for 2D games |' + - '| **Audio** | Unity Audio | Built-in | Audio playback and mixing | Built-in audio system with mixer support |' + - '| **Testing** | Unity Test Framework | 1.1.33 | Unit and integration testing | Built-in testing framework based on NUnit |' - id: data-models title: Game Data Models @@ -6029,7 +6042,7 @@ sections: repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} @@ -6064,7 +6077,7 @@ sections: sections: - id: system-list repeatable: true - title: "{{system_name}} System" + title: '{{system_name}} System' template: | **Responsibility:** {{system_description}} @@ -6588,7 +6601,7 @@ sections: repeatable: true sections: - id: integration - title: "{{service_name}} Integration" + title: '{{service_name}} Integration' template: | - **Purpose:** {{service_purpose}} - **Documentation:** {{service_docs_url}} @@ -6700,12 +6713,12 @@ sections: - id: environments title: Build Environments repeatable: true - template: "- **{{env_name}}:** {{env_purpose}} - {{platform_settings}}" + template: '- **{{env_name}}:** {{env_purpose}} - {{platform_settings}}' - id: platform-specific-builds title: Platform-Specific Build Settings type: code language: text - template: "{{platform_build_configurations}}" + template: '{{platform_build_configurations}}' - id: coding-standards title: Coding Standards @@ -6734,9 +6747,9 @@ sections: columns: [Element, Convention, Example] instruction: Only include if deviating from Unity defaults examples: - - "| MonoBehaviour | PascalCase + Component suffix | PlayerController, HealthSystem |" - - "| ScriptableObject | PascalCase + Data/Config suffix | PlayerData, GameConfig |" - - "| Prefab | PascalCase descriptive | PlayerCharacter, EnvironmentTile |" + - '| MonoBehaviour | PascalCase + Component suffix | PlayerController, HealthSystem |' + - '| ScriptableObject | PascalCase + Data/Config suffix | PlayerData, GameConfig |' + - '| Prefab | PascalCase descriptive | PlayerCharacter, EnvironmentTile |' - id: critical-rules title: Critical Unity Rules instruction: | @@ -6748,7 +6761,7 @@ sections: Avoid obvious rules like "follow SOLID principles" or "optimize performance" repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' - id: unity-specifics title: Unity-Specific Guidelines condition: Critical Unity-specific rules needed @@ -6757,7 +6770,7 @@ sections: - id: unity-lifecycle title: Unity Lifecycle Rules repeatable: true - template: "- **{{lifecycle_method}}:** {{usage_rule}}" + template: '- **{{lifecycle_method}}:** {{usage_rule}}' - id: test-strategy title: Test Strategy and Standards @@ -8462,8 +8475,8 @@ template: version: 3.0 output: format: markdown - filename: "stories/{{epic_name}}/{{story_id}}-{{story_name}}.md" - title: "Story: {{story_title}}" + filename: 'stories/{{epic_name}}/{{story_id}}-{{story_name}}.md' + title: 'Story: {{story_title}}' workflow: mode: interactive @@ -8472,13 +8485,13 @@ sections: - id: initial-setup instruction: | This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. - + Before starting, ensure you have access to: - + - Game Design Document (GDD) - Game Architecture Document - Any existing stories in this epic - + The story should be specific enough that a developer can implement it without requiring additional design decisions. - id: story-header @@ -8492,7 +8505,7 @@ sections: - id: description title: Description instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature. - template: "{{clear_description_of_what_needs_to_be_implemented}}" + template: '{{clear_description_of_what_needs_to_be_implemented}}' - id: acceptance-criteria title: Acceptance Criteria @@ -8502,7 +8515,7 @@ sections: title: Functional Requirements type: checklist items: - - "{{specific_functional_requirement}}" + - '{{specific_functional_requirement}}' - id: technical-requirements title: Technical Requirements type: checklist @@ -8510,14 +8523,14 @@ sections: - Code follows C# best practices - Maintains stable frame rate on target devices - No memory leaks or performance degradation - - "{{specific_technical_requirement}}" + - '{{specific_technical_requirement}}' - id: game-design-requirements title: Game Design Requirements type: checklist items: - - "{{gameplay_requirement_from_gdd}}" - - "{{balance_requirement_if_applicable}}" - - "{{player_experience_requirement}}" + - '{{gameplay_requirement_from_gdd}}' + - '{{balance_requirement_if_applicable}}' + - '{{player_experience_requirement}}' - id: technical-specifications title: Technical Specifications @@ -8527,12 +8540,12 @@ sections: title: Files to Create/Modify template: | **New Files:** - + - `{{file_path_1}}` - {{purpose}} - `{{file_path_2}}` - {{purpose}} - + **Modified Files:** - + - `{{existing_file_1}}` - {{changes_needed}} - `{{existing_file_2}}` - {{changes_needed}} - id: class-interface-definitions @@ -8615,13 +8628,13 @@ sections: instruction: Reference the specific sections of the GDD that this story implements template: | **GDD Reference:** {{section_name}} ({{page_or_section_number}}) - + **Game Mechanic:** {{mechanic_name}} - + **Player Experience Goal:** {{experience_description}} - + **Balance Parameters:** - + - {{parameter_1}}: {{value_or_range}} - {{parameter_2}}: {{value_or_range}} @@ -8668,15 +8681,15 @@ sections: instruction: List any dependencies that must be completed before this story can be implemented template: | **Story Dependencies:** - + - {{story_id}}: {{dependency_description}} - + **Technical Dependencies:** - + - {{system_or_file}}: {{requirement}} - + **Asset Dependencies:** - + - {{asset_type}}: {{asset_description}} - Location: `{{asset_path}}` @@ -8692,24 +8705,24 @@ sections: - Performance targets met - No C# compiler errors or warnings - Documentation updated - - "{{game_specific_dod_item}}" + - '{{game_specific_dod_item}}' - id: notes title: Notes instruction: Any additional context, design decisions, or implementation notes template: | **Implementation Notes:** - + - {{note_1}} - {{note_2}} - + **Design Decisions:** - + - {{decision_1}}: {{rationale}} - {{decision_2}}: {{rationale}} - + **Future Considerations:** - + - {{future_enhancement_1}} - {{future_optimization_1}} ==================== END: .bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml ==================== @@ -8928,7 +8941,7 @@ template: output: format: markdown filename: docs/game-architecture.md - title: "{{project_name}} Game Architecture Document" + title: '{{project_name}} Game Architecture Document' workflow: mode: interactive @@ -9038,11 +9051,11 @@ sections: - Game management patterns (Singleton managers, Event systems, State machines) - Data patterns (ScriptableObject configuration, Save/Load systems) - Unity-specific patterns (Object pooling, Coroutines, Unity Events) - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - "**Component-Based Architecture:** Using MonoBehaviour components for game logic - _Rationale:_ Aligns with Unity's design philosophy and enables reusable, testable game systems" - - "**ScriptableObject Data:** Using ScriptableObjects for game configuration - _Rationale:_ Enables data-driven design and easy balancing without code changes" - - "**Event-Driven Communication:** Using Unity Events and C# events for system decoupling - _Rationale:_ Supports modular architecture and easier testing" + - '**ScriptableObject Data:** Using ScriptableObjects for game configuration - _Rationale:_ Enables data-driven design and easy balancing without code changes' + - '**Event-Driven Communication:** Using Unity Events and C# events for system decoupling - _Rationale:_ Supports modular architecture and easier testing' - id: tech-stack title: Tech Stack @@ -9081,13 +9094,13 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Populate the technology stack table with all relevant Unity technologies examples: - - "| **Game Engine** | Unity | 2022.3.21f1 | Core game development platform | Latest LTS version, stable 2D tooling, comprehensive package ecosystem |" + - '| **Game Engine** | Unity | 2022.3.21f1 | Core game development platform | Latest LTS version, stable 2D tooling, comprehensive package ecosystem |' - "| **Language** | C# | 10.0 | Primary scripting language | Unity's native language, strong typing, excellent tooling |" - - "| **Render Pipeline** | Universal Render Pipeline (URP) | 14.0.10 | 2D/3D rendering | Optimized for mobile, excellent 2D features, future-proof |" - - "| **Input System** | Unity Input System | 1.7.0 | Cross-platform input handling | Modern input system, supports multiple devices, rebindable controls |" - - "| **Physics** | Unity 2D Physics | Built-in | 2D collision and physics | Integrated Box2D, optimized for 2D games |" - - "| **Audio** | Unity Audio | Built-in | Audio playback and mixing | Built-in audio system with mixer support |" - - "| **Testing** | Unity Test Framework | 1.1.33 | Unit and integration testing | Built-in testing framework based on NUnit |" + - '| **Render Pipeline** | Universal Render Pipeline (URP) | 14.0.10 | 2D/3D rendering | Optimized for mobile, excellent 2D features, future-proof |' + - '| **Input System** | Unity Input System | 1.7.0 | Cross-platform input handling | Modern input system, supports multiple devices, rebindable controls |' + - '| **Physics** | Unity 2D Physics | Built-in | 2D collision and physics | Integrated Box2D, optimized for 2D games |' + - '| **Audio** | Unity Audio | Built-in | Audio playback and mixing | Built-in audio system with mixer support |' + - '| **Testing** | Unity Test Framework | 1.1.33 | Unit and integration testing | Built-in testing framework based on NUnit |' - id: data-models title: Game Data Models @@ -9105,7 +9118,7 @@ sections: repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} @@ -9140,7 +9153,7 @@ sections: sections: - id: system-list repeatable: true - title: "{{system_name}} System" + title: '{{system_name}} System' template: | **Responsibility:** {{system_description}} @@ -9664,7 +9677,7 @@ sections: repeatable: true sections: - id: integration - title: "{{service_name}} Integration" + title: '{{service_name}} Integration' template: | - **Purpose:** {{service_purpose}} - **Documentation:** {{service_docs_url}} @@ -9776,12 +9789,12 @@ sections: - id: environments title: Build Environments repeatable: true - template: "- **{{env_name}}:** {{env_purpose}} - {{platform_settings}}" + template: '- **{{env_name}}:** {{env_purpose}} - {{platform_settings}}' - id: platform-specific-builds title: Platform-Specific Build Settings type: code language: text - template: "{{platform_build_configurations}}" + template: '{{platform_build_configurations}}' - id: coding-standards title: Coding Standards @@ -9810,9 +9823,9 @@ sections: columns: [Element, Convention, Example] instruction: Only include if deviating from Unity defaults examples: - - "| MonoBehaviour | PascalCase + Component suffix | PlayerController, HealthSystem |" - - "| ScriptableObject | PascalCase + Data/Config suffix | PlayerData, GameConfig |" - - "| Prefab | PascalCase descriptive | PlayerCharacter, EnvironmentTile |" + - '| MonoBehaviour | PascalCase + Component suffix | PlayerController, HealthSystem |' + - '| ScriptableObject | PascalCase + Data/Config suffix | PlayerData, GameConfig |' + - '| Prefab | PascalCase descriptive | PlayerCharacter, EnvironmentTile |' - id: critical-rules title: Critical Unity Rules instruction: | @@ -9824,7 +9837,7 @@ sections: Avoid obvious rules like "follow SOLID principles" or "optimize performance" repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' - id: unity-specifics title: Unity-Specific Guidelines condition: Critical Unity-specific rules needed @@ -9833,7 +9846,7 @@ sections: - id: unity-lifecycle title: Unity Lifecycle Rules repeatable: true - template: "- **{{lifecycle_method}}:** {{usage_rule}}" + template: '- **{{lifecycle_method}}:** {{usage_rule}}' - id: test-strategy title: Test Strategy and Standards @@ -9961,7 +9974,7 @@ template: output: format: markdown filename: docs/game-brief.md - title: "{{game_title}} Game Brief" + title: '{{game_title}} Game Brief' workflow: mode: interactive @@ -9970,7 +9983,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. - id: game-vision @@ -10027,7 +10040,7 @@ sections: repeatable: true template: | **Core Mechanic: {{mechanic_name}}** - + - **Description:** {{how_it_works}} - **Player Value:** {{why_its_fun}} - **Implementation Scope:** {{complexity_estimate}} @@ -10054,12 +10067,12 @@ sections: title: Technical Constraints template: | **Platform Requirements:** - + - Primary: {{platform_1}} - {{requirements}} - Secondary: {{platform_2}} - {{requirements}} - + **Technical Specifications:** - + - Engine: Unity & C# - Performance Target: {{fps_target}} FPS on {{target_device}} - Memory Budget: <{{memory_limit}}MB @@ -10097,10 +10110,10 @@ sections: title: Competitive Analysis template: | **Direct Competitors:** - + - {{competitor_1}}: {{strengths_and_weaknesses}} - {{competitor_2}}: {{strengths_and_weaknesses}} - + **Differentiation Strategy:** {{how_we_differ_and_why_thats_valuable}} - id: market-opportunity @@ -10124,16 +10137,16 @@ sections: title: Content Categories template: | **Core Content:** - + - {{content_type_1}}: {{quantity_and_description}} - {{content_type_2}}: {{quantity_and_description}} - + **Optional Content:** - + - {{optional_content_type}}: {{quantity_and_description}} - + **Replay Elements:** - + - {{replayability_features}} - id: difficulty-accessibility title: Difficulty and Accessibility @@ -10200,13 +10213,13 @@ sections: title: Player Experience Metrics template: | **Engagement Goals:** - + - Tutorial completion rate: >{{percentage}}% - Average session length: {{duration}} minutes - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - + **Quality Benchmarks:** - + - Player satisfaction: >{{rating}}/10 - Completion rate: >{{percentage}}% - Technical performance: {{fps_target}} FPS consistent @@ -10214,13 +10227,13 @@ sections: title: Development Metrics template: | **Technical Targets:** - + - Zero critical bugs at launch - Performance targets met on all platforms - Load times under {{seconds}}s - + **Process Goals:** - + - Development timeline adherence - Feature scope completion - Quality assurance standards @@ -10229,7 +10242,7 @@ sections: condition: has_business_goals template: | **Commercial Goals:** - + - {{revenue_target}} in first {{time_period}} - {{user_acquisition_target}} players in first {{time_period}} - {{retention_target}} monthly active users @@ -10247,21 +10260,21 @@ sections: title: Development Roadmap sections: - id: phase-1-preproduction - title: "Phase 1: Pre-Production ({{duration}})" + title: 'Phase 1: Pre-Production ({{duration}})' type: bullet-list template: | - Detailed Game Design Document creation - Technical architecture planning - Art style exploration and pipeline setup - id: phase-2-prototype - title: "Phase 2: Prototype ({{duration}})" + title: 'Phase 2: Prototype ({{duration}})' type: bullet-list template: | - Core mechanic implementation - Technical proof of concept - Initial playtesting and iteration - id: phase-3-production - title: "Phase 3: Production ({{duration}})" + title: 'Phase 3: Production ({{duration}})' type: bullet-list template: | - Full feature development @@ -10282,12 +10295,12 @@ sections: title: Validation Plan template: | **Concept Testing:** - + - {{validation_method_1}} - {{timeline}} - {{validation_method_2}} - {{timeline}} - + **Prototype Testing:** - + - {{testing_approach}} - {{timeline}} - {{feedback_collection_method}} - {{timeline}} @@ -10320,7 +10333,7 @@ template: output: format: markdown filename: docs/game-design-document.md - title: "{{game_title}} Game Design Document (GDD)" + title: '{{game_title}} Game Design Document (GDD)' workflow: mode: interactive @@ -10368,8 +10381,8 @@ sections: **Primary:** {{age_range}}, {{player_type}}, {{platform_preference}} **Secondary:** {{secondary_audience}} examples: - - "Primary: Ages 8-16, casual mobile gamers, prefer short play sessions" - - "Secondary: Adult puzzle enthusiasts, educators looking for teaching tools" + - 'Primary: Ages 8-16, casual mobile gamers, prefer short play sessions' + - 'Secondary: Adult puzzle enthusiasts, educators looking for teaching tools' - id: platform-technical title: Platform & Technical Requirements instruction: Based on the technical preferences or user input, define the target platforms and Unity-specific requirements @@ -10380,7 +10393,7 @@ sections: **Screen Support:** {{resolution_range}} **Build Targets:** {{build_targets}} examples: - - "Primary Platform: Mobile (iOS/Android), Engine: Unity 2022.3 LTS & C#, Performance: 60 FPS on iPhone 8/Galaxy S8" + - 'Primary Platform: Mobile (iOS/Android), Engine: Unity 2022.3 LTS & C#, Performance: 60 FPS on iPhone 8/Galaxy S8' - id: unique-selling-points title: Unique Selling Points instruction: List 3-5 key features that differentiate this game from competitors @@ -10410,7 +10423,7 @@ sections: instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions for Unity implementation. template: | **Primary Loop ({{duration}} seconds):** - + 1. {{action_1}} ({{time_1}}s) - {{unity_component}} 2. {{action_2}} ({{time_2}}s) - {{unity_component}} 3. {{action_3}} ({{time_3}}s) - {{unity_component}} @@ -10422,17 +10435,17 @@ sections: instruction: Clearly define success and failure states with Unity-specific implementation notes template: | **Victory Conditions:** - + - {{win_condition_1}} - Unity Event: {{unity_event}} - {{win_condition_2}} - Unity Event: {{unity_event}} - + **Failure States:** - + - {{loss_condition_1}} - Trigger: {{unity_trigger}} - {{loss_condition_2}} - Trigger: {{unity_trigger}} examples: - - "Victory: Player reaches exit portal - Unity Event: OnTriggerEnter2D with Portal tag" - - "Failure: Health reaches zero - Trigger: Health component value <= 0" + - 'Victory: Player reaches exit portal - Unity Event: OnTriggerEnter2D with Portal tag' + - 'Failure: Health reaches zero - Trigger: Health component value <= 0' - id: game-mechanics title: Game Mechanics @@ -10444,30 +10457,30 @@ sections: repeatable: true sections: - id: mechanic - title: "{{mechanic_name}}" + title: '{{mechanic_name}}' template: | **Description:** {{detailed_description}} - + **Player Input:** {{input_method}} - Unity Input System: {{input_action}} - + **System Response:** {{game_response}} - + **Unity Implementation Notes:** - + - **Components Needed:** {{component_list}} - **Physics Requirements:** {{physics_2d_setup}} - **Animation States:** {{animator_states}} - **Performance Considerations:** {{optimization_notes}} - + **Dependencies:** {{other_mechanics_needed}} - + **Script Architecture:** - + - {{script_name}}.cs - {{responsibility}} - {{manager_script}}.cs - {{management_role}} examples: - - "Components Needed: Rigidbody2D, BoxCollider2D, PlayerMovement script" - - "Physics Requirements: 2D Physics material for ground friction, Gravity scale 3" + - 'Components Needed: Rigidbody2D, BoxCollider2D, PlayerMovement script' + - 'Physics Requirements: 2D Physics material for ground friction, Gravity scale 3' - id: controls title: Controls instruction: Define all input methods for different platforms using Unity's Input System @@ -10488,15 +10501,15 @@ sections: title: Player Progression template: | **Progression Type:** {{linear|branching|metroidvania}} - + **Key Milestones:** - + 1. **{{milestone_1}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} 2. **{{milestone_2}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} 3. **{{milestone_3}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} - + **Save Data Structure:** - + ```csharp [System.Serializable] public class PlayerProgress @@ -10512,17 +10525,17 @@ sections: template: | **Tutorial Phase:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Early Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Mid Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Late Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} examples: - - "enemy speed: 2.0f, jump height: 4.5f, obstacle density: 0.3f" + - 'enemy speed: 2.0f, jump height: 4.5f, obstacle density: 0.3f' - id: economy-resources title: Economy & Resources condition: has_economy @@ -10545,31 +10558,31 @@ sections: repeatable: true sections: - id: level-type - title: "{{level_type_name}}" + title: '{{level_type_name}}' template: | **Purpose:** {{gameplay_purpose}} **Target Duration:** {{target_time}} **Key Elements:** {{required_mechanics}} **Difficulty Rating:** {{relative_difficulty}} - + **Unity Scene Structure:** - + - **Environment:** {{tilemap_setup}} - **Gameplay Objects:** {{prefab_list}} - **Lighting:** {{lighting_setup}} - **Audio:** {{audio_sources}} - + **Level Flow Template:** - + - **Introduction:** {{intro_description}} - Area: {{unity_area_bounds}} - **Challenge:** {{main_challenge}} - Mechanics: {{active_components}} - **Resolution:** {{completion_requirement}} - Trigger: {{completion_trigger}} - + **Reusable Prefabs:** - + - {{prefab_name}} - {{prefab_purpose}} examples: - - "Environment: TilemapRenderer with Platform tileset, Lighting: 2D Global Light + Point Lights" + - 'Environment: TilemapRenderer with Platform tileset, Lighting: 2D Global Light + Point Lights' - id: level-progression title: Level Progression template: | @@ -10577,14 +10590,14 @@ sections: **Total Levels:** {{number}} **Unlock Pattern:** {{progression_method}} **Scene Management:** {{unity_scene_loading}} - + **Unity Scene Organization:** - + - Scene Naming: {{naming_convention}} - Addressable Assets: {{addressable_groups}} - Loading Screens: {{loading_implementation}} examples: - - "Scene Naming: World{X}_Level{Y}_Name, Addressable Groups: Levels_World1, World_Environments" + - 'Scene Naming: World{X}_Level{Y}_Name, Addressable Groups: Levels_World1, World_Environments' - id: technical-specifications title: Technical Specifications @@ -10604,19 +10617,19 @@ sections: **Physics:** {{2D Only|3D Only|Hybrid}} **Scripting Backend:** {{Mono|IL2CPP}} **API Compatibility:** {{.NET Standard 2.1|.NET Framework}} - + **Required Packages:** - + - {{package_name}} {{version}} - {{purpose}} - + **Project Settings:** - + - Color Space: {{Linear|Gamma}} - Quality Settings: {{quality_levels}} - Physics Settings: {{physics_config}} examples: - com.unity.addressables 1.20.5 - Asset loading and memory management - - "Color Space: Linear, Quality: Mobile/Desktop presets, Gravity: -20" + - 'Color Space: Linear, Quality: Mobile/Desktop presets, Gravity: -20' - id: performance-requirements title: Performance Requirements template: | @@ -10624,64 +10637,64 @@ sections: **Memory Usage:** <{{memory_limit}}MB heap, <{{texture_memory}}MB textures **Load Times:** <{{load_time}}s initial, <{{level_load}}s between levels **Battery Usage:** Optimized for mobile devices - {{battery_target}} hours gameplay - + **Unity Profiler Targets:** - + - CPU Frame Time: <{{cpu_time}}ms - GPU Frame Time: <{{gpu_time}}ms - GC Allocs: <{{gc_limit}}KB per frame - Draw Calls: <{{draw_calls}} per frame examples: - - "60 FPS (minimum 30), CPU: <16.67ms, GPU: <16.67ms, GC: <4KB, Draws: <50" + - '60 FPS (minimum 30), CPU: <16.67ms, GPU: <16.67ms, GC: <4KB, Draws: <50' - id: platform-specific title: Platform Specific Requirements template: | **Desktop:** - + - Resolution: {{min_resolution}} - {{max_resolution}} - Input: Keyboard, Mouse, Gamepad ({{gamepad_support}}) - Build Target: {{desktop_targets}} - + **Mobile:** - + - Resolution: {{mobile_min}} - {{mobile_max}} - Input: Touch, Accelerometer ({{sensor_support}}) - OS: iOS {{ios_min}}+, Android {{android_min}}+ (API {{api_level}}) - Device Requirements: {{device_specs}} - + **Web (if applicable):** - + - WebGL Version: {{webgl_version}} - Browser Support: {{browser_list}} - Compression: {{compression_format}} examples: - - "Resolution: 1280x720 - 4K, Gamepad: Xbox/PlayStation controllers via Input System" + - 'Resolution: 1280x720 - 4K, Gamepad: Xbox/PlayStation controllers via Input System' - id: asset-requirements title: Asset Requirements instruction: Define asset specifications for Unity pipeline optimization template: | **2D Art Assets:** - + - Sprites: {{sprite_resolution}} at {{ppu}} PPU - Texture Format: {{texture_compression}} - Atlas Strategy: {{sprite_atlas_setup}} - Animation: {{animation_type}} at {{framerate}} FPS - + **Audio Assets:** - + - Music: {{audio_format}} at {{sample_rate}} Hz - SFX: {{sfx_format}} at {{sfx_sample_rate}} Hz - Compression: {{audio_compression}} - 3D Audio: {{spatial_audio}} - + **UI Assets:** - + - Canvas Resolution: {{ui_resolution}} - UI Scale Mode: {{scale_mode}} - Font: {{font_requirements}} - Icon Sizes: {{icon_specifications}} examples: - - "Sprites: 32x32 to 256x256 at 16 PPU, Format: RGBA32 for quality/RGBA16 for performance" + - 'Sprites: 32x32 to 256x256 at 16 PPU, Format: RGBA32 for quality/RGBA16 for performance' - id: technical-architecture-requirements title: Technical Architecture Requirements @@ -10696,17 +10709,17 @@ sections: title: Code Architecture Pattern template: | **Architecture Pattern:** {{MVC|MVVM|ECS|Component-Based|Custom}} - + **Core Systems Required:** - + - **Scene Management:** {{scene_manager_approach}} - **State Management:** {{state_pattern_implementation}} - **Event System:** {{event_system_choice}} - **Object Pooling:** {{pooling_strategy}} - **Save/Load System:** {{save_system_approach}} - + **Folder Structure:** - + ``` Assets/ ├── _Project/ @@ -10716,62 +10729,62 @@ sections: │ ├── Scenes/ │ └── {{additional_folders}} ``` - + **Naming Conventions:** - + - Scripts: {{script_naming}} - Prefabs: {{prefab_naming}} - Scenes: {{scene_naming}} examples: - - "Architecture: Component-Based with ScriptableObject data containers" - - "Scripts: PascalCase (PlayerController), Prefabs: Player_Prefab, Scenes: Level_01_Forest" + - 'Architecture: Component-Based with ScriptableObject data containers' + - 'Scripts: PascalCase (PlayerController), Prefabs: Player_Prefab, Scenes: Level_01_Forest' - id: unity-systems-integration title: Unity Systems Integration template: | **Required Unity Systems:** - + - **Input System:** {{input_implementation}} - **Animation System:** {{animation_approach}} - **Physics Integration:** {{physics_usage}} - **Rendering Features:** {{rendering_requirements}} - **Asset Streaming:** {{asset_loading_strategy}} - + **Third-Party Integrations:** - + - {{integration_name}}: {{integration_purpose}} - + **Performance Systems:** - + - **Profiling Integration:** {{profiling_setup}} - **Memory Management:** {{memory_strategy}} - **Build Pipeline:** {{build_automation}} examples: - - "Input System: Action Maps for Menu/Gameplay contexts with device switching" - - "DOTween: Smooth UI transitions and gameplay animations" + - 'Input System: Action Maps for Menu/Gameplay contexts with device switching' + - 'DOTween: Smooth UI transitions and gameplay animations' - id: data-management title: Data Management template: | **Save Data Architecture:** - + - **Format:** {{PlayerPrefs|JSON|Binary|Cloud}} - **Structure:** {{save_data_organization}} - **Encryption:** {{security_approach}} - **Cloud Sync:** {{cloud_integration}} - + **Configuration Data:** - + - **ScriptableObjects:** {{scriptable_object_usage}} - **Settings Management:** {{settings_system}} - **Localization:** {{localization_approach}} - + **Runtime Data:** - + - **Caching Strategy:** {{cache_implementation}} - **Memory Pools:** {{pooling_objects}} - **Asset References:** {{asset_reference_system}} examples: - - "Save Data: JSON format with AES encryption, stored in persistent data path" - - "ScriptableObjects: Game settings, level configurations, character data" + - 'Save Data: JSON format with AES encryption, stored in persistent data path' + - 'ScriptableObjects: Game settings, level configurations, character data' - id: development-phases title: Development Phases & Epic Planning @@ -10783,15 +10796,15 @@ sections: instruction: Present a high-level list of all phases for user approval. Each phase's design should deliver significant Unity functionality. type: numbered-list examples: - - "Phase 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management" - - "Phase 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop" - - "Phase 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression" - - "Phase 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment" + - 'Phase 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management' + - 'Phase 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop' + - 'Phase 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression' + - 'Phase 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment' - id: phase-1-foundation - title: "Phase 1: Unity Foundation & Core Systems ({{duration}})" + title: 'Phase 1: Unity Foundation & Core Systems ({{duration}})' sections: - id: foundation-design - title: "Design: Unity Project Foundation" + title: 'Design: Unity Project Foundation' type: bullet-list template: | - Unity project setup with proper folder structure and naming conventions @@ -10801,9 +10814,9 @@ sections: - Development tools setup (debugging, profiling integration) - Initial build pipeline and platform configuration examples: - - "Input System: Configure PlayerInput component with Action Maps for movement and UI" + - 'Input System: Configure PlayerInput component with Action Maps for movement and UI' - id: core-systems-design - title: "Design: Essential Game Systems" + title: 'Design: Essential Game Systems' type: bullet-list template: | - Save/Load system implementation with {{save_format}} format @@ -10813,10 +10826,10 @@ sections: - Basic UI framework and canvas configuration - Settings and configuration management with ScriptableObjects - id: phase-2-gameplay - title: "Phase 2: Core Gameplay Implementation ({{duration}})" + title: 'Phase 2: Core Gameplay Implementation ({{duration}})' sections: - id: gameplay-mechanics-design - title: "Design: Primary Game Mechanics" + title: 'Design: Primary Game Mechanics' type: bullet-list template: | - Player controller with {{movement_type}} movement system @@ -10826,7 +10839,7 @@ sections: - Basic collision detection and response systems - Animation system integration with Animator controllers - id: level-systems-design - title: "Design: Level & Content Systems" + title: 'Design: Level & Content Systems' type: bullet-list template: | - Scene loading and transition system @@ -10836,10 +10849,10 @@ sections: - Collectibles and pickup systems - Victory/defeat condition implementation - id: phase-3-polish - title: "Phase 3: Polish & Optimization ({{duration}})" + title: 'Phase 3: Polish & Optimization ({{duration}})' sections: - id: performance-design - title: "Design: Performance & Platform Optimization" + title: 'Design: Performance & Platform Optimization' type: bullet-list template: | - Unity Profiler analysis and optimization passes @@ -10849,7 +10862,7 @@ sections: - Build size optimization and asset bundling - Quality settings configuration for different device tiers - id: user-experience-design - title: "Design: User Experience & Polish" + title: 'Design: User Experience & Polish' type: bullet-list template: | - Complete UI/UX implementation with responsive design @@ -10874,10 +10887,10 @@ sections: - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. elicit: true examples: - - "Epic 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management" - - "Epic 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop" - - "Epic 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression" - - "Epic 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment" + - 'Epic 1: Unity Foundation & Core Systems: Project setup, input handling, basic scene management' + - 'Epic 2: Core Game Mechanics: Player controller, physics systems, basic gameplay loop' + - 'Epic 3: Level Systems & Content Pipeline: Scene loading, prefab systems, level progression' + - 'Epic 4: Polish & Platform Optimization: Performance tuning, platform-specific features, deployment' - id: epic-details title: Epic {{epic_number}} {{epic_title}} @@ -10899,13 +10912,13 @@ sections: - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained - If a story seems complex, break it down further as long as it can deliver a vertical slice elicit: true - template: "{{epic_goal}}" + template: '{{epic_goal}}' sections: - id: story title: Story {{epic_number}}.{{story_number}} {{story_title}} repeatable: true instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature and reference the gamearchitecture section for additional implementation and integration specifics. - template: "{{clear_description_of_what_needs_to_be_implemented}}" + template: '{{clear_description_of_what_needs_to_be_implemented}}' sections: - id: acceptance-criteria title: Acceptance Criteria @@ -10915,7 +10928,7 @@ sections: title: Functional Requirements type: checklist items: - - "{{specific_functional_requirement}}" + - '{{specific_functional_requirement}}' - id: technical-requirements title: Technical Requirements type: checklist @@ -10923,14 +10936,14 @@ sections: - Code follows C# best practices - Maintains stable frame rate on target devices - No memory leaks or performance degradation - - "{{specific_technical_requirement}}" + - '{{specific_technical_requirement}}' - id: game-design-requirements title: Game Design Requirements type: checklist items: - - "{{gameplay_requirement_from_gdd}}" - - "{{balance_requirement_if_applicable}}" - - "{{player_experience_requirement}}" + - '{{gameplay_requirement_from_gdd}}' + - '{{balance_requirement_if_applicable}}' + - '{{player_experience_requirement}}' - id: success-metrics title: Success Metrics & Quality Assurance @@ -10948,8 +10961,8 @@ sections: - **Build Size:** Final build <{{size_limit}}MB for mobile, <{{desktop_limit}}MB for desktop - **Battery Life:** Mobile gameplay sessions >{{battery_target}} hours on average device examples: - - "Frame Rate: Consistent 60 FPS with <5% drops below 45 FPS on target hardware" - - "Crash Rate: <0.5% across iOS/Android, <0.1% on desktop platforms" + - 'Frame Rate: Consistent 60 FPS with <5% drops below 45 FPS on target hardware' + - 'Crash Rate: <0.5% across iOS/Android, <0.1% on desktop platforms' - id: gameplay-metrics title: Gameplay & User Engagement Metrics type: bullet-list @@ -10961,8 +10974,8 @@ sections: - **Gameplay Completion:** {{completion_rate}}% complete main game content - **Control Responsiveness:** Input lag <{{input_lag}}ms on all platforms examples: - - "Tutorial Completion: 85% of players complete movement and basic mechanics tutorial" - - "Session Duration: Average 15-20 minutes per session for mobile, 30-45 minutes for desktop" + - 'Tutorial Completion: 85% of players complete movement and basic mechanics tutorial' + - 'Session Duration: Average 15-20 minutes per session for mobile, 30-45 minutes for desktop' - id: platform-specific-metrics title: Platform-Specific Quality Metrics type: table @@ -10993,31 +11006,31 @@ sections: instruction: Provide guidance for the Story Manager (SM) agent on how to break down this GDD into implementable user stories template: | **Epic Prioritization:** {{epic_order_rationale}} - + **Story Sizing Guidelines:** - + - Foundation stories: {{foundation_story_scope}} - Feature stories: {{feature_story_scope}} - Polish stories: {{polish_story_scope}} - + **Unity-Specific Story Considerations:** - + - Each story should result in testable Unity scenes or prefabs - Include specific Unity components and systems in acceptance criteria - Consider cross-platform testing requirements - Account for Unity build and deployment steps examples: - - "Foundation stories: Individual Unity systems (Input, Audio, Scene Management) - 1-2 days each" - - "Feature stories: Complete gameplay mechanics with UI and feedback - 2-4 days each" + - 'Foundation stories: Individual Unity systems (Input, Audio, Scene Management) - 1-2 days each' + - 'Feature stories: Complete gameplay mechanics with UI and feedback - 2-4 days each' - id: recommended-agents title: Recommended BMad Agent Sequence type: numbered-list template: | 1. **{{agent_name}}**: {{agent_responsibility}} examples: - - "Unity Architect: Create detailed technical architecture document with specific Unity implementation patterns" - - "Unity Developer: Implement core systems and gameplay mechanics according to architecture" - - "QA Tester: Validate performance metrics and cross-platform functionality" + - 'Unity Architect: Create detailed technical architecture document with specific Unity implementation patterns' + - 'Unity Developer: Implement core systems and gameplay mechanics according to architecture' + - 'QA Tester: Validate performance metrics and cross-platform functionality' ==================== END: .bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml ==================== ==================== START: .bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml ==================== @@ -11027,8 +11040,8 @@ template: version: 3.0 output: format: markdown - filename: "stories/{{epic_name}}/{{story_id}}-{{story_name}}.md" - title: "Story: {{story_title}}" + filename: 'stories/{{epic_name}}/{{story_id}}-{{story_name}}.md' + title: 'Story: {{story_title}}' workflow: mode: interactive @@ -11037,13 +11050,13 @@ sections: - id: initial-setup instruction: | This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. - + Before starting, ensure you have access to: - + - Game Design Document (GDD) - Game Architecture Document - Any existing stories in this epic - + The story should be specific enough that a developer can implement it without requiring additional design decisions. - id: story-header @@ -11057,7 +11070,7 @@ sections: - id: description title: Description instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature. - template: "{{clear_description_of_what_needs_to_be_implemented}}" + template: '{{clear_description_of_what_needs_to_be_implemented}}' - id: acceptance-criteria title: Acceptance Criteria @@ -11067,7 +11080,7 @@ sections: title: Functional Requirements type: checklist items: - - "{{specific_functional_requirement}}" + - '{{specific_functional_requirement}}' - id: technical-requirements title: Technical Requirements type: checklist @@ -11075,14 +11088,14 @@ sections: - Code follows C# best practices - Maintains stable frame rate on target devices - No memory leaks or performance degradation - - "{{specific_technical_requirement}}" + - '{{specific_technical_requirement}}' - id: game-design-requirements title: Game Design Requirements type: checklist items: - - "{{gameplay_requirement_from_gdd}}" - - "{{balance_requirement_if_applicable}}" - - "{{player_experience_requirement}}" + - '{{gameplay_requirement_from_gdd}}' + - '{{balance_requirement_if_applicable}}' + - '{{player_experience_requirement}}' - id: technical-specifications title: Technical Specifications @@ -11092,12 +11105,12 @@ sections: title: Files to Create/Modify template: | **New Files:** - + - `{{file_path_1}}` - {{purpose}} - `{{file_path_2}}` - {{purpose}} - + **Modified Files:** - + - `{{existing_file_1}}` - {{changes_needed}} - `{{existing_file_2}}` - {{changes_needed}} - id: class-interface-definitions @@ -11180,13 +11193,13 @@ sections: instruction: Reference the specific sections of the GDD that this story implements template: | **GDD Reference:** {{section_name}} ({{page_or_section_number}}) - + **Game Mechanic:** {{mechanic_name}} - + **Player Experience Goal:** {{experience_description}} - + **Balance Parameters:** - + - {{parameter_1}}: {{value_or_range}} - {{parameter_2}}: {{value_or_range}} @@ -11233,15 +11246,15 @@ sections: instruction: List any dependencies that must be completed before this story can be implemented template: | **Story Dependencies:** - + - {{story_id}}: {{dependency_description}} - + **Technical Dependencies:** - + - {{system_or_file}}: {{requirement}} - + **Asset Dependencies:** - + - {{asset_type}}: {{asset_description}} - Location: `{{asset_path}}` @@ -11257,24 +11270,24 @@ sections: - Performance targets met - No C# compiler errors or warnings - Documentation updated - - "{{game_specific_dod_item}}" + - '{{game_specific_dod_item}}' - id: notes title: Notes instruction: Any additional context, design decisions, or implementation notes template: | **Implementation Notes:** - + - {{note_1}} - {{note_2}} - + **Design Decisions:** - + - {{decision_1}}: {{rationale}} - {{decision_2}}: {{rationale}} - + **Future Considerations:** - + - {{future_enhancement_1}} - {{future_optimization_1}} ==================== END: .bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml ==================== @@ -11287,7 +11300,7 @@ template: output: format: markdown filename: docs/level-design-document.md - title: "{{game_title}} Level Design Document" + title: '{{game_title}} Level Design Document' workflow: mode: interactive @@ -11296,7 +11309,7 @@ sections: - id: initial-setup instruction: | This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. - id: introduction @@ -11304,7 +11317,7 @@ sections: instruction: Establish the purpose and scope of level design for this game content: | This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. sections: - id: change-log @@ -11348,32 +11361,32 @@ sections: repeatable: true sections: - id: level-category - title: "{{category_name}} Levels" + title: '{{category_name}} Levels' template: | **Purpose:** {{gameplay_purpose}} - + **Target Duration:** {{min_time}} - {{max_time}} minutes - + **Difficulty Range:** {{difficulty_scale}} - + **Key Mechanics Featured:** - + - {{mechanic_1}} - {{usage_description}} - {{mechanic_2}} - {{usage_description}} - + **Player Objectives:** - + - Primary: {{primary_objective}} - Secondary: {{secondary_objective}} - Hidden: {{secret_objective}} - + **Success Criteria:** - + - {{completion_requirement_1}} - {{completion_requirement_2}} - + **Technical Requirements:** - + - Maximum entities: {{entity_limit}} - Performance target: {{fps_target}} FPS - Memory budget: {{memory_limit}}MB @@ -11388,11 +11401,11 @@ sections: instruction: Based on GDD requirements, define the overall level organization template: | **Organization Type:** {{linear|hub_world|open_world}} - + **Total Level Count:** {{number}} - + **World Breakdown:** - + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} @@ -11427,7 +11440,7 @@ sections: instruction: Define how players access new levels template: | **Progression Gates:** - + - Linear progression: Complete previous level - Star requirements: {{star_count}} stars to unlock - Skill gates: Demonstrate {{skill_requirement}} @@ -11442,17 +11455,17 @@ sections: instruction: Define all environmental components that can be used in levels template: | **Terrain Types:** - + - {{terrain_1}}: {{properties_and_usage}} - {{terrain_2}}: {{properties_and_usage}} - + **Interactive Objects:** - + - {{object_1}}: {{behavior_and_purpose}} - {{object_2}}: {{behavior_and_purpose}} - + **Hazards and Obstacles:** - + - {{hazard_1}}: {{damage_and_behavior}} - {{hazard_2}}: {{damage_and_behavior}} - id: collectibles-rewards @@ -11460,18 +11473,18 @@ sections: instruction: Define all collectible items and their placement rules template: | **Collectible Types:** - + - {{collectible_1}}: {{value_and_purpose}} - {{collectible_2}}: {{value_and_purpose}} - + **Placement Guidelines:** - + - Mandatory collectibles: {{placement_rules}} - Optional collectibles: {{placement_rules}} - Secret collectibles: {{placement_rules}} - + **Reward Distribution:** - + - Easy to find: {{percentage}}% - Moderate challenge: {{percentage}}% - High skill required: {{percentage}}% @@ -11480,18 +11493,18 @@ sections: instruction: Define how enemies should be placed and balanced in levels template: | **Enemy Categories:** - + - {{enemy_type_1}}: {{behavior_and_usage}} - {{enemy_type_2}}: {{behavior_and_usage}} - + **Placement Principles:** - + - Introduction encounters: {{guideline}} - Standard encounters: {{guideline}} - Challenge encounters: {{guideline}} - + **Difficulty Scaling:** - + - Enemy count progression: {{scaling_rule}} - Enemy type introduction: {{pacing_rule}} - Encounter complexity: {{complexity_rule}} @@ -11504,14 +11517,14 @@ sections: title: Level Layout Principles template: | **Spatial Design:** - + - Grid size: {{grid_dimensions}} - Minimum path width: {{width_units}} - Maximum vertical distance: {{height_units}} - Safe zones placement: {{safety_guidelines}} - + **Navigation Design:** - + - Clear path indication: {{visual_cues}} - Landmark placement: {{landmark_rules}} - Dead end avoidance: {{dead_end_policy}} @@ -11521,13 +11534,13 @@ sections: instruction: Define how to control the rhythm and pace of gameplay within levels template: | **Action Sequences:** - + - High intensity duration: {{max_duration}} - Rest period requirement: {{min_rest_time}} - Intensity variation: {{pacing_pattern}} - + **Learning Sequences:** - + - New mechanic introduction: {{teaching_method}} - Practice opportunity: {{practice_duration}} - Skill application: {{application_context}} @@ -11536,14 +11549,14 @@ sections: instruction: Define how to create appropriate challenges for each level type template: | **Challenge Types:** - + - Execution challenges: {{skill_requirements}} - Puzzle challenges: {{complexity_guidelines}} - Time challenges: {{time_pressure_rules}} - Resource challenges: {{resource_management}} - + **Difficulty Calibration:** - + - Skill check frequency: {{frequency_guidelines}} - Failure recovery: {{retry_mechanics}} - Hint system integration: {{help_system}} @@ -11557,7 +11570,7 @@ sections: instruction: Define how level data should be structured for implementation template: | **Level File Format:** - + - Data format: {{json|yaml|custom}} - File naming: `level_{{world}}_{{number}}.{{extension}}` - Data organization: {{structure_description}} @@ -11595,14 +11608,14 @@ sections: instruction: Define how level assets are organized and loaded template: | **Tilemap Requirements:** - + - Tile size: {{tile_dimensions}}px - Tileset organization: {{tileset_structure}} - Layer organization: {{layer_system}} - Collision data: {{collision_format}} - + **Audio Integration:** - + - Background music: {{music_requirements}} - Ambient sounds: {{ambient_system}} - Dynamic audio: {{dynamic_audio_rules}} @@ -11611,19 +11624,19 @@ sections: instruction: Define performance requirements for level systems template: | **Entity Limits:** - + - Maximum active entities: {{entity_limit}} - Maximum particles: {{particle_limit}} - Maximum audio sources: {{audio_limit}} - + **Memory Management:** - + - Texture memory budget: {{texture_memory}}MB - Audio memory budget: {{audio_memory}}MB - Level loading time: <{{load_time}}s - + **Culling and LOD:** - + - Off-screen culling: {{culling_distance}} - Level-of-detail rules: {{lod_system}} - Asset streaming: {{streaming_requirements}} @@ -11636,13 +11649,13 @@ sections: title: Automated Testing template: | **Performance Testing:** - + - Frame rate validation: Maintain {{fps_target}} FPS - Memory usage monitoring: Stay under {{memory_limit}}MB - Loading time verification: Complete in <{{load_time}}s - + **Gameplay Testing:** - + - Completion path validation: All objectives achievable - Collectible accessibility: All items reachable - Softlock prevention: No unwinnable states @@ -11670,14 +11683,14 @@ sections: title: Balance Validation template: | **Metrics Collection:** - + - Completion rate: Target {{completion_percentage}}% - Average completion time: {{target_time}} ± {{variance}} - Death count per level: <{{max_deaths}} - Collectible discovery rate: {{discovery_percentage}}% - + **Iteration Guidelines:** - + - Adjustment criteria: {{criteria_for_changes}} - Testing sample size: {{minimum_testers}} - Validation period: {{testing_duration}} @@ -11690,14 +11703,14 @@ sections: title: Design Phase template: | **Concept Development:** - + 1. Define level purpose and goals 2. Create rough layout sketch 3. Identify key mechanics and challenges 4. Estimate difficulty and duration - + **Documentation Requirements:** - + - Level design brief - Layout diagrams - Mechanic integration notes @@ -11706,15 +11719,15 @@ sections: title: Implementation Phase template: | **Technical Implementation:** - + 1. Create level data file 2. Build tilemap and layout 3. Place entities and objects 4. Configure level logic and triggers 5. Integrate audio and visual effects - + **Quality Assurance:** - + 1. Automated testing execution 2. Internal playtesting 3. Performance validation @@ -11723,14 +11736,14 @@ sections: title: Integration Phase template: | **Game Integration:** - + 1. Level progression integration 2. Save system compatibility 3. Analytics integration 4. Achievement system integration - + **Final Validation:** - + 1. Full game context testing 2. Performance regression testing 3. Platform compatibility verification @@ -13657,21 +13670,21 @@ workflow: - brainstorming_session - game_research_prompt - player_research - notes: 'Start with brainstorming game concepts, then create comprehensive game brief. SAVE OUTPUT: Copy final game-brief.md to your project''s docs/design/ folder.' + notes: "Start with brainstorming game concepts, then create comprehensive game brief. SAVE OUTPUT: Copy final game-brief.md to your project's docs/design/ folder." - agent: game-designer creates: game-design-doc.md requires: game-brief.md optional_steps: - competitive_analysis - technical_research - notes: 'Create detailed Game Design Document using game-design-doc-tmpl. Defines all gameplay mechanics, progression, and technical requirements. SAVE OUTPUT: Copy final game-design-doc.md to your project''s docs/design/ folder.' + notes: "Create detailed Game Design Document using game-design-doc-tmpl. Defines all gameplay mechanics, progression, and technical requirements. SAVE OUTPUT: Copy final game-design-doc.md to your project's docs/design/ folder." - agent: game-designer creates: level-design-doc.md requires: game-design-doc.md optional_steps: - level_prototyping - difficulty_analysis - notes: 'Create level design framework using level-design-doc-tmpl. Establishes content creation guidelines and performance requirements. SAVE OUTPUT: Copy final level-design-doc.md to your project''s docs/design/ folder.' + notes: "Create level design framework using level-design-doc-tmpl. Establishes content creation guidelines and performance requirements. SAVE OUTPUT: Copy final level-design-doc.md to your project's docs/design/ folder." - agent: solution-architect creates: game-architecture.md requires: @@ -13681,7 +13694,7 @@ workflow: - technical_research_prompt - performance_analysis - platform_research - notes: 'Create comprehensive technical architecture using game-architecture-tmpl. Defines Unity systems, performance optimization, and code structure. SAVE OUTPUT: Copy final game-architecture.md to your project''s docs/architecture/ folder.' + notes: "Create comprehensive technical architecture using game-architecture-tmpl. Defines Unity systems, performance optimization, and code structure. SAVE OUTPUT: Copy final game-architecture.md to your project's docs/architecture/ folder." - agent: game-designer validates: design_consistency requires: all_design_documents @@ -13706,7 +13719,7 @@ workflow: optional_steps: - quick_brainstorming - concept_validation - notes: 'Create focused game brief for prototype. Emphasize core mechanics and immediate playability. SAVE OUTPUT: Copy final game-brief.md to your project''s docs/ folder.' + notes: "Create focused game brief for prototype. Emphasize core mechanics and immediate playability. SAVE OUTPUT: Copy final game-brief.md to your project's docs/ folder." - agent: game-designer creates: prototype-design.md uses: create-doc prototype-design OR create-game-story @@ -14460,7 +14473,7 @@ Use the `shard-doc` task or `@kayvan/markdown-tree-parser` tool for automatic ga - **Claude Code**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Cursor**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` -- **Windsurf**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` +- **Windsurf**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Trae**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` - **Roo Code**: Select mode from mode selector with bmad2du prefix - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select the appropriate game agent. diff --git a/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt b/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt index 36ef5a65..d3ffa32d 100644 --- a/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +++ b/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt @@ -530,40 +530,40 @@ template: output: format: markdown filename: docs/infrastructure-architecture.md - title: "{{project_name}} Infrastructure Architecture" + title: '{{project_name}} Infrastructure Architecture' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Infrastructure Architecture Elicitation Actions" + title: 'Infrastructure Architecture Elicitation Actions' sections: - id: infrastructure-overview options: - - "Multi-Cloud Strategy Analysis - Evaluate cloud provider options and vendor lock-in considerations" - - "Regional Distribution Planning - Analyze latency requirements and data residency needs" - - "Environment Isolation Strategy - Design security boundaries and resource segregation" - - "Scalability Patterns Review - Assess auto-scaling needs and traffic patterns" - - "Compliance Requirements Analysis - Review regulatory and security compliance needs" - - "Cost-Benefit Analysis - Compare infrastructure options and TCO" - - "Proceed to next section" + - 'Multi-Cloud Strategy Analysis - Evaluate cloud provider options and vendor lock-in considerations' + - 'Regional Distribution Planning - Analyze latency requirements and data residency needs' + - 'Environment Isolation Strategy - Design security boundaries and resource segregation' + - 'Scalability Patterns Review - Assess auto-scaling needs and traffic patterns' + - 'Compliance Requirements Analysis - Review regulatory and security compliance needs' + - 'Cost-Benefit Analysis - Compare infrastructure options and TCO' + - 'Proceed to next section' sections: - id: initial-setup instruction: | Initial Setup - + 1. Replace {{project_name}} with the actual project name throughout the document 2. Gather and review required inputs: - Product Requirements Document (PRD) - Required for business needs and scale requirements - Main System Architecture - Required for infrastructure dependencies - Technical Preferences/Tech Stack Document - Required for technology choices - PRD Technical Assumptions - Required for cross-referencing repository and service architecture - + If any required documents are missing, ask user: "I need the following documents to create a comprehensive infrastructure architecture: [list missing]. Would you like to proceed with available information or provide the missing documents first?" - + 3. Cross-reference with PRD Technical Assumptions to ensure infrastructure decisions align with repository and service architecture decisions made in the system architecture. - + Output file location: `docs/infrastructure-architecture.md` - id: infrastructure-overview @@ -592,7 +592,7 @@ sections: - Repository Structure - State Management - Dependency Management - + All infrastructure must be defined as code. No manual resource creation in production environments. - id: environment-configuration @@ -606,7 +606,7 @@ sections: sections: - id: environments repeatable: true - title: "{{environment_name}} Environment" + title: '{{environment_name}} Environment' template: | - **Purpose:** {{environment_purpose}} - **Resources:** {{environment_resources}} @@ -628,7 +628,7 @@ sections: title: Network Architecture instruction: | Design network topology considering security zones, traffic patterns, and compliance requirements. Reference main architecture for service communication patterns. - + Create Mermaid diagram showing: - VPC/Network structure - Security zones and boundaries @@ -691,7 +691,7 @@ sections: title: Data Resources instruction: | Design data infrastructure based on data architecture from main system design. Consider data volumes, access patterns, compliance, and recovery requirements. - + Create data flow diagram showing: - Database topology - Replication patterns @@ -712,7 +712,7 @@ sections: - Data Encryption - Compliance Controls - Security Scanning & Monitoring - + Apply principle of least privilege for all access controls. Document all security exceptions with business justification. - id: shared-responsibility @@ -748,7 +748,7 @@ sections: title: CI/CD Pipeline instruction: | Design deployment pipeline that balances speed with safety. Include progressive deployment strategies and automated quality gates. - + Create pipeline diagram showing: - Build stages - Test gates @@ -779,7 +779,7 @@ sections: - Recovery Procedures - RTO & RPO Targets - DR Testing Approach - + DR procedures must be tested at least quarterly. Document test results and improvement actions. - id: cost-optimization @@ -821,15 +821,15 @@ sections: title: DevOps/Platform Feasibility Review instruction: | CRITICAL STEP - Present architectural blueprint summary to DevOps/Platform Engineering Agent for feasibility review. Request specific feedback on: - + - **Operational Complexity:** Are the proposed patterns implementable with current tooling and expertise? - **Resource Constraints:** Do infrastructure requirements align with available resources and budgets? - **Security Implementation:** Are security patterns achievable with current security toolchain? - **Operational Overhead:** Will the proposed architecture create excessive operational burden? - **Technology Constraints:** Are selected technologies compatible with existing infrastructure? - + Document all feasibility feedback and concerns raised. Iterate on architectural decisions based on operational constraints and feedback. - + Address all critical feasibility concerns before proceeding to final architecture documentation. If critical blockers identified, revise architecture before continuing. sections: - id: feasibility-results @@ -847,7 +847,7 @@ sections: title: Validation Framework content: | This infrastructure architecture will be validated using the comprehensive `infrastructure-checklist.md`, with particular focus on Section 12: Architecture Documentation Validation. The checklist ensures: - + - Completeness of architecture documentation - Consistency with broader system architecture - Appropriate level of detail for different stakeholders @@ -857,12 +857,12 @@ sections: title: Validation Process content: | The architecture documentation validation should be performed: - + - After initial architecture development - After significant architecture changes - Before major implementation phases - During periodic architecture reviews - + The Platform Engineer should use the infrastructure checklist to systematically validate all aspects of this architecture document. - id: implementation-handoff @@ -873,7 +873,7 @@ sections: title: Architecture Decision Records (ADRs) content: | Create ADRs for key infrastructure decisions: - + - Cloud provider selection rationale - Container orchestration platform choice - Networking architecture decisions @@ -883,7 +883,7 @@ sections: title: Implementation Validation Criteria content: | Define specific criteria for validating correct implementation: - + - Infrastructure as Code quality gates - Security compliance checkpoints - Performance benchmarks @@ -943,7 +943,7 @@ sections: instruction: Final Review - Ensure all sections are complete and consistent. Verify feasibility review was conducted and all concerns addressed. Apply final validation against infrastructure checklist. content: | --- - + _Document Version: 1.0_ _Last Updated: {{current_date}}_ _Next Review: {{review_date}}_ @@ -957,30 +957,30 @@ template: output: format: markdown filename: docs/platform-infrastructure/platform-implementation.md - title: "{{project_name}} Platform Infrastructure Implementation" + title: '{{project_name}} Platform Infrastructure Implementation' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Platform Implementation Elicitation Actions" + title: 'Platform Implementation Elicitation Actions' sections: - id: foundation-infrastructure options: - - "Platform Layer Security Hardening - Additional security controls and compliance validation" - - "Performance Optimization - Network and resource optimization" - - "Operational Excellence Enhancement - Automation and monitoring improvements" - - "Platform Integration Validation - Verify foundation supports upper layers" - - "Developer Experience Analysis - Foundation impact on developer workflows" - - "Disaster Recovery Testing - Foundation resilience validation" - - "BMAD Workflow Integration - Cross-agent support verification" - - "Finalize and Proceed to Container Platform" + - 'Platform Layer Security Hardening - Additional security controls and compliance validation' + - 'Performance Optimization - Network and resource optimization' + - 'Operational Excellence Enhancement - Automation and monitoring improvements' + - 'Platform Integration Validation - Verify foundation supports upper layers' + - 'Developer Experience Analysis - Foundation impact on developer workflows' + - 'Disaster Recovery Testing - Foundation resilience validation' + - 'BMAD Workflow Integration - Cross-agent support verification' + - 'Finalize and Proceed to Container Platform' sections: - id: initial-setup instruction: | Initial Setup - + 1. Replace {{project_name}} with the actual project name throughout the document 2. Gather and review required inputs: - **Infrastructure Architecture Document** (Primary input - REQUIRED) @@ -989,10 +989,10 @@ sections: - Technology Stack Document - Infrastructure Checklist - NOTE: If Infrastructure Architecture Document is missing, HALT and request: "I need the Infrastructure Architecture Document to proceed with platform implementation. This document defines the infrastructure design that we'll be implementing." - + 3. Validate that the infrastructure architecture has been reviewed and approved 4. All platform implementation must align with the approved infrastructure architecture. Any deviations require architect approval. - + Output file location: `docs/platform-infrastructure/platform-implementation.md` - id: executive-summary @@ -1065,7 +1065,7 @@ sections: # Example Terraform for VPC setup module "vpc" { source = "./modules/vpc" - + cidr_block = "{{vpc_cidr}}" availability_zones = {{availability_zones}} public_subnets = {{public_subnets}} @@ -1460,7 +1460,7 @@ sections: // K6 Load Test Example import http from 'k6/http'; import { check } from 'k6'; - + export let options = { stages: [ { duration: '5m', target: {{target_users}} }, @@ -1574,7 +1574,7 @@ sections: instruction: Final Review - Ensure all platform layers are properly implemented, integrated, and documented. Verify that the implementation fully supports the BMAD methodology and all agent workflows. Confirm successful validation against the infrastructure checklist. content: | --- - + _Platform Version: 1.0_ _Implementation Date: {{implementation_date}}_ _Next Review: {{review_date}}_ diff --git a/dist/teams/team-all.txt b/dist/teams/team-all.txt index 1b054b24..e2cb3c61 100644 --- a/dist/teams/team-all.txt +++ b/dist/teams/team-all.txt @@ -1261,7 +1261,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing - **Claude Code**: `/agent-name` (e.g., `/bmad-master`) - **Cursor**: `@agent-name` (e.g., `@bmad-master`) -- **Windsurf**: `@agent-name` (e.g., `@bmad-master`) +- **Windsurf**: `/agent-name` (e.g., `/bmad-master`) - **Trae**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-master`) - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. @@ -2001,7 +2001,7 @@ Agents should be workflow-aware: know active workflow, their role, access artifa ==================== START: .bmad-core/tasks/facilitate-brainstorming-session.md ==================== --- docOutputLocation: docs/brainstorming-session-results.md -template: ".bmad-core/templates/brainstorming-output-tmpl.yaml" +template: '.bmad-core/templates/brainstorming-output-tmpl.yaml' --- # Facilitate Brainstorming Session Task @@ -2772,35 +2772,35 @@ template: output: format: markdown filename: docs/brief.md - title: "Project Brief: {{project_name}}" + title: 'Project Brief: {{project_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Project Brief Elicitation Actions" + title: 'Project Brief Elicitation Actions' options: - - "Expand section with more specific details" - - "Validate against similar successful products" - - "Stress test assumptions with edge cases" - - "Explore alternative solution approaches" - - "Analyze resource/constraint trade-offs" - - "Generate risk mitigation strategies" - - "Challenge scope from MVP minimalist view" - - "Brainstorm creative feature possibilities" - - "If only we had [resource/capability/time]..." - - "Proceed to next section" + - 'Expand section with more specific details' + - 'Validate against similar successful products' + - 'Stress test assumptions with edge cases' + - 'Explore alternative solution approaches' + - 'Analyze resource/constraint trade-offs' + - 'Generate risk mitigation strategies' + - 'Challenge scope from MVP minimalist view' + - 'Brainstorm creative feature possibilities' + - 'If only we had [resource/capability/time]...' + - 'Proceed to next section' sections: - id: introduction instruction: | This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - + Start by asking the user which mode they prefer: - + 1. **Interactive Mode** - Work through each section collaboratively 2. **YOLO Mode** - Generate complete draft for review and refinement - + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. - id: executive-summary @@ -2811,7 +2811,7 @@ sections: - Primary problem being solved - Target market identification - Key value proposition - template: "{{executive_summary_content}}" + template: '{{executive_summary_content}}' - id: problem-statement title: Problem Statement @@ -2821,7 +2821,7 @@ sections: - Impact of the problem (quantify if possible) - Why existing solutions fall short - Urgency and importance of solving this now - template: "{{detailed_problem_description}}" + template: '{{detailed_problem_description}}' - id: proposed-solution title: Proposed Solution @@ -2831,7 +2831,7 @@ sections: - Key differentiators from existing solutions - Why this solution will succeed where others haven't - High-level vision for the product - template: "{{solution_description}}" + template: '{{solution_description}}' - id: target-users title: Target Users @@ -2843,12 +2843,12 @@ sections: - Goals they're trying to achieve sections: - id: primary-segment - title: "Primary User Segment: {{segment_name}}" - template: "{{primary_user_description}}" + title: 'Primary User Segment: {{segment_name}}' + template: '{{primary_user_description}}' - id: secondary-segment - title: "Secondary User Segment: {{segment_name}}" + title: 'Secondary User Segment: {{segment_name}}' condition: Has secondary user segment - template: "{{secondary_user_description}}" + template: '{{secondary_user_description}}' - id: goals-metrics title: Goals & Success Metrics @@ -2857,15 +2857,15 @@ sections: - id: business-objectives title: Business Objectives type: bullet-list - template: "- {{objective_with_metric}}" + template: '- {{objective_with_metric}}' - id: user-success-metrics title: User Success Metrics type: bullet-list - template: "- {{user_metric}}" + template: '- {{user_metric}}' - id: kpis title: Key Performance Indicators (KPIs) type: bullet-list - template: "- {{kpi}}: {{definition_and_target}}" + template: '- {{kpi}}: {{definition_and_target}}' - id: mvp-scope title: MVP Scope @@ -2874,14 +2874,14 @@ sections: - id: core-features title: Core Features (Must Have) type: bullet-list - template: "- **{{feature}}:** {{description_and_rationale}}" + template: '- **{{feature}}:** {{description_and_rationale}}' - id: out-of-scope title: Out of Scope for MVP type: bullet-list - template: "- {{feature_or_capability}}" + template: '- {{feature_or_capability}}' - id: mvp-success-criteria title: MVP Success Criteria - template: "{{mvp_success_definition}}" + template: '{{mvp_success_definition}}' - id: post-mvp-vision title: Post-MVP Vision @@ -2889,13 +2889,13 @@ sections: sections: - id: phase-2-features title: Phase 2 Features - template: "{{next_priority_features}}" + template: '{{next_priority_features}}' - id: long-term-vision title: Long-term Vision - template: "{{one_two_year_vision}}" + template: '{{one_two_year_vision}}' - id: expansion-opportunities title: Expansion Opportunities - template: "{{potential_expansions}}" + template: '{{potential_expansions}}' - id: technical-considerations title: Technical Considerations @@ -2936,7 +2936,7 @@ sections: - id: key-assumptions title: Key Assumptions type: bullet-list - template: "- {{assumption}}" + template: '- {{assumption}}' - id: risks-questions title: Risks & Open Questions @@ -2945,15 +2945,15 @@ sections: - id: key-risks title: Key Risks type: bullet-list - template: "- **{{risk}}:** {{description_and_impact}}" + template: '- **{{risk}}:** {{description_and_impact}}' - id: open-questions title: Open Questions type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: research-areas title: Areas Needing Further Research type: bullet-list - template: "- {{research_topic}}" + template: '- {{research_topic}}' - id: appendices title: Appendices @@ -2970,10 +2970,10 @@ sections: - id: stakeholder-input title: B. Stakeholder Input condition: Has stakeholder feedback - template: "{{stakeholder_feedback}}" + template: '{{stakeholder_feedback}}' - id: references title: C. References - template: "{{relevant_links_and_docs}}" + template: '{{relevant_links_and_docs}}' - id: next-steps title: Next Steps @@ -2981,7 +2981,7 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action_item}}" + template: '{{action_item}}' - id: pm-handoff title: PM Handoff content: | @@ -2996,24 +2996,24 @@ template: output: format: markdown filename: docs/market-research.md - title: "Market Research Report: {{project_product_name}}" + title: 'Market Research Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Market Research Elicitation Actions" + title: 'Market Research Elicitation Actions' options: - - "Expand market sizing calculations with sensitivity analysis" - - "Deep dive into a specific customer segment" - - "Analyze an emerging market trend in detail" - - "Compare this market to an analogous market" - - "Stress test market assumptions" - - "Explore adjacent market opportunities" - - "Challenge market definition and boundaries" - - "Generate strategic scenarios (best/base/worst case)" - - "If only we had considered [X market factor]..." - - "Proceed to next section" + - 'Expand market sizing calculations with sensitivity analysis' + - 'Deep dive into a specific customer segment' + - 'Analyze an emerging market trend in detail' + - 'Compare this market to an analogous market' + - 'Stress test market assumptions' + - 'Explore adjacent market opportunities' + - 'Challenge market definition and boundaries' + - 'Generate strategic scenarios (best/base/worst case)' + - 'If only we had considered [X market factor]...' + - 'Proceed to next section' sections: - id: executive-summary @@ -3095,7 +3095,7 @@ sections: repeatable: true sections: - id: segment - title: "Segment {{segment_number}}: {{segment_name}}" + title: 'Segment {{segment_number}}: {{segment_name}}' template: | - **Description:** {{brief_overview}} - **Size:** {{number_of_customers_market_value}} @@ -3121,7 +3121,7 @@ sections: instruction: Map the end-to-end customer experience for primary segments template: | For primary customer segment: - + 1. **Awareness:** {{discovery_process}} 2. **Consideration:** {{evaluation_criteria}} 3. **Purchase:** {{decision_triggers}} @@ -3164,20 +3164,20 @@ sections: instruction: Analyze each force with specific evidence and implications sections: - id: supplier-power - title: "Supplier Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Supplier Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: buyer-power - title: "Buyer Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Buyer Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: competitive-rivalry - title: "Competitive Rivalry: {{intensity_level}}" - template: "{{analysis_and_implications}}" + title: 'Competitive Rivalry: {{intensity_level}}' + template: '{{analysis_and_implications}}' - id: threat-new-entry - title: "Threat of New Entry: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of New Entry: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: threat-substitutes - title: "Threat of Substitutes: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of Substitutes: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: adoption-lifecycle title: Technology Adoption Lifecycle Stage instruction: | @@ -3195,7 +3195,7 @@ sections: repeatable: true sections: - id: opportunity - title: "Opportunity {{opportunity_number}}: {{name}}" + title: 'Opportunity {{opportunity_number}}: {{name}}' template: | - **Description:** {{what_is_the_opportunity}} - **Size/Potential:** {{quantified_potential}} @@ -3251,24 +3251,24 @@ template: output: format: markdown filename: docs/competitor-analysis.md - title: "Competitive Analysis Report: {{project_product_name}}" + title: 'Competitive Analysis Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Competitive Analysis Elicitation Actions" + title: 'Competitive Analysis Elicitation Actions' options: - "Deep dive on a specific competitor's strategy" - - "Analyze competitive dynamics in a specific segment" - - "War game competitive responses to your moves" - - "Explore partnership vs. competition scenarios" - - "Stress test differentiation claims" - - "Analyze disruption potential (yours or theirs)" - - "Compare to competition in adjacent markets" - - "Generate win/loss analysis insights" + - 'Analyze competitive dynamics in a specific segment' + - 'War game competitive responses to your moves' + - 'Explore partnership vs. competition scenarios' + - 'Stress test differentiation claims' + - 'Analyze disruption potential (yours or theirs)' + - 'Compare to competition in adjacent markets' + - 'Generate win/loss analysis insights' - "If only we had known about [competitor X's plan]..." - - "Proceed to next section" + - 'Proceed to next section' sections: - id: executive-summary @@ -3322,7 +3322,7 @@ sections: title: Competitor Prioritization Matrix instruction: | Help categorize competitors by market share and strategic threat level - + Create a 2x2 matrix: - Priority 1 (Core Competitors): High Market Share + High Threat - Priority 2 (Emerging Threats): Low Market Share + High Threat @@ -3335,7 +3335,7 @@ sections: repeatable: true sections: - id: competitor - title: "{{competitor_name}} - Priority {{priority_level}}" + title: '{{competitor_name}} - Priority {{priority_level}}' sections: - id: company-overview title: Company Overview @@ -3367,11 +3367,11 @@ sections: - id: strengths title: Strengths type: bullet-list - template: "- {{strength}}" + template: '- {{strength}}' - id: weaknesses title: Weaknesses type: bullet-list - template: "- {{weakness}}" + template: '- {{weakness}}' - id: market-position title: Market Position & Performance template: | @@ -3387,24 +3387,37 @@ sections: title: Feature Comparison Matrix instruction: Create a detailed comparison table of key features across competitors type: table - columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + columns: + [ + 'Feature Category', + '{{your_company}}', + '{{competitor_1}}', + '{{competitor_2}}', + '{{competitor_3}}', + ] rows: - - category: "Core Functionality" + - category: 'Core Functionality' items: - - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - category: "User Experience" + - ['Feature A', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - ['Feature B', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - category: 'User Experience' items: - - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] - - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] - - category: "Integration & Ecosystem" + - ['Mobile App', '{{rating}}', '{{rating}}', '{{rating}}', '{{rating}}'] + - ['Onboarding Time', '{{time}}', '{{time}}', '{{time}}', '{{time}}'] + - category: 'Integration & Ecosystem' items: - - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] - - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] - - category: "Pricing & Plans" + - [ + 'API Availability', + '{{availability}}', + '{{availability}}', + '{{availability}}', + '{{availability}}', + ] + - ['Third-party Integrations', '{{number}}', '{{number}}', '{{number}}', '{{number}}'] + - category: 'Pricing & Plans' items: - - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] - - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - ['Starting Price', '{{price}}', '{{price}}', '{{price}}', '{{price}}'] + - ['Free Tier', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}'] - id: swot-comparison title: SWOT Comparison instruction: Create SWOT analysis for your solution vs. top competitors @@ -3417,7 +3430,7 @@ sections: - **Opportunities:** {{opportunities}} - **Threats:** {{threats}} - id: vs-competitor - title: "vs. {{main_competitor}}" + title: 'vs. {{main_competitor}}' template: | - **Competitive Advantages:** {{your_advantages}} - **Competitive Disadvantages:** {{their_advantages}} @@ -3426,7 +3439,7 @@ sections: title: Positioning Map instruction: | Describe competitor positions on key dimensions - + Create a positioning description using 2 key dimensions relevant to the market, such as: - Price vs. Features - Ease of Use vs. Power @@ -3461,7 +3474,7 @@ sections: title: Blue Ocean Opportunities instruction: | Identify uncontested market spaces - + List opportunities to create new market space: - Underserved segments - Unaddressed use cases @@ -3547,7 +3560,7 @@ template: output: format: markdown filename: docs/brainstorming-session-results.md - title: "Brainstorming Session Results" + title: 'Brainstorming Session Results' workflow: mode: non-interactive @@ -3565,45 +3578,45 @@ sections: - id: summary-details template: | **Topic:** {{session_topic}} - + **Session Goals:** {{stated_goals}} - + **Techniques Used:** {{techniques_list}} - + **Total Ideas Generated:** {{total_ideas}} - id: key-themes - title: "Key Themes Identified:" + title: 'Key Themes Identified:' type: bullet-list - template: "- {{theme}}" + template: '- {{theme}}' - id: technique-sessions title: Technique Sessions repeatable: true sections: - id: technique - title: "{{technique_name}} - {{duration}}" + title: '{{technique_name}} - {{duration}}' sections: - id: description - template: "**Description:** {{technique_description}}" + template: '**Description:** {{technique_description}}' - id: ideas-generated - title: "Ideas Generated:" + title: 'Ideas Generated:' type: numbered-list - template: "{{idea}}" + template: '{{idea}}' - id: insights - title: "Insights Discovered:" + title: 'Insights Discovered:' type: bullet-list - template: "- {{insight}}" + template: '- {{insight}}' - id: connections - title: "Notable Connections:" + title: 'Notable Connections:' type: bullet-list - template: "- {{connection}}" + template: '- {{connection}}' - id: idea-categorization title: Idea Categorization sections: - id: immediate-opportunities title: Immediate Opportunities - content: "*Ideas ready to implement now*" + content: '*Ideas ready to implement now*' repeatable: true type: numbered-list template: | @@ -3613,7 +3626,7 @@ sections: - Resources needed: {{requirements}} - id: future-innovations title: Future Innovations - content: "*Ideas requiring development/research*" + content: '*Ideas requiring development/research*' repeatable: true type: numbered-list template: | @@ -3623,7 +3636,7 @@ sections: - Timeline estimate: {{timeline}} - id: moonshots title: Moonshots - content: "*Ambitious, transformative concepts*" + content: '*Ambitious, transformative concepts*' repeatable: true type: numbered-list template: | @@ -3633,9 +3646,9 @@ sections: - Challenges to overcome: {{challenges}} - id: insights-learnings title: Insights & Learnings - content: "*Key realizations from the session*" + content: '*Key realizations from the session*' type: bullet-list - template: "- {{insight}}: {{description_and_implications}}" + template: '- {{insight}}: {{description_and_implications}}' - id: action-planning title: Action Planning @@ -3644,21 +3657,21 @@ sections: title: Top 3 Priority Ideas sections: - id: priority-1 - title: "#1 Priority: {{idea_name}}" + title: '#1 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-2 - title: "#2 Priority: {{idea_name}}" + title: '#2 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-3 - title: "#3 Priority: {{idea_name}}" + title: '#3 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} @@ -3671,19 +3684,19 @@ sections: - id: what-worked title: What Worked Well type: bullet-list - template: "- {{aspect}}" + template: '- {{aspect}}' - id: areas-exploration title: Areas for Further Exploration type: bullet-list - template: "- {{area}}: {{reason}}" + template: '- {{area}}: {{reason}}' - id: recommended-techniques title: Recommended Follow-up Techniques type: bullet-list - template: "- {{technique}}: {{reason}}" + template: '- {{technique}}: {{reason}}' - id: questions-emerged title: Questions That Emerged type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: next-session title: Next Session Planning template: | @@ -3694,7 +3707,7 @@ sections: - id: footer content: | --- - + *Session facilitated using the BMAD-METHOD brainstorming framework* ==================== END: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== @@ -3834,7 +3847,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Architecture Document" + title: '{{project_name}} Architecture Document' workflow: mode: interactive @@ -3849,20 +3862,20 @@ sections: - id: intro-content content: | This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - + **Relationship to Frontend Architecture:** If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - + 1. Review the PRD and brainstorming brief for any mentions of: - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) - Existing projects or codebases being used as a foundation - Boilerplate projects or scaffolding tools - Previous projects to be cloned or adapted - + 2. If a starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -3875,16 +3888,16 @@ sections: - Existing architectural patterns and conventions - Any limitations or constraints imposed by the starter - Use this analysis to inform and align your architecture decisions - + 3. If no starter template is mentioned but this is a greenfield project: - Suggest appropriate starter templates based on the tech stack preferences - Explain the benefits (faster setup, best practices, community support) - Let the user decide whether to use one - + 4. If the user confirms no starter template will be used: - Proceed with architecture design from scratch - Note that manual setup will be required for all tooling and configuration - + Document the decision here before proceeding with the architecture design. If none, just say N/A elicit: true - id: changelog @@ -3912,7 +3925,7 @@ sections: title: High Level Overview instruction: | Based on the PRD's Technical Assumptions section, describe: - + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) 2. Repository structure decision from PRD (Monorepo/Polyrepo) 3. Service architecture decision from PRD @@ -3929,49 +3942,49 @@ sections: - Data flow directions - External integrations - User entry points - + - id: architectural-patterns title: Architectural and Design Patterns instruction: | List the key high-level patterns that will guide the architecture. For each pattern: - + 1. Present 2-3 viable options if multiple exist 2. Provide your recommendation with clear rationale 3. Get user confirmation before finalizing 4. These patterns should align with the PRD's technical assumptions and project goals - + Common patterns to consider: - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) - Code organization patterns (Dependency Injection, Repository, Module, Factory) - Data patterns (Event Sourcing, Saga, Database per Service) - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + - '**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences 2. For each category, present 2-3 viable options with pros/cons 3. Make a clear recommendation based on project needs 4. Get explicit user approval for each selection 5. Document exact versions (avoid "latest" - pin specific versions) 6. This table is the single source of truth - all other docs must reference these choices - + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - + - Starter templates (if any) - Languages and runtimes with exact versions - Frameworks and libraries / packages - Cloud provider and key services choices - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion - Development tools - + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. elicit: true sections: @@ -3987,34 +4000,34 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Populate the technology stack table with all relevant technologies examples: - - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" - - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" - - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + - '| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |' + - '| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |' + - '| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |' - id: data-models title: Data Models instruction: | Define the core data models/entities: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - {{relationship_1}} - {{relationship_2}} @@ -4023,7 +4036,7 @@ sections: title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services and their responsibilities 2. Consider the repository structure (monorepo/polyrepo) from PRD 3. Define clear boundaries and interfaces between components @@ -4032,22 +4045,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -4064,29 +4077,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -4095,13 +4108,13 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include error handling paths 4. Document async operations 5. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -4112,13 +4125,13 @@ sections: language: yaml instruction: | If the project includes a REST API: - + 1. Create an OpenAPI 3.0 specification 2. Include all endpoints from epics/stories 3. Define request/response schemas based on data models 4. Document authentication requirements 5. Include example requests/responses - + Use YAML format for better readability. If no REST API, skip this section. elicit: true template: | @@ -4135,13 +4148,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -4151,14 +4164,14 @@ sections: language: plaintext instruction: | Create a project folder structure that reflects: - + 1. The chosen repository structure (monorepo/polyrepo) 2. The service architecture (monolith/microservices/serverless) 3. The selected tech stack and languages 4. Component organization from above 5. Best practices for the chosen frameworks 6. Clear separation of concerns - + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. elicit: true examples: @@ -4176,13 +4189,13 @@ sections: title: Infrastructure and Deployment instruction: | Define the deployment architecture and practices: - + 1. Use IaC tool selected in Tech Stack 2. Choose deployment strategy appropriate for the architecture 3. Define environments and promotion flow 4. Establish rollback procedures 5. Consider security, monitoring, and cost optimization - + Get user input on deployment preferences and CI/CD tool choices. elicit: true sections: @@ -4201,12 +4214,12 @@ sections: - id: environments title: Environments repeatable: true - template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + template: '- **{{env_name}}:** {{env_purpose}} - {{env_details}}' - id: promotion-flow title: Environment Promotion Flow type: code language: text - template: "{{promotion_flow_diagram}}" + template: '{{promotion_flow_diagram}}' - id: rollback-strategy title: Rollback Strategy template: | @@ -4218,13 +4231,13 @@ sections: title: Error Handling Strategy instruction: | Define comprehensive error handling approach: - + 1. Choose appropriate patterns for the language/framework from Tech Stack 2. Define logging standards and tools 3. Establish error categories and handling rules 4. Consider observability and debugging needs 5. Ensure security (no sensitive data in logs) - + This section guides both AI and human developers in consistent error handling. elicit: true sections: @@ -4271,13 +4284,13 @@ sections: title: Coding Standards instruction: | These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - + 1. This section directly controls AI developer behavior 2. Keep it minimal - assume AI knows general best practices 3. Focus on project-specific conventions and gotchas 4. Overly detailed standards bloat context and slow development 5. Standards will be extracted to separate file for dev agent use - + For each standard, get explicit user confirmation it's necessary. elicit: true sections: @@ -4299,32 +4312,32 @@ sections: - "Never use console.log in production code - use logger" - "All API responses must use ApiResponse wrapper type" - "Database queries must use repository pattern, never direct ORM" - + Avoid obvious rules like "use SOLID principles" or "write clean code" repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' - id: language-specifics title: Language-Specific Guidelines condition: Critical language-specific rules needed instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. sections: - id: language-rules - title: "{{language_name}} Specifics" + title: '{{language_name}} Specifics' repeatable: true - template: "- **{{rule_topic}}:** {{rule_detail}}" + template: '- **{{rule_topic}}:** {{rule_detail}}' - id: test-strategy title: Test Strategy and Standards instruction: | Work with user to define comprehensive test strategy: - + 1. Use test frameworks from Tech Stack 2. Decide on TDD vs test-after approach 3. Define test organization and naming 4. Establish coverage goals 5. Determine integration test infrastructure 6. Plan for test data and external dependencies - + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. elicit: true sections: @@ -4345,7 +4358,7 @@ sections: - **Location:** {{unit_test_location}} - **Mocking Library:** {{mocking_library}} - **Coverage Requirement:** {{unit_coverage}} - + **AI Agent Requirements:** - Generate tests for all public methods - Cover edge cases and error conditions @@ -4359,9 +4372,9 @@ sections: - **Test Infrastructure:** - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) examples: - - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" - - "**Message Queue:** Embedded Kafka for tests" - - "**External APIs:** WireMock for stubbing" + - '**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration' + - '**Message Queue:** Embedded Kafka for tests' + - '**External APIs:** WireMock for stubbing' - id: e2e-tests title: End-to-End Tests template: | @@ -4387,7 +4400,7 @@ sections: title: Security instruction: | Define MANDATORY security requirements for AI and human developers: - + 1. Focus on implementation-specific rules 2. Reference security tools from Tech Stack 3. Define clear patterns for common scenarios @@ -4456,16 +4469,16 @@ sections: title: Next Steps instruction: | After completing the architecture: - + 1. If project has UI components: - Use "Frontend Architecture Mode" - Provide this document as input - + 2. For all projects: - Review with Product Owner - Begin story implementation with Dev agent - Set up infrastructure with DevOps agent - + 3. Include specific prompts for next agents if needed sections: - id: architect-prompt @@ -4487,7 +4500,7 @@ template: output: format: markdown filename: docs/ui-architecture.md - title: "{{project_name}} Frontend Architecture Document" + title: '{{project_name}} Frontend Architecture Document' workflow: mode: interactive @@ -4498,16 +4511,16 @@ sections: title: Template and Framework Selection instruction: | Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. - + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - UI kit or component library starters - Existing frontend projects being used as a foundation - Admin dashboard templates or other specialized starters - Design system implementations - + 2. If a frontend starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -4523,7 +4536,7 @@ sections: - Testing setup and patterns - Build and development scripts - Use this analysis to ensure your frontend architecture aligns with the starter's patterns - + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - Based on the framework choice, suggest appropriate starters: - React: Create React App, Next.js, Vite + React @@ -4531,11 +4544,11 @@ sections: - Angular: Angular CLI - Or suggest popular UI templates if applicable - Explain benefits specific to frontend development - + 4. If the user confirms no starter template will be used: - Note that all tooling, bundling, and configuration will need manual setup - Proceed with frontend architecture from scratch - + Document the starter template decision and any constraints it imposes before proceeding. sections: - id: changelog @@ -4555,17 +4568,29 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Fill in appropriate technology choices based on the selected framework and project requirements. rows: - - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Framework', '{{framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['UI Library', '{{ui_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'State Management', + '{{state_management}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Routing', '{{routing_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Styling', '{{styling_solution}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Testing', '{{test_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Component Library', + '{{component_lib}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Form Handling', '{{form_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Animation', '{{animation_lib}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Dev Tools', '{{dev_tools}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: project-structure title: Project Structure @@ -4659,12 +4684,12 @@ sections: title: Testing Best Practices type: numbered-list items: - - "**Unit Tests**: Test individual components in isolation" - - "**Integration Tests**: Test component interactions" - - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" - - "**Coverage Goals**: Aim for 80% code coverage" - - "**Test Structure**: Arrange-Act-Assert pattern" - - "**Mock External Dependencies**: API calls, routing, state management" + - '**Unit Tests**: Test individual components in isolation' + - '**Integration Tests**: Test component interactions' + - '**E2E Tests**: Test critical user flows (using Cypress/Playwright)' + - '**Coverage Goals**: Aim for 80% code coverage' + - '**Test Structure**: Arrange-Act-Assert pattern' + - '**Mock External Dependencies**: API calls, routing, state management' - id: environment-configuration title: Environment Configuration @@ -4696,7 +4721,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Fullstack Architecture Document" + title: '{{project_name}} Fullstack Architecture Document' workflow: mode: interactive @@ -4710,33 +4735,33 @@ sections: elicit: true content: | This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. sections: - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - + 1. Review the PRD and other documents for mentions of: - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) - Monorepo templates (e.g., Nx, Turborepo starters) - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) - Existing projects being extended or cloned - + 2. If starter templates or existing projects are mentioned: - Ask the user to provide access (links, repos, or files) - Analyze to understand pre-configured choices and constraints - Note any architectural decisions already made - Identify what can be modified vs what must be retained - + 3. If no starter is mentioned but this is greenfield: - Suggest appropriate fullstack starters based on tech preferences - Consider platform-specific options (Vercel, AWS, etc.) - Let user decide whether to use one - + 4. Document the decision and any constraints it imposes - + If none, state "N/A - Greenfield project" - id: changelog title: Change Log @@ -4762,17 +4787,17 @@ sections: title: Platform and Infrastructure Choice instruction: | Based on PRD requirements and technical assumptions, make a platform recommendation: - + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - **Azure**: For .NET ecosystems or enterprise Microsoft environments - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - + 2. Present 2-3 viable options with clear pros/cons 3. Make a recommendation with rationale 4. Get explicit user confirmation - + Document the choice and key services that will be used. template: | **Platform:** {{selected_platform}} @@ -4782,7 +4807,7 @@ sections: title: Repository Structure instruction: | Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: - + 1. For modern fullstack apps, monorepo is often preferred 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) 3. Define package/app boundaries @@ -4804,7 +4829,7 @@ sections: - Databases and storage - External integrations - CDN and caching layers - + Use appropriate diagram type for clarity. - id: architectural-patterns title: Architectural Patterns @@ -4814,21 +4839,21 @@ sections: - Frontend patterns (e.g., Component-based, State management) - Backend patterns (e.g., Repository, CQRS, Event-driven) - Integration patterns (e.g., BFF, API Gateway) - + For each pattern, provide recommendation and rationale. repeatable: true - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" - - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + - '**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications' + - '**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - + Key areas to cover: - Frontend and backend languages/frameworks - Databases and caching @@ -4837,7 +4862,7 @@ sections: - Testing tools for both frontend and backend - Build and deployment tools - Monitoring and logging - + Upon render, elicit feedback immediately. elicit: true sections: @@ -4846,49 +4871,67 @@ sections: type: table columns: [Category, Technology, Version, Purpose, Rationale] rows: - - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Frontend Language', '{{fe_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Frontend Framework', + '{{fe_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - [ + 'UI Component Library', + '{{ui_library}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['State Management', '{{state_mgmt}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Language', '{{be_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Backend Framework', + '{{be_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['API Style', '{{api_style}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Database', '{{database}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Cache', '{{cache}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['File Storage', '{{storage}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Authentication', '{{auth}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Frontend Testing', '{{fe_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Testing', '{{be_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['E2E Testing', '{{e2e_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Bundler', '{{bundler}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['IaC Tool', '{{iac_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CI/CD', '{{cicd}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Monitoring', '{{monitoring}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Logging', '{{logging}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CSS Framework', '{{css_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: data-models title: Data Models instruction: | Define the core data models/entities that will be shared between frontend and backend: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Create TypeScript interfaces that can be shared 6. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} @@ -4897,17 +4940,17 @@ sections: title: TypeScript Interface type: code language: typescript - template: "{{model_interface}}" + template: '{{model_interface}}' - id: relationships title: Relationships type: bullet-list - template: "- {{relationship}}" + template: '- {{relationship}}' - id: api-spec title: API Specification instruction: | Based on the chosen API style from Tech Stack: - + 1. If REST API, create an OpenAPI 3.0 specification 2. If GraphQL, provide the GraphQL schema 3. If tRPC, show router definitions @@ -4915,7 +4958,7 @@ sections: 5. Define request/response schemas based on data models 6. Document authentication requirements 7. Include example requests/responses - + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. elicit: true sections: @@ -4938,19 +4981,19 @@ sections: condition: API style is GraphQL type: code language: graphql - template: "{{graphql_schema}}" + template: '{{graphql_schema}}' - id: trpc-api title: tRPC Router Definitions condition: API style is tRPC type: code language: typescript - template: "{{trpc_routers}}" + template: '{{trpc_routers}}' - id: components title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services across the fullstack 2. Consider both frontend and backend components 3. Define clear boundaries and interfaces between components @@ -4959,22 +5002,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -4991,29 +5034,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -5022,14 +5065,14 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include both frontend and backend flows 4. Include error handling paths 5. Document async operations 6. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -5037,13 +5080,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -5060,12 +5103,12 @@ sections: title: Component Organization type: code language: text - template: "{{component_structure}}" + template: '{{component_structure}}' - id: component-template title: Component Template type: code language: typescript - template: "{{component_template}}" + template: '{{component_template}}' - id: state-management title: State Management Architecture instruction: Detail state management approach based on chosen solution. @@ -5074,11 +5117,11 @@ sections: title: State Structure type: code language: typescript - template: "{{state_structure}}" + template: '{{state_structure}}' - id: state-patterns title: State Management Patterns type: bullet-list - template: "- {{pattern}}" + template: '- {{pattern}}' - id: routing-architecture title: Routing Architecture instruction: Define routing structure based on framework choice. @@ -5087,12 +5130,12 @@ sections: title: Route Organization type: code language: text - template: "{{route_structure}}" + template: '{{route_structure}}' - id: protected-routes title: Protected Route Pattern type: code language: typescript - template: "{{protected_route_example}}" + template: '{{protected_route_example}}' - id: frontend-services title: Frontend Services Layer instruction: Define how frontend communicates with backend. @@ -5101,12 +5144,12 @@ sections: title: API Client Setup type: code language: typescript - template: "{{api_client_setup}}" + template: '{{api_client_setup}}' - id: service-example title: Service Example type: code language: typescript - template: "{{service_example}}" + template: '{{service_example}}' - id: backend-architecture title: Backend Architecture @@ -5124,12 +5167,12 @@ sections: title: Function Organization type: code language: text - template: "{{function_structure}}" + template: '{{function_structure}}' - id: function-template title: Function Template type: code language: typescript - template: "{{function_template}}" + template: '{{function_template}}' - id: traditional-server condition: Traditional server architecture chosen sections: @@ -5137,12 +5180,12 @@ sections: title: Controller/Route Organization type: code language: text - template: "{{controller_structure}}" + template: '{{controller_structure}}' - id: controller-template title: Controller Template type: code language: typescript - template: "{{controller_template}}" + template: '{{controller_template}}' - id: database-architecture title: Database Architecture instruction: Define database schema and access patterns. @@ -5151,12 +5194,12 @@ sections: title: Schema Design type: code language: sql - template: "{{database_schema}}" + template: '{{database_schema}}' - id: data-access-layer title: Data Access Layer type: code language: typescript - template: "{{repository_pattern}}" + template: '{{repository_pattern}}' - id: auth-architecture title: Authentication and Authorization instruction: Define auth implementation details. @@ -5165,12 +5208,12 @@ sections: title: Auth Flow type: mermaid mermaid_type: sequence - template: "{{auth_flow_diagram}}" + template: '{{auth_flow_diagram}}' - id: auth-middleware title: Middleware/Guards type: code language: typescript - template: "{{auth_middleware}}" + template: '{{auth_middleware}}' - id: unified-project-structure title: Unified Project Structure @@ -5179,60 +5222,60 @@ sections: type: code language: plaintext examples: - - | - {{project-name}}/ - ├── .github/ # CI/CD workflows - │ └── workflows/ - │ ├── ci.yaml - │ └── deploy.yaml - ├── apps/ # Application packages - │ ├── web/ # Frontend application - │ │ ├── src/ - │ │ │ ├── components/ # UI components - │ │ │ ├── pages/ # Page components/routes - │ │ │ ├── hooks/ # Custom React hooks - │ │ │ ├── services/ # API client services - │ │ │ ├── stores/ # State management - │ │ │ ├── styles/ # Global styles/themes - │ │ │ └── utils/ # Frontend utilities - │ │ ├── public/ # Static assets - │ │ ├── tests/ # Frontend tests - │ │ └── package.json - │ └── api/ # Backend application - │ ├── src/ - │ │ ├── routes/ # API routes/controllers - │ │ ├── services/ # Business logic - │ │ ├── models/ # Data models - │ │ ├── middleware/ # Express/API middleware - │ │ ├── utils/ # Backend utilities - │ │ └── {{serverless_or_server_entry}} - │ ├── tests/ # Backend tests - │ └── package.json - ├── packages/ # Shared packages - │ ├── shared/ # Shared types/utilities - │ │ ├── src/ - │ │ │ ├── types/ # TypeScript interfaces - │ │ │ ├── constants/ # Shared constants - │ │ │ └── utils/ # Shared utilities - │ │ └── package.json - │ ├── ui/ # Shared UI components - │ │ ├── src/ - │ │ └── package.json - │ └── config/ # Shared configuration - │ ├── eslint/ - │ ├── typescript/ - │ └── jest/ - ├── infrastructure/ # IaC definitions - │ └── {{iac_structure}} - ├── scripts/ # Build/deploy scripts - ├── docs/ # Documentation - │ ├── prd.md - │ ├── front-end-spec.md - │ └── fullstack-architecture.md - ├── .env.example # Environment template - ├── package.json # Root package.json - ├── {{monorepo_config}} # Monorepo configuration - └── README.md + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md - id: development-workflow title: Development Workflow @@ -5246,12 +5289,12 @@ sections: title: Prerequisites type: code language: bash - template: "{{prerequisites_commands}}" + template: '{{prerequisites_commands}}' - id: initial-setup title: Initial Setup type: code language: bash - template: "{{setup_commands}}" + template: '{{setup_commands}}' - id: dev-commands title: Development Commands type: code @@ -5259,13 +5302,13 @@ sections: template: | # Start all services {{start_all_command}} - + # Start frontend only {{start_frontend_command}} - + # Start backend only {{start_backend_command}} - + # Run tests {{test_commands}} - id: environment-config @@ -5278,10 +5321,10 @@ sections: template: | # Frontend (.env.local) {{frontend_env_vars}} - + # Backend (.env) {{backend_env_vars}} - + # Shared {{shared_env_vars}} @@ -5298,7 +5341,7 @@ sections: - **Build Command:** {{frontend_build_command}} - **Output Directory:** {{frontend_output_dir}} - **CDN/Edge:** {{cdn_strategy}} - + **Backend Deployment:** - **Platform:** {{backend_deploy_platform}} - **Build Command:** {{backend_build_command}} @@ -5307,15 +5350,15 @@ sections: title: CI/CD Pipeline type: code language: yaml - template: "{{cicd_pipeline_config}}" + template: '{{cicd_pipeline_config}}' - id: environments title: Environments type: table columns: [Environment, Frontend URL, Backend URL, Purpose] rows: - - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] - - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] - - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + - ['Development', '{{dev_fe_url}}', '{{dev_be_url}}', 'Local development'] + - ['Staging', '{{staging_fe_url}}', '{{staging_be_url}}', 'Pre-production testing'] + - ['Production', '{{prod_fe_url}}', '{{prod_be_url}}', 'Live environment'] - id: security-performance title: Security and Performance @@ -5329,12 +5372,12 @@ sections: - CSP Headers: {{csp_policy}} - XSS Prevention: {{xss_strategy}} - Secure Storage: {{storage_strategy}} - + **Backend Security:** - Input Validation: {{validation_approach}} - Rate Limiting: {{rate_limit_config}} - CORS Policy: {{cors_config}} - + **Authentication Security:** - Token Storage: {{token_strategy}} - Session Management: {{session_approach}} @@ -5346,7 +5389,7 @@ sections: - Bundle Size Target: {{bundle_size}} - Loading Strategy: {{loading_approach}} - Caching Strategy: {{fe_cache_strategy}} - + **Backend Performance:** - Response Time Target: {{response_target}} - Database Optimization: {{db_optimization}} @@ -5362,10 +5405,10 @@ sections: type: code language: text template: | - E2E Tests - / \ - Integration Tests - / \ + E2E Tests + / \ + Integration Tests + / \ Frontend Unit Backend Unit - id: test-organization title: Test Organization @@ -5374,17 +5417,17 @@ sections: title: Frontend Tests type: code language: text - template: "{{frontend_test_structure}}" + template: '{{frontend_test_structure}}' - id: backend-tests title: Backend Tests type: code language: text - template: "{{backend_test_structure}}" + template: '{{backend_test_structure}}' - id: e2e-tests title: E2E Tests type: code language: text - template: "{{e2e_test_structure}}" + template: '{{e2e_test_structure}}' - id: test-examples title: Test Examples sections: @@ -5392,17 +5435,17 @@ sections: title: Frontend Component Test type: code language: typescript - template: "{{frontend_test_example}}" + template: '{{frontend_test_example}}' - id: backend-test title: Backend API Test type: code language: typescript - template: "{{backend_test_example}}" + template: '{{backend_test_example}}' - id: e2e-test title: E2E Test type: code language: typescript - template: "{{e2e_test_example}}" + template: '{{e2e_test_example}}' - id: coding-standards title: Coding Standards @@ -5412,22 +5455,22 @@ sections: - id: critical-rules title: Critical Fullstack Rules repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' examples: - - "**Type Sharing:** Always define types in packages/shared and import from there" - - "**API Calls:** Never make direct HTTP calls - use the service layer" - - "**Environment Variables:** Access only through config objects, never process.env directly" - - "**Error Handling:** All API routes must use the standard error handler" - - "**State Updates:** Never mutate state directly - use proper state management patterns" + - '**Type Sharing:** Always define types in packages/shared and import from there' + - '**API Calls:** Never make direct HTTP calls - use the service layer' + - '**Environment Variables:** Access only through config objects, never process.env directly' + - '**Error Handling:** All API routes must use the standard error handler' + - '**State Updates:** Never mutate state directly - use proper state management patterns' - id: naming-conventions title: Naming Conventions type: table columns: [Element, Frontend, Backend, Example] rows: - - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] - - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] - - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] - - ["Database Tables", "-", "snake_case", "`user_profiles`"] + - ['Components', 'PascalCase', '-', '`UserProfile.tsx`'] + - ['Hooks', "camelCase with 'use'", '-', '`useAuth.ts`'] + - ['API Routes', '-', 'kebab-case', '`/api/user-profile`'] + - ['Database Tables', '-', 'snake_case', '`user_profiles`'] - id: error-handling title: Error Handling Strategy @@ -5438,7 +5481,7 @@ sections: title: Error Flow type: mermaid mermaid_type: sequence - template: "{{error_flow_diagram}}" + template: '{{error_flow_diagram}}' - id: error-format title: Error Response Format type: code @@ -5457,12 +5500,12 @@ sections: title: Frontend Error Handling type: code language: typescript - template: "{{frontend_error_handler}}" + template: '{{frontend_error_handler}}' - id: backend-error-handling title: Backend Error Handling type: code language: typescript - template: "{{backend_error_handler}}" + template: '{{backend_error_handler}}' - id: monitoring title: Monitoring and Observability @@ -5484,7 +5527,7 @@ sections: - JavaScript errors - API response times - User interactions - + **Backend Metrics:** - Request rate - Error rate @@ -5504,7 +5547,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Brownfield Enhancement Architecture" + title: '{{project_name}} Brownfield Enhancement Architecture' workflow: mode: interactive @@ -5515,40 +5558,40 @@ sections: title: Introduction instruction: | IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - + 2. **REQUIRED INPUTS**: - Completed brownfield-prd.md - Existing project technical documentation (from docs folder or user-provided) - Access to existing project structure (IDE or uploaded files) - + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - + If any required inputs are missing, request them before proceeding. elicit: true sections: - id: intro-content content: | This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - + **Relationship to Existing Architecture:** This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - id: existing-project-analysis title: Existing Project Analysis instruction: | Analyze the existing project structure and architecture: - + 1. Review existing documentation in docs folder 2. Examine current technology stack and versions 3. Identify existing architectural patterns and conventions 4. Note current deployment and infrastructure setup 5. Document any constraints or limitations - + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." elicit: true sections: @@ -5562,11 +5605,11 @@ sections: - id: available-docs title: Available Documentation type: bullet-list - template: "- {{existing_docs_summary}}" + template: '- {{existing_docs_summary}}' - id: constraints title: Identified Constraints type: bullet-list - template: "- {{constraint}}" + template: '- {{constraint}}' - id: changelog title: Change Log type: table @@ -5577,12 +5620,12 @@ sections: title: Enhancement Scope and Integration Strategy instruction: | Define how the enhancement will integrate with the existing system: - + 1. Review the brownfield PRD enhancement scope 2. Identify integration points with existing code 3. Define boundaries between new and existing functionality 4. Establish compatibility requirements - + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" elicit: true sections: @@ -5611,7 +5654,7 @@ sections: title: Tech Stack Alignment instruction: | Ensure new components align with existing technology choices: - + 1. Use existing technology stack as the foundation 2. Only introduce new technologies if absolutely necessary 3. Justify any new additions with clear rationale @@ -5634,7 +5677,7 @@ sections: title: Data Models and Schema Changes instruction: | Define new data models and how they integrate with existing schema: - + 1. Identify new entities required for the enhancement 2. Define relationships with existing data models 3. Plan database schema changes (additions, modifications) @@ -5646,15 +5689,15 @@ sections: repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} **Integration:** {{integration_with_existing}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - **With Existing:** {{existing_relationships}} - **With New:** {{new_relationships}} @@ -5666,7 +5709,7 @@ sections: - **Modified Tables:** {{modified_tables_list}} - **New Indexes:** {{new_indexes_list}} - **Migration Strategy:** {{migration_approach}} - + **Backward Compatibility:** - {{compatibility_measure_1}} - {{compatibility_measure_2}} @@ -5675,12 +5718,12 @@ sections: title: Component Architecture instruction: | Define new components and their integration with existing architecture: - + 1. Identify new components required for the enhancement 2. Define interfaces with existing components 3. Establish clear boundaries and responsibilities 4. Plan integration points and data flow - + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" elicit: true sections: @@ -5689,19 +5732,19 @@ sections: repeatable: true sections: - id: component - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} **Integration Points:** {{integration_points}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** - **Existing Components:** {{existing_dependencies}} - **New Components:** {{new_dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: interaction-diagram title: Component Interaction Diagram @@ -5714,7 +5757,7 @@ sections: condition: Enhancement requires API changes instruction: | Define new API endpoints and integration with existing APIs: - + 1. Plan new API endpoints required for the enhancement 2. Ensure consistency with existing API patterns 3. Define authentication and authorization integration @@ -5732,7 +5775,7 @@ sections: repeatable: true sections: - id: endpoint - title: "{{endpoint_name}}" + title: '{{endpoint_name}}' template: | - **Method:** {{http_method}} - **Endpoint:** {{endpoint_path}} @@ -5743,12 +5786,12 @@ sections: title: Request type: code language: json - template: "{{request_schema}}" + template: '{{request_schema}}' - id: response title: Response type: code language: json - template: "{{response_schema}}" + template: '{{response_schema}}' - id: external-api-integration title: External API Integration @@ -5757,24 +5800,24 @@ sections: repeatable: true sections: - id: external-api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL:** {{api_base_url}} - **Authentication:** {{auth_method}} - **Integration Method:** {{integration_approach}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Error Handling:** {{error_handling_strategy}} - id: source-tree-integration title: Source Tree Integration instruction: | Define how new code will integrate with existing project structure: - + 1. Follow existing project organization patterns 2. Identify where new files/folders will be placed 3. Ensure consistency with existing naming conventions @@ -5786,7 +5829,7 @@ sections: type: code language: plaintext instruction: Document relevant parts of current structure - template: "{{existing_structure_relevant_parts}}" + template: '{{existing_structure_relevant_parts}}' - id: new-file-organization title: New File Organization type: code @@ -5813,7 +5856,7 @@ sections: title: Infrastructure and Deployment Integration instruction: | Define how the enhancement will be deployed alongside existing infrastructure: - + 1. Use existing deployment pipeline and infrastructure 2. Identify any infrastructure changes needed 3. Plan deployment strategy to minimize risk @@ -5843,7 +5886,7 @@ sections: title: Coding Standards and Conventions instruction: | Ensure new code follows existing project conventions: - + 1. Document existing coding standards from project analysis 2. Identify any enhancement-specific requirements 3. Ensure consistency with existing codebase patterns @@ -5861,7 +5904,7 @@ sections: title: Enhancement-Specific Standards condition: New patterns needed for enhancement repeatable: true - template: "- **{{standard_name}}:** {{standard_description}}" + template: '- **{{standard_name}}:** {{standard_description}}' - id: integration-rules title: Critical Integration Rules template: | @@ -5874,7 +5917,7 @@ sections: title: Testing Strategy instruction: | Define testing approach for the enhancement: - + 1. Integrate with existing test suite 2. Ensure existing functionality remains intact 3. Plan for testing new features @@ -5914,7 +5957,7 @@ sections: title: Security Integration instruction: | Ensure security consistency with existing system: - + 1. Follow existing security patterns and tools 2. Ensure new features don't introduce vulnerabilities 3. Maintain existing security posture @@ -5949,7 +5992,7 @@ sections: title: Next Steps instruction: | After completing the brownfield architecture: - + 1. Review integration points with existing system 2. Begin story implementation with Dev agent 3. Set up deployment pipeline integration @@ -7238,7 +7281,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Product Requirements Document (PRD)" + title: '{{project_name}} Product Requirements Document (PRD)' workflow: mode: interactive @@ -7275,21 +7318,21 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR examples: - - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." + - 'FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR examples: - - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." + - 'NFR1: AWS service usage must aim to stay within free-tier limits where feasible.' - id: ui-goals title: User Interface Design Goals condition: PRD has UX/UI requirements instruction: | Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - + 1. Pre-fill all subsections with educated guesses based on project context 2. Present the complete rendered section to user 3. Clearly let the user know where assumptions were made @@ -7308,30 +7351,30 @@ sections: title: Core Screens and Views instruction: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories examples: - - "Login Screen" - - "Main Dashboard" - - "Item Detail Page" - - "Settings Page" + - 'Login Screen' + - 'Main Dashboard' + - 'Item Detail Page' + - 'Settings Page' - id: accessibility - title: "Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}" + title: 'Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}' - id: branding title: Branding instruction: Any known branding elements or style guides that must be incorporated? examples: - - "Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions." - - "Attached is the full color pallet and tokens for our corporate branding." + - 'Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions.' + - 'Attached is the full color pallet and tokens for our corporate branding.' - id: target-platforms - title: "Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}" + title: 'Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}' examples: - - "Web Responsive, and all mobile platforms" - - "iPhone Only" - - "ASCII Windows Desktop" + - 'Web Responsive, and all mobile platforms' + - 'iPhone Only' + - 'ASCII Windows Desktop' - id: technical-assumptions title: Technical Assumptions instruction: | Gather technical decisions that will guide the Architect. Steps: - + 1. Check if .bmad-core/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets 3. For unknowns, offer guidance based on project goals and MVP scope @@ -7344,13 +7387,13 @@ sections: testing: [Unit Only, Unit + Integration, Full Testing Pyramid] sections: - id: repository-structure - title: "Repository Structure: {Monorepo|Polyrepo|Multi-repo}" + title: 'Repository Structure: {Monorepo|Polyrepo|Multi-repo}' - id: service-architecture title: Service Architecture - instruction: "CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo)." + instruction: 'CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).' - id: testing-requirements title: Testing Requirements - instruction: "CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods)." + instruction: 'CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).' - id: additional-assumptions title: Additional Technical Assumptions and Requests instruction: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items @@ -7359,9 +7402,9 @@ sections: title: Epic List instruction: | Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - + CRITICAL: Epics MUST be logically sequential following agile best practices: - + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed @@ -7370,21 +7413,21 @@ sections: - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. elicit: true examples: - - "Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management" - - "Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations" - - "Epic 3: User Workflows & Interactions: Enable key user journeys and business processes" - - "Epic 4: Reporting & Analytics: Provide insights and data visualization for users" + - 'Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management' + - 'Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations' + - 'Epic 3: User Workflows & Interactions: Enable key user journeys and business processes' + - 'Epic 4: Reporting & Analytics: Provide insights and data visualization for users' - id: epic-details title: Epic {{epic_number}} {{epic_title}} repeatable: true instruction: | After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. - + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). - + CRITICAL STORY SEQUENCING REQUIREMENTS: - + - Stories within each epic MUST be logically sequential - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation - No story should depend on work from a later story or epic @@ -7395,7 +7438,7 @@ sections: - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained - If a story seems complex, break it down further as long as it can deliver a vertical slice elicit: true - template: "{{epic_goal}}" + template: '{{epic_goal}}' sections: - id: story title: Story {{epic_number}}.{{story_number}} {{story_title}} @@ -7408,11 +7451,11 @@ sections: - id: acceptance-criteria title: Acceptance Criteria type: numbered-list - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' repeatable: true instruction: | Define clear, comprehensive, and testable acceptance criteria that: - + - Precisely define what "done" means from a functional perspective - Are unambiguous and serve as basis for verification - Include any critical non-functional requirements from the PRD @@ -7443,7 +7486,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Brownfield Enhancement PRD" + title: '{{project_name}} Brownfield Enhancement PRD' workflow: mode: interactive @@ -7454,19 +7497,19 @@ sections: title: Intro Project Analysis and Context instruction: | IMPORTANT - SCOPE ASSESSMENT REQUIRED: - + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. - + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - + Do not proceed with any recommendations until the user has validated your understanding of the existing system. sections: - id: existing-project-overview @@ -7492,7 +7535,7 @@ sections: - Note: "Document-project analysis available - using existing technical documentation" - List key documents created by document-project - Skip the missing documentation check below - + Otherwise, check for existing documentation: sections: - id: available-docs @@ -7506,7 +7549,7 @@ sections: - External API Documentation [[LLM: If from document-project, check ✓]] - UX/UI Guidelines [[LLM: May not be in document-project]] - Technical Debt Documentation [[LLM: If from document-project, check ✓]] - - "Other: {{other_docs}}" + - 'Other: {{other_docs}}' instruction: | - If document-project was already run: "Using existing project analysis from document-project output." - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." @@ -7526,7 +7569,7 @@ sections: - UI/UX Overhaul - Technology Stack Upgrade - Bug Fix and Stability Improvements - - "Other: {{other_type}}" + - 'Other: {{other_type}}' - id: enhancement-description title: Enhancement Description instruction: 2-3 sentences describing what the user wants to add or change @@ -7567,29 +7610,29 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown with identifier starting with FR examples: - - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - 'FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system examples: - - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - 'NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.' - id: compatibility title: Compatibility Requirements instruction: Critical for brownfield - what must remain compatible type: numbered-list prefix: CR - template: "{{requirement}}: {{description}}" + template: '{{requirement}}: {{description}}' items: - id: cr1 - template: "CR1: {{existing_api_compatibility}}" + template: 'CR1: {{existing_api_compatibility}}' - id: cr2 - template: "CR2: {{database_schema_compatibility}}" + template: 'CR2: {{database_schema_compatibility}}' - id: cr3 - template: "CR3: {{ui_ux_consistency}}" + template: 'CR3: {{ui_ux_consistency}}' - id: cr4 - template: "CR4: {{integration_compatibility}}" + template: 'CR4: {{integration_compatibility}}' - id: ui-enhancement-goals title: User Interface Enhancement Goals @@ -7616,7 +7659,7 @@ sections: If document-project output available: - Extract from "Actual Tech Stack" table in High Level Architecture section - Include version numbers and any noted constraints - + Otherwise, document the current technology stack: template: | **Languages**: {{languages}} @@ -7655,7 +7698,7 @@ sections: - Reference "Technical Debt and Known Issues" section - Include "Workarounds and Gotchas" that might impact enhancement - Note any identified constraints from "Critical Technical Debt" - + Build risk assessment incorporating existing known issues: template: | **Technical Risks**: {{technical_risks}} @@ -7672,13 +7715,13 @@ sections: - id: epic-approach title: Epic Approach instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features - template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + template: '**Epic Structure Decision**: {{epic_decision}} with rationale' - id: epic-details - title: "Epic 1: {{enhancement_title}}" + title: 'Epic 1: {{enhancement_title}}' instruction: | Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality - + CRITICAL STORY SEQUENCING FOR BROWNFIELD: - Stories must ensure existing functionality remains intact - Each story should include verification that existing features still work @@ -7691,11 +7734,11 @@ sections: - Each story must deliver value while maintaining system integrity template: | **Epic Goal**: {{epic_goal}} - + **Integration Requirements**: {{integration_requirements}} sections: - id: story - title: "Story 1.{{story_number}} {{story_title}}" + title: 'Story 1.{{story_number}} {{story_title}}' repeatable: true template: | As a {{user_type}}, @@ -7706,16 +7749,16 @@ sections: title: Acceptance Criteria type: numbered-list instruction: Define criteria that include both new functionality and existing system integrity - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' - id: integration-verification title: Integration Verification instruction: Specific verification steps to ensure existing functionality remains intact type: numbered-list prefix: IV items: - - template: "IV1: {{existing_functionality_verification}}" - - template: "IV2: {{integration_point_verification}}" - - template: "IV3: {{performance_impact_verification}}" + - template: 'IV1: {{existing_functionality_verification}}' + - template: 'IV2: {{integration_point_verification}}' + - template: 'IV3: {{performance_impact_verification}}' ==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/pm-checklist.md ==================== @@ -8284,14 +8327,14 @@ template: output: format: markdown filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md - title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + title: 'Story {{epic_num}}.{{story_num}}: {{story_title_short}}' workflow: mode: interactive elicitation: advanced-elicitation agent_config: - editable_sections: + editable_sections: - Status - Story - Acceptance Criteria @@ -8308,7 +8351,7 @@ sections: instruction: Select the current status of the story owner: scrum-master editors: [scrum-master, dev-agent] - + - id: story title: Story type: template-text @@ -8320,7 +8363,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: acceptance-criteria title: Acceptance Criteria type: numbered-list @@ -8328,7 +8371,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: tasks-subtasks title: Tasks / Subtasks type: bullet-list @@ -8345,7 +8388,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master, dev-agent] - + - id: dev-notes title: Dev Notes instruction: | @@ -8369,7 +8412,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: change-log title: Change Log type: table @@ -8377,7 +8420,7 @@ sections: instruction: Track changes made to this story document owner: scrum-master editors: [scrum-master, dev-agent, qa-agent] - + - id: dev-agent-record title: Dev Agent Record instruction: This section is populated by the development agent during implementation @@ -8386,29 +8429,29 @@ sections: sections: - id: agent-model title: Agent Model Used - template: "{{agent_model_name_version}}" + template: '{{agent_model_name_version}}' instruction: Record the specific AI agent model and version used for development owner: dev-agent editors: [dev-agent] - + - id: debug-log-references title: Debug Log References instruction: Reference any debug logs or traces generated during development owner: dev-agent editors: [dev-agent] - + - id: completion-notes title: Completion Notes List instruction: Notes about the completion of tasks and any issues encountered owner: dev-agent editors: [dev-agent] - + - id: file-list title: File List instruction: List all files created, modified, or affected during story implementation owner: dev-agent editors: [dev-agent] - + - id: qa-results title: QA Results instruction: Results from QA Agent QA review of the completed story implementation @@ -8860,10 +8903,10 @@ Perform a comprehensive test architecture review with quality gate decision. Thi ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Prerequisites @@ -9025,6 +9068,8 @@ Gate: {STATUS} → docs/qa/gates/{epic}.{story}-{slug}.yml Risk profile: docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md +# Note: Paths should reference core-config.yaml for custom configurations + ### Recommended Status [✓ Ready for Done] / [✗ Changes Required - See unchecked items above] @@ -9036,26 +9081,26 @@ NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md **Template and Directory:** - Render from `templates/qa-gate-tmpl.yaml` -- Create `docs/qa/gates/` directory if missing +- Create `docs/qa/gates/` directory if missing (or configure in core-config.yaml) - Save to: `docs/qa/gates/{epic}.{story}-{slug}.yml` Gate file structure: ```yaml schema: 1 -story: "{epic}.{story}" -story_title: "{story title}" +story: '{epic}.{story}' +story_title: '{story title}' gate: PASS|CONCERNS|FAIL|WAIVED -status_reason: "1-2 sentence explanation of gate decision" -reviewer: "Quinn (Test Architect)" -updated: "{ISO-8601 timestamp}" +status_reason: '1-2 sentence explanation of gate decision' +reviewer: 'Quinn (Test Architect)' +updated: '{ISO-8601 timestamp}' top_issues: [] # Empty if no issues waiver: { active: false } # Set active: true only if WAIVED # Extended fields (optional but recommended): quality_score: 0-100 # 100 - (20*FAILs) - (10*CONCERNS) or use technical-preferences.md weights -expires: "{ISO-8601 timestamp}" # Typically 2 weeks from review +expires: '{ISO-8601 timestamp}' # Typically 2 weeks from review evidence: tests_reviewed: { count } @@ -9067,24 +9112,24 @@ evidence: nfr_validation: security: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' performance: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' reliability: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' maintainability: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' recommendations: immediate: # Must fix before production - - action: "Add rate limiting" - refs: ["api/auth/login.ts"] + - action: 'Add rate limiting' + refs: ['api/auth/login.ts'] future: # Can be addressed later - - action: "Consider caching" - refs: ["services/data.ts"] + - action: 'Consider caching' + refs: ['services/data.ts'] ``` ### Gate Decision Criteria @@ -9196,11 +9241,11 @@ Slug rules: ```yaml schema: 1 -story: "{epic}.{story}" +story: '{epic}.{story}' gate: PASS|CONCERNS|FAIL|WAIVED -status_reason: "1-2 sentence explanation of gate decision" -reviewer: "Quinn" -updated: "{ISO-8601 timestamp}" +status_reason: '1-2 sentence explanation of gate decision' +reviewer: 'Quinn' +updated: '{ISO-8601 timestamp}' top_issues: [] # Empty array if no issues waiver: { active: false } # Only set active: true if WAIVED ``` @@ -9209,20 +9254,20 @@ waiver: { active: false } # Only set active: true if WAIVED ```yaml schema: 1 -story: "1.3" +story: '1.3' gate: CONCERNS -status_reason: "Missing rate limiting on auth endpoints poses security risk." -reviewer: "Quinn" -updated: "2025-01-12T10:15:00Z" +status_reason: 'Missing rate limiting on auth endpoints poses security risk.' +reviewer: 'Quinn' +updated: '2025-01-12T10:15:00Z' top_issues: - - id: "SEC-001" + - id: 'SEC-001' severity: high # ONLY: low|medium|high - finding: "No rate limiting on login endpoint" - suggested_action: "Add rate limiting middleware before production" - - id: "TEST-001" + finding: 'No rate limiting on login endpoint' + suggested_action: 'Add rate limiting middleware before production' + - id: 'TEST-001' severity: medium - finding: "No integration tests for auth flow" - suggested_action: "Add integration test coverage" + finding: 'No integration tests for auth flow' + suggested_action: 'Add integration test coverage' waiver: { active: false } ``` @@ -9230,20 +9275,20 @@ waiver: { active: false } ```yaml schema: 1 -story: "1.3" +story: '1.3' gate: WAIVED -status_reason: "Known issues accepted for MVP release." -reviewer: "Quinn" -updated: "2025-01-12T10:15:00Z" +status_reason: 'Known issues accepted for MVP release.' +reviewer: 'Quinn' +updated: '2025-01-12T10:15:00Z' top_issues: - - id: "PERF-001" + - id: 'PERF-001' severity: low - finding: "Dashboard loads slowly with 1000+ items" - suggested_action: "Implement pagination in next sprint" + finding: 'Dashboard loads slowly with 1000+ items' + suggested_action: 'Implement pagination in next sprint' waiver: active: true - reason: "MVP release - performance optimization deferred" - approved_by: "Product Owner" + reason: 'MVP release - performance optimization deferred' + approved_by: 'Product Owner' ``` ## Gate Decision Criteria @@ -9362,21 +9407,21 @@ Identify all testable requirements from: For each requirement, document which tests validate it. Use Given-When-Then to describe what the test validates (not how it's written): ```yaml -requirement: "AC1: User can login with valid credentials" +requirement: 'AC1: User can login with valid credentials' test_mappings: - - test_file: "auth/login.test.ts" - test_case: "should successfully login with valid email and password" + - test_file: 'auth/login.test.ts' + test_case: 'should successfully login with valid email and password' # Given-When-Then describes WHAT the test validates, not HOW it's coded - given: "A registered user with valid credentials" - when: "They submit the login form" - then: "They are redirected to dashboard and session is created" + given: 'A registered user with valid credentials' + when: 'They submit the login form' + then: 'They are redirected to dashboard and session is created' coverage: full - - test_file: "e2e/auth-flow.test.ts" - test_case: "complete login flow" - given: "User on login page" - when: "Entering valid credentials and submitting" - then: "Dashboard loads with user data" + - test_file: 'e2e/auth-flow.test.ts' + test_case: 'complete login flow' + given: 'User on login page' + when: 'Entering valid credentials and submitting' + then: 'Dashboard loads with user data' coverage: integration ``` @@ -9398,19 +9443,19 @@ Document any gaps found: ```yaml coverage_gaps: - - requirement: "AC3: Password reset email sent within 60 seconds" - gap: "No test for email delivery timing" + - requirement: 'AC3: Password reset email sent within 60 seconds' + gap: 'No test for email delivery timing' severity: medium suggested_test: type: integration - description: "Test email service SLA compliance" + description: 'Test email service SLA compliance' - - requirement: "AC5: Support 1000 concurrent users" - gap: "No load testing implemented" + - requirement: 'AC5: Support 1000 concurrent users' + gap: 'No load testing implemented' severity: high suggested_test: type: performance - description: "Load test with 1000 concurrent connections" + description: 'Load test with 1000 concurrent connections' ``` ## Outputs @@ -9426,11 +9471,11 @@ trace: full: Y partial: Z none: W - planning_ref: "docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md" + planning_ref: 'docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md' uncovered: - - ac: "AC3" - reason: "No test found for password reset timing" - notes: "See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md" + - ac: 'AC3' + reason: 'No test found for password reset timing' + notes: 'See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md' ``` ### Output 2: Traceability Report @@ -9604,10 +9649,10 @@ Generate a comprehensive risk assessment matrix for a story implementation using ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: 'docs/stories/{epic}.{story}.*.md' + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Purpose @@ -9677,14 +9722,14 @@ For each category, identify specific risks: ```yaml risk: - id: "SEC-001" # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH + id: 'SEC-001' # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH category: security - title: "Insufficient input validation on user forms" - description: "Form inputs not properly sanitized could lead to XSS attacks" + title: 'Insufficient input validation on user forms' + description: 'Form inputs not properly sanitized could lead to XSS attacks' affected_components: - - "UserRegistrationForm" - - "ProfileUpdateForm" - detection_method: "Code review revealed missing validation" + - 'UserRegistrationForm' + - 'ProfileUpdateForm' + detection_method: 'Code review revealed missing validation' ``` ### 2. Risk Assessment @@ -9731,20 +9776,20 @@ For each identified risk, provide mitigation: ```yaml mitigation: - risk_id: "SEC-001" - strategy: "preventive" # preventive|detective|corrective + risk_id: 'SEC-001' + strategy: 'preventive' # preventive|detective|corrective actions: - - "Implement input validation library (e.g., validator.js)" - - "Add CSP headers to prevent XSS execution" - - "Sanitize all user inputs before storage" - - "Escape all outputs in templates" + - 'Implement input validation library (e.g., validator.js)' + - 'Add CSP headers to prevent XSS execution' + - 'Sanitize all user inputs before storage' + - 'Escape all outputs in templates' testing_requirements: - - "Security testing with OWASP ZAP" - - "Manual penetration testing of forms" - - "Unit tests for validation functions" - residual_risk: "Low - Some zero-day vulnerabilities may remain" - owner: "dev" - timeline: "Before deployment" + - 'Security testing with OWASP ZAP' + - 'Manual penetration testing of forms' + - 'Unit tests for validation functions' + residual_risk: 'Low - Some zero-day vulnerabilities may remain' + owner: 'dev' + timeline: 'Before deployment' ``` ## Outputs @@ -9770,12 +9815,12 @@ risk_summary: highest: id: SEC-001 score: 9 - title: "XSS on profile form" + title: 'XSS on profile form' recommendations: must_fix: - - "Add input sanitization & CSP" + - 'Add input sanitization & CSP' monitor: - - "Add security alerts for auth endpoints" + - 'Add security alerts for auth endpoints' ``` ### Output 2: Markdown Report @@ -9960,299 +10005,79 @@ Create comprehensive test scenarios with appropriate test level recommendations ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Purpose Design a complete test strategy that identifies what to test, at which level (unit/integration/e2e), and why. This ensures efficient test coverage without redundancy while maintaining appropriate test boundaries. -## Test Level Decision Framework - -### Unit Tests - -**When to use:** - -- Testing pure functions and business logic -- Algorithm correctness -- Input validation and data transformation -- Error handling in isolated components -- Complex calculations or state machines - -**Characteristics:** - -- Fast execution (immediate feedback) -- No external dependencies (DB, API, file system) -- Highly maintainable and stable -- Easy to debug failures - -**Example scenarios:** +## Dependencies ```yaml -unit_test: - component: "PriceCalculator" - scenario: "Calculate discount with multiple rules" - justification: "Complex business logic with multiple branches" - mock_requirements: "None - pure function" +data: + - test-levels-framework.md # Unit/Integration/E2E decision criteria + - test-priorities-matrix.md # P0/P1/P2/P3 classification system ``` -### Integration Tests - -**When to use:** - -- Testing component interactions -- Database operations and queries -- API endpoint behavior -- Service layer orchestration -- External service integration (with test doubles) - -**Characteristics:** - -- Moderate execution time -- May use test databases or containers -- Tests multiple components together -- Validates contracts between components - -**Example scenarios:** - -```yaml -integration_test: - components: ["UserService", "UserRepository", "Database"] - scenario: "Create user with duplicate email check" - justification: "Tests transaction boundaries and constraint handling" - test_doubles: "Mock email service, real test database" -``` - -### End-to-End Tests - -**When to use:** - -- Critical user journeys -- Cross-system workflows -- UI interaction flows -- Full stack validation -- Production-like scenario testing - -**Characteristics:** - -- Keep under 90 seconds per test -- Tests complete user scenarios -- Uses real or production-like environment -- Higher maintenance cost -- More prone to flakiness - -**Example scenarios:** - -```yaml -e2e_test: - flow: "Complete purchase flow" - scenario: "User browses, adds to cart, and completes checkout" - justification: "Critical business flow requiring full stack validation" - environment: "Staging with test payment gateway" -``` - -## Test Design Process +## Process ### 1. Analyze Story Requirements -Break down each acceptance criterion into testable scenarios: +Break down each acceptance criterion into testable scenarios. For each AC: -```yaml -acceptance_criterion: "User can reset password via email" -test_scenarios: - - level: unit - what: "Password validation rules" - why: "Complex regex and business rules" +- Identify the core functionality to test +- Determine data variations needed +- Consider error conditions +- Note edge cases - - level: integration - what: "Password reset token generation and storage" - why: "Database interaction with expiry logic" +### 2. Apply Test Level Framework - - level: integration - what: "Email service integration" - why: "External service with retry logic" +**Reference:** Load `test-levels-framework.md` for detailed criteria - - level: e2e - what: "Complete password reset flow" - why: "Critical security flow needing full validation" -``` +Quick rules: -### 2. Apply Test Level Heuristics +- **Unit**: Pure logic, algorithms, calculations +- **Integration**: Component interactions, DB operations +- **E2E**: Critical user journeys, compliance -Use these rules to determine appropriate test levels: +### 3. Assign Priorities -```markdown -## Test Level Selection Rules +**Reference:** Load `test-priorities-matrix.md` for classification -### Favor Unit Tests When: +Quick priority assignment: -- Logic can be isolated -- No side effects involved -- Fast feedback needed -- High cyclomatic complexity +- **P0**: Revenue-critical, security, compliance +- **P1**: Core user journeys, frequently used +- **P2**: Secondary features, admin functions +- **P3**: Nice-to-have, rarely used -### Favor Integration Tests When: +### 4. Design Test Scenarios -- Testing persistence layer -- Validating service contracts -- Testing middleware/interceptors -- Component boundaries critical - -### Favor E2E Tests When: - -- User-facing critical paths -- Multi-system interactions -- Regulatory compliance scenarios -- Visual regression important - -### Anti-patterns to Avoid: - -- E2E testing for business logic validation -- Unit testing framework behavior -- Integration testing third-party libraries -- Duplicate coverage across levels - -### Duplicate Coverage Guard - -**Before adding any test, check:** - -1. Is this already tested at a lower level? -2. Can a unit test cover this instead of integration? -3. Can an integration test cover this instead of E2E? - -**Coverage overlap is only acceptable when:** - -- Testing different aspects (unit: logic, integration: interaction, e2e: user experience) -- Critical paths requiring defense in depth -- Regression prevention for previously broken functionality -``` - -### 3. Design Test Scenarios - -**Test ID Format:** `{EPIC}.{STORY}-{LEVEL}-{SEQ}` - -- Example: `1.3-UNIT-001`, `1.3-INT-002`, `1.3-E2E-001` -- Ensures traceability across all artifacts - -**Naming Convention:** - -- Unit: `test_{component}_{scenario}` -- Integration: `test_{flow}_{interaction}` -- E2E: `test_{journey}_{outcome}` - -**Risk Linkage:** - -- Tag tests with risk IDs they mitigate -- Prioritize tests for high-risk areas (P0) -- Link to risk profile when available - -For each identified test need: +For each identified test need, create: ```yaml test_scenario: - id: "1.3-INT-002" - requirement: "AC2: Rate limiting on login attempts" - mitigates_risks: ["SEC-001", "PERF-003"] # Links to risk profile - priority: P0 # Based on risk score - - unit_tests: - - name: "RateLimiter calculates window correctly" - input: "Timestamp array" - expected: "Correct window calculation" - - integration_tests: - - name: "Login endpoint enforces rate limit" - setup: "5 failed attempts" - action: "6th attempt" - expected: "429 response with retry-after header" - - e2e_tests: - - name: "User sees rate limit message" - setup: "Trigger rate limit" - validation: "Error message displayed, retry timer shown" + id: '{epic}.{story}-{LEVEL}-{SEQ}' + requirement: 'AC reference' + priority: P0|P1|P2|P3 + level: unit|integration|e2e + description: 'What is being tested' + justification: 'Why this level was chosen' + mitigates_risks: ['RISK-001'] # If risk profile exists ``` -## Deterministic Test Level Minimums +### 5. Validate Coverage -**Per Acceptance Criterion:** +Ensure: -- At least 1 unit test for business logic -- At least 1 integration test if multiple components interact -- At least 1 E2E test if it's a user-facing feature - -**Exceptions:** - -- Pure UI changes: May skip unit tests -- Pure logic changes: May skip E2E tests -- Infrastructure changes: May focus on integration tests - -**When in doubt:** Start with unit tests, add integration for interactions, E2E for critical paths only. - -## Test Quality Standards - -### Core Testing Principles - -**No Flaky Tests:** Ensure reliability through proper async handling, explicit waits, and atomic test design. - -**No Hard Waits/Sleeps:** Use dynamic waiting strategies (e.g., polling, event-based triggers). - -**Stateless & Parallel-Safe:** Tests run independently; use cron jobs or semaphores only if unavoidable. - -**No Order Dependency:** Every it/describe/context block works in isolation (supports .only execution). - -**Self-Cleaning Tests:** Test sets up its own data and automatically deletes/deactivates entities created during testing. - -**Tests Live Near Source Code:** Co-locate test files with the code they validate (e.g., `*.spec.js` alongside components). - -### Execution Strategy - -**Shifted Left:** - -- Start with local environments or ephemeral stacks -- Validate functionality across all deployment stages (local → dev → stage) - -**Low Maintenance:** Minimize manual upkeep (avoid brittle selectors, do not repeat UI actions, leverage APIs). - -**CI Execution Evidence:** Integrate into pipelines with clear logs/artifacts. - -**Visibility:** Generate test reports (e.g., JUnit XML, HTML) for failures and trends. - -### Coverage Requirements - -**Release Confidence:** - -- Happy Path: Core user journeys are prioritized -- Edge Cases: Critical error/validation scenarios are covered -- Feature Flags: Test both enabled and disabled states where applicable - -### Test Design Rules - -**Assertions:** Keep them explicit in tests; avoid abstraction into helpers. Use parametrized tests for soft assertions. - -**Naming:** Follow conventions (e.g., `describe('Component')`, `it('should do X when Y')`). - -**Size:** Aim for files ≤200 lines; split/chunk large tests logically. - -**Speed:** Target individual tests ≤90 seconds; optimize slow setups (e.g., shared fixtures). - -**Careful Abstractions:** Favor readability over DRY when balancing helper reuse (page objects are okay, assertion logic is not). - -**Test Cleanup:** Ensure tests clean up resources they create (e.g., closing browser, deleting test data). - -**Deterministic Flow:** Tests should refrain from using conditionals (e.g., if/else) to control flow or try/catch blocks where possible. - -### API Testing Standards - -- Tests must not depend on hardcoded data → use factories and per-test setup -- Always test both happy path and negative/error cases -- API tests should run parallel safely (no global state shared) -- Test idempotency where applicable (e.g., duplicate requests) -- Tests should clean up their data -- Response logs should only be printed in case of failure -- Auth tests must validate token expiration and renewal +- Every AC has at least one test +- No duplicate coverage across levels +- Critical paths have multiple levels +- Risk mitigations are addressed ## Outputs @@ -10260,13 +10085,11 @@ test_scenario: **Save to:** `docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md` -Generate a comprehensive test design document: - ```markdown # Test Design: Story {epic}.{story} Date: {date} -Reviewer: Quinn (Test Architect) +Designer: Quinn (Test Architect) ## Test Strategy Overview @@ -10274,212 +10097,80 @@ Reviewer: Quinn (Test Architect) - Unit tests: Y (A%) - Integration tests: Z (B%) - E2E tests: W (C%) +- Priority distribution: P0: X, P1: Y, P2: Z -## Test Level Rationale +## Test Scenarios by Acceptance Criteria -[Explain why this distribution was chosen] +### AC1: {description} -## Detailed Test Scenarios +#### Scenarios -### Requirement: AC1 - {description} +| ID | Level | Priority | Test | Justification | +| ------------ | ----------- | -------- | ------------------------- | ------------------------ | +| 1.3-UNIT-001 | Unit | P0 | Validate input format | Pure validation logic | +| 1.3-INT-001 | Integration | P0 | Service processes request | Multi-component flow | +| 1.3-E2E-001 | E2E | P1 | User completes journey | Critical path validation | -#### Unit Tests (3 scenarios) +[Continue for all ACs...] -1. **ID**: 1.3-UNIT-001 - **Test**: Validate input format - - **Why Unit**: Pure validation logic - - **Coverage**: Input edge cases - - **Mocks**: None needed - - **Mitigates**: DATA-001 (if applicable) +## Risk Coverage -#### Integration Tests (2 scenarios) +[Map test scenarios to identified risks if risk profile exists] -1. **ID**: 1.3-INT-001 - **Test**: Service processes valid request - - **Why Integration**: Multiple components involved - - **Coverage**: Happy path + error handling - - **Test Doubles**: Mock external API - - **Mitigates**: TECH-002 +## Recommended Execution Order -#### E2E Tests (1 scenario) - -1. **ID**: 1.3-E2E-001 - **Test**: Complete user workflow - - **Why E2E**: Critical user journey - - **Coverage**: Full stack validation - - **Environment**: Staging - - **Max Duration**: 90 seconds - - **Mitigates**: BUS-001 - -[Continue for all requirements...] - -## Test Data Requirements - -### Unit Test Data - -- Static fixtures for calculations -- Edge case values arrays - -### Integration Test Data - -- Test database seeds -- API response fixtures - -### E2E Test Data - -- Test user accounts -- Sandbox environment data - -## Mock/Stub Strategy - -### What to Mock - -- External services (payment, email) -- Time-dependent functions -- Random number generators - -### What NOT to Mock - -- Core business logic -- Database in integration tests -- Critical security functions - -## Test Execution Implementation - -### Parallel Execution - -- All unit tests: Fully parallel (stateless requirement) -- Integration tests: Parallel with isolated databases -- E2E tests: Sequential or limited parallelism - -### Execution Order - -1. Unit tests first (fail fast) -2. Integration tests second -3. E2E tests last (expensive, max 90 seconds each) - -## Risk-Based Test Priority - -### P0 - Must Have (Linked to Critical/High Risks) - -- Security-related tests (SEC-\* risks) -- Data integrity tests (DATA-\* risks) -- Critical business flow tests (BUS-\* risks) -- Tests for risks scored ≥6 in risk profile - -### P1 - Should Have (Medium Risks) - -- Edge case coverage -- Performance tests (PERF-\* risks) -- Error recovery tests -- Tests for risks scored 4-5 - -### P2 - Nice to Have (Low Risks) - -- UI polish tests -- Minor validation tests -- Tests for risks scored ≤3 - -## Test Maintenance Considerations - -### High Maintenance Tests - -[List tests that may need frequent updates] - -### Stability Measures - -- No retry strategies (tests must be deterministic) -- Dynamic waits only (no hard sleeps) -- Environment isolation -- Self-cleaning test data - -## Coverage Goals - -### Unit Test Coverage - -- Target: 80% line coverage -- Focus: Business logic, calculations - -### Integration Coverage - -- Target: All API endpoints -- Focus: Contract validation - -### E2E Coverage - -- Target: Critical paths only -- Focus: User value delivery +1. P0 Unit tests (fail fast) +2. P0 Integration tests +3. P0 E2E tests +4. P1 tests in order +5. P2+ as time permits ``` -## Test Level Smells to Flag +### Output 2: Gate YAML Block -### Over-testing Smells +Generate for inclusion in quality gate: -- Same logic tested at multiple levels -- E2E tests for calculations -- Integration tests for framework features +```yaml +test_design: + scenarios_total: X + by_level: + unit: Y + integration: Z + e2e: W + by_priority: + p0: A + p1: B + p2: C + coverage_gaps: [] # List any ACs without tests +``` -### Under-testing Smells +### Output 3: Trace References -- No unit tests for complex logic -- Missing integration tests for data operations -- No E2E tests for critical user paths +Print for use by trace-requirements task: -### Wrong Level Smells +```text +Test design matrix: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md +P0 tests identified: {count} +``` -- Unit tests with real database -- E2E tests checking calculation results -- Integration tests mocking everything +## Quality Checklist -## Quality Indicators +Before finalizing, verify: -Good test design shows: - -- Clear level separation -- No redundant coverage -- Fast feedback from unit tests -- Reliable integration tests -- Focused e2e tests +- [ ] Every AC has test coverage +- [ ] Test levels are appropriate (not over-testing) +- [ ] No duplicate coverage across levels +- [ ] Priorities align with business risk +- [ ] Test IDs follow naming convention +- [ ] Scenarios are atomic and independent ## Key Principles -- Test at the lowest appropriate level -- One clear owner per test -- Fast tests run first -- Mock at boundaries, not internals -- E2E for user value, not implementation -- Maintain test/production parity where critical -- Tests must be atomic and self-contained -- No shared state between tests -- Explicit assertions in test files (not helpers) - -### Output 2: Story Hook Line - -**Print this line for review task to quote:** - -```text -Test design: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md -``` - -**For traceability:** This planning document will be referenced by trace-requirements task. - -### Output 3: Test Count Summary - -**Print summary for quick reference:** - -```yaml -test_summary: - total: { total_count } - by_level: - unit: { unit_count } - integration: { int_count } - e2e: { e2e_count } - by_priority: - P0: { p0_count } - P1: { p1_count } - P2: { p2_count } - coverage_gaps: [] # List any ACs without tests -``` +- **Shift left**: Prefer unit over integration, integration over E2E +- **Risk-based**: Focus on what could go wrong +- **Efficient coverage**: Test once at the right level +- **Maintainability**: Consider long-term test maintenance +- **Fast feedback**: Quick tests run first ==================== END: .bmad-core/tasks/test-design.md ==================== ==================== START: .bmad-core/tasks/nfr-assess.md ==================== @@ -10491,12 +10182,12 @@ Quick NFR validation focused on the core four: security, performance, reliabilit ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: 'docs/stories/{epic}.{story}.*.md' optional: - - architecture_refs: "docs/architecture/*.md" - - technical_preferences: "docs/technical-preferences.md" + - architecture_refs: 'docs/architecture/*.md' + - technical_preferences: 'docs/technical-preferences.md' - acceptance_criteria: From story file ``` @@ -10577,16 +10268,16 @@ nfr_validation: _assessed: [security, performance, reliability, maintainability] security: status: CONCERNS - notes: "No rate limiting on auth endpoints" + notes: 'No rate limiting on auth endpoints' performance: status: PASS - notes: "Response times < 200ms verified" + notes: 'Response times < 200ms verified' reliability: status: PASS - notes: "Error handling and retries implemented" + notes: 'Error handling and retries implemented' maintainability: status: CONCERNS - notes: "Test coverage at 65%, target is 80%" + notes: 'Test coverage at 65%, target is 80%' ``` ## Deterministic Status Rules @@ -10816,10 +10507,10 @@ performance_deep_dive: p99: 350ms database: slow_queries: 2 - missing_indexes: ["users.email", "orders.user_id"] + missing_indexes: ['users.email', 'orders.user_id'] caching: hit_rate: 0% - recommendation: "Add Redis for session data" + recommendation: 'Add Redis for session data' load_test: max_rps: 150 breaking_point: 200 rps @@ -10836,16 +10527,16 @@ template: output: format: yaml filename: docs/qa/gates/{{epic_num}}.{{story_num}}-{{story_slug}}.yml - title: "Quality Gate: {{epic_num}}.{{story_num}}" + title: 'Quality Gate: {{epic_num}}.{{story_num}}' # Required fields (keep these first) schema: 1 -story: "{{epic_num}}.{{story_num}}" -story_title: "{{story_title}}" -gate: "{{gate_status}}" # PASS|CONCERNS|FAIL|WAIVED -status_reason: "{{status_reason}}" # 1-2 sentence summary of why this gate decision -reviewer: "Quinn (Test Architect)" -updated: "{{iso_timestamp}}" +story: '{{epic_num}}.{{story_num}}' +story_title: '{{story_title}}' +gate: '{{gate_status}}' # PASS|CONCERNS|FAIL|WAIVED +status_reason: '{{status_reason}}' # 1-2 sentence summary of why this gate decision +reviewer: 'Quinn (Test Architect)' +updated: '{{iso_timestamp}}' # Always present but only active when WAIVED waiver: { active: false } @@ -10860,68 +10551,77 @@ risk_summary: must_fix: [] monitor: [] -# Example with issues: -# top_issues: -# - id: "SEC-001" -# severity: high # ONLY: low|medium|high -# finding: "No rate limiting on login endpoint" -# suggested_action: "Add rate limiting middleware before production" -# - id: "TEST-001" -# severity: medium -# finding: "Missing integration tests for auth flow" -# suggested_action: "Add test coverage for critical paths" +# Examples section using block scalars for clarity +examples: + with_issues: | + top_issues: + - id: "SEC-001" + severity: high # ONLY: low|medium|high + finding: "No rate limiting on login endpoint" + suggested_action: "Add rate limiting middleware before production" + - id: "TEST-001" + severity: medium + finding: "Missing integration tests for auth flow" + suggested_action: "Add test coverage for critical paths" -# Example when waived: -# waiver: -# active: true -# reason: "Accepted for MVP release - will address in next sprint" -# approved_by: "Product Owner" + when_waived: | + waiver: + active: true + reason: "Accepted for MVP release - will address in next sprint" + approved_by: "Product Owner" # ============ Optional Extended Fields ============ # Uncomment and use if your team wants more detail -# quality_score: 75 # 0-100 (optional scoring) -# expires: "2025-01-26T00:00:00Z" # Optional gate freshness window +optional_fields_examples: + quality_and_expiry: | + quality_score: 75 # 0-100 (optional scoring) + expires: "2025-01-26T00:00:00Z" # Optional gate freshness window -# evidence: -# tests_reviewed: 15 -# risks_identified: 3 -# trace: -# ac_covered: [1, 2, 3] # AC numbers with test coverage -# ac_gaps: [4] # AC numbers lacking coverage + evidence: | + evidence: + tests_reviewed: 15 + risks_identified: 3 + trace: + ac_covered: [1, 2, 3] # AC numbers with test coverage + ac_gaps: [4] # AC numbers lacking coverage -# nfr_validation: -# security: { status: CONCERNS, notes: "Rate limiting missing" } -# performance: { status: PASS, notes: "" } -# reliability: { status: PASS, notes: "" } -# maintainability: { status: PASS, notes: "" } + nfr_validation: | + nfr_validation: + security: { status: CONCERNS, notes: "Rate limiting missing" } + performance: { status: PASS, notes: "" } + reliability: { status: PASS, notes: "" } + maintainability: { status: PASS, notes: "" } -# history: # Append-only audit trail -# - at: "2025-01-12T10:00:00Z" -# gate: FAIL -# note: "Initial review - missing tests" -# - at: "2025-01-12T15:00:00Z" -# gate: CONCERNS -# note: "Tests added but rate limiting still missing" + history: | + history: # Append-only audit trail + - at: "2025-01-12T10:00:00Z" + gate: FAIL + note: "Initial review - missing tests" + - at: "2025-01-12T15:00:00Z" + gate: CONCERNS + note: "Tests added but rate limiting still missing" -# risk_summary: # From risk-profile task -# totals: -# critical: 0 -# high: 0 -# medium: 0 -# low: 0 -# # 'highest' is emitted only when risks exist -# recommendations: -# must_fix: [] -# monitor: [] + risk_summary: | + risk_summary: # From risk-profile task + totals: + critical: 0 + high: 0 + medium: 0 + low: 0 + # 'highest' is emitted only when risks exist + recommendations: + must_fix: [] + monitor: [] -# recommendations: -# immediate: # Must fix before production -# - action: "Add rate limiting to auth endpoints" -# refs: ["api/auth/login.ts:42-68"] -# future: # Can be addressed later -# - action: "Consider caching for better performance" -# refs: ["services/data.service.ts"] + recommendations: | + recommendations: + immediate: # Must fix before production + - action: "Add rate limiting to auth endpoints" + refs: ["api/auth/login.ts:42-68"] + future: # Can be addressed later + - action: "Consider caching for better performance" + refs: ["services/data.service.ts"] ==================== END: .bmad-core/templates/qa-gate-tmpl.yaml ==================== ==================== START: .bmad-core/tasks/create-next-story.md ==================== @@ -11257,7 +10957,7 @@ template: output: format: markdown filename: docs/front-end-spec.md - title: "{{project_name}} UI/UX Specification" + title: '{{project_name}} UI/UX Specification' workflow: mode: interactive @@ -11268,7 +10968,7 @@ sections: title: Introduction instruction: | Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification. - + Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted. content: | This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{project_name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. @@ -11277,7 +10977,7 @@ sections: title: Overall UX Goals & Principles instruction: | Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: - + 1. Target User Personas - elicit details or confirm existing ones from PRD 2. Key Usability Goals - understand what success looks like for users 3. Core Design Principles - establish 3-5 guiding principles @@ -11285,29 +10985,29 @@ sections: sections: - id: user-personas title: Target User Personas - template: "{{persona_descriptions}}" + template: '{{persona_descriptions}}' examples: - - "**Power User:** Technical professionals who need advanced features and efficiency" - - "**Casual User:** Occasional users who prioritize ease of use and clear guidance" - - "**Administrator:** System managers who need control and oversight capabilities" + - '**Power User:** Technical professionals who need advanced features and efficiency' + - '**Casual User:** Occasional users who prioritize ease of use and clear guidance' + - '**Administrator:** System managers who need control and oversight capabilities' - id: usability-goals title: Usability Goals - template: "{{usability_goals}}" + template: '{{usability_goals}}' examples: - - "Ease of learning: New users can complete core tasks within 5 minutes" - - "Efficiency of use: Power users can complete frequent tasks with minimal clicks" - - "Error prevention: Clear validation and confirmation for destructive actions" - - "Memorability: Infrequent users can return without relearning" + - 'Ease of learning: New users can complete core tasks within 5 minutes' + - 'Efficiency of use: Power users can complete frequent tasks with minimal clicks' + - 'Error prevention: Clear validation and confirmation for destructive actions' + - 'Memorability: Infrequent users can return without relearning' - id: design-principles title: Design Principles - template: "{{design_principles}}" + template: '{{design_principles}}' type: numbered-list examples: - - "**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation" + - '**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation' - "**Progressive disclosure** - Show only what's needed, when it's needed" - - "**Consistent patterns** - Use familiar UI patterns throughout the application" - - "**Immediate feedback** - Every action should have a clear, immediate response" - - "**Accessible by default** - Design for all users from the start" + - '**Consistent patterns** - Use familiar UI patterns throughout the application' + - '**Immediate feedback** - Every action should have a clear, immediate response' + - '**Accessible by default** - Design for all users from the start' - id: changelog title: Change Log type: table @@ -11318,7 +11018,7 @@ sections: title: Information Architecture (IA) instruction: | Collaborate with the user to create a comprehensive information architecture: - + 1. Build a Site Map or Screen Inventory showing all major areas 2. Define the Navigation Structure (primary, secondary, breadcrumbs) 3. Use Mermaid diagrams for visual representation @@ -11329,7 +11029,7 @@ sections: title: Site Map / Screen Inventory type: mermaid mermaid_type: graph - template: "{{sitemap_diagram}}" + template: '{{sitemap_diagram}}' examples: - | graph TD @@ -11348,46 +11048,46 @@ sections: title: Navigation Structure template: | **Primary Navigation:** {{primary_nav_description}} - + **Secondary Navigation:** {{secondary_nav_description}} - + **Breadcrumb Strategy:** {{breadcrumb_strategy}} - id: user-flows title: User Flows instruction: | For each critical user task identified in the PRD: - + 1. Define the user's goal clearly 2. Map out all steps including decision points 3. Consider edge cases and error states 4. Use Mermaid flow diagrams for clarity 5. Link to external tools (Figma/Miro) if detailed flows exist there - + Create subsections for each major flow. elicit: true repeatable: true sections: - id: flow - title: "{{flow_name}}" + title: '{{flow_name}}' template: | **User Goal:** {{flow_goal}} - + **Entry Points:** {{entry_points}} - + **Success Criteria:** {{success_criteria}} sections: - id: flow-diagram title: Flow Diagram type: mermaid mermaid_type: graph - template: "{{flow_diagram}}" + template: '{{flow_diagram}}' - id: edge-cases - title: "Edge Cases & Error Handling:" + title: 'Edge Cases & Error Handling:' type: bullet-list - template: "- {{edge_case}}" + template: '- {{edge_case}}' - id: notes - template: "**Notes:** {{flow_notes}}" + template: '**Notes:** {{flow_notes}}' - id: wireframes-mockups title: Wireframes & Mockups @@ -11396,23 +11096,23 @@ sections: elicit: true sections: - id: design-files - template: "**Primary Design Files:** {{design_tool_link}}" + template: '**Primary Design Files:** {{design_tool_link}}' - id: key-screen-layouts title: Key Screen Layouts repeatable: true sections: - id: screen - title: "{{screen_name}}" + title: '{{screen_name}}' template: | **Purpose:** {{screen_purpose}} - + **Key Elements:** - {{element_1}} - {{element_2}} - {{element_3}} - + **Interaction Notes:** {{interaction_notes}} - + **Design File Reference:** {{specific_frame_link}} - id: component-library @@ -11422,20 +11122,20 @@ sections: elicit: true sections: - id: design-system-approach - template: "**Design System Approach:** {{design_system_approach}}" + template: '**Design System Approach:** {{design_system_approach}}' - id: core-components title: Core Components repeatable: true sections: - id: component - title: "{{component_name}}" + title: '{{component_name}}' template: | **Purpose:** {{component_purpose}} - + **Variants:** {{component_variants}} - + **States:** {{component_states}} - + **Usage Guidelines:** {{usage_guidelines}} - id: branding-style @@ -11445,19 +11145,19 @@ sections: sections: - id: visual-identity title: Visual Identity - template: "**Brand Guidelines:** {{brand_guidelines_link}}" + template: '**Brand Guidelines:** {{brand_guidelines_link}}' - id: color-palette title: Color Palette type: table - columns: ["Color Type", "Hex Code", "Usage"] + columns: ['Color Type', 'Hex Code', 'Usage'] rows: - - ["Primary", "{{primary_color}}", "{{primary_usage}}"] - - ["Secondary", "{{secondary_color}}", "{{secondary_usage}}"] - - ["Accent", "{{accent_color}}", "{{accent_usage}}"] - - ["Success", "{{success_color}}", "Positive feedback, confirmations"] - - ["Warning", "{{warning_color}}", "Cautions, important notices"] - - ["Error", "{{error_color}}", "Errors, destructive actions"] - - ["Neutral", "{{neutral_colors}}", "Text, borders, backgrounds"] + - ['Primary', '{{primary_color}}', '{{primary_usage}}'] + - ['Secondary', '{{secondary_color}}', '{{secondary_usage}}'] + - ['Accent', '{{accent_color}}', '{{accent_usage}}'] + - ['Success', '{{success_color}}', 'Positive feedback, confirmations'] + - ['Warning', '{{warning_color}}', 'Cautions, important notices'] + - ['Error', '{{error_color}}', 'Errors, destructive actions'] + - ['Neutral', '{{neutral_colors}}', 'Text, borders, backgrounds'] - id: typography title: Typography sections: @@ -11470,24 +11170,24 @@ sections: - id: type-scale title: Type Scale type: table - columns: ["Element", "Size", "Weight", "Line Height"] + columns: ['Element', 'Size', 'Weight', 'Line Height'] rows: - - ["H1", "{{h1_size}}", "{{h1_weight}}", "{{h1_line}}"] - - ["H2", "{{h2_size}}", "{{h2_weight}}", "{{h2_line}}"] - - ["H3", "{{h3_size}}", "{{h3_weight}}", "{{h3_line}}"] - - ["Body", "{{body_size}}", "{{body_weight}}", "{{body_line}}"] - - ["Small", "{{small_size}}", "{{small_weight}}", "{{small_line}}"] + - ['H1', '{{h1_size}}', '{{h1_weight}}', '{{h1_line}}'] + - ['H2', '{{h2_size}}', '{{h2_weight}}', '{{h2_line}}'] + - ['H3', '{{h3_size}}', '{{h3_weight}}', '{{h3_line}}'] + - ['Body', '{{body_size}}', '{{body_weight}}', '{{body_line}}'] + - ['Small', '{{small_size}}', '{{small_weight}}', '{{small_line}}'] - id: iconography title: Iconography template: | **Icon Library:** {{icon_library}} - + **Usage Guidelines:** {{icon_guidelines}} - id: spacing-layout title: Spacing & Layout template: | **Grid System:** {{grid_system}} - + **Spacing Scale:** {{spacing_scale}} - id: accessibility @@ -11497,7 +11197,7 @@ sections: sections: - id: compliance-target title: Compliance Target - template: "**Standard:** {{compliance_standard}}" + template: '**Standard:** {{compliance_standard}}' - id: key-requirements title: Key Requirements template: | @@ -11505,19 +11205,19 @@ sections: - Color contrast ratios: {{contrast_requirements}} - Focus indicators: {{focus_requirements}} - Text sizing: {{text_requirements}} - + **Interaction:** - Keyboard navigation: {{keyboard_requirements}} - Screen reader support: {{screen_reader_requirements}} - Touch targets: {{touch_requirements}} - + **Content:** - Alternative text: {{alt_text_requirements}} - Heading structure: {{heading_requirements}} - Form labels: {{form_requirements}} - id: testing-strategy title: Testing Strategy - template: "{{accessibility_testing}}" + template: '{{accessibility_testing}}' - id: responsiveness title: Responsiveness Strategy @@ -11527,21 +11227,21 @@ sections: - id: breakpoints title: Breakpoints type: table - columns: ["Breakpoint", "Min Width", "Max Width", "Target Devices"] + columns: ['Breakpoint', 'Min Width', 'Max Width', 'Target Devices'] rows: - - ["Mobile", "{{mobile_min}}", "{{mobile_max}}", "{{mobile_devices}}"] - - ["Tablet", "{{tablet_min}}", "{{tablet_max}}", "{{tablet_devices}}"] - - ["Desktop", "{{desktop_min}}", "{{desktop_max}}", "{{desktop_devices}}"] - - ["Wide", "{{wide_min}}", "-", "{{wide_devices}}"] + - ['Mobile', '{{mobile_min}}', '{{mobile_max}}', '{{mobile_devices}}'] + - ['Tablet', '{{tablet_min}}', '{{tablet_max}}', '{{tablet_devices}}'] + - ['Desktop', '{{desktop_min}}', '{{desktop_max}}', '{{desktop_devices}}'] + - ['Wide', '{{wide_min}}', '-', '{{wide_devices}}'] - id: adaptation-patterns title: Adaptation Patterns template: | **Layout Changes:** {{layout_adaptations}} - + **Navigation Changes:** {{nav_adaptations}} - + **Content Priority:** {{content_adaptations}} - + **Interaction Changes:** {{interaction_adaptations}} - id: animation @@ -11551,11 +11251,11 @@ sections: sections: - id: motion-principles title: Motion Principles - template: "{{motion_principles}}" + template: '{{motion_principles}}' - id: key-animations title: Key Animations repeatable: true - template: "- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})" + template: '- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})' - id: performance title: Performance Considerations @@ -11569,13 +11269,13 @@ sections: - **Animation FPS:** {{animation_goal}} - id: design-strategies title: Design Strategies - template: "{{performance_strategies}}" + template: '{{performance_strategies}}' - id: next-steps title: Next Steps instruction: | After completing the UI/UX specification: - + 1. Recommend review with stakeholders 2. Suggest creating/updating visual designs in design tool 3. Prepare for handoff to Design Architect for frontend architecture @@ -11584,17 +11284,17 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action}}" + template: '{{action}}' - id: design-handoff-checklist title: Design Handoff Checklist type: checklist items: - - "All user flows documented" - - "Component inventory complete" - - "Accessibility requirements defined" - - "Responsive strategy clear" - - "Brand guidelines incorporated" - - "Performance goals established" + - 'All user flows documented' + - 'Component inventory complete' + - 'Accessibility requirements defined' + - 'Responsive strategy clear' + - 'Brand guidelines incorporated' + - 'Performance goals established' - id: checklist-results title: Checklist Results @@ -11624,7 +11324,7 @@ workflow: - Single story (< 4 hours) → Use brownfield-create-story task - Small feature (1-3 stories) → Use brownfield-create-epic task - Major enhancement (multiple epics) → Continue with full workflow - + Ask user: "Can you describe the enhancement scope? Is this a small fix, a feature addition, or a major enhancement requiring architectural changes?" - step: routing_decision @@ -11633,14 +11333,14 @@ workflow: single_story: agent: pm uses: brownfield-create-story - notes: "Create single story for immediate implementation. Exit workflow after story creation." + notes: 'Create single story for immediate implementation. Exit workflow after story creation.' small_feature: agent: pm uses: brownfield-create-epic - notes: "Create focused epic with 1-3 stories. Exit workflow after epic creation." + notes: 'Create focused epic with 1-3 stories. Exit workflow after epic creation.' major_enhancement: continue: to_next_step - notes: "Continue with comprehensive planning workflow below." + notes: 'Continue with comprehensive planning workflow below.' - step: documentation_check agent: analyst @@ -11658,7 +11358,7 @@ workflow: action: analyze existing project and use task document-project creates: brownfield-architecture.md (or multiple documents) condition: documentation_inadequate - notes: "Run document-project to capture current system state, technical debt, and constraints. Pass findings to PRD creation." + notes: 'Run document-project to capture current system state, technical debt, and constraints. Pass findings to PRD creation.' - agent: pm creates: prd.md @@ -11690,12 +11390,12 @@ workflow: - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for integration safety and completeness. May require updates to any document." + notes: 'Validates all documents for integration safety and completeness. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -11785,7 +11485,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -11869,36 +11569,36 @@ workflow: {{if single_story}}: Proceeding with brownfield-create-story task for immediate implementation. {{if small_feature}}: Creating focused epic with brownfield-create-epic task. {{if major_enhancement}}: Continuing with comprehensive planning workflow. - + documentation_assessment: | Documentation assessment complete: {{if adequate}}: Existing documentation is sufficient. Proceeding directly to PRD creation. {{if inadequate}}: Running document-project to capture current system state before PRD. - + document_project_to_pm: | Project analysis complete. Key findings documented in: - {{document_list}} Use these findings to inform PRD creation and avoid re-analyzing the same aspects. - + pm_to_architect_decision: | PRD complete and saved as docs/prd.md. Architectural changes identified: {{yes/no}} {{if yes}}: Proceeding to create architecture document for: {{specific_changes}} {{if no}}: No architectural changes needed. Proceeding to validation. - - architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for integration safety." - + + architect_to_po: 'Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for integration safety.' + po_to_sm: | All artifacts validated. Documentation type available: {{sharded_prd / brownfield_docs}} {{if sharded}}: Use standard create-next-story task. {{if brownfield}}: Use create-brownfield-story task to handle varied documentation formats. - + sm_story_creation: | Creating story from {{documentation_type}}. {{if missing_context}}: May need to gather additional context from user during story creation. - - complete: "All planning artifacts validated and development can begin. Stories will be created based on available documentation format." + + complete: 'All planning artifacts validated and development can begin. Stories will be created based on available documentation format.' ==================== END: .bmad-core/workflows/brownfield-fullstack.yaml ==================== ==================== START: .bmad-core/workflows/brownfield-service.yaml ==================== @@ -11921,7 +11621,7 @@ workflow: agent: architect action: analyze existing project and use task document-project creates: multiple documents per the document-project template - notes: "Review existing service documentation, codebase, performance metrics, and identify integration dependencies." + notes: 'Review existing service documentation, codebase, performance metrics, and identify integration dependencies.' - agent: pm creates: prd.md @@ -11938,12 +11638,12 @@ workflow: - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for service integration safety and API compatibility. May require updates to any document." + notes: 'Validates all documents for service integration safety and API compatibility. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -12031,7 +11731,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -12084,11 +11784,11 @@ workflow: - Multiple integration points affected handoff_prompts: - analyst_to_pm: "Service analysis complete. Create comprehensive PRD with service integration strategy." - pm_to_architect: "PRD ready. Save it as docs/prd.md, then create the service architecture." - architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for service integration safety." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Service analysis complete. Create comprehensive PRD with service integration strategy.' + pm_to_architect: 'PRD ready. Save it as docs/prd.md, then create the service architecture.' + architect_to_po: 'Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for service integration safety.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/brownfield-service.yaml ==================== ==================== START: .bmad-core/workflows/brownfield-ui.yaml ==================== @@ -12110,7 +11810,7 @@ workflow: agent: architect action: analyze existing project and use task document-project creates: multiple documents per the document-project template - notes: "Review existing frontend application, user feedback, analytics data, and identify improvement areas." + notes: 'Review existing frontend application, user feedback, analytics data, and identify improvement areas.' - agent: pm creates: prd.md @@ -12135,12 +11835,12 @@ workflow: - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for UI integration safety and design consistency. May require updates to any document." + notes: 'Validates all documents for UI integration safety and design consistency. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -12228,7 +11928,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -12283,12 +11983,12 @@ workflow: - Multiple team members will work on related changes handoff_prompts: - analyst_to_pm: "UI analysis complete. Create comprehensive PRD with UI integration strategy." - pm_to_ux: "PRD ready. Save it as docs/prd.md, then create the UI/UX specification." - ux_to_architect: "UI/UX spec complete. Save it as docs/front-end-spec.md, then create the frontend architecture." - architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for UI integration safety." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'UI analysis complete. Create comprehensive PRD with UI integration strategy.' + pm_to_ux: 'PRD ready. Save it as docs/prd.md, then create the UI/UX specification.' + ux_to_architect: 'UI/UX spec complete. Save it as docs/front-end-spec.md, then create the frontend architecture.' + architect_to_po: 'Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for UI integration safety.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/brownfield-ui.yaml ==================== ==================== START: .bmad-core/workflows/greenfield-fullstack.yaml ==================== @@ -12330,7 +12030,7 @@ workflow: creates: v0_prompt (optional) requires: front-end-spec.md condition: user_wants_ai_generation - notes: "OPTIONAL BUT RECOMMENDED: Generate AI UI prompt for tools like v0, Lovable, etc. Use the generate-ai-frontend-prompt task. User can then generate UI in external tool and download project structure." + notes: 'OPTIONAL BUT RECOMMENDED: Generate AI UI prompt for tools like v0, Lovable, etc. Use the generate-ai-frontend-prompt task. User can then generate UI in external tool and download project structure.' - agent: architect creates: fullstack-architecture.md @@ -12346,26 +12046,26 @@ workflow: updates: prd.md (if needed) requires: fullstack-architecture.md condition: architecture_suggests_prd_changes - notes: "If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder." + notes: 'If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder.' - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for consistency and completeness. May require updates to any document." + notes: 'Validates all documents for consistency and completeness. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - project_setup_guidance: action: guide_project_structure condition: user_has_generated_ui - notes: "If user generated UI with v0/Lovable: For polyrepo setup, place downloaded project in separate frontend repo alongside backend repo. For monorepo, place in apps/web or packages/frontend directory. Review architecture document for specific guidance." + notes: 'If user generated UI with v0/Lovable: For polyrepo setup, place downloaded project in separate frontend repo alongside backend repo. For monorepo, place in apps/web or packages/frontend directory. Review architecture document for specific guidance.' - development_order_guidance: action: guide_development_sequence - notes: "Based on PRD stories: If stories are frontend-heavy, start with frontend project/directory first. If backend-heavy or API-first, start with backend. For tightly coupled features, follow story sequence in monorepo setup. Reference sharded PRD epics for development order." + notes: 'Based on PRD stories: If stories are frontend-heavy, start with frontend project/directory first. If backend-heavy or API-first, start with backend. For tightly coupled features, follow story sequence in monorepo setup. Reference sharded PRD epics for development order.' - agent: po action: shard_documents @@ -12453,7 +12153,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -12524,14 +12224,14 @@ workflow: - Enterprise or customer-facing applications handoff_prompts: - analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD." - pm_to_ux: "PRD is ready. Save it as docs/prd.md in your project, then create the UI/UX specification." - ux_to_architect: "UI/UX spec complete. Save it as docs/front-end-spec.md in your project, then create the fullstack architecture." - architect_review: "Architecture complete. Save it as docs/fullstack-architecture.md. Do you suggest any changes to the PRD stories or need new stories added?" - architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/." - updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD.' + pm_to_ux: 'PRD is ready. Save it as docs/prd.md in your project, then create the UI/UX specification.' + ux_to_architect: 'UI/UX spec complete. Save it as docs/front-end-spec.md in your project, then create the fullstack architecture.' + architect_review: 'Architecture complete. Save it as docs/fullstack-architecture.md. Do you suggest any changes to the PRD stories or need new stories added?' + architect_to_pm: 'Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/.' + updated_to_po: 'All documents ready in docs/ folder. Please validate all artifacts for consistency.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/greenfield-fullstack.yaml ==================== ==================== START: .bmad-core/workflows/greenfield-service.yaml ==================== @@ -12574,17 +12274,17 @@ workflow: updates: prd.md (if needed) requires: architecture.md condition: architecture_suggests_prd_changes - notes: "If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder." + notes: 'If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder.' - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for consistency and completeness. May require updates to any document." + notes: 'Validates all documents for consistency and completeness. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -12672,7 +12372,7 @@ workflow: notes: | All stories implemented and reviewed! Service development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -12734,13 +12434,13 @@ workflow: - Enterprise or external-facing APIs handoff_prompts: - analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD." - pm_to_architect: "PRD is ready. Save it as docs/prd.md in your project, then create the service architecture." - architect_review: "Architecture complete. Save it as docs/architecture.md. Do you suggest any changes to the PRD stories or need new stories added?" - architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/." - updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD.' + pm_to_architect: 'PRD is ready. Save it as docs/prd.md in your project, then create the service architecture.' + architect_review: 'Architecture complete. Save it as docs/architecture.md. Do you suggest any changes to the PRD stories or need new stories added?' + architect_to_pm: 'Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/.' + updated_to_po: 'All documents ready in docs/ folder. Please validate all artifacts for consistency.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/greenfield-service.yaml ==================== ==================== START: .bmad-core/workflows/greenfield-ui.yaml ==================== @@ -12783,7 +12483,7 @@ workflow: creates: v0_prompt (optional) requires: front-end-spec.md condition: user_wants_ai_generation - notes: "OPTIONAL BUT RECOMMENDED: Generate AI UI prompt for tools like v0, Lovable, etc. Use the generate-ai-frontend-prompt task. User can then generate UI in external tool and download project structure." + notes: 'OPTIONAL BUT RECOMMENDED: Generate AI UI prompt for tools like v0, Lovable, etc. Use the generate-ai-frontend-prompt task. User can then generate UI in external tool and download project structure.' - agent: architect creates: front-end-architecture.md @@ -12797,22 +12497,22 @@ workflow: updates: prd.md (if needed) requires: front-end-architecture.md condition: architecture_suggests_prd_changes - notes: "If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder." + notes: 'If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder.' - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for consistency and completeness. May require updates to any document." + notes: 'Validates all documents for consistency and completeness. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - project_setup_guidance: action: guide_project_structure condition: user_has_generated_ui - notes: "If user generated UI with v0/Lovable: For polyrepo setup, place downloaded project in separate frontend repo. For monorepo, place in apps/web or frontend/ directory. Review architecture document for specific guidance." + notes: 'If user generated UI with v0/Lovable: For polyrepo setup, place downloaded project in separate frontend repo. For monorepo, place in apps/web or frontend/ directory. Review architecture document for specific guidance.' - agent: po action: shard_documents @@ -12900,7 +12600,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -12971,12 +12671,12 @@ workflow: - Customer-facing applications handoff_prompts: - analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD." - pm_to_ux: "PRD is ready. Save it as docs/prd.md in your project, then create the UI/UX specification." - ux_to_architect: "UI/UX spec complete. Save it as docs/front-end-spec.md in your project, then create the frontend architecture." - architect_review: "Frontend architecture complete. Save it as docs/front-end-architecture.md. Do you suggest any changes to the PRD stories or need new stories added?" - architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/." - updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD.' + pm_to_ux: 'PRD is ready. Save it as docs/prd.md in your project, then create the UI/UX specification.' + ux_to_architect: 'UI/UX spec complete. Save it as docs/front-end-spec.md in your project, then create the frontend architecture.' + architect_review: 'Frontend architecture complete. Save it as docs/front-end-architecture.md. Do you suggest any changes to the PRD stories or need new stories added?' + architect_to_pm: 'Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/.' + updated_to_po: 'All documents ready in docs/ folder. Please validate all artifacts for consistency.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/greenfield-ui.yaml ==================== diff --git a/dist/teams/team-fullstack.txt b/dist/teams/team-fullstack.txt index f0eccbec..b3358831 100644 --- a/dist/teams/team-fullstack.txt +++ b/dist/teams/team-fullstack.txt @@ -1098,7 +1098,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing - **Claude Code**: `/agent-name` (e.g., `/bmad-master`) - **Cursor**: `@agent-name` (e.g., `@bmad-master`) -- **Windsurf**: `@agent-name` (e.g., `@bmad-master`) +- **Windsurf**: `/agent-name` (e.g., `/bmad-master`) - **Trae**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-master`) - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. @@ -1838,7 +1838,7 @@ Agents should be workflow-aware: know active workflow, their role, access artifa ==================== START: .bmad-core/tasks/facilitate-brainstorming-session.md ==================== --- docOutputLocation: docs/brainstorming-session-results.md -template: ".bmad-core/templates/brainstorming-output-tmpl.yaml" +template: '.bmad-core/templates/brainstorming-output-tmpl.yaml' --- # Facilitate Brainstorming Session Task @@ -2609,35 +2609,35 @@ template: output: format: markdown filename: docs/brief.md - title: "Project Brief: {{project_name}}" + title: 'Project Brief: {{project_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Project Brief Elicitation Actions" + title: 'Project Brief Elicitation Actions' options: - - "Expand section with more specific details" - - "Validate against similar successful products" - - "Stress test assumptions with edge cases" - - "Explore alternative solution approaches" - - "Analyze resource/constraint trade-offs" - - "Generate risk mitigation strategies" - - "Challenge scope from MVP minimalist view" - - "Brainstorm creative feature possibilities" - - "If only we had [resource/capability/time]..." - - "Proceed to next section" + - 'Expand section with more specific details' + - 'Validate against similar successful products' + - 'Stress test assumptions with edge cases' + - 'Explore alternative solution approaches' + - 'Analyze resource/constraint trade-offs' + - 'Generate risk mitigation strategies' + - 'Challenge scope from MVP minimalist view' + - 'Brainstorm creative feature possibilities' + - 'If only we had [resource/capability/time]...' + - 'Proceed to next section' sections: - id: introduction instruction: | This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - + Start by asking the user which mode they prefer: - + 1. **Interactive Mode** - Work through each section collaboratively 2. **YOLO Mode** - Generate complete draft for review and refinement - + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. - id: executive-summary @@ -2648,7 +2648,7 @@ sections: - Primary problem being solved - Target market identification - Key value proposition - template: "{{executive_summary_content}}" + template: '{{executive_summary_content}}' - id: problem-statement title: Problem Statement @@ -2658,7 +2658,7 @@ sections: - Impact of the problem (quantify if possible) - Why existing solutions fall short - Urgency and importance of solving this now - template: "{{detailed_problem_description}}" + template: '{{detailed_problem_description}}' - id: proposed-solution title: Proposed Solution @@ -2668,7 +2668,7 @@ sections: - Key differentiators from existing solutions - Why this solution will succeed where others haven't - High-level vision for the product - template: "{{solution_description}}" + template: '{{solution_description}}' - id: target-users title: Target Users @@ -2680,12 +2680,12 @@ sections: - Goals they're trying to achieve sections: - id: primary-segment - title: "Primary User Segment: {{segment_name}}" - template: "{{primary_user_description}}" + title: 'Primary User Segment: {{segment_name}}' + template: '{{primary_user_description}}' - id: secondary-segment - title: "Secondary User Segment: {{segment_name}}" + title: 'Secondary User Segment: {{segment_name}}' condition: Has secondary user segment - template: "{{secondary_user_description}}" + template: '{{secondary_user_description}}' - id: goals-metrics title: Goals & Success Metrics @@ -2694,15 +2694,15 @@ sections: - id: business-objectives title: Business Objectives type: bullet-list - template: "- {{objective_with_metric}}" + template: '- {{objective_with_metric}}' - id: user-success-metrics title: User Success Metrics type: bullet-list - template: "- {{user_metric}}" + template: '- {{user_metric}}' - id: kpis title: Key Performance Indicators (KPIs) type: bullet-list - template: "- {{kpi}}: {{definition_and_target}}" + template: '- {{kpi}}: {{definition_and_target}}' - id: mvp-scope title: MVP Scope @@ -2711,14 +2711,14 @@ sections: - id: core-features title: Core Features (Must Have) type: bullet-list - template: "- **{{feature}}:** {{description_and_rationale}}" + template: '- **{{feature}}:** {{description_and_rationale}}' - id: out-of-scope title: Out of Scope for MVP type: bullet-list - template: "- {{feature_or_capability}}" + template: '- {{feature_or_capability}}' - id: mvp-success-criteria title: MVP Success Criteria - template: "{{mvp_success_definition}}" + template: '{{mvp_success_definition}}' - id: post-mvp-vision title: Post-MVP Vision @@ -2726,13 +2726,13 @@ sections: sections: - id: phase-2-features title: Phase 2 Features - template: "{{next_priority_features}}" + template: '{{next_priority_features}}' - id: long-term-vision title: Long-term Vision - template: "{{one_two_year_vision}}" + template: '{{one_two_year_vision}}' - id: expansion-opportunities title: Expansion Opportunities - template: "{{potential_expansions}}" + template: '{{potential_expansions}}' - id: technical-considerations title: Technical Considerations @@ -2773,7 +2773,7 @@ sections: - id: key-assumptions title: Key Assumptions type: bullet-list - template: "- {{assumption}}" + template: '- {{assumption}}' - id: risks-questions title: Risks & Open Questions @@ -2782,15 +2782,15 @@ sections: - id: key-risks title: Key Risks type: bullet-list - template: "- **{{risk}}:** {{description_and_impact}}" + template: '- **{{risk}}:** {{description_and_impact}}' - id: open-questions title: Open Questions type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: research-areas title: Areas Needing Further Research type: bullet-list - template: "- {{research_topic}}" + template: '- {{research_topic}}' - id: appendices title: Appendices @@ -2807,10 +2807,10 @@ sections: - id: stakeholder-input title: B. Stakeholder Input condition: Has stakeholder feedback - template: "{{stakeholder_feedback}}" + template: '{{stakeholder_feedback}}' - id: references title: C. References - template: "{{relevant_links_and_docs}}" + template: '{{relevant_links_and_docs}}' - id: next-steps title: Next Steps @@ -2818,7 +2818,7 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action_item}}" + template: '{{action_item}}' - id: pm-handoff title: PM Handoff content: | @@ -2833,24 +2833,24 @@ template: output: format: markdown filename: docs/market-research.md - title: "Market Research Report: {{project_product_name}}" + title: 'Market Research Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Market Research Elicitation Actions" + title: 'Market Research Elicitation Actions' options: - - "Expand market sizing calculations with sensitivity analysis" - - "Deep dive into a specific customer segment" - - "Analyze an emerging market trend in detail" - - "Compare this market to an analogous market" - - "Stress test market assumptions" - - "Explore adjacent market opportunities" - - "Challenge market definition and boundaries" - - "Generate strategic scenarios (best/base/worst case)" - - "If only we had considered [X market factor]..." - - "Proceed to next section" + - 'Expand market sizing calculations with sensitivity analysis' + - 'Deep dive into a specific customer segment' + - 'Analyze an emerging market trend in detail' + - 'Compare this market to an analogous market' + - 'Stress test market assumptions' + - 'Explore adjacent market opportunities' + - 'Challenge market definition and boundaries' + - 'Generate strategic scenarios (best/base/worst case)' + - 'If only we had considered [X market factor]...' + - 'Proceed to next section' sections: - id: executive-summary @@ -2932,7 +2932,7 @@ sections: repeatable: true sections: - id: segment - title: "Segment {{segment_number}}: {{segment_name}}" + title: 'Segment {{segment_number}}: {{segment_name}}' template: | - **Description:** {{brief_overview}} - **Size:** {{number_of_customers_market_value}} @@ -2958,7 +2958,7 @@ sections: instruction: Map the end-to-end customer experience for primary segments template: | For primary customer segment: - + 1. **Awareness:** {{discovery_process}} 2. **Consideration:** {{evaluation_criteria}} 3. **Purchase:** {{decision_triggers}} @@ -3001,20 +3001,20 @@ sections: instruction: Analyze each force with specific evidence and implications sections: - id: supplier-power - title: "Supplier Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Supplier Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: buyer-power - title: "Buyer Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Buyer Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: competitive-rivalry - title: "Competitive Rivalry: {{intensity_level}}" - template: "{{analysis_and_implications}}" + title: 'Competitive Rivalry: {{intensity_level}}' + template: '{{analysis_and_implications}}' - id: threat-new-entry - title: "Threat of New Entry: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of New Entry: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: threat-substitutes - title: "Threat of Substitutes: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of Substitutes: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: adoption-lifecycle title: Technology Adoption Lifecycle Stage instruction: | @@ -3032,7 +3032,7 @@ sections: repeatable: true sections: - id: opportunity - title: "Opportunity {{opportunity_number}}: {{name}}" + title: 'Opportunity {{opportunity_number}}: {{name}}' template: | - **Description:** {{what_is_the_opportunity}} - **Size/Potential:** {{quantified_potential}} @@ -3088,24 +3088,24 @@ template: output: format: markdown filename: docs/competitor-analysis.md - title: "Competitive Analysis Report: {{project_product_name}}" + title: 'Competitive Analysis Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Competitive Analysis Elicitation Actions" + title: 'Competitive Analysis Elicitation Actions' options: - "Deep dive on a specific competitor's strategy" - - "Analyze competitive dynamics in a specific segment" - - "War game competitive responses to your moves" - - "Explore partnership vs. competition scenarios" - - "Stress test differentiation claims" - - "Analyze disruption potential (yours or theirs)" - - "Compare to competition in adjacent markets" - - "Generate win/loss analysis insights" + - 'Analyze competitive dynamics in a specific segment' + - 'War game competitive responses to your moves' + - 'Explore partnership vs. competition scenarios' + - 'Stress test differentiation claims' + - 'Analyze disruption potential (yours or theirs)' + - 'Compare to competition in adjacent markets' + - 'Generate win/loss analysis insights' - "If only we had known about [competitor X's plan]..." - - "Proceed to next section" + - 'Proceed to next section' sections: - id: executive-summary @@ -3159,7 +3159,7 @@ sections: title: Competitor Prioritization Matrix instruction: | Help categorize competitors by market share and strategic threat level - + Create a 2x2 matrix: - Priority 1 (Core Competitors): High Market Share + High Threat - Priority 2 (Emerging Threats): Low Market Share + High Threat @@ -3172,7 +3172,7 @@ sections: repeatable: true sections: - id: competitor - title: "{{competitor_name}} - Priority {{priority_level}}" + title: '{{competitor_name}} - Priority {{priority_level}}' sections: - id: company-overview title: Company Overview @@ -3204,11 +3204,11 @@ sections: - id: strengths title: Strengths type: bullet-list - template: "- {{strength}}" + template: '- {{strength}}' - id: weaknesses title: Weaknesses type: bullet-list - template: "- {{weakness}}" + template: '- {{weakness}}' - id: market-position title: Market Position & Performance template: | @@ -3224,24 +3224,37 @@ sections: title: Feature Comparison Matrix instruction: Create a detailed comparison table of key features across competitors type: table - columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + columns: + [ + 'Feature Category', + '{{your_company}}', + '{{competitor_1}}', + '{{competitor_2}}', + '{{competitor_3}}', + ] rows: - - category: "Core Functionality" + - category: 'Core Functionality' items: - - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - category: "User Experience" + - ['Feature A', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - ['Feature B', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - category: 'User Experience' items: - - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] - - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] - - category: "Integration & Ecosystem" + - ['Mobile App', '{{rating}}', '{{rating}}', '{{rating}}', '{{rating}}'] + - ['Onboarding Time', '{{time}}', '{{time}}', '{{time}}', '{{time}}'] + - category: 'Integration & Ecosystem' items: - - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] - - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] - - category: "Pricing & Plans" + - [ + 'API Availability', + '{{availability}}', + '{{availability}}', + '{{availability}}', + '{{availability}}', + ] + - ['Third-party Integrations', '{{number}}', '{{number}}', '{{number}}', '{{number}}'] + - category: 'Pricing & Plans' items: - - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] - - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - ['Starting Price', '{{price}}', '{{price}}', '{{price}}', '{{price}}'] + - ['Free Tier', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}'] - id: swot-comparison title: SWOT Comparison instruction: Create SWOT analysis for your solution vs. top competitors @@ -3254,7 +3267,7 @@ sections: - **Opportunities:** {{opportunities}} - **Threats:** {{threats}} - id: vs-competitor - title: "vs. {{main_competitor}}" + title: 'vs. {{main_competitor}}' template: | - **Competitive Advantages:** {{your_advantages}} - **Competitive Disadvantages:** {{their_advantages}} @@ -3263,7 +3276,7 @@ sections: title: Positioning Map instruction: | Describe competitor positions on key dimensions - + Create a positioning description using 2 key dimensions relevant to the market, such as: - Price vs. Features - Ease of Use vs. Power @@ -3298,7 +3311,7 @@ sections: title: Blue Ocean Opportunities instruction: | Identify uncontested market spaces - + List opportunities to create new market space: - Underserved segments - Unaddressed use cases @@ -3384,7 +3397,7 @@ template: output: format: markdown filename: docs/brainstorming-session-results.md - title: "Brainstorming Session Results" + title: 'Brainstorming Session Results' workflow: mode: non-interactive @@ -3402,45 +3415,45 @@ sections: - id: summary-details template: | **Topic:** {{session_topic}} - + **Session Goals:** {{stated_goals}} - + **Techniques Used:** {{techniques_list}} - + **Total Ideas Generated:** {{total_ideas}} - id: key-themes - title: "Key Themes Identified:" + title: 'Key Themes Identified:' type: bullet-list - template: "- {{theme}}" + template: '- {{theme}}' - id: technique-sessions title: Technique Sessions repeatable: true sections: - id: technique - title: "{{technique_name}} - {{duration}}" + title: '{{technique_name}} - {{duration}}' sections: - id: description - template: "**Description:** {{technique_description}}" + template: '**Description:** {{technique_description}}' - id: ideas-generated - title: "Ideas Generated:" + title: 'Ideas Generated:' type: numbered-list - template: "{{idea}}" + template: '{{idea}}' - id: insights - title: "Insights Discovered:" + title: 'Insights Discovered:' type: bullet-list - template: "- {{insight}}" + template: '- {{insight}}' - id: connections - title: "Notable Connections:" + title: 'Notable Connections:' type: bullet-list - template: "- {{connection}}" + template: '- {{connection}}' - id: idea-categorization title: Idea Categorization sections: - id: immediate-opportunities title: Immediate Opportunities - content: "*Ideas ready to implement now*" + content: '*Ideas ready to implement now*' repeatable: true type: numbered-list template: | @@ -3450,7 +3463,7 @@ sections: - Resources needed: {{requirements}} - id: future-innovations title: Future Innovations - content: "*Ideas requiring development/research*" + content: '*Ideas requiring development/research*' repeatable: true type: numbered-list template: | @@ -3460,7 +3473,7 @@ sections: - Timeline estimate: {{timeline}} - id: moonshots title: Moonshots - content: "*Ambitious, transformative concepts*" + content: '*Ambitious, transformative concepts*' repeatable: true type: numbered-list template: | @@ -3470,9 +3483,9 @@ sections: - Challenges to overcome: {{challenges}} - id: insights-learnings title: Insights & Learnings - content: "*Key realizations from the session*" + content: '*Key realizations from the session*' type: bullet-list - template: "- {{insight}}: {{description_and_implications}}" + template: '- {{insight}}: {{description_and_implications}}' - id: action-planning title: Action Planning @@ -3481,21 +3494,21 @@ sections: title: Top 3 Priority Ideas sections: - id: priority-1 - title: "#1 Priority: {{idea_name}}" + title: '#1 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-2 - title: "#2 Priority: {{idea_name}}" + title: '#2 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-3 - title: "#3 Priority: {{idea_name}}" + title: '#3 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} @@ -3508,19 +3521,19 @@ sections: - id: what-worked title: What Worked Well type: bullet-list - template: "- {{aspect}}" + template: '- {{aspect}}' - id: areas-exploration title: Areas for Further Exploration type: bullet-list - template: "- {{area}}: {{reason}}" + template: '- {{area}}: {{reason}}' - id: recommended-techniques title: Recommended Follow-up Techniques type: bullet-list - template: "- {{technique}}: {{reason}}" + template: '- {{technique}}: {{reason}}' - id: questions-emerged title: Questions That Emerged type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: next-session title: Next Session Planning template: | @@ -3531,7 +3544,7 @@ sections: - id: footer content: | --- - + *Session facilitated using the BMAD-METHOD brainstorming framework* ==================== END: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== @@ -4245,7 +4258,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Product Requirements Document (PRD)" + title: '{{project_name}} Product Requirements Document (PRD)' workflow: mode: interactive @@ -4282,21 +4295,21 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR examples: - - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." + - 'FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR examples: - - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." + - 'NFR1: AWS service usage must aim to stay within free-tier limits where feasible.' - id: ui-goals title: User Interface Design Goals condition: PRD has UX/UI requirements instruction: | Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - + 1. Pre-fill all subsections with educated guesses based on project context 2. Present the complete rendered section to user 3. Clearly let the user know where assumptions were made @@ -4315,30 +4328,30 @@ sections: title: Core Screens and Views instruction: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories examples: - - "Login Screen" - - "Main Dashboard" - - "Item Detail Page" - - "Settings Page" + - 'Login Screen' + - 'Main Dashboard' + - 'Item Detail Page' + - 'Settings Page' - id: accessibility - title: "Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}" + title: 'Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}' - id: branding title: Branding instruction: Any known branding elements or style guides that must be incorporated? examples: - - "Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions." - - "Attached is the full color pallet and tokens for our corporate branding." + - 'Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions.' + - 'Attached is the full color pallet and tokens for our corporate branding.' - id: target-platforms - title: "Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}" + title: 'Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}' examples: - - "Web Responsive, and all mobile platforms" - - "iPhone Only" - - "ASCII Windows Desktop" + - 'Web Responsive, and all mobile platforms' + - 'iPhone Only' + - 'ASCII Windows Desktop' - id: technical-assumptions title: Technical Assumptions instruction: | Gather technical decisions that will guide the Architect. Steps: - + 1. Check if .bmad-core/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets 3. For unknowns, offer guidance based on project goals and MVP scope @@ -4351,13 +4364,13 @@ sections: testing: [Unit Only, Unit + Integration, Full Testing Pyramid] sections: - id: repository-structure - title: "Repository Structure: {Monorepo|Polyrepo|Multi-repo}" + title: 'Repository Structure: {Monorepo|Polyrepo|Multi-repo}' - id: service-architecture title: Service Architecture - instruction: "CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo)." + instruction: 'CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).' - id: testing-requirements title: Testing Requirements - instruction: "CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods)." + instruction: 'CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).' - id: additional-assumptions title: Additional Technical Assumptions and Requests instruction: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items @@ -4366,9 +4379,9 @@ sections: title: Epic List instruction: | Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - + CRITICAL: Epics MUST be logically sequential following agile best practices: - + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed @@ -4377,21 +4390,21 @@ sections: - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. elicit: true examples: - - "Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management" - - "Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations" - - "Epic 3: User Workflows & Interactions: Enable key user journeys and business processes" - - "Epic 4: Reporting & Analytics: Provide insights and data visualization for users" + - 'Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management' + - 'Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations' + - 'Epic 3: User Workflows & Interactions: Enable key user journeys and business processes' + - 'Epic 4: Reporting & Analytics: Provide insights and data visualization for users' - id: epic-details title: Epic {{epic_number}} {{epic_title}} repeatable: true instruction: | After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. - + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). - + CRITICAL STORY SEQUENCING REQUIREMENTS: - + - Stories within each epic MUST be logically sequential - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation - No story should depend on work from a later story or epic @@ -4402,7 +4415,7 @@ sections: - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained - If a story seems complex, break it down further as long as it can deliver a vertical slice elicit: true - template: "{{epic_goal}}" + template: '{{epic_goal}}' sections: - id: story title: Story {{epic_number}}.{{story_number}} {{story_title}} @@ -4415,11 +4428,11 @@ sections: - id: acceptance-criteria title: Acceptance Criteria type: numbered-list - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' repeatable: true instruction: | Define clear, comprehensive, and testable acceptance criteria that: - + - Precisely define what "done" means from a functional perspective - Are unambiguous and serve as basis for verification - Include any critical non-functional requirements from the PRD @@ -4450,7 +4463,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Brownfield Enhancement PRD" + title: '{{project_name}} Brownfield Enhancement PRD' workflow: mode: interactive @@ -4461,19 +4474,19 @@ sections: title: Intro Project Analysis and Context instruction: | IMPORTANT - SCOPE ASSESSMENT REQUIRED: - + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. - + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - + Do not proceed with any recommendations until the user has validated your understanding of the existing system. sections: - id: existing-project-overview @@ -4499,7 +4512,7 @@ sections: - Note: "Document-project analysis available - using existing technical documentation" - List key documents created by document-project - Skip the missing documentation check below - + Otherwise, check for existing documentation: sections: - id: available-docs @@ -4513,7 +4526,7 @@ sections: - External API Documentation [[LLM: If from document-project, check ✓]] - UX/UI Guidelines [[LLM: May not be in document-project]] - Technical Debt Documentation [[LLM: If from document-project, check ✓]] - - "Other: {{other_docs}}" + - 'Other: {{other_docs}}' instruction: | - If document-project was already run: "Using existing project analysis from document-project output." - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." @@ -4533,7 +4546,7 @@ sections: - UI/UX Overhaul - Technology Stack Upgrade - Bug Fix and Stability Improvements - - "Other: {{other_type}}" + - 'Other: {{other_type}}' - id: enhancement-description title: Enhancement Description instruction: 2-3 sentences describing what the user wants to add or change @@ -4574,29 +4587,29 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown with identifier starting with FR examples: - - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - 'FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system examples: - - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - 'NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.' - id: compatibility title: Compatibility Requirements instruction: Critical for brownfield - what must remain compatible type: numbered-list prefix: CR - template: "{{requirement}}: {{description}}" + template: '{{requirement}}: {{description}}' items: - id: cr1 - template: "CR1: {{existing_api_compatibility}}" + template: 'CR1: {{existing_api_compatibility}}' - id: cr2 - template: "CR2: {{database_schema_compatibility}}" + template: 'CR2: {{database_schema_compatibility}}' - id: cr3 - template: "CR3: {{ui_ux_consistency}}" + template: 'CR3: {{ui_ux_consistency}}' - id: cr4 - template: "CR4: {{integration_compatibility}}" + template: 'CR4: {{integration_compatibility}}' - id: ui-enhancement-goals title: User Interface Enhancement Goals @@ -4623,7 +4636,7 @@ sections: If document-project output available: - Extract from "Actual Tech Stack" table in High Level Architecture section - Include version numbers and any noted constraints - + Otherwise, document the current technology stack: template: | **Languages**: {{languages}} @@ -4662,7 +4675,7 @@ sections: - Reference "Technical Debt and Known Issues" section - Include "Workarounds and Gotchas" that might impact enhancement - Note any identified constraints from "Critical Technical Debt" - + Build risk assessment incorporating existing known issues: template: | **Technical Risks**: {{technical_risks}} @@ -4679,13 +4692,13 @@ sections: - id: epic-approach title: Epic Approach instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features - template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + template: '**Epic Structure Decision**: {{epic_decision}} with rationale' - id: epic-details - title: "Epic 1: {{enhancement_title}}" + title: 'Epic 1: {{enhancement_title}}' instruction: | Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality - + CRITICAL STORY SEQUENCING FOR BROWNFIELD: - Stories must ensure existing functionality remains intact - Each story should include verification that existing features still work @@ -4698,11 +4711,11 @@ sections: - Each story must deliver value while maintaining system integrity template: | **Epic Goal**: {{epic_goal}} - + **Integration Requirements**: {{integration_requirements}} sections: - id: story - title: "Story 1.{{story_number}} {{story_title}}" + title: 'Story 1.{{story_number}} {{story_title}}' repeatable: true template: | As a {{user_type}}, @@ -4713,16 +4726,16 @@ sections: title: Acceptance Criteria type: numbered-list instruction: Define criteria that include both new functionality and existing system integrity - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' - id: integration-verification title: Integration Verification instruction: Specific verification steps to ensure existing functionality remains intact type: numbered-list prefix: IV items: - - template: "IV1: {{existing_functionality_verification}}" - - template: "IV2: {{integration_point_verification}}" - - template: "IV3: {{performance_impact_verification}}" + - template: 'IV1: {{existing_functionality_verification}}' + - template: 'IV2: {{integration_point_verification}}' + - template: 'IV3: {{performance_impact_verification}}' ==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/pm-checklist.md ==================== @@ -5351,7 +5364,7 @@ template: output: format: markdown filename: docs/front-end-spec.md - title: "{{project_name}} UI/UX Specification" + title: '{{project_name}} UI/UX Specification' workflow: mode: interactive @@ -5362,7 +5375,7 @@ sections: title: Introduction instruction: | Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification. - + Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted. content: | This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{project_name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. @@ -5371,7 +5384,7 @@ sections: title: Overall UX Goals & Principles instruction: | Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: - + 1. Target User Personas - elicit details or confirm existing ones from PRD 2. Key Usability Goals - understand what success looks like for users 3. Core Design Principles - establish 3-5 guiding principles @@ -5379,29 +5392,29 @@ sections: sections: - id: user-personas title: Target User Personas - template: "{{persona_descriptions}}" + template: '{{persona_descriptions}}' examples: - - "**Power User:** Technical professionals who need advanced features and efficiency" - - "**Casual User:** Occasional users who prioritize ease of use and clear guidance" - - "**Administrator:** System managers who need control and oversight capabilities" + - '**Power User:** Technical professionals who need advanced features and efficiency' + - '**Casual User:** Occasional users who prioritize ease of use and clear guidance' + - '**Administrator:** System managers who need control and oversight capabilities' - id: usability-goals title: Usability Goals - template: "{{usability_goals}}" + template: '{{usability_goals}}' examples: - - "Ease of learning: New users can complete core tasks within 5 minutes" - - "Efficiency of use: Power users can complete frequent tasks with minimal clicks" - - "Error prevention: Clear validation and confirmation for destructive actions" - - "Memorability: Infrequent users can return without relearning" + - 'Ease of learning: New users can complete core tasks within 5 minutes' + - 'Efficiency of use: Power users can complete frequent tasks with minimal clicks' + - 'Error prevention: Clear validation and confirmation for destructive actions' + - 'Memorability: Infrequent users can return without relearning' - id: design-principles title: Design Principles - template: "{{design_principles}}" + template: '{{design_principles}}' type: numbered-list examples: - - "**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation" + - '**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation' - "**Progressive disclosure** - Show only what's needed, when it's needed" - - "**Consistent patterns** - Use familiar UI patterns throughout the application" - - "**Immediate feedback** - Every action should have a clear, immediate response" - - "**Accessible by default** - Design for all users from the start" + - '**Consistent patterns** - Use familiar UI patterns throughout the application' + - '**Immediate feedback** - Every action should have a clear, immediate response' + - '**Accessible by default** - Design for all users from the start' - id: changelog title: Change Log type: table @@ -5412,7 +5425,7 @@ sections: title: Information Architecture (IA) instruction: | Collaborate with the user to create a comprehensive information architecture: - + 1. Build a Site Map or Screen Inventory showing all major areas 2. Define the Navigation Structure (primary, secondary, breadcrumbs) 3. Use Mermaid diagrams for visual representation @@ -5423,7 +5436,7 @@ sections: title: Site Map / Screen Inventory type: mermaid mermaid_type: graph - template: "{{sitemap_diagram}}" + template: '{{sitemap_diagram}}' examples: - | graph TD @@ -5442,46 +5455,46 @@ sections: title: Navigation Structure template: | **Primary Navigation:** {{primary_nav_description}} - + **Secondary Navigation:** {{secondary_nav_description}} - + **Breadcrumb Strategy:** {{breadcrumb_strategy}} - id: user-flows title: User Flows instruction: | For each critical user task identified in the PRD: - + 1. Define the user's goal clearly 2. Map out all steps including decision points 3. Consider edge cases and error states 4. Use Mermaid flow diagrams for clarity 5. Link to external tools (Figma/Miro) if detailed flows exist there - + Create subsections for each major flow. elicit: true repeatable: true sections: - id: flow - title: "{{flow_name}}" + title: '{{flow_name}}' template: | **User Goal:** {{flow_goal}} - + **Entry Points:** {{entry_points}} - + **Success Criteria:** {{success_criteria}} sections: - id: flow-diagram title: Flow Diagram type: mermaid mermaid_type: graph - template: "{{flow_diagram}}" + template: '{{flow_diagram}}' - id: edge-cases - title: "Edge Cases & Error Handling:" + title: 'Edge Cases & Error Handling:' type: bullet-list - template: "- {{edge_case}}" + template: '- {{edge_case}}' - id: notes - template: "**Notes:** {{flow_notes}}" + template: '**Notes:** {{flow_notes}}' - id: wireframes-mockups title: Wireframes & Mockups @@ -5490,23 +5503,23 @@ sections: elicit: true sections: - id: design-files - template: "**Primary Design Files:** {{design_tool_link}}" + template: '**Primary Design Files:** {{design_tool_link}}' - id: key-screen-layouts title: Key Screen Layouts repeatable: true sections: - id: screen - title: "{{screen_name}}" + title: '{{screen_name}}' template: | **Purpose:** {{screen_purpose}} - + **Key Elements:** - {{element_1}} - {{element_2}} - {{element_3}} - + **Interaction Notes:** {{interaction_notes}} - + **Design File Reference:** {{specific_frame_link}} - id: component-library @@ -5516,20 +5529,20 @@ sections: elicit: true sections: - id: design-system-approach - template: "**Design System Approach:** {{design_system_approach}}" + template: '**Design System Approach:** {{design_system_approach}}' - id: core-components title: Core Components repeatable: true sections: - id: component - title: "{{component_name}}" + title: '{{component_name}}' template: | **Purpose:** {{component_purpose}} - + **Variants:** {{component_variants}} - + **States:** {{component_states}} - + **Usage Guidelines:** {{usage_guidelines}} - id: branding-style @@ -5539,19 +5552,19 @@ sections: sections: - id: visual-identity title: Visual Identity - template: "**Brand Guidelines:** {{brand_guidelines_link}}" + template: '**Brand Guidelines:** {{brand_guidelines_link}}' - id: color-palette title: Color Palette type: table - columns: ["Color Type", "Hex Code", "Usage"] + columns: ['Color Type', 'Hex Code', 'Usage'] rows: - - ["Primary", "{{primary_color}}", "{{primary_usage}}"] - - ["Secondary", "{{secondary_color}}", "{{secondary_usage}}"] - - ["Accent", "{{accent_color}}", "{{accent_usage}}"] - - ["Success", "{{success_color}}", "Positive feedback, confirmations"] - - ["Warning", "{{warning_color}}", "Cautions, important notices"] - - ["Error", "{{error_color}}", "Errors, destructive actions"] - - ["Neutral", "{{neutral_colors}}", "Text, borders, backgrounds"] + - ['Primary', '{{primary_color}}', '{{primary_usage}}'] + - ['Secondary', '{{secondary_color}}', '{{secondary_usage}}'] + - ['Accent', '{{accent_color}}', '{{accent_usage}}'] + - ['Success', '{{success_color}}', 'Positive feedback, confirmations'] + - ['Warning', '{{warning_color}}', 'Cautions, important notices'] + - ['Error', '{{error_color}}', 'Errors, destructive actions'] + - ['Neutral', '{{neutral_colors}}', 'Text, borders, backgrounds'] - id: typography title: Typography sections: @@ -5564,24 +5577,24 @@ sections: - id: type-scale title: Type Scale type: table - columns: ["Element", "Size", "Weight", "Line Height"] + columns: ['Element', 'Size', 'Weight', 'Line Height'] rows: - - ["H1", "{{h1_size}}", "{{h1_weight}}", "{{h1_line}}"] - - ["H2", "{{h2_size}}", "{{h2_weight}}", "{{h2_line}}"] - - ["H3", "{{h3_size}}", "{{h3_weight}}", "{{h3_line}}"] - - ["Body", "{{body_size}}", "{{body_weight}}", "{{body_line}}"] - - ["Small", "{{small_size}}", "{{small_weight}}", "{{small_line}}"] + - ['H1', '{{h1_size}}', '{{h1_weight}}', '{{h1_line}}'] + - ['H2', '{{h2_size}}', '{{h2_weight}}', '{{h2_line}}'] + - ['H3', '{{h3_size}}', '{{h3_weight}}', '{{h3_line}}'] + - ['Body', '{{body_size}}', '{{body_weight}}', '{{body_line}}'] + - ['Small', '{{small_size}}', '{{small_weight}}', '{{small_line}}'] - id: iconography title: Iconography template: | **Icon Library:** {{icon_library}} - + **Usage Guidelines:** {{icon_guidelines}} - id: spacing-layout title: Spacing & Layout template: | **Grid System:** {{grid_system}} - + **Spacing Scale:** {{spacing_scale}} - id: accessibility @@ -5591,7 +5604,7 @@ sections: sections: - id: compliance-target title: Compliance Target - template: "**Standard:** {{compliance_standard}}" + template: '**Standard:** {{compliance_standard}}' - id: key-requirements title: Key Requirements template: | @@ -5599,19 +5612,19 @@ sections: - Color contrast ratios: {{contrast_requirements}} - Focus indicators: {{focus_requirements}} - Text sizing: {{text_requirements}} - + **Interaction:** - Keyboard navigation: {{keyboard_requirements}} - Screen reader support: {{screen_reader_requirements}} - Touch targets: {{touch_requirements}} - + **Content:** - Alternative text: {{alt_text_requirements}} - Heading structure: {{heading_requirements}} - Form labels: {{form_requirements}} - id: testing-strategy title: Testing Strategy - template: "{{accessibility_testing}}" + template: '{{accessibility_testing}}' - id: responsiveness title: Responsiveness Strategy @@ -5621,21 +5634,21 @@ sections: - id: breakpoints title: Breakpoints type: table - columns: ["Breakpoint", "Min Width", "Max Width", "Target Devices"] + columns: ['Breakpoint', 'Min Width', 'Max Width', 'Target Devices'] rows: - - ["Mobile", "{{mobile_min}}", "{{mobile_max}}", "{{mobile_devices}}"] - - ["Tablet", "{{tablet_min}}", "{{tablet_max}}", "{{tablet_devices}}"] - - ["Desktop", "{{desktop_min}}", "{{desktop_max}}", "{{desktop_devices}}"] - - ["Wide", "{{wide_min}}", "-", "{{wide_devices}}"] + - ['Mobile', '{{mobile_min}}', '{{mobile_max}}', '{{mobile_devices}}'] + - ['Tablet', '{{tablet_min}}', '{{tablet_max}}', '{{tablet_devices}}'] + - ['Desktop', '{{desktop_min}}', '{{desktop_max}}', '{{desktop_devices}}'] + - ['Wide', '{{wide_min}}', '-', '{{wide_devices}}'] - id: adaptation-patterns title: Adaptation Patterns template: | **Layout Changes:** {{layout_adaptations}} - + **Navigation Changes:** {{nav_adaptations}} - + **Content Priority:** {{content_adaptations}} - + **Interaction Changes:** {{interaction_adaptations}} - id: animation @@ -5645,11 +5658,11 @@ sections: sections: - id: motion-principles title: Motion Principles - template: "{{motion_principles}}" + template: '{{motion_principles}}' - id: key-animations title: Key Animations repeatable: true - template: "- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})" + template: '- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})' - id: performance title: Performance Considerations @@ -5663,13 +5676,13 @@ sections: - **Animation FPS:** {{animation_goal}} - id: design-strategies title: Design Strategies - template: "{{performance_strategies}}" + template: '{{performance_strategies}}' - id: next-steps title: Next Steps instruction: | After completing the UI/UX specification: - + 1. Recommend review with stakeholders 2. Suggest creating/updating visual designs in design tool 3. Prepare for handoff to Design Architect for frontend architecture @@ -5678,17 +5691,17 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action}}" + template: '{{action}}' - id: design-handoff-checklist title: Design Handoff Checklist type: checklist items: - - "All user flows documented" - - "Component inventory complete" - - "Accessibility requirements defined" - - "Responsive strategy clear" - - "Brand guidelines incorporated" - - "Performance goals established" + - 'All user flows documented' + - 'Component inventory complete' + - 'Accessibility requirements defined' + - 'Responsive strategy clear' + - 'Brand guidelines incorporated' + - 'Performance goals established' - id: checklist-results title: Checklist Results @@ -5703,7 +5716,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Architecture Document" + title: '{{project_name}} Architecture Document' workflow: mode: interactive @@ -5718,20 +5731,20 @@ sections: - id: intro-content content: | This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - + **Relationship to Frontend Architecture:** If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - + 1. Review the PRD and brainstorming brief for any mentions of: - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) - Existing projects or codebases being used as a foundation - Boilerplate projects or scaffolding tools - Previous projects to be cloned or adapted - + 2. If a starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -5744,16 +5757,16 @@ sections: - Existing architectural patterns and conventions - Any limitations or constraints imposed by the starter - Use this analysis to inform and align your architecture decisions - + 3. If no starter template is mentioned but this is a greenfield project: - Suggest appropriate starter templates based on the tech stack preferences - Explain the benefits (faster setup, best practices, community support) - Let the user decide whether to use one - + 4. If the user confirms no starter template will be used: - Proceed with architecture design from scratch - Note that manual setup will be required for all tooling and configuration - + Document the decision here before proceeding with the architecture design. If none, just say N/A elicit: true - id: changelog @@ -5781,7 +5794,7 @@ sections: title: High Level Overview instruction: | Based on the PRD's Technical Assumptions section, describe: - + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) 2. Repository structure decision from PRD (Monorepo/Polyrepo) 3. Service architecture decision from PRD @@ -5798,49 +5811,49 @@ sections: - Data flow directions - External integrations - User entry points - + - id: architectural-patterns title: Architectural and Design Patterns instruction: | List the key high-level patterns that will guide the architecture. For each pattern: - + 1. Present 2-3 viable options if multiple exist 2. Provide your recommendation with clear rationale 3. Get user confirmation before finalizing 4. These patterns should align with the PRD's technical assumptions and project goals - + Common patterns to consider: - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) - Code organization patterns (Dependency Injection, Repository, Module, Factory) - Data patterns (Event Sourcing, Saga, Database per Service) - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + - '**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences 2. For each category, present 2-3 viable options with pros/cons 3. Make a clear recommendation based on project needs 4. Get explicit user approval for each selection 5. Document exact versions (avoid "latest" - pin specific versions) 6. This table is the single source of truth - all other docs must reference these choices - + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - + - Starter templates (if any) - Languages and runtimes with exact versions - Frameworks and libraries / packages - Cloud provider and key services choices - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion - Development tools - + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. elicit: true sections: @@ -5856,34 +5869,34 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Populate the technology stack table with all relevant technologies examples: - - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" - - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" - - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + - '| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |' + - '| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |' + - '| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |' - id: data-models title: Data Models instruction: | Define the core data models/entities: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - {{relationship_1}} - {{relationship_2}} @@ -5892,7 +5905,7 @@ sections: title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services and their responsibilities 2. Consider the repository structure (monorepo/polyrepo) from PRD 3. Define clear boundaries and interfaces between components @@ -5901,22 +5914,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -5933,29 +5946,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -5964,13 +5977,13 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include error handling paths 4. Document async operations 5. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -5981,13 +5994,13 @@ sections: language: yaml instruction: | If the project includes a REST API: - + 1. Create an OpenAPI 3.0 specification 2. Include all endpoints from epics/stories 3. Define request/response schemas based on data models 4. Document authentication requirements 5. Include example requests/responses - + Use YAML format for better readability. If no REST API, skip this section. elicit: true template: | @@ -6004,13 +6017,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -6020,14 +6033,14 @@ sections: language: plaintext instruction: | Create a project folder structure that reflects: - + 1. The chosen repository structure (monorepo/polyrepo) 2. The service architecture (monolith/microservices/serverless) 3. The selected tech stack and languages 4. Component organization from above 5. Best practices for the chosen frameworks 6. Clear separation of concerns - + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. elicit: true examples: @@ -6045,13 +6058,13 @@ sections: title: Infrastructure and Deployment instruction: | Define the deployment architecture and practices: - + 1. Use IaC tool selected in Tech Stack 2. Choose deployment strategy appropriate for the architecture 3. Define environments and promotion flow 4. Establish rollback procedures 5. Consider security, monitoring, and cost optimization - + Get user input on deployment preferences and CI/CD tool choices. elicit: true sections: @@ -6070,12 +6083,12 @@ sections: - id: environments title: Environments repeatable: true - template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + template: '- **{{env_name}}:** {{env_purpose}} - {{env_details}}' - id: promotion-flow title: Environment Promotion Flow type: code language: text - template: "{{promotion_flow_diagram}}" + template: '{{promotion_flow_diagram}}' - id: rollback-strategy title: Rollback Strategy template: | @@ -6087,13 +6100,13 @@ sections: title: Error Handling Strategy instruction: | Define comprehensive error handling approach: - + 1. Choose appropriate patterns for the language/framework from Tech Stack 2. Define logging standards and tools 3. Establish error categories and handling rules 4. Consider observability and debugging needs 5. Ensure security (no sensitive data in logs) - + This section guides both AI and human developers in consistent error handling. elicit: true sections: @@ -6140,13 +6153,13 @@ sections: title: Coding Standards instruction: | These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - + 1. This section directly controls AI developer behavior 2. Keep it minimal - assume AI knows general best practices 3. Focus on project-specific conventions and gotchas 4. Overly detailed standards bloat context and slow development 5. Standards will be extracted to separate file for dev agent use - + For each standard, get explicit user confirmation it's necessary. elicit: true sections: @@ -6168,32 +6181,32 @@ sections: - "Never use console.log in production code - use logger" - "All API responses must use ApiResponse wrapper type" - "Database queries must use repository pattern, never direct ORM" - + Avoid obvious rules like "use SOLID principles" or "write clean code" repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' - id: language-specifics title: Language-Specific Guidelines condition: Critical language-specific rules needed instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. sections: - id: language-rules - title: "{{language_name}} Specifics" + title: '{{language_name}} Specifics' repeatable: true - template: "- **{{rule_topic}}:** {{rule_detail}}" + template: '- **{{rule_topic}}:** {{rule_detail}}' - id: test-strategy title: Test Strategy and Standards instruction: | Work with user to define comprehensive test strategy: - + 1. Use test frameworks from Tech Stack 2. Decide on TDD vs test-after approach 3. Define test organization and naming 4. Establish coverage goals 5. Determine integration test infrastructure 6. Plan for test data and external dependencies - + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. elicit: true sections: @@ -6214,7 +6227,7 @@ sections: - **Location:** {{unit_test_location}} - **Mocking Library:** {{mocking_library}} - **Coverage Requirement:** {{unit_coverage}} - + **AI Agent Requirements:** - Generate tests for all public methods - Cover edge cases and error conditions @@ -6228,9 +6241,9 @@ sections: - **Test Infrastructure:** - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) examples: - - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" - - "**Message Queue:** Embedded Kafka for tests" - - "**External APIs:** WireMock for stubbing" + - '**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration' + - '**Message Queue:** Embedded Kafka for tests' + - '**External APIs:** WireMock for stubbing' - id: e2e-tests title: End-to-End Tests template: | @@ -6256,7 +6269,7 @@ sections: title: Security instruction: | Define MANDATORY security requirements for AI and human developers: - + 1. Focus on implementation-specific rules 2. Reference security tools from Tech Stack 3. Define clear patterns for common scenarios @@ -6325,16 +6338,16 @@ sections: title: Next Steps instruction: | After completing the architecture: - + 1. If project has UI components: - Use "Frontend Architecture Mode" - Provide this document as input - + 2. For all projects: - Review with Product Owner - Begin story implementation with Dev agent - Set up infrastructure with DevOps agent - + 3. Include specific prompts for next agents if needed sections: - id: architect-prompt @@ -6356,7 +6369,7 @@ template: output: format: markdown filename: docs/ui-architecture.md - title: "{{project_name}} Frontend Architecture Document" + title: '{{project_name}} Frontend Architecture Document' workflow: mode: interactive @@ -6367,16 +6380,16 @@ sections: title: Template and Framework Selection instruction: | Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. - + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - UI kit or component library starters - Existing frontend projects being used as a foundation - Admin dashboard templates or other specialized starters - Design system implementations - + 2. If a frontend starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -6392,7 +6405,7 @@ sections: - Testing setup and patterns - Build and development scripts - Use this analysis to ensure your frontend architecture aligns with the starter's patterns - + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - Based on the framework choice, suggest appropriate starters: - React: Create React App, Next.js, Vite + React @@ -6400,11 +6413,11 @@ sections: - Angular: Angular CLI - Or suggest popular UI templates if applicable - Explain benefits specific to frontend development - + 4. If the user confirms no starter template will be used: - Note that all tooling, bundling, and configuration will need manual setup - Proceed with frontend architecture from scratch - + Document the starter template decision and any constraints it imposes before proceeding. sections: - id: changelog @@ -6424,17 +6437,29 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Fill in appropriate technology choices based on the selected framework and project requirements. rows: - - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Framework', '{{framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['UI Library', '{{ui_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'State Management', + '{{state_management}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Routing', '{{routing_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Styling', '{{styling_solution}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Testing', '{{test_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Component Library', + '{{component_lib}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Form Handling', '{{form_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Animation', '{{animation_lib}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Dev Tools', '{{dev_tools}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: project-structure title: Project Structure @@ -6528,12 +6553,12 @@ sections: title: Testing Best Practices type: numbered-list items: - - "**Unit Tests**: Test individual components in isolation" - - "**Integration Tests**: Test component interactions" - - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" - - "**Coverage Goals**: Aim for 80% code coverage" - - "**Test Structure**: Arrange-Act-Assert pattern" - - "**Mock External Dependencies**: API calls, routing, state management" + - '**Unit Tests**: Test individual components in isolation' + - '**Integration Tests**: Test component interactions' + - '**E2E Tests**: Test critical user flows (using Cypress/Playwright)' + - '**Coverage Goals**: Aim for 80% code coverage' + - '**Test Structure**: Arrange-Act-Assert pattern' + - '**Mock External Dependencies**: API calls, routing, state management' - id: environment-configuration title: Environment Configuration @@ -6565,7 +6590,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Fullstack Architecture Document" + title: '{{project_name}} Fullstack Architecture Document' workflow: mode: interactive @@ -6579,33 +6604,33 @@ sections: elicit: true content: | This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. sections: - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - + 1. Review the PRD and other documents for mentions of: - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) - Monorepo templates (e.g., Nx, Turborepo starters) - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) - Existing projects being extended or cloned - + 2. If starter templates or existing projects are mentioned: - Ask the user to provide access (links, repos, or files) - Analyze to understand pre-configured choices and constraints - Note any architectural decisions already made - Identify what can be modified vs what must be retained - + 3. If no starter is mentioned but this is greenfield: - Suggest appropriate fullstack starters based on tech preferences - Consider platform-specific options (Vercel, AWS, etc.) - Let user decide whether to use one - + 4. Document the decision and any constraints it imposes - + If none, state "N/A - Greenfield project" - id: changelog title: Change Log @@ -6631,17 +6656,17 @@ sections: title: Platform and Infrastructure Choice instruction: | Based on PRD requirements and technical assumptions, make a platform recommendation: - + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - **Azure**: For .NET ecosystems or enterprise Microsoft environments - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - + 2. Present 2-3 viable options with clear pros/cons 3. Make a recommendation with rationale 4. Get explicit user confirmation - + Document the choice and key services that will be used. template: | **Platform:** {{selected_platform}} @@ -6651,7 +6676,7 @@ sections: title: Repository Structure instruction: | Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: - + 1. For modern fullstack apps, monorepo is often preferred 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) 3. Define package/app boundaries @@ -6673,7 +6698,7 @@ sections: - Databases and storage - External integrations - CDN and caching layers - + Use appropriate diagram type for clarity. - id: architectural-patterns title: Architectural Patterns @@ -6683,21 +6708,21 @@ sections: - Frontend patterns (e.g., Component-based, State management) - Backend patterns (e.g., Repository, CQRS, Event-driven) - Integration patterns (e.g., BFF, API Gateway) - + For each pattern, provide recommendation and rationale. repeatable: true - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" - - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + - '**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications' + - '**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - + Key areas to cover: - Frontend and backend languages/frameworks - Databases and caching @@ -6706,7 +6731,7 @@ sections: - Testing tools for both frontend and backend - Build and deployment tools - Monitoring and logging - + Upon render, elicit feedback immediately. elicit: true sections: @@ -6715,49 +6740,67 @@ sections: type: table columns: [Category, Technology, Version, Purpose, Rationale] rows: - - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Frontend Language', '{{fe_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Frontend Framework', + '{{fe_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - [ + 'UI Component Library', + '{{ui_library}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['State Management', '{{state_mgmt}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Language', '{{be_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Backend Framework', + '{{be_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['API Style', '{{api_style}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Database', '{{database}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Cache', '{{cache}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['File Storage', '{{storage}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Authentication', '{{auth}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Frontend Testing', '{{fe_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Testing', '{{be_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['E2E Testing', '{{e2e_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Bundler', '{{bundler}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['IaC Tool', '{{iac_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CI/CD', '{{cicd}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Monitoring', '{{monitoring}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Logging', '{{logging}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CSS Framework', '{{css_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: data-models title: Data Models instruction: | Define the core data models/entities that will be shared between frontend and backend: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Create TypeScript interfaces that can be shared 6. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} @@ -6766,17 +6809,17 @@ sections: title: TypeScript Interface type: code language: typescript - template: "{{model_interface}}" + template: '{{model_interface}}' - id: relationships title: Relationships type: bullet-list - template: "- {{relationship}}" + template: '- {{relationship}}' - id: api-spec title: API Specification instruction: | Based on the chosen API style from Tech Stack: - + 1. If REST API, create an OpenAPI 3.0 specification 2. If GraphQL, provide the GraphQL schema 3. If tRPC, show router definitions @@ -6784,7 +6827,7 @@ sections: 5. Define request/response schemas based on data models 6. Document authentication requirements 7. Include example requests/responses - + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. elicit: true sections: @@ -6807,19 +6850,19 @@ sections: condition: API style is GraphQL type: code language: graphql - template: "{{graphql_schema}}" + template: '{{graphql_schema}}' - id: trpc-api title: tRPC Router Definitions condition: API style is tRPC type: code language: typescript - template: "{{trpc_routers}}" + template: '{{trpc_routers}}' - id: components title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services across the fullstack 2. Consider both frontend and backend components 3. Define clear boundaries and interfaces between components @@ -6828,22 +6871,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -6860,29 +6903,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -6891,14 +6934,14 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include both frontend and backend flows 4. Include error handling paths 5. Document async operations 6. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -6906,13 +6949,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -6929,12 +6972,12 @@ sections: title: Component Organization type: code language: text - template: "{{component_structure}}" + template: '{{component_structure}}' - id: component-template title: Component Template type: code language: typescript - template: "{{component_template}}" + template: '{{component_template}}' - id: state-management title: State Management Architecture instruction: Detail state management approach based on chosen solution. @@ -6943,11 +6986,11 @@ sections: title: State Structure type: code language: typescript - template: "{{state_structure}}" + template: '{{state_structure}}' - id: state-patterns title: State Management Patterns type: bullet-list - template: "- {{pattern}}" + template: '- {{pattern}}' - id: routing-architecture title: Routing Architecture instruction: Define routing structure based on framework choice. @@ -6956,12 +6999,12 @@ sections: title: Route Organization type: code language: text - template: "{{route_structure}}" + template: '{{route_structure}}' - id: protected-routes title: Protected Route Pattern type: code language: typescript - template: "{{protected_route_example}}" + template: '{{protected_route_example}}' - id: frontend-services title: Frontend Services Layer instruction: Define how frontend communicates with backend. @@ -6970,12 +7013,12 @@ sections: title: API Client Setup type: code language: typescript - template: "{{api_client_setup}}" + template: '{{api_client_setup}}' - id: service-example title: Service Example type: code language: typescript - template: "{{service_example}}" + template: '{{service_example}}' - id: backend-architecture title: Backend Architecture @@ -6993,12 +7036,12 @@ sections: title: Function Organization type: code language: text - template: "{{function_structure}}" + template: '{{function_structure}}' - id: function-template title: Function Template type: code language: typescript - template: "{{function_template}}" + template: '{{function_template}}' - id: traditional-server condition: Traditional server architecture chosen sections: @@ -7006,12 +7049,12 @@ sections: title: Controller/Route Organization type: code language: text - template: "{{controller_structure}}" + template: '{{controller_structure}}' - id: controller-template title: Controller Template type: code language: typescript - template: "{{controller_template}}" + template: '{{controller_template}}' - id: database-architecture title: Database Architecture instruction: Define database schema and access patterns. @@ -7020,12 +7063,12 @@ sections: title: Schema Design type: code language: sql - template: "{{database_schema}}" + template: '{{database_schema}}' - id: data-access-layer title: Data Access Layer type: code language: typescript - template: "{{repository_pattern}}" + template: '{{repository_pattern}}' - id: auth-architecture title: Authentication and Authorization instruction: Define auth implementation details. @@ -7034,12 +7077,12 @@ sections: title: Auth Flow type: mermaid mermaid_type: sequence - template: "{{auth_flow_diagram}}" + template: '{{auth_flow_diagram}}' - id: auth-middleware title: Middleware/Guards type: code language: typescript - template: "{{auth_middleware}}" + template: '{{auth_middleware}}' - id: unified-project-structure title: Unified Project Structure @@ -7048,60 +7091,60 @@ sections: type: code language: plaintext examples: - - | - {{project-name}}/ - ├── .github/ # CI/CD workflows - │ └── workflows/ - │ ├── ci.yaml - │ └── deploy.yaml - ├── apps/ # Application packages - │ ├── web/ # Frontend application - │ │ ├── src/ - │ │ │ ├── components/ # UI components - │ │ │ ├── pages/ # Page components/routes - │ │ │ ├── hooks/ # Custom React hooks - │ │ │ ├── services/ # API client services - │ │ │ ├── stores/ # State management - │ │ │ ├── styles/ # Global styles/themes - │ │ │ └── utils/ # Frontend utilities - │ │ ├── public/ # Static assets - │ │ ├── tests/ # Frontend tests - │ │ └── package.json - │ └── api/ # Backend application - │ ├── src/ - │ │ ├── routes/ # API routes/controllers - │ │ ├── services/ # Business logic - │ │ ├── models/ # Data models - │ │ ├── middleware/ # Express/API middleware - │ │ ├── utils/ # Backend utilities - │ │ └── {{serverless_or_server_entry}} - │ ├── tests/ # Backend tests - │ └── package.json - ├── packages/ # Shared packages - │ ├── shared/ # Shared types/utilities - │ │ ├── src/ - │ │ │ ├── types/ # TypeScript interfaces - │ │ │ ├── constants/ # Shared constants - │ │ │ └── utils/ # Shared utilities - │ │ └── package.json - │ ├── ui/ # Shared UI components - │ │ ├── src/ - │ │ └── package.json - │ └── config/ # Shared configuration - │ ├── eslint/ - │ ├── typescript/ - │ └── jest/ - ├── infrastructure/ # IaC definitions - │ └── {{iac_structure}} - ├── scripts/ # Build/deploy scripts - ├── docs/ # Documentation - │ ├── prd.md - │ ├── front-end-spec.md - │ └── fullstack-architecture.md - ├── .env.example # Environment template - ├── package.json # Root package.json - ├── {{monorepo_config}} # Monorepo configuration - └── README.md + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md - id: development-workflow title: Development Workflow @@ -7115,12 +7158,12 @@ sections: title: Prerequisites type: code language: bash - template: "{{prerequisites_commands}}" + template: '{{prerequisites_commands}}' - id: initial-setup title: Initial Setup type: code language: bash - template: "{{setup_commands}}" + template: '{{setup_commands}}' - id: dev-commands title: Development Commands type: code @@ -7128,13 +7171,13 @@ sections: template: | # Start all services {{start_all_command}} - + # Start frontend only {{start_frontend_command}} - + # Start backend only {{start_backend_command}} - + # Run tests {{test_commands}} - id: environment-config @@ -7147,10 +7190,10 @@ sections: template: | # Frontend (.env.local) {{frontend_env_vars}} - + # Backend (.env) {{backend_env_vars}} - + # Shared {{shared_env_vars}} @@ -7167,7 +7210,7 @@ sections: - **Build Command:** {{frontend_build_command}} - **Output Directory:** {{frontend_output_dir}} - **CDN/Edge:** {{cdn_strategy}} - + **Backend Deployment:** - **Platform:** {{backend_deploy_platform}} - **Build Command:** {{backend_build_command}} @@ -7176,15 +7219,15 @@ sections: title: CI/CD Pipeline type: code language: yaml - template: "{{cicd_pipeline_config}}" + template: '{{cicd_pipeline_config}}' - id: environments title: Environments type: table columns: [Environment, Frontend URL, Backend URL, Purpose] rows: - - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] - - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] - - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + - ['Development', '{{dev_fe_url}}', '{{dev_be_url}}', 'Local development'] + - ['Staging', '{{staging_fe_url}}', '{{staging_be_url}}', 'Pre-production testing'] + - ['Production', '{{prod_fe_url}}', '{{prod_be_url}}', 'Live environment'] - id: security-performance title: Security and Performance @@ -7198,12 +7241,12 @@ sections: - CSP Headers: {{csp_policy}} - XSS Prevention: {{xss_strategy}} - Secure Storage: {{storage_strategy}} - + **Backend Security:** - Input Validation: {{validation_approach}} - Rate Limiting: {{rate_limit_config}} - CORS Policy: {{cors_config}} - + **Authentication Security:** - Token Storage: {{token_strategy}} - Session Management: {{session_approach}} @@ -7215,7 +7258,7 @@ sections: - Bundle Size Target: {{bundle_size}} - Loading Strategy: {{loading_approach}} - Caching Strategy: {{fe_cache_strategy}} - + **Backend Performance:** - Response Time Target: {{response_target}} - Database Optimization: {{db_optimization}} @@ -7231,10 +7274,10 @@ sections: type: code language: text template: | - E2E Tests - / \ - Integration Tests - / \ + E2E Tests + / \ + Integration Tests + / \ Frontend Unit Backend Unit - id: test-organization title: Test Organization @@ -7243,17 +7286,17 @@ sections: title: Frontend Tests type: code language: text - template: "{{frontend_test_structure}}" + template: '{{frontend_test_structure}}' - id: backend-tests title: Backend Tests type: code language: text - template: "{{backend_test_structure}}" + template: '{{backend_test_structure}}' - id: e2e-tests title: E2E Tests type: code language: text - template: "{{e2e_test_structure}}" + template: '{{e2e_test_structure}}' - id: test-examples title: Test Examples sections: @@ -7261,17 +7304,17 @@ sections: title: Frontend Component Test type: code language: typescript - template: "{{frontend_test_example}}" + template: '{{frontend_test_example}}' - id: backend-test title: Backend API Test type: code language: typescript - template: "{{backend_test_example}}" + template: '{{backend_test_example}}' - id: e2e-test title: E2E Test type: code language: typescript - template: "{{e2e_test_example}}" + template: '{{e2e_test_example}}' - id: coding-standards title: Coding Standards @@ -7281,22 +7324,22 @@ sections: - id: critical-rules title: Critical Fullstack Rules repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' examples: - - "**Type Sharing:** Always define types in packages/shared and import from there" - - "**API Calls:** Never make direct HTTP calls - use the service layer" - - "**Environment Variables:** Access only through config objects, never process.env directly" - - "**Error Handling:** All API routes must use the standard error handler" - - "**State Updates:** Never mutate state directly - use proper state management patterns" + - '**Type Sharing:** Always define types in packages/shared and import from there' + - '**API Calls:** Never make direct HTTP calls - use the service layer' + - '**Environment Variables:** Access only through config objects, never process.env directly' + - '**Error Handling:** All API routes must use the standard error handler' + - '**State Updates:** Never mutate state directly - use proper state management patterns' - id: naming-conventions title: Naming Conventions type: table columns: [Element, Frontend, Backend, Example] rows: - - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] - - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] - - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] - - ["Database Tables", "-", "snake_case", "`user_profiles`"] + - ['Components', 'PascalCase', '-', '`UserProfile.tsx`'] + - ['Hooks', "camelCase with 'use'", '-', '`useAuth.ts`'] + - ['API Routes', '-', 'kebab-case', '`/api/user-profile`'] + - ['Database Tables', '-', 'snake_case', '`user_profiles`'] - id: error-handling title: Error Handling Strategy @@ -7307,7 +7350,7 @@ sections: title: Error Flow type: mermaid mermaid_type: sequence - template: "{{error_flow_diagram}}" + template: '{{error_flow_diagram}}' - id: error-format title: Error Response Format type: code @@ -7326,12 +7369,12 @@ sections: title: Frontend Error Handling type: code language: typescript - template: "{{frontend_error_handler}}" + template: '{{frontend_error_handler}}' - id: backend-error-handling title: Backend Error Handling type: code language: typescript - template: "{{backend_error_handler}}" + template: '{{backend_error_handler}}' - id: monitoring title: Monitoring and Observability @@ -7353,7 +7396,7 @@ sections: - JavaScript errors - API response times - User interactions - + **Backend Metrics:** - Request rate - Error rate @@ -7373,7 +7416,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Brownfield Enhancement Architecture" + title: '{{project_name}} Brownfield Enhancement Architecture' workflow: mode: interactive @@ -7384,40 +7427,40 @@ sections: title: Introduction instruction: | IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - + 2. **REQUIRED INPUTS**: - Completed brownfield-prd.md - Existing project technical documentation (from docs folder or user-provided) - Access to existing project structure (IDE or uploaded files) - + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - + If any required inputs are missing, request them before proceeding. elicit: true sections: - id: intro-content content: | This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - + **Relationship to Existing Architecture:** This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - id: existing-project-analysis title: Existing Project Analysis instruction: | Analyze the existing project structure and architecture: - + 1. Review existing documentation in docs folder 2. Examine current technology stack and versions 3. Identify existing architectural patterns and conventions 4. Note current deployment and infrastructure setup 5. Document any constraints or limitations - + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." elicit: true sections: @@ -7431,11 +7474,11 @@ sections: - id: available-docs title: Available Documentation type: bullet-list - template: "- {{existing_docs_summary}}" + template: '- {{existing_docs_summary}}' - id: constraints title: Identified Constraints type: bullet-list - template: "- {{constraint}}" + template: '- {{constraint}}' - id: changelog title: Change Log type: table @@ -7446,12 +7489,12 @@ sections: title: Enhancement Scope and Integration Strategy instruction: | Define how the enhancement will integrate with the existing system: - + 1. Review the brownfield PRD enhancement scope 2. Identify integration points with existing code 3. Define boundaries between new and existing functionality 4. Establish compatibility requirements - + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" elicit: true sections: @@ -7480,7 +7523,7 @@ sections: title: Tech Stack Alignment instruction: | Ensure new components align with existing technology choices: - + 1. Use existing technology stack as the foundation 2. Only introduce new technologies if absolutely necessary 3. Justify any new additions with clear rationale @@ -7503,7 +7546,7 @@ sections: title: Data Models and Schema Changes instruction: | Define new data models and how they integrate with existing schema: - + 1. Identify new entities required for the enhancement 2. Define relationships with existing data models 3. Plan database schema changes (additions, modifications) @@ -7515,15 +7558,15 @@ sections: repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} **Integration:** {{integration_with_existing}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - **With Existing:** {{existing_relationships}} - **With New:** {{new_relationships}} @@ -7535,7 +7578,7 @@ sections: - **Modified Tables:** {{modified_tables_list}} - **New Indexes:** {{new_indexes_list}} - **Migration Strategy:** {{migration_approach}} - + **Backward Compatibility:** - {{compatibility_measure_1}} - {{compatibility_measure_2}} @@ -7544,12 +7587,12 @@ sections: title: Component Architecture instruction: | Define new components and their integration with existing architecture: - + 1. Identify new components required for the enhancement 2. Define interfaces with existing components 3. Establish clear boundaries and responsibilities 4. Plan integration points and data flow - + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" elicit: true sections: @@ -7558,19 +7601,19 @@ sections: repeatable: true sections: - id: component - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} **Integration Points:** {{integration_points}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** - **Existing Components:** {{existing_dependencies}} - **New Components:** {{new_dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: interaction-diagram title: Component Interaction Diagram @@ -7583,7 +7626,7 @@ sections: condition: Enhancement requires API changes instruction: | Define new API endpoints and integration with existing APIs: - + 1. Plan new API endpoints required for the enhancement 2. Ensure consistency with existing API patterns 3. Define authentication and authorization integration @@ -7601,7 +7644,7 @@ sections: repeatable: true sections: - id: endpoint - title: "{{endpoint_name}}" + title: '{{endpoint_name}}' template: | - **Method:** {{http_method}} - **Endpoint:** {{endpoint_path}} @@ -7612,12 +7655,12 @@ sections: title: Request type: code language: json - template: "{{request_schema}}" + template: '{{request_schema}}' - id: response title: Response type: code language: json - template: "{{response_schema}}" + template: '{{response_schema}}' - id: external-api-integration title: External API Integration @@ -7626,24 +7669,24 @@ sections: repeatable: true sections: - id: external-api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL:** {{api_base_url}} - **Authentication:** {{auth_method}} - **Integration Method:** {{integration_approach}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Error Handling:** {{error_handling_strategy}} - id: source-tree-integration title: Source Tree Integration instruction: | Define how new code will integrate with existing project structure: - + 1. Follow existing project organization patterns 2. Identify where new files/folders will be placed 3. Ensure consistency with existing naming conventions @@ -7655,7 +7698,7 @@ sections: type: code language: plaintext instruction: Document relevant parts of current structure - template: "{{existing_structure_relevant_parts}}" + template: '{{existing_structure_relevant_parts}}' - id: new-file-organization title: New File Organization type: code @@ -7682,7 +7725,7 @@ sections: title: Infrastructure and Deployment Integration instruction: | Define how the enhancement will be deployed alongside existing infrastructure: - + 1. Use existing deployment pipeline and infrastructure 2. Identify any infrastructure changes needed 3. Plan deployment strategy to minimize risk @@ -7712,7 +7755,7 @@ sections: title: Coding Standards and Conventions instruction: | Ensure new code follows existing project conventions: - + 1. Document existing coding standards from project analysis 2. Identify any enhancement-specific requirements 3. Ensure consistency with existing codebase patterns @@ -7730,7 +7773,7 @@ sections: title: Enhancement-Specific Standards condition: New patterns needed for enhancement repeatable: true - template: "- **{{standard_name}}:** {{standard_description}}" + template: '- **{{standard_name}}:** {{standard_description}}' - id: integration-rules title: Critical Integration Rules template: | @@ -7743,7 +7786,7 @@ sections: title: Testing Strategy instruction: | Define testing approach for the enhancement: - + 1. Integrate with existing test suite 2. Ensure existing functionality remains intact 3. Plan for testing new features @@ -7783,7 +7826,7 @@ sections: title: Security Integration instruction: | Ensure security consistency with existing system: - + 1. Follow existing security patterns and tools 2. Ensure new features don't introduce vulnerabilities 3. Maintain existing security posture @@ -7818,7 +7861,7 @@ sections: title: Next Steps instruction: | After completing the brownfield architecture: - + 1. Review integration points with existing system 2. Begin story implementation with Dev agent 3. Set up deployment pipeline integration @@ -8430,14 +8473,14 @@ template: output: format: markdown filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md - title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + title: 'Story {{epic_num}}.{{story_num}}: {{story_title_short}}' workflow: mode: interactive elicitation: advanced-elicitation agent_config: - editable_sections: + editable_sections: - Status - Story - Acceptance Criteria @@ -8454,7 +8497,7 @@ sections: instruction: Select the current status of the story owner: scrum-master editors: [scrum-master, dev-agent] - + - id: story title: Story type: template-text @@ -8466,7 +8509,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: acceptance-criteria title: Acceptance Criteria type: numbered-list @@ -8474,7 +8517,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: tasks-subtasks title: Tasks / Subtasks type: bullet-list @@ -8491,7 +8534,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master, dev-agent] - + - id: dev-notes title: Dev Notes instruction: | @@ -8515,7 +8558,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: change-log title: Change Log type: table @@ -8523,7 +8566,7 @@ sections: instruction: Track changes made to this story document owner: scrum-master editors: [scrum-master, dev-agent, qa-agent] - + - id: dev-agent-record title: Dev Agent Record instruction: This section is populated by the development agent during implementation @@ -8532,29 +8575,29 @@ sections: sections: - id: agent-model title: Agent Model Used - template: "{{agent_model_name_version}}" + template: '{{agent_model_name_version}}' instruction: Record the specific AI agent model and version used for development owner: dev-agent editors: [dev-agent] - + - id: debug-log-references title: Debug Log References instruction: Reference any debug logs or traces generated during development owner: dev-agent editors: [dev-agent] - + - id: completion-notes title: Completion Notes List instruction: Notes about the completion of tasks and any issues encountered owner: dev-agent editors: [dev-agent] - + - id: file-list title: File List instruction: List all files created, modified, or affected during story implementation owner: dev-agent editors: [dev-agent] - + - id: qa-results title: QA Results instruction: Results from QA Agent QA review of the completed story implementation @@ -9020,7 +9063,7 @@ workflow: - Single story (< 4 hours) → Use brownfield-create-story task - Small feature (1-3 stories) → Use brownfield-create-epic task - Major enhancement (multiple epics) → Continue with full workflow - + Ask user: "Can you describe the enhancement scope? Is this a small fix, a feature addition, or a major enhancement requiring architectural changes?" - step: routing_decision @@ -9029,14 +9072,14 @@ workflow: single_story: agent: pm uses: brownfield-create-story - notes: "Create single story for immediate implementation. Exit workflow after story creation." + notes: 'Create single story for immediate implementation. Exit workflow after story creation.' small_feature: agent: pm uses: brownfield-create-epic - notes: "Create focused epic with 1-3 stories. Exit workflow after epic creation." + notes: 'Create focused epic with 1-3 stories. Exit workflow after epic creation.' major_enhancement: continue: to_next_step - notes: "Continue with comprehensive planning workflow below." + notes: 'Continue with comprehensive planning workflow below.' - step: documentation_check agent: analyst @@ -9054,7 +9097,7 @@ workflow: action: analyze existing project and use task document-project creates: brownfield-architecture.md (or multiple documents) condition: documentation_inadequate - notes: "Run document-project to capture current system state, technical debt, and constraints. Pass findings to PRD creation." + notes: 'Run document-project to capture current system state, technical debt, and constraints. Pass findings to PRD creation.' - agent: pm creates: prd.md @@ -9086,12 +9129,12 @@ workflow: - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for integration safety and completeness. May require updates to any document." + notes: 'Validates all documents for integration safety and completeness. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -9181,7 +9224,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -9265,36 +9308,36 @@ workflow: {{if single_story}}: Proceeding with brownfield-create-story task for immediate implementation. {{if small_feature}}: Creating focused epic with brownfield-create-epic task. {{if major_enhancement}}: Continuing with comprehensive planning workflow. - + documentation_assessment: | Documentation assessment complete: {{if adequate}}: Existing documentation is sufficient. Proceeding directly to PRD creation. {{if inadequate}}: Running document-project to capture current system state before PRD. - + document_project_to_pm: | Project analysis complete. Key findings documented in: - {{document_list}} Use these findings to inform PRD creation and avoid re-analyzing the same aspects. - + pm_to_architect_decision: | PRD complete and saved as docs/prd.md. Architectural changes identified: {{yes/no}} {{if yes}}: Proceeding to create architecture document for: {{specific_changes}} {{if no}}: No architectural changes needed. Proceeding to validation. - - architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for integration safety." - + + architect_to_po: 'Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for integration safety.' + po_to_sm: | All artifacts validated. Documentation type available: {{sharded_prd / brownfield_docs}} {{if sharded}}: Use standard create-next-story task. {{if brownfield}}: Use create-brownfield-story task to handle varied documentation formats. - + sm_story_creation: | Creating story from {{documentation_type}}. {{if missing_context}}: May need to gather additional context from user during story creation. - - complete: "All planning artifacts validated and development can begin. Stories will be created based on available documentation format." + + complete: 'All planning artifacts validated and development can begin. Stories will be created based on available documentation format.' ==================== END: .bmad-core/workflows/brownfield-fullstack.yaml ==================== ==================== START: .bmad-core/workflows/brownfield-service.yaml ==================== @@ -9317,7 +9360,7 @@ workflow: agent: architect action: analyze existing project and use task document-project creates: multiple documents per the document-project template - notes: "Review existing service documentation, codebase, performance metrics, and identify integration dependencies." + notes: 'Review existing service documentation, codebase, performance metrics, and identify integration dependencies.' - agent: pm creates: prd.md @@ -9334,12 +9377,12 @@ workflow: - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for service integration safety and API compatibility. May require updates to any document." + notes: 'Validates all documents for service integration safety and API compatibility. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -9427,7 +9470,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -9480,11 +9523,11 @@ workflow: - Multiple integration points affected handoff_prompts: - analyst_to_pm: "Service analysis complete. Create comprehensive PRD with service integration strategy." - pm_to_architect: "PRD ready. Save it as docs/prd.md, then create the service architecture." - architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for service integration safety." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Service analysis complete. Create comprehensive PRD with service integration strategy.' + pm_to_architect: 'PRD ready. Save it as docs/prd.md, then create the service architecture.' + architect_to_po: 'Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for service integration safety.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/brownfield-service.yaml ==================== ==================== START: .bmad-core/workflows/brownfield-ui.yaml ==================== @@ -9506,7 +9549,7 @@ workflow: agent: architect action: analyze existing project and use task document-project creates: multiple documents per the document-project template - notes: "Review existing frontend application, user feedback, analytics data, and identify improvement areas." + notes: 'Review existing frontend application, user feedback, analytics data, and identify improvement areas.' - agent: pm creates: prd.md @@ -9531,12 +9574,12 @@ workflow: - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for UI integration safety and design consistency. May require updates to any document." + notes: 'Validates all documents for UI integration safety and design consistency. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -9624,7 +9667,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -9679,12 +9722,12 @@ workflow: - Multiple team members will work on related changes handoff_prompts: - analyst_to_pm: "UI analysis complete. Create comprehensive PRD with UI integration strategy." - pm_to_ux: "PRD ready. Save it as docs/prd.md, then create the UI/UX specification." - ux_to_architect: "UI/UX spec complete. Save it as docs/front-end-spec.md, then create the frontend architecture." - architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for UI integration safety." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'UI analysis complete. Create comprehensive PRD with UI integration strategy.' + pm_to_ux: 'PRD ready. Save it as docs/prd.md, then create the UI/UX specification.' + ux_to_architect: 'UI/UX spec complete. Save it as docs/front-end-spec.md, then create the frontend architecture.' + architect_to_po: 'Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for UI integration safety.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/brownfield-ui.yaml ==================== ==================== START: .bmad-core/workflows/greenfield-fullstack.yaml ==================== @@ -9726,7 +9769,7 @@ workflow: creates: v0_prompt (optional) requires: front-end-spec.md condition: user_wants_ai_generation - notes: "OPTIONAL BUT RECOMMENDED: Generate AI UI prompt for tools like v0, Lovable, etc. Use the generate-ai-frontend-prompt task. User can then generate UI in external tool and download project structure." + notes: 'OPTIONAL BUT RECOMMENDED: Generate AI UI prompt for tools like v0, Lovable, etc. Use the generate-ai-frontend-prompt task. User can then generate UI in external tool and download project structure.' - agent: architect creates: fullstack-architecture.md @@ -9742,26 +9785,26 @@ workflow: updates: prd.md (if needed) requires: fullstack-architecture.md condition: architecture_suggests_prd_changes - notes: "If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder." + notes: 'If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder.' - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for consistency and completeness. May require updates to any document." + notes: 'Validates all documents for consistency and completeness. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - project_setup_guidance: action: guide_project_structure condition: user_has_generated_ui - notes: "If user generated UI with v0/Lovable: For polyrepo setup, place downloaded project in separate frontend repo alongside backend repo. For monorepo, place in apps/web or packages/frontend directory. Review architecture document for specific guidance." + notes: 'If user generated UI with v0/Lovable: For polyrepo setup, place downloaded project in separate frontend repo alongside backend repo. For monorepo, place in apps/web or packages/frontend directory. Review architecture document for specific guidance.' - development_order_guidance: action: guide_development_sequence - notes: "Based on PRD stories: If stories are frontend-heavy, start with frontend project/directory first. If backend-heavy or API-first, start with backend. For tightly coupled features, follow story sequence in monorepo setup. Reference sharded PRD epics for development order." + notes: 'Based on PRD stories: If stories are frontend-heavy, start with frontend project/directory first. If backend-heavy or API-first, start with backend. For tightly coupled features, follow story sequence in monorepo setup. Reference sharded PRD epics for development order.' - agent: po action: shard_documents @@ -9849,7 +9892,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -9920,14 +9963,14 @@ workflow: - Enterprise or customer-facing applications handoff_prompts: - analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD." - pm_to_ux: "PRD is ready. Save it as docs/prd.md in your project, then create the UI/UX specification." - ux_to_architect: "UI/UX spec complete. Save it as docs/front-end-spec.md in your project, then create the fullstack architecture." - architect_review: "Architecture complete. Save it as docs/fullstack-architecture.md. Do you suggest any changes to the PRD stories or need new stories added?" - architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/." - updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD.' + pm_to_ux: 'PRD is ready. Save it as docs/prd.md in your project, then create the UI/UX specification.' + ux_to_architect: 'UI/UX spec complete. Save it as docs/front-end-spec.md in your project, then create the fullstack architecture.' + architect_review: 'Architecture complete. Save it as docs/fullstack-architecture.md. Do you suggest any changes to the PRD stories or need new stories added?' + architect_to_pm: 'Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/.' + updated_to_po: 'All documents ready in docs/ folder. Please validate all artifacts for consistency.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/greenfield-fullstack.yaml ==================== ==================== START: .bmad-core/workflows/greenfield-service.yaml ==================== @@ -9970,17 +10013,17 @@ workflow: updates: prd.md (if needed) requires: architecture.md condition: architecture_suggests_prd_changes - notes: "If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder." + notes: 'If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder.' - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for consistency and completeness. May require updates to any document." + notes: 'Validates all documents for consistency and completeness. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -10068,7 +10111,7 @@ workflow: notes: | All stories implemented and reviewed! Service development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -10130,13 +10173,13 @@ workflow: - Enterprise or external-facing APIs handoff_prompts: - analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD." - pm_to_architect: "PRD is ready. Save it as docs/prd.md in your project, then create the service architecture." - architect_review: "Architecture complete. Save it as docs/architecture.md. Do you suggest any changes to the PRD stories or need new stories added?" - architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/." - updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD.' + pm_to_architect: 'PRD is ready. Save it as docs/prd.md in your project, then create the service architecture.' + architect_review: 'Architecture complete. Save it as docs/architecture.md. Do you suggest any changes to the PRD stories or need new stories added?' + architect_to_pm: 'Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/.' + updated_to_po: 'All documents ready in docs/ folder. Please validate all artifacts for consistency.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/greenfield-service.yaml ==================== ==================== START: .bmad-core/workflows/greenfield-ui.yaml ==================== @@ -10179,7 +10222,7 @@ workflow: creates: v0_prompt (optional) requires: front-end-spec.md condition: user_wants_ai_generation - notes: "OPTIONAL BUT RECOMMENDED: Generate AI UI prompt for tools like v0, Lovable, etc. Use the generate-ai-frontend-prompt task. User can then generate UI in external tool and download project structure." + notes: 'OPTIONAL BUT RECOMMENDED: Generate AI UI prompt for tools like v0, Lovable, etc. Use the generate-ai-frontend-prompt task. User can then generate UI in external tool and download project structure.' - agent: architect creates: front-end-architecture.md @@ -10193,22 +10236,22 @@ workflow: updates: prd.md (if needed) requires: front-end-architecture.md condition: architecture_suggests_prd_changes - notes: "If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder." + notes: 'If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder.' - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for consistency and completeness. May require updates to any document." + notes: 'Validates all documents for consistency and completeness. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - project_setup_guidance: action: guide_project_structure condition: user_has_generated_ui - notes: "If user generated UI with v0/Lovable: For polyrepo setup, place downloaded project in separate frontend repo. For monorepo, place in apps/web or frontend/ directory. Review architecture document for specific guidance." + notes: 'If user generated UI with v0/Lovable: For polyrepo setup, place downloaded project in separate frontend repo. For monorepo, place in apps/web or frontend/ directory. Review architecture document for specific guidance.' - agent: po action: shard_documents @@ -10296,7 +10339,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -10367,12 +10410,12 @@ workflow: - Customer-facing applications handoff_prompts: - analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD." - pm_to_ux: "PRD is ready. Save it as docs/prd.md in your project, then create the UI/UX specification." - ux_to_architect: "UI/UX spec complete. Save it as docs/front-end-spec.md in your project, then create the frontend architecture." - architect_review: "Frontend architecture complete. Save it as docs/front-end-architecture.md. Do you suggest any changes to the PRD stories or need new stories added?" - architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/." - updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD.' + pm_to_ux: 'PRD is ready. Save it as docs/prd.md in your project, then create the UI/UX specification.' + ux_to_architect: 'UI/UX spec complete. Save it as docs/front-end-spec.md in your project, then create the frontend architecture.' + architect_review: 'Frontend architecture complete. Save it as docs/front-end-architecture.md. Do you suggest any changes to the PRD stories or need new stories added?' + architect_to_pm: 'Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/.' + updated_to_po: 'All documents ready in docs/ folder. Please validate all artifacts for consistency.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/greenfield-ui.yaml ==================== diff --git a/dist/teams/team-ide-minimal.txt b/dist/teams/team-ide-minimal.txt index ba44703b..f7b0cc87 100644 --- a/dist/teams/team-ide-minimal.txt +++ b/dist/teams/team-ide-minimal.txt @@ -1014,7 +1014,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing - **Claude Code**: `/agent-name` (e.g., `/bmad-master`) - **Cursor**: `@agent-name` (e.g., `@bmad-master`) -- **Windsurf**: `@agent-name` (e.g., `@bmad-master`) +- **Windsurf**: `/agent-name` (e.g., `/bmad-master`) - **Trae**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-master`) - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. @@ -2246,14 +2246,14 @@ template: output: format: markdown filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md - title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + title: 'Story {{epic_num}}.{{story_num}}: {{story_title_short}}' workflow: mode: interactive elicitation: advanced-elicitation agent_config: - editable_sections: + editable_sections: - Status - Story - Acceptance Criteria @@ -2270,7 +2270,7 @@ sections: instruction: Select the current status of the story owner: scrum-master editors: [scrum-master, dev-agent] - + - id: story title: Story type: template-text @@ -2282,7 +2282,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: acceptance-criteria title: Acceptance Criteria type: numbered-list @@ -2290,7 +2290,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: tasks-subtasks title: Tasks / Subtasks type: bullet-list @@ -2307,7 +2307,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master, dev-agent] - + - id: dev-notes title: Dev Notes instruction: | @@ -2331,7 +2331,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: change-log title: Change Log type: table @@ -2339,7 +2339,7 @@ sections: instruction: Track changes made to this story document owner: scrum-master editors: [scrum-master, dev-agent, qa-agent] - + - id: dev-agent-record title: Dev Agent Record instruction: This section is populated by the development agent during implementation @@ -2348,29 +2348,29 @@ sections: sections: - id: agent-model title: Agent Model Used - template: "{{agent_model_name_version}}" + template: '{{agent_model_name_version}}' instruction: Record the specific AI agent model and version used for development owner: dev-agent editors: [dev-agent] - + - id: debug-log-references title: Debug Log References instruction: Reference any debug logs or traces generated during development owner: dev-agent editors: [dev-agent] - + - id: completion-notes title: Completion Notes List instruction: Notes about the completion of tasks and any issues encountered owner: dev-agent editors: [dev-agent] - + - id: file-list title: File List instruction: List all files created, modified, or affected during story implementation owner: dev-agent editors: [dev-agent] - + - id: qa-results title: QA Results instruction: Results from QA Agent QA review of the completed story implementation @@ -3375,10 +3375,10 @@ Perform a comprehensive test architecture review with quality gate decision. Thi ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Prerequisites @@ -3540,6 +3540,8 @@ Gate: {STATUS} → docs/qa/gates/{epic}.{story}-{slug}.yml Risk profile: docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md +# Note: Paths should reference core-config.yaml for custom configurations + ### Recommended Status [✓ Ready for Done] / [✗ Changes Required - See unchecked items above] @@ -3551,26 +3553,26 @@ NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md **Template and Directory:** - Render from `templates/qa-gate-tmpl.yaml` -- Create `docs/qa/gates/` directory if missing +- Create `docs/qa/gates/` directory if missing (or configure in core-config.yaml) - Save to: `docs/qa/gates/{epic}.{story}-{slug}.yml` Gate file structure: ```yaml schema: 1 -story: "{epic}.{story}" -story_title: "{story title}" +story: '{epic}.{story}' +story_title: '{story title}' gate: PASS|CONCERNS|FAIL|WAIVED -status_reason: "1-2 sentence explanation of gate decision" -reviewer: "Quinn (Test Architect)" -updated: "{ISO-8601 timestamp}" +status_reason: '1-2 sentence explanation of gate decision' +reviewer: 'Quinn (Test Architect)' +updated: '{ISO-8601 timestamp}' top_issues: [] # Empty if no issues waiver: { active: false } # Set active: true only if WAIVED # Extended fields (optional but recommended): quality_score: 0-100 # 100 - (20*FAILs) - (10*CONCERNS) or use technical-preferences.md weights -expires: "{ISO-8601 timestamp}" # Typically 2 weeks from review +expires: '{ISO-8601 timestamp}' # Typically 2 weeks from review evidence: tests_reviewed: { count } @@ -3582,24 +3584,24 @@ evidence: nfr_validation: security: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' performance: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' reliability: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' maintainability: status: PASS|CONCERNS|FAIL - notes: "Specific findings" + notes: 'Specific findings' recommendations: immediate: # Must fix before production - - action: "Add rate limiting" - refs: ["api/auth/login.ts"] + - action: 'Add rate limiting' + refs: ['api/auth/login.ts'] future: # Can be addressed later - - action: "Consider caching" - refs: ["services/data.ts"] + - action: 'Consider caching' + refs: ['services/data.ts'] ``` ### Gate Decision Criteria @@ -3711,11 +3713,11 @@ Slug rules: ```yaml schema: 1 -story: "{epic}.{story}" +story: '{epic}.{story}' gate: PASS|CONCERNS|FAIL|WAIVED -status_reason: "1-2 sentence explanation of gate decision" -reviewer: "Quinn" -updated: "{ISO-8601 timestamp}" +status_reason: '1-2 sentence explanation of gate decision' +reviewer: 'Quinn' +updated: '{ISO-8601 timestamp}' top_issues: [] # Empty array if no issues waiver: { active: false } # Only set active: true if WAIVED ``` @@ -3724,20 +3726,20 @@ waiver: { active: false } # Only set active: true if WAIVED ```yaml schema: 1 -story: "1.3" +story: '1.3' gate: CONCERNS -status_reason: "Missing rate limiting on auth endpoints poses security risk." -reviewer: "Quinn" -updated: "2025-01-12T10:15:00Z" +status_reason: 'Missing rate limiting on auth endpoints poses security risk.' +reviewer: 'Quinn' +updated: '2025-01-12T10:15:00Z' top_issues: - - id: "SEC-001" + - id: 'SEC-001' severity: high # ONLY: low|medium|high - finding: "No rate limiting on login endpoint" - suggested_action: "Add rate limiting middleware before production" - - id: "TEST-001" + finding: 'No rate limiting on login endpoint' + suggested_action: 'Add rate limiting middleware before production' + - id: 'TEST-001' severity: medium - finding: "No integration tests for auth flow" - suggested_action: "Add integration test coverage" + finding: 'No integration tests for auth flow' + suggested_action: 'Add integration test coverage' waiver: { active: false } ``` @@ -3745,20 +3747,20 @@ waiver: { active: false } ```yaml schema: 1 -story: "1.3" +story: '1.3' gate: WAIVED -status_reason: "Known issues accepted for MVP release." -reviewer: "Quinn" -updated: "2025-01-12T10:15:00Z" +status_reason: 'Known issues accepted for MVP release.' +reviewer: 'Quinn' +updated: '2025-01-12T10:15:00Z' top_issues: - - id: "PERF-001" + - id: 'PERF-001' severity: low - finding: "Dashboard loads slowly with 1000+ items" - suggested_action: "Implement pagination in next sprint" + finding: 'Dashboard loads slowly with 1000+ items' + suggested_action: 'Implement pagination in next sprint' waiver: active: true - reason: "MVP release - performance optimization deferred" - approved_by: "Product Owner" + reason: 'MVP release - performance optimization deferred' + approved_by: 'Product Owner' ``` ## Gate Decision Criteria @@ -3877,21 +3879,21 @@ Identify all testable requirements from: For each requirement, document which tests validate it. Use Given-When-Then to describe what the test validates (not how it's written): ```yaml -requirement: "AC1: User can login with valid credentials" +requirement: 'AC1: User can login with valid credentials' test_mappings: - - test_file: "auth/login.test.ts" - test_case: "should successfully login with valid email and password" + - test_file: 'auth/login.test.ts' + test_case: 'should successfully login with valid email and password' # Given-When-Then describes WHAT the test validates, not HOW it's coded - given: "A registered user with valid credentials" - when: "They submit the login form" - then: "They are redirected to dashboard and session is created" + given: 'A registered user with valid credentials' + when: 'They submit the login form' + then: 'They are redirected to dashboard and session is created' coverage: full - - test_file: "e2e/auth-flow.test.ts" - test_case: "complete login flow" - given: "User on login page" - when: "Entering valid credentials and submitting" - then: "Dashboard loads with user data" + - test_file: 'e2e/auth-flow.test.ts' + test_case: 'complete login flow' + given: 'User on login page' + when: 'Entering valid credentials and submitting' + then: 'Dashboard loads with user data' coverage: integration ``` @@ -3913,19 +3915,19 @@ Document any gaps found: ```yaml coverage_gaps: - - requirement: "AC3: Password reset email sent within 60 seconds" - gap: "No test for email delivery timing" + - requirement: 'AC3: Password reset email sent within 60 seconds' + gap: 'No test for email delivery timing' severity: medium suggested_test: type: integration - description: "Test email service SLA compliance" + description: 'Test email service SLA compliance' - - requirement: "AC5: Support 1000 concurrent users" - gap: "No load testing implemented" + - requirement: 'AC5: Support 1000 concurrent users' + gap: 'No load testing implemented' severity: high suggested_test: type: performance - description: "Load test with 1000 concurrent connections" + description: 'Load test with 1000 concurrent connections' ``` ## Outputs @@ -3941,11 +3943,11 @@ trace: full: Y partial: Z none: W - planning_ref: "docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md" + planning_ref: 'docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md' uncovered: - - ac: "AC3" - reason: "No test found for password reset timing" - notes: "See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md" + - ac: 'AC3' + reason: 'No test found for password reset timing' + notes: 'See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md' ``` ### Output 2: Traceability Report @@ -4119,10 +4121,10 @@ Generate a comprehensive risk assessment matrix for a story implementation using ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: 'docs/stories/{epic}.{story}.*.md' + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Purpose @@ -4192,14 +4194,14 @@ For each category, identify specific risks: ```yaml risk: - id: "SEC-001" # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH + id: 'SEC-001' # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH category: security - title: "Insufficient input validation on user forms" - description: "Form inputs not properly sanitized could lead to XSS attacks" + title: 'Insufficient input validation on user forms' + description: 'Form inputs not properly sanitized could lead to XSS attacks' affected_components: - - "UserRegistrationForm" - - "ProfileUpdateForm" - detection_method: "Code review revealed missing validation" + - 'UserRegistrationForm' + - 'ProfileUpdateForm' + detection_method: 'Code review revealed missing validation' ``` ### 2. Risk Assessment @@ -4246,20 +4248,20 @@ For each identified risk, provide mitigation: ```yaml mitigation: - risk_id: "SEC-001" - strategy: "preventive" # preventive|detective|corrective + risk_id: 'SEC-001' + strategy: 'preventive' # preventive|detective|corrective actions: - - "Implement input validation library (e.g., validator.js)" - - "Add CSP headers to prevent XSS execution" - - "Sanitize all user inputs before storage" - - "Escape all outputs in templates" + - 'Implement input validation library (e.g., validator.js)' + - 'Add CSP headers to prevent XSS execution' + - 'Sanitize all user inputs before storage' + - 'Escape all outputs in templates' testing_requirements: - - "Security testing with OWASP ZAP" - - "Manual penetration testing of forms" - - "Unit tests for validation functions" - residual_risk: "Low - Some zero-day vulnerabilities may remain" - owner: "dev" - timeline: "Before deployment" + - 'Security testing with OWASP ZAP' + - 'Manual penetration testing of forms' + - 'Unit tests for validation functions' + residual_risk: 'Low - Some zero-day vulnerabilities may remain' + owner: 'dev' + timeline: 'Before deployment' ``` ## Outputs @@ -4285,12 +4287,12 @@ risk_summary: highest: id: SEC-001 score: 9 - title: "XSS on profile form" + title: 'XSS on profile form' recommendations: must_fix: - - "Add input sanitization & CSP" + - 'Add input sanitization & CSP' monitor: - - "Add security alerts for auth endpoints" + - 'Add security alerts for auth endpoints' ``` ### Output 2: Markdown Report @@ -4475,299 +4477,79 @@ Create comprehensive test scenarios with appropriate test level recommendations ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" - - story_title: "{title}" # If missing, derive from story file H1 - - story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated) + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: '{devStoryLocation}/{epic}.{story}.*.md' # Path from core-config.yaml + - story_title: '{title}' # If missing, derive from story file H1 + - story_slug: '{slug}' # If missing, derive from title (lowercase, hyphenated) ``` ## Purpose Design a complete test strategy that identifies what to test, at which level (unit/integration/e2e), and why. This ensures efficient test coverage without redundancy while maintaining appropriate test boundaries. -## Test Level Decision Framework - -### Unit Tests - -**When to use:** - -- Testing pure functions and business logic -- Algorithm correctness -- Input validation and data transformation -- Error handling in isolated components -- Complex calculations or state machines - -**Characteristics:** - -- Fast execution (immediate feedback) -- No external dependencies (DB, API, file system) -- Highly maintainable and stable -- Easy to debug failures - -**Example scenarios:** +## Dependencies ```yaml -unit_test: - component: "PriceCalculator" - scenario: "Calculate discount with multiple rules" - justification: "Complex business logic with multiple branches" - mock_requirements: "None - pure function" +data: + - test-levels-framework.md # Unit/Integration/E2E decision criteria + - test-priorities-matrix.md # P0/P1/P2/P3 classification system ``` -### Integration Tests - -**When to use:** - -- Testing component interactions -- Database operations and queries -- API endpoint behavior -- Service layer orchestration -- External service integration (with test doubles) - -**Characteristics:** - -- Moderate execution time -- May use test databases or containers -- Tests multiple components together -- Validates contracts between components - -**Example scenarios:** - -```yaml -integration_test: - components: ["UserService", "UserRepository", "Database"] - scenario: "Create user with duplicate email check" - justification: "Tests transaction boundaries and constraint handling" - test_doubles: "Mock email service, real test database" -``` - -### End-to-End Tests - -**When to use:** - -- Critical user journeys -- Cross-system workflows -- UI interaction flows -- Full stack validation -- Production-like scenario testing - -**Characteristics:** - -- Keep under 90 seconds per test -- Tests complete user scenarios -- Uses real or production-like environment -- Higher maintenance cost -- More prone to flakiness - -**Example scenarios:** - -```yaml -e2e_test: - flow: "Complete purchase flow" - scenario: "User browses, adds to cart, and completes checkout" - justification: "Critical business flow requiring full stack validation" - environment: "Staging with test payment gateway" -``` - -## Test Design Process +## Process ### 1. Analyze Story Requirements -Break down each acceptance criterion into testable scenarios: +Break down each acceptance criterion into testable scenarios. For each AC: -```yaml -acceptance_criterion: "User can reset password via email" -test_scenarios: - - level: unit - what: "Password validation rules" - why: "Complex regex and business rules" +- Identify the core functionality to test +- Determine data variations needed +- Consider error conditions +- Note edge cases - - level: integration - what: "Password reset token generation and storage" - why: "Database interaction with expiry logic" +### 2. Apply Test Level Framework - - level: integration - what: "Email service integration" - why: "External service with retry logic" +**Reference:** Load `test-levels-framework.md` for detailed criteria - - level: e2e - what: "Complete password reset flow" - why: "Critical security flow needing full validation" -``` +Quick rules: -### 2. Apply Test Level Heuristics +- **Unit**: Pure logic, algorithms, calculations +- **Integration**: Component interactions, DB operations +- **E2E**: Critical user journeys, compliance -Use these rules to determine appropriate test levels: +### 3. Assign Priorities -```markdown -## Test Level Selection Rules +**Reference:** Load `test-priorities-matrix.md` for classification -### Favor Unit Tests When: +Quick priority assignment: -- Logic can be isolated -- No side effects involved -- Fast feedback needed -- High cyclomatic complexity +- **P0**: Revenue-critical, security, compliance +- **P1**: Core user journeys, frequently used +- **P2**: Secondary features, admin functions +- **P3**: Nice-to-have, rarely used -### Favor Integration Tests When: +### 4. Design Test Scenarios -- Testing persistence layer -- Validating service contracts -- Testing middleware/interceptors -- Component boundaries critical - -### Favor E2E Tests When: - -- User-facing critical paths -- Multi-system interactions -- Regulatory compliance scenarios -- Visual regression important - -### Anti-patterns to Avoid: - -- E2E testing for business logic validation -- Unit testing framework behavior -- Integration testing third-party libraries -- Duplicate coverage across levels - -### Duplicate Coverage Guard - -**Before adding any test, check:** - -1. Is this already tested at a lower level? -2. Can a unit test cover this instead of integration? -3. Can an integration test cover this instead of E2E? - -**Coverage overlap is only acceptable when:** - -- Testing different aspects (unit: logic, integration: interaction, e2e: user experience) -- Critical paths requiring defense in depth -- Regression prevention for previously broken functionality -``` - -### 3. Design Test Scenarios - -**Test ID Format:** `{EPIC}.{STORY}-{LEVEL}-{SEQ}` - -- Example: `1.3-UNIT-001`, `1.3-INT-002`, `1.3-E2E-001` -- Ensures traceability across all artifacts - -**Naming Convention:** - -- Unit: `test_{component}_{scenario}` -- Integration: `test_{flow}_{interaction}` -- E2E: `test_{journey}_{outcome}` - -**Risk Linkage:** - -- Tag tests with risk IDs they mitigate -- Prioritize tests for high-risk areas (P0) -- Link to risk profile when available - -For each identified test need: +For each identified test need, create: ```yaml test_scenario: - id: "1.3-INT-002" - requirement: "AC2: Rate limiting on login attempts" - mitigates_risks: ["SEC-001", "PERF-003"] # Links to risk profile - priority: P0 # Based on risk score - - unit_tests: - - name: "RateLimiter calculates window correctly" - input: "Timestamp array" - expected: "Correct window calculation" - - integration_tests: - - name: "Login endpoint enforces rate limit" - setup: "5 failed attempts" - action: "6th attempt" - expected: "429 response with retry-after header" - - e2e_tests: - - name: "User sees rate limit message" - setup: "Trigger rate limit" - validation: "Error message displayed, retry timer shown" + id: '{epic}.{story}-{LEVEL}-{SEQ}' + requirement: 'AC reference' + priority: P0|P1|P2|P3 + level: unit|integration|e2e + description: 'What is being tested' + justification: 'Why this level was chosen' + mitigates_risks: ['RISK-001'] # If risk profile exists ``` -## Deterministic Test Level Minimums +### 5. Validate Coverage -**Per Acceptance Criterion:** +Ensure: -- At least 1 unit test for business logic -- At least 1 integration test if multiple components interact -- At least 1 E2E test if it's a user-facing feature - -**Exceptions:** - -- Pure UI changes: May skip unit tests -- Pure logic changes: May skip E2E tests -- Infrastructure changes: May focus on integration tests - -**When in doubt:** Start with unit tests, add integration for interactions, E2E for critical paths only. - -## Test Quality Standards - -### Core Testing Principles - -**No Flaky Tests:** Ensure reliability through proper async handling, explicit waits, and atomic test design. - -**No Hard Waits/Sleeps:** Use dynamic waiting strategies (e.g., polling, event-based triggers). - -**Stateless & Parallel-Safe:** Tests run independently; use cron jobs or semaphores only if unavoidable. - -**No Order Dependency:** Every it/describe/context block works in isolation (supports .only execution). - -**Self-Cleaning Tests:** Test sets up its own data and automatically deletes/deactivates entities created during testing. - -**Tests Live Near Source Code:** Co-locate test files with the code they validate (e.g., `*.spec.js` alongside components). - -### Execution Strategy - -**Shifted Left:** - -- Start with local environments or ephemeral stacks -- Validate functionality across all deployment stages (local → dev → stage) - -**Low Maintenance:** Minimize manual upkeep (avoid brittle selectors, do not repeat UI actions, leverage APIs). - -**CI Execution Evidence:** Integrate into pipelines with clear logs/artifacts. - -**Visibility:** Generate test reports (e.g., JUnit XML, HTML) for failures and trends. - -### Coverage Requirements - -**Release Confidence:** - -- Happy Path: Core user journeys are prioritized -- Edge Cases: Critical error/validation scenarios are covered -- Feature Flags: Test both enabled and disabled states where applicable - -### Test Design Rules - -**Assertions:** Keep them explicit in tests; avoid abstraction into helpers. Use parametrized tests for soft assertions. - -**Naming:** Follow conventions (e.g., `describe('Component')`, `it('should do X when Y')`). - -**Size:** Aim for files ≤200 lines; split/chunk large tests logically. - -**Speed:** Target individual tests ≤90 seconds; optimize slow setups (e.g., shared fixtures). - -**Careful Abstractions:** Favor readability over DRY when balancing helper reuse (page objects are okay, assertion logic is not). - -**Test Cleanup:** Ensure tests clean up resources they create (e.g., closing browser, deleting test data). - -**Deterministic Flow:** Tests should refrain from using conditionals (e.g., if/else) to control flow or try/catch blocks where possible. - -### API Testing Standards - -- Tests must not depend on hardcoded data → use factories and per-test setup -- Always test both happy path and negative/error cases -- API tests should run parallel safely (no global state shared) -- Test idempotency where applicable (e.g., duplicate requests) -- Tests should clean up their data -- Response logs should only be printed in case of failure -- Auth tests must validate token expiration and renewal +- Every AC has at least one test +- No duplicate coverage across levels +- Critical paths have multiple levels +- Risk mitigations are addressed ## Outputs @@ -4775,13 +4557,11 @@ test_scenario: **Save to:** `docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md` -Generate a comprehensive test design document: - ```markdown # Test Design: Story {epic}.{story} Date: {date} -Reviewer: Quinn (Test Architect) +Designer: Quinn (Test Architect) ## Test Strategy Overview @@ -4789,212 +4569,80 @@ Reviewer: Quinn (Test Architect) - Unit tests: Y (A%) - Integration tests: Z (B%) - E2E tests: W (C%) +- Priority distribution: P0: X, P1: Y, P2: Z -## Test Level Rationale +## Test Scenarios by Acceptance Criteria -[Explain why this distribution was chosen] +### AC1: {description} -## Detailed Test Scenarios +#### Scenarios -### Requirement: AC1 - {description} +| ID | Level | Priority | Test | Justification | +| ------------ | ----------- | -------- | ------------------------- | ------------------------ | +| 1.3-UNIT-001 | Unit | P0 | Validate input format | Pure validation logic | +| 1.3-INT-001 | Integration | P0 | Service processes request | Multi-component flow | +| 1.3-E2E-001 | E2E | P1 | User completes journey | Critical path validation | -#### Unit Tests (3 scenarios) +[Continue for all ACs...] -1. **ID**: 1.3-UNIT-001 - **Test**: Validate input format - - **Why Unit**: Pure validation logic - - **Coverage**: Input edge cases - - **Mocks**: None needed - - **Mitigates**: DATA-001 (if applicable) +## Risk Coverage -#### Integration Tests (2 scenarios) +[Map test scenarios to identified risks if risk profile exists] -1. **ID**: 1.3-INT-001 - **Test**: Service processes valid request - - **Why Integration**: Multiple components involved - - **Coverage**: Happy path + error handling - - **Test Doubles**: Mock external API - - **Mitigates**: TECH-002 +## Recommended Execution Order -#### E2E Tests (1 scenario) - -1. **ID**: 1.3-E2E-001 - **Test**: Complete user workflow - - **Why E2E**: Critical user journey - - **Coverage**: Full stack validation - - **Environment**: Staging - - **Max Duration**: 90 seconds - - **Mitigates**: BUS-001 - -[Continue for all requirements...] - -## Test Data Requirements - -### Unit Test Data - -- Static fixtures for calculations -- Edge case values arrays - -### Integration Test Data - -- Test database seeds -- API response fixtures - -### E2E Test Data - -- Test user accounts -- Sandbox environment data - -## Mock/Stub Strategy - -### What to Mock - -- External services (payment, email) -- Time-dependent functions -- Random number generators - -### What NOT to Mock - -- Core business logic -- Database in integration tests -- Critical security functions - -## Test Execution Implementation - -### Parallel Execution - -- All unit tests: Fully parallel (stateless requirement) -- Integration tests: Parallel with isolated databases -- E2E tests: Sequential or limited parallelism - -### Execution Order - -1. Unit tests first (fail fast) -2. Integration tests second -3. E2E tests last (expensive, max 90 seconds each) - -## Risk-Based Test Priority - -### P0 - Must Have (Linked to Critical/High Risks) - -- Security-related tests (SEC-\* risks) -- Data integrity tests (DATA-\* risks) -- Critical business flow tests (BUS-\* risks) -- Tests for risks scored ≥6 in risk profile - -### P1 - Should Have (Medium Risks) - -- Edge case coverage -- Performance tests (PERF-\* risks) -- Error recovery tests -- Tests for risks scored 4-5 - -### P2 - Nice to Have (Low Risks) - -- UI polish tests -- Minor validation tests -- Tests for risks scored ≤3 - -## Test Maintenance Considerations - -### High Maintenance Tests - -[List tests that may need frequent updates] - -### Stability Measures - -- No retry strategies (tests must be deterministic) -- Dynamic waits only (no hard sleeps) -- Environment isolation -- Self-cleaning test data - -## Coverage Goals - -### Unit Test Coverage - -- Target: 80% line coverage -- Focus: Business logic, calculations - -### Integration Coverage - -- Target: All API endpoints -- Focus: Contract validation - -### E2E Coverage - -- Target: Critical paths only -- Focus: User value delivery +1. P0 Unit tests (fail fast) +2. P0 Integration tests +3. P0 E2E tests +4. P1 tests in order +5. P2+ as time permits ``` -## Test Level Smells to Flag +### Output 2: Gate YAML Block -### Over-testing Smells +Generate for inclusion in quality gate: -- Same logic tested at multiple levels -- E2E tests for calculations -- Integration tests for framework features +```yaml +test_design: + scenarios_total: X + by_level: + unit: Y + integration: Z + e2e: W + by_priority: + p0: A + p1: B + p2: C + coverage_gaps: [] # List any ACs without tests +``` -### Under-testing Smells +### Output 3: Trace References -- No unit tests for complex logic -- Missing integration tests for data operations -- No E2E tests for critical user paths +Print for use by trace-requirements task: -### Wrong Level Smells +```text +Test design matrix: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md +P0 tests identified: {count} +``` -- Unit tests with real database -- E2E tests checking calculation results -- Integration tests mocking everything +## Quality Checklist -## Quality Indicators +Before finalizing, verify: -Good test design shows: - -- Clear level separation -- No redundant coverage -- Fast feedback from unit tests -- Reliable integration tests -- Focused e2e tests +- [ ] Every AC has test coverage +- [ ] Test levels are appropriate (not over-testing) +- [ ] No duplicate coverage across levels +- [ ] Priorities align with business risk +- [ ] Test IDs follow naming convention +- [ ] Scenarios are atomic and independent ## Key Principles -- Test at the lowest appropriate level -- One clear owner per test -- Fast tests run first -- Mock at boundaries, not internals -- E2E for user value, not implementation -- Maintain test/production parity where critical -- Tests must be atomic and self-contained -- No shared state between tests -- Explicit assertions in test files (not helpers) - -### Output 2: Story Hook Line - -**Print this line for review task to quote:** - -```text -Test design: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md -``` - -**For traceability:** This planning document will be referenced by trace-requirements task. - -### Output 3: Test Count Summary - -**Print summary for quick reference:** - -```yaml -test_summary: - total: { total_count } - by_level: - unit: { unit_count } - integration: { int_count } - e2e: { e2e_count } - by_priority: - P0: { p0_count } - P1: { p1_count } - P2: { p2_count } - coverage_gaps: [] # List any ACs without tests -``` +- **Shift left**: Prefer unit over integration, integration over E2E +- **Risk-based**: Focus on what could go wrong +- **Efficient coverage**: Test once at the right level +- **Maintainability**: Consider long-term test maintenance +- **Fast feedback**: Quick tests run first ==================== END: .bmad-core/tasks/test-design.md ==================== ==================== START: .bmad-core/tasks/nfr-assess.md ==================== @@ -5006,12 +4654,12 @@ Quick NFR validation focused on the core four: security, performance, reliabilit ```yaml required: - - story_id: "{epic}.{story}" # e.g., "1.3" - - story_path: "docs/stories/{epic}.{story}.*.md" + - story_id: '{epic}.{story}' # e.g., "1.3" + - story_path: 'docs/stories/{epic}.{story}.*.md' optional: - - architecture_refs: "docs/architecture/*.md" - - technical_preferences: "docs/technical-preferences.md" + - architecture_refs: 'docs/architecture/*.md' + - technical_preferences: 'docs/technical-preferences.md' - acceptance_criteria: From story file ``` @@ -5092,16 +4740,16 @@ nfr_validation: _assessed: [security, performance, reliability, maintainability] security: status: CONCERNS - notes: "No rate limiting on auth endpoints" + notes: 'No rate limiting on auth endpoints' performance: status: PASS - notes: "Response times < 200ms verified" + notes: 'Response times < 200ms verified' reliability: status: PASS - notes: "Error handling and retries implemented" + notes: 'Error handling and retries implemented' maintainability: status: CONCERNS - notes: "Test coverage at 65%, target is 80%" + notes: 'Test coverage at 65%, target is 80%' ``` ## Deterministic Status Rules @@ -5331,10 +4979,10 @@ performance_deep_dive: p99: 350ms database: slow_queries: 2 - missing_indexes: ["users.email", "orders.user_id"] + missing_indexes: ['users.email', 'orders.user_id'] caching: hit_rate: 0% - recommendation: "Add Redis for session data" + recommendation: 'Add Redis for session data' load_test: max_rps: 150 breaking_point: 200 rps @@ -5351,16 +4999,16 @@ template: output: format: yaml filename: docs/qa/gates/{{epic_num}}.{{story_num}}-{{story_slug}}.yml - title: "Quality Gate: {{epic_num}}.{{story_num}}" + title: 'Quality Gate: {{epic_num}}.{{story_num}}' # Required fields (keep these first) schema: 1 -story: "{{epic_num}}.{{story_num}}" -story_title: "{{story_title}}" -gate: "{{gate_status}}" # PASS|CONCERNS|FAIL|WAIVED -status_reason: "{{status_reason}}" # 1-2 sentence summary of why this gate decision -reviewer: "Quinn (Test Architect)" -updated: "{{iso_timestamp}}" +story: '{{epic_num}}.{{story_num}}' +story_title: '{{story_title}}' +gate: '{{gate_status}}' # PASS|CONCERNS|FAIL|WAIVED +status_reason: '{{status_reason}}' # 1-2 sentence summary of why this gate decision +reviewer: 'Quinn (Test Architect)' +updated: '{{iso_timestamp}}' # Always present but only active when WAIVED waiver: { active: false } @@ -5375,68 +5023,77 @@ risk_summary: must_fix: [] monitor: [] -# Example with issues: -# top_issues: -# - id: "SEC-001" -# severity: high # ONLY: low|medium|high -# finding: "No rate limiting on login endpoint" -# suggested_action: "Add rate limiting middleware before production" -# - id: "TEST-001" -# severity: medium -# finding: "Missing integration tests for auth flow" -# suggested_action: "Add test coverage for critical paths" +# Examples section using block scalars for clarity +examples: + with_issues: | + top_issues: + - id: "SEC-001" + severity: high # ONLY: low|medium|high + finding: "No rate limiting on login endpoint" + suggested_action: "Add rate limiting middleware before production" + - id: "TEST-001" + severity: medium + finding: "Missing integration tests for auth flow" + suggested_action: "Add test coverage for critical paths" -# Example when waived: -# waiver: -# active: true -# reason: "Accepted for MVP release - will address in next sprint" -# approved_by: "Product Owner" + when_waived: | + waiver: + active: true + reason: "Accepted for MVP release - will address in next sprint" + approved_by: "Product Owner" # ============ Optional Extended Fields ============ # Uncomment and use if your team wants more detail -# quality_score: 75 # 0-100 (optional scoring) -# expires: "2025-01-26T00:00:00Z" # Optional gate freshness window +optional_fields_examples: + quality_and_expiry: | + quality_score: 75 # 0-100 (optional scoring) + expires: "2025-01-26T00:00:00Z" # Optional gate freshness window -# evidence: -# tests_reviewed: 15 -# risks_identified: 3 -# trace: -# ac_covered: [1, 2, 3] # AC numbers with test coverage -# ac_gaps: [4] # AC numbers lacking coverage + evidence: | + evidence: + tests_reviewed: 15 + risks_identified: 3 + trace: + ac_covered: [1, 2, 3] # AC numbers with test coverage + ac_gaps: [4] # AC numbers lacking coverage -# nfr_validation: -# security: { status: CONCERNS, notes: "Rate limiting missing" } -# performance: { status: PASS, notes: "" } -# reliability: { status: PASS, notes: "" } -# maintainability: { status: PASS, notes: "" } + nfr_validation: | + nfr_validation: + security: { status: CONCERNS, notes: "Rate limiting missing" } + performance: { status: PASS, notes: "" } + reliability: { status: PASS, notes: "" } + maintainability: { status: PASS, notes: "" } -# history: # Append-only audit trail -# - at: "2025-01-12T10:00:00Z" -# gate: FAIL -# note: "Initial review - missing tests" -# - at: "2025-01-12T15:00:00Z" -# gate: CONCERNS -# note: "Tests added but rate limiting still missing" + history: | + history: # Append-only audit trail + - at: "2025-01-12T10:00:00Z" + gate: FAIL + note: "Initial review - missing tests" + - at: "2025-01-12T15:00:00Z" + gate: CONCERNS + note: "Tests added but rate limiting still missing" -# risk_summary: # From risk-profile task -# totals: -# critical: 0 -# high: 0 -# medium: 0 -# low: 0 -# # 'highest' is emitted only when risks exist -# recommendations: -# must_fix: [] -# monitor: [] + risk_summary: | + risk_summary: # From risk-profile task + totals: + critical: 0 + high: 0 + medium: 0 + low: 0 + # 'highest' is emitted only when risks exist + recommendations: + must_fix: [] + monitor: [] -# recommendations: -# immediate: # Must fix before production -# - action: "Add rate limiting to auth endpoints" -# refs: ["api/auth/login.ts:42-68"] -# future: # Can be addressed later -# - action: "Consider caching for better performance" -# refs: ["services/data.service.ts"] + recommendations: | + recommendations: + immediate: # Must fix before production + - action: "Add rate limiting to auth endpoints" + refs: ["api/auth/login.ts:42-68"] + future: # Can be addressed later + - action: "Consider caching for better performance" + refs: ["services/data.service.ts"] ==================== END: .bmad-core/templates/qa-gate-tmpl.yaml ==================== ==================== START: .bmad-core/data/technical-preferences.md ==================== diff --git a/dist/teams/team-no-ui.txt b/dist/teams/team-no-ui.txt index 0e8dcfb3..15717063 100644 --- a/dist/teams/team-no-ui.txt +++ b/dist/teams/team-no-ui.txt @@ -1044,7 +1044,7 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing - **Claude Code**: `/agent-name` (e.g., `/bmad-master`) - **Cursor**: `@agent-name` (e.g., `@bmad-master`) -- **Windsurf**: `@agent-name` (e.g., `@bmad-master`) +- **Windsurf**: `/agent-name` (e.g., `/bmad-master`) - **Trae**: `@agent-name` (e.g., `@bmad-master`) - **Roo Code**: Select mode from mode selector (e.g., `bmad-master`) - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select **Agent** from the chat mode selector. @@ -1784,7 +1784,7 @@ Agents should be workflow-aware: know active workflow, their role, access artifa ==================== START: .bmad-core/tasks/facilitate-brainstorming-session.md ==================== --- docOutputLocation: docs/brainstorming-session-results.md -template: ".bmad-core/templates/brainstorming-output-tmpl.yaml" +template: '.bmad-core/templates/brainstorming-output-tmpl.yaml' --- # Facilitate Brainstorming Session Task @@ -2555,35 +2555,35 @@ template: output: format: markdown filename: docs/brief.md - title: "Project Brief: {{project_name}}" + title: 'Project Brief: {{project_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Project Brief Elicitation Actions" + title: 'Project Brief Elicitation Actions' options: - - "Expand section with more specific details" - - "Validate against similar successful products" - - "Stress test assumptions with edge cases" - - "Explore alternative solution approaches" - - "Analyze resource/constraint trade-offs" - - "Generate risk mitigation strategies" - - "Challenge scope from MVP minimalist view" - - "Brainstorm creative feature possibilities" - - "If only we had [resource/capability/time]..." - - "Proceed to next section" + - 'Expand section with more specific details' + - 'Validate against similar successful products' + - 'Stress test assumptions with edge cases' + - 'Explore alternative solution approaches' + - 'Analyze resource/constraint trade-offs' + - 'Generate risk mitigation strategies' + - 'Challenge scope from MVP minimalist view' + - 'Brainstorm creative feature possibilities' + - 'If only we had [resource/capability/time]...' + - 'Proceed to next section' sections: - id: introduction instruction: | This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - + Start by asking the user which mode they prefer: - + 1. **Interactive Mode** - Work through each section collaboratively 2. **YOLO Mode** - Generate complete draft for review and refinement - + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. - id: executive-summary @@ -2594,7 +2594,7 @@ sections: - Primary problem being solved - Target market identification - Key value proposition - template: "{{executive_summary_content}}" + template: '{{executive_summary_content}}' - id: problem-statement title: Problem Statement @@ -2604,7 +2604,7 @@ sections: - Impact of the problem (quantify if possible) - Why existing solutions fall short - Urgency and importance of solving this now - template: "{{detailed_problem_description}}" + template: '{{detailed_problem_description}}' - id: proposed-solution title: Proposed Solution @@ -2614,7 +2614,7 @@ sections: - Key differentiators from existing solutions - Why this solution will succeed where others haven't - High-level vision for the product - template: "{{solution_description}}" + template: '{{solution_description}}' - id: target-users title: Target Users @@ -2626,12 +2626,12 @@ sections: - Goals they're trying to achieve sections: - id: primary-segment - title: "Primary User Segment: {{segment_name}}" - template: "{{primary_user_description}}" + title: 'Primary User Segment: {{segment_name}}' + template: '{{primary_user_description}}' - id: secondary-segment - title: "Secondary User Segment: {{segment_name}}" + title: 'Secondary User Segment: {{segment_name}}' condition: Has secondary user segment - template: "{{secondary_user_description}}" + template: '{{secondary_user_description}}' - id: goals-metrics title: Goals & Success Metrics @@ -2640,15 +2640,15 @@ sections: - id: business-objectives title: Business Objectives type: bullet-list - template: "- {{objective_with_metric}}" + template: '- {{objective_with_metric}}' - id: user-success-metrics title: User Success Metrics type: bullet-list - template: "- {{user_metric}}" + template: '- {{user_metric}}' - id: kpis title: Key Performance Indicators (KPIs) type: bullet-list - template: "- {{kpi}}: {{definition_and_target}}" + template: '- {{kpi}}: {{definition_and_target}}' - id: mvp-scope title: MVP Scope @@ -2657,14 +2657,14 @@ sections: - id: core-features title: Core Features (Must Have) type: bullet-list - template: "- **{{feature}}:** {{description_and_rationale}}" + template: '- **{{feature}}:** {{description_and_rationale}}' - id: out-of-scope title: Out of Scope for MVP type: bullet-list - template: "- {{feature_or_capability}}" + template: '- {{feature_or_capability}}' - id: mvp-success-criteria title: MVP Success Criteria - template: "{{mvp_success_definition}}" + template: '{{mvp_success_definition}}' - id: post-mvp-vision title: Post-MVP Vision @@ -2672,13 +2672,13 @@ sections: sections: - id: phase-2-features title: Phase 2 Features - template: "{{next_priority_features}}" + template: '{{next_priority_features}}' - id: long-term-vision title: Long-term Vision - template: "{{one_two_year_vision}}" + template: '{{one_two_year_vision}}' - id: expansion-opportunities title: Expansion Opportunities - template: "{{potential_expansions}}" + template: '{{potential_expansions}}' - id: technical-considerations title: Technical Considerations @@ -2719,7 +2719,7 @@ sections: - id: key-assumptions title: Key Assumptions type: bullet-list - template: "- {{assumption}}" + template: '- {{assumption}}' - id: risks-questions title: Risks & Open Questions @@ -2728,15 +2728,15 @@ sections: - id: key-risks title: Key Risks type: bullet-list - template: "- **{{risk}}:** {{description_and_impact}}" + template: '- **{{risk}}:** {{description_and_impact}}' - id: open-questions title: Open Questions type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: research-areas title: Areas Needing Further Research type: bullet-list - template: "- {{research_topic}}" + template: '- {{research_topic}}' - id: appendices title: Appendices @@ -2753,10 +2753,10 @@ sections: - id: stakeholder-input title: B. Stakeholder Input condition: Has stakeholder feedback - template: "{{stakeholder_feedback}}" + template: '{{stakeholder_feedback}}' - id: references title: C. References - template: "{{relevant_links_and_docs}}" + template: '{{relevant_links_and_docs}}' - id: next-steps title: Next Steps @@ -2764,7 +2764,7 @@ sections: - id: immediate-actions title: Immediate Actions type: numbered-list - template: "{{action_item}}" + template: '{{action_item}}' - id: pm-handoff title: PM Handoff content: | @@ -2779,24 +2779,24 @@ template: output: format: markdown filename: docs/market-research.md - title: "Market Research Report: {{project_product_name}}" + title: 'Market Research Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Market Research Elicitation Actions" + title: 'Market Research Elicitation Actions' options: - - "Expand market sizing calculations with sensitivity analysis" - - "Deep dive into a specific customer segment" - - "Analyze an emerging market trend in detail" - - "Compare this market to an analogous market" - - "Stress test market assumptions" - - "Explore adjacent market opportunities" - - "Challenge market definition and boundaries" - - "Generate strategic scenarios (best/base/worst case)" - - "If only we had considered [X market factor]..." - - "Proceed to next section" + - 'Expand market sizing calculations with sensitivity analysis' + - 'Deep dive into a specific customer segment' + - 'Analyze an emerging market trend in detail' + - 'Compare this market to an analogous market' + - 'Stress test market assumptions' + - 'Explore adjacent market opportunities' + - 'Challenge market definition and boundaries' + - 'Generate strategic scenarios (best/base/worst case)' + - 'If only we had considered [X market factor]...' + - 'Proceed to next section' sections: - id: executive-summary @@ -2878,7 +2878,7 @@ sections: repeatable: true sections: - id: segment - title: "Segment {{segment_number}}: {{segment_name}}" + title: 'Segment {{segment_number}}: {{segment_name}}' template: | - **Description:** {{brief_overview}} - **Size:** {{number_of_customers_market_value}} @@ -2904,7 +2904,7 @@ sections: instruction: Map the end-to-end customer experience for primary segments template: | For primary customer segment: - + 1. **Awareness:** {{discovery_process}} 2. **Consideration:** {{evaluation_criteria}} 3. **Purchase:** {{decision_triggers}} @@ -2947,20 +2947,20 @@ sections: instruction: Analyze each force with specific evidence and implications sections: - id: supplier-power - title: "Supplier Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Supplier Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: buyer-power - title: "Buyer Power: {{power_level}}" - template: "{{analysis_and_implications}}" + title: 'Buyer Power: {{power_level}}' + template: '{{analysis_and_implications}}' - id: competitive-rivalry - title: "Competitive Rivalry: {{intensity_level}}" - template: "{{analysis_and_implications}}" + title: 'Competitive Rivalry: {{intensity_level}}' + template: '{{analysis_and_implications}}' - id: threat-new-entry - title: "Threat of New Entry: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of New Entry: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: threat-substitutes - title: "Threat of Substitutes: {{threat_level}}" - template: "{{analysis_and_implications}}" + title: 'Threat of Substitutes: {{threat_level}}' + template: '{{analysis_and_implications}}' - id: adoption-lifecycle title: Technology Adoption Lifecycle Stage instruction: | @@ -2978,7 +2978,7 @@ sections: repeatable: true sections: - id: opportunity - title: "Opportunity {{opportunity_number}}: {{name}}" + title: 'Opportunity {{opportunity_number}}: {{name}}' template: | - **Description:** {{what_is_the_opportunity}} - **Size/Potential:** {{quantified_potential}} @@ -3034,24 +3034,24 @@ template: output: format: markdown filename: docs/competitor-analysis.md - title: "Competitive Analysis Report: {{project_product_name}}" + title: 'Competitive Analysis Report: {{project_product_name}}' workflow: mode: interactive elicitation: advanced-elicitation custom_elicitation: - title: "Competitive Analysis Elicitation Actions" + title: 'Competitive Analysis Elicitation Actions' options: - "Deep dive on a specific competitor's strategy" - - "Analyze competitive dynamics in a specific segment" - - "War game competitive responses to your moves" - - "Explore partnership vs. competition scenarios" - - "Stress test differentiation claims" - - "Analyze disruption potential (yours or theirs)" - - "Compare to competition in adjacent markets" - - "Generate win/loss analysis insights" + - 'Analyze competitive dynamics in a specific segment' + - 'War game competitive responses to your moves' + - 'Explore partnership vs. competition scenarios' + - 'Stress test differentiation claims' + - 'Analyze disruption potential (yours or theirs)' + - 'Compare to competition in adjacent markets' + - 'Generate win/loss analysis insights' - "If only we had known about [competitor X's plan]..." - - "Proceed to next section" + - 'Proceed to next section' sections: - id: executive-summary @@ -3105,7 +3105,7 @@ sections: title: Competitor Prioritization Matrix instruction: | Help categorize competitors by market share and strategic threat level - + Create a 2x2 matrix: - Priority 1 (Core Competitors): High Market Share + High Threat - Priority 2 (Emerging Threats): Low Market Share + High Threat @@ -3118,7 +3118,7 @@ sections: repeatable: true sections: - id: competitor - title: "{{competitor_name}} - Priority {{priority_level}}" + title: '{{competitor_name}} - Priority {{priority_level}}' sections: - id: company-overview title: Company Overview @@ -3150,11 +3150,11 @@ sections: - id: strengths title: Strengths type: bullet-list - template: "- {{strength}}" + template: '- {{strength}}' - id: weaknesses title: Weaknesses type: bullet-list - template: "- {{weakness}}" + template: '- {{weakness}}' - id: market-position title: Market Position & Performance template: | @@ -3170,24 +3170,37 @@ sections: title: Feature Comparison Matrix instruction: Create a detailed comparison table of key features across competitors type: table - columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + columns: + [ + 'Feature Category', + '{{your_company}}', + '{{competitor_1}}', + '{{competitor_2}}', + '{{competitor_3}}', + ] rows: - - category: "Core Functionality" + - category: 'Core Functionality' items: - - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] - - category: "User Experience" + - ['Feature A', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - ['Feature B', '{{status}}', '{{status}}', '{{status}}', '{{status}}'] + - category: 'User Experience' items: - - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] - - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] - - category: "Integration & Ecosystem" + - ['Mobile App', '{{rating}}', '{{rating}}', '{{rating}}', '{{rating}}'] + - ['Onboarding Time', '{{time}}', '{{time}}', '{{time}}', '{{time}}'] + - category: 'Integration & Ecosystem' items: - - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] - - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] - - category: "Pricing & Plans" + - [ + 'API Availability', + '{{availability}}', + '{{availability}}', + '{{availability}}', + '{{availability}}', + ] + - ['Third-party Integrations', '{{number}}', '{{number}}', '{{number}}', '{{number}}'] + - category: 'Pricing & Plans' items: - - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] - - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - ['Starting Price', '{{price}}', '{{price}}', '{{price}}', '{{price}}'] + - ['Free Tier', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}', '{{yes_no}}'] - id: swot-comparison title: SWOT Comparison instruction: Create SWOT analysis for your solution vs. top competitors @@ -3200,7 +3213,7 @@ sections: - **Opportunities:** {{opportunities}} - **Threats:** {{threats}} - id: vs-competitor - title: "vs. {{main_competitor}}" + title: 'vs. {{main_competitor}}' template: | - **Competitive Advantages:** {{your_advantages}} - **Competitive Disadvantages:** {{their_advantages}} @@ -3209,7 +3222,7 @@ sections: title: Positioning Map instruction: | Describe competitor positions on key dimensions - + Create a positioning description using 2 key dimensions relevant to the market, such as: - Price vs. Features - Ease of Use vs. Power @@ -3244,7 +3257,7 @@ sections: title: Blue Ocean Opportunities instruction: | Identify uncontested market spaces - + List opportunities to create new market space: - Underserved segments - Unaddressed use cases @@ -3330,7 +3343,7 @@ template: output: format: markdown filename: docs/brainstorming-session-results.md - title: "Brainstorming Session Results" + title: 'Brainstorming Session Results' workflow: mode: non-interactive @@ -3348,45 +3361,45 @@ sections: - id: summary-details template: | **Topic:** {{session_topic}} - + **Session Goals:** {{stated_goals}} - + **Techniques Used:** {{techniques_list}} - + **Total Ideas Generated:** {{total_ideas}} - id: key-themes - title: "Key Themes Identified:" + title: 'Key Themes Identified:' type: bullet-list - template: "- {{theme}}" + template: '- {{theme}}' - id: technique-sessions title: Technique Sessions repeatable: true sections: - id: technique - title: "{{technique_name}} - {{duration}}" + title: '{{technique_name}} - {{duration}}' sections: - id: description - template: "**Description:** {{technique_description}}" + template: '**Description:** {{technique_description}}' - id: ideas-generated - title: "Ideas Generated:" + title: 'Ideas Generated:' type: numbered-list - template: "{{idea}}" + template: '{{idea}}' - id: insights - title: "Insights Discovered:" + title: 'Insights Discovered:' type: bullet-list - template: "- {{insight}}" + template: '- {{insight}}' - id: connections - title: "Notable Connections:" + title: 'Notable Connections:' type: bullet-list - template: "- {{connection}}" + template: '- {{connection}}' - id: idea-categorization title: Idea Categorization sections: - id: immediate-opportunities title: Immediate Opportunities - content: "*Ideas ready to implement now*" + content: '*Ideas ready to implement now*' repeatable: true type: numbered-list template: | @@ -3396,7 +3409,7 @@ sections: - Resources needed: {{requirements}} - id: future-innovations title: Future Innovations - content: "*Ideas requiring development/research*" + content: '*Ideas requiring development/research*' repeatable: true type: numbered-list template: | @@ -3406,7 +3419,7 @@ sections: - Timeline estimate: {{timeline}} - id: moonshots title: Moonshots - content: "*Ambitious, transformative concepts*" + content: '*Ambitious, transformative concepts*' repeatable: true type: numbered-list template: | @@ -3416,9 +3429,9 @@ sections: - Challenges to overcome: {{challenges}} - id: insights-learnings title: Insights & Learnings - content: "*Key realizations from the session*" + content: '*Key realizations from the session*' type: bullet-list - template: "- {{insight}}: {{description_and_implications}}" + template: '- {{insight}}: {{description_and_implications}}' - id: action-planning title: Action Planning @@ -3427,21 +3440,21 @@ sections: title: Top 3 Priority Ideas sections: - id: priority-1 - title: "#1 Priority: {{idea_name}}" + title: '#1 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-2 - title: "#2 Priority: {{idea_name}}" + title: '#2 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} - Resources needed: {{resources}} - Timeline: {{timeline}} - id: priority-3 - title: "#3 Priority: {{idea_name}}" + title: '#3 Priority: {{idea_name}}' template: | - Rationale: {{rationale}} - Next steps: {{next_steps}} @@ -3454,19 +3467,19 @@ sections: - id: what-worked title: What Worked Well type: bullet-list - template: "- {{aspect}}" + template: '- {{aspect}}' - id: areas-exploration title: Areas for Further Exploration type: bullet-list - template: "- {{area}}: {{reason}}" + template: '- {{area}}: {{reason}}' - id: recommended-techniques title: Recommended Follow-up Techniques type: bullet-list - template: "- {{technique}}: {{reason}}" + template: '- {{technique}}: {{reason}}' - id: questions-emerged title: Questions That Emerged type: bullet-list - template: "- {{question}}" + template: '- {{question}}' - id: next-session title: Next Session Planning template: | @@ -3477,7 +3490,7 @@ sections: - id: footer content: | --- - + *Session facilitated using the BMAD-METHOD brainstorming framework* ==================== END: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== @@ -4191,7 +4204,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Product Requirements Document (PRD)" + title: '{{project_name}} Product Requirements Document (PRD)' workflow: mode: interactive @@ -4228,21 +4241,21 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR examples: - - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." + - 'FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR examples: - - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." + - 'NFR1: AWS service usage must aim to stay within free-tier limits where feasible.' - id: ui-goals title: User Interface Design Goals condition: PRD has UX/UI requirements instruction: | Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - + 1. Pre-fill all subsections with educated guesses based on project context 2. Present the complete rendered section to user 3. Clearly let the user know where assumptions were made @@ -4261,30 +4274,30 @@ sections: title: Core Screens and Views instruction: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories examples: - - "Login Screen" - - "Main Dashboard" - - "Item Detail Page" - - "Settings Page" + - 'Login Screen' + - 'Main Dashboard' + - 'Item Detail Page' + - 'Settings Page' - id: accessibility - title: "Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}" + title: 'Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}' - id: branding title: Branding instruction: Any known branding elements or style guides that must be incorporated? examples: - - "Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions." - - "Attached is the full color pallet and tokens for our corporate branding." + - 'Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions.' + - 'Attached is the full color pallet and tokens for our corporate branding.' - id: target-platforms - title: "Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}" + title: 'Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}' examples: - - "Web Responsive, and all mobile platforms" - - "iPhone Only" - - "ASCII Windows Desktop" + - 'Web Responsive, and all mobile platforms' + - 'iPhone Only' + - 'ASCII Windows Desktop' - id: technical-assumptions title: Technical Assumptions instruction: | Gather technical decisions that will guide the Architect. Steps: - + 1. Check if .bmad-core/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets 3. For unknowns, offer guidance based on project goals and MVP scope @@ -4297,13 +4310,13 @@ sections: testing: [Unit Only, Unit + Integration, Full Testing Pyramid] sections: - id: repository-structure - title: "Repository Structure: {Monorepo|Polyrepo|Multi-repo}" + title: 'Repository Structure: {Monorepo|Polyrepo|Multi-repo}' - id: service-architecture title: Service Architecture - instruction: "CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo)." + instruction: 'CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).' - id: testing-requirements title: Testing Requirements - instruction: "CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods)." + instruction: 'CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).' - id: additional-assumptions title: Additional Technical Assumptions and Requests instruction: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items @@ -4312,9 +4325,9 @@ sections: title: Epic List instruction: | Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - + CRITICAL: Epics MUST be logically sequential following agile best practices: - + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed @@ -4323,21 +4336,21 @@ sections: - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. elicit: true examples: - - "Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management" - - "Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations" - - "Epic 3: User Workflows & Interactions: Enable key user journeys and business processes" - - "Epic 4: Reporting & Analytics: Provide insights and data visualization for users" + - 'Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management' + - 'Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations' + - 'Epic 3: User Workflows & Interactions: Enable key user journeys and business processes' + - 'Epic 4: Reporting & Analytics: Provide insights and data visualization for users' - id: epic-details title: Epic {{epic_number}} {{epic_title}} repeatable: true instruction: | After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. - + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). - + CRITICAL STORY SEQUENCING REQUIREMENTS: - + - Stories within each epic MUST be logically sequential - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation - No story should depend on work from a later story or epic @@ -4348,7 +4361,7 @@ sections: - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained - If a story seems complex, break it down further as long as it can deliver a vertical slice elicit: true - template: "{{epic_goal}}" + template: '{{epic_goal}}' sections: - id: story title: Story {{epic_number}}.{{story_number}} {{story_title}} @@ -4361,11 +4374,11 @@ sections: - id: acceptance-criteria title: Acceptance Criteria type: numbered-list - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' repeatable: true instruction: | Define clear, comprehensive, and testable acceptance criteria that: - + - Precisely define what "done" means from a functional perspective - Are unambiguous and serve as basis for verification - Include any critical non-functional requirements from the PRD @@ -4396,7 +4409,7 @@ template: output: format: markdown filename: docs/prd.md - title: "{{project_name}} Brownfield Enhancement PRD" + title: '{{project_name}} Brownfield Enhancement PRD' workflow: mode: interactive @@ -4407,19 +4420,19 @@ sections: title: Intro Project Analysis and Context instruction: | IMPORTANT - SCOPE ASSESSMENT REQUIRED: - + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. - + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - + Do not proceed with any recommendations until the user has validated your understanding of the existing system. sections: - id: existing-project-overview @@ -4445,7 +4458,7 @@ sections: - Note: "Document-project analysis available - using existing technical documentation" - List key documents created by document-project - Skip the missing documentation check below - + Otherwise, check for existing documentation: sections: - id: available-docs @@ -4459,7 +4472,7 @@ sections: - External API Documentation [[LLM: If from document-project, check ✓]] - UX/UI Guidelines [[LLM: May not be in document-project]] - Technical Debt Documentation [[LLM: If from document-project, check ✓]] - - "Other: {{other_docs}}" + - 'Other: {{other_docs}}' instruction: | - If document-project was already run: "Using existing project analysis from document-project output." - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." @@ -4479,7 +4492,7 @@ sections: - UI/UX Overhaul - Technology Stack Upgrade - Bug Fix and Stability Improvements - - "Other: {{other_type}}" + - 'Other: {{other_type}}' - id: enhancement-description title: Enhancement Description instruction: 2-3 sentences describing what the user wants to add or change @@ -4520,29 +4533,29 @@ sections: prefix: FR instruction: Each Requirement will be a bullet markdown with identifier starting with FR examples: - - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - 'FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.' - id: non-functional title: Non Functional type: numbered-list prefix: NFR instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system examples: - - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - 'NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.' - id: compatibility title: Compatibility Requirements instruction: Critical for brownfield - what must remain compatible type: numbered-list prefix: CR - template: "{{requirement}}: {{description}}" + template: '{{requirement}}: {{description}}' items: - id: cr1 - template: "CR1: {{existing_api_compatibility}}" + template: 'CR1: {{existing_api_compatibility}}' - id: cr2 - template: "CR2: {{database_schema_compatibility}}" + template: 'CR2: {{database_schema_compatibility}}' - id: cr3 - template: "CR3: {{ui_ux_consistency}}" + template: 'CR3: {{ui_ux_consistency}}' - id: cr4 - template: "CR4: {{integration_compatibility}}" + template: 'CR4: {{integration_compatibility}}' - id: ui-enhancement-goals title: User Interface Enhancement Goals @@ -4569,7 +4582,7 @@ sections: If document-project output available: - Extract from "Actual Tech Stack" table in High Level Architecture section - Include version numbers and any noted constraints - + Otherwise, document the current technology stack: template: | **Languages**: {{languages}} @@ -4608,7 +4621,7 @@ sections: - Reference "Technical Debt and Known Issues" section - Include "Workarounds and Gotchas" that might impact enhancement - Note any identified constraints from "Critical Technical Debt" - + Build risk assessment incorporating existing known issues: template: | **Technical Risks**: {{technical_risks}} @@ -4625,13 +4638,13 @@ sections: - id: epic-approach title: Epic Approach instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features - template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + template: '**Epic Structure Decision**: {{epic_decision}} with rationale' - id: epic-details - title: "Epic 1: {{enhancement_title}}" + title: 'Epic 1: {{enhancement_title}}' instruction: | Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality - + CRITICAL STORY SEQUENCING FOR BROWNFIELD: - Stories must ensure existing functionality remains intact - Each story should include verification that existing features still work @@ -4644,11 +4657,11 @@ sections: - Each story must deliver value while maintaining system integrity template: | **Epic Goal**: {{epic_goal}} - + **Integration Requirements**: {{integration_requirements}} sections: - id: story - title: "Story 1.{{story_number}} {{story_title}}" + title: 'Story 1.{{story_number}} {{story_title}}' repeatable: true template: | As a {{user_type}}, @@ -4659,16 +4672,16 @@ sections: title: Acceptance Criteria type: numbered-list instruction: Define criteria that include both new functionality and existing system integrity - item_template: "{{criterion_number}}: {{criteria}}" + item_template: '{{criterion_number}}: {{criteria}}' - id: integration-verification title: Integration Verification instruction: Specific verification steps to ensure existing functionality remains intact type: numbered-list prefix: IV items: - - template: "IV1: {{existing_functionality_verification}}" - - template: "IV2: {{integration_point_verification}}" - - template: "IV3: {{performance_impact_verification}}" + - template: 'IV1: {{existing_functionality_verification}}' + - template: 'IV2: {{integration_point_verification}}' + - template: 'IV3: {{performance_impact_verification}}' ==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/pm-checklist.md ==================== @@ -5243,7 +5256,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Architecture Document" + title: '{{project_name}} Architecture Document' workflow: mode: interactive @@ -5258,20 +5271,20 @@ sections: - id: intro-content content: | This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - + **Relationship to Frontend Architecture:** If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - + 1. Review the PRD and brainstorming brief for any mentions of: - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) - Existing projects or codebases being used as a foundation - Boilerplate projects or scaffolding tools - Previous projects to be cloned or adapted - + 2. If a starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -5284,16 +5297,16 @@ sections: - Existing architectural patterns and conventions - Any limitations or constraints imposed by the starter - Use this analysis to inform and align your architecture decisions - + 3. If no starter template is mentioned but this is a greenfield project: - Suggest appropriate starter templates based on the tech stack preferences - Explain the benefits (faster setup, best practices, community support) - Let the user decide whether to use one - + 4. If the user confirms no starter template will be used: - Proceed with architecture design from scratch - Note that manual setup will be required for all tooling and configuration - + Document the decision here before proceeding with the architecture design. If none, just say N/A elicit: true - id: changelog @@ -5321,7 +5334,7 @@ sections: title: High Level Overview instruction: | Based on the PRD's Technical Assumptions section, describe: - + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) 2. Repository structure decision from PRD (Monorepo/Polyrepo) 3. Service architecture decision from PRD @@ -5338,49 +5351,49 @@ sections: - Data flow directions - External integrations - User entry points - + - id: architectural-patterns title: Architectural and Design Patterns instruction: | List the key high-level patterns that will guide the architecture. For each pattern: - + 1. Present 2-3 viable options if multiple exist 2. Provide your recommendation with clear rationale 3. Get user confirmation before finalizing 4. These patterns should align with the PRD's technical assumptions and project goals - + Common patterns to consider: - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) - Code organization patterns (Dependency Injection, Repository, Module, Factory) - Data patterns (Event Sourcing, Saga, Database per Service) - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + - '**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences 2. For each category, present 2-3 viable options with pros/cons 3. Make a clear recommendation based on project needs 4. Get explicit user approval for each selection 5. Document exact versions (avoid "latest" - pin specific versions) 6. This table is the single source of truth - all other docs must reference these choices - + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - + - Starter templates (if any) - Languages and runtimes with exact versions - Frameworks and libraries / packages - Cloud provider and key services choices - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion - Development tools - + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. elicit: true sections: @@ -5396,34 +5409,34 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Populate the technology stack table with all relevant technologies examples: - - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" - - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" - - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + - '| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |' + - '| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |' + - '| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |' - id: data-models title: Data Models instruction: | Define the core data models/entities: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - {{relationship_1}} - {{relationship_2}} @@ -5432,7 +5445,7 @@ sections: title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services and their responsibilities 2. Consider the repository structure (monorepo/polyrepo) from PRD 3. Define clear boundaries and interfaces between components @@ -5441,22 +5454,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -5473,29 +5486,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -5504,13 +5517,13 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include error handling paths 4. Document async operations 5. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -5521,13 +5534,13 @@ sections: language: yaml instruction: | If the project includes a REST API: - + 1. Create an OpenAPI 3.0 specification 2. Include all endpoints from epics/stories 3. Define request/response schemas based on data models 4. Document authentication requirements 5. Include example requests/responses - + Use YAML format for better readability. If no REST API, skip this section. elicit: true template: | @@ -5544,13 +5557,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -5560,14 +5573,14 @@ sections: language: plaintext instruction: | Create a project folder structure that reflects: - + 1. The chosen repository structure (monorepo/polyrepo) 2. The service architecture (monolith/microservices/serverless) 3. The selected tech stack and languages 4. Component organization from above 5. Best practices for the chosen frameworks 6. Clear separation of concerns - + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. elicit: true examples: @@ -5585,13 +5598,13 @@ sections: title: Infrastructure and Deployment instruction: | Define the deployment architecture and practices: - + 1. Use IaC tool selected in Tech Stack 2. Choose deployment strategy appropriate for the architecture 3. Define environments and promotion flow 4. Establish rollback procedures 5. Consider security, monitoring, and cost optimization - + Get user input on deployment preferences and CI/CD tool choices. elicit: true sections: @@ -5610,12 +5623,12 @@ sections: - id: environments title: Environments repeatable: true - template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + template: '- **{{env_name}}:** {{env_purpose}} - {{env_details}}' - id: promotion-flow title: Environment Promotion Flow type: code language: text - template: "{{promotion_flow_diagram}}" + template: '{{promotion_flow_diagram}}' - id: rollback-strategy title: Rollback Strategy template: | @@ -5627,13 +5640,13 @@ sections: title: Error Handling Strategy instruction: | Define comprehensive error handling approach: - + 1. Choose appropriate patterns for the language/framework from Tech Stack 2. Define logging standards and tools 3. Establish error categories and handling rules 4. Consider observability and debugging needs 5. Ensure security (no sensitive data in logs) - + This section guides both AI and human developers in consistent error handling. elicit: true sections: @@ -5680,13 +5693,13 @@ sections: title: Coding Standards instruction: | These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - + 1. This section directly controls AI developer behavior 2. Keep it minimal - assume AI knows general best practices 3. Focus on project-specific conventions and gotchas 4. Overly detailed standards bloat context and slow development 5. Standards will be extracted to separate file for dev agent use - + For each standard, get explicit user confirmation it's necessary. elicit: true sections: @@ -5708,32 +5721,32 @@ sections: - "Never use console.log in production code - use logger" - "All API responses must use ApiResponse wrapper type" - "Database queries must use repository pattern, never direct ORM" - + Avoid obvious rules like "use SOLID principles" or "write clean code" repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' - id: language-specifics title: Language-Specific Guidelines condition: Critical language-specific rules needed instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. sections: - id: language-rules - title: "{{language_name}} Specifics" + title: '{{language_name}} Specifics' repeatable: true - template: "- **{{rule_topic}}:** {{rule_detail}}" + template: '- **{{rule_topic}}:** {{rule_detail}}' - id: test-strategy title: Test Strategy and Standards instruction: | Work with user to define comprehensive test strategy: - + 1. Use test frameworks from Tech Stack 2. Decide on TDD vs test-after approach 3. Define test organization and naming 4. Establish coverage goals 5. Determine integration test infrastructure 6. Plan for test data and external dependencies - + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. elicit: true sections: @@ -5754,7 +5767,7 @@ sections: - **Location:** {{unit_test_location}} - **Mocking Library:** {{mocking_library}} - **Coverage Requirement:** {{unit_coverage}} - + **AI Agent Requirements:** - Generate tests for all public methods - Cover edge cases and error conditions @@ -5768,9 +5781,9 @@ sections: - **Test Infrastructure:** - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) examples: - - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" - - "**Message Queue:** Embedded Kafka for tests" - - "**External APIs:** WireMock for stubbing" + - '**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration' + - '**Message Queue:** Embedded Kafka for tests' + - '**External APIs:** WireMock for stubbing' - id: e2e-tests title: End-to-End Tests template: | @@ -5796,7 +5809,7 @@ sections: title: Security instruction: | Define MANDATORY security requirements for AI and human developers: - + 1. Focus on implementation-specific rules 2. Reference security tools from Tech Stack 3. Define clear patterns for common scenarios @@ -5865,16 +5878,16 @@ sections: title: Next Steps instruction: | After completing the architecture: - + 1. If project has UI components: - Use "Frontend Architecture Mode" - Provide this document as input - + 2. For all projects: - Review with Product Owner - Begin story implementation with Dev agent - Set up infrastructure with DevOps agent - + 3. Include specific prompts for next agents if needed sections: - id: architect-prompt @@ -5896,7 +5909,7 @@ template: output: format: markdown filename: docs/ui-architecture.md - title: "{{project_name}} Frontend Architecture Document" + title: '{{project_name}} Frontend Architecture Document' workflow: mode: interactive @@ -5907,16 +5920,16 @@ sections: title: Template and Framework Selection instruction: | Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. - + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - UI kit or component library starters - Existing frontend projects being used as a foundation - Admin dashboard templates or other specialized starters - Design system implementations - + 2. If a frontend starter template or existing project is mentioned: - Ask the user to provide access via one of these methods: - Link to the starter template documentation @@ -5932,7 +5945,7 @@ sections: - Testing setup and patterns - Build and development scripts - Use this analysis to ensure your frontend architecture aligns with the starter's patterns - + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - Based on the framework choice, suggest appropriate starters: - React: Create React App, Next.js, Vite + React @@ -5940,11 +5953,11 @@ sections: - Angular: Angular CLI - Or suggest popular UI templates if applicable - Explain benefits specific to frontend development - + 4. If the user confirms no starter template will be used: - Note that all tooling, bundling, and configuration will need manual setup - Proceed with frontend architecture from scratch - + Document the starter template decision and any constraints it imposes before proceeding. sections: - id: changelog @@ -5964,17 +5977,29 @@ sections: columns: [Category, Technology, Version, Purpose, Rationale] instruction: Fill in appropriate technology choices based on the selected framework and project requirements. rows: - - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Framework', '{{framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['UI Library', '{{ui_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'State Management', + '{{state_management}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Routing', '{{routing_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Styling', '{{styling_solution}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Testing', '{{test_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Component Library', + '{{component_lib}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['Form Handling', '{{form_library}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Animation', '{{animation_lib}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Dev Tools', '{{dev_tools}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: project-structure title: Project Structure @@ -6068,12 +6093,12 @@ sections: title: Testing Best Practices type: numbered-list items: - - "**Unit Tests**: Test individual components in isolation" - - "**Integration Tests**: Test component interactions" - - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" - - "**Coverage Goals**: Aim for 80% code coverage" - - "**Test Structure**: Arrange-Act-Assert pattern" - - "**Mock External Dependencies**: API calls, routing, state management" + - '**Unit Tests**: Test individual components in isolation' + - '**Integration Tests**: Test component interactions' + - '**E2E Tests**: Test critical user flows (using Cypress/Playwright)' + - '**Coverage Goals**: Aim for 80% code coverage' + - '**Test Structure**: Arrange-Act-Assert pattern' + - '**Mock External Dependencies**: API calls, routing, state management' - id: environment-configuration title: Environment Configuration @@ -6105,7 +6130,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Fullstack Architecture Document" + title: '{{project_name}} Fullstack Architecture Document' workflow: mode: interactive @@ -6119,33 +6144,33 @@ sections: elicit: true content: | This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. sections: - id: starter-template title: Starter Template or Existing Project instruction: | Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - + 1. Review the PRD and other documents for mentions of: - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) - Monorepo templates (e.g., Nx, Turborepo starters) - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) - Existing projects being extended or cloned - + 2. If starter templates or existing projects are mentioned: - Ask the user to provide access (links, repos, or files) - Analyze to understand pre-configured choices and constraints - Note any architectural decisions already made - Identify what can be modified vs what must be retained - + 3. If no starter is mentioned but this is greenfield: - Suggest appropriate fullstack starters based on tech preferences - Consider platform-specific options (Vercel, AWS, etc.) - Let user decide whether to use one - + 4. Document the decision and any constraints it imposes - + If none, state "N/A - Greenfield project" - id: changelog title: Change Log @@ -6171,17 +6196,17 @@ sections: title: Platform and Infrastructure Choice instruction: | Based on PRD requirements and technical assumptions, make a platform recommendation: - + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - **Azure**: For .NET ecosystems or enterprise Microsoft environments - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - + 2. Present 2-3 viable options with clear pros/cons 3. Make a recommendation with rationale 4. Get explicit user confirmation - + Document the choice and key services that will be used. template: | **Platform:** {{selected_platform}} @@ -6191,7 +6216,7 @@ sections: title: Repository Structure instruction: | Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: - + 1. For modern fullstack apps, monorepo is often preferred 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) 3. Define package/app boundaries @@ -6213,7 +6238,7 @@ sections: - Databases and storage - External integrations - CDN and caching layers - + Use appropriate diagram type for clarity. - id: architectural-patterns title: Architectural Patterns @@ -6223,21 +6248,21 @@ sections: - Frontend patterns (e.g., Component-based, State management) - Backend patterns (e.g., Repository, CQRS, Event-driven) - Integration patterns (e.g., BFF, API Gateway) - + For each pattern, provide recommendation and rationale. repeatable: true - template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + template: '- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}' examples: - - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" - - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" - - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" - - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + - '**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications' + - '**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases' + - '**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility' + - '**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring' - id: tech-stack title: Tech Stack instruction: | This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - + Key areas to cover: - Frontend and backend languages/frameworks - Databases and caching @@ -6246,7 +6271,7 @@ sections: - Testing tools for both frontend and backend - Build and deployment tools - Monitoring and logging - + Upon render, elicit feedback immediately. elicit: true sections: @@ -6255,49 +6280,67 @@ sections: type: table columns: [Category, Technology, Version, Purpose, Rationale] rows: - - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] - - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ['Frontend Language', '{{fe_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Frontend Framework', + '{{fe_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - [ + 'UI Component Library', + '{{ui_library}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['State Management', '{{state_mgmt}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Language', '{{be_language}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - [ + 'Backend Framework', + '{{be_framework}}', + '{{version}}', + '{{purpose}}', + '{{why_chosen}}', + ] + - ['API Style', '{{api_style}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Database', '{{database}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Cache', '{{cache}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['File Storage', '{{storage}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Authentication', '{{auth}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Frontend Testing', '{{fe_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Backend Testing', '{{be_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['E2E Testing', '{{e2e_test}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Build Tool', '{{build_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Bundler', '{{bundler}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['IaC Tool', '{{iac_tool}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CI/CD', '{{cicd}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Monitoring', '{{monitoring}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['Logging', '{{logging}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] + - ['CSS Framework', '{{css_framework}}', '{{version}}', '{{purpose}}', '{{why_chosen}}'] - id: data-models title: Data Models instruction: | Define the core data models/entities that will be shared between frontend and backend: - + 1. Review PRD requirements and identify key business entities 2. For each model, explain its purpose and relationships 3. Include key attributes and data types 4. Show relationships between models 5. Create TypeScript interfaces that can be shared 6. Discuss design decisions with user - + Create a clear conceptual model before moving to database schema. elicit: true repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} @@ -6306,17 +6349,17 @@ sections: title: TypeScript Interface type: code language: typescript - template: "{{model_interface}}" + template: '{{model_interface}}' - id: relationships title: Relationships type: bullet-list - template: "- {{relationship}}" + template: '- {{relationship}}' - id: api-spec title: API Specification instruction: | Based on the chosen API style from Tech Stack: - + 1. If REST API, create an OpenAPI 3.0 specification 2. If GraphQL, provide the GraphQL schema 3. If tRPC, show router definitions @@ -6324,7 +6367,7 @@ sections: 5. Define request/response schemas based on data models 6. Document authentication requirements 7. Include example requests/responses - + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. elicit: true sections: @@ -6347,19 +6390,19 @@ sections: condition: API style is GraphQL type: code language: graphql - template: "{{graphql_schema}}" + template: '{{graphql_schema}}' - id: trpc-api title: tRPC Router Definitions condition: API style is tRPC type: code language: typescript - template: "{{trpc_routers}}" + template: '{{trpc_routers}}' - id: components title: Components instruction: | Based on the architectural patterns, tech stack, and data models from above: - + 1. Identify major logical components/services across the fullstack 2. Consider both frontend and backend components 3. Define clear boundaries and interfaces between components @@ -6368,22 +6411,22 @@ sections: - Key interfaces/APIs exposed - Dependencies on other components - Technology specifics based on tech stack choices - + 5. Create component diagrams where helpful elicit: true sections: - id: component-list repeatable: true - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** {{dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: component-diagrams title: Component Diagrams @@ -6400,29 +6443,29 @@ sections: condition: Project requires external API integrations instruction: | For each external service integration: - + 1. Identify APIs needed based on PRD requirements and component design 2. If documentation URLs are unknown, ask user for specifics 3. Document authentication methods and security considerations 4. List specific endpoints that will be used 5. Note any rate limits or usage constraints - + If no external APIs are needed, state this explicitly and skip to next section. elicit: true repeatable: true sections: - id: api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL(s):** {{api_base_url}} - **Authentication:** {{auth_method}} - **Rate Limits:** {{rate_limits}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Integration Notes:** {{integration_considerations}} - id: core-workflows @@ -6431,14 +6474,14 @@ sections: mermaid_type: sequence instruction: | Illustrate key system workflows using sequence diagrams: - + 1. Identify critical user journeys from PRD 2. Show component interactions including external APIs 3. Include both frontend and backend flows 4. Include error handling paths 5. Document async operations 6. Create both high-level and detailed diagrams as needed - + Focus on workflows that clarify architecture decisions or complex interactions. elicit: true @@ -6446,13 +6489,13 @@ sections: title: Database Schema instruction: | Transform the conceptual data models into concrete database schemas: - + 1. Use the database type(s) selected in Tech Stack 2. Create schema definitions using appropriate notation 3. Include indexes, constraints, and relationships 4. Consider performance and scalability 5. For NoSQL, show document structures - + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) elicit: true @@ -6469,12 +6512,12 @@ sections: title: Component Organization type: code language: text - template: "{{component_structure}}" + template: '{{component_structure}}' - id: component-template title: Component Template type: code language: typescript - template: "{{component_template}}" + template: '{{component_template}}' - id: state-management title: State Management Architecture instruction: Detail state management approach based on chosen solution. @@ -6483,11 +6526,11 @@ sections: title: State Structure type: code language: typescript - template: "{{state_structure}}" + template: '{{state_structure}}' - id: state-patterns title: State Management Patterns type: bullet-list - template: "- {{pattern}}" + template: '- {{pattern}}' - id: routing-architecture title: Routing Architecture instruction: Define routing structure based on framework choice. @@ -6496,12 +6539,12 @@ sections: title: Route Organization type: code language: text - template: "{{route_structure}}" + template: '{{route_structure}}' - id: protected-routes title: Protected Route Pattern type: code language: typescript - template: "{{protected_route_example}}" + template: '{{protected_route_example}}' - id: frontend-services title: Frontend Services Layer instruction: Define how frontend communicates with backend. @@ -6510,12 +6553,12 @@ sections: title: API Client Setup type: code language: typescript - template: "{{api_client_setup}}" + template: '{{api_client_setup}}' - id: service-example title: Service Example type: code language: typescript - template: "{{service_example}}" + template: '{{service_example}}' - id: backend-architecture title: Backend Architecture @@ -6533,12 +6576,12 @@ sections: title: Function Organization type: code language: text - template: "{{function_structure}}" + template: '{{function_structure}}' - id: function-template title: Function Template type: code language: typescript - template: "{{function_template}}" + template: '{{function_template}}' - id: traditional-server condition: Traditional server architecture chosen sections: @@ -6546,12 +6589,12 @@ sections: title: Controller/Route Organization type: code language: text - template: "{{controller_structure}}" + template: '{{controller_structure}}' - id: controller-template title: Controller Template type: code language: typescript - template: "{{controller_template}}" + template: '{{controller_template}}' - id: database-architecture title: Database Architecture instruction: Define database schema and access patterns. @@ -6560,12 +6603,12 @@ sections: title: Schema Design type: code language: sql - template: "{{database_schema}}" + template: '{{database_schema}}' - id: data-access-layer title: Data Access Layer type: code language: typescript - template: "{{repository_pattern}}" + template: '{{repository_pattern}}' - id: auth-architecture title: Authentication and Authorization instruction: Define auth implementation details. @@ -6574,12 +6617,12 @@ sections: title: Auth Flow type: mermaid mermaid_type: sequence - template: "{{auth_flow_diagram}}" + template: '{{auth_flow_diagram}}' - id: auth-middleware title: Middleware/Guards type: code language: typescript - template: "{{auth_middleware}}" + template: '{{auth_middleware}}' - id: unified-project-structure title: Unified Project Structure @@ -6588,60 +6631,60 @@ sections: type: code language: plaintext examples: - - | - {{project-name}}/ - ├── .github/ # CI/CD workflows - │ └── workflows/ - │ ├── ci.yaml - │ └── deploy.yaml - ├── apps/ # Application packages - │ ├── web/ # Frontend application - │ │ ├── src/ - │ │ │ ├── components/ # UI components - │ │ │ ├── pages/ # Page components/routes - │ │ │ ├── hooks/ # Custom React hooks - │ │ │ ├── services/ # API client services - │ │ │ ├── stores/ # State management - │ │ │ ├── styles/ # Global styles/themes - │ │ │ └── utils/ # Frontend utilities - │ │ ├── public/ # Static assets - │ │ ├── tests/ # Frontend tests - │ │ └── package.json - │ └── api/ # Backend application - │ ├── src/ - │ │ ├── routes/ # API routes/controllers - │ │ ├── services/ # Business logic - │ │ ├── models/ # Data models - │ │ ├── middleware/ # Express/API middleware - │ │ ├── utils/ # Backend utilities - │ │ └── {{serverless_or_server_entry}} - │ ├── tests/ # Backend tests - │ └── package.json - ├── packages/ # Shared packages - │ ├── shared/ # Shared types/utilities - │ │ ├── src/ - │ │ │ ├── types/ # TypeScript interfaces - │ │ │ ├── constants/ # Shared constants - │ │ │ └── utils/ # Shared utilities - │ │ └── package.json - │ ├── ui/ # Shared UI components - │ │ ├── src/ - │ │ └── package.json - │ └── config/ # Shared configuration - │ ├── eslint/ - │ ├── typescript/ - │ └── jest/ - ├── infrastructure/ # IaC definitions - │ └── {{iac_structure}} - ├── scripts/ # Build/deploy scripts - ├── docs/ # Documentation - │ ├── prd.md - │ ├── front-end-spec.md - │ └── fullstack-architecture.md - ├── .env.example # Environment template - ├── package.json # Root package.json - ├── {{monorepo_config}} # Monorepo configuration - └── README.md + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md - id: development-workflow title: Development Workflow @@ -6655,12 +6698,12 @@ sections: title: Prerequisites type: code language: bash - template: "{{prerequisites_commands}}" + template: '{{prerequisites_commands}}' - id: initial-setup title: Initial Setup type: code language: bash - template: "{{setup_commands}}" + template: '{{setup_commands}}' - id: dev-commands title: Development Commands type: code @@ -6668,13 +6711,13 @@ sections: template: | # Start all services {{start_all_command}} - + # Start frontend only {{start_frontend_command}} - + # Start backend only {{start_backend_command}} - + # Run tests {{test_commands}} - id: environment-config @@ -6687,10 +6730,10 @@ sections: template: | # Frontend (.env.local) {{frontend_env_vars}} - + # Backend (.env) {{backend_env_vars}} - + # Shared {{shared_env_vars}} @@ -6707,7 +6750,7 @@ sections: - **Build Command:** {{frontend_build_command}} - **Output Directory:** {{frontend_output_dir}} - **CDN/Edge:** {{cdn_strategy}} - + **Backend Deployment:** - **Platform:** {{backend_deploy_platform}} - **Build Command:** {{backend_build_command}} @@ -6716,15 +6759,15 @@ sections: title: CI/CD Pipeline type: code language: yaml - template: "{{cicd_pipeline_config}}" + template: '{{cicd_pipeline_config}}' - id: environments title: Environments type: table columns: [Environment, Frontend URL, Backend URL, Purpose] rows: - - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] - - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] - - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + - ['Development', '{{dev_fe_url}}', '{{dev_be_url}}', 'Local development'] + - ['Staging', '{{staging_fe_url}}', '{{staging_be_url}}', 'Pre-production testing'] + - ['Production', '{{prod_fe_url}}', '{{prod_be_url}}', 'Live environment'] - id: security-performance title: Security and Performance @@ -6738,12 +6781,12 @@ sections: - CSP Headers: {{csp_policy}} - XSS Prevention: {{xss_strategy}} - Secure Storage: {{storage_strategy}} - + **Backend Security:** - Input Validation: {{validation_approach}} - Rate Limiting: {{rate_limit_config}} - CORS Policy: {{cors_config}} - + **Authentication Security:** - Token Storage: {{token_strategy}} - Session Management: {{session_approach}} @@ -6755,7 +6798,7 @@ sections: - Bundle Size Target: {{bundle_size}} - Loading Strategy: {{loading_approach}} - Caching Strategy: {{fe_cache_strategy}} - + **Backend Performance:** - Response Time Target: {{response_target}} - Database Optimization: {{db_optimization}} @@ -6771,10 +6814,10 @@ sections: type: code language: text template: | - E2E Tests - / \ - Integration Tests - / \ + E2E Tests + / \ + Integration Tests + / \ Frontend Unit Backend Unit - id: test-organization title: Test Organization @@ -6783,17 +6826,17 @@ sections: title: Frontend Tests type: code language: text - template: "{{frontend_test_structure}}" + template: '{{frontend_test_structure}}' - id: backend-tests title: Backend Tests type: code language: text - template: "{{backend_test_structure}}" + template: '{{backend_test_structure}}' - id: e2e-tests title: E2E Tests type: code language: text - template: "{{e2e_test_structure}}" + template: '{{e2e_test_structure}}' - id: test-examples title: Test Examples sections: @@ -6801,17 +6844,17 @@ sections: title: Frontend Component Test type: code language: typescript - template: "{{frontend_test_example}}" + template: '{{frontend_test_example}}' - id: backend-test title: Backend API Test type: code language: typescript - template: "{{backend_test_example}}" + template: '{{backend_test_example}}' - id: e2e-test title: E2E Test type: code language: typescript - template: "{{e2e_test_example}}" + template: '{{e2e_test_example}}' - id: coding-standards title: Coding Standards @@ -6821,22 +6864,22 @@ sections: - id: critical-rules title: Critical Fullstack Rules repeatable: true - template: "- **{{rule_name}}:** {{rule_description}}" + template: '- **{{rule_name}}:** {{rule_description}}' examples: - - "**Type Sharing:** Always define types in packages/shared and import from there" - - "**API Calls:** Never make direct HTTP calls - use the service layer" - - "**Environment Variables:** Access only through config objects, never process.env directly" - - "**Error Handling:** All API routes must use the standard error handler" - - "**State Updates:** Never mutate state directly - use proper state management patterns" + - '**Type Sharing:** Always define types in packages/shared and import from there' + - '**API Calls:** Never make direct HTTP calls - use the service layer' + - '**Environment Variables:** Access only through config objects, never process.env directly' + - '**Error Handling:** All API routes must use the standard error handler' + - '**State Updates:** Never mutate state directly - use proper state management patterns' - id: naming-conventions title: Naming Conventions type: table columns: [Element, Frontend, Backend, Example] rows: - - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] - - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] - - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] - - ["Database Tables", "-", "snake_case", "`user_profiles`"] + - ['Components', 'PascalCase', '-', '`UserProfile.tsx`'] + - ['Hooks', "camelCase with 'use'", '-', '`useAuth.ts`'] + - ['API Routes', '-', 'kebab-case', '`/api/user-profile`'] + - ['Database Tables', '-', 'snake_case', '`user_profiles`'] - id: error-handling title: Error Handling Strategy @@ -6847,7 +6890,7 @@ sections: title: Error Flow type: mermaid mermaid_type: sequence - template: "{{error_flow_diagram}}" + template: '{{error_flow_diagram}}' - id: error-format title: Error Response Format type: code @@ -6866,12 +6909,12 @@ sections: title: Frontend Error Handling type: code language: typescript - template: "{{frontend_error_handler}}" + template: '{{frontend_error_handler}}' - id: backend-error-handling title: Backend Error Handling type: code language: typescript - template: "{{backend_error_handler}}" + template: '{{backend_error_handler}}' - id: monitoring title: Monitoring and Observability @@ -6893,7 +6936,7 @@ sections: - JavaScript errors - API response times - User interactions - + **Backend Metrics:** - Request rate - Error rate @@ -6913,7 +6956,7 @@ template: output: format: markdown filename: docs/architecture.md - title: "{{project_name}} Brownfield Enhancement Architecture" + title: '{{project_name}} Brownfield Enhancement Architecture' workflow: mode: interactive @@ -6924,40 +6967,40 @@ sections: title: Introduction instruction: | IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - + 2. **REQUIRED INPUTS**: - Completed brownfield-prd.md - Existing project technical documentation (from docs folder or user-provided) - Access to existing project structure (IDE or uploaded files) - + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - + If any required inputs are missing, request them before proceeding. elicit: true sections: - id: intro-content content: | This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - + **Relationship to Existing Architecture:** This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - id: existing-project-analysis title: Existing Project Analysis instruction: | Analyze the existing project structure and architecture: - + 1. Review existing documentation in docs folder 2. Examine current technology stack and versions 3. Identify existing architectural patterns and conventions 4. Note current deployment and infrastructure setup 5. Document any constraints or limitations - + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." elicit: true sections: @@ -6971,11 +7014,11 @@ sections: - id: available-docs title: Available Documentation type: bullet-list - template: "- {{existing_docs_summary}}" + template: '- {{existing_docs_summary}}' - id: constraints title: Identified Constraints type: bullet-list - template: "- {{constraint}}" + template: '- {{constraint}}' - id: changelog title: Change Log type: table @@ -6986,12 +7029,12 @@ sections: title: Enhancement Scope and Integration Strategy instruction: | Define how the enhancement will integrate with the existing system: - + 1. Review the brownfield PRD enhancement scope 2. Identify integration points with existing code 3. Define boundaries between new and existing functionality 4. Establish compatibility requirements - + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" elicit: true sections: @@ -7020,7 +7063,7 @@ sections: title: Tech Stack Alignment instruction: | Ensure new components align with existing technology choices: - + 1. Use existing technology stack as the foundation 2. Only introduce new technologies if absolutely necessary 3. Justify any new additions with clear rationale @@ -7043,7 +7086,7 @@ sections: title: Data Models and Schema Changes instruction: | Define new data models and how they integrate with existing schema: - + 1. Identify new entities required for the enhancement 2. Define relationships with existing data models 3. Plan database schema changes (additions, modifications) @@ -7055,15 +7098,15 @@ sections: repeatable: true sections: - id: model - title: "{{model_name}}" + title: '{{model_name}}' template: | **Purpose:** {{model_purpose}} **Integration:** {{integration_with_existing}} - + **Key Attributes:** - {{attribute_1}}: {{type_1}} - {{description_1}} - {{attribute_2}}: {{type_2}} - {{description_2}} - + **Relationships:** - **With Existing:** {{existing_relationships}} - **With New:** {{new_relationships}} @@ -7075,7 +7118,7 @@ sections: - **Modified Tables:** {{modified_tables_list}} - **New Indexes:** {{new_indexes_list}} - **Migration Strategy:** {{migration_approach}} - + **Backward Compatibility:** - {{compatibility_measure_1}} - {{compatibility_measure_2}} @@ -7084,12 +7127,12 @@ sections: title: Component Architecture instruction: | Define new components and their integration with existing architecture: - + 1. Identify new components required for the enhancement 2. Define interfaces with existing components 3. Establish clear boundaries and responsibilities 4. Plan integration points and data flow - + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" elicit: true sections: @@ -7098,19 +7141,19 @@ sections: repeatable: true sections: - id: component - title: "{{component_name}}" + title: '{{component_name}}' template: | **Responsibility:** {{component_description}} **Integration Points:** {{integration_points}} - + **Key Interfaces:** - {{interface_1}} - {{interface_2}} - + **Dependencies:** - **Existing Components:** {{existing_dependencies}} - **New Components:** {{new_dependencies}} - + **Technology Stack:** {{component_tech_details}} - id: interaction-diagram title: Component Interaction Diagram @@ -7123,7 +7166,7 @@ sections: condition: Enhancement requires API changes instruction: | Define new API endpoints and integration with existing APIs: - + 1. Plan new API endpoints required for the enhancement 2. Ensure consistency with existing API patterns 3. Define authentication and authorization integration @@ -7141,7 +7184,7 @@ sections: repeatable: true sections: - id: endpoint - title: "{{endpoint_name}}" + title: '{{endpoint_name}}' template: | - **Method:** {{http_method}} - **Endpoint:** {{endpoint_path}} @@ -7152,12 +7195,12 @@ sections: title: Request type: code language: json - template: "{{request_schema}}" + template: '{{request_schema}}' - id: response title: Response type: code language: json - template: "{{response_schema}}" + template: '{{response_schema}}' - id: external-api-integration title: External API Integration @@ -7166,24 +7209,24 @@ sections: repeatable: true sections: - id: external-api - title: "{{api_name}} API" + title: '{{api_name}} API' template: | - **Purpose:** {{api_purpose}} - **Documentation:** {{api_docs_url}} - **Base URL:** {{api_base_url}} - **Authentication:** {{auth_method}} - **Integration Method:** {{integration_approach}} - + **Key Endpoints Used:** - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - + **Error Handling:** {{error_handling_strategy}} - id: source-tree-integration title: Source Tree Integration instruction: | Define how new code will integrate with existing project structure: - + 1. Follow existing project organization patterns 2. Identify where new files/folders will be placed 3. Ensure consistency with existing naming conventions @@ -7195,7 +7238,7 @@ sections: type: code language: plaintext instruction: Document relevant parts of current structure - template: "{{existing_structure_relevant_parts}}" + template: '{{existing_structure_relevant_parts}}' - id: new-file-organization title: New File Organization type: code @@ -7222,7 +7265,7 @@ sections: title: Infrastructure and Deployment Integration instruction: | Define how the enhancement will be deployed alongside existing infrastructure: - + 1. Use existing deployment pipeline and infrastructure 2. Identify any infrastructure changes needed 3. Plan deployment strategy to minimize risk @@ -7252,7 +7295,7 @@ sections: title: Coding Standards and Conventions instruction: | Ensure new code follows existing project conventions: - + 1. Document existing coding standards from project analysis 2. Identify any enhancement-specific requirements 3. Ensure consistency with existing codebase patterns @@ -7270,7 +7313,7 @@ sections: title: Enhancement-Specific Standards condition: New patterns needed for enhancement repeatable: true - template: "- **{{standard_name}}:** {{standard_description}}" + template: '- **{{standard_name}}:** {{standard_description}}' - id: integration-rules title: Critical Integration Rules template: | @@ -7283,7 +7326,7 @@ sections: title: Testing Strategy instruction: | Define testing approach for the enhancement: - + 1. Integrate with existing test suite 2. Ensure existing functionality remains intact 3. Plan for testing new features @@ -7323,7 +7366,7 @@ sections: title: Security Integration instruction: | Ensure security consistency with existing system: - + 1. Follow existing security patterns and tools 2. Ensure new features don't introduce vulnerabilities 3. Maintain existing security posture @@ -7358,7 +7401,7 @@ sections: title: Next Steps instruction: | After completing the brownfield architecture: - + 1. Review integration points with existing system 2. Begin story implementation with Dev agent 3. Set up deployment pipeline integration @@ -7970,14 +8013,14 @@ template: output: format: markdown filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md - title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + title: 'Story {{epic_num}}.{{story_num}}: {{story_title_short}}' workflow: mode: interactive elicitation: advanced-elicitation agent_config: - editable_sections: + editable_sections: - Status - Story - Acceptance Criteria @@ -7994,7 +8037,7 @@ sections: instruction: Select the current status of the story owner: scrum-master editors: [scrum-master, dev-agent] - + - id: story title: Story type: template-text @@ -8006,7 +8049,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: acceptance-criteria title: Acceptance Criteria type: numbered-list @@ -8014,7 +8057,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: tasks-subtasks title: Tasks / Subtasks type: bullet-list @@ -8031,7 +8074,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master, dev-agent] - + - id: dev-notes title: Dev Notes instruction: | @@ -8055,7 +8098,7 @@ sections: elicit: true owner: scrum-master editors: [scrum-master] - + - id: change-log title: Change Log type: table @@ -8063,7 +8106,7 @@ sections: instruction: Track changes made to this story document owner: scrum-master editors: [scrum-master, dev-agent, qa-agent] - + - id: dev-agent-record title: Dev Agent Record instruction: This section is populated by the development agent during implementation @@ -8072,29 +8115,29 @@ sections: sections: - id: agent-model title: Agent Model Used - template: "{{agent_model_name_version}}" + template: '{{agent_model_name_version}}' instruction: Record the specific AI agent model and version used for development owner: dev-agent editors: [dev-agent] - + - id: debug-log-references title: Debug Log References instruction: Reference any debug logs or traces generated during development owner: dev-agent editors: [dev-agent] - + - id: completion-notes title: Completion Notes List instruction: Notes about the completion of tasks and any issues encountered owner: dev-agent editors: [dev-agent] - + - id: file-list title: File List instruction: List all files created, modified, or affected during story implementation owner: dev-agent editors: [dev-agent] - + - id: qa-results title: QA Results instruction: Results from QA Agent QA review of the completed story implementation @@ -8577,17 +8620,17 @@ workflow: updates: prd.md (if needed) requires: architecture.md condition: architecture_suggests_prd_changes - notes: "If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder." + notes: 'If architect suggests story changes, update PRD and re-export the complete unredacted prd.md to docs/ folder.' - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for consistency and completeness. May require updates to any document." + notes: 'Validates all documents for consistency and completeness. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -8675,7 +8718,7 @@ workflow: notes: | All stories implemented and reviewed! Service development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -8737,13 +8780,13 @@ workflow: - Enterprise or external-facing APIs handoff_prompts: - analyst_to_pm: "Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD." - pm_to_architect: "PRD is ready. Save it as docs/prd.md in your project, then create the service architecture." - architect_review: "Architecture complete. Save it as docs/architecture.md. Do you suggest any changes to the PRD stories or need new stories added?" - architect_to_pm: "Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/." - updated_to_po: "All documents ready in docs/ folder. Please validate all artifacts for consistency." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Project brief is complete. Save it as docs/project-brief.md in your project, then create the PRD.' + pm_to_architect: 'PRD is ready. Save it as docs/prd.md in your project, then create the service architecture.' + architect_review: 'Architecture complete. Save it as docs/architecture.md. Do you suggest any changes to the PRD stories or need new stories added?' + architect_to_pm: 'Please update the PRD with the suggested story changes, then re-export the complete prd.md to docs/.' + updated_to_po: 'All documents ready in docs/ folder. Please validate all artifacts for consistency.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/greenfield-service.yaml ==================== ==================== START: .bmad-core/workflows/brownfield-service.yaml ==================== @@ -8766,7 +8809,7 @@ workflow: agent: architect action: analyze existing project and use task document-project creates: multiple documents per the document-project template - notes: "Review existing service documentation, codebase, performance metrics, and identify integration dependencies." + notes: 'Review existing service documentation, codebase, performance metrics, and identify integration dependencies.' - agent: pm creates: prd.md @@ -8783,12 +8826,12 @@ workflow: - agent: po validates: all_artifacts uses: po-master-checklist - notes: "Validates all documents for service integration safety and API compatibility. May require updates to any document." + notes: 'Validates all documents for service integration safety and API compatibility. May require updates to any document.' - agent: various updates: any_flagged_documents condition: po_checklist_issues - notes: "If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder." + notes: 'If PO finds issues, return to relevant agent to fix and re-export updated documents to docs/ folder.' - agent: po action: shard_documents @@ -8876,7 +8919,7 @@ workflow: notes: | All stories implemented and reviewed! Project development phase complete. - + Reference: .bmad-core/data/bmad-kb.md#IDE Development Workflow flow_diagram: | @@ -8929,9 +8972,9 @@ workflow: - Multiple integration points affected handoff_prompts: - analyst_to_pm: "Service analysis complete. Create comprehensive PRD with service integration strategy." - pm_to_architect: "PRD ready. Save it as docs/prd.md, then create the service architecture." - architect_to_po: "Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for service integration safety." - po_issues: "PO found issues with [document]. Please return to [agent] to fix and re-save the updated document." - complete: "All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development." + analyst_to_pm: 'Service analysis complete. Create comprehensive PRD with service integration strategy.' + pm_to_architect: 'PRD ready. Save it as docs/prd.md, then create the service architecture.' + architect_to_po: 'Architecture complete. Save it as docs/architecture.md. Please validate all artifacts for service integration safety.' + po_issues: 'PO found issues with [document]. Please return to [agent] to fix and re-save the updated document.' + complete: 'All planning artifacts validated and saved in docs/ folder. Move to IDE environment to begin development.' ==================== END: .bmad-core/workflows/brownfield-service.yaml ==================== diff --git a/docs/enhanced-ide-development-workflow.md b/docs/enhanced-ide-development-workflow.md index 1af97d7d..6159d395 100644 --- a/docs/enhanced-ide-development-workflow.md +++ b/docs/enhanced-ide-development-workflow.md @@ -29,14 +29,14 @@ The Test Architect (Quinn) provides comprehensive quality assurance throughout t ### Quick Command Reference -| **Stage** | **Command** | **Purpose** | **Output** | **Priority** | -|-----------|------------|-------------|------------|--------------| -| **After Story Approval** | `*risk` | Identify integration & regression risks | `docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md` | High for complex/brownfield | -| | `*design` | Create test strategy for dev | `docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md` | High for new features | -| **During Development** | `*trace` | Verify test coverage | `docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md` | Medium | -| | `*nfr` | Validate quality attributes | `docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md` | High for critical features | -| **After Development** | `*review` | Comprehensive assessment | QA Results in story + `docs/qa/gates/{epic}.{story}-{slug}.yml` | **Required** | -| **Post-Review** | `*gate` | Update quality decision | Updated `docs/qa/gates/{epic}.{story}-{slug}.yml` | As needed | +| **Stage** | **Command** | **Purpose** | **Output** | **Priority** | +| ------------------------ | ----------- | --------------------------------------- | --------------------------------------------------------------- | --------------------------- | +| **After Story Approval** | `*risk` | Identify integration & regression risks | `docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md` | High for complex/brownfield | +| | `*design` | Create test strategy for dev | `docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md` | High for new features | +| **During Development** | `*trace` | Verify test coverage | `docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md` | Medium | +| | `*nfr` | Validate quality attributes | `docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md` | High for critical features | +| **After Development** | `*review` | Comprehensive assessment | QA Results in story + `docs/qa/gates/{epic}.{story}-{slug}.yml` | **Required** | +| **Post-Review** | `*gate` | Update quality decision | Updated `docs/qa/gates/{epic}.{story}-{slug}.yml` | As needed | ### Stage 1: After Story Creation (Before Dev Starts) @@ -134,24 +134,24 @@ The Test Architect (Quinn) provides comprehensive quality assurance throughout t ### Understanding Gate Decisions -| **Status** | **Meaning** | **Action Required** | **Can Proceed?** | -|------------|-------------|-------------------|------------------| -| **PASS** | All critical requirements met | None | ✅ Yes | -| **CONCERNS** | Non-critical issues found | Team review recommended | ⚠️ With caution | -| **FAIL** | Critical issues (security, missing P0 tests) | Must fix | ❌ No | -| **WAIVED** | Issues acknowledged and accepted | Document reasoning | ✅ With approval | +| **Status** | **Meaning** | **Action Required** | **Can Proceed?** | +| ------------ | -------------------------------------------- | ----------------------- | ---------------- | +| **PASS** | All critical requirements met | None | ✅ Yes | +| **CONCERNS** | Non-critical issues found | Team review recommended | ⚠️ With caution | +| **FAIL** | Critical issues (security, missing P0 tests) | Must fix | ❌ No | +| **WAIVED** | Issues acknowledged and accepted | Document reasoning | ✅ With approval | ### Risk-Based Testing Strategy The Test Architect uses risk scoring to prioritize testing: -| **Risk Score** | **Calculation** | **Testing Priority** | **Gate Impact** | -|---------------|----------------|-------------------|----------------| -| **9** | High probability × High impact | P0 - Must test thoroughly | FAIL if untested | -| **6** | Medium-high combinations | P1 - Should test well | CONCERNS if gaps | -| **4** | Medium combinations | P1 - Should test | CONCERNS if notable gaps | -| **2-3** | Low-medium combinations | P2 - Nice to have | Note in review | -| **1** | Minimal risk | P2 - Minimal | Note in review | +| **Risk Score** | **Calculation** | **Testing Priority** | **Gate Impact** | +| -------------- | ------------------------------ | ------------------------- | ------------------------ | +| **9** | High probability × High impact | P0 - Must test thoroughly | FAIL if untested | +| **6** | Medium-high combinations | P1 - Should test well | CONCERNS if gaps | +| **4** | Medium combinations | P1 - Should test | CONCERNS if notable gaps | +| **2-3** | Low-medium combinations | P2 - Nice to have | Note in review | +| **1** | Minimal risk | P2 - Minimal | Note in review | ### Special Situations & Best Practices @@ -227,14 +227,14 @@ All Test Architect activities create permanent records: **Should I run Test Architect commands?** -| **Scenario** | **Before Dev** | **During Dev** | **After Dev** | -|-------------|---------------|----------------|---------------| -| **Simple bug fix** | Optional | Optional | Required `*review` | -| **New feature** | Recommended `*risk`, `*design` | Optional `*trace` | Required `*review` | -| **Brownfield change** | **Required** `*risk`, `*design` | Recommended `*trace`, `*nfr` | Required `*review` | -| **API modification** | **Required** `*risk`, `*design` | **Required** `*trace` | Required `*review` | -| **Performance-critical** | Recommended `*design` | **Required** `*nfr` | Required `*review` | -| **Data migration** | **Required** `*risk`, `*design` | **Required** `*trace` | Required `*review` + `*gate` | +| **Scenario** | **Before Dev** | **During Dev** | **After Dev** | +| ------------------------ | ------------------------------- | ---------------------------- | ---------------------------- | +| **Simple bug fix** | Optional | Optional | Required `*review` | +| **New feature** | Recommended `*risk`, `*design` | Optional `*trace` | Required `*review` | +| **Brownfield change** | **Required** `*risk`, `*design` | Recommended `*trace`, `*nfr` | Required `*review` | +| **API modification** | **Required** `*risk`, `*design` | **Required** `*trace` | Required `*review` | +| **Performance-critical** | Recommended `*design` | **Required** `*nfr` | Required `*review` | +| **Data migration** | **Required** `*risk`, `*design` | **Required** `*trace` | Required `*review` + `*gate` | ### Success Metrics diff --git a/docs/user-guide.md b/docs/user-guide.md index ceee141d..43c2daf6 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -277,7 +277,7 @@ The documentation uses short forms for convenience. Both styles are valid: ```text *risk → *risk-profile -*design → *test-design +*design → *test-design *nfr → *nfr-assess *trace → *trace-requirements (or just *trace) *review → *review @@ -376,14 +376,14 @@ Manages quality gate decisions: The Test Architect provides value throughout the entire development lifecycle. Here's when and how to leverage each capability: -| **Stage** | **Command** | **When to Use** | **Value** | **Output** | -|-----------|------------|-----------------|-----------|------------| -| **Story Drafting** | `*risk` | After SM drafts story | Identify pitfalls early | `docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md` | -| | `*design` | After risk assessment | Guide dev on test strategy | `docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md` | -| **Development** | `*trace` | Mid-implementation | Verify test coverage | `docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md` | -| | `*nfr` | While building features | Catch quality issues early | `docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md` | -| **Review** | `*review` | Story marked complete | Full quality assessment | QA Results in story + gate file | -| **Post-Review** | `*gate` | After fixing issues | Update quality decision | Updated `docs/qa/gates/{epic}.{story}-{slug}.yml` | +| **Stage** | **Command** | **When to Use** | **Value** | **Output** | +| ------------------ | ----------- | ----------------------- | -------------------------- | -------------------------------------------------------------- | +| **Story Drafting** | `*risk` | After SM drafts story | Identify pitfalls early | `docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md` | +| | `*design` | After risk assessment | Guide dev on test strategy | `docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md` | +| **Development** | `*trace` | Mid-implementation | Verify test coverage | `docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md` | +| | `*nfr` | While building features | Catch quality issues early | `docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md` | +| **Review** | `*review` | Story marked complete | Full quality assessment | QA Results in story + gate file | +| **Post-Review** | `*gate` | After fixing issues | Update quality decision | Updated `docs/qa/gates/{epic}.{story}-{slug}.yml` | #### Example Commands diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..7ed2db16 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,119 @@ +import js from '@eslint/js'; +import eslintConfigPrettier from 'eslint-config-prettier/flat'; +import nodePlugin from 'eslint-plugin-n'; +import unicorn from 'eslint-plugin-unicorn'; +import yml from 'eslint-plugin-yml'; + +export default [ + // Global ignores for files/folders that should not be linted + { + ignores: ['dist/**', 'coverage/**', '**/*.min.js'], + }, + + // Base JavaScript recommended rules + js.configs.recommended, + + // Node.js rules + ...nodePlugin.configs['flat/mixed-esm-and-cjs'], + + // Unicorn rules (modern best practices) + unicorn.configs.recommended, + + // YAML linting + ...yml.configs['flat/recommended'], + + // Place Prettier last to disable conflicting stylistic rules + eslintConfigPrettier, + + // Project-specific tweaks + { + rules: { + // Allow console for CLI tools in this repo + 'no-console': 'off', + // Enforce .yaml file extension for consistency + 'yml/file-extension': [ + 'error', + { + extension: 'yaml', + caseSensitive: true, + }, + ], + // Prefer double quotes in YAML wherever quoting is used, but allow the other to avoid escapes + 'yml/quotes': [ + 'error', + { + prefer: 'double', + avoidEscape: true, + }, + ], + // Relax some Unicorn rules that are too opinionated for this codebase + 'unicorn/prevent-abbreviations': 'off', + 'unicorn/no-null': 'off', + }, + }, + + // CLI/CommonJS scripts under tools/** + { + files: ['tools/**/*.js'], + rules: { + // Allow CommonJS patterns for Node CLI scripts + 'unicorn/prefer-module': 'off', + 'unicorn/import-style': 'off', + 'unicorn/no-process-exit': 'off', + 'n/no-process-exit': 'off', + 'unicorn/no-await-expression-member': 'off', + 'unicorn/prefer-top-level-await': 'off', + // Avoid failing CI on incidental unused vars in internal scripts + 'no-unused-vars': 'off', + // Reduce style-only churn in internal tools + 'unicorn/prefer-ternary': 'off', + 'unicorn/filename-case': 'off', + 'unicorn/no-array-reduce': 'off', + 'unicorn/no-array-callback-reference': 'off', + 'unicorn/consistent-function-scoping': 'off', + 'n/no-extraneous-require': 'off', + 'n/no-extraneous-import': 'off', + 'n/no-unpublished-require': 'off', + 'n/no-unpublished-import': 'off', + // Some scripts intentionally use globals provided at runtime + 'no-undef': 'off', + // Additional relaxed rules for legacy/internal scripts + 'no-useless-catch': 'off', + 'unicorn/prefer-number-properties': 'off', + 'no-unreachable': 'off', + }, + }, + + // ESLint config file should not be checked for publish-related Node rules + { + files: ['eslint.config.mjs'], + rules: { + 'n/no-unpublished-import': 'off', + }, + }, + + // YAML workflow templates allow empty mapping values intentionally + { + files: ['bmad-core/workflows/**/*.yaml'], + rules: { + 'yml/no-empty-mapping-value': 'off', + }, + }, + + // GitHub workflow files in this repo may use empty mapping values + { + files: ['.github/workflows/**/*.yaml'], + rules: { + 'yml/no-empty-mapping-value': 'off', + }, + }, + + // Other GitHub YAML files may intentionally use empty values and reserved filenames + { + files: ['.github/**/*.yaml'], + rules: { + 'yml/no-empty-mapping-value': 'off', + 'unicorn/filename-case': 'off', + }, + }, +]; diff --git a/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.4 Deployment Configuration/1.4.2 - cloudbuild.yaml b/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.4 Deployment Configuration/1.4.2 - cloudbuild.yaml index 2ec414b1..da4a315e 100644 --- a/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.4 Deployment Configuration/1.4.2 - cloudbuild.yaml +++ b/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.4 Deployment Configuration/1.4.2 - cloudbuild.yaml @@ -1,26 +1,26 @@ -steps: - # Build the container image - - name: 'gcr.io/cloud-builders/docker' - args: ['build', '-t', 'gcr.io/{{PROJECT_ID}}/{{COMPANY_NAME}}-ai-agents:$COMMIT_SHA', '.'] - - # Push the container image to Container Registry - - name: 'gcr.io/cloud-builders/docker' - args: ['push', 'gcr.io/{{PROJECT_ID}}/{{COMPANY_NAME}}-ai-agents:$COMMIT_SHA'] - - # Deploy container image to Cloud Run - - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' - entrypoint: gcloud - args: - - 'run' - - 'deploy' - - '{{COMPANY_NAME}}-ai-agents' - - '--image' - - 'gcr.io/{{PROJECT_ID}}/{{COMPANY_NAME}}-ai-agents:$COMMIT_SHA' - - '--region' - - '{{LOCATION}}' - - '--platform' - - 'managed' - - '--allow-unauthenticated' - -images: - - 'gcr.io/{{PROJECT_ID}}/{{COMPANY_NAME}}-ai-agents:$COMMIT_SHA' \ No newline at end of file +steps: + # Build the container image + - name: "gcr.io/cloud-builders/docker" + args: ["build", "-t", "gcr.io/{{PROJECT_ID}}/{{COMPANY_NAME}}-ai-agents:$COMMIT_SHA", "."] + + # Push the container image to Container Registry + - name: "gcr.io/cloud-builders/docker" + args: ["push", "gcr.io/{{PROJECT_ID}}/{{COMPANY_NAME}}-ai-agents:$COMMIT_SHA"] + + # Deploy container image to Cloud Run + - name: "gcr.io/google.com/cloudsdktool/cloud-sdk" + entrypoint: gcloud + args: + - "run" + - "deploy" + - "{{COMPANY_NAME}}-ai-agents" + - "--image" + - "gcr.io/{{PROJECT_ID}}/{{COMPANY_NAME}}-ai-agents:$COMMIT_SHA" + - "--region" + - "{{LOCATION}}" + - "--platform" + - "managed" + - "--allow-unauthenticated" + +images: + - "gcr.io/{{PROJECT_ID}}/{{COMPANY_NAME}}-ai-agents:$COMMIT_SHA" diff --git a/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md b/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md index 3eb103fa..9e23646a 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +++ b/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md @@ -60,10 +60,10 @@ commands: task-execution: flow: Read story → Implement game feature → Write tests → Pass tests → Update [x] → Next task updates-ONLY: - - "Checkboxes: [ ] not started | [-] in progress | [x] complete" - - "Debug Log: | Task | File | Change | Reverted? |" - - "Completion Notes: Deviations only, <50 words" - - "Change Log: Requirement changes only" + - 'Checkboxes: [ ] not started | [-] in progress | [x] complete' + - 'Debug Log: | Task | File | Change | Reverted? |' + - 'Completion Notes: Deviations only, <50 words' + - 'Change Log: Requirement changes only' blocking: Unapproved deps | Ambiguous after story check | 3 failures | Missing game config done: Game feature works + Tests pass + 60 FPS + No lint errors + Follows Phaser 3 best practices dependencies: diff --git a/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md b/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md index f5b60c53..a522d44f 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +++ b/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md @@ -27,7 +27,7 @@ activation-instructions: - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute - STAY IN CHARACTER! - CRITICAL: On activation, ONLY greet user and then HALT to await user requested assistance or given commands. ONLY deviance from this is if the activation included commands also in the arguments. - - "CRITICAL RULE: You are ONLY allowed to create/modify story files - NEVER implement! If asked to implement, tell user they MUST switch to Game Developer Agent" + - 'CRITICAL RULE: You are ONLY allowed to create/modify story files - NEVER implement! If asked to implement, tell user they MUST switch to Game Developer Agent' agent: name: Jordan id: game-sm diff --git a/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md b/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md index 95d04b94..1d66719a 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +++ b/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md @@ -73,7 +73,7 @@ interface GameState { interface GameSettings { musicVolume: number; sfxVolume: number; - difficulty: "easy" | "normal" | "hard"; + difficulty: 'easy' | 'normal' | 'hard'; controls: ControlScheme; } ``` @@ -114,12 +114,12 @@ class GameScene extends Phaser.Scene { private inputManager!: InputManager; constructor() { - super({ key: "GameScene" }); + super({ key: 'GameScene' }); } preload(): void { // Load only scene-specific assets - this.load.image("player", "assets/player.png"); + this.load.image('player', 'assets/player.png'); } create(data: SceneData): void { @@ -144,7 +144,7 @@ class GameScene extends Phaser.Scene { this.inputManager.destroy(); // Remove event listeners - this.events.off("*"); + this.events.off('*'); } } ``` @@ -153,13 +153,13 @@ class GameScene extends Phaser.Scene { ```typescript // Proper scene transitions with data -this.scene.start("NextScene", { +this.scene.start('NextScene', { playerScore: this.playerScore, currentLevel: this.currentLevel + 1, }); // Scene overlays for UI -this.scene.launch("PauseMenuScene"); +this.scene.launch('PauseMenuScene'); this.scene.pause(); ``` @@ -203,7 +203,7 @@ class Player extends GameEntity { private health!: HealthComponent; constructor(scene: Phaser.Scene, x: number, y: number) { - super(scene, x, y, "player"); + super(scene, x, y, 'player'); this.movement = this.addComponent(new MovementComponent(this)); this.health = this.addComponent(new HealthComponent(this, 100)); @@ -223,7 +223,7 @@ class GameManager { constructor(scene: Phaser.Scene) { if (GameManager.instance) { - throw new Error("GameManager already exists!"); + throw new Error('GameManager already exists!'); } this.scene = scene; @@ -233,7 +233,7 @@ class GameManager { static getInstance(): GameManager { if (!GameManager.instance) { - throw new Error("GameManager not initialized!"); + throw new Error('GameManager not initialized!'); } return GameManager.instance; } @@ -280,7 +280,7 @@ class BulletPool { } // Pool exhausted - create new bullet - console.warn("Bullet pool exhausted, creating new bullet"); + console.warn('Bullet pool exhausted, creating new bullet'); return new Bullet(this.scene, 0, 0); } @@ -380,14 +380,12 @@ class InputManager { } private setupKeyboard(): void { - this.keys = this.scene.input.keyboard.addKeys( - "W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT", - ); + this.keys = this.scene.input.keyboard.addKeys('W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT'); } private setupTouch(): void { - this.scene.input.on("pointerdown", this.handlePointerDown, this); - this.scene.input.on("pointerup", this.handlePointerUp, this); + this.scene.input.on('pointerdown', this.handlePointerDown, this); + this.scene.input.on('pointerup', this.handlePointerUp, this); } update(): void { @@ -414,9 +412,9 @@ class InputManager { class AssetManager { loadAssets(): Promise { return new Promise((resolve, reject) => { - this.scene.load.on("filecomplete", this.handleFileComplete, this); - this.scene.load.on("loaderror", this.handleLoadError, this); - this.scene.load.on("complete", () => resolve()); + this.scene.load.on('filecomplete', this.handleFileComplete, this); + this.scene.load.on('loaderror', this.handleLoadError, this); + this.scene.load.on('complete', () => resolve()); this.scene.load.start(); }); @@ -432,8 +430,8 @@ class AssetManager { private loadFallbackAsset(key: string): void { // Load placeholder or default assets switch (key) { - case "player": - this.scene.load.image("player", "assets/defaults/default-player.png"); + case 'player': + this.scene.load.image('player', 'assets/defaults/default-player.png'); break; default: console.warn(`No fallback for asset: ${key}`); @@ -460,11 +458,11 @@ class GameSystem { private attemptRecovery(context: string): void { switch (context) { - case "update": + case 'update': // Reset system state this.reset(); break; - case "render": + case 'render': // Disable visual effects this.disableEffects(); break; @@ -484,7 +482,7 @@ class GameSystem { ```typescript // Example test for game mechanics -describe("HealthComponent", () => { +describe('HealthComponent', () => { let healthComponent: HealthComponent; beforeEach(() => { @@ -492,18 +490,18 @@ describe("HealthComponent", () => { healthComponent = new HealthComponent(mockEntity, 100); }); - test("should initialize with correct health", () => { + test('should initialize with correct health', () => { expect(healthComponent.currentHealth).toBe(100); expect(healthComponent.maxHealth).toBe(100); }); - test("should handle damage correctly", () => { + test('should handle damage correctly', () => { healthComponent.takeDamage(25); expect(healthComponent.currentHealth).toBe(75); expect(healthComponent.isAlive()).toBe(true); }); - test("should handle death correctly", () => { + test('should handle death correctly', () => { healthComponent.takeDamage(150); expect(healthComponent.currentHealth).toBe(0); expect(healthComponent.isAlive()).toBe(false); @@ -516,7 +514,7 @@ describe("HealthComponent", () => { **Scene Testing:** ```typescript -describe("GameScene Integration", () => { +describe('GameScene Integration', () => { let scene: GameScene; let mockGame: Phaser.Game; @@ -526,7 +524,7 @@ describe("GameScene Integration", () => { scene = new GameScene(); }); - test("should initialize all systems", () => { + test('should initialize all systems', () => { scene.create({}); expect(scene.gameManager).toBeDefined(); diff --git a/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml b/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml index 2d4a04bb..4accd3c3 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +++ b/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml @@ -14,7 +14,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics. - + If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD. - id: introduction @@ -22,7 +22,7 @@ sections: instruction: Establish the document's purpose and scope for game development content: | This document outlines the complete technical architecture for {{game_title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems. - + This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility. sections: - id: change-log @@ -41,7 +41,7 @@ sections: title: Architecture Summary instruction: | Provide a comprehensive overview covering: - + - Game engine choice and configuration - Project structure and organization - Key systems and their interactions @@ -129,23 +129,23 @@ sections: title: Scene Management System template: | **Purpose:** Handle game flow and scene transitions - + **Key Components:** - + - Scene loading and unloading - Data passing between scenes - Transition effects - Memory management - + **Implementation Requirements:** - + - Preload scene for asset loading - Menu system with navigation - Gameplay scenes with state management - Pause/resume functionality - + **Files to Create:** - + - `src/scenes/BootScene.ts` - `src/scenes/PreloadScene.ts` - `src/scenes/MenuScene.ts` @@ -155,23 +155,23 @@ sections: title: Game State Management template: | **Purpose:** Track player progress and game status - + **State Categories:** - + - Player progress (levels, unlocks) - Game settings (audio, controls) - Session data (current level, score) - Persistent data (achievements, statistics) - + **Implementation Requirements:** - + - Save/load system with localStorage - State validation and error recovery - Cross-session data persistence - Settings management - + **Files to Create:** - + - `src/systems/GameState.ts` - `src/systems/SaveManager.ts` - `src/types/GameData.ts` @@ -179,23 +179,23 @@ sections: title: Asset Management System template: | **Purpose:** Efficient loading and management of game assets - + **Asset Categories:** - + - Sprite sheets and animations - Audio files and music - Level data and configurations - UI assets and fonts - + **Implementation Requirements:** - + - Progressive loading strategy - Asset caching and optimization - Error handling for failed loads - Memory management for large assets - + **Files to Create:** - + - `src/systems/AssetManager.ts` - `src/config/AssetConfig.ts` - `src/utils/AssetLoader.ts` @@ -203,23 +203,23 @@ sections: title: Input Management System template: | **Purpose:** Handle all player input across platforms - + **Input Types:** - + - Keyboard controls - Mouse/pointer interaction - Touch gestures (mobile) - Gamepad support (optional) - + **Implementation Requirements:** - + - Input mapping and configuration - Touch-friendly mobile controls - Input buffering for responsive gameplay - Customizable control schemes - + **Files to Create:** - + - `src/systems/InputManager.ts` - `src/utils/TouchControls.ts` - `src/types/InputTypes.ts` @@ -232,19 +232,19 @@ sections: title: "{{mechanic_name}} System" template: | **Purpose:** {{system_purpose}} - + **Core Functionality:** - + - {{feature_1}} - {{feature_2}} - {{feature_3}} - + **Dependencies:** {{required_systems}} - + **Performance Considerations:** {{optimization_notes}} - + **Files to Create:** - + - `src/systems/{{system_name}}.ts` - `src/gameObjects/{{related_object}}.ts` - `src/types/{{system_types}}.ts` @@ -252,65 +252,65 @@ sections: title: Physics & Collision System template: | **Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js) - + **Collision Categories:** - + - Player collision - Enemy interactions - Environmental objects - Collectibles and items - + **Implementation Requirements:** - + - Optimized collision detection - Physics body management - Collision callbacks and events - Performance monitoring - + **Files to Create:** - + - `src/systems/PhysicsManager.ts` - `src/utils/CollisionGroups.ts` - id: audio-system title: Audio System template: | **Audio Requirements:** - + - Background music with looping - Sound effects for actions - Audio settings and volume control - Mobile audio optimization - + **Implementation Features:** - + - Audio sprite management - Dynamic music system - Spatial audio (if applicable) - Audio pooling for performance - + **Files to Create:** - + - `src/systems/AudioManager.ts` - `src/config/AudioConfig.ts` - id: ui-system title: UI System template: | **UI Components:** - + - HUD elements (score, health, etc.) - Menu navigation - Modal dialogs - Settings screens - + **Implementation Requirements:** - + - Responsive layout system - Touch-friendly interface - Keyboard navigation support - Animation and transitions - + **Files to Create:** - + - `src/systems/UIManager.ts` - `src/gameObjects/UI/` - `src/types/UITypes.ts` @@ -610,4 +610,4 @@ sections: - 90%+ test coverage on game logic - Zero TypeScript errors in strict mode - Consistent adherence to coding standards - - Comprehensive documentation coverage \ No newline at end of file + - Comprehensive documentation coverage diff --git a/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml b/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml index 7532a2b0..118fbb0e 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +++ b/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml @@ -14,7 +14,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. - id: game-vision @@ -71,7 +71,7 @@ sections: repeatable: true template: | **Core Mechanic: {{mechanic_name}}** - + - **Description:** {{how_it_works}} - **Player Value:** {{why_its_fun}} - **Implementation Scope:** {{complexity_estimate}} @@ -98,12 +98,12 @@ sections: title: Technical Constraints template: | **Platform Requirements:** - + - Primary: {{platform_1}} - {{requirements}} - Secondary: {{platform_2}} - {{requirements}} - + **Technical Specifications:** - + - Engine: Phaser 3 + TypeScript - Performance Target: {{fps_target}} FPS on {{target_device}} - Memory Budget: <{{memory_limit}}MB @@ -141,10 +141,10 @@ sections: title: Competitive Analysis template: | **Direct Competitors:** - + - {{competitor_1}}: {{strengths_and_weaknesses}} - {{competitor_2}}: {{strengths_and_weaknesses}} - + **Differentiation Strategy:** {{how_we_differ_and_why_thats_valuable}} - id: market-opportunity @@ -168,16 +168,16 @@ sections: title: Content Categories template: | **Core Content:** - + - {{content_type_1}}: {{quantity_and_description}} - {{content_type_2}}: {{quantity_and_description}} - + **Optional Content:** - + - {{optional_content_type}}: {{quantity_and_description}} - + **Replay Elements:** - + - {{replayability_features}} - id: difficulty-accessibility title: Difficulty and Accessibility @@ -244,13 +244,13 @@ sections: title: Player Experience Metrics template: | **Engagement Goals:** - + - Tutorial completion rate: >{{percentage}}% - Average session length: {{duration}} minutes - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - + **Quality Benchmarks:** - + - Player satisfaction: >{{rating}}/10 - Completion rate: >{{percentage}}% - Technical performance: {{fps_target}} FPS consistent @@ -258,13 +258,13 @@ sections: title: Development Metrics template: | **Technical Targets:** - + - Zero critical bugs at launch - Performance targets met on all platforms - Load times under {{seconds}}s - + **Process Goals:** - + - Development timeline adherence - Feature scope completion - Quality assurance standards @@ -273,7 +273,7 @@ sections: condition: has_business_goals template: | **Commercial Goals:** - + - {{revenue_target}} in first {{time_period}} - {{user_acquisition_target}} players in first {{time_period}} - {{retention_target}} monthly active users @@ -326,12 +326,12 @@ sections: title: Validation Plan template: | **Concept Testing:** - + - {{validation_method_1}} - {{timeline}} - {{validation_method_2}} - {{timeline}} - + **Prototype Testing:** - + - {{testing_approach}} - {{timeline}} - {{feedback_collection_method}} - {{timeline}} @@ -353,4 +353,4 @@ sections: type: table template: | | Date | Version | Description | Author | - | :--- | :------ | :---------- | :----- | \ No newline at end of file + | :--- | :------ | :---------- | :----- | diff --git a/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml b/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml index f2010a05..a1262ef8 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +++ b/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml @@ -14,7 +14,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive Game Design Document that will serve as the foundation for all game development work. The GDD should be detailed enough that developers can create user stories and epics from it. Focus on gameplay systems, mechanics, and technical requirements that can be broken down into implementable features. - + If available, review any provided documents or ask if any are optionally available: Project Brief, Market Research, Competitive Analysis - id: executive-summary @@ -59,7 +59,7 @@ sections: instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions. template: | **Primary Loop ({{duration}} seconds):** - + 1. {{action_1}} ({{time_1}}s) 2. {{action_2}} ({{time_2}}s) 3. {{action_3}} ({{time_3}}s) @@ -69,12 +69,12 @@ sections: instruction: Clearly define success and failure states template: | **Victory Conditions:** - + - {{win_condition_1}} - {{win_condition_2}} - + **Failure States:** - + - {{loss_condition_1}} - {{loss_condition_2}} @@ -90,17 +90,17 @@ sections: title: "{{mechanic_name}}" template: | **Description:** {{detailed_description}} - + **Player Input:** {{input_method}} - + **System Response:** {{game_response}} - + **Implementation Notes:** - + - {{tech_requirement_1}} - {{tech_requirement_2}} - {{performance_consideration}} - + **Dependencies:** {{other_mechanics_needed}} - id: controls title: Controls @@ -119,9 +119,9 @@ sections: title: Player Progression template: | **Progression Type:** {{linear|branching|metroidvania}} - + **Key Milestones:** - + 1. **{{milestone_1}}** - {{unlock_description}} 2. **{{milestone_2}}** - {{unlock_description}} 3. **{{milestone_3}}** - {{unlock_description}} @@ -158,9 +158,9 @@ sections: **Duration:** {{target_time}} **Key Elements:** {{required_mechanics}} **Difficulty:** {{relative_difficulty}} - + **Structure Template:** - + - Introduction: {{intro_description}} - Challenge: {{main_challenge}} - Resolution: {{completion_requirement}} @@ -186,13 +186,13 @@ sections: title: Platform Specific template: | **Desktop:** - + - Resolution: {{min_resolution}} - {{max_resolution}} - Input: Keyboard, Mouse, Gamepad - Browser: Chrome 80+, Firefox 75+, Safari 13+ - + **Mobile:** - + - Resolution: {{mobile_min}} - {{mobile_max}} - Input: Touch, Tilt (optional) - OS: iOS 13+, Android 8+ @@ -201,14 +201,14 @@ sections: instruction: Define asset specifications for the art and audio teams template: | **Visual Assets:** - + - Art Style: {{style_description}} - Color Palette: {{color_specification}} - Animation: {{animation_requirements}} - UI Resolution: {{ui_specs}} - + **Audio Assets:** - + - Music Style: {{music_genre}} - Sound Effects: {{sfx_requirements}} - Voice Acting: {{voice_needs}} @@ -221,7 +221,7 @@ sections: title: Engine Configuration template: | **Phaser 3 Setup:** - + - TypeScript: Strict mode enabled - Physics: {{physics_system}} (Arcade/Matter) - Renderer: WebGL with Canvas fallback @@ -230,7 +230,7 @@ sections: title: Code Architecture template: | **Required Systems:** - + - Scene Management - State Management - Asset Loading @@ -242,7 +242,7 @@ sections: title: Data Management template: | **Save Data:** - + - Progress tracking - Settings persistence - Statistics collection @@ -340,4 +340,4 @@ sections: title: References instruction: List any competitive analysis, inspiration, or research sources type: bullet-list - template: "{{reference}}" \ No newline at end of file + template: "{{reference}}" diff --git a/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml b/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml index 2132cf70..63209a51 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +++ b/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml @@ -14,13 +14,13 @@ sections: - id: initial-setup instruction: | This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. - + Before starting, ensure you have access to: - + - Game Design Document (GDD) - Game Architecture Document - Any existing stories in this epic - + The story should be specific enough that a developer can implement it without requiring additional design decisions. - id: story-header @@ -69,12 +69,12 @@ sections: title: Files to Create/Modify template: | **New Files:** - + - `{{file_path_1}}` - {{purpose}} - `{{file_path_2}}` - {{purpose}} - + **Modified Files:** - + - `{{existing_file_1}}` - {{changes_needed}} - `{{existing_file_2}}` - {{changes_needed}} - id: class-interface-definitions @@ -89,15 +89,15 @@ sections: {{property_2}}: {{type}}; {{method_1}}({{params}}): {{return_type}}; } - + // {{class_name}} class {{class_name}} extends {{phaser_class}} { private {{property}}: {{type}}; - + constructor({{params}}) { // Implementation requirements } - + public {{method}}({{params}}): {{return_type}} { // Method requirements } @@ -107,15 +107,15 @@ sections: instruction: Specify how this feature integrates with existing systems template: | **Scene Integration:** - + - {{scene_name}}: {{integration_details}} - + **System Dependencies:** - + - {{system_name}}: {{dependency_description}} - + **Event Communication:** - + - Emits: `{{event_name}}` when {{condition}} - Listens: `{{event_name}}` to {{response}} @@ -127,7 +127,7 @@ sections: title: Dev Agent Record template: | **Tasks:** - + - [ ] {{task_1_description}} - [ ] {{task_2_description}} - [ ] {{task_3_description}} @@ -135,18 +135,18 @@ sections: - [ ] Write unit tests for {{component}} - [ ] Integration testing with {{related_system}} - [ ] Performance testing and optimization - + **Debug Log:** | Task | File | Change | Reverted? | |------|------|--------|-----------| | | | | | - + **Completion Notes:** - + - + **Change Log:** - + - id: game-design-context @@ -154,13 +154,13 @@ sections: instruction: Reference the specific sections of the GDD that this story implements template: | **GDD Reference:** {{section_name}} ({{page_or_section_number}}) - + **Game Mechanic:** {{mechanic_name}} - + **Player Experience Goal:** {{experience_description}} - + **Balance Parameters:** - + - {{parameter_1}}: {{value_or_range}} - {{parameter_2}}: {{value_or_range}} @@ -172,11 +172,11 @@ sections: title: Unit Tests template: | **Test Files:** - + - `tests/{{component_name}}.test.ts` - + **Test Scenarios:** - + - {{test_scenario_1}} - {{test_scenario_2}} - {{edge_case_test}} @@ -184,12 +184,12 @@ sections: title: Game Testing template: | **Manual Test Cases:** - + 1. {{test_case_1_description}} - + - Expected: {{expected_behavior}} - Performance: {{performance_expectation}} - + 2. {{test_case_2_description}} - Expected: {{expected_behavior}} - Edge Case: {{edge_case_handling}} @@ -197,7 +197,7 @@ sections: title: Performance Tests template: | **Metrics to Verify:** - + - Frame rate maintains {{fps_target}} FPS - Memory usage stays under {{memory_limit}}MB - {{feature_specific_performance_metric}} @@ -207,15 +207,15 @@ sections: instruction: List any dependencies that must be completed before this story can be implemented template: | **Story Dependencies:** - + - {{story_id}}: {{dependency_description}} - + **Technical Dependencies:** - + - {{system_or_file}}: {{requirement}} - + **Asset Dependencies:** - + - {{asset_type}}: {{asset_description}} - Location: `{{asset_path}}` @@ -238,16 +238,16 @@ sections: instruction: Any additional context, design decisions, or implementation notes template: | **Implementation Notes:** - + - {{note_1}} - {{note_2}} - + **Design Decisions:** - + - {{decision_1}}: {{rationale}} - {{decision_2}}: {{rationale}} - + **Future Considerations:** - + - {{future_enhancement_1}} - - {{future_optimization_1}} \ No newline at end of file + - {{future_optimization_1}} diff --git a/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml b/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml index 23d57d5d..7e5f43fc 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +++ b/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml @@ -14,7 +14,7 @@ sections: - id: initial-setup instruction: | This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. - id: introduction @@ -22,7 +22,7 @@ sections: instruction: Establish the purpose and scope of level design for this game content: | This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. sections: - id: change-log @@ -69,29 +69,29 @@ sections: title: "{{category_name}} Levels" template: | **Purpose:** {{gameplay_purpose}} - + **Target Duration:** {{min_time}} - {{max_time}} minutes - + **Difficulty Range:** {{difficulty_scale}} - + **Key Mechanics Featured:** - + - {{mechanic_1}} - {{usage_description}} - {{mechanic_2}} - {{usage_description}} - + **Player Objectives:** - + - Primary: {{primary_objective}} - Secondary: {{secondary_objective}} - Hidden: {{secret_objective}} - + **Success Criteria:** - + - {{completion_requirement_1}} - {{completion_requirement_2}} - + **Technical Requirements:** - + - Maximum entities: {{entity_limit}} - Performance target: {{fps_target}} FPS - Memory budget: {{memory_limit}}MB @@ -106,11 +106,11 @@ sections: instruction: Based on GDD requirements, define the overall level organization template: | **Organization Type:** {{linear|hub_world|open_world}} - + **Total Level Count:** {{number}} - + **World Breakdown:** - + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} @@ -145,7 +145,7 @@ sections: instruction: Define how players access new levels template: | **Progression Gates:** - + - Linear progression: Complete previous level - Star requirements: {{star_count}} stars to unlock - Skill gates: Demonstrate {{skill_requirement}} @@ -160,17 +160,17 @@ sections: instruction: Define all environmental components that can be used in levels template: | **Terrain Types:** - + - {{terrain_1}}: {{properties_and_usage}} - {{terrain_2}}: {{properties_and_usage}} - + **Interactive Objects:** - + - {{object_1}}: {{behavior_and_purpose}} - {{object_2}}: {{behavior_and_purpose}} - + **Hazards and Obstacles:** - + - {{hazard_1}}: {{damage_and_behavior}} - {{hazard_2}}: {{damage_and_behavior}} - id: collectibles-rewards @@ -178,18 +178,18 @@ sections: instruction: Define all collectible items and their placement rules template: | **Collectible Types:** - + - {{collectible_1}}: {{value_and_purpose}} - {{collectible_2}}: {{value_and_purpose}} - + **Placement Guidelines:** - + - Mandatory collectibles: {{placement_rules}} - Optional collectibles: {{placement_rules}} - Secret collectibles: {{placement_rules}} - + **Reward Distribution:** - + - Easy to find: {{percentage}}% - Moderate challenge: {{percentage}}% - High skill required: {{percentage}}% @@ -198,18 +198,18 @@ sections: instruction: Define how enemies should be placed and balanced in levels template: | **Enemy Categories:** - + - {{enemy_type_1}}: {{behavior_and_usage}} - {{enemy_type_2}}: {{behavior_and_usage}} - + **Placement Principles:** - + - Introduction encounters: {{guideline}} - Standard encounters: {{guideline}} - Challenge encounters: {{guideline}} - + **Difficulty Scaling:** - + - Enemy count progression: {{scaling_rule}} - Enemy type introduction: {{pacing_rule}} - Encounter complexity: {{complexity_rule}} @@ -222,14 +222,14 @@ sections: title: Level Layout Principles template: | **Spatial Design:** - + - Grid size: {{grid_dimensions}} - Minimum path width: {{width_units}} - Maximum vertical distance: {{height_units}} - Safe zones placement: {{safety_guidelines}} - + **Navigation Design:** - + - Clear path indication: {{visual_cues}} - Landmark placement: {{landmark_rules}} - Dead end avoidance: {{dead_end_policy}} @@ -239,13 +239,13 @@ sections: instruction: Define how to control the rhythm and pace of gameplay within levels template: | **Action Sequences:** - + - High intensity duration: {{max_duration}} - Rest period requirement: {{min_rest_time}} - Intensity variation: {{pacing_pattern}} - + **Learning Sequences:** - + - New mechanic introduction: {{teaching_method}} - Practice opportunity: {{practice_duration}} - Skill application: {{application_context}} @@ -254,14 +254,14 @@ sections: instruction: Define how to create appropriate challenges for each level type template: | **Challenge Types:** - + - Execution challenges: {{skill_requirements}} - Puzzle challenges: {{complexity_guidelines}} - Time challenges: {{time_pressure_rules}} - Resource challenges: {{resource_management}} - + **Difficulty Calibration:** - + - Skill check frequency: {{frequency_guidelines}} - Failure recovery: {{retry_mechanics}} - Hint system integration: {{help_system}} @@ -275,7 +275,7 @@ sections: instruction: Define how level data should be structured for implementation template: | **Level File Format:** - + - Data format: {{json|yaml|custom}} - File naming: `level_{{world}}_{{number}}.{{extension}}` - Data organization: {{structure_description}} @@ -313,14 +313,14 @@ sections: instruction: Define how level assets are organized and loaded template: | **Tilemap Requirements:** - + - Tile size: {{tile_dimensions}}px - Tileset organization: {{tileset_structure}} - Layer organization: {{layer_system}} - Collision data: {{collision_format}} - + **Audio Integration:** - + - Background music: {{music_requirements}} - Ambient sounds: {{ambient_system}} - Dynamic audio: {{dynamic_audio_rules}} @@ -329,19 +329,19 @@ sections: instruction: Define performance requirements for level systems template: | **Entity Limits:** - + - Maximum active entities: {{entity_limit}} - Maximum particles: {{particle_limit}} - Maximum audio sources: {{audio_limit}} - + **Memory Management:** - + - Texture memory budget: {{texture_memory}}MB - Audio memory budget: {{audio_memory}}MB - Level loading time: <{{load_time}}s - + **Culling and LOD:** - + - Off-screen culling: {{culling_distance}} - Level-of-detail rules: {{lod_system}} - Asset streaming: {{streaming_requirements}} @@ -354,13 +354,13 @@ sections: title: Automated Testing template: | **Performance Testing:** - + - Frame rate validation: Maintain {{fps_target}} FPS - Memory usage monitoring: Stay under {{memory_limit}}MB - Loading time verification: Complete in <{{load_time}}s - + **Gameplay Testing:** - + - Completion path validation: All objectives achievable - Collectible accessibility: All items reachable - Softlock prevention: No unwinnable states @@ -388,14 +388,14 @@ sections: title: Balance Validation template: | **Metrics Collection:** - + - Completion rate: Target {{completion_percentage}}% - Average completion time: {{target_time}} ± {{variance}} - Death count per level: <{{max_deaths}} - Collectible discovery rate: {{discovery_percentage}}% - + **Iteration Guidelines:** - + - Adjustment criteria: {{criteria_for_changes}} - Testing sample size: {{minimum_testers}} - Validation period: {{testing_duration}} @@ -408,14 +408,14 @@ sections: title: Design Phase template: | **Concept Development:** - + 1. Define level purpose and goals 2. Create rough layout sketch 3. Identify key mechanics and challenges 4. Estimate difficulty and duration - + **Documentation Requirements:** - + - Level design brief - Layout diagrams - Mechanic integration notes @@ -424,15 +424,15 @@ sections: title: Implementation Phase template: | **Technical Implementation:** - + 1. Create level data file 2. Build tilemap and layout 3. Place entities and objects 4. Configure level logic and triggers 5. Integrate audio and visual effects - + **Quality Assurance:** - + 1. Automated testing execution 2. Internal playtesting 3. Performance validation @@ -441,14 +441,14 @@ sections: title: Integration Phase template: | **Game Integration:** - + 1. Level progression integration 2. Save system compatibility 3. Analytics integration 4. Achievement system integration - + **Final Validation:** - + 1. Full game context testing 2. Performance regression testing 3. Platform compatibility verification @@ -481,4 +481,4 @@ sections: - Difficulty curve adherence: {{curve_accuracy}} - Mechanic integration effectiveness: {{integration_score}} - Player guidance clarity: {{guidance_score}} - - Content accessibility: {{accessibility_rate}}% \ No newline at end of file + - Content accessibility: {{accessibility_rate}}% diff --git a/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml b/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml index 21b7a1cc..9c9e4415 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml +++ b/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml @@ -17,21 +17,21 @@ workflow: - brainstorming_session - game_research_prompt - player_research - notes: 'Start with brainstorming game concepts, then create comprehensive game brief. SAVE OUTPUT: Copy final game-brief.md to your project''s docs/design/ folder.' + notes: "Start with brainstorming game concepts, then create comprehensive game brief. SAVE OUTPUT: Copy final game-brief.md to your project's docs/design/ folder." - agent: game-designer creates: game-design-doc.md requires: game-brief.md optional_steps: - competitive_analysis - technical_research - notes: 'Create detailed Game Design Document using game-design-doc-tmpl. Defines all gameplay mechanics, progression, and technical requirements. SAVE OUTPUT: Copy final game-design-doc.md to your project''s docs/design/ folder.' + notes: "Create detailed Game Design Document using game-design-doc-tmpl. Defines all gameplay mechanics, progression, and technical requirements. SAVE OUTPUT: Copy final game-design-doc.md to your project's docs/design/ folder." - agent: game-designer creates: level-design-doc.md requires: game-design-doc.md optional_steps: - level_prototyping - difficulty_analysis - notes: 'Create level design framework using level-design-doc-tmpl. Establishes content creation guidelines and performance requirements. SAVE OUTPUT: Copy final level-design-doc.md to your project''s docs/design/ folder.' + notes: "Create level design framework using level-design-doc-tmpl. Establishes content creation guidelines and performance requirements. SAVE OUTPUT: Copy final level-design-doc.md to your project's docs/design/ folder." - agent: solution-architect creates: game-architecture.md requires: @@ -41,7 +41,7 @@ workflow: - technical_research_prompt - performance_analysis - platform_research - notes: 'Create comprehensive technical architecture using game-architecture-tmpl. Defines Phaser 3 systems, performance optimization, and code structure. SAVE OUTPUT: Copy final game-architecture.md to your project''s docs/architecture/ folder.' + notes: "Create comprehensive technical architecture using game-architecture-tmpl. Defines Phaser 3 systems, performance optimization, and code structure. SAVE OUTPUT: Copy final game-architecture.md to your project's docs/architecture/ folder." - agent: game-designer validates: design_consistency requires: all_design_documents @@ -66,7 +66,7 @@ workflow: optional_steps: - quick_brainstorming - concept_validation - notes: 'Create focused game brief for prototype. Emphasize core mechanics and immediate playability. SAVE OUTPUT: Copy final game-brief.md to your project''s docs/ folder.' + notes: "Create focused game brief for prototype. Emphasize core mechanics and immediate playability. SAVE OUTPUT: Copy final game-brief.md to your project's docs/ folder." - agent: game-designer creates: prototype-design.md uses: create-doc prototype-design OR create-game-story diff --git a/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml b/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml index c61e4fc8..4b5b48f1 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml +++ b/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml @@ -44,7 +44,7 @@ workflow: notes: Implement stories in priority order. Test frequently and adjust design based on what feels fun. Document discoveries. workflow_end: action: prototype_evaluation - notes: 'Prototype complete. Evaluate core mechanics, gather feedback, and decide next steps: iterate, expand, or archive.' + notes: "Prototype complete. Evaluate core mechanics, gather feedback, and decide next steps: iterate, expand, or archive." game_jam_sequence: - step: jam_concept agent: game-designer diff --git a/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.md b/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.md index a14406f3..fb28eab3 100644 --- a/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.md +++ b/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.md @@ -61,13 +61,13 @@ commands: - explain: teach me what and why you did whatever you just did in detail so I can learn. Explain to me as if you were training a junior Unity developer. - exit: Say goodbye as the Game Developer, and then abandon inhabiting this persona develop-story: - order-of-execution: "Read (first or next) task→Implement Task and its subtasks→Write tests→Execute validations→Only if ALL pass, then update the task checkbox with [x]→Update story section File List to ensure it lists and new or modified or deleted source file→repeat order-of-execution until complete" + order-of-execution: 'Read (first or next) task→Implement Task and its subtasks→Write tests→Execute validations→Only if ALL pass, then update the task checkbox with [x]→Update story section File List to ensure it lists and new or modified or deleted source file→repeat order-of-execution until complete' story-file-updates-ONLY: - CRITICAL: ONLY UPDATE THE STORY FILE WITH UPDATES TO SECTIONS INDICATED BELOW. DO NOT MODIFY ANY OTHER SECTIONS. - CRITICAL: You are ONLY authorized to edit these specific sections of story files - Tasks / Subtasks Checkboxes, Dev Agent Record section and all its subsections, Agent Model Used, Debug Log References, Completion Notes List, File List, Change Log, Status - CRITICAL: DO NOT modify Status, Story, Acceptance Criteria, Dev Notes, Testing sections, or any other sections not listed above - blocking: "HALT for: Unapproved deps needed, confirm with user | Ambiguous after story check | 3 failures attempting to implement or fix something repeatedly | Missing config | Failing regression" - ready-for-review: "Code matches requirements + All validations pass + Follows Unity & C# standards + File List complete + Stable FPS" + blocking: 'HALT for: Unapproved deps needed, confirm with user | Ambiguous after story check | 3 failures attempting to implement or fix something repeatedly | Missing config | Failing regression' + ready-for-review: 'Code matches requirements + All validations pass + Follows Unity & C# standards + File List complete + Stable FPS' completion: "All Tasks and Subtasks marked [x] and have tests→Validations and full regression passes (DON'T BE LAZY, EXECUTE ALL TESTS and CONFIRM)→Ensure File List is Complete→run the task execute-checklist for the checklist game-story-dod-checklist→set story status: 'Ready for Review'→HALT" dependencies: tasks: diff --git a/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md b/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md index 005171da..97579dad 100644 --- a/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md +++ b/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md @@ -456,7 +456,7 @@ Use the `shard-doc` task or `@kayvan/markdown-tree-parser` tool for automatic ga - **Claude Code**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Cursor**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` -- **Windsurf**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` +- **Windsurf**: `/bmad2du/game-designer`, `/bmad2du/game-developer`, `/bmad2du/game-sm`, `/bmad2du/game-architect` - **Trae**: `@bmad2du/game-designer`, `@bmad2du/game-developer`, `@bmad2du/game-sm`, `@bmad2du/game-architect` - **Roo Code**: Select mode from mode selector with bmad2du prefix - **GitHub Copilot**: Open the Chat view (`⌃⌘I` on Mac, `Ctrl+Alt+I` on Windows/Linux) and select the appropriate game agent. diff --git a/expansion-packs/bmad-2d-unity-game-dev/templates/game-brief-tmpl.yaml b/expansion-packs/bmad-2d-unity-game-dev/templates/game-brief-tmpl.yaml index ff191a48..1769ef29 100644 --- a/expansion-packs/bmad-2d-unity-game-dev/templates/game-brief-tmpl.yaml +++ b/expansion-packs/bmad-2d-unity-game-dev/templates/game-brief-tmpl.yaml @@ -14,7 +14,7 @@ sections: - id: initial-setup instruction: | This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. - id: game-vision @@ -71,7 +71,7 @@ sections: repeatable: true template: | **Core Mechanic: {{mechanic_name}}** - + - **Description:** {{how_it_works}} - **Player Value:** {{why_its_fun}} - **Implementation Scope:** {{complexity_estimate}} @@ -98,12 +98,12 @@ sections: title: Technical Constraints template: | **Platform Requirements:** - + - Primary: {{platform_1}} - {{requirements}} - Secondary: {{platform_2}} - {{requirements}} - + **Technical Specifications:** - + - Engine: Unity & C# - Performance Target: {{fps_target}} FPS on {{target_device}} - Memory Budget: <{{memory_limit}}MB @@ -141,10 +141,10 @@ sections: title: Competitive Analysis template: | **Direct Competitors:** - + - {{competitor_1}}: {{strengths_and_weaknesses}} - {{competitor_2}}: {{strengths_and_weaknesses}} - + **Differentiation Strategy:** {{how_we_differ_and_why_thats_valuable}} - id: market-opportunity @@ -168,16 +168,16 @@ sections: title: Content Categories template: | **Core Content:** - + - {{content_type_1}}: {{quantity_and_description}} - {{content_type_2}}: {{quantity_and_description}} - + **Optional Content:** - + - {{optional_content_type}}: {{quantity_and_description}} - + **Replay Elements:** - + - {{replayability_features}} - id: difficulty-accessibility title: Difficulty and Accessibility @@ -244,13 +244,13 @@ sections: title: Player Experience Metrics template: | **Engagement Goals:** - + - Tutorial completion rate: >{{percentage}}% - Average session length: {{duration}} minutes - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - + **Quality Benchmarks:** - + - Player satisfaction: >{{rating}}/10 - Completion rate: >{{percentage}}% - Technical performance: {{fps_target}} FPS consistent @@ -258,13 +258,13 @@ sections: title: Development Metrics template: | **Technical Targets:** - + - Zero critical bugs at launch - Performance targets met on all platforms - Load times under {{seconds}}s - + **Process Goals:** - + - Development timeline adherence - Feature scope completion - Quality assurance standards @@ -273,7 +273,7 @@ sections: condition: has_business_goals template: | **Commercial Goals:** - + - {{revenue_target}} in first {{time_period}} - {{user_acquisition_target}} players in first {{time_period}} - {{retention_target}} monthly active users @@ -326,12 +326,12 @@ sections: title: Validation Plan template: | **Concept Testing:** - + - {{validation_method_1}} - {{timeline}} - {{validation_method_2}} - {{timeline}} - + **Prototype Testing:** - + - {{testing_approach}} - {{timeline}} - {{feedback_collection_method}} - {{timeline}} @@ -353,4 +353,4 @@ sections: type: table template: | | Date | Version | Description | Author | - | :--- | :------ | :---------- | :----- | \ No newline at end of file + | :--- | :------ | :---------- | :----- | diff --git a/expansion-packs/bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml b/expansion-packs/bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml index 50656137..60e7819b 100644 --- a/expansion-packs/bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml +++ b/expansion-packs/bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml @@ -95,7 +95,7 @@ sections: instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions for Unity implementation. template: | **Primary Loop ({{duration}} seconds):** - + 1. {{action_1}} ({{time_1}}s) - {{unity_component}} 2. {{action_2}} ({{time_2}}s) - {{unity_component}} 3. {{action_3}} ({{time_3}}s) - {{unity_component}} @@ -107,12 +107,12 @@ sections: instruction: Clearly define success and failure states with Unity-specific implementation notes template: | **Victory Conditions:** - + - {{win_condition_1}} - Unity Event: {{unity_event}} - {{win_condition_2}} - Unity Event: {{unity_event}} - + **Failure States:** - + - {{loss_condition_1}} - Trigger: {{unity_trigger}} - {{loss_condition_2}} - Trigger: {{unity_trigger}} examples: @@ -132,22 +132,22 @@ sections: title: "{{mechanic_name}}" template: | **Description:** {{detailed_description}} - + **Player Input:** {{input_method}} - Unity Input System: {{input_action}} - + **System Response:** {{game_response}} - + **Unity Implementation Notes:** - + - **Components Needed:** {{component_list}} - **Physics Requirements:** {{physics_2d_setup}} - **Animation States:** {{animator_states}} - **Performance Considerations:** {{optimization_notes}} - + **Dependencies:** {{other_mechanics_needed}} - + **Script Architecture:** - + - {{script_name}}.cs - {{responsibility}} - {{manager_script}}.cs - {{management_role}} examples: @@ -173,15 +173,15 @@ sections: title: Player Progression template: | **Progression Type:** {{linear|branching|metroidvania}} - + **Key Milestones:** - + 1. **{{milestone_1}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} 2. **{{milestone_2}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} 3. **{{milestone_3}}** - {{unlock_description}} - Unity: {{scriptable_object_update}} - + **Save Data Structure:** - + ```csharp [System.Serializable] public class PlayerProgress @@ -197,13 +197,13 @@ sections: template: | **Tutorial Phase:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Early Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Mid Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} - + **Late Game:** {{duration}} - {{difficulty_description}} - Unity Config: {{scriptable_object_values}} examples: @@ -236,22 +236,22 @@ sections: **Target Duration:** {{target_time}} **Key Elements:** {{required_mechanics}} **Difficulty Rating:** {{relative_difficulty}} - + **Unity Scene Structure:** - + - **Environment:** {{tilemap_setup}} - **Gameplay Objects:** {{prefab_list}} - **Lighting:** {{lighting_setup}} - **Audio:** {{audio_sources}} - + **Level Flow Template:** - + - **Introduction:** {{intro_description}} - Area: {{unity_area_bounds}} - **Challenge:** {{main_challenge}} - Mechanics: {{active_components}} - **Resolution:** {{completion_requirement}} - Trigger: {{completion_trigger}} - + **Reusable Prefabs:** - + - {{prefab_name}} - {{prefab_purpose}} examples: - "Environment: TilemapRenderer with Platform tileset, Lighting: 2D Global Light + Point Lights" @@ -262,9 +262,9 @@ sections: **Total Levels:** {{number}} **Unlock Pattern:** {{progression_method}} **Scene Management:** {{unity_scene_loading}} - + **Unity Scene Organization:** - + - Scene Naming: {{naming_convention}} - Addressable Assets: {{addressable_groups}} - Loading Screens: {{loading_implementation}} @@ -289,13 +289,13 @@ sections: **Physics:** {{2D Only|3D Only|Hybrid}} **Scripting Backend:** {{Mono|IL2CPP}} **API Compatibility:** {{.NET Standard 2.1|.NET Framework}} - + **Required Packages:** - + - {{package_name}} {{version}} - {{purpose}} - + **Project Settings:** - + - Color Space: {{Linear|Gamma}} - Quality Settings: {{quality_levels}} - Physics Settings: {{physics_config}} @@ -309,9 +309,9 @@ sections: **Memory Usage:** <{{memory_limit}}MB heap, <{{texture_memory}}MB textures **Load Times:** <{{load_time}}s initial, <{{level_load}}s between levels **Battery Usage:** Optimized for mobile devices - {{battery_target}} hours gameplay - + **Unity Profiler Targets:** - + - CPU Frame Time: <{{cpu_time}}ms - GPU Frame Time: <{{gpu_time}}ms - GC Allocs: <{{gc_limit}}KB per frame @@ -322,20 +322,20 @@ sections: title: Platform Specific Requirements template: | **Desktop:** - + - Resolution: {{min_resolution}} - {{max_resolution}} - Input: Keyboard, Mouse, Gamepad ({{gamepad_support}}) - Build Target: {{desktop_targets}} - + **Mobile:** - + - Resolution: {{mobile_min}} - {{mobile_max}} - Input: Touch, Accelerometer ({{sensor_support}}) - OS: iOS {{ios_min}}+, Android {{android_min}}+ (API {{api_level}}) - Device Requirements: {{device_specs}} - + **Web (if applicable):** - + - WebGL Version: {{webgl_version}} - Browser Support: {{browser_list}} - Compression: {{compression_format}} @@ -346,21 +346,21 @@ sections: instruction: Define asset specifications for Unity pipeline optimization template: | **2D Art Assets:** - + - Sprites: {{sprite_resolution}} at {{ppu}} PPU - Texture Format: {{texture_compression}} - Atlas Strategy: {{sprite_atlas_setup}} - Animation: {{animation_type}} at {{framerate}} FPS - + **Audio Assets:** - + - Music: {{audio_format}} at {{sample_rate}} Hz - SFX: {{sfx_format}} at {{sfx_sample_rate}} Hz - Compression: {{audio_compression}} - 3D Audio: {{spatial_audio}} - + **UI Assets:** - + - Canvas Resolution: {{ui_resolution}} - UI Scale Mode: {{scale_mode}} - Font: {{font_requirements}} @@ -381,17 +381,17 @@ sections: title: Code Architecture Pattern template: | **Architecture Pattern:** {{MVC|MVVM|ECS|Component-Based|Custom}} - + **Core Systems Required:** - + - **Scene Management:** {{scene_manager_approach}} - **State Management:** {{state_pattern_implementation}} - **Event System:** {{event_system_choice}} - **Object Pooling:** {{pooling_strategy}} - **Save/Load System:** {{save_system_approach}} - + **Folder Structure:** - + ``` Assets/ ├── _Project/ @@ -401,9 +401,9 @@ sections: │ ├── Scenes/ │ └── {{additional_folders}} ``` - + **Naming Conventions:** - + - Scripts: {{script_naming}} - Prefabs: {{prefab_naming}} - Scenes: {{scene_naming}} @@ -414,19 +414,19 @@ sections: title: Unity Systems Integration template: | **Required Unity Systems:** - + - **Input System:** {{input_implementation}} - **Animation System:** {{animation_approach}} - **Physics Integration:** {{physics_usage}} - **Rendering Features:** {{rendering_requirements}} - **Asset Streaming:** {{asset_loading_strategy}} - + **Third-Party Integrations:** - + - {{integration_name}}: {{integration_purpose}} - + **Performance Systems:** - + - **Profiling Integration:** {{profiling_setup}} - **Memory Management:** {{memory_strategy}} - **Build Pipeline:** {{build_automation}} @@ -437,20 +437,20 @@ sections: title: Data Management template: | **Save Data Architecture:** - + - **Format:** {{PlayerPrefs|JSON|Binary|Cloud}} - **Structure:** {{save_data_organization}} - **Encryption:** {{security_approach}} - **Cloud Sync:** {{cloud_integration}} - + **Configuration Data:** - + - **ScriptableObjects:** {{scriptable_object_usage}} - **Settings Management:** {{settings_system}} - **Localization:** {{localization_approach}} - + **Runtime Data:** - + - **Caching Strategy:** {{cache_implementation}} - **Memory Pools:** {{pooling_objects}} - **Asset References:** {{asset_reference_system}} @@ -678,15 +678,15 @@ sections: instruction: Provide guidance for the Story Manager (SM) agent on how to break down this GDD into implementable user stories template: | **Epic Prioritization:** {{epic_order_rationale}} - + **Story Sizing Guidelines:** - + - Foundation stories: {{foundation_story_scope}} - Feature stories: {{feature_story_scope}} - Polish stories: {{polish_story_scope}} - + **Unity-Specific Story Considerations:** - + - Each story should result in testable Unity scenes or prefabs - Include specific Unity components and systems in acceptance criteria - Consider cross-platform testing requirements @@ -702,4 +702,4 @@ sections: examples: - "Unity Architect: Create detailed technical architecture document with specific Unity implementation patterns" - "Unity Developer: Implement core systems and gameplay mechanics according to architecture" - - "QA Tester: Validate performance metrics and cross-platform functionality" \ No newline at end of file + - "QA Tester: Validate performance metrics and cross-platform functionality" diff --git a/expansion-packs/bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml b/expansion-packs/bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml index 99e8f653..c2020b06 100644 --- a/expansion-packs/bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml +++ b/expansion-packs/bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml @@ -14,13 +14,13 @@ sections: - id: initial-setup instruction: | This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. - + Before starting, ensure you have access to: - + - Game Design Document (GDD) - Game Architecture Document - Any existing stories in this epic - + The story should be specific enough that a developer can implement it without requiring additional design decisions. - id: story-header @@ -69,12 +69,12 @@ sections: title: Files to Create/Modify template: | **New Files:** - + - `{{file_path_1}}` - {{purpose}} - `{{file_path_2}}` - {{purpose}} - + **Modified Files:** - + - `{{existing_file_1}}` - {{changes_needed}} - `{{existing_file_2}}` - {{changes_needed}} - id: class-interface-definitions @@ -157,13 +157,13 @@ sections: instruction: Reference the specific sections of the GDD that this story implements template: | **GDD Reference:** {{section_name}} ({{page_or_section_number}}) - + **Game Mechanic:** {{mechanic_name}} - + **Player Experience Goal:** {{experience_description}} - + **Balance Parameters:** - + - {{parameter_1}}: {{value_or_range}} - {{parameter_2}}: {{value_or_range}} @@ -210,15 +210,15 @@ sections: instruction: List any dependencies that must be completed before this story can be implemented template: | **Story Dependencies:** - + - {{story_id}}: {{dependency_description}} - + **Technical Dependencies:** - + - {{system_or_file}}: {{requirement}} - + **Asset Dependencies:** - + - {{asset_type}}: {{asset_description}} - Location: `{{asset_path}}` @@ -241,16 +241,16 @@ sections: instruction: Any additional context, design decisions, or implementation notes template: | **Implementation Notes:** - + - {{note_1}} - {{note_2}} - + **Design Decisions:** - + - {{decision_1}}: {{rationale}} - {{decision_2}}: {{rationale}} - + **Future Considerations:** - + - {{future_enhancement_1}} - {{future_optimization_1}} diff --git a/expansion-packs/bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml b/expansion-packs/bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml index e2ce44c8..2cba1051 100644 --- a/expansion-packs/bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml +++ b/expansion-packs/bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml @@ -14,7 +14,7 @@ sections: - id: initial-setup instruction: | This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. - id: introduction @@ -22,7 +22,7 @@ sections: instruction: Establish the purpose and scope of level design for this game content: | This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. sections: - id: change-log @@ -69,29 +69,29 @@ sections: title: "{{category_name}} Levels" template: | **Purpose:** {{gameplay_purpose}} - + **Target Duration:** {{min_time}} - {{max_time}} minutes - + **Difficulty Range:** {{difficulty_scale}} - + **Key Mechanics Featured:** - + - {{mechanic_1}} - {{usage_description}} - {{mechanic_2}} - {{usage_description}} - + **Player Objectives:** - + - Primary: {{primary_objective}} - Secondary: {{secondary_objective}} - Hidden: {{secret_objective}} - + **Success Criteria:** - + - {{completion_requirement_1}} - {{completion_requirement_2}} - + **Technical Requirements:** - + - Maximum entities: {{entity_limit}} - Performance target: {{fps_target}} FPS - Memory budget: {{memory_limit}}MB @@ -106,11 +106,11 @@ sections: instruction: Based on GDD requirements, define the overall level organization template: | **Organization Type:** {{linear|hub_world|open_world}} - + **Total Level Count:** {{number}} - + **World Breakdown:** - + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} @@ -145,7 +145,7 @@ sections: instruction: Define how players access new levels template: | **Progression Gates:** - + - Linear progression: Complete previous level - Star requirements: {{star_count}} stars to unlock - Skill gates: Demonstrate {{skill_requirement}} @@ -160,17 +160,17 @@ sections: instruction: Define all environmental components that can be used in levels template: | **Terrain Types:** - + - {{terrain_1}}: {{properties_and_usage}} - {{terrain_2}}: {{properties_and_usage}} - + **Interactive Objects:** - + - {{object_1}}: {{behavior_and_purpose}} - {{object_2}}: {{behavior_and_purpose}} - + **Hazards and Obstacles:** - + - {{hazard_1}}: {{damage_and_behavior}} - {{hazard_2}}: {{damage_and_behavior}} - id: collectibles-rewards @@ -178,18 +178,18 @@ sections: instruction: Define all collectible items and their placement rules template: | **Collectible Types:** - + - {{collectible_1}}: {{value_and_purpose}} - {{collectible_2}}: {{value_and_purpose}} - + **Placement Guidelines:** - + - Mandatory collectibles: {{placement_rules}} - Optional collectibles: {{placement_rules}} - Secret collectibles: {{placement_rules}} - + **Reward Distribution:** - + - Easy to find: {{percentage}}% - Moderate challenge: {{percentage}}% - High skill required: {{percentage}}% @@ -198,18 +198,18 @@ sections: instruction: Define how enemies should be placed and balanced in levels template: | **Enemy Categories:** - + - {{enemy_type_1}}: {{behavior_and_usage}} - {{enemy_type_2}}: {{behavior_and_usage}} - + **Placement Principles:** - + - Introduction encounters: {{guideline}} - Standard encounters: {{guideline}} - Challenge encounters: {{guideline}} - + **Difficulty Scaling:** - + - Enemy count progression: {{scaling_rule}} - Enemy type introduction: {{pacing_rule}} - Encounter complexity: {{complexity_rule}} @@ -222,14 +222,14 @@ sections: title: Level Layout Principles template: | **Spatial Design:** - + - Grid size: {{grid_dimensions}} - Minimum path width: {{width_units}} - Maximum vertical distance: {{height_units}} - Safe zones placement: {{safety_guidelines}} - + **Navigation Design:** - + - Clear path indication: {{visual_cues}} - Landmark placement: {{landmark_rules}} - Dead end avoidance: {{dead_end_policy}} @@ -239,13 +239,13 @@ sections: instruction: Define how to control the rhythm and pace of gameplay within levels template: | **Action Sequences:** - + - High intensity duration: {{max_duration}} - Rest period requirement: {{min_rest_time}} - Intensity variation: {{pacing_pattern}} - + **Learning Sequences:** - + - New mechanic introduction: {{teaching_method}} - Practice opportunity: {{practice_duration}} - Skill application: {{application_context}} @@ -254,14 +254,14 @@ sections: instruction: Define how to create appropriate challenges for each level type template: | **Challenge Types:** - + - Execution challenges: {{skill_requirements}} - Puzzle challenges: {{complexity_guidelines}} - Time challenges: {{time_pressure_rules}} - Resource challenges: {{resource_management}} - + **Difficulty Calibration:** - + - Skill check frequency: {{frequency_guidelines}} - Failure recovery: {{retry_mechanics}} - Hint system integration: {{help_system}} @@ -275,7 +275,7 @@ sections: instruction: Define how level data should be structured for implementation template: | **Level File Format:** - + - Data format: {{json|yaml|custom}} - File naming: `level_{{world}}_{{number}}.{{extension}}` - Data organization: {{structure_description}} @@ -313,14 +313,14 @@ sections: instruction: Define how level assets are organized and loaded template: | **Tilemap Requirements:** - + - Tile size: {{tile_dimensions}}px - Tileset organization: {{tileset_structure}} - Layer organization: {{layer_system}} - Collision data: {{collision_format}} - + **Audio Integration:** - + - Background music: {{music_requirements}} - Ambient sounds: {{ambient_system}} - Dynamic audio: {{dynamic_audio_rules}} @@ -329,19 +329,19 @@ sections: instruction: Define performance requirements for level systems template: | **Entity Limits:** - + - Maximum active entities: {{entity_limit}} - Maximum particles: {{particle_limit}} - Maximum audio sources: {{audio_limit}} - + **Memory Management:** - + - Texture memory budget: {{texture_memory}}MB - Audio memory budget: {{audio_memory}}MB - Level loading time: <{{load_time}}s - + **Culling and LOD:** - + - Off-screen culling: {{culling_distance}} - Level-of-detail rules: {{lod_system}} - Asset streaming: {{streaming_requirements}} @@ -354,13 +354,13 @@ sections: title: Automated Testing template: | **Performance Testing:** - + - Frame rate validation: Maintain {{fps_target}} FPS - Memory usage monitoring: Stay under {{memory_limit}}MB - Loading time verification: Complete in <{{load_time}}s - + **Gameplay Testing:** - + - Completion path validation: All objectives achievable - Collectible accessibility: All items reachable - Softlock prevention: No unwinnable states @@ -388,14 +388,14 @@ sections: title: Balance Validation template: | **Metrics Collection:** - + - Completion rate: Target {{completion_percentage}}% - Average completion time: {{target_time}} ± {{variance}} - Death count per level: <{{max_deaths}} - Collectible discovery rate: {{discovery_percentage}}% - + **Iteration Guidelines:** - + - Adjustment criteria: {{criteria_for_changes}} - Testing sample size: {{minimum_testers}} - Validation period: {{testing_duration}} @@ -408,14 +408,14 @@ sections: title: Design Phase template: | **Concept Development:** - + 1. Define level purpose and goals 2. Create rough layout sketch 3. Identify key mechanics and challenges 4. Estimate difficulty and duration - + **Documentation Requirements:** - + - Level design brief - Layout diagrams - Mechanic integration notes @@ -424,15 +424,15 @@ sections: title: Implementation Phase template: | **Technical Implementation:** - + 1. Create level data file 2. Build tilemap and layout 3. Place entities and objects 4. Configure level logic and triggers 5. Integrate audio and visual effects - + **Quality Assurance:** - + 1. Automated testing execution 2. Internal playtesting 3. Performance validation @@ -441,14 +441,14 @@ sections: title: Integration Phase template: | **Game Integration:** - + 1. Level progression integration 2. Save system compatibility 3. Analytics integration 4. Achievement system integration - + **Final Validation:** - + 1. Full game context testing 2. Performance regression testing 3. Platform compatibility verification @@ -481,4 +481,4 @@ sections: - Difficulty curve adherence: {{curve_accuracy}} - Mechanic integration effectiveness: {{integration_score}} - Player guidance clarity: {{guidance_score}} - - Content accessibility: {{accessibility_rate}}% \ No newline at end of file + - Content accessibility: {{accessibility_rate}}% diff --git a/expansion-packs/bmad-2d-unity-game-dev/workflows/game-dev-greenfield.yaml b/expansion-packs/bmad-2d-unity-game-dev/workflows/game-dev-greenfield.yaml index 0cc9428b..946d516a 100644 --- a/expansion-packs/bmad-2d-unity-game-dev/workflows/game-dev-greenfield.yaml +++ b/expansion-packs/bmad-2d-unity-game-dev/workflows/game-dev-greenfield.yaml @@ -17,21 +17,21 @@ workflow: - brainstorming_session - game_research_prompt - player_research - notes: 'Start with brainstorming game concepts, then create comprehensive game brief. SAVE OUTPUT: Copy final game-brief.md to your project''s docs/design/ folder.' + notes: "Start with brainstorming game concepts, then create comprehensive game brief. SAVE OUTPUT: Copy final game-brief.md to your project's docs/design/ folder." - agent: game-designer creates: game-design-doc.md requires: game-brief.md optional_steps: - competitive_analysis - technical_research - notes: 'Create detailed Game Design Document using game-design-doc-tmpl. Defines all gameplay mechanics, progression, and technical requirements. SAVE OUTPUT: Copy final game-design-doc.md to your project''s docs/design/ folder.' + notes: "Create detailed Game Design Document using game-design-doc-tmpl. Defines all gameplay mechanics, progression, and technical requirements. SAVE OUTPUT: Copy final game-design-doc.md to your project's docs/design/ folder." - agent: game-designer creates: level-design-doc.md requires: game-design-doc.md optional_steps: - level_prototyping - difficulty_analysis - notes: 'Create level design framework using level-design-doc-tmpl. Establishes content creation guidelines and performance requirements. SAVE OUTPUT: Copy final level-design-doc.md to your project''s docs/design/ folder.' + notes: "Create level design framework using level-design-doc-tmpl. Establishes content creation guidelines and performance requirements. SAVE OUTPUT: Copy final level-design-doc.md to your project's docs/design/ folder." - agent: solution-architect creates: game-architecture.md requires: @@ -41,7 +41,7 @@ workflow: - technical_research_prompt - performance_analysis - platform_research - notes: 'Create comprehensive technical architecture using game-architecture-tmpl. Defines Unity systems, performance optimization, and code structure. SAVE OUTPUT: Copy final game-architecture.md to your project''s docs/architecture/ folder.' + notes: "Create comprehensive technical architecture using game-architecture-tmpl. Defines Unity systems, performance optimization, and code structure. SAVE OUTPUT: Copy final game-architecture.md to your project's docs/architecture/ folder." - agent: game-designer validates: design_consistency requires: all_design_documents @@ -66,7 +66,7 @@ workflow: optional_steps: - quick_brainstorming - concept_validation - notes: 'Create focused game brief for prototype. Emphasize core mechanics and immediate playability. SAVE OUTPUT: Copy final game-brief.md to your project''s docs/ folder.' + notes: "Create focused game brief for prototype. Emphasize core mechanics and immediate playability. SAVE OUTPUT: Copy final game-brief.md to your project's docs/ folder." - agent: game-designer creates: prototype-design.md uses: create-doc prototype-design OR create-game-story diff --git a/expansion-packs/bmad-2d-unity-game-dev/workflows/game-prototype.yaml b/expansion-packs/bmad-2d-unity-game-dev/workflows/game-prototype.yaml index e3b3ff91..e91b160f 100644 --- a/expansion-packs/bmad-2d-unity-game-dev/workflows/game-prototype.yaml +++ b/expansion-packs/bmad-2d-unity-game-dev/workflows/game-prototype.yaml @@ -44,7 +44,7 @@ workflow: notes: Implement stories in priority order. Test frequently in the Unity Editor and adjust design based on what feels fun. Document discoveries. workflow_end: action: prototype_evaluation - notes: 'Prototype complete. Evaluate core mechanics, gather feedback, and decide next steps: iterate, expand, or archive.' + notes: "Prototype complete. Evaluate core mechanics, gather feedback, and decide next steps: iterate, expand, or archive." game_jam_sequence: - step: jam_concept agent: game-designer diff --git a/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml b/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml index 2775b247..87426507 100644 --- a/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +++ b/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml @@ -27,18 +27,18 @@ sections: - id: initial-setup instruction: | Initial Setup - + 1. Replace {{project_name}} with the actual project name throughout the document 2. Gather and review required inputs: - Product Requirements Document (PRD) - Required for business needs and scale requirements - Main System Architecture - Required for infrastructure dependencies - Technical Preferences/Tech Stack Document - Required for technology choices - PRD Technical Assumptions - Required for cross-referencing repository and service architecture - + If any required documents are missing, ask user: "I need the following documents to create a comprehensive infrastructure architecture: [list missing]. Would you like to proceed with available information or provide the missing documents first?" - + 3. Cross-reference with PRD Technical Assumptions to ensure infrastructure decisions align with repository and service architecture decisions made in the system architecture. - + Output file location: `docs/infrastructure-architecture.md` - id: infrastructure-overview @@ -67,7 +67,7 @@ sections: - Repository Structure - State Management - Dependency Management - + All infrastructure must be defined as code. No manual resource creation in production environments. - id: environment-configuration @@ -103,7 +103,7 @@ sections: title: Network Architecture instruction: | Design network topology considering security zones, traffic patterns, and compliance requirements. Reference main architecture for service communication patterns. - + Create Mermaid diagram showing: - VPC/Network structure - Security zones and boundaries @@ -166,7 +166,7 @@ sections: title: Data Resources instruction: | Design data infrastructure based on data architecture from main system design. Consider data volumes, access patterns, compliance, and recovery requirements. - + Create data flow diagram showing: - Database topology - Replication patterns @@ -187,7 +187,7 @@ sections: - Data Encryption - Compliance Controls - Security Scanning & Monitoring - + Apply principle of least privilege for all access controls. Document all security exceptions with business justification. - id: shared-responsibility @@ -223,7 +223,7 @@ sections: title: CI/CD Pipeline instruction: | Design deployment pipeline that balances speed with safety. Include progressive deployment strategies and automated quality gates. - + Create pipeline diagram showing: - Build stages - Test gates @@ -254,7 +254,7 @@ sections: - Recovery Procedures - RTO & RPO Targets - DR Testing Approach - + DR procedures must be tested at least quarterly. Document test results and improvement actions. - id: cost-optimization @@ -296,15 +296,15 @@ sections: title: DevOps/Platform Feasibility Review instruction: | CRITICAL STEP - Present architectural blueprint summary to DevOps/Platform Engineering Agent for feasibility review. Request specific feedback on: - + - **Operational Complexity:** Are the proposed patterns implementable with current tooling and expertise? - **Resource Constraints:** Do infrastructure requirements align with available resources and budgets? - **Security Implementation:** Are security patterns achievable with current security toolchain? - **Operational Overhead:** Will the proposed architecture create excessive operational burden? - **Technology Constraints:** Are selected technologies compatible with existing infrastructure? - + Document all feasibility feedback and concerns raised. Iterate on architectural decisions based on operational constraints and feedback. - + Address all critical feasibility concerns before proceeding to final architecture documentation. If critical blockers identified, revise architecture before continuing. sections: - id: feasibility-results @@ -322,7 +322,7 @@ sections: title: Validation Framework content: | This infrastructure architecture will be validated using the comprehensive `infrastructure-checklist.md`, with particular focus on Section 12: Architecture Documentation Validation. The checklist ensures: - + - Completeness of architecture documentation - Consistency with broader system architecture - Appropriate level of detail for different stakeholders @@ -332,12 +332,12 @@ sections: title: Validation Process content: | The architecture documentation validation should be performed: - + - After initial architecture development - After significant architecture changes - Before major implementation phases - During periodic architecture reviews - + The Platform Engineer should use the infrastructure checklist to systematically validate all aspects of this architecture document. - id: implementation-handoff @@ -348,7 +348,7 @@ sections: title: Architecture Decision Records (ADRs) content: | Create ADRs for key infrastructure decisions: - + - Cloud provider selection rationale - Container orchestration platform choice - Networking architecture decisions @@ -358,7 +358,7 @@ sections: title: Implementation Validation Criteria content: | Define specific criteria for validating correct implementation: - + - Infrastructure as Code quality gates - Security compliance checkpoints - Performance benchmarks @@ -418,7 +418,7 @@ sections: instruction: Final Review - Ensure all sections are complete and consistent. Verify feasibility review was conducted and all concerns addressed. Apply final validation against infrastructure checklist. content: | --- - + _Document Version: 1.0_ _Last Updated: {{current_date}}_ - _Next Review: {{review_date}}_ \ No newline at end of file + _Next Review: {{review_date}}_ diff --git a/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml b/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml index 84cfc12a..58fd57f5 100644 --- a/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +++ b/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml @@ -28,7 +28,7 @@ sections: - id: initial-setup instruction: | Initial Setup - + 1. Replace {{project_name}} with the actual project name throughout the document 2. Gather and review required inputs: - **Infrastructure Architecture Document** (Primary input - REQUIRED) @@ -37,10 +37,10 @@ sections: - Technology Stack Document - Infrastructure Checklist - NOTE: If Infrastructure Architecture Document is missing, HALT and request: "I need the Infrastructure Architecture Document to proceed with platform implementation. This document defines the infrastructure design that we'll be implementing." - + 3. Validate that the infrastructure architecture has been reviewed and approved 4. All platform implementation must align with the approved infrastructure architecture. Any deviations require architect approval. - + Output file location: `docs/platform-infrastructure/platform-implementation.md` - id: executive-summary @@ -113,7 +113,7 @@ sections: # Example Terraform for VPC setup module "vpc" { source = "./modules/vpc" - + cidr_block = "{{vpc_cidr}}" availability_zones = {{availability_zones}} public_subnets = {{public_subnets}} @@ -508,7 +508,7 @@ sections: // K6 Load Test Example import http from 'k6/http'; import { check } from 'k6'; - + export let options = { stages: [ { duration: '5m', target: {{target_users}} }, @@ -622,8 +622,8 @@ sections: instruction: Final Review - Ensure all platform layers are properly implemented, integrated, and documented. Verify that the implementation fully supports the BMAD methodology and all agent workflows. Confirm successful validation against the infrastructure checklist. content: | --- - + _Platform Version: 1.0_ _Implementation Date: {{implementation_date}}_ _Next Review: {{review_date}}_ - _Approved by: {{architect_name}} (Architect), {{devops_name}} (DevOps/Platform Engineer)_ \ No newline at end of file + _Approved by: {{architect_name}} (Architect), {{devops_name}} (DevOps/Platform Engineer)_ diff --git a/package-lock.json b/package-lock.json index ed80ded1..9dfcae1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,17 +26,25 @@ "bmad-method": "tools/bmad-npx-wrapper.js" }, "devDependencies": { + "@eslint/js": "^9.33.0", "@semantic-release/changelog": "^6.0.3", "@semantic-release/git": "^10.0.1", + "eslint": "^9.33.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-n": "^17.21.3", + "eslint-plugin-unicorn": "^60.0.0", + "eslint-plugin-yml": "^1.18.0", "husky": "^9.1.7", "jest": "^30.0.4", "lint-staged": "^16.1.1", "prettier": "^3.5.3", + "prettier-plugin-packagejson": "^2.5.19", "semantic-release": "^22.0.0", + "yaml-eslint-parser": "^1.2.3", "yaml-lint": "^1.7.0" }, "engines": { - "node": ">=20.0.0" + "node": ">=20.10.0" } }, "node_modules/@ampproject/remapping": { @@ -614,6 +622,271 @@ "tslib": "^2.4.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", + "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", + "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", + "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", + "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "9.33.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.33.0.tgz", + "integrity": "sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", + "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.15.2", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@inquirer/external-editor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.0.tgz", @@ -2162,6 +2435,13 @@ "@types/ms": "*" } }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", @@ -2189,6 +2469,13 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/mdast": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", @@ -2526,6 +2813,29 @@ "win32" ] }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/agent-base": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", @@ -2550,6 +2860,23 @@ "node": ">=8" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -2935,6 +3262,19 @@ "dev": true, "license": "MIT" }, + "node_modules/builtin-modules": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-5.0.0.tgz", + "integrity": "sha512-bkXY9WsVpY7CvMhKSR6pZilZu9Ln5WDrKVBUXf2S443etkmEO4V58heTecXcUIsNsi4Rx8JUO4NfX1IcQl4deg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3006,6 +3346,13 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "dev": true, + "license": "MIT" + }, "node_modules/char-regex": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", @@ -3055,6 +3402,19 @@ "dev": true, "license": "MIT" }, + "node_modules/clean-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", + "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -3385,6 +3745,20 @@ "dev": true, "license": "MIT" }, + "node_modules/core-js-compat": { + "version": "3.45.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.45.0.tgz", + "integrity": "sha512-gRoVMBawZg0OnxaVv3zpqLLxaHmsubEGyTnqdpI/CEBvX4JadI1dMSHxagThprYRtSVbuQxvi6iUatdPxohHpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.25.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -3533,6 +3907,13 @@ "node": ">=4.0.0" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -3571,6 +3952,16 @@ "node": ">=6" } }, + "node_modules/detect-indent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-7.0.1.tgz", + "integrity": "sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -3702,6 +4093,20 @@ "dev": true, "license": "MIT" }, + "node_modules/enhanced-resolve": { + "version": "5.18.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", + "integrity": "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/env-ci": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/env-ci/-/env-ci-10.0.0.tgz", @@ -3902,6 +4307,494 @@ "node": ">=0.8.0" } }, + "node_modules/eslint": { + "version": "9.33.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.33.0.tgz", + "integrity": "sha512-TS9bTNIryDzStCpJN93aC5VRSW3uTx9sClUn4B87pwiCaJh220otoI0X8mJKr+VcPtniMdN8GKjlwgWGUv5ZKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.0", + "@eslint/config-helpers": "^0.3.1", + "@eslint/core": "^0.15.2", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.33.0", + "@eslint/plugin-kit": "^0.3.5", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-compat-utils": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz", + "integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-compat-utils/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-config-prettier": { + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-es-x": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz", + "integrity": "sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==", + "dev": true, + "funding": [ + "https://github.com/sponsors/ota-meshi", + "https://opencollective.com/eslint" + ], + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.1.2", + "@eslint-community/regexpp": "^4.11.0", + "eslint-compat-utils": "^0.5.1" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, + "node_modules/eslint-plugin-n": { + "version": "17.21.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.21.3.tgz", + "integrity": "sha512-MtxYjDZhMQgsWRm/4xYLL0i2EhusWT7itDxlJ80l1NND2AL2Vi5Mvneqv/ikG9+zpran0VsVRXTEHrpLmUZRNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.5.0", + "enhanced-resolve": "^5.17.1", + "eslint-plugin-es-x": "^7.8.0", + "get-tsconfig": "^4.8.1", + "globals": "^15.11.0", + "globrex": "^0.1.2", + "ignore": "^5.3.2", + "semver": "^7.6.3", + "ts-declaration-location": "^1.0.6" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": ">=8.23.0" + } + }, + "node_modules/eslint-plugin-n/node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-n/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint-plugin-n/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-unicorn": { + "version": "60.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-60.0.0.tgz", + "integrity": "sha512-QUzTefvP8stfSXsqKQ+vBQSEsXIlAiCduS/V1Em+FKgL9c21U/IIm20/e3MFy1jyCf14tHAhqC1sX8OTy6VUCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "@eslint-community/eslint-utils": "^4.7.0", + "@eslint/plugin-kit": "^0.3.3", + "change-case": "^5.4.4", + "ci-info": "^4.3.0", + "clean-regexp": "^1.0.0", + "core-js-compat": "^3.44.0", + "esquery": "^1.6.0", + "find-up-simple": "^1.0.1", + "globals": "^16.3.0", + "indent-string": "^5.0.0", + "is-builtin-module": "^5.0.0", + "jsesc": "^3.1.0", + "pluralize": "^8.0.0", + "regexp-tree": "^0.1.27", + "regjsparser": "^0.12.0", + "semver": "^7.7.2", + "strip-indent": "^4.0.0" + }, + "engines": { + "node": "^20.10.0 || >=21.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" + }, + "peerDependencies": { + "eslint": ">=9.29.0" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/globals": { + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.3.0.tgz", + "integrity": "sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-yml": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-1.18.0.tgz", + "integrity": "sha512-9NtbhHRN2NJa/s3uHchO3qVVZw0vyOIvWlXWGaKCr/6l3Go62wsvJK5byiI6ZoYztDsow4GnS69BZD3GnqH3hA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.2", + "escape-string-regexp": "4.0.0", + "eslint-compat-utils": "^0.6.0", + "natural-compare": "^1.4.0", + "yaml-eslint-parser": "^1.2.1" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-plugin-yml/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-yml/node_modules/eslint-compat-utils": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.6.5.tgz", + "integrity": "sha512-vAUHYzue4YAa2hNACjB8HvUQj5yehAZgiClyFVVom9cP8z5NSFq3PwB/TtJslN2zAMgRX6FCFCjYBbQh71g5RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-plugin-yml/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -3916,6 +4809,52 @@ "node": ">=4" } }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", @@ -3981,6 +4920,13 @@ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "license": "MIT" }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, "node_modules/fast-glob": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", @@ -4005,6 +4951,13 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, "node_modules/fastq": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", @@ -4040,6 +4993,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -4096,6 +5062,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, "node_modules/foreground-child": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", @@ -4260,6 +5247,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz", + "integrity": "sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/git-hooks-list": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-hooks-list/-/git-hooks-list-4.1.1.tgz", + "integrity": "sha512-cmP497iLq54AZnv4YRAEMnEyQ1eIn4tGKbmswqwmFV4GBnAqE8NLtWxxdXa++AalfgL5EBH4IxTPyquEuGY/jA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/fisker/git-hooks-list?sponsor=1" + } + }, "node_modules/git-log-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.1.tgz", @@ -4321,6 +5331,19 @@ "node": ">= 6" } }, + "node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/globby": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-14.1.0.tgz", @@ -4368,6 +5391,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true, + "license": "MIT" + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -4720,6 +5750,22 @@ "dev": true, "license": "MIT" }, + "node_modules/is-builtin-module": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-5.0.0.tgz", + "integrity": "sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "builtin-modules": "^5.0.0" + }, + "engines": { + "node": ">=18.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -5750,6 +6796,13 @@ "node": ">=6" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -5764,6 +6817,20 @@ "dev": true, "license": "MIT" }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -5823,6 +6890,16 @@ "node": "*" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -5833,6 +6910,20 @@ "node": ">=6" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/lilconfig": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", @@ -6097,6 +7188,13 @@ "integrity": "sha512-yv3cSQZmfpbIKo4Yo45B1taEvxjNvcpF1CEOc0Y6dEyvhPIfEJE3twDwPgWTPQubcSgXyBwBKG6wpQvWMDOf6Q==", "license": "MIT" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.uniqby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", @@ -7038,6 +8136,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/minimatch": { "version": "10.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", @@ -10020,6 +11128,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -10415,6 +11541,26 @@ "node": ">=8" } }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/prettier": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", @@ -10431,6 +11577,25 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-packagejson": { + "version": "2.5.19", + "resolved": "https://registry.npmjs.org/prettier-plugin-packagejson/-/prettier-plugin-packagejson-2.5.19.tgz", + "integrity": "sha512-Qsqp4+jsZbKMpEGZB1UP1pxeAT8sCzne2IwnKkr+QhUe665EXUo3BAvTf1kAPCqyMv9kg3ZmO0+7eOni/C6Uag==", + "dev": true, + "license": "MIT", + "dependencies": { + "sort-package-json": "3.4.0", + "synckit": "0.11.11" + }, + "peerDependencies": { + "prettier": ">= 1.16.0" + }, + "peerDependenciesMeta": { + "prettier": { + "optional": true + } + } + }, "node_modules/pretty-format": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.0.5.tgz", @@ -10473,6 +11638,16 @@ "dev": true, "license": "ISC" }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/pure-rand": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", @@ -10664,6 +11839,16 @@ "esprima": "~4.0.0" } }, + "node_modules/regexp-tree": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", + "dev": true, + "license": "MIT", + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, "node_modules/registry-auth-token": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.1.0.tgz", @@ -10677,6 +11862,32 @@ "node": ">=14" } }, + "node_modules/regjsparser": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", + "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~3.0.2" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/remark-parse": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", @@ -10741,6 +11952,16 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -11363,6 +12584,61 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/sort-object-keys": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sort-object-keys/-/sort-object-keys-1.1.3.tgz", + "integrity": "sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/sort-package-json": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-3.4.0.tgz", + "integrity": "sha512-97oFRRMM2/Js4oEA9LJhjyMlde+2ewpZQf53pgue27UkbEXfHJnDzHlUxQ/DWUkzqmp7DFwJp8D+wi/TYeQhpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-indent": "^7.0.1", + "detect-newline": "^4.0.1", + "git-hooks-list": "^4.0.0", + "is-plain-obj": "^4.1.0", + "semver": "^7.7.1", + "sort-object-keys": "^1.1.3", + "tinyglobby": "^0.2.12" + }, + "bin": { + "sort-package-json": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/sort-package-json/node_modules/detect-newline": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-4.0.1.tgz", + "integrity": "sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sort-package-json/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -11636,6 +12912,22 @@ "node": ">=6" } }, + "node_modules/strip-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -11694,6 +12986,16 @@ "url": "https://opencollective.com/synckit" } }, + "node_modules/tapable": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz", + "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/temp-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-3.0.0.tgz", @@ -11873,6 +13175,54 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/tinyglobby": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", + "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -11916,12 +13266,61 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/ts-declaration-location": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ts-declaration-location/-/ts-declaration-location-1.0.7.tgz", + "integrity": "sha512-EDyGAwH1gO0Ausm9gV6T2nUvBgXT5kGoCMJPllOaooZ+4VvJiKBdZE7wK18N1deEowhcUptS+5GXZK8U/fvpwA==", + "dev": true, + "funding": [ + { + "type": "ko-fi", + "url": "https://ko-fi.com/rebeccastevens" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/ts-declaration-location" + } + ], + "license": "BSD-3-Clause", + "dependencies": { + "picomatch": "^4.0.2" + }, + "peerDependencies": { + "typescript": ">=4.0.0" + } + }, + "node_modules/ts-declaration-location/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -11944,6 +13343,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typescript": { + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/uglify-js": { "version": "3.19.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", @@ -12191,6 +13605,16 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/url-join": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", @@ -12295,6 +13719,16 @@ "node": ">= 8" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -12408,6 +13842,36 @@ "node": ">= 14.6" } }, + "node_modules/yaml-eslint-parser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-1.3.0.tgz", + "integrity": "sha512-E/+VitOorXSLiAqtTd7Yqax0/pAS3xaYMP+AUUJGOK1OZG3rhcj9fcJOM5HJ2VrP1FrStVCWr1muTfQCdj4tAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.0.0", + "yaml": "^2.0.0" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + } + }, + "node_modules/yaml-eslint-parser/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/yaml-lint": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/yaml-lint/-/yaml-lint-1.7.0.tgz", diff --git a/package.json b/package.json index 9ea4938d..444f11eb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,23 @@ { + "$schema": "https://json.schemastore.org/package.json", "name": "bmad-method", "version": "5.0.0", "description": "Breakthrough Method of Agile AI-driven Development", + "keywords": [ + "agile", + "ai", + "orchestrator", + "development", + "methodology", + "agents", + "bmad" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/bmadcode/BMAD-METHOD.git" + }, + "license": "MIT", + "author": "Brian (BMad) Madison", "main": "tools/cli.js", "bin": { "bmad": "tools/bmad-npx-wrapper.js", @@ -11,27 +27,43 @@ "build": "node tools/cli.js build", "build:agents": "node tools/cli.js build --agents-only", "build:teams": "node tools/cli.js build --teams-only", - "list:agents": "node tools/cli.js list:agents", - "validate": "node tools/cli.js validate", "flatten": "node tools/flattener/main.js", + "format": "prettier --write \"**/*.{js,cjs,mjs,json,md,yaml}\"", + "format:check": "prettier --check \"**/*.{js,cjs,mjs,json,md,yaml}\"", "install:bmad": "node tools/installer/bin/bmad.js install", - "format": "prettier --write \"**/*.md\"", - "version:patch": "node tools/version-bump.js patch", - "version:minor": "node tools/version-bump.js minor", - "version:major": "node tools/version-bump.js major", - "version:expansion": "node tools/bump-expansion-version.js", - "version:expansion:set": "node tools/update-expansion-version.js", - "version:all": "node tools/bump-all-versions.js", - "version:all:minor": "node tools/bump-all-versions.js minor", - "version:all:major": "node tools/bump-all-versions.js major", - "version:all:patch": "node tools/bump-all-versions.js patch", - "version:expansion:all": "node tools/bump-all-versions.js", - "version:expansion:all:minor": "node tools/bump-all-versions.js minor", - "version:expansion:all:major": "node tools/bump-all-versions.js major", - "version:expansion:all:patch": "node tools/bump-all-versions.js patch", + "lint": "eslint . --ext .js,.cjs,.mjs,.yaml --max-warnings=0", + "lint:fix": "eslint . --ext .js,.cjs,.mjs,.yaml --fix", + "list:agents": "node tools/cli.js list:agents", + "prepare": "husky", "release": "semantic-release", "release:test": "semantic-release --dry-run --no-ci || echo 'Config test complete - authentication errors are expected locally'", - "prepare": "husky" + "validate": "node tools/cli.js validate", + "version:all": "node tools/bump-all-versions.js", + "version:all:major": "node tools/bump-all-versions.js major", + "version:all:minor": "node tools/bump-all-versions.js minor", + "version:all:patch": "node tools/bump-all-versions.js patch", + "version:expansion": "node tools/bump-expansion-version.js", + "version:expansion:all": "node tools/bump-all-versions.js", + "version:expansion:all:major": "node tools/bump-all-versions.js major", + "version:expansion:all:minor": "node tools/bump-all-versions.js minor", + "version:expansion:all:patch": "node tools/bump-all-versions.js patch", + "version:expansion:set": "node tools/update-expansion-version.js", + "version:major": "node tools/version-bump.js major", + "version:minor": "node tools/version-bump.js minor", + "version:patch": "node tools/version-bump.js patch" + }, + "lint-staged": { + "**/*.{js,cjs,mjs}": [ + "eslint --fix --max-warnings=0", + "prettier --write" + ], + "**/*.yaml": [ + "eslint --fix", + "prettier --write" + ], + "**/*.{json,md}": [ + "prettier --write" + ] }, "dependencies": { "@kayvan/markdown-tree-parser": "^1.5.0", @@ -46,37 +78,25 @@ "ora": "^5.4.1", "semver": "^7.6.3" }, - "keywords": [ - "agile", - "ai", - "orchestrator", - "development", - "methodology", - "agents", - "bmad" - ], - "author": "Brian (BMad) Madison", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/bmadcode/BMAD-METHOD.git" - }, - "engines": { - "node": ">=20.0.0" - }, "devDependencies": { + "@eslint/js": "^9.33.0", "@semantic-release/changelog": "^6.0.3", "@semantic-release/git": "^10.0.1", + "eslint": "^9.33.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-n": "^17.21.3", + "eslint-plugin-unicorn": "^60.0.0", + "eslint-plugin-yml": "^1.18.0", "husky": "^9.1.7", "jest": "^30.0.4", "lint-staged": "^16.1.1", "prettier": "^3.5.3", + "prettier-plugin-packagejson": "^2.5.19", "semantic-release": "^22.0.0", + "yaml-eslint-parser": "^1.2.3", "yaml-lint": "^1.7.0" }, - "lint-staged": { - "**/*.md": [ - "prettier --write" - ] + "engines": { + "node": ">=20.10.0" } } diff --git a/prettier.config.mjs b/prettier.config.mjs new file mode 100644 index 00000000..86a7539d --- /dev/null +++ b/prettier.config.mjs @@ -0,0 +1,32 @@ +export default { + $schema: 'https://json.schemastore.org/prettierrc', + printWidth: 100, + tabWidth: 2, + useTabs: false, + semi: true, + singleQuote: true, + trailingComma: 'all', + bracketSpacing: true, + arrowParens: 'always', + endOfLine: 'lf', + proseWrap: 'preserve', + overrides: [ + { + files: ['*.md'], + options: { proseWrap: 'preserve' }, + }, + { + files: ['*.yaml'], + options: { singleQuote: false }, + }, + { + files: ['*.json', '*.jsonc'], + options: { singleQuote: false }, + }, + { + files: ['*.cjs'], + options: { parser: 'babel' }, + }, + ], + plugins: ['prettier-plugin-packagejson'], +}; diff --git a/tools/bmad-npx-wrapper.js b/tools/bmad-npx-wrapper.js index 96c322ca..9c6daeee 100755 --- a/tools/bmad-npx-wrapper.js +++ b/tools/bmad-npx-wrapper.js @@ -5,30 +5,30 @@ * This file ensures proper execution when run via npx from GitHub */ -const { execSync } = require('child_process'); -const path = require('path'); -const fs = require('fs'); +const { execSync } = require('node:child_process'); +const path = require('node:path'); +const fs = require('node:fs'); // Check if we're running in an npx temporary directory const isNpxExecution = __dirname.includes('_npx') || __dirname.includes('.npm'); // If running via npx, we need to handle things differently if (isNpxExecution) { - const args = process.argv.slice(2); - + const arguments_ = process.argv.slice(2); + // Use the installer for all commands const bmadScriptPath = path.join(__dirname, 'installer', 'bin', 'bmad.js'); - + if (!fs.existsSync(bmadScriptPath)) { console.error('Error: Could not find bmad.js at', bmadScriptPath); console.error('Current directory:', __dirname); process.exit(1); } - + try { - execSync(`node "${bmadScriptPath}" ${args.join(' ')}`, { + execSync(`node "${bmadScriptPath}" ${arguments_.join(' ')}`, { stdio: 'inherit', - cwd: path.dirname(__dirname) + cwd: path.dirname(__dirname), }); } catch (error) { process.exit(error.status || 1); @@ -36,4 +36,4 @@ if (isNpxExecution) { } else { // Local execution - use installer for all commands require('./installer/bin/bmad.js'); -} \ No newline at end of file +} diff --git a/tools/builders/web-builder.js b/tools/builders/web-builder.js index dc6af2be..4ea30da4 100644 --- a/tools/builders/web-builder.js +++ b/tools/builders/web-builder.js @@ -1,23 +1,23 @@ -const fs = require("node:fs").promises; -const path = require("node:path"); -const DependencyResolver = require("../lib/dependency-resolver"); -const yamlUtils = require("../lib/yaml-utils"); +const fs = require('node:fs').promises; +const path = require('node:path'); +const DependencyResolver = require('../lib/dependency-resolver'); +const yamlUtilities = require('../lib/yaml-utils'); class WebBuilder { constructor(options = {}) { this.rootDir = options.rootDir || process.cwd(); - this.outputDirs = options.outputDirs || [path.join(this.rootDir, "dist")]; + this.outputDirs = options.outputDirs || [path.join(this.rootDir, 'dist')]; this.resolver = new DependencyResolver(this.rootDir); this.templatePath = path.join( this.rootDir, - "tools", - "md-assets", - "web-agent-startup-instructions.md" + 'tools', + 'md-assets', + 'web-agent-startup-instructions.md', ); } parseYaml(content) { - const yaml = require("js-yaml"); + const yaml = require('js-yaml'); return yaml.load(content); } @@ -26,7 +26,7 @@ class WebBuilder { // All resources get installed under the bundle root, so use that path const relativePath = path.relative(this.rootDir, filePath); const pathParts = relativePath.split(path.sep); - + let resourcePath; if (pathParts[0] === 'expansion-packs') { // For expansion packs, remove 'expansion-packs/packname' and use the rest @@ -35,18 +35,28 @@ class WebBuilder { // For bmad-core, common, etc., remove the first part resourcePath = pathParts.slice(1).join('/'); } - + return `.${bundleRoot}/${resourcePath}`; } generateWebInstructions(bundleType, packName = null) { // Generate dynamic web instructions based on bundle type const rootExample = packName ? `.${packName}` : '.bmad-core'; - const examplePath = packName ? `.${packName}/folder/filename.md` : '.bmad-core/folder/filename.md'; - const personasExample = packName ? `.${packName}/personas/analyst.md` : '.bmad-core/personas/analyst.md'; - const tasksExample = packName ? `.${packName}/tasks/create-story.md` : '.bmad-core/tasks/create-story.md'; - const utilsExample = packName ? `.${packName}/utils/template-format.md` : '.bmad-core/utils/template-format.md'; - const tasksRef = packName ? `.${packName}/tasks/create-story.md` : '.bmad-core/tasks/create-story.md'; + const examplePath = packName + ? `.${packName}/folder/filename.md` + : '.bmad-core/folder/filename.md'; + const personasExample = packName + ? `.${packName}/personas/analyst.md` + : '.bmad-core/personas/analyst.md'; + const tasksExample = packName + ? `.${packName}/tasks/create-story.md` + : '.bmad-core/tasks/create-story.md'; + const utilitiesExample = packName + ? `.${packName}/utils/template-format.md` + : '.bmad-core/utils/template-format.md'; + const tasksReference = packName + ? `.${packName}/tasks/create-story.md` + : '.bmad-core/tasks/create-story.md'; return `# Web Agent Bundle Instructions @@ -79,8 +89,8 @@ dependencies: These references map directly to bundle sections: -- \`utils: template-format\` → Look for \`==================== START: ${utilsExample} ====================\` -- \`tasks: create-story\` → Look for \`==================== START: ${tasksRef} ====================\` +- \`utils: template-format\` → Look for \`==================== START: ${utilitiesExample} ====================\` +- \`tasks: create-story\` → Look for \`==================== START: ${tasksReference} ====================\` 3. **Execution Context**: You are operating in a web environment. All your capabilities and knowledge are contained within this bundle. Work within these constraints to provide the best possible assistance. @@ -112,10 +122,10 @@ These references map directly to bundle sections: // Write to all output directories for (const outputDir of this.outputDirs) { - const outputPath = path.join(outputDir, "agents"); + const outputPath = path.join(outputDir, 'agents'); await fs.mkdir(outputPath, { recursive: true }); const outputFile = path.join(outputPath, `${agentId}.txt`); - await fs.writeFile(outputFile, bundle, "utf8"); + await fs.writeFile(outputFile, bundle, 'utf8'); } } @@ -131,10 +141,10 @@ These references map directly to bundle sections: // Write to all output directories for (const outputDir of this.outputDirs) { - const outputPath = path.join(outputDir, "teams"); + const outputPath = path.join(outputDir, 'teams'); await fs.mkdir(outputPath, { recursive: true }); const outputFile = path.join(outputPath, `${teamId}.txt`); - await fs.writeFile(outputFile, bundle, "utf8"); + await fs.writeFile(outputFile, bundle, 'utf8'); } } @@ -157,7 +167,7 @@ These references map directly to bundle sections: sections.push(this.formatSection(resourcePath, resource.content, 'bmad-core')); } - return sections.join("\n"); + return sections.join('\n'); } async buildTeamBundle(teamId) { @@ -182,40 +192,40 @@ These references map directly to bundle sections: sections.push(this.formatSection(resourcePath, resource.content, 'bmad-core')); } - return sections.join("\n"); + return sections.join('\n'); } processAgentContent(content) { // First, replace content before YAML with the template - const yamlContent = yamlUtils.extractYamlFromAgent(content); + const yamlContent = yamlUtilities.extractYamlFromAgent(content); if (!yamlContent) return content; const yamlMatch = content.match(/```ya?ml\n([\s\S]*?)\n```/); if (!yamlMatch) return content; - + const yamlStartIndex = content.indexOf(yamlMatch[0]); const yamlEndIndex = yamlStartIndex + yamlMatch[0].length; // Parse YAML and remove root and IDE-FILE-RESOLUTION properties try { - const yaml = require("js-yaml"); + const yaml = require('js-yaml'); const parsed = yaml.load(yamlContent); // Remove the properties if they exist at root level delete parsed.root; - delete parsed["IDE-FILE-RESOLUTION"]; - delete parsed["REQUEST-RESOLUTION"]; + delete parsed['IDE-FILE-RESOLUTION']; + delete parsed['REQUEST-RESOLUTION']; // Also remove from activation-instructions if they exist - if (parsed["activation-instructions"] && Array.isArray(parsed["activation-instructions"])) { - parsed["activation-instructions"] = parsed["activation-instructions"].filter( + if (parsed['activation-instructions'] && Array.isArray(parsed['activation-instructions'])) { + parsed['activation-instructions'] = parsed['activation-instructions'].filter( (instruction) => { return ( typeof instruction === 'string' && - !instruction.startsWith("IDE-FILE-RESOLUTION:") && - !instruction.startsWith("REQUEST-RESOLUTION:") + !instruction.startsWith('IDE-FILE-RESOLUTION:') && + !instruction.startsWith('REQUEST-RESOLUTION:') ); - } + }, ); } @@ -223,25 +233,25 @@ These references map directly to bundle sections: const cleanedYaml = yaml.dump(parsed, { lineWidth: -1 }); // Get the agent name from the YAML for the header - const agentName = parsed.agent?.id || "agent"; + const agentName = parsed.agent?.id || 'agent'; // Build the new content with just the agent header and YAML const newHeader = `# ${agentName}\n\nCRITICAL: 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:\n\n`; - const afterYaml = content.substring(yamlEndIndex); + const afterYaml = content.slice(Math.max(0, yamlEndIndex)); - return newHeader + "```yaml\n" + cleanedYaml.trim() + "\n```" + afterYaml; + return newHeader + '```yaml\n' + cleanedYaml.trim() + '\n```' + afterYaml; } catch (error) { - console.warn("Failed to process agent YAML:", error.message); + console.warn('Failed to process agent YAML:', error.message); // If parsing fails, return original content return content; } } formatSection(path, content, bundleRoot = 'bmad-core') { - const separator = "===================="; + const separator = '===================='; // Process agent content if this is an agent file - if (path.includes("/agents/")) { + if (path.includes('/agents/')) { content = this.processAgentContent(content); } @@ -252,17 +262,17 @@ These references map directly to bundle sections: `${separator} START: ${path} ${separator}`, content.trim(), `${separator} END: ${path} ${separator}`, - "", - ].join("\n"); + '', + ].join('\n'); } replaceRootReferences(content, bundleRoot) { // Replace {root} with the appropriate bundle root path - return content.replace(/\{root\}/g, `.${bundleRoot}`); + return content.replaceAll('{root}', `.${bundleRoot}`); } async validate() { - console.log("Validating agent configurations..."); + console.log('Validating agent configurations...'); const agents = await this.resolver.listAgents(); for (const agentId of agents) { try { @@ -274,7 +284,7 @@ These references map directly to bundle sections: } } - console.log("\nValidating team configurations..."); + console.log('\nValidating team configurations...'); const teams = await this.resolver.listTeams(); for (const teamId of teams) { try { @@ -299,54 +309,54 @@ These references map directly to bundle sections: } async buildExpansionPack(packName, options = {}) { - const packDir = path.join(this.rootDir, "expansion-packs", packName); - const outputDirs = [path.join(this.rootDir, "dist", "expansion-packs", packName)]; + const packDir = path.join(this.rootDir, 'expansion-packs', packName); + const outputDirectories = [path.join(this.rootDir, 'dist', 'expansion-packs', packName)]; // Clean output directories if requested if (options.clean !== false) { - for (const outputDir of outputDirs) { + for (const outputDir of outputDirectories) { try { await fs.rm(outputDir, { recursive: true, force: true }); - } catch (error) { + } catch { // Directory might not exist, that's fine } } } // Build individual agents first - const agentsDir = path.join(packDir, "agents"); + const agentsDir = path.join(packDir, 'agents'); try { const agentFiles = await fs.readdir(agentsDir); - const agentMarkdownFiles = agentFiles.filter((f) => f.endsWith(".md")); + const agentMarkdownFiles = agentFiles.filter((f) => f.endsWith('.md')); if (agentMarkdownFiles.length > 0) { console.log(` Building individual agents for ${packName}:`); for (const agentFile of agentMarkdownFiles) { - const agentName = agentFile.replace(".md", ""); + const agentName = agentFile.replace('.md', ''); console.log(` - ${agentName}`); // Build individual agent bundle const bundle = await this.buildExpansionAgentBundle(packName, packDir, agentName); // Write to all output directories - for (const outputDir of outputDirs) { - const agentsOutputDir = path.join(outputDir, "agents"); + for (const outputDir of outputDirectories) { + const agentsOutputDir = path.join(outputDir, 'agents'); await fs.mkdir(agentsOutputDir, { recursive: true }); const outputFile = path.join(agentsOutputDir, `${agentName}.txt`); - await fs.writeFile(outputFile, bundle, "utf8"); + await fs.writeFile(outputFile, bundle, 'utf8'); } } } - } catch (error) { + } catch { console.debug(` No agents directory found for ${packName}`); } // Build team bundle - const agentTeamsDir = path.join(packDir, "agent-teams"); + const agentTeamsDir = path.join(packDir, 'agent-teams'); try { const teamFiles = await fs.readdir(agentTeamsDir); - const teamFile = teamFiles.find((f) => f.endsWith(".yaml")); + const teamFile = teamFiles.find((f) => f.endsWith('.yaml')); if (teamFile) { console.log(` Building team bundle for ${packName}`); @@ -356,17 +366,17 @@ These references map directly to bundle sections: const bundle = await this.buildExpansionTeamBundle(packName, packDir, teamConfigPath); // Write to all output directories - for (const outputDir of outputDirs) { - const teamsOutputDir = path.join(outputDir, "teams"); + for (const outputDir of outputDirectories) { + const teamsOutputDir = path.join(outputDir, 'teams'); await fs.mkdir(teamsOutputDir, { recursive: true }); - const outputFile = path.join(teamsOutputDir, teamFile.replace(".yaml", ".txt")); - await fs.writeFile(outputFile, bundle, "utf8"); + const outputFile = path.join(teamsOutputDir, teamFile.replace('.yaml', '.txt')); + await fs.writeFile(outputFile, bundle, 'utf8'); console.log(` ✓ Created bundle: ${path.relative(this.rootDir, outputFile)}`); } } else { console.warn(` ⚠ No team configuration found in ${packName}/agent-teams/`); } - } catch (error) { + } catch { console.warn(` ⚠ No agent-teams directory found for ${packName}`); } } @@ -376,16 +386,16 @@ These references map directly to bundle sections: const sections = [template]; // Add agent configuration - const agentPath = path.join(packDir, "agents", `${agentName}.md`); - const agentContent = await fs.readFile(agentPath, "utf8"); + const agentPath = path.join(packDir, 'agents', `${agentName}.md`); + const agentContent = await fs.readFile(agentPath, 'utf8'); const agentWebPath = this.convertToWebPath(agentPath, packName); sections.push(this.formatSection(agentWebPath, agentContent, packName)); // Resolve and add agent dependencies - const yamlContent = yamlUtils.extractYamlFromAgent(agentContent); + const yamlContent = yamlUtilities.extractYamlFromAgent(agentContent); if (yamlContent) { try { - const yaml = require("js-yaml"); + const yaml = require('js-yaml'); const agentConfig = yaml.load(yamlContent); if (agentConfig.dependencies) { @@ -398,59 +408,43 @@ These references map directly to bundle sections: // Try expansion pack first const resourcePath = path.join(packDir, resourceType, resourceName); try { - const resourceContent = await fs.readFile(resourcePath, "utf8"); + const resourceContent = await fs.readFile(resourcePath, 'utf8'); const resourceWebPath = this.convertToWebPath(resourcePath, packName); - sections.push( - this.formatSection(resourceWebPath, resourceContent, packName) - ); + sections.push(this.formatSection(resourceWebPath, resourceContent, packName)); found = true; - } catch (error) { + } catch { // Not in expansion pack, continue } // If not found in expansion pack, try core if (!found) { - const corePath = path.join( - this.rootDir, - "bmad-core", - resourceType, - resourceName - ); + const corePath = path.join(this.rootDir, 'bmad-core', resourceType, resourceName); try { - const coreContent = await fs.readFile(corePath, "utf8"); + const coreContent = await fs.readFile(corePath, 'utf8'); const coreWebPath = this.convertToWebPath(corePath, packName); - sections.push( - this.formatSection(coreWebPath, coreContent, packName) - ); + sections.push(this.formatSection(coreWebPath, coreContent, packName)); found = true; - } catch (error) { + } catch { // Not in core either, continue } } // If not found in core, try common folder if (!found) { - const commonPath = path.join( - this.rootDir, - "common", - resourceType, - resourceName - ); + const commonPath = path.join(this.rootDir, 'common', resourceType, resourceName); try { - const commonContent = await fs.readFile(commonPath, "utf8"); + const commonContent = await fs.readFile(commonPath, 'utf8'); const commonWebPath = this.convertToWebPath(commonPath, packName); - sections.push( - this.formatSection(commonWebPath, commonContent, packName) - ); + sections.push(this.formatSection(commonWebPath, commonContent, packName)); found = true; - } catch (error) { + } catch { // Not in common either, continue } } if (!found) { console.warn( - ` ⚠ Dependency ${resourceType}#${resourceName} not found in expansion pack or core` + ` ⚠ Dependency ${resourceType}#${resourceName} not found in expansion pack or core`, ); } } @@ -462,7 +456,7 @@ These references map directly to bundle sections: } } - return sections.join("\n"); + return sections.join('\n'); } async buildExpansionTeamBundle(packName, packDir, teamConfigPath) { @@ -471,38 +465,38 @@ These references map directly to bundle sections: const sections = [template]; // Add team configuration and parse to get agent list - const teamContent = await fs.readFile(teamConfigPath, "utf8"); - const teamFileName = path.basename(teamConfigPath, ".yaml"); + const teamContent = await fs.readFile(teamConfigPath, 'utf8'); + const teamFileName = path.basename(teamConfigPath, '.yaml'); const teamConfig = this.parseYaml(teamContent); const teamWebPath = this.convertToWebPath(teamConfigPath, packName); sections.push(this.formatSection(teamWebPath, teamContent, packName)); // Get list of expansion pack agents const expansionAgents = new Set(); - const agentsDir = path.join(packDir, "agents"); + const agentsDir = path.join(packDir, 'agents'); try { const agentFiles = await fs.readdir(agentsDir); - for (const agentFile of agentFiles.filter((f) => f.endsWith(".md"))) { - const agentName = agentFile.replace(".md", ""); + for (const agentFile of agentFiles.filter((f) => f.endsWith('.md'))) { + const agentName = agentFile.replace('.md', ''); expansionAgents.add(agentName); } - } catch (error) { + } catch { console.warn(` ⚠ No agents directory found in ${packName}`); } // Build a map of all available expansion pack resources for override checking const expansionResources = new Map(); - const resourceDirs = ["templates", "tasks", "checklists", "workflows", "data"]; - for (const resourceDir of resourceDirs) { + const resourceDirectories = ['templates', 'tasks', 'checklists', 'workflows', 'data']; + for (const resourceDir of resourceDirectories) { const resourcePath = path.join(packDir, resourceDir); try { const resourceFiles = await fs.readdir(resourcePath); for (const resourceFile of resourceFiles.filter( - (f) => f.endsWith(".md") || f.endsWith(".yaml") + (f) => f.endsWith('.md') || f.endsWith('.yaml'), )) { expansionResources.set(`${resourceDir}#${resourceFile}`, true); } - } catch (error) { + } catch { // Directory might not exist, that's fine } } @@ -511,9 +505,9 @@ These references map directly to bundle sections: const agentsToProcess = teamConfig.agents || []; // Ensure bmad-orchestrator is always included for teams - if (!agentsToProcess.includes("bmad-orchestrator")) { + if (!agentsToProcess.includes('bmad-orchestrator')) { console.warn(` ⚠ Team ${teamFileName} missing bmad-orchestrator, adding automatically`); - agentsToProcess.unshift("bmad-orchestrator"); + agentsToProcess.unshift('bmad-orchestrator'); } // Track all dependencies from all agents (deduplicated) @@ -523,7 +517,7 @@ These references map directly to bundle sections: if (expansionAgents.has(agentId)) { // Use expansion pack version (override) const agentPath = path.join(agentsDir, `${agentId}.md`); - const agentContent = await fs.readFile(agentPath, "utf8"); + const agentContent = await fs.readFile(agentPath, 'utf8'); const expansionAgentWebPath = this.convertToWebPath(agentPath, packName); sections.push(this.formatSection(expansionAgentWebPath, agentContent, packName)); @@ -551,13 +545,13 @@ These references map directly to bundle sections: } else { // Use core BMad version try { - const coreAgentPath = path.join(this.rootDir, "bmad-core", "agents", `${agentId}.md`); - const coreAgentContent = await fs.readFile(coreAgentPath, "utf8"); + const coreAgentPath = path.join(this.rootDir, 'bmad-core', 'agents', `${agentId}.md`); + const coreAgentContent = await fs.readFile(coreAgentPath, 'utf8'); const coreAgentWebPath = this.convertToWebPath(coreAgentPath, packName); sections.push(this.formatSection(coreAgentWebPath, coreAgentContent, packName)); // Parse and collect dependencies from core agent - const yamlContent = yamlUtils.extractYamlFromAgent(coreAgentContent, true); + const yamlContent = yamlUtilities.extractYamlFromAgent(coreAgentContent, true); if (yamlContent) { try { const agentConfig = this.parseYaml(yamlContent); @@ -577,7 +571,7 @@ These references map directly to bundle sections: console.debug(`Failed to parse agent YAML for ${agentId}:`, error.message); } } - } catch (error) { + } catch { console.warn(` ⚠ Agent ${agentId} not found in core or expansion pack`); } } @@ -593,38 +587,38 @@ These references map directly to bundle sections: // We know it exists in expansion pack, find and load it const expansionPath = path.join(packDir, dep.type, dep.name); try { - const content = await fs.readFile(expansionPath, "utf8"); + const content = await fs.readFile(expansionPath, 'utf8'); const expansionWebPath = this.convertToWebPath(expansionPath, packName); sections.push(this.formatSection(expansionWebPath, content, packName)); console.log(` ✓ Using expansion override for ${key}`); found = true; - } catch (error) { + } catch { // Try next extension } } // If not found in expansion pack (or doesn't exist there), try core if (!found) { - const corePath = path.join(this.rootDir, "bmad-core", dep.type, dep.name); + const corePath = path.join(this.rootDir, 'bmad-core', dep.type, dep.name); try { - const content = await fs.readFile(corePath, "utf8"); + const content = await fs.readFile(corePath, 'utf8'); const coreWebPath = this.convertToWebPath(corePath, packName); sections.push(this.formatSection(coreWebPath, content, packName)); found = true; - } catch (error) { + } catch { // Not in core either, continue } } // If not found in core, try common folder if (!found) { - const commonPath = path.join(this.rootDir, "common", dep.type, dep.name); + const commonPath = path.join(this.rootDir, 'common', dep.type, dep.name); try { - const content = await fs.readFile(commonPath, "utf8"); + const content = await fs.readFile(commonPath, 'utf8'); const commonWebPath = this.convertToWebPath(commonPath, packName); sections.push(this.formatSection(commonWebPath, content, packName)); found = true; - } catch (error) { + } catch { // Not in common either, continue } } @@ -635,16 +629,16 @@ These references map directly to bundle sections: } // Add remaining expansion pack resources not already included as dependencies - for (const resourceDir of resourceDirs) { + for (const resourceDir of resourceDirectories) { const resourcePath = path.join(packDir, resourceDir); try { const resourceFiles = await fs.readdir(resourcePath); for (const resourceFile of resourceFiles.filter( - (f) => f.endsWith(".md") || f.endsWith(".yaml") + (f) => f.endsWith('.md') || f.endsWith('.yaml'), )) { const filePath = path.join(resourcePath, resourceFile); - const fileContent = await fs.readFile(filePath, "utf8"); - const fileName = resourceFile.replace(/\.(md|yaml)$/, ""); + const fileContent = await fs.readFile(filePath, 'utf8'); + const fileName = resourceFile.replace(/\.(md|yaml)$/, ''); // Only add if not already included as a dependency const resourceKey = `${resourceDir}#${fileName}`; @@ -654,21 +648,21 @@ These references map directly to bundle sections: sections.push(this.formatSection(resourceWebPath, fileContent, packName)); } } - } catch (error) { + } catch { // Directory might not exist, that's fine } } - return sections.join("\n"); + return sections.join('\n'); } async listExpansionPacks() { - const expansionPacksDir = path.join(this.rootDir, "expansion-packs"); + const expansionPacksDir = path.join(this.rootDir, 'expansion-packs'); try { const entries = await fs.readdir(expansionPacksDir, { withFileTypes: true }); return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name); - } catch (error) { - console.warn("No expansion-packs directory found"); + } catch { + console.warn('No expansion-packs directory found'); return []; } } diff --git a/tools/bump-all-versions.js b/tools/bump-all-versions.js index ef7fd60a..fd2736ae 100755 --- a/tools/bump-all-versions.js +++ b/tools/bump-all-versions.js @@ -1,11 +1,9 @@ -#!/usr/bin/env node - -const fs = require('fs'); -const path = require('path'); +const fs = require('node:fs'); +const path = require('node:path'); const yaml = require('js-yaml'); -const args = process.argv.slice(2); -const bumpType = args[0] || 'minor'; // default to minor +const arguments_ = process.argv.slice(2); +const bumpType = arguments_[0] || 'minor'; // default to minor if (!['major', 'minor', 'patch'].includes(bumpType)) { console.log('Usage: node bump-all-versions.js [major|minor|patch]'); @@ -15,22 +13,26 @@ if (!['major', 'minor', 'patch'].includes(bumpType)) { function bumpVersion(currentVersion, type) { const [major, minor, patch] = currentVersion.split('.').map(Number); - + switch (type) { - case 'major': + case 'major': { return `${major + 1}.0.0`; - case 'minor': + } + case 'minor': { return `${major}.${minor + 1}.0`; - case 'patch': + } + case 'patch': { return `${major}.${minor}.${patch + 1}`; - default: + } + default: { return currentVersion; + } } } async function bumpAllVersions() { const updatedItems = []; - + // First, bump the core version (package.json) const packagePath = path.join(__dirname, '..', 'package.json'); try { @@ -38,69 +40,76 @@ async function bumpAllVersions() { const packageJson = JSON.parse(packageContent); const oldCoreVersion = packageJson.version || '1.0.0'; const newCoreVersion = bumpVersion(oldCoreVersion, bumpType); - + packageJson.version = newCoreVersion; - + fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2) + '\n'); - - updatedItems.push({ type: 'core', name: 'BMad Core', oldVersion: oldCoreVersion, newVersion: newCoreVersion }); + + updatedItems.push({ + type: 'core', + name: 'BMad Core', + oldVersion: oldCoreVersion, + newVersion: newCoreVersion, + }); console.log(`✓ BMad Core (package.json): ${oldCoreVersion} → ${newCoreVersion}`); } catch (error) { console.error(`✗ Failed to update BMad Core: ${error.message}`); } - + // Then, bump all expansion packs const expansionPacksDir = path.join(__dirname, '..', 'expansion-packs'); - + try { const entries = fs.readdirSync(expansionPacksDir, { withFileTypes: true }); - + for (const entry of entries) { if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'README.md') { const packId = entry.name; const configPath = path.join(expansionPacksDir, packId, 'config.yaml'); - + if (fs.existsSync(configPath)) { try { const configContent = fs.readFileSync(configPath, 'utf8'); const config = yaml.load(configContent); const oldVersion = config.version || '1.0.0'; const newVersion = bumpVersion(oldVersion, bumpType); - + config.version = newVersion; - + const updatedYaml = yaml.dump(config, { indent: 2 }); fs.writeFileSync(configPath, updatedYaml); - + updatedItems.push({ type: 'expansion', name: packId, oldVersion, newVersion }); console.log(`✓ ${packId}: ${oldVersion} → ${newVersion}`); - } catch (error) { console.error(`✗ Failed to update ${packId}: ${error.message}`); } } } } - + if (updatedItems.length > 0) { - const coreCount = updatedItems.filter(i => i.type === 'core').length; - const expansionCount = updatedItems.filter(i => i.type === 'expansion').length; - - console.log(`\n✓ Successfully bumped ${updatedItems.length} item(s) with ${bumpType} version bump`); + const coreCount = updatedItems.filter((index) => index.type === 'core').length; + const expansionCount = updatedItems.filter((index) => index.type === 'expansion').length; + + console.log( + `\n✓ Successfully bumped ${updatedItems.length} item(s) with ${bumpType} version bump`, + ); if (coreCount > 0) console.log(` - ${coreCount} core`); if (expansionCount > 0) console.log(` - ${expansionCount} expansion pack(s)`); - + console.log('\nNext steps:'); console.log('1. Test the changes'); - console.log('2. Commit: git add -A && git commit -m "chore: bump all versions (' + bumpType + ')"'); + console.log( + '2. Commit: git add -A && git commit -m "chore: bump all versions (' + bumpType + ')"', + ); } else { console.log('No items found to update'); } - } catch (error) { console.error('Error reading expansion packs directory:', error.message); process.exit(1); } } -bumpAllVersions(); \ No newline at end of file +bumpAllVersions(); diff --git a/tools/bump-expansion-version.js b/tools/bump-expansion-version.js index 819a146c..1ffaa00b 100644 --- a/tools/bump-expansion-version.js +++ b/tools/bump-expansion-version.js @@ -1,17 +1,15 @@ -#!/usr/bin/env node - // Load required modules -const fs = require('fs'); -const path = require('path'); +const fs = require('node:fs'); +const path = require('node:path'); const yaml = require('js-yaml'); // Parse CLI arguments -const args = process.argv.slice(2); -const packId = args[0]; -const bumpType = args[1] || 'minor'; +const arguments_ = process.argv.slice(2); +const packId = arguments_[0]; +const bumpType = arguments_[1] || 'minor'; // Validate arguments -if (!packId || args.length > 2) { +if (!packId || arguments_.length > 2) { console.log('Usage: node bump-expansion-version.js [major|minor|patch]'); console.log('Default: minor'); console.log('Example: node bump-expansion-version.js bmad-creator-tools patch'); @@ -28,10 +26,18 @@ function bumpVersion(currentVersion, type) { const [major, minor, patch] = currentVersion.split('.').map(Number); switch (type) { - case 'major': return `${major + 1}.0.0`; - case 'minor': return `${major}.${minor + 1}.0`; - case 'patch': return `${major}.${minor}.${patch + 1}`; - default: return currentVersion; + case 'major': { + return `${major + 1}.0.0`; + } + case 'minor': { + return `${major}.${minor + 1}.0`; + } + case 'patch': { + return `${major}.${minor}.${patch + 1}`; + } + default: { + return currentVersion; + } } } @@ -47,11 +53,11 @@ async function updateVersion() { const packsDir = path.join(__dirname, '..', 'expansion-packs'); const entries = fs.readdirSync(packsDir, { withFileTypes: true }); - entries.forEach(entry => { + for (const entry of entries) { if (entry.isDirectory() && !entry.name.startsWith('.')) { console.log(` - ${entry.name}`); } - }); + } process.exit(1); } @@ -72,8 +78,9 @@ async function updateVersion() { console.log(`\n✓ Successfully bumped ${packId} with ${bumpType} version bump`); console.log('\nNext steps:'); console.log(`1. Test the changes`); - console.log(`2. Commit: git add -A && git commit -m "chore: bump ${packId} version (${bumpType})"`); - + console.log( + `2. Commit: git add -A && git commit -m "chore: bump ${packId} version (${bumpType})"`, + ); } catch (error) { console.error('Error updating version:', error.message); process.exit(1); diff --git a/tools/cli.js b/tools/cli.js index 4a89bfb8..0965b9a9 100644 --- a/tools/cli.js +++ b/tools/cli.js @@ -1,10 +1,8 @@ -#!/usr/bin/env node - const { Command } = require('commander'); const WebBuilder = require('./builders/web-builder'); const V3ToV4Upgrader = require('./upgraders/v3-to-v4-upgrader'); const IdeSetup = require('./installer/lib/ide-setup'); -const path = require('path'); +const path = require('node:path'); const program = new Command(); @@ -23,7 +21,7 @@ program .option('--no-clean', 'Skip cleaning output directories') .action(async (options) => { const builder = new WebBuilder({ - rootDir: process.cwd() + rootDir: process.cwd(), }); try { @@ -66,7 +64,7 @@ program .option('--no-clean', 'Skip cleaning output directories') .action(async (options) => { const builder = new WebBuilder({ - rootDir: process.cwd() + rootDir: process.cwd(), }); try { @@ -92,7 +90,7 @@ program const builder = new WebBuilder({ rootDir: process.cwd() }); const agents = await builder.resolver.listAgents(); console.log('Available agents:'); - agents.forEach(agent => console.log(` - ${agent}`)); + for (const agent of agents) console.log(` - ${agent}`); process.exit(0); }); @@ -103,7 +101,7 @@ program const builder = new WebBuilder({ rootDir: process.cwd() }); const expansions = await builder.listExpansionPacks(); console.log('Available expansion packs:'); - expansions.forEach(expansion => console.log(` - ${expansion}`)); + for (const expansion of expansions) console.log(` - ${expansion}`); process.exit(0); }); @@ -116,19 +114,19 @@ program // Validate by attempting to build all agents and teams const agents = await builder.resolver.listAgents(); const teams = await builder.resolver.listTeams(); - + console.log('Validating agents...'); for (const agent of agents) { await builder.resolver.resolveAgentDependencies(agent); console.log(` ✓ ${agent}`); } - + console.log('\nValidating teams...'); for (const team of teams) { await builder.resolver.resolveTeamDependencies(team); console.log(` ✓ ${team}`); } - + console.log('\nAll configurations are valid!'); } catch (error) { console.error('Validation failed:', error.message); @@ -147,8 +145,8 @@ program await upgrader.upgrade({ projectPath: options.project, dryRun: options.dryRun, - backup: options.backup + backup: options.backup, }); }); -program.parse(); \ No newline at end of file +program.parse(); diff --git a/tools/flattener/aggregate.js b/tools/flattener/aggregate.js index 3e2eed11..6a597a2f 100644 --- a/tools/flattener/aggregate.js +++ b/tools/flattener/aggregate.js @@ -1,7 +1,7 @@ -const fs = require("fs-extra"); -const path = require("node:path"); -const os = require("node:os"); -const { isBinaryFile } = require("./binary.js"); +const fs = require('fs-extra'); +const path = require('node:path'); +const os = require('node:os'); +const { isBinaryFile } = require('./binary.js'); /** * Aggregate file contents with bounded concurrency. @@ -22,7 +22,7 @@ async function aggregateFileContents(files, rootDir, spinner = null) { // Automatic concurrency selection based on CPU count and workload size. // - Base on 2x logical CPUs, clamped to [2, 64] // - For very small workloads, avoid excessive parallelism - const cpuCount = (os.cpus && Array.isArray(os.cpus()) ? os.cpus().length : (os.cpus?.length || 4)); + const cpuCount = os.cpus && Array.isArray(os.cpus()) ? os.cpus().length : os.cpus?.length || 4; let concurrency = Math.min(64, Math.max(2, (Number(cpuCount) || 4) * 2)); if (files.length > 0 && files.length < concurrency) { concurrency = Math.max(1, Math.min(concurrency, Math.ceil(files.length / 2))); @@ -37,16 +37,16 @@ async function aggregateFileContents(files, rootDir, spinner = null) { const binary = await isBinaryFile(filePath); if (binary) { - const size = (await fs.stat(filePath)).size; + const { size } = await fs.stat(filePath); results.binaryFiles.push({ path: relativePath, absolutePath: filePath, size }); } else { - const content = await fs.readFile(filePath, "utf8"); + const content = await fs.readFile(filePath, 'utf8'); results.textFiles.push({ path: relativePath, absolutePath: filePath, content, size: content.length, - lines: content.split("\n").length, + lines: content.split('\n').length, }); } } catch (error) { @@ -63,8 +63,8 @@ async function aggregateFileContents(files, rootDir, spinner = null) { } } - for (let i = 0; i < files.length; i += concurrency) { - const slice = files.slice(i, i + concurrency); + for (let index = 0; index < files.length; index += concurrency) { + const slice = files.slice(index, index + concurrency); await Promise.all(slice.map(processOne)); } diff --git a/tools/flattener/binary.js b/tools/flattener/binary.js index 4b7c8c0e..fcfb27c1 100644 --- a/tools/flattener/binary.js +++ b/tools/flattener/binary.js @@ -1,6 +1,6 @@ -const fsp = require("node:fs/promises"); -const path = require("node:path"); -const { Buffer } = require("node:buffer"); +const fsp = require('node:fs/promises'); +const path = require('node:path'); +const { Buffer } = require('node:buffer'); /** * Efficiently determine if a file is binary without reading the whole file. @@ -13,25 +13,54 @@ async function isBinaryFile(filePath) { try { const stats = await fsp.stat(filePath); if (stats.isDirectory()) { - throw new Error("EISDIR: illegal operation on a directory"); + throw new Error('EISDIR: illegal operation on a directory'); } const binaryExtensions = new Set([ - ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".ico", ".svg", - ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", - ".zip", ".tar", ".gz", ".rar", ".7z", - ".exe", ".dll", ".so", ".dylib", - ".mp3", ".mp4", ".avi", ".mov", ".wav", - ".ttf", ".otf", ".woff", ".woff2", - ".bin", ".dat", ".db", ".sqlite", + '.jpg', + '.jpeg', + '.png', + '.gif', + '.bmp', + '.ico', + '.svg', + '.pdf', + '.doc', + '.docx', + '.xls', + '.xlsx', + '.ppt', + '.pptx', + '.zip', + '.tar', + '.gz', + '.rar', + '.7z', + '.exe', + '.dll', + '.so', + '.dylib', + '.mp3', + '.mp4', + '.avi', + '.mov', + '.wav', + '.ttf', + '.otf', + '.woff', + '.woff2', + '.bin', + '.dat', + '.db', + '.sqlite', ]); - const ext = path.extname(filePath).toLowerCase(); - if (binaryExtensions.has(ext)) return true; + const extension = path.extname(filePath).toLowerCase(); + if (binaryExtensions.has(extension)) return true; if (stats.size === 0) return false; const sampleSize = Math.min(4096, stats.size); - const fd = await fsp.open(filePath, "r"); + const fd = await fsp.open(filePath, 'r'); try { const buffer = Buffer.allocUnsafe(sampleSize); const { bytesRead } = await fd.read(buffer, 0, sampleSize, 0); @@ -41,9 +70,7 @@ async function isBinaryFile(filePath) { await fd.close(); } } catch (error) { - console.warn( - `Warning: Could not determine if file is binary: ${filePath} - ${error.message}`, - ); + console.warn(`Warning: Could not determine if file is binary: ${filePath} - ${error.message}`); return false; } } diff --git a/tools/flattener/discovery.js b/tools/flattener/discovery.js index e28186a2..7eaaa2d4 100644 --- a/tools/flattener/discovery.js +++ b/tools/flattener/discovery.js @@ -1,18 +1,21 @@ -const path = require("node:path"); -const { execFile } = require("node:child_process"); -const { promisify } = require("node:util"); -const { glob } = require("glob"); -const { loadIgnore } = require("./ignoreRules.js"); +const path = require('node:path'); +const { execFile } = require('node:child_process'); +const { promisify } = require('node:util'); +const { glob } = require('glob'); +const { loadIgnore } = require('./ignoreRules.js'); const pExecFile = promisify(execFile); async function isGitRepo(rootDir) { try { - const { stdout } = await pExecFile("git", [ - "rev-parse", - "--is-inside-work-tree", - ], { cwd: rootDir }); - return String(stdout || "").toString().trim() === "true"; + const { stdout } = await pExecFile('git', ['rev-parse', '--is-inside-work-tree'], { + cwd: rootDir, + }); + return ( + String(stdout || '') + .toString() + .trim() === 'true' + ); } catch { return false; } @@ -20,12 +23,10 @@ async function isGitRepo(rootDir) { async function gitListFiles(rootDir) { try { - const { stdout } = await pExecFile("git", [ - "ls-files", - "-co", - "--exclude-standard", - ], { cwd: rootDir }); - return String(stdout || "") + const { stdout } = await pExecFile('git', ['ls-files', '-co', '--exclude-standard'], { + cwd: rootDir, + }); + return String(stdout || '') .split(/\r?\n/) .map((s) => s.trim()) .filter(Boolean); @@ -48,14 +49,14 @@ async function discoverFiles(rootDir, options = {}) { const { filter } = await loadIgnore(rootDir); // Try git first - if (preferGit && await isGitRepo(rootDir)) { + if (preferGit && (await isGitRepo(rootDir))) { const relFiles = await gitListFiles(rootDir); const filteredRel = relFiles.filter((p) => filter(p)); return filteredRel.map((p) => path.resolve(rootDir, p)); } // Glob fallback - const globbed = await glob("**/*", { + const globbed = await glob('**/*', { cwd: rootDir, nodir: true, dot: true, diff --git a/tools/flattener/files.js b/tools/flattener/files.js index 157bef12..e7236d7b 100644 --- a/tools/flattener/files.js +++ b/tools/flattener/files.js @@ -1,8 +1,8 @@ -const path = require("node:path"); -const discovery = require("./discovery.js"); -const ignoreRules = require("./ignoreRules.js"); -const { isBinaryFile } = require("./binary.js"); -const { aggregateFileContents } = require("./aggregate.js"); +const path = require('node:path'); +const discovery = require('./discovery.js'); +const ignoreRules = require('./ignoreRules.js'); +const { isBinaryFile } = require('./binary.js'); +const { aggregateFileContents } = require('./aggregate.js'); // Backward-compatible signature; delegate to central loader async function parseGitignore(gitignorePath) { @@ -14,7 +14,7 @@ async function discoverFiles(rootDir) { // Delegate to discovery module which respects .gitignore and defaults return await discovery.discoverFiles(rootDir, { preferGit: true }); } catch (error) { - console.error("Error discovering files:", error.message); + console.error('Error discovering files:', error.message); return []; } } diff --git a/tools/flattener/ignoreRules.js b/tools/flattener/ignoreRules.js index 1e8efd9e..bb3a3135 100644 --- a/tools/flattener/ignoreRules.js +++ b/tools/flattener/ignoreRules.js @@ -1,147 +1,147 @@ -const fs = require("fs-extra"); -const path = require("node:path"); -const ignore = require("ignore"); +const fs = require('fs-extra'); +const path = require('node:path'); +const ignore = require('ignore'); // Central default ignore patterns for discovery and filtering. // These complement .gitignore and are applied regardless of VCS presence. const DEFAULT_PATTERNS = [ // Project/VCS - "**/.bmad-core/**", - "**/.git/**", - "**/.svn/**", - "**/.hg/**", - "**/.bzr/**", + '**/.bmad-core/**', + '**/.git/**', + '**/.svn/**', + '**/.hg/**', + '**/.bzr/**', // Package/build outputs - "**/node_modules/**", - "**/bower_components/**", - "**/vendor/**", - "**/packages/**", - "**/build/**", - "**/dist/**", - "**/out/**", - "**/target/**", - "**/bin/**", - "**/obj/**", - "**/release/**", - "**/debug/**", + '**/node_modules/**', + '**/bower_components/**', + '**/vendor/**', + '**/packages/**', + '**/build/**', + '**/dist/**', + '**/out/**', + '**/target/**', + '**/bin/**', + '**/obj/**', + '**/release/**', + '**/debug/**', // Environments - "**/.venv/**", - "**/venv/**", - "**/.virtualenv/**", - "**/virtualenv/**", - "**/env/**", + '**/.venv/**', + '**/venv/**', + '**/.virtualenv/**', + '**/virtualenv/**', + '**/env/**', // Logs & coverage - "**/*.log", - "**/npm-debug.log*", - "**/yarn-debug.log*", - "**/yarn-error.log*", - "**/lerna-debug.log*", - "**/coverage/**", - "**/.nyc_output/**", - "**/.coverage/**", - "**/test-results/**", + '**/*.log', + '**/npm-debug.log*', + '**/yarn-debug.log*', + '**/yarn-error.log*', + '**/lerna-debug.log*', + '**/coverage/**', + '**/.nyc_output/**', + '**/.coverage/**', + '**/test-results/**', // Caches & temp - "**/.cache/**", - "**/.tmp/**", - "**/.temp/**", - "**/tmp/**", - "**/temp/**", - "**/.sass-cache/**", + '**/.cache/**', + '**/.tmp/**', + '**/.temp/**', + '**/tmp/**', + '**/temp/**', + '**/.sass-cache/**', // IDE/editor - "**/.vscode/**", - "**/.idea/**", - "**/*.swp", - "**/*.swo", - "**/*~", - "**/.project", - "**/.classpath", - "**/.settings/**", - "**/*.sublime-project", - "**/*.sublime-workspace", + '**/.vscode/**', + '**/.idea/**', + '**/*.swp', + '**/*.swo', + '**/*~', + '**/.project', + '**/.classpath', + '**/.settings/**', + '**/*.sublime-project', + '**/*.sublime-workspace', // Lockfiles - "**/package-lock.json", - "**/yarn.lock", - "**/pnpm-lock.yaml", - "**/composer.lock", - "**/Pipfile.lock", + '**/package-lock.json', + '**/yarn.lock', + '**/pnpm-lock.yaml', + '**/composer.lock', + '**/Pipfile.lock', // Python/Java/compiled artifacts - "**/*.pyc", - "**/*.pyo", - "**/*.pyd", - "**/__pycache__/**", - "**/*.class", - "**/*.jar", - "**/*.war", - "**/*.ear", - "**/*.o", - "**/*.so", - "**/*.dll", - "**/*.exe", + '**/*.pyc', + '**/*.pyo', + '**/*.pyd', + '**/__pycache__/**', + '**/*.class', + '**/*.jar', + '**/*.war', + '**/*.ear', + '**/*.o', + '**/*.so', + '**/*.dll', + '**/*.exe', // System junk - "**/lib64/**", - "**/.venv/lib64/**", - "**/venv/lib64/**", - "**/_site/**", - "**/.jekyll-cache/**", - "**/.jekyll-metadata", - "**/.DS_Store", - "**/.DS_Store?", - "**/._*", - "**/.Spotlight-V100/**", - "**/.Trashes/**", - "**/ehthumbs.db", - "**/Thumbs.db", - "**/desktop.ini", + '**/lib64/**', + '**/.venv/lib64/**', + '**/venv/lib64/**', + '**/_site/**', + '**/.jekyll-cache/**', + '**/.jekyll-metadata', + '**/.DS_Store', + '**/.DS_Store?', + '**/._*', + '**/.Spotlight-V100/**', + '**/.Trashes/**', + '**/ehthumbs.db', + '**/Thumbs.db', + '**/desktop.ini', // XML outputs - "**/flattened-codebase.xml", - "**/repomix-output.xml", + '**/flattened-codebase.xml', + '**/repomix-output.xml', // Images, media, fonts, archives, docs, dylibs - "**/*.jpg", - "**/*.jpeg", - "**/*.png", - "**/*.gif", - "**/*.bmp", - "**/*.ico", - "**/*.svg", - "**/*.pdf", - "**/*.doc", - "**/*.docx", - "**/*.xls", - "**/*.xlsx", - "**/*.ppt", - "**/*.pptx", - "**/*.zip", - "**/*.tar", - "**/*.gz", - "**/*.rar", - "**/*.7z", - "**/*.dylib", - "**/*.mp3", - "**/*.mp4", - "**/*.avi", - "**/*.mov", - "**/*.wav", - "**/*.ttf", - "**/*.otf", - "**/*.woff", - "**/*.woff2", + '**/*.jpg', + '**/*.jpeg', + '**/*.png', + '**/*.gif', + '**/*.bmp', + '**/*.ico', + '**/*.svg', + '**/*.pdf', + '**/*.doc', + '**/*.docx', + '**/*.xls', + '**/*.xlsx', + '**/*.ppt', + '**/*.pptx', + '**/*.zip', + '**/*.tar', + '**/*.gz', + '**/*.rar', + '**/*.7z', + '**/*.dylib', + '**/*.mp3', + '**/*.mp4', + '**/*.avi', + '**/*.mov', + '**/*.wav', + '**/*.ttf', + '**/*.otf', + '**/*.woff', + '**/*.woff2', // Env files - "**/.env", - "**/.env.*", - "**/*.env", + '**/.env', + '**/.env.*', + '**/*.env', // Misc - "**/junit.xml", + '**/junit.xml', ]; async function readIgnoreFile(filePath) { try { - if (!await fs.pathExists(filePath)) return []; - const content = await fs.readFile(filePath, "utf8"); + if (!(await fs.pathExists(filePath))) return []; + const content = await fs.readFile(filePath, 'utf8'); return content - .split("\n") + .split('\n') .map((l) => l.trim()) - .filter((l) => l && !l.startsWith("#")); - } catch (err) { + .filter((l) => l && !l.startsWith('#')); + } catch { return []; } } @@ -153,18 +153,18 @@ async function parseGitignore(gitignorePath) { async function loadIgnore(rootDir, extraPatterns = []) { const ig = ignore(); - const gitignorePath = path.join(rootDir, ".gitignore"); + const gitignorePath = path.join(rootDir, '.gitignore'); const patterns = [ - ...await readIgnoreFile(gitignorePath), + ...(await readIgnoreFile(gitignorePath)), ...DEFAULT_PATTERNS, ...extraPatterns, ]; // De-duplicate - const unique = Array.from(new Set(patterns.map((p) => String(p)))); + const unique = [...new Set(patterns.map(String))]; ig.add(unique); // Include-only filter: return true if path should be included - const filter = (relativePath) => !ig.ignores(relativePath.replace(/\\/g, "/")); + const filter = (relativePath) => !ig.ignores(relativePath.replaceAll('\\', '/')); return { ig, filter, patterns: unique }; } diff --git a/tools/flattener/main.js b/tools/flattener/main.js index abed992c..d8f7b565 100644 --- a/tools/flattener/main.js +++ b/tools/flattener/main.js @@ -1,20 +1,14 @@ -#!/usr/bin/env node - -const { Command } = require("commander"); -const fs = require("fs-extra"); -const path = require("node:path"); -const process = require("node:process"); +const { Command } = require('commander'); +const fs = require('fs-extra'); +const path = require('node:path'); +const process = require('node:process'); // Modularized components -const { findProjectRoot } = require("./projectRoot.js"); -const { promptYesNo, promptPath } = require("./prompts.js"); -const { - discoverFiles, - filterFiles, - aggregateFileContents, -} = require("./files.js"); -const { generateXMLOutput } = require("./xml.js"); -const { calculateStatistics } = require("./stats.js"); +const { findProjectRoot } = require('./projectRoot.js'); +const { promptYesNo, promptPath } = require('./prompts.js'); +const { discoverFiles, filterFiles, aggregateFileContents } = require('./files.js'); +const { generateXMLOutput } = require('./xml.js'); +const { calculateStatistics } = require('./stats.js'); /** * Recursively discover all files in a directory @@ -73,30 +67,30 @@ const { calculateStatistics } = require("./stats.js"); const program = new Command(); program - .name("bmad-flatten") - .description("BMad-Method codebase flattener tool") - .version("1.0.0") - .option("-i, --input ", "Input directory to flatten", process.cwd()) - .option("-o, --output ", "Output file path", "flattened-codebase.xml") + .name('bmad-flatten') + .description('BMad-Method codebase flattener tool') + .version('1.0.0') + .option('-i, --input ', 'Input directory to flatten', process.cwd()) + .option('-o, --output ', 'Output file path', 'flattened-codebase.xml') .action(async (options) => { let inputDir = path.resolve(options.input); let outputPath = path.resolve(options.output); // Detect if user explicitly provided -i/--input or -o/--output const argv = process.argv.slice(2); - const userSpecifiedInput = argv.some((a) => - a === "-i" || a === "--input" || a.startsWith("--input=") + const userSpecifiedInput = argv.some( + (a) => a === '-i' || a === '--input' || a.startsWith('--input='), ); - const userSpecifiedOutput = argv.some((a) => - a === "-o" || a === "--output" || a.startsWith("--output=") + const userSpecifiedOutput = argv.some( + (a) => a === '-o' || a === '--output' || a.startsWith('--output='), ); - const noPathArgs = !userSpecifiedInput && !userSpecifiedOutput; + const noPathArguments = !userSpecifiedInput && !userSpecifiedOutput; - if (noPathArgs) { + if (noPathArguments) { const detectedRoot = await findProjectRoot(process.cwd()); const suggestedOutput = detectedRoot - ? path.join(detectedRoot, "flattened-codebase.xml") - : path.resolve("flattened-codebase.xml"); + ? path.join(detectedRoot, 'flattened-codebase.xml') + : path.resolve('flattened-codebase.xml'); if (detectedRoot) { const useDefaults = await promptYesNo( @@ -107,26 +101,25 @@ program inputDir = detectedRoot; outputPath = suggestedOutput; } else { - inputDir = await promptPath( - "Enter input directory path", - process.cwd(), - ); + inputDir = await promptPath('Enter input directory path', process.cwd()); outputPath = await promptPath( - "Enter output file path", - path.join(inputDir, "flattened-codebase.xml"), + 'Enter output file path', + path.join(inputDir, 'flattened-codebase.xml'), ); } } else { - console.log("Could not auto-detect a project root."); - inputDir = await promptPath( - "Enter input directory path", - process.cwd(), - ); + console.log('Could not auto-detect a project root.'); + inputDir = await promptPath('Enter input directory path', process.cwd()); outputPath = await promptPath( - "Enter output file path", - path.join(inputDir, "flattened-codebase.xml"), + 'Enter output file path', + path.join(inputDir, 'flattened-codebase.xml'), ); } + } else { + console.error( + 'Could not auto-detect a project root and no arguments were provided. Please specify -i/--input and -o/--output.', + ); + process.exit(1); } // Ensure output directory exists @@ -134,24 +127,23 @@ program try { // Verify input directory exists - if (!await fs.pathExists(inputDir)) { + if (!(await fs.pathExists(inputDir))) { console.error(`❌ Error: Input directory does not exist: ${inputDir}`); process.exit(1); } // Import ora dynamically - const { default: ora } = await import("ora"); + const { default: ora } = await import('ora'); // Start file discovery with spinner - const discoverySpinner = ora("🔍 Discovering files...").start(); + const discoverySpinner = ora('🔍 Discovering files...').start(); const files = await discoverFiles(inputDir); const filteredFiles = await filterFiles(files, inputDir); - discoverySpinner.succeed( - `📁 Found ${filteredFiles.length} files to include`, - ); + discoverySpinner.succeed(`📁 Found ${filteredFiles.length} files to include`); // Process files with progress tracking - const processingSpinner = ora("📄 Processing files...").start(); + console.log('Reading file contents'); + const processingSpinner = ora('📄 Processing files...').start(); const aggregatedContent = await aggregateFileContents( filteredFiles, inputDir, @@ -165,31 +157,23 @@ program } // Generate XML output using streaming - const xmlSpinner = ora("🔧 Generating XML output...").start(); + const xmlSpinner = ora('🔧 Generating XML output...').start(); await generateXMLOutput(aggregatedContent, outputPath); - xmlSpinner.succeed("📝 XML generation completed"); + xmlSpinner.succeed('📝 XML generation completed'); // Calculate and display statistics const outputStats = await fs.stat(outputPath); - const stats = await calculateStatistics( - aggregatedContent, - outputStats.size, - inputDir, - ); + const stats = await calculateStatistics(aggregatedContent, outputStats.size, inputDir); // Display completion summary - console.log("\n📊 Completion Summary:"); + console.log('\n📊 Completion Summary:'); console.log( - `✅ Successfully processed ${filteredFiles.length} files into ${ - path.basename(outputPath) - }`, + `✅ Successfully processed ${filteredFiles.length} files into ${path.basename(outputPath)}`, ); console.log(`📁 Output file: ${outputPath}`); console.log(`📏 Total source size: ${stats.totalSize}`); console.log(`📄 Generated XML size: ${stats.xmlSize}`); - console.log( - `📝 Total lines of code: ${stats.totalLines.toLocaleString()}`, - ); + console.log(`📝 Total lines of code: ${stats.totalLines.toLocaleString()}`); console.log(`🔢 Estimated tokens: ${stats.estimatedTokens}`); console.log( `📊 File breakdown: ${stats.textFiles} text, ${stats.binaryFiles} binary, ${stats.errorFiles} errors\n`, @@ -197,92 +181,75 @@ program // Ask user if they want detailed stats + markdown report const generateDetailed = await promptYesNo( - "Generate detailed stats (console + markdown) now?", + 'Generate detailed stats (console + markdown) now?', true, ); if (generateDetailed) { // Additional detailed stats - console.log("\n📈 Size Percentiles:"); + console.log('\n📈 Size Percentiles:'); console.log( - ` Avg: ${ - Math.round(stats.avgFileSize).toLocaleString() - } B, Median: ${ - Math.round(stats.medianFileSize).toLocaleString() - } B, p90: ${stats.p90.toLocaleString()} B, p95: ${stats.p95.toLocaleString()} B, p99: ${stats.p99.toLocaleString()} B`, + ` Avg: ${Math.round(stats.avgFileSize).toLocaleString()} B, Median: ${Math.round( + stats.medianFileSize, + ).toLocaleString()} B, p90: ${stats.p90.toLocaleString()} B, p95: ${stats.p95.toLocaleString()} B, p99: ${stats.p99.toLocaleString()} B`, ); - if (Array.isArray(stats.histogram) && stats.histogram.length) { - console.log("\n🧮 Size Histogram:"); + if (Array.isArray(stats.histogram) && stats.histogram.length > 0) { + console.log('\n🧮 Size Histogram:'); for (const b of stats.histogram.slice(0, 2)) { - console.log( - ` ${b.label}: ${b.count} files, ${b.bytes.toLocaleString()} bytes`, - ); + console.log(` ${b.label}: ${b.count} files, ${b.bytes.toLocaleString()} bytes`); } if (stats.histogram.length > 2) { console.log(` … and ${stats.histogram.length - 2} more buckets`); } } - if (Array.isArray(stats.byExtension) && stats.byExtension.length) { + if (Array.isArray(stats.byExtension) && stats.byExtension.length > 0) { const topExt = stats.byExtension.slice(0, 2); - console.log("\n📦 Top Extensions:"); + console.log('\n📦 Top Extensions:'); for (const e of topExt) { - const pct = stats.totalBytes - ? ((e.bytes / stats.totalBytes) * 100) - : 0; + const pct = stats.totalBytes ? (e.bytes / stats.totalBytes) * 100 : 0; console.log( - ` ${e.ext}: ${e.count} files, ${e.bytes.toLocaleString()} bytes (${ - pct.toFixed(2) - }%)`, + ` ${e.ext}: ${e.count} files, ${e.bytes.toLocaleString()} bytes (${pct.toFixed( + 2, + )}%)`, ); } if (stats.byExtension.length > 2) { - console.log( - ` … and ${stats.byExtension.length - 2} more extensions`, - ); + console.log(` … and ${stats.byExtension.length - 2} more extensions`); } } - if (Array.isArray(stats.byDirectory) && stats.byDirectory.length) { + if (Array.isArray(stats.byDirectory) && stats.byDirectory.length > 0) { const topDir = stats.byDirectory.slice(0, 2); - console.log("\n📂 Top Directories:"); + console.log('\n📂 Top Directories:'); for (const d of topDir) { - const pct = stats.totalBytes - ? ((d.bytes / stats.totalBytes) * 100) - : 0; + const pct = stats.totalBytes ? (d.bytes / stats.totalBytes) * 100 : 0; console.log( - ` ${d.dir}: ${d.count} files, ${d.bytes.toLocaleString()} bytes (${ - pct.toFixed(2) - }%)`, + ` ${d.dir}: ${d.count} files, ${d.bytes.toLocaleString()} bytes (${pct.toFixed( + 2, + )}%)`, ); } if (stats.byDirectory.length > 2) { - console.log( - ` … and ${stats.byDirectory.length - 2} more directories`, - ); + console.log(` … and ${stats.byDirectory.length - 2} more directories`); } } - if ( - Array.isArray(stats.depthDistribution) && - stats.depthDistribution.length - ) { - console.log("\n🌳 Depth Distribution:"); + if (Array.isArray(stats.depthDistribution) && stats.depthDistribution.length > 0) { + console.log('\n🌳 Depth Distribution:'); const dd = stats.depthDistribution.slice(0, 2); - let line = " " + dd.map((d) => `${d.depth}:${d.count}`).join(" "); + let line = ' ' + dd.map((d) => `${d.depth}:${d.count}`).join(' '); if (stats.depthDistribution.length > 2) { line += ` … +${stats.depthDistribution.length - 2} more`; } console.log(line); } - if (Array.isArray(stats.longestPaths) && stats.longestPaths.length) { - console.log("\n🧵 Longest Paths:"); + if (Array.isArray(stats.longestPaths) && stats.longestPaths.length > 0) { + console.log('\n🧵 Longest Paths:'); for (const p of stats.longestPaths.slice(0, 2)) { - console.log( - ` ${p.path} (${p.length} chars, ${p.size.toLocaleString()} bytes)`, - ); + console.log(` ${p.path} (${p.length} chars, ${p.size.toLocaleString()} bytes)`); } if (stats.longestPaths.length > 2) { console.log(` … and ${stats.longestPaths.length - 2} more paths`); @@ -290,7 +257,7 @@ program } if (stats.temporal) { - console.log("\n⏱️ Temporal:"); + console.log('\n⏱️ Temporal:'); if (stats.temporal.oldest) { console.log( ` Oldest: ${stats.temporal.oldest.path} (${stats.temporal.oldest.mtime})`, @@ -302,104 +269,82 @@ program ); } if (Array.isArray(stats.temporal.ageBuckets)) { - console.log(" Age buckets:"); + console.log(' Age buckets:'); for (const b of stats.temporal.ageBuckets.slice(0, 2)) { - console.log( - ` ${b.label}: ${b.count} files, ${b.bytes.toLocaleString()} bytes`, - ); + console.log(` ${b.label}: ${b.count} files, ${b.bytes.toLocaleString()} bytes`); } if (stats.temporal.ageBuckets.length > 2) { - console.log( - ` … and ${ - stats.temporal.ageBuckets.length - 2 - } more buckets`, - ); + console.log(` … and ${stats.temporal.ageBuckets.length - 2} more buckets`); } } } if (stats.quality) { - console.log("\n✅ Quality Signals:"); + console.log('\n✅ Quality Signals:'); console.log(` Zero-byte files: ${stats.quality.zeroByteFiles}`); console.log(` Empty text files: ${stats.quality.emptyTextFiles}`); console.log(` Hidden files: ${stats.quality.hiddenFiles}`); console.log(` Symlinks: ${stats.quality.symlinks}`); console.log( - ` Large files (>= ${ - (stats.quality.largeThreshold / (1024 * 1024)).toFixed(0) - } MB): ${stats.quality.largeFilesCount}`, + ` Large files (>= ${(stats.quality.largeThreshold / (1024 * 1024)).toFixed( + 0, + )} MB): ${stats.quality.largeFilesCount}`, ); console.log( ` Suspiciously large files (>= 100 MB): ${stats.quality.suspiciousLargeFilesCount}`, ); } - if ( - Array.isArray(stats.duplicateCandidates) && - stats.duplicateCandidates.length - ) { - console.log("\n🧬 Duplicate Candidates:"); + if (Array.isArray(stats.duplicateCandidates) && stats.duplicateCandidates.length > 0) { + console.log('\n🧬 Duplicate Candidates:'); for (const d of stats.duplicateCandidates.slice(0, 2)) { - console.log( - ` ${d.reason}: ${d.count} files @ ${d.size.toLocaleString()} bytes`, - ); + console.log(` ${d.reason}: ${d.count} files @ ${d.size.toLocaleString()} bytes`); } if (stats.duplicateCandidates.length > 2) { - console.log( - ` … and ${stats.duplicateCandidates.length - 2} more groups`, - ); + console.log(` … and ${stats.duplicateCandidates.length - 2} more groups`); } } - if (typeof stats.compressibilityRatio === "number") { + if (typeof stats.compressibilityRatio === 'number') { console.log( - `\n🗜️ Compressibility ratio (sampled): ${ - (stats.compressibilityRatio * 100).toFixed(2) - }%`, + `\n🗜️ Compressibility ratio (sampled): ${(stats.compressibilityRatio * 100).toFixed( + 2, + )}%`, ); } if (stats.git && stats.git.isRepo) { - console.log("\n🔧 Git:"); + console.log('\n🔧 Git:'); console.log( ` Tracked: ${stats.git.trackedCount} files, ${stats.git.trackedBytes.toLocaleString()} bytes`, ); console.log( ` Untracked: ${stats.git.untrackedCount} files, ${stats.git.untrackedBytes.toLocaleString()} bytes`, ); - if ( - Array.isArray(stats.git.lfsCandidates) && - stats.git.lfsCandidates.length - ) { - console.log(" LFS candidates (top 2):"); + if (Array.isArray(stats.git.lfsCandidates) && stats.git.lfsCandidates.length > 0) { + console.log(' LFS candidates (top 2):'); for (const f of stats.git.lfsCandidates.slice(0, 2)) { console.log(` ${f.path} (${f.size.toLocaleString()} bytes)`); } if (stats.git.lfsCandidates.length > 2) { - console.log( - ` … and ${stats.git.lfsCandidates.length - 2} more`, - ); + console.log(` … and ${stats.git.lfsCandidates.length - 2} more`); } } } - if (Array.isArray(stats.largestFiles) && stats.largestFiles.length) { - console.log("\n📚 Largest Files (top 2):"); + if (Array.isArray(stats.largestFiles) && stats.largestFiles.length > 0) { + console.log('\n📚 Largest Files (top 2):'); for (const f of stats.largestFiles.slice(0, 2)) { // Show LOC for text files when available; omit ext and mtime - let locStr = ""; + let locStr = ''; if (!f.isBinary && Array.isArray(aggregatedContent?.textFiles)) { - const tf = aggregatedContent.textFiles.find((t) => - t.path === f.path - ); - if (tf && typeof tf.lines === "number") { + const tf = aggregatedContent.textFiles.find((t) => t.path === f.path); + if (tf && typeof tf.lines === 'number') { locStr = `, LOC: ${tf.lines.toLocaleString()}`; } } console.log( - ` ${f.path} – ${f.sizeFormatted} (${ - f.percentOfTotal.toFixed(2) - }%)${locStr}`, + ` ${f.path} – ${f.sizeFormatted} (${f.percentOfTotal.toFixed(2)}%)${locStr}`, ); } if (stats.largestFiles.length > 2) { @@ -409,262 +354,214 @@ program // Write a comprehensive markdown report next to the XML { - const mdPath = outputPath.endsWith(".xml") - ? outputPath.replace(/\.xml$/i, ".stats.md") - : outputPath + ".stats.md"; + const mdPath = outputPath.endsWith('.xml') + ? outputPath.replace(/\.xml$/i, '.stats.md') + : outputPath + '.stats.md'; try { - const pct = (num, den) => (den ? ((num / den) * 100) : 0); + const pct = (num, den) => (den ? (num / den) * 100 : 0); const md = []; - md.push(`# 🧾 Flatten Stats for ${path.basename(outputPath)}`); - md.push(""); - md.push("## 📊 Summary"); - md.push(`- Total source size: ${stats.totalSize}`); - md.push(`- Generated XML size: ${stats.xmlSize}`); md.push( + `# 🧾 Flatten Stats for ${path.basename(outputPath)}`, + '', + '## 📊 Summary', + `- Total source size: ${stats.totalSize}`, + `- Generated XML size: ${stats.xmlSize}`, `- Total lines of code: ${stats.totalLines.toLocaleString()}`, - ); - md.push(`- Estimated tokens: ${stats.estimatedTokens}`); - md.push( + `- Estimated tokens: ${stats.estimatedTokens}`, `- File breakdown: ${stats.textFiles} text, ${stats.binaryFiles} binary, ${stats.errorFiles} errors`, + '', + '## 📈 Size Percentiles', + `Avg: ${Math.round(stats.avgFileSize).toLocaleString()} B, Median: ${Math.round( + stats.medianFileSize, + ).toLocaleString()} B, p90: ${stats.p90.toLocaleString()} B, p95: ${stats.p95.toLocaleString()} B, p99: ${stats.p99.toLocaleString()} B`, + '', ); - md.push(""); - - // Percentiles - md.push("## 📈 Size Percentiles"); - md.push( - `Avg: ${ - Math.round(stats.avgFileSize).toLocaleString() - } B, Median: ${ - Math.round(stats.medianFileSize).toLocaleString() - } B, p90: ${stats.p90.toLocaleString()} B, p95: ${stats.p95.toLocaleString()} B, p99: ${stats.p99.toLocaleString()} B`, - ); - md.push(""); // Histogram - if (Array.isArray(stats.histogram) && stats.histogram.length) { - md.push("## 🧮 Size Histogram"); - md.push("| Bucket | Files | Bytes |"); - md.push("| --- | ---: | ---: |"); + if (Array.isArray(stats.histogram) && stats.histogram.length > 0) { + md.push( + '## 🧮 Size Histogram', + '| Bucket | Files | Bytes |', + '| --- | ---: | ---: |', + ); for (const b of stats.histogram) { - md.push( - `| ${b.label} | ${b.count} | ${b.bytes.toLocaleString()} |`, - ); + md.push(`| ${b.label} | ${b.count} | ${b.bytes.toLocaleString()} |`); } - md.push(""); + md.push(''); } // Top Extensions - if (Array.isArray(stats.byExtension) && stats.byExtension.length) { - md.push("## 📦 Top Extensions by Bytes (Top 20)"); - md.push("| Ext | Files | Bytes | % of total |"); - md.push("| --- | ---: | ---: | ---: |"); + if (Array.isArray(stats.byExtension) && stats.byExtension.length > 0) { + md.push( + '## 📦 Top Extensions by Bytes (Top 20)', + '| Ext | Files | Bytes | % of total |', + '| --- | ---: | ---: | ---: |', + ); for (const e of stats.byExtension.slice(0, 20)) { const p = pct(e.bytes, stats.totalBytes); md.push( - `| ${e.ext} | ${e.count} | ${e.bytes.toLocaleString()} | ${ - p.toFixed(2) - }% |`, + `| ${e.ext} | ${e.count} | ${e.bytes.toLocaleString()} | ${p.toFixed(2)}% |`, ); } - md.push(""); + md.push(''); } // Top Directories - if (Array.isArray(stats.byDirectory) && stats.byDirectory.length) { - md.push("## 📂 Top Directories by Bytes (Top 20)"); - md.push("| Directory | Files | Bytes | % of total |"); - md.push("| --- | ---: | ---: | ---: |"); + if (Array.isArray(stats.byDirectory) && stats.byDirectory.length > 0) { + md.push( + '## 📂 Top Directories by Bytes (Top 20)', + '| Directory | Files | Bytes | % of total |', + '| --- | ---: | ---: | ---: |', + ); for (const d of stats.byDirectory.slice(0, 20)) { const p = pct(d.bytes, stats.totalBytes); md.push( - `| ${d.dir} | ${d.count} | ${d.bytes.toLocaleString()} | ${ - p.toFixed(2) - }% |`, + `| ${d.dir} | ${d.count} | ${d.bytes.toLocaleString()} | ${p.toFixed(2)}% |`, ); } - md.push(""); + md.push(''); } // Depth distribution - if ( - Array.isArray(stats.depthDistribution) && - stats.depthDistribution.length - ) { - md.push("## 🌳 Depth Distribution"); - md.push("| Depth | Count |"); - md.push("| ---: | ---: |"); + if (Array.isArray(stats.depthDistribution) && stats.depthDistribution.length > 0) { + md.push('## 🌳 Depth Distribution', '| Depth | Count |', '| ---: | ---: |'); for (const d of stats.depthDistribution) { md.push(`| ${d.depth} | ${d.count} |`); } - md.push(""); + md.push(''); } // Longest paths - if ( - Array.isArray(stats.longestPaths) && stats.longestPaths.length - ) { - md.push("## 🧵 Longest Paths (Top 25)"); - md.push("| Path | Length | Bytes |"); - md.push("| --- | ---: | ---: |"); + if (Array.isArray(stats.longestPaths) && stats.longestPaths.length > 0) { + md.push( + '## 🧵 Longest Paths (Top 25)', + '| Path | Length | Bytes |', + '| --- | ---: | ---: |', + ); for (const pth of stats.longestPaths) { - md.push( - `| ${pth.path} | ${pth.length} | ${pth.size.toLocaleString()} |`, - ); + md.push(`| ${pth.path} | ${pth.length} | ${pth.size.toLocaleString()} |`); } - md.push(""); + md.push(''); } // Temporal if (stats.temporal) { - md.push("## ⏱️ Temporal"); + md.push('## ⏱️ Temporal'); if (stats.temporal.oldest) { - md.push( - `- Oldest: ${stats.temporal.oldest.path} (${stats.temporal.oldest.mtime})`, - ); + md.push(`- Oldest: ${stats.temporal.oldest.path} (${stats.temporal.oldest.mtime})`); } if (stats.temporal.newest) { - md.push( - `- Newest: ${stats.temporal.newest.path} (${stats.temporal.newest.mtime})`, - ); + md.push(`- Newest: ${stats.temporal.newest.path} (${stats.temporal.newest.mtime})`); } if (Array.isArray(stats.temporal.ageBuckets)) { - md.push(""); - md.push("| Age | Files | Bytes |"); - md.push("| --- | ---: | ---: |"); + md.push('', '| Age | Files | Bytes |', '| --- | ---: | ---: |'); for (const b of stats.temporal.ageBuckets) { - md.push( - `| ${b.label} | ${b.count} | ${b.bytes.toLocaleString()} |`, - ); + md.push(`| ${b.label} | ${b.count} | ${b.bytes.toLocaleString()} |`); } } - md.push(""); + md.push(''); } // Quality signals if (stats.quality) { - md.push("## ✅ Quality Signals"); - md.push(`- Zero-byte files: ${stats.quality.zeroByteFiles}`); - md.push(`- Empty text files: ${stats.quality.emptyTextFiles}`); - md.push(`- Hidden files: ${stats.quality.hiddenFiles}`); - md.push(`- Symlinks: ${stats.quality.symlinks}`); - md.push( - `- Large files (>= ${ - (stats.quality.largeThreshold / (1024 * 1024)).toFixed(0) - } MB): ${stats.quality.largeFilesCount}`, - ); md.push( + '## ✅ Quality Signals', + `- Zero-byte files: ${stats.quality.zeroByteFiles}`, + `- Empty text files: ${stats.quality.emptyTextFiles}`, + `- Hidden files: ${stats.quality.hiddenFiles}`, + `- Symlinks: ${stats.quality.symlinks}`, + `- Large files (>= ${(stats.quality.largeThreshold / (1024 * 1024)).toFixed(0)} MB): ${stats.quality.largeFilesCount}`, `- Suspiciously large files (>= 100 MB): ${stats.quality.suspiciousLargeFilesCount}`, + '', ); - md.push(""); } // Duplicates - if ( - Array.isArray(stats.duplicateCandidates) && - stats.duplicateCandidates.length - ) { - md.push("## 🧬 Duplicate Candidates"); - md.push("| Reason | Files | Size (bytes) |"); - md.push("| --- | ---: | ---: |"); + if (Array.isArray(stats.duplicateCandidates) && stats.duplicateCandidates.length > 0) { + md.push( + '## 🧬 Duplicate Candidates', + '| Reason | Files | Size (bytes) |', + '| --- | ---: | ---: |', + ); for (const d of stats.duplicateCandidates) { - md.push( - `| ${d.reason} | ${d.count} | ${d.size.toLocaleString()} |`, - ); + md.push(`| ${d.reason} | ${d.count} | ${d.size.toLocaleString()} |`); } - md.push(""); - // Detailed listing of duplicate file names and locations - md.push("### 🧬 Duplicate Groups Details"); + md.push('', '### 🧬 Duplicate Groups Details'); let dupIndex = 1; for (const d of stats.duplicateCandidates) { md.push( `#### Group ${dupIndex}: ${d.count} files @ ${d.size.toLocaleString()} bytes (${d.reason})`, ); - if (Array.isArray(d.files) && d.files.length) { + if (Array.isArray(d.files) && d.files.length > 0) { for (const fp of d.files) { md.push(`- ${fp}`); } } else { - md.push("- (file list unavailable)"); + md.push('- (file list unavailable)'); } - md.push(""); + md.push(''); dupIndex++; } - md.push(""); + md.push(''); } // Compressibility - if (typeof stats.compressibilityRatio === "number") { - md.push("## 🗜️ Compressibility"); + if (typeof stats.compressibilityRatio === 'number') { md.push( - `Sampled compressibility ratio: ${ - (stats.compressibilityRatio * 100).toFixed(2) - }%`, + '## 🗜️ Compressibility', + `Sampled compressibility ratio: ${(stats.compressibilityRatio * 100).toFixed(2)}%`, + '', ); - md.push(""); } // Git if (stats.git && stats.git.isRepo) { - md.push("## 🔧 Git"); md.push( + '## 🔧 Git', `- Tracked: ${stats.git.trackedCount} files, ${stats.git.trackedBytes.toLocaleString()} bytes`, - ); - md.push( `- Untracked: ${stats.git.untrackedCount} files, ${stats.git.untrackedBytes.toLocaleString()} bytes`, ); - if ( - Array.isArray(stats.git.lfsCandidates) && - stats.git.lfsCandidates.length - ) { - md.push(""); - md.push("### 📦 LFS Candidates (Top 20)"); - md.push("| Path | Bytes |"); - md.push("| --- | ---: |"); + if (Array.isArray(stats.git.lfsCandidates) && stats.git.lfsCandidates.length > 0) { + md.push('', '### 📦 LFS Candidates (Top 20)', '| Path | Bytes |', '| --- | ---: |'); for (const f of stats.git.lfsCandidates.slice(0, 20)) { md.push(`| ${f.path} | ${f.size.toLocaleString()} |`); } } - md.push(""); + md.push(''); } // Largest Files - if ( - Array.isArray(stats.largestFiles) && stats.largestFiles.length - ) { - md.push("## 📚 Largest Files (Top 50)"); - md.push("| Path | Size | % of total | LOC |"); - md.push("| --- | ---: | ---: | ---: |"); + if (Array.isArray(stats.largestFiles) && stats.largestFiles.length > 0) { + md.push( + '## 📚 Largest Files (Top 50)', + '| Path | Size | % of total | LOC |', + '| --- | ---: | ---: | ---: |', + ); for (const f of stats.largestFiles) { - let loc = ""; - if ( - !f.isBinary && Array.isArray(aggregatedContent?.textFiles) - ) { - const tf = aggregatedContent.textFiles.find((t) => - t.path === f.path - ); - if (tf && typeof tf.lines === "number") { + let loc = ''; + if (!f.isBinary && Array.isArray(aggregatedContent?.textFiles)) { + const tf = aggregatedContent.textFiles.find((t) => t.path === f.path); + if (tf && typeof tf.lines === 'number') { loc = tf.lines.toLocaleString(); } } md.push( - `| ${f.path} | ${f.sizeFormatted} | ${ - f.percentOfTotal.toFixed(2) - }% | ${loc} |`, + `| ${f.path} | ${f.sizeFormatted} | ${f.percentOfTotal.toFixed(2)}% | ${loc} |`, ); } - md.push(""); + md.push(''); } - await fs.writeFile(mdPath, md.join("\n")); + await fs.writeFile(mdPath, md.join('\n')); console.log(`\n🧾 Detailed stats report written to: ${mdPath}`); - } catch (e) { - console.warn(`⚠️ Failed to write stats markdown: ${e.message}`); + } catch (error) { + console.warn(`⚠️ Failed to write stats markdown: ${error.message}`); } } } } catch (error) { - console.error("❌ Critical error:", error.message); - console.error("An unexpected error occurred."); + console.error('❌ Critical error:', error.message); + console.error('An unexpected error occurred.'); process.exit(1); } }); diff --git a/tools/flattener/projectRoot.js b/tools/flattener/projectRoot.js index 27f3a1eb..9fec15d1 100644 --- a/tools/flattener/projectRoot.js +++ b/tools/flattener/projectRoot.js @@ -1,10 +1,10 @@ -const fs = require("fs-extra"); -const path = require("node:path"); +const fs = require('fs-extra'); +const path = require('node:path'); // Deno/Node compatibility: explicitly import process -const process = require("node:process"); -const { execFile } = require("node:child_process"); -const { promisify } = require("node:util"); +const process = require('node:process'); +const { execFile } = require('node:child_process'); +const { promisify } = require('node:util'); const execFileAsync = promisify(execFile); // Simple memoization across calls (keyed by realpath of startDir) @@ -18,7 +18,7 @@ async function _tryRun(cmd, args, cwd, timeoutMs = 500) { windowsHide: true, maxBuffer: 1024 * 1024, }); - const out = String(stdout || "").trim(); + const out = String(stdout || '').trim(); return out || null; } catch { return null; @@ -27,15 +27,17 @@ async function _tryRun(cmd, args, cwd, timeoutMs = 500) { async function _detectVcsTopLevel(startDir) { // Run common VCS root queries in parallel; ignore failures - const gitP = _tryRun("git", ["rev-parse", "--show-toplevel"], startDir); - const hgP = _tryRun("hg", ["root"], startDir); + const gitP = _tryRun('git', ['rev-parse', '--show-toplevel'], startDir); + const hgP = _tryRun('hg', ['root'], startDir); const svnP = (async () => { - const show = await _tryRun("svn", ["info", "--show-item", "wc-root"], startDir); + const show = await _tryRun('svn', ['info', '--show-item', 'wc-root'], startDir); if (show) return show; - const info = await _tryRun("svn", ["info"], startDir); + const info = await _tryRun('svn', ['info'], startDir); if (info) { - const line = info.split(/\r?\n/).find((l) => l.toLowerCase().startsWith("working copy root path:")); - if (line) return line.split(":").slice(1).join(":").trim(); + const line = info + .split(/\r?\n/) + .find((l) => l.toLowerCase().startsWith('working copy root path:')); + if (line) return line.split(':').slice(1).join(':').trim(); } return null; })(); @@ -71,90 +73,92 @@ async function findProjectRoot(startDir) { const checks = []; const add = (rel, weight) => { - const makePath = (d) => Array.isArray(rel) ? path.join(d, ...rel) : path.join(d, rel); + const makePath = (d) => (Array.isArray(rel) ? path.join(d, ...rel) : path.join(d, rel)); checks.push({ makePath, weight }); }; // Highest priority: explicit sentinel markers - add(".project-root", 110); - add(".workspace-root", 110); - add(".repo-root", 110); + add('.project-root', 110); + add('.workspace-root', 110); + add('.repo-root', 110); // Highest priority: VCS roots - add(".git", 100); - add(".hg", 95); - add(".svn", 95); + add('.git', 100); + add('.hg', 95); + add('.svn', 95); // Monorepo/workspace indicators - add("pnpm-workspace.yaml", 90); - add("lerna.json", 90); - add("turbo.json", 90); - add("nx.json", 90); - add("rush.json", 90); - add("go.work", 90); - add("WORKSPACE", 90); - add("WORKSPACE.bazel", 90); - add("MODULE.bazel", 90); - add("pants.toml", 90); + add('pnpm-workspace.yaml', 90); + add('lerna.json', 90); + add('turbo.json', 90); + add('nx.json', 90); + add('rush.json', 90); + add('go.work', 90); + add('WORKSPACE', 90); + add('WORKSPACE.bazel', 90); + add('MODULE.bazel', 90); + add('pants.toml', 90); // Lockfiles and package-manager/top-level locks - add("yarn.lock", 85); - add("pnpm-lock.yaml", 85); - add("package-lock.json", 85); - add("bun.lockb", 85); - add("Cargo.lock", 85); - add("composer.lock", 85); - add("poetry.lock", 85); - add("Pipfile.lock", 85); - add("Gemfile.lock", 85); + add('yarn.lock', 85); + add('pnpm-lock.yaml', 85); + add('package-lock.json', 85); + add('bun.lockb', 85); + add('Cargo.lock', 85); + add('composer.lock', 85); + add('poetry.lock', 85); + add('Pipfile.lock', 85); + add('Gemfile.lock', 85); // Build-system root indicators - add("settings.gradle", 80); - add("settings.gradle.kts", 80); - add("gradlew", 80); - add("pom.xml", 80); - add("build.sbt", 80); - add(["project", "build.properties"], 80); + add('settings.gradle', 80); + add('settings.gradle.kts', 80); + add('gradlew', 80); + add('pom.xml', 80); + add('build.sbt', 80); + add(['project', 'build.properties'], 80); // Language/project config markers - add("deno.json", 75); - add("deno.jsonc", 75); - add("pyproject.toml", 75); - add("Pipfile", 75); - add("requirements.txt", 75); - add("go.mod", 75); - add("Cargo.toml", 75); - add("composer.json", 75); - add("mix.exs", 75); - add("Gemfile", 75); - add("CMakeLists.txt", 75); - add("stack.yaml", 75); - add("cabal.project", 75); - add("rebar.config", 75); - add("pubspec.yaml", 75); - add("flake.nix", 75); - add("shell.nix", 75); - add("default.nix", 75); - add(".tool-versions", 75); - add("package.json", 74); // generic Node project (lower than lockfiles/workspaces) + add('deno.json', 75); + add('deno.jsonc', 75); + add('pyproject.toml', 75); + add('Pipfile', 75); + add('requirements.txt', 75); + add('go.mod', 75); + add('Cargo.toml', 75); + add('composer.json', 75); + add('mix.exs', 75); + add('Gemfile', 75); + add('CMakeLists.txt', 75); + add('stack.yaml', 75); + add('cabal.project', 75); + add('rebar.config', 75); + add('pubspec.yaml', 75); + add('flake.nix', 75); + add('shell.nix', 75); + add('default.nix', 75); + add('.tool-versions', 75); + add('package.json', 74); // generic Node project (lower than lockfiles/workspaces) // Changesets - add([".changeset", "config.json"], 70); - add(".changeset", 70); + add(['.changeset', 'config.json'], 70); + add('.changeset', 70); // Custom markers via env (comma-separated names) if (process.env.PROJECT_ROOT_MARKERS) { - for (const name of process.env.PROJECT_ROOT_MARKERS.split(",").map((s) => s.trim()).filter(Boolean)) { + for (const name of process.env.PROJECT_ROOT_MARKERS.split(',') + .map((s) => s.trim()) + .filter(Boolean)) { add(name, 72); } } /** Check for package.json with "workspaces" */ const hasWorkspacePackageJson = async (d) => { - const pkgPath = path.join(d, "package.json"); + const pkgPath = path.join(d, 'package.json'); if (!(await exists(pkgPath))) return false; try { - const raw = await fs.readFile(pkgPath, "utf8"); + const raw = await fs.readFile(pkgPath, 'utf8'); const pkg = JSON.parse(raw); return Boolean(pkg && pkg.workspaces); } catch { @@ -172,9 +176,8 @@ async function findProjectRoot(startDir) { while (true) { // Special check: package.json with "workspaces" - if (await hasWorkspacePackageJson(dir)) { - if (!best || 90 >= best.weight) best = { dir, weight: 90 }; - } + if ((await hasWorkspacePackageJson(dir)) && (!best || 90 >= best.weight)) + best = { dir, weight: 90 }; // Evaluate all other checks in parallel const results = await Promise.all( @@ -201,4 +204,3 @@ async function findProjectRoot(startDir) { } module.exports = { findProjectRoot }; - diff --git a/tools/flattener/prompts.js b/tools/flattener/prompts.js index 58c76137..849256d8 100644 --- a/tools/flattener/prompts.js +++ b/tools/flattener/prompts.js @@ -1,11 +1,11 @@ -const os = require("node:os"); -const path = require("node:path"); -const readline = require("node:readline"); -const process = require("node:process"); +const os = require('node:os'); +const path = require('node:path'); +const readline = require('node:readline'); +const process = require('node:process'); function expandHome(p) { if (!p) return p; - if (p.startsWith("~")) return path.join(os.homedir(), p.slice(1)); + if (p.startsWith('~')) return path.join(os.homedir(), p.slice(1)); return p; } @@ -27,16 +27,16 @@ function promptQuestion(question) { } async function promptYesNo(question, defaultYes = true) { - const suffix = defaultYes ? " [Y/n] " : " [y/N] "; + const suffix = defaultYes ? ' [Y/n] ' : ' [y/N] '; const ans = (await promptQuestion(`${question}${suffix}`)).trim().toLowerCase(); if (!ans) return defaultYes; - if (["y", "yes"].includes(ans)) return true; - if (["n", "no"].includes(ans)) return false; + if (['y', 'yes'].includes(ans)) return true; + if (['n', 'no'].includes(ans)) return false; return promptYesNo(question, defaultYes); } async function promptPath(question, defaultValue) { - const prompt = `${question}${defaultValue ? ` (default: ${defaultValue})` : ""}: `; + const prompt = `${question}${defaultValue ? ` (default: ${defaultValue})` : ''}: `; const ans = (await promptQuestion(prompt)).trim(); return expandHome(ans || defaultValue); } diff --git a/tools/flattener/stats.helpers.js b/tools/flattener/stats.helpers.js index bab08526..039c316f 100644 --- a/tools/flattener/stats.helpers.js +++ b/tools/flattener/stats.helpers.js @@ -1,11 +1,11 @@ -"use strict"; +'use strict'; -const fs = require("node:fs/promises"); -const path = require("node:path"); -const zlib = require("node:zlib"); -const { Buffer } = require("node:buffer"); -const crypto = require("node:crypto"); -const cp = require("node:child_process"); +const fs = require('node:fs/promises'); +const path = require('node:path'); +const zlib = require('node:zlib'); +const { Buffer } = require('node:buffer'); +const crypto = require('node:crypto'); +const cp = require('node:child_process'); const KB = 1024; const MB = 1024 * KB; @@ -34,17 +34,19 @@ async function enrichAllFiles(textFiles, binaryFiles) { const allFiles = []; async function enrich(file, isBinary) { - const ext = (path.extname(file.path) || "").toLowerCase(); - const dir = path.dirname(file.path) || "."; + const ext = (path.extname(file.path) || '').toLowerCase(); + const dir = path.dirname(file.path) || '.'; const depth = file.path.split(path.sep).filter(Boolean).length; - const hidden = file.path.split(path.sep).some((seg) => seg.startsWith(".")); + const hidden = file.path.split(path.sep).some((seg) => seg.startsWith('.')); let mtimeMs = 0; let isSymlink = false; try { const lst = await fs.lstat(file.absolutePath); mtimeMs = lst.mtimeMs; isSymlink = lst.isSymbolicLink(); - } catch (_) { /* ignore lstat errors during enrichment */ } + } catch { + /* ignore lstat errors during enrichment */ + } allFiles.push({ path: file.path, absolutePath: file.absolutePath, @@ -67,18 +69,18 @@ async function enrichAllFiles(textFiles, binaryFiles) { function buildHistogram(allFiles) { const buckets = [ - [1 * KB, "0–1KB"], - [10 * KB, "1–10KB"], - [100 * KB, "10–100KB"], - [1 * MB, "100KB–1MB"], - [10 * MB, "1–10MB"], - [100 * MB, "10–100MB"], - [Infinity, ">=100MB"], + [1 * KB, '0–1KB'], + [10 * KB, '1–10KB'], + [100 * KB, '10–100KB'], + [1 * MB, '100KB–1MB'], + [10 * MB, '1–10MB'], + [100 * MB, '10–100MB'], + [Infinity, '>=100MB'], ]; const histogram = buckets.map(([_, label]) => ({ label, count: 0, bytes: 0 })); for (const f of allFiles) { - for (let i = 0; i < buckets.length; i++) { - if (f.size < buckets[i][0]) { + for (const [i, bucket] of buckets.entries()) { + if (f.size < bucket[0]) { histogram[i].count++; histogram[i].bytes += f.size; break; @@ -91,13 +93,13 @@ function buildHistogram(allFiles) { function aggregateByExtension(allFiles) { const byExtension = new Map(); for (const f of allFiles) { - const key = f.ext || ""; + const key = f.ext || ''; const v = byExtension.get(key) || { ext: key, count: 0, bytes: 0 }; v.count++; v.bytes += f.size; byExtension.set(key, v); } - return Array.from(byExtension.values()).sort((a, b) => b.bytes - a.bytes); + return [...byExtension.values()].sort((a, b) => b.bytes - a.bytes); } function aggregateByDirectory(allFiles) { @@ -109,15 +111,15 @@ function aggregateByDirectory(allFiles) { byDirectory.set(dir, v); } for (const f of allFiles) { - const parts = f.dir === "." ? [] : f.dir.split(path.sep); - let acc = ""; + const parts = f.dir === '.' ? [] : f.dir.split(path.sep); + let acc = ''; for (let i = 0; i < parts.length; i++) { acc = i === 0 ? parts[0] : acc + path.sep + parts[i]; addDirBytes(acc, f.size); } - if (parts.length === 0) addDirBytes(".", f.size); + if (parts.length === 0) addDirBytes('.', f.size); } - return Array.from(byDirectory.values()).sort((a, b) => b.bytes - a.bytes); + return [...byDirectory.values()].sort((a, b) => b.bytes - a.bytes); } function computeDepthAndLongest(allFiles) { @@ -129,21 +131,22 @@ function computeDepthAndLongest(allFiles) { .sort((a, b) => b.path.length - a.path.length) .slice(0, 25) .map((f) => ({ path: f.path, length: f.path.length, size: f.size })); - const depthDist = Array.from(depthDistribution.entries()) + const depthDist = [...depthDistribution.entries()] .sort((a, b) => a[0] - b[0]) .map(([depth, count]) => ({ depth, count })); return { depthDist, longestPaths }; } function computeTemporal(allFiles, nowMs) { - let oldest = null, newest = null; + let oldest = null, + newest = null; const ageBuckets = [ - { label: "> 1 year", minDays: 365, maxDays: Infinity, count: 0, bytes: 0 }, - { label: "6–12 months", minDays: 180, maxDays: 365, count: 0, bytes: 0 }, - { label: "1–6 months", minDays: 30, maxDays: 180, count: 0, bytes: 0 }, - { label: "7–30 days", minDays: 7, maxDays: 30, count: 0, bytes: 0 }, - { label: "1–7 days", minDays: 1, maxDays: 7, count: 0, bytes: 0 }, - { label: "< 1 day", minDays: 0, maxDays: 1, count: 0, bytes: 0 }, + { label: '> 1 year', minDays: 365, maxDays: Infinity, count: 0, bytes: 0 }, + { label: '6–12 months', minDays: 180, maxDays: 365, count: 0, bytes: 0 }, + { label: '1–6 months', minDays: 30, maxDays: 180, count: 0, bytes: 0 }, + { label: '7–30 days', minDays: 7, maxDays: 30, count: 0, bytes: 0 }, + { label: '1–7 days', minDays: 1, maxDays: 7, count: 0, bytes: 0 }, + { label: '< 1 day', minDays: 0, maxDays: 1, count: 0, bytes: 0 }, ]; for (const f of allFiles) { const ageDays = Math.max(0, (nowMs - (f.mtimeMs || nowMs)) / (24 * 60 * 60 * 1000)); @@ -158,15 +161,21 @@ function computeTemporal(allFiles, nowMs) { if (!newest || f.mtimeMs > newest.mtimeMs) newest = f; } return { - oldest: oldest ? { path: oldest.path, mtime: oldest.mtimeMs ? new Date(oldest.mtimeMs).toISOString() : null } : null, - newest: newest ? { path: newest.path, mtime: newest.mtimeMs ? new Date(newest.mtimeMs).toISOString() : null } : null, + oldest: oldest + ? { path: oldest.path, mtime: oldest.mtimeMs ? new Date(oldest.mtimeMs).toISOString() : null } + : null, + newest: newest + ? { path: newest.path, mtime: newest.mtimeMs ? new Date(newest.mtimeMs).toISOString() : null } + : null, ageBuckets, }; } function computeQuality(allFiles, textFiles) { const zeroByteFiles = allFiles.filter((f) => f.size === 0).length; - const emptyTextFiles = textFiles.filter((f) => (f.size || 0) === 0 || (f.lines || 0) === 0).length; + const emptyTextFiles = textFiles.filter( + (f) => (f.size || 0) === 0 || (f.lines || 0) === 0, + ).length; const hiddenFiles = allFiles.filter((f) => f.hidden).length; const symlinks = allFiles.filter((f) => f.isSymlink).length; const largeThreshold = 50 * MB; @@ -201,18 +210,31 @@ function computeDuplicates(allFiles, textFiles) { for (const tf of textGroup) { try { const src = textFiles.find((x) => x.absolutePath === tf.absolutePath); - const content = src ? src.content : ""; - const h = crypto.createHash("sha1").update(content).digest("hex"); + const content = src ? src.content : ''; + const h = crypto.createHash('sha1').update(content).digest('hex'); const g = contentHashGroups.get(h) || []; g.push(tf); contentHashGroups.set(h, g); - } catch (_) { /* ignore hashing errors for duplicate detection */ } + } catch { + /* ignore hashing errors for duplicate detection */ + } } for (const [_h, g] of contentHashGroups.entries()) { - if (g.length > 1) duplicateCandidates.push({ reason: "same-size+text-hash", size: Number(sizeKey), count: g.length, files: g.map((f) => f.path) }); + if (g.length > 1) + duplicateCandidates.push({ + reason: 'same-size+text-hash', + size: Number(sizeKey), + count: g.length, + files: g.map((f) => f.path), + }); } if (otherGroup.length > 1) { - duplicateCandidates.push({ reason: "same-size", size: Number(sizeKey), count: otherGroup.length, files: otherGroup.map((f) => f.path) }); + duplicateCandidates.push({ + reason: 'same-size', + size: Number(sizeKey), + count: otherGroup.length, + files: otherGroup.map((f) => f.path), + }); } } return duplicateCandidates; @@ -226,10 +248,12 @@ function estimateCompressibility(textFiles) { const sampleLen = Math.min(256 * 1024, tf.size || 0); if (sampleLen <= 0) continue; const sample = tf.content.slice(0, sampleLen); - const gz = zlib.gzipSync(Buffer.from(sample, "utf8")); + const gz = zlib.gzipSync(Buffer.from(sample, 'utf8')); compSampleBytes += sampleLen; compCompressedBytes += gz.length; - } catch (_) { /* ignore compression errors during sampling */ } + } catch { + /* ignore compression errors during sampling */ + } } return compSampleBytes > 0 ? compCompressedBytes / compSampleBytes : null; } @@ -245,20 +269,34 @@ function computeGitInfo(allFiles, rootDir, largeThreshold) { }; try { if (!rootDir) return info; - const top = cp.execFileSync("git", ["rev-parse", "--show-toplevel"], { cwd: rootDir, stdio: ["ignore", "pipe", "ignore"] }).toString().trim(); + const top = cp + .execFileSync('git', ['rev-parse', '--show-toplevel'], { + cwd: rootDir, + stdio: ['ignore', 'pipe', 'ignore'], + }) + .toString() + .trim(); if (!top) return info; info.isRepo = true; - const out = cp.execFileSync("git", ["ls-files", "-z"], { cwd: rootDir, stdio: ["ignore", "pipe", "ignore"] }); - const tracked = new Set(out.toString().split("\0").filter(Boolean)); - let trackedBytes = 0, trackedCount = 0, untrackedBytes = 0, untrackedCount = 0; + const out = cp.execFileSync('git', ['ls-files', '-z'], { + cwd: rootDir, + stdio: ['ignore', 'pipe', 'ignore'], + }); + const tracked = new Set(out.toString().split('\0').filter(Boolean)); + let trackedBytes = 0, + trackedCount = 0, + untrackedBytes = 0, + untrackedCount = 0; const lfsCandidates = []; for (const f of allFiles) { const isTracked = tracked.has(f.path); if (isTracked) { - trackedCount++; trackedBytes += f.size; + trackedCount++; + trackedBytes += f.size; if (f.size >= largeThreshold) lfsCandidates.push({ path: f.path, size: f.size }); } else { - untrackedCount++; untrackedBytes += f.size; + untrackedCount++; + untrackedBytes += f.size; } } info.trackedCount = trackedCount; @@ -266,7 +304,9 @@ function computeGitInfo(allFiles, rootDir, largeThreshold) { info.untrackedCount = untrackedCount; info.untrackedBytes = untrackedBytes; info.lfsCandidates = lfsCandidates.sort((a, b) => b.size - a.size).slice(0, 50); - } catch (_) { /* git not available or not a repo, ignore */ } + } catch { + /* git not available or not a repo, ignore */ + } return info; } @@ -280,34 +320,58 @@ function computeLargestFiles(allFiles, totalBytes) { size: f.size, sizeFormatted: formatSize(f.size), percentOfTotal: toPct(f.size, totalBytes), - ext: f.ext || "", + ext: f.ext || '', isBinary: f.isBinary, mtime: f.mtimeMs ? new Date(f.mtimeMs).toISOString() : null, })); } function mdTable(rows, headers) { - const header = `| ${headers.join(" | ")} |`; - const sep = `| ${headers.map(() => "---").join(" | ")} |`; - const body = rows.map((r) => `| ${r.join(" | ")} |`).join("\n"); + const header = `| ${headers.join(' | ')} |`; + const sep = `| ${headers.map(() => '---').join(' | ')} |`; + const body = rows.map((r) => `| ${r.join(' | ')} |`).join('\n'); return `${header}\n${sep}\n${body}`; } function buildMarkdownReport(largestFiles, byExtensionArr, byDirectoryArr, totalBytes) { const toPct = (num, den) => (den === 0 ? 0 : (num / den) * 100); const md = []; - md.push("\n### Top Largest Files (Top 50)\n"); - md.push(mdTable( - largestFiles.map((f) => [f.path, f.sizeFormatted, `${f.percentOfTotal.toFixed(2)}%`, f.ext || "", f.isBinary ? "binary" : "text"]), - ["Path", "Size", "% of total", "Ext", "Type"], - )); - md.push("\n\n### Top Extensions by Bytes (Top 20)\n"); - const topExtRows = byExtensionArr.slice(0, 20).map((e) => [e.ext, String(e.count), formatSize(e.bytes), `${toPct(e.bytes, totalBytes).toFixed(2)}%`]); - md.push(mdTable(topExtRows, ["Ext", "Count", "Bytes", "% of total"])); - md.push("\n\n### Top Directories by Bytes (Top 20)\n"); - const topDirRows = byDirectoryArr.slice(0, 20).map((d) => [d.dir, String(d.count), formatSize(d.bytes), `${toPct(d.bytes, totalBytes).toFixed(2)}%`]); - md.push(mdTable(topDirRows, ["Directory", "Files", "Bytes", "% of total"])); - return md.join("\n"); + md.push( + '\n### Top Largest Files (Top 50)\n', + mdTable( + largestFiles.map((f) => [ + f.path, + f.sizeFormatted, + `${f.percentOfTotal.toFixed(2)}%`, + f.ext || '', + f.isBinary ? 'binary' : 'text', + ]), + ['Path', 'Size', '% of total', 'Ext', 'Type'], + ), + '\n\n### Top Extensions by Bytes (Top 20)\n', + ); + const topExtRows = byExtensionArr + .slice(0, 20) + .map((e) => [ + e.ext, + String(e.count), + formatSize(e.bytes), + `${toPct(e.bytes, totalBytes).toFixed(2)}%`, + ]); + md.push( + mdTable(topExtRows, ['Ext', 'Count', 'Bytes', '% of total']), + '\n\n### Top Directories by Bytes (Top 20)\n', + ); + const topDirRows = byDirectoryArr + .slice(0, 20) + .map((d) => [ + d.dir, + String(d.count), + formatSize(d.bytes), + `${toPct(d.bytes, totalBytes).toFixed(2)}%`, + ]); + md.push(mdTable(topDirRows, ['Directory', 'Files', 'Bytes', '% of total'])); + return md.join('\n'); } module.exports = { diff --git a/tools/flattener/stats.js b/tools/flattener/stats.js index 7bf9f9c9..179a7fd3 100644 --- a/tools/flattener/stats.js +++ b/tools/flattener/stats.js @@ -1,4 +1,4 @@ -const H = require("./stats.helpers.js"); +const H = require('./stats.helpers.js'); async function calculateStatistics(aggregatedContent, xmlFileSize, rootDir) { const { textFiles, binaryFiles, errors } = aggregatedContent; @@ -10,8 +10,8 @@ async function calculateStatistics(aggregatedContent, xmlFileSize, rootDir) { const allFiles = await H.enrichAllFiles(textFiles, binaryFiles); const totalBytes = allFiles.reduce((s, f) => s + f.size, 0); const sizes = allFiles.map((f) => f.size).sort((a, b) => a - b); - const avgSize = sizes.length ? totalBytes / sizes.length : 0; - const medianSize = sizes.length ? H.percentile(sizes, 50) : 0; + const avgSize = sizes.length > 0 ? totalBytes / sizes.length : 0; + const medianSize = sizes.length > 0 ? H.percentile(sizes, 50) : 0; const p90 = H.percentile(sizes, 90); const p95 = H.percentile(sizes, 95); const p99 = H.percentile(sizes, 99); diff --git a/tools/flattener/test-matrix.js b/tools/flattener/test-matrix.js index c33d07dc..78b2b874 100644 --- a/tools/flattener/test-matrix.js +++ b/tools/flattener/test-matrix.js @@ -1,4 +1,3 @@ -#!/usr/bin/env node /* deno-lint-ignore-file */ /* Automatic test matrix for project root detection. @@ -6,65 +5,65 @@ No external options or flags required. Safe to run multiple times. */ -const os = require("node:os"); -const path = require("node:path"); -const fs = require("fs-extra"); -const { promisify } = require("node:util"); -const { execFile } = require("node:child_process"); -const process = require("node:process"); +const os = require('node:os'); +const path = require('node:path'); +const fs = require('fs-extra'); +const { promisify } = require('node:util'); +const { execFile } = require('node:child_process'); +const process = require('node:process'); const execFileAsync = promisify(execFile); -const { findProjectRoot } = require("./projectRoot.js"); +const { findProjectRoot } = require('./projectRoot.js'); async function cmdAvailable(cmd) { try { - await execFileAsync(cmd, ["--version"], { timeout: 500, windowsHide: true }); + await execFileAsync(cmd, ['--version'], { timeout: 500, windowsHide: true }); return true; } catch { return false; } -async function testSvnMarker() { - const root = await mkTmpDir("svn"); - const nested = path.join(root, "proj", "code"); - await fs.ensureDir(nested); - await fs.ensureDir(path.join(root, ".svn")); - const found = await findProjectRoot(nested); - assertEqual(found, root, ".svn marker should be detected"); - return { name: "svn-marker", ok: true }; -} - -async function testSymlinkStart() { - const root = await mkTmpDir("symlink-start"); - const nested = path.join(root, "a", "b"); - await fs.ensureDir(nested); - await fs.writeFile(path.join(root, ".project-root"), "\n"); - const tmp = await mkTmpDir("symlink-tmp"); - const link = path.join(tmp, "link-to-b"); - try { - await fs.symlink(nested, link); - } catch { - // symlink may not be permitted on some systems; skip - return { name: "symlink-start", ok: true, skipped: true }; + async function testSvnMarker() { + const root = await mkTmpDir('svn'); + const nested = path.join(root, 'proj', 'code'); + await fs.ensureDir(nested); + await fs.ensureDir(path.join(root, '.svn')); + const found = await findProjectRoot(nested); + assertEqual(found, root, '.svn marker should be detected'); + return { name: 'svn-marker', ok: true }; } - const found = await findProjectRoot(link); - assertEqual(found, root, "should resolve symlinked start to real root"); - return { name: "symlink-start", ok: true }; -} -async function testSubmoduleLikeInnerGitFile() { - const root = await mkTmpDir("submodule-like"); - const mid = path.join(root, "mid"); - const leaf = path.join(mid, "leaf"); - await fs.ensureDir(leaf); - // outer repo - await fs.ensureDir(path.join(root, ".git")); - // inner submodule-like .git file - await fs.writeFile(path.join(mid, ".git"), "gitdir: ../.git/modules/mid\n"); - const found = await findProjectRoot(leaf); - assertEqual(found, root, "outermost .git should win on tie weight"); - return { name: "submodule-like-gitfile", ok: true }; -} + async function testSymlinkStart() { + const root = await mkTmpDir('symlink-start'); + const nested = path.join(root, 'a', 'b'); + await fs.ensureDir(nested); + await fs.writeFile(path.join(root, '.project-root'), '\n'); + const tmp = await mkTmpDir('symlink-tmp'); + const link = path.join(tmp, 'link-to-b'); + try { + await fs.symlink(nested, link); + } catch { + // symlink may not be permitted on some systems; skip + return { name: 'symlink-start', ok: true, skipped: true }; + } + const found = await findProjectRoot(link); + assertEqual(found, root, 'should resolve symlinked start to real root'); + return { name: 'symlink-start', ok: true }; + } + + async function testSubmoduleLikeInnerGitFile() { + const root = await mkTmpDir('submodule-like'); + const mid = path.join(root, 'mid'); + const leaf = path.join(mid, 'leaf'); + await fs.ensureDir(leaf); + // outer repo + await fs.ensureDir(path.join(root, '.git')); + // inner submodule-like .git file + await fs.writeFile(path.join(mid, '.git'), 'gitdir: ../.git/modules/mid\n'); + const found = await findProjectRoot(leaf); + assertEqual(found, root, 'outermost .git should win on tie weight'); + return { name: 'submodule-like-gitfile', ok: true }; + } } async function mkTmpDir(name) { @@ -75,274 +74,283 @@ async function mkTmpDir(name) { function assertEqual(actual, expected, msg) { if (actual !== expected) { - throw new Error(`${msg}: expected=\"${expected}\" actual=\"${actual}\"`); + throw new Error(`${msg}: expected="${expected}" actual="${actual}"`); } } async function testSentinel() { - const root = await mkTmpDir("sentinel"); - const nested = path.join(root, "a", "b", "c"); + const root = await mkTmpDir('sentinel'); + const nested = path.join(root, 'a', 'b', 'c'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, ".project-root"), "\n"); + await fs.writeFile(path.join(root, '.project-root'), '\n'); const found = await findProjectRoot(nested); - await assertEqual(found, root, "sentinel .project-root should win"); - return { name: "sentinel", ok: true }; + await assertEqual(found, root, 'sentinel .project-root should win'); + return { name: 'sentinel', ok: true }; } async function testOtherSentinels() { - const root = await mkTmpDir("other-sentinels"); - const nested = path.join(root, "x", "y"); + const root = await mkTmpDir('other-sentinels'); + const nested = path.join(root, 'x', 'y'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, ".workspace-root"), "\n"); + await fs.writeFile(path.join(root, '.workspace-root'), '\n'); const found1 = await findProjectRoot(nested); - assertEqual(found1, root, "sentinel .workspace-root should win"); + assertEqual(found1, root, 'sentinel .workspace-root should win'); - await fs.remove(path.join(root, ".workspace-root")); - await fs.writeFile(path.join(root, ".repo-root"), "\n"); + await fs.remove(path.join(root, '.workspace-root')); + await fs.writeFile(path.join(root, '.repo-root'), '\n'); const found2 = await findProjectRoot(nested); - assertEqual(found2, root, "sentinel .repo-root should win"); - return { name: "other-sentinels", ok: true }; + assertEqual(found2, root, 'sentinel .repo-root should win'); + return { name: 'other-sentinels', ok: true }; } async function testGitCliAndMarker() { - const hasGit = await cmdAvailable("git"); - if (!hasGit) return { name: "git-cli", ok: true, skipped: true }; + const hasGit = await cmdAvailable('git'); + if (!hasGit) return { name: 'git-cli', ok: true, skipped: true }; - const root = await mkTmpDir("git"); - const nested = path.join(root, "pkg", "src"); + const root = await mkTmpDir('git'); + const nested = path.join(root, 'pkg', 'src'); await fs.ensureDir(nested); - await execFileAsync("git", ["init"], { cwd: root, timeout: 2000 }); + await execFileAsync('git', ['init'], { cwd: root, timeout: 2000 }); const found = await findProjectRoot(nested); - await assertEqual(found, root, "git toplevel should be detected"); - return { name: "git-cli", ok: true }; + await assertEqual(found, root, 'git toplevel should be detected'); + return { name: 'git-cli', ok: true }; } async function testHgMarkerOrCli() { // Prefer simple marker test to avoid requiring Mercurial install - const root = await mkTmpDir("hg"); - const nested = path.join(root, "lib"); + const root = await mkTmpDir('hg'); + const nested = path.join(root, 'lib'); await fs.ensureDir(nested); - await fs.ensureDir(path.join(root, ".hg")); + await fs.ensureDir(path.join(root, '.hg')); const found = await findProjectRoot(nested); - await assertEqual(found, root, ".hg marker should be detected"); - return { name: "hg-marker", ok: true }; + await assertEqual(found, root, '.hg marker should be detected'); + return { name: 'hg-marker', ok: true }; } async function testWorkspacePnpm() { - const root = await mkTmpDir("pnpm-workspace"); - const pkgA = path.join(root, "packages", "a"); + const root = await mkTmpDir('pnpm-workspace'); + const pkgA = path.join(root, 'packages', 'a'); await fs.ensureDir(pkgA); - await fs.writeFile(path.join(root, "pnpm-workspace.yaml"), "packages:\n - packages/*\n"); + await fs.writeFile(path.join(root, 'pnpm-workspace.yaml'), 'packages:\n - packages/*\n'); const found = await findProjectRoot(pkgA); - await assertEqual(found, root, "pnpm-workspace.yaml should be detected"); - return { name: "pnpm-workspace", ok: true }; + await assertEqual(found, root, 'pnpm-workspace.yaml should be detected'); + return { name: 'pnpm-workspace', ok: true }; } async function testPackageJsonWorkspaces() { - const root = await mkTmpDir("package-workspaces"); - const pkgA = path.join(root, "packages", "a"); + const root = await mkTmpDir('package-workspaces'); + const pkgA = path.join(root, 'packages', 'a'); await fs.ensureDir(pkgA); - await fs.writeJson(path.join(root, "package.json"), { private: true, workspaces: ["packages/*"] }, { spaces: 2 }); + await fs.writeJson( + path.join(root, 'package.json'), + { private: true, workspaces: ['packages/*'] }, + { spaces: 2 }, + ); const found = await findProjectRoot(pkgA); - await assertEqual(found, root, "package.json workspaces should be detected"); - return { name: "package.json-workspaces", ok: true }; + await assertEqual(found, root, 'package.json workspaces should be detected'); + return { name: 'package.json-workspaces', ok: true }; } async function testLockfiles() { - const root = await mkTmpDir("lockfiles"); - const nested = path.join(root, "src"); + const root = await mkTmpDir('lockfiles'); + const nested = path.join(root, 'src'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "yarn.lock"), "\n"); + await fs.writeFile(path.join(root, 'yarn.lock'), '\n'); const found = await findProjectRoot(nested); - await assertEqual(found, root, "yarn.lock should be detected"); - return { name: "lockfiles", ok: true }; + await assertEqual(found, root, 'yarn.lock should be detected'); + return { name: 'lockfiles', ok: true }; } async function testLanguageConfigs() { - const root = await mkTmpDir("lang-configs"); - const nested = path.join(root, "x", "y"); + const root = await mkTmpDir('lang-configs'); + const nested = path.join(root, 'x', 'y'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "pyproject.toml"), "[tool.poetry]\nname='tmp'\n"); + await fs.writeFile(path.join(root, 'pyproject.toml'), "[tool.poetry]\nname='tmp'\n"); const found = await findProjectRoot(nested); - await assertEqual(found, root, "pyproject.toml should be detected"); - return { name: "language-configs", ok: true }; + await assertEqual(found, root, 'pyproject.toml should be detected'); + return { name: 'language-configs', ok: true }; } async function testPreferOuterOnTie() { - const root = await mkTmpDir("tie"); - const mid = path.join(root, "mid"); - const leaf = path.join(mid, "leaf"); + const root = await mkTmpDir('tie'); + const mid = path.join(root, 'mid'); + const leaf = path.join(mid, 'leaf'); await fs.ensureDir(leaf); // same weight marker at two levels - await fs.writeFile(path.join(root, "requirements.txt"), "\n"); - await fs.writeFile(path.join(mid, "requirements.txt"), "\n"); + await fs.writeFile(path.join(root, 'requirements.txt'), '\n'); + await fs.writeFile(path.join(mid, 'requirements.txt'), '\n'); const found = await findProjectRoot(leaf); - await assertEqual(found, root, "outermost directory should win on equal weight"); - return { name: "prefer-outermost-tie", ok: true }; + await assertEqual(found, root, 'outermost directory should win on equal weight'); + return { name: 'prefer-outermost-tie', ok: true }; } // Additional coverage: Bazel, Nx/Turbo/Rush, Go workspaces, Deno, Java/Scala, PHP, Rust, Nix, Changesets, env markers, // and priority interaction between package.json and lockfiles. async function testBazelWorkspace() { - const root = await mkTmpDir("bazel"); - const nested = path.join(root, "apps", "svc"); + const root = await mkTmpDir('bazel'); + const nested = path.join(root, 'apps', 'svc'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "WORKSPACE"), "workspace(name=\"tmp\")\n"); + await fs.writeFile(path.join(root, 'WORKSPACE'), 'workspace(name="tmp")\n'); const found = await findProjectRoot(nested); - await assertEqual(found, root, "Bazel WORKSPACE should be detected"); - return { name: "bazel-workspace", ok: true }; + await assertEqual(found, root, 'Bazel WORKSPACE should be detected'); + return { name: 'bazel-workspace', ok: true }; } async function testNx() { - const root = await mkTmpDir("nx"); - const nested = path.join(root, "apps", "web"); + const root = await mkTmpDir('nx'); + const nested = path.join(root, 'apps', 'web'); await fs.ensureDir(nested); - await fs.writeJson(path.join(root, "nx.json"), { npmScope: "tmp" }, { spaces: 2 }); + await fs.writeJson(path.join(root, 'nx.json'), { npmScope: 'tmp' }, { spaces: 2 }); const found = await findProjectRoot(nested); - await assertEqual(found, root, "nx.json should be detected"); - return { name: "nx", ok: true }; + await assertEqual(found, root, 'nx.json should be detected'); + return { name: 'nx', ok: true }; } async function testTurbo() { - const root = await mkTmpDir("turbo"); - const nested = path.join(root, "packages", "x"); + const root = await mkTmpDir('turbo'); + const nested = path.join(root, 'packages', 'x'); await fs.ensureDir(nested); - await fs.writeJson(path.join(root, "turbo.json"), { pipeline: {} }, { spaces: 2 }); + await fs.writeJson(path.join(root, 'turbo.json'), { pipeline: {} }, { spaces: 2 }); const found = await findProjectRoot(nested); - await assertEqual(found, root, "turbo.json should be detected"); - return { name: "turbo", ok: true }; + await assertEqual(found, root, 'turbo.json should be detected'); + return { name: 'turbo', ok: true }; } async function testRush() { - const root = await mkTmpDir("rush"); - const nested = path.join(root, "apps", "a"); + const root = await mkTmpDir('rush'); + const nested = path.join(root, 'apps', 'a'); await fs.ensureDir(nested); - await fs.writeJson(path.join(root, "rush.json"), { projectFolderMinDepth: 1 }, { spaces: 2 }); + await fs.writeJson(path.join(root, 'rush.json'), { projectFolderMinDepth: 1 }, { spaces: 2 }); const found = await findProjectRoot(nested); - await assertEqual(found, root, "rush.json should be detected"); - return { name: "rush", ok: true }; + await assertEqual(found, root, 'rush.json should be detected'); + return { name: 'rush', ok: true }; } async function testGoWorkAndMod() { - const root = await mkTmpDir("gowork"); - const mod = path.join(root, "modA"); - const nested = path.join(mod, "pkg"); + const root = await mkTmpDir('gowork'); + const mod = path.join(root, 'modA'); + const nested = path.join(mod, 'pkg'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "go.work"), "go 1.22\nuse ./modA\n"); - await fs.writeFile(path.join(mod, "go.mod"), "module example.com/a\ngo 1.22\n"); + await fs.writeFile(path.join(root, 'go.work'), 'go 1.22\nuse ./modA\n'); + await fs.writeFile(path.join(mod, 'go.mod'), 'module example.com/a\ngo 1.22\n'); const found = await findProjectRoot(nested); - await assertEqual(found, root, "go.work should define the workspace root"); - return { name: "go-work", ok: true }; + await assertEqual(found, root, 'go.work should define the workspace root'); + return { name: 'go-work', ok: true }; } async function testDenoJson() { - const root = await mkTmpDir("deno"); - const nested = path.join(root, "src"); + const root = await mkTmpDir('deno'); + const nested = path.join(root, 'src'); await fs.ensureDir(nested); - await fs.writeJson(path.join(root, "deno.json"), { tasks: {} }, { spaces: 2 }); + await fs.writeJson(path.join(root, 'deno.json'), { tasks: {} }, { spaces: 2 }); const found = await findProjectRoot(nested); - await assertEqual(found, root, "deno.json should be detected"); - return { name: "deno-json", ok: true }; + await assertEqual(found, root, 'deno.json should be detected'); + return { name: 'deno-json', ok: true }; } async function testGradleSettings() { - const root = await mkTmpDir("gradle"); - const nested = path.join(root, "app"); + const root = await mkTmpDir('gradle'); + const nested = path.join(root, 'app'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "settings.gradle"), "rootProject.name='tmp'\n"); + await fs.writeFile(path.join(root, 'settings.gradle'), "rootProject.name='tmp'\n"); const found = await findProjectRoot(nested); - await assertEqual(found, root, "settings.gradle should be detected"); - return { name: "gradle-settings", ok: true }; + await assertEqual(found, root, 'settings.gradle should be detected'); + return { name: 'gradle-settings', ok: true }; } async function testMavenPom() { - const root = await mkTmpDir("maven"); - const nested = path.join(root, "module"); + const root = await mkTmpDir('maven'); + const nested = path.join(root, 'module'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "pom.xml"), "\n"); + await fs.writeFile(path.join(root, 'pom.xml'), '\n'); const found = await findProjectRoot(nested); - await assertEqual(found, root, "pom.xml should be detected"); - return { name: "maven-pom", ok: true }; + await assertEqual(found, root, 'pom.xml should be detected'); + return { name: 'maven-pom', ok: true }; } async function testSbtBuild() { - const root = await mkTmpDir("sbt"); - const nested = path.join(root, "sub"); + const root = await mkTmpDir('sbt'); + const nested = path.join(root, 'sub'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "build.sbt"), "name := \"tmp\"\n"); + await fs.writeFile(path.join(root, 'build.sbt'), 'name := "tmp"\n'); const found = await findProjectRoot(nested); - await assertEqual(found, root, "build.sbt should be detected"); - return { name: "sbt-build", ok: true }; + await assertEqual(found, root, 'build.sbt should be detected'); + return { name: 'sbt-build', ok: true }; } async function testComposer() { - const root = await mkTmpDir("composer"); - const nested = path.join(root, "src"); + const root = await mkTmpDir('composer'); + const nested = path.join(root, 'src'); await fs.ensureDir(nested); - await fs.writeJson(path.join(root, "composer.json"), { name: "tmp/pkg" }, { spaces: 2 }); - await fs.writeFile(path.join(root, "composer.lock"), "{}\n"); + await fs.writeJson(path.join(root, 'composer.json'), { name: 'tmp/pkg' }, { spaces: 2 }); + await fs.writeFile(path.join(root, 'composer.lock'), '{}\n'); const found = await findProjectRoot(nested); - await assertEqual(found, root, "composer.{json,lock} should be detected"); - return { name: "composer", ok: true }; + await assertEqual(found, root, 'composer.{json,lock} should be detected'); + return { name: 'composer', ok: true }; } async function testCargo() { - const root = await mkTmpDir("cargo"); - const nested = path.join(root, "src"); + const root = await mkTmpDir('cargo'); + const nested = path.join(root, 'src'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "Cargo.toml"), "[package]\nname='tmp'\nversion='0.0.0'\n"); + await fs.writeFile(path.join(root, 'Cargo.toml'), "[package]\nname='tmp'\nversion='0.0.0'\n"); const found = await findProjectRoot(nested); - await assertEqual(found, root, "Cargo.toml should be detected"); - return { name: "cargo", ok: true }; + await assertEqual(found, root, 'Cargo.toml should be detected'); + return { name: 'cargo', ok: true }; } async function testNixFlake() { - const root = await mkTmpDir("nix"); - const nested = path.join(root, "work"); + const root = await mkTmpDir('nix'); + const nested = path.join(root, 'work'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "flake.nix"), "{ }\n"); + await fs.writeFile(path.join(root, 'flake.nix'), '{ }\n'); const found = await findProjectRoot(nested); - await assertEqual(found, root, "flake.nix should be detected"); - return { name: "nix-flake", ok: true }; + await assertEqual(found, root, 'flake.nix should be detected'); + return { name: 'nix-flake', ok: true }; } async function testChangesetConfig() { - const root = await mkTmpDir("changeset"); - const nested = path.join(root, "pkg"); + const root = await mkTmpDir('changeset'); + const nested = path.join(root, 'pkg'); await fs.ensureDir(nested); - await fs.ensureDir(path.join(root, ".changeset")); - await fs.writeJson(path.join(root, ".changeset", "config.json"), { $schema: "https://unpkg.com/@changesets/config@2.3.1/schema.json" }, { spaces: 2 }); + await fs.ensureDir(path.join(root, '.changeset')); + await fs.writeJson( + path.join(root, '.changeset', 'config.json'), + { $schema: 'https://unpkg.com/@changesets/config@2.3.1/schema.json' }, + { spaces: 2 }, + ); const found = await findProjectRoot(nested); - await assertEqual(found, root, ".changeset/config.json should be detected"); - return { name: "changesets", ok: true }; + await assertEqual(found, root, '.changeset/config.json should be detected'); + return { name: 'changesets', ok: true }; } async function testEnvCustomMarker() { - const root = await mkTmpDir("env-marker"); - const nested = path.join(root, "dir"); + const root = await mkTmpDir('env-marker'); + const nested = path.join(root, 'dir'); await fs.ensureDir(nested); - await fs.writeFile(path.join(root, "MY_ROOT"), "\n"); + await fs.writeFile(path.join(root, 'MY_ROOT'), '\n'); const prev = process.env.PROJECT_ROOT_MARKERS; - process.env.PROJECT_ROOT_MARKERS = "MY_ROOT"; + process.env.PROJECT_ROOT_MARKERS = 'MY_ROOT'; try { const found = await findProjectRoot(nested); - await assertEqual(found, root, "custom env marker should be honored"); + await assertEqual(found, root, 'custom env marker should be honored'); } finally { - if (prev === undefined) delete process.env.PROJECT_ROOT_MARKERS; else process.env.PROJECT_ROOT_MARKERS = prev; + if (prev === undefined) delete process.env.PROJECT_ROOT_MARKERS; + else process.env.PROJECT_ROOT_MARKERS = prev; } - return { name: "env-custom-marker", ok: true }; + return { name: 'env-custom-marker', ok: true }; } async function testPackageLowPriorityVsLock() { - const root = await mkTmpDir("pkg-vs-lock"); - const nested = path.join(root, "nested"); - await fs.ensureDir(path.join(nested, "deep")); - await fs.writeJson(path.join(nested, "package.json"), { name: "nested" }, { spaces: 2 }); - await fs.writeFile(path.join(root, "yarn.lock"), "\n"); - const found = await findProjectRoot(path.join(nested, "deep")); - await assertEqual(found, root, "lockfile at root should outrank nested package.json"); - return { name: "package-vs-lock-priority", ok: true }; + const root = await mkTmpDir('pkg-vs-lock'); + const nested = path.join(root, 'nested'); + await fs.ensureDir(path.join(nested, 'deep')); + await fs.writeJson(path.join(nested, 'package.json'), { name: 'nested' }, { spaces: 2 }); + await fs.writeFile(path.join(root, 'yarn.lock'), '\n'); + const found = await findProjectRoot(path.join(nested, 'deep')); + await assertEqual(found, root, 'lockfile at root should outrank nested package.json'); + return { name: 'package-vs-lock-priority', ok: true }; } async function run() { @@ -381,25 +389,25 @@ async function run() { try { const r = await t(); results.push({ ...r, ok: true }); - console.log(`✔ ${r.name}${r.skipped ? " (skipped)" : ""}`); - } catch (err) { - console.error(`✖ ${t.name}:`, err && err.message ? err.message : err); - results.push({ name: t.name, ok: false, error: String(err) }); + console.log(`✔ ${r.name}${r.skipped ? ' (skipped)' : ''}`); + } catch (error) { + console.error(`✖ ${t.name}:`, error && error.message ? error.message : error); + results.push({ name: t.name, ok: false, error: String(error) }); } } const failed = results.filter((r) => !r.ok); - console.log("\nSummary:"); + console.log('\nSummary:'); for (const r of results) { - console.log(`- ${r.name}: ${r.ok ? "ok" : "FAIL"}${r.skipped ? " (skipped)" : ""}`); + console.log(`- ${r.name}: ${r.ok ? 'ok' : 'FAIL'}${r.skipped ? ' (skipped)' : ''}`); } - if (failed.length) { + if (failed.length > 0) { process.exitCode = 1; } } -run().catch((e) => { - console.error("Fatal error:", e); +run().catch((error) => { + console.error('Fatal error:', error); process.exit(1); }); diff --git a/tools/flattener/xml.js b/tools/flattener/xml.js index a1ce615c..a8d999f2 100644 --- a/tools/flattener/xml.js +++ b/tools/flattener/xml.js @@ -1,49 +1,44 @@ -const fs = require("fs-extra"); +const fs = require('fs-extra'); -function escapeXml(str) { - if (typeof str !== "string") { - return String(str); +function escapeXml(string_) { + if (typeof string_ !== 'string') { + return String(string_); } - return str - .replace(/&/g, "&") - .replace(/ ` ${line}`); + return content.split('\n').map((line) => ` ${line}`); } function generateXMLOutput(aggregatedContent, outputPath) { const { textFiles } = aggregatedContent; - const writeStream = fs.createWriteStream(outputPath, { encoding: "utf8" }); + const writeStream = fs.createWriteStream(outputPath, { encoding: 'utf8' }); return new Promise((resolve, reject) => { - writeStream.on("error", reject); - writeStream.on("finish", resolve); + writeStream.on('error', reject); + writeStream.on('finish', resolve); writeStream.write('\n'); - writeStream.write("\n"); + writeStream.write('\n'); // Sort files by path for deterministic order - const filesSorted = [...textFiles].sort((a, b) => - a.path.localeCompare(b.path) - ); + const filesSorted = [...textFiles].sort((a, b) => a.path.localeCompare(b.path)); let index = 0; const writeNext = () => { if (index >= filesSorted.length) { - writeStream.write("\n"); + writeStream.write('\n'); writeStream.end(); return; } const file = filesSorted[index++]; const p = escapeXml(file.path); - const content = typeof file.content === "string" ? file.content : ""; + const content = typeof file.content === 'string' ? file.content : ''; if (content.length === 0) { writeStream.write(`\t\n`); @@ -51,27 +46,34 @@ function generateXMLOutput(aggregatedContent, outputPath) { return; } - const needsCdata = content.includes("<") || content.includes("&") || - content.includes("]]>"); + const needsCdata = content.includes('<') || content.includes('&') || content.includes(']]>'); if (needsCdata) { // Open tag and CDATA on their own line with tab indent; content lines indented with two tabs writeStream.write(`\t" inside content, trim trailing newlines, indent each line with two tabs - const safe = content.replace(/]]>/g, "]]]]>"); - const trimmed = safe.replace(/[\r\n]+$/, ""); - const indented = trimmed.length > 0 - ? trimmed.split("\n").map((line) => `\t\t${line}`).join("\n") - : ""; + const safe = content.replaceAll(']]>', ']]]]>'); + const trimmed = safe.replace(/[\r\n]+$/, ''); + const indented = + trimmed.length > 0 + ? trimmed + .split('\n') + .map((line) => `\t\t${line}`) + .join('\n') + : ''; writeStream.write(indented); // Close CDATA and attach closing tag directly after the last content line - writeStream.write("]]>\n"); + writeStream.write(']]>\n'); } else { // Write opening tag then newline; indent content with two tabs; attach closing tag directly after last content char writeStream.write(`\t\n`); - const trimmed = content.replace(/[\r\n]+$/, ""); - const indented = trimmed.length > 0 - ? trimmed.split("\n").map((line) => `\t\t${line}`).join("\n") - : ""; + const trimmed = content.replace(/[\r\n]+$/, ''); + const indented = + trimmed.length > 0 + ? trimmed + .split('\n') + .map((line) => `\t\t${line}`) + .join('\n') + : ''; writeStream.write(indented); writeStream.write(`\n`); } diff --git a/tools/installer/bin/bmad.js b/tools/installer/bin/bmad.js index a0620f83..5160bf6d 100755 --- a/tools/installer/bin/bmad.js +++ b/tools/installer/bin/bmad.js @@ -1,13 +1,13 @@ #!/usr/bin/env node const { program } = require('commander'); -const path = require('path'); -const fs = require('fs').promises; +const path = require('node:path'); +const fs = require('node:fs').promises; const yaml = require('js-yaml'); const chalk = require('chalk').default || require('chalk'); const inquirer = require('inquirer').default || require('inquirer'); const semver = require('semver'); -const https = require('https'); +const https = require('node:https'); // Handle both execution contexts (from root via npx or from installer directory) let version; @@ -18,18 +18,20 @@ try { version = require('../package.json').version; packageName = require('../package.json').name; installer = require('../lib/installer'); -} catch (e) { +} catch (error) { // Fall back to root context (when run via npx from GitHub) - console.log(`Installer context not found (${e.message}), trying root context...`); + console.log(`Installer context not found (${error.message}), trying root context...`); try { version = require('../../../package.json').version; installer = require('../../../tools/installer/lib/installer'); - } catch (e2) { - console.error('Error: Could not load required modules. Please ensure you are running from the correct directory.'); + } catch (error) { + console.error( + 'Error: Could not load required modules. Please ensure you are running from the correct directory.', + ); console.error('Debug info:', { __dirname, cwd: process.cwd(), - error: e2.message + error: error.message, }); process.exit(1); } @@ -45,8 +47,14 @@ program .option('-f, --full', 'Install complete BMad Method') .option('-x, --expansion-only', 'Install only expansion packs (no bmad-core)') .option('-d, --directory ', 'Installation directory') - .option('-i, --ide ', 'Configure for specific IDE(s) - can specify multiple (cursor, claude-code, windsurf, trae, roo, kilo, cline, gemini, qwen-code, github-copilot, crush, other)') - .option('-e, --expansion-packs ', 'Install specific expansion packs (can specify multiple)') + .option( + '-i, --ide ', + 'Configure for specific IDE(s) - can specify multiple (cursor, claude-code, windsurf, trae, roo, kilo, cline, gemini, qwen-code, github-copilot, other)', + ) + .option( + '-e, --expansion-packs ', + 'Install specific expansion packs (can specify multiple)', + ) .action(async (options) => { try { if (!options.full && !options.expansionOnly) { @@ -64,8 +72,8 @@ program const config = { installType, directory: options.directory || '.', - ides: (options.ide || []).filter(ide => ide !== 'other'), - expansionPacks: options.expansionPacks || [] + ides: (options.ide || []).filter((ide) => ide !== 'other'), + expansionPacks: options.expansionPacks || [], }; await installer.install(config); process.exit(0); @@ -96,28 +104,30 @@ program .description('Check for BMad Update') .action(async () => { console.log('Checking for updates...'); - + // Make HTTP request to npm registry for latest version info - const req = https.get(`https://registry.npmjs.org/${packageName}/latest`, res => { + const req = https.get(`https://registry.npmjs.org/${packageName}/latest`, (res) => { // Check for HTTP errors (non-200 status codes) if (res.statusCode !== 200) { console.error(chalk.red(`Update check failed: Received status code ${res.statusCode}`)); return; } - + // Accumulate response data chunks let data = ''; - res.on('data', chunk => data += chunk); - + res.on('data', (chunk) => (data += chunk)); + // Process complete response res.on('end', () => { try { // Parse npm registry response and extract version const latest = JSON.parse(data).version; - + // Compare versions using semver if (semver.gt(latest, version)) { - console.log(chalk.bold.blue(`⚠️ ${packageName} update available: ${version} → ${latest}`)); + console.log( + chalk.bold.blue(`⚠️ ${packageName} update available: ${version} → ${latest}`), + ); console.log(chalk.bold.blue('\nInstall latest by running:')); console.log(chalk.bold.magenta(` npm install ${packageName}@latest`)); console.log(chalk.dim(' or')); @@ -131,14 +141,14 @@ program } }); }); - + // Handle network/connection errors - req.on('error', error => { + req.on('error', (error) => { console.error(chalk.red('Update check failed:'), error.message); }); - + // Set 30 second timeout to prevent hanging - req.setTimeout(30000, () => { + req.setTimeout(30_000, () => { req.destroy(); console.error(chalk.red('Update check timed out')); }); @@ -183,16 +193,17 @@ program }); async function promptInstallation() { - // Display ASCII logo - console.log(chalk.bold.cyan(` -██████╗ ███╗ ███╗ █████╗ ██████╗ ███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ + console.log( + chalk.bold.cyan(` +██████╗ ███╗ ███╗ █████╗ ██████╗ ███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ██╔══██╗████╗ ████║██╔══██╗██╔══██╗ ████╗ ████║██╔════╝╚══██╔══╝██║ ██║██╔═══██╗██╔══██╗ ██████╔╝██╔████╔██║███████║██║ ██║█████╗██╔████╔██║█████╗ ██║ ███████║██║ ██║██║ ██║ ██╔══██╗██║╚██╔╝██║██╔══██║██║ ██║╚════╝██║╚██╔╝██║██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║ ██████╔╝██║ ╚═╝ ██║██║ ██║██████╔╝ ██║ ╚═╝ ██║███████╗ ██║ ██║ ██║╚██████╔╝██████╔╝ -╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ - `)); +╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ + `), + ); console.log(chalk.bold.magenta('🚀 Universal AI Agent Framework for Any Domain')); console.log(chalk.bold.blue(`✨ Installer v${version}\n`)); @@ -210,8 +221,8 @@ async function promptInstallation() { return 'Please enter a valid project path'; } return true; - } - } + }, + }, ]); answers.directory = directory; @@ -238,9 +249,10 @@ async function promptInstallation() { if (state.type === 'v4_existing') { const currentVersion = state.manifest?.version || 'unknown'; const newVersion = version; // Always use package.json version - const versionInfo = currentVersion === newVersion - ? `(v${currentVersion} - reinstall)` - : `(v${currentVersion} → v${newVersion})`; + const versionInfo = + currentVersion === newVersion + ? `(v${currentVersion} - reinstall)` + : `(v${currentVersion} → v${newVersion})`; bmadOptionText = `Update ${coreShortTitle} ${versionInfo} .bmad-core`; } else { bmadOptionText = `${coreShortTitle} (v${version}) .bmad-core`; @@ -249,7 +261,7 @@ async function promptInstallation() { choices.push({ name: bmadOptionText, value: 'bmad-core', - checked: true + checked: true, }); // Add expansion pack options @@ -260,9 +272,10 @@ async function promptInstallation() { if (existing) { const currentVersion = existing.manifest?.version || 'unknown'; const newVersion = pack.version; - const versionInfo = currentVersion === newVersion - ? `(v${currentVersion} - reinstall)` - : `(v${currentVersion} → v${newVersion})`; + const versionInfo = + currentVersion === newVersion + ? `(v${currentVersion} - reinstall)` + : `(v${currentVersion} → v${newVersion})`; packOptionText = `Update ${pack.shortTitle} ${versionInfo} .${pack.id}`; } else { packOptionText = `${pack.shortTitle} (v${pack.version}) .${pack.id}`; @@ -271,7 +284,7 @@ async function promptInstallation() { choices.push({ name: packOptionText, value: pack.id, - checked: false + checked: false, }); } @@ -287,13 +300,13 @@ async function promptInstallation() { return 'Please select at least one item to install'; } return true; - } - } + }, + }, ]); // Process selections answers.installType = selectedItems.includes('bmad-core') ? 'full' : 'expansion-only'; - answers.expansionPacks = selectedItems.filter(item => item !== 'bmad-core'); + answers.expansionPacks = selectedItems.filter((item) => item !== 'bmad-core'); // Ask sharding questions if installing BMad core if (selectedItems.includes('bmad-core')) { @@ -306,8 +319,8 @@ async function promptInstallation() { type: 'confirm', name: 'prdSharded', message: 'Will the PRD (Product Requirements Document) be sharded into multiple files?', - default: true - } + default: true, + }, ]); answers.prdSharded = prdSharded; @@ -317,18 +330,30 @@ async function promptInstallation() { type: 'confirm', name: 'architectureSharded', message: 'Will the architecture documentation be sharded into multiple files?', - default: true - } + default: true, + }, ]); answers.architectureSharded = architectureSharded; // Show warning if architecture sharding is disabled if (!architectureSharded) { console.log(chalk.yellow.bold('\n⚠️ IMPORTANT: Architecture Sharding Disabled')); - console.log(chalk.yellow('With architecture sharding disabled, you should still create the files listed')); - console.log(chalk.yellow('in devLoadAlwaysFiles (like coding-standards.md, tech-stack.md, source-tree.md)')); + console.log( + chalk.yellow( + 'With architecture sharding disabled, you should still create the files listed', + ), + ); + console.log( + chalk.yellow( + 'in devLoadAlwaysFiles (like coding-standards.md, tech-stack.md, source-tree.md)', + ), + ); console.log(chalk.yellow('as these are used by the dev agent at runtime.')); - console.log(chalk.yellow('\nAlternatively, you can remove these files from the devLoadAlwaysFiles list')); + console.log( + chalk.yellow( + '\nAlternatively, you can remove these files from the devLoadAlwaysFiles list', + ), + ); console.log(chalk.yellow('in your core-config.yaml after installation.')); const { acknowledge } = await inquirer.prompt([ @@ -336,8 +361,8 @@ async function promptInstallation() { type: 'confirm', name: 'acknowledge', message: 'Do you acknowledge this requirement and want to proceed?', - default: false - } + default: false, + }, ]); if (!acknowledge) { @@ -353,7 +378,11 @@ async function promptInstallation() { while (!ideSelectionComplete) { console.log(chalk.cyan('\n🛠️ IDE Configuration')); - console.log(chalk.bold.yellow.bgRed(' ⚠️ IMPORTANT: This is a MULTISELECT! Use SPACEBAR to toggle each IDE! ')); + console.log( + chalk.bold.yellow.bgRed( + ' ⚠️ IMPORTANT: This is a MULTISELECT! Use SPACEBAR to toggle each IDE! ', + ), + ); console.log(chalk.bold.magenta('🔸 Use arrow keys to navigate')); console.log(chalk.bold.magenta('🔸 Use SPACEBAR to select/deselect IDEs')); console.log(chalk.bold.magenta('🔸 Press ENTER when finished selecting\n')); @@ -362,7 +391,8 @@ async function promptInstallation() { { type: 'checkbox', name: 'ides', - message: 'Which IDE(s) do you want to configure? (Select with SPACEBAR, confirm with ENTER):', + message: + 'Which IDE(s) do you want to configure? (Select with SPACEBAR, confirm with ENTER):', choices: [ { name: 'Cursor', value: 'cursor' }, { name: 'Claude Code', value: 'claude-code' }, @@ -374,9 +404,9 @@ async function promptInstallation() { { name: 'Gemini CLI', value: 'gemini' }, { name: 'Qwen Code', value: 'qwen-code' }, { name: 'Crush', value: 'crush' }, - { name: 'Github Copilot', value: 'github-copilot' } - ] - } + { name: 'Github Copilot', value: 'github-copilot' }, + ], + }, ]); ides = ideResponse.ides; @@ -387,13 +417,19 @@ async function promptInstallation() { { type: 'confirm', name: 'confirmNoIde', - message: chalk.red('⚠️ You have NOT selected any IDEs. This means NO IDE integration will be set up. Is this correct?'), - default: false - } + message: chalk.red( + '⚠️ You have NOT selected any IDEs. This means NO IDE integration will be set up. Is this correct?', + ), + default: false, + }, ]); if (!confirmNoIde) { - console.log(chalk.bold.red('\n🔄 Returning to IDE selection. Remember to use SPACEBAR to select IDEs!\n')); + console.log( + chalk.bold.red( + '\n🔄 Returning to IDE selection. Remember to use SPACEBAR to select IDEs!\n', + ), + ); continue; // Go back to IDE selection only } } @@ -407,7 +443,9 @@ async function promptInstallation() { // Configure GitHub Copilot immediately if selected if (ides.includes('github-copilot')) { console.log(chalk.cyan('\n🔧 GitHub Copilot Configuration')); - console.log(chalk.dim('BMad works best with specific VS Code settings for optimal agent experience.\n')); + console.log( + chalk.dim('BMad works best with specific VS Code settings for optimal agent experience.\n'), + ); const { configChoice } = await inquirer.prompt([ { @@ -417,19 +455,19 @@ async function promptInstallation() { choices: [ { name: 'Use recommended defaults (fastest setup)', - value: 'defaults' + value: 'defaults', }, { name: 'Configure each setting manually (customize to your preferences)', - value: 'manual' + value: 'manual', }, { - name: 'Skip settings configuration (I\'ll configure manually later)', - value: 'skip' - } + name: "Skip settings configuration (I'll configure manually later)", + value: 'skip', + }, ], - default: 'defaults' - } + default: 'defaults', + }, ]); answers.githubCopilotConfig = { configChoice }; @@ -440,14 +478,17 @@ async function promptInstallation() { { type: 'confirm', name: 'includeWebBundles', - message: 'Would you like to include pre-built web bundles? (standalone files for ChatGPT, Claude, Gemini)', - default: false - } + message: + 'Would you like to include pre-built web bundles? (standalone files for ChatGPT, Claude, Gemini)', + default: false, + }, ]); if (includeWebBundles) { console.log(chalk.cyan('\n📦 Web bundles are standalone files perfect for web AI platforms.')); - console.log(chalk.dim(' You can choose different teams/agents than your IDE installation.\n')); + console.log( + chalk.dim(' You can choose different teams/agents than your IDE installation.\n'), + ); const { webBundleType } = await inquirer.prompt([ { @@ -457,22 +498,22 @@ async function promptInstallation() { choices: [ { name: 'All available bundles (agents, teams, expansion packs)', - value: 'all' + value: 'all', }, { name: 'Specific teams only', - value: 'teams' + value: 'teams', }, { name: 'Individual agents only', - value: 'agents' + value: 'agents', }, { name: 'Custom selection', - value: 'custom' - } - ] - } + value: 'custom', + }, + ], + }, ]); answers.webBundleType = webBundleType; @@ -485,18 +526,18 @@ async function promptInstallation() { type: 'checkbox', name: 'selectedTeams', message: 'Select team bundles to include:', - choices: teams.map(t => ({ + choices: teams.map((t) => ({ name: `${t.icon || '📋'} ${t.name}: ${t.description}`, value: t.id, - checked: webBundleType === 'teams' // Check all if teams-only mode + checked: webBundleType === 'teams', // Check all if teams-only mode })), validate: (answer) => { - if (answer.length < 1) { + if (answer.length === 0) { return 'You must select at least one team.'; } return true; - } - } + }, + }, ]); answers.selectedWebBundleTeams = selectedTeams; } @@ -508,8 +549,8 @@ async function promptInstallation() { type: 'confirm', name: 'includeIndividualAgents', message: 'Also include individual agent bundles?', - default: true - } + default: true, + }, ]); answers.includeIndividualAgents = includeIndividualAgents; } @@ -525,8 +566,8 @@ async function promptInstallation() { return 'Please enter a valid directory path'; } return true; - } - } + }, + }, ]); answers.webBundlesDirectory = webBundlesDirectory; } @@ -539,6 +580,6 @@ async function promptInstallation() { program.parse(process.argv); // Show help if no command provided -if (!process.argv.slice(2).length) { +if (process.argv.slice(2).length === 0) { program.outputHelp(); -} \ No newline at end of file +} diff --git a/tools/installer/config/ide-agent-config.yaml b/tools/installer/config/ide-agent-config.yaml index c4fa7d0f..3c7e318f 100644 --- a/tools/installer/config/ide-agent-config.yaml +++ b/tools/installer/config/ide-agent-config.yaml @@ -55,4 +55,4 @@ cline-order: game-designer: 12 game-developer: 13 game-sm: 14 - infra-devops-platform: 15 \ No newline at end of file + infra-devops-platform: 15 diff --git a/tools/installer/config/install.config.yaml b/tools/installer/config/install.config.yaml index 7a346149..b2176a96 100644 --- a/tools/installer/config/install.config.yaml +++ b/tools/installer/config/install.config.yaml @@ -40,12 +40,12 @@ ide-configurations: # 3. Crush will switch to that agent's persona / task windsurf: name: Windsurf - rule-dir: .windsurf/rules/ + rule-dir: .windsurf/workflows/ format: multi-file command-suffix: .md instructions: | # To use BMad agents in Windsurf: - # 1. Type @agent-name (e.g., "@dev", "@pm") + # 1. Type /agent-name (e.g., "/dev", "/pm") # 2. Windsurf will adopt that agent's persona trae: name: Trae diff --git a/tools/installer/lib/config-loader.js b/tools/installer/lib/config-loader.js index b890a315..3e026c6b 100644 --- a/tools/installer/lib/config-loader.js +++ b/tools/installer/lib/config-loader.js @@ -1,5 +1,5 @@ const fs = require('fs-extra'); -const path = require('path'); +const path = require('node:path'); const yaml = require('js-yaml'); const { extractYamlFromAgent } = require('../../lib/yaml-utils'); @@ -11,7 +11,7 @@ class ConfigLoader { async load() { if (this.config) return this.config; - + try { const configContent = await fs.readFile(this.configPath, 'utf8'); this.config = yaml.load(configContent); @@ -28,30 +28,30 @@ class ConfigLoader { async getAvailableAgents() { const agentsDir = path.join(this.getBmadCorePath(), 'agents'); - + try { const entries = await fs.readdir(agentsDir, { withFileTypes: true }); const agents = []; - + for (const entry of entries) { if (entry.isFile() && entry.name.endsWith('.md')) { const agentPath = path.join(agentsDir, entry.name); const agentId = path.basename(entry.name, '.md'); - + try { const agentContent = await fs.readFile(agentPath, 'utf8'); - + // Extract YAML block from agent file const yamlContentText = extractYamlFromAgent(agentContent); if (yamlContentText) { const yamlContent = yaml.load(yamlContentText); const agentConfig = yamlContent.agent || {}; - + agents.push({ id: agentId, name: agentConfig.title || agentConfig.name || agentId, file: `bmad-core/agents/${entry.name}`, - description: agentConfig.whenToUse || 'No description available' + description: agentConfig.whenToUse || 'No description available', }); } } catch (error) { @@ -59,10 +59,10 @@ class ConfigLoader { } } } - + // Sort agents by name for consistent display agents.sort((a, b) => a.name.localeCompare(b.name)); - + return agents; } catch (error) { console.warn(`Failed to read agents directory: ${error.message}`); @@ -72,41 +72,45 @@ class ConfigLoader { async getAvailableExpansionPacks() { const expansionPacksDir = path.join(this.getBmadCorePath(), '..', 'expansion-packs'); - + try { const entries = await fs.readdir(expansionPacksDir, { withFileTypes: true }); const expansionPacks = []; - + for (const entry of entries) { if (entry.isDirectory() && !entry.name.startsWith('.')) { const packPath = path.join(expansionPacksDir, entry.name); const configPath = path.join(packPath, 'config.yaml'); - + try { // Read config.yaml const configContent = await fs.readFile(configPath, 'utf8'); const config = yaml.load(configContent); - + expansionPacks.push({ id: entry.name, name: config.name || entry.name, - description: config['short-title'] || config.description || 'No description available', - fullDescription: config.description || config['short-title'] || 'No description available', + description: + config['short-title'] || config.description || 'No description available', + fullDescription: + config.description || config['short-title'] || 'No description available', version: config.version || '1.0.0', author: config.author || 'BMad Team', packPath: packPath, - dependencies: config.dependencies?.agents || [] + dependencies: config.dependencies?.agents || [], }); } catch (error) { // Fallback if config.yaml doesn't exist or can't be read - console.warn(`Failed to read config for expansion pack ${entry.name}: ${error.message}`); - + console.warn( + `Failed to read config for expansion pack ${entry.name}: ${error.message}`, + ); + // Try to derive info from directory name as fallback const name = entry.name .split('-') - .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) .join(' '); - + expansionPacks.push({ id: entry.name, name: name, @@ -115,12 +119,12 @@ class ConfigLoader { version: '1.0.0', author: 'BMad Team', packPath: packPath, - dependencies: [] + dependencies: [], }); } } } - + return expansionPacks; } catch (error) { console.warn(`Failed to read expansion packs directory: ${error.message}`); @@ -132,16 +136,16 @@ class ConfigLoader { // Use DependencyResolver to dynamically parse agent dependencies const DependencyResolver = require('../../lib/dependency-resolver'); const resolver = new DependencyResolver(path.join(__dirname, '..', '..', '..')); - + const agentDeps = await resolver.resolveAgentDependencies(agentId); - + // Convert to flat list of file paths const depPaths = []; - + // Core files and utilities are included automatically by DependencyResolver - + // Add agent file itself is already handled by installer - + // Add all resolved resources for (const resource of agentDeps.resources) { const filePath = `.bmad-core/${resource.type}/${resource.id}.md`; @@ -149,7 +153,7 @@ class ConfigLoader { depPaths.push(filePath); } } - + return depPaths; } @@ -175,25 +179,25 @@ class ConfigLoader { async getAvailableTeams() { const teamsDir = path.join(this.getBmadCorePath(), 'agent-teams'); - + try { const entries = await fs.readdir(teamsDir, { withFileTypes: true }); const teams = []; - + for (const entry of entries) { if (entry.isFile() && entry.name.endsWith('.yaml')) { const teamPath = path.join(teamsDir, entry.name); - + try { const teamContent = await fs.readFile(teamPath, 'utf8'); const teamConfig = yaml.load(teamContent); - + if (teamConfig.bundle) { teams.push({ id: path.basename(entry.name, '.yaml'), name: teamConfig.bundle.name || entry.name, description: teamConfig.bundle.description || 'Team configuration', - icon: teamConfig.bundle.icon || '📋' + icon: teamConfig.bundle.icon || '📋', }); } } catch (error) { @@ -201,7 +205,7 @@ class ConfigLoader { } } } - + return teams; } catch (error) { console.warn(`Warning: Could not scan teams directory: ${error.message}`); @@ -217,16 +221,16 @@ class ConfigLoader { // Use DependencyResolver to dynamically parse team dependencies const DependencyResolver = require('../../lib/dependency-resolver'); const resolver = new DependencyResolver(path.join(__dirname, '..', '..', '..')); - + try { const teamDeps = await resolver.resolveTeamDependencies(teamId); - + // Convert to flat list of file paths const depPaths = []; - + // Add team config file depPaths.push(`.bmad-core/agent-teams/${teamId}.yaml`); - + // Add all agents for (const agent of teamDeps.agents) { const filePath = `.bmad-core/agents/${agent.id}.md`; @@ -234,7 +238,7 @@ class ConfigLoader { depPaths.push(filePath); } } - + // Add all resolved resources for (const resource of teamDeps.resources) { const filePath = `.bmad-core/${resource.type}/${resource.id}.${resource.type === 'workflows' ? 'yaml' : 'md'}`; @@ -242,7 +246,7 @@ class ConfigLoader { depPaths.push(filePath); } } - + return depPaths; } catch (error) { throw new Error(`Failed to resolve team dependencies for ${teamId}: ${error.message}`); @@ -250,4 +254,4 @@ class ConfigLoader { } } -module.exports = new ConfigLoader(); \ No newline at end of file +module.exports = new ConfigLoader(); diff --git a/tools/installer/lib/file-manager.js b/tools/installer/lib/file-manager.js index 32a0f4a0..df386da8 100644 --- a/tools/installer/lib/file-manager.js +++ b/tools/installer/lib/file-manager.js @@ -1,32 +1,24 @@ -const fs = require("fs-extra"); -const path = require("path"); -const crypto = require("crypto"); -const yaml = require("js-yaml"); -const chalk = require("chalk").default || require("chalk"); -const { createReadStream, createWriteStream, promises: fsPromises } = require('fs'); -const { pipeline } = require('stream/promises'); +const fs = require('fs-extra'); +const path = require('node:path'); +const crypto = require('node:crypto'); +const yaml = require('js-yaml'); +const chalk = require('chalk'); +const { createReadStream, createWriteStream, promises: fsPromises } = require('node:fs'); +const { pipeline } = require('node:stream/promises'); const resourceLocator = require('./resource-locator'); class FileManager { - constructor() { - this.manifestDir = ".bmad-core"; - this.manifestFile = "install-manifest.yaml"; - } + constructor() {} async copyFile(source, destination) { try { await fs.ensureDir(path.dirname(destination)); - + // Use streaming for large files (> 10MB) const stats = await fs.stat(source); - if (stats.size > 10 * 1024 * 1024) { - await pipeline( - createReadStream(source), - createWriteStream(destination) - ); - } else { - await fs.copy(source, destination); - } + await (stats.size > 10 * 1024 * 1024 + ? pipeline(createReadStream(source), createWriteStream(destination)) + : fs.copy(source, destination)); return true; } catch (error) { console.error(chalk.red(`Failed to copy ${source}:`), error.message); @@ -37,32 +29,24 @@ class FileManager { async copyDirectory(source, destination) { try { await fs.ensureDir(destination); - + // Use streaming copy for large directories const files = await resourceLocator.findFiles('**/*', { cwd: source, - nodir: true + nodir: true, }); - + // Process files in batches to avoid memory issues const batchSize = 50; - for (let i = 0; i < files.length; i += batchSize) { - const batch = files.slice(i, i + batchSize); + for (let index = 0; index < files.length; index += batchSize) { + const batch = files.slice(index, index + batchSize); await Promise.all( - batch.map(file => - this.copyFile( - path.join(source, file), - path.join(destination, file) - ) - ) + batch.map((file) => this.copyFile(path.join(source, file), path.join(destination, file))), ); } return true; } catch (error) { - console.error( - chalk.red(`Failed to copy directory ${source}:`), - error.message - ); + console.error(chalk.red(`Failed to copy directory ${source}:`), error.message); return false; } } @@ -73,17 +57,16 @@ class FileManager { for (const file of files) { const sourcePath = path.join(sourceDir, file); - const destPath = path.join(destDir, file); + const destinationPath = path.join(destDir, file); // Use root replacement if rootValue is provided and file needs it - const needsRootReplacement = rootValue && (file.endsWith('.md') || file.endsWith('.yaml') || file.endsWith('.yml')); - + const needsRootReplacement = + rootValue && (file.endsWith('.md') || file.endsWith('.yaml') || file.endsWith('.yml')); + let success = false; - if (needsRootReplacement) { - success = await this.copyFileWithRootReplacement(sourcePath, destPath, rootValue); - } else { - success = await this.copyFile(sourcePath, destPath); - } + success = await (needsRootReplacement + ? this.copyFileWithRootReplacement(sourcePath, destinationPath, rootValue) + : this.copyFile(sourcePath, destinationPath)); if (success) { copied.push(file); @@ -97,32 +80,28 @@ class FileManager { try { // Use streaming for hash calculation to reduce memory usage const stream = createReadStream(filePath); - const hash = crypto.createHash("sha256"); - + const hash = crypto.createHash('sha256'); + for await (const chunk of stream) { hash.update(chunk); } - - return hash.digest("hex").slice(0, 16); - } catch (error) { + + return hash.digest('hex').slice(0, 16); + } catch { return null; } } async createManifest(installDir, config, files) { - const manifestPath = path.join( - installDir, - this.manifestDir, - this.manifestFile - ); + const manifestPath = path.join(installDir, this.manifestDir, this.manifestFile); // Read version from package.json - let coreVersion = "unknown"; + let coreVersion = 'unknown'; try { const packagePath = path.join(__dirname, '..', '..', '..', 'package.json'); const packageJson = require(packagePath); coreVersion = packageJson.version; - } catch (error) { + } catch { console.warn("Could not read version from package.json, using 'unknown'"); } @@ -156,31 +135,23 @@ class FileManager { } async readManifest(installDir) { - const manifestPath = path.join( - installDir, - this.manifestDir, - this.manifestFile - ); + const manifestPath = path.join(installDir, this.manifestDir, this.manifestFile); try { - const content = await fs.readFile(manifestPath, "utf8"); + const content = await fs.readFile(manifestPath, 'utf8'); return yaml.load(content); - } catch (error) { + } catch { return null; } } async readExpansionPackManifest(installDir, packId) { - const manifestPath = path.join( - installDir, - `.${packId}`, - this.manifestFile - ); + const manifestPath = path.join(installDir, `.${packId}`, this.manifestFile); try { - const content = await fs.readFile(manifestPath, "utf8"); + const content = await fs.readFile(manifestPath, 'utf8'); return yaml.load(content); - } catch (error) { + } catch { return null; } } @@ -203,24 +174,24 @@ class FileManager { async checkFileIntegrity(installDir, manifest) { const result = { missing: [], - modified: [] + modified: [], }; for (const file of manifest.files) { const filePath = path.join(installDir, file.path); - + // Skip checking the manifest file itself - it will always be different due to timestamps if (file.path.endsWith('install-manifest.yaml')) { continue; } - - if (!(await this.pathExists(filePath))) { - result.missing.push(file.path); - } else { + + if (await this.pathExists(filePath)) { const currentHash = await this.calculateFileHash(filePath); if (currentHash && currentHash !== file.hash) { result.modified.push(file.path); } + } else { + result.missing.push(file.path); } } @@ -228,7 +199,7 @@ class FileManager { } async backupFile(filePath) { - const backupPath = filePath + ".bak"; + const backupPath = filePath + '.bak'; let counter = 1; let finalBackupPath = backupPath; @@ -256,7 +227,7 @@ class FileManager { } async readFile(filePath) { - return fs.readFile(filePath, "utf8"); + return fs.readFile(filePath, 'utf8'); } async writeFile(filePath, content) { @@ -269,14 +240,10 @@ class FileManager { } async createExpansionPackManifest(installDir, packId, config, files) { - const manifestPath = path.join( - installDir, - `.${packId}`, - this.manifestFile - ); + const manifestPath = path.join(installDir, `.${packId}`, this.manifestFile); const manifest = { - version: config.expansionPackVersion || require("../../../package.json").version, + version: config.expansionPackVersion || require('../../../package.json').version, installed_at: new Date().toISOString(), install_type: config.installType, expansion_pack_id: config.expansionPackId, @@ -306,24 +273,24 @@ class FileManager { async modifyCoreConfig(installDir, config) { const coreConfigPath = path.join(installDir, '.bmad-core', 'core-config.yaml'); - + try { // Read the existing core-config.yaml const coreConfigContent = await fs.readFile(coreConfigPath, 'utf8'); const coreConfig = yaml.load(coreConfigContent); - + // Modify sharding settings if provided if (config.prdSharded !== undefined) { coreConfig.prd.prdSharded = config.prdSharded; } - + if (config.architectureSharded !== undefined) { coreConfig.architecture.architectureSharded = config.architectureSharded; } - + // Write back the modified config await fs.writeFile(coreConfigPath, yaml.dump(coreConfig, { indent: 2 })); - + return true; } catch (error) { console.error(chalk.red(`Failed to modify core-config.yaml:`), error.message); @@ -335,31 +302,32 @@ class FileManager { try { // Check file size to determine if we should stream const stats = await fs.stat(source); - - if (stats.size > 5 * 1024 * 1024) { // 5MB threshold + + if (stats.size > 5 * 1024 * 1024) { + // 5MB threshold // Use streaming for large files - const { Transform } = require('stream'); + const { Transform } = require('node:stream'); const replaceStream = new Transform({ transform(chunk, encoding, callback) { - const modified = chunk.toString().replace(/\{root\}/g, rootValue); + const modified = chunk.toString().replaceAll('{root}', rootValue); callback(null, modified); - } + }, }); - + await this.ensureDirectory(path.dirname(destination)); await pipeline( createReadStream(source, { encoding: 'utf8' }), replaceStream, - createWriteStream(destination, { encoding: 'utf8' }) + createWriteStream(destination, { encoding: 'utf8' }), ); } else { // Regular approach for smaller files const content = await fsPromises.readFile(source, 'utf8'); - const updatedContent = content.replace(/\{root\}/g, rootValue); + const updatedContent = content.replaceAll('{root}', rootValue); await this.ensureDirectory(path.dirname(destination)); await fsPromises.writeFile(destination, updatedContent, 'utf8'); } - + return true; } catch (error) { console.error(chalk.red(`Failed to copy ${source} with root replacement:`), error.message); @@ -367,45 +335,55 @@ class FileManager { } } - async copyDirectoryWithRootReplacement(source, destination, rootValue, fileExtensions = ['.md', '.yaml', '.yml']) { + async copyDirectoryWithRootReplacement( + source, + destination, + rootValue, + fileExtensions = ['.md', '.yaml', '.yml'], + ) { try { await this.ensureDirectory(destination); - + // Get all files in source directory - const files = await resourceLocator.findFiles('**/*', { - cwd: source, - nodir: true + const files = await resourceLocator.findFiles('**/*', { + cwd: source, + nodir: true, }); - + let replacedCount = 0; - + for (const file of files) { const sourcePath = path.join(source, file); - const destPath = path.join(destination, file); - + const destinationPath = path.join(destination, file); + // Check if this file type should have {root} replacement - const shouldReplace = fileExtensions.some(ext => file.endsWith(ext)); - + const shouldReplace = fileExtensions.some((extension) => file.endsWith(extension)); + if (shouldReplace) { - if (await this.copyFileWithRootReplacement(sourcePath, destPath, rootValue)) { + if (await this.copyFileWithRootReplacement(sourcePath, destinationPath, rootValue)) { replacedCount++; } } else { // Regular copy for files that don't need replacement - await this.copyFile(sourcePath, destPath); + await this.copyFile(sourcePath, destinationPath); } } - + if (replacedCount > 0) { console.log(chalk.dim(` Processed ${replacedCount} files with {root} replacement`)); } - + return true; } catch (error) { - console.error(chalk.red(`Failed to copy directory ${source} with root replacement:`), error.message); + console.error( + chalk.red(`Failed to copy directory ${source} with root replacement:`), + error.message, + ); return false; } } + manifestDir = '.bmad-core'; + manifestFile = 'install-manifest.yaml'; } module.exports = new FileManager(); diff --git a/tools/installer/lib/ide-base-setup.js b/tools/installer/lib/ide-base-setup.js index 7b28e42c..d47d8d5d 100644 --- a/tools/installer/lib/ide-base-setup.js +++ b/tools/installer/lib/ide-base-setup.js @@ -3,13 +3,13 @@ * Reduces duplication and provides shared methods */ -const path = require("path"); -const fs = require("fs-extra"); -const yaml = require("js-yaml"); -const chalk = require("chalk").default || require("chalk"); -const fileManager = require("./file-manager"); -const resourceLocator = require("./resource-locator"); -const { extractYamlFromAgent } = require("../../lib/yaml-utils"); +const path = require('node:path'); +const fs = require('fs-extra'); +const yaml = require('js-yaml'); +const chalk = require('chalk').default || require('chalk'); +const fileManager = require('./file-manager'); +const resourceLocator = require('./resource-locator'); +const { extractYamlFromAgent } = require('../../lib/yaml-utils'); class BaseIdeSetup { constructor() { @@ -27,19 +27,19 @@ class BaseIdeSetup { } const allAgents = new Set(); - + // Get core agents const coreAgents = await this.getCoreAgentIds(installDir); - coreAgents.forEach(id => allAgents.add(id)); - + for (const id of coreAgents) allAgents.add(id); + // Get expansion pack agents const expansionPacks = await this.getInstalledExpansionPacks(installDir); for (const pack of expansionPacks) { const packAgents = await this.getExpansionPackAgents(pack.path); - packAgents.forEach(id => allAgents.add(id)); + for (const id of packAgents) allAgents.add(id); } - - const result = Array.from(allAgents); + + const result = [...allAgents]; this._agentCache.set(cacheKey, result); return result; } @@ -50,14 +50,14 @@ class BaseIdeSetup { async getCoreAgentIds(installDir) { const coreAgents = []; const corePaths = [ - path.join(installDir, ".bmad-core", "agents"), - path.join(installDir, "bmad-core", "agents") + path.join(installDir, '.bmad-core', 'agents'), + path.join(installDir, 'bmad-core', 'agents'), ]; for (const agentsDir of corePaths) { if (await fileManager.pathExists(agentsDir)) { - const files = await resourceLocator.findFiles("*.md", { cwd: agentsDir }); - coreAgents.push(...files.map(file => path.basename(file, ".md"))); + const files = await resourceLocator.findFiles('*.md', { cwd: agentsDir }); + coreAgents.push(...files.map((file) => path.basename(file, '.md'))); break; // Use first found } } @@ -76,13 +76,13 @@ class BaseIdeSetup { // Use resource locator for efficient path finding let agentPath = await resourceLocator.getAgentPath(agentId); - + if (!agentPath) { // Check installation-specific paths const possiblePaths = [ - path.join(installDir, ".bmad-core", "agents", `${agentId}.md`), - path.join(installDir, "bmad-core", "agents", `${agentId}.md`), - path.join(installDir, "common", "agents", `${agentId}.md`) + path.join(installDir, '.bmad-core', 'agents', `${agentId}.md`), + path.join(installDir, 'bmad-core', 'agents', `${agentId}.md`), + path.join(installDir, 'common', 'agents', `${agentId}.md`), ]; for (const testPath of possiblePaths) { @@ -113,7 +113,7 @@ class BaseIdeSetup { const metadata = yaml.load(yamlContent); return metadata.agent_name || agentId; } - } catch (error) { + } catch { // Fallback to agent ID } return agentId; @@ -129,31 +129,31 @@ class BaseIdeSetup { } const expansionPacks = []; - + // Check for dot-prefixed expansion packs - const dotExpansions = await resourceLocator.findFiles(".bmad-*", { cwd: installDir }); - + const dotExpansions = await resourceLocator.findFiles('.bmad-*', { cwd: installDir }); + for (const dotExpansion of dotExpansions) { - if (dotExpansion !== ".bmad-core") { + if (dotExpansion !== '.bmad-core') { const packPath = path.join(installDir, dotExpansion); - const packName = dotExpansion.substring(1); // remove the dot + const packName = dotExpansion.slice(1); // remove the dot expansionPacks.push({ name: packName, - path: packPath + path: packPath, }); } } - + // Check other dot folders that have config.yaml - const allDotFolders = await resourceLocator.findFiles(".*", { cwd: installDir }); + const allDotFolders = await resourceLocator.findFiles('.*', { cwd: installDir }); for (const folder of allDotFolders) { - if (!folder.startsWith(".bmad-") && folder !== ".bmad-core") { + if (!folder.startsWith('.bmad-') && folder !== '.bmad-core') { const packPath = path.join(installDir, folder); - const configPath = path.join(packPath, "config.yaml"); + const configPath = path.join(packPath, 'config.yaml'); if (await fileManager.pathExists(configPath)) { expansionPacks.push({ - name: folder.substring(1), // remove the dot - path: packPath + name: folder.slice(1), // remove the dot + path: packPath, }); } } @@ -167,13 +167,13 @@ class BaseIdeSetup { * Get expansion pack agents */ async getExpansionPackAgents(packPath) { - const agentsDir = path.join(packPath, "agents"); + const agentsDir = path.join(packPath, 'agents'); if (!(await fileManager.pathExists(agentsDir))) { return []; } - - const agentFiles = await resourceLocator.findFiles("*.md", { cwd: agentsDir }); - return agentFiles.map(file => path.basename(file, ".md")); + + const agentFiles = await resourceLocator.findFiles('*.md', { cwd: agentsDir }); + return agentFiles.map((file) => path.basename(file, '.md')); } /** @@ -183,27 +183,28 @@ class BaseIdeSetup { const agentContent = await fileManager.readFile(agentPath); const agentTitle = await this.getAgentTitle(agentId, installDir); const yamlContent = extractYamlFromAgent(agentContent); - - let content = ""; - + + let content = ''; + if (format === 'mdc') { // MDC format for Cursor - content = "---\n"; - content += "description: \n"; - content += "globs: []\n"; - content += "alwaysApply: false\n"; - content += "---\n\n"; + content = '---\n'; + content += 'description: \n'; + content += 'globs: []\n'; + content += 'alwaysApply: false\n'; + content += '---\n\n'; content += `# ${agentId.toUpperCase()} Agent Rule\n\n`; content += `This rule is triggered when the user types \`@${agentId}\` and activates the ${agentTitle} agent persona.\n\n`; - content += "## Agent Activation\n\n"; - content += "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:\n\n"; - content += "```yaml\n"; - content += yamlContent || agentContent.replace(/^#.*$/m, "").trim(); - content += "\n```\n\n"; - content += "## File Reference\n\n"; - const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/'); + content += '## Agent Activation\n\n'; + content += + '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:\n\n'; + content += '```yaml\n'; + content += yamlContent || agentContent.replace(/^#.*$/m, '').trim(); + content += '\n```\n\n'; + content += '## File Reference\n\n'; + const relativePath = path.relative(installDir, agentPath).replaceAll('\\', '/'); content += `The complete agent definition is available in [${relativePath}](mdc:${relativePath}).\n\n`; - content += "## Usage\n\n"; + content += '## Usage\n\n'; content += `When the user types \`@${agentId}\`, activate this ${agentTitle} persona and follow all instructions defined in the YAML configuration above.\n`; } else if (format === 'claude') { // Claude Code format @@ -211,7 +212,7 @@ class BaseIdeSetup { content += `When this command is used, adopt the following agent persona:\n\n`; content += agentContent; } - + return content; } @@ -224,4 +225,4 @@ class BaseIdeSetup { } } -module.exports = BaseIdeSetup; \ No newline at end of file +module.exports = BaseIdeSetup; diff --git a/tools/installer/lib/ide-setup.js b/tools/installer/lib/ide-setup.js index 4758a0ca..b6944ad1 100644 --- a/tools/installer/lib/ide-setup.js +++ b/tools/installer/lib/ide-setup.js @@ -1,13 +1,13 @@ -const path = require("path"); -const fs = require("fs-extra"); -const yaml = require("js-yaml"); -const chalk = require("chalk").default || require("chalk"); -const inquirer = require("inquirer").default || require("inquirer"); -const fileManager = require("./file-manager"); -const configLoader = require("./config-loader"); -const { extractYamlFromAgent } = require("../../lib/yaml-utils"); -const BaseIdeSetup = require("./ide-base-setup"); -const resourceLocator = require("./resource-locator"); +const path = require('node:path'); +const fs = require('fs-extra'); +const yaml = require('js-yaml'); +const chalk = require('chalk'); +const inquirer = require('inquirer'); +const fileManager = require('./file-manager'); +const configLoader = require('./config-loader'); +const { extractYamlFromAgent } = require('../../lib/yaml-utils'); +const BaseIdeSetup = require('./ide-base-setup'); +const resourceLocator = require('./resource-locator'); class IdeSetup extends BaseIdeSetup { constructor() { @@ -23,11 +23,11 @@ class IdeSetup extends BaseIdeSetup { const configContent = await fs.readFile(configPath, 'utf8'); this.ideAgentConfig = yaml.load(configContent); return this.ideAgentConfig; - } catch (error) { + } catch { console.warn('Failed to load IDE agent configuration, using defaults'); return { 'roo-permissions': {}, - 'cline-order': {} + 'cline-order': {}, }; } } @@ -41,36 +41,48 @@ class IdeSetup extends BaseIdeSetup { } switch (ide) { - case "cursor": + case 'cursor': { return this.setupCursor(installDir, selectedAgent); - case "claude-code": + } + case 'claude-code': { return this.setupClaudeCode(installDir, selectedAgent); - case "crush": + } + case 'crush': { return this.setupCrush(installDir, selectedAgent); - case "windsurf": + } + case 'windsurf': { return this.setupWindsurf(installDir, selectedAgent); - case "trae": + } + case 'trae': { return this.setupTrae(installDir, selectedAgent); - case "roo": + } + case 'roo': { return this.setupRoo(installDir, selectedAgent); - case "cline": + } + case 'cline': { return this.setupCline(installDir, selectedAgent); - case "kilo": + } + case 'kilo': { return this.setupKilocode(installDir, selectedAgent); - case "gemini": + } + case 'gemini': { return this.setupGeminiCli(installDir, selectedAgent); - case "github-copilot": + } + case 'github-copilot': { return this.setupGitHubCopilot(installDir, selectedAgent, spinner, preConfiguredSettings); - case "qwen-code": + } + case 'qwen-code': { return this.setupQwenCode(installDir, selectedAgent); - default: + } + default: { console.log(chalk.yellow(`\nIDE ${ide} not yet supported`)); return false; + } } } async setupCursor(installDir, selectedAgent) { - const cursorRulesDir = path.join(installDir, ".cursor", "rules", "bmad"); + const cursorRulesDir = path.join(installDir, '.cursor', 'rules', 'bmad'); const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); await fileManager.ensureDirectory(cursorRulesDir); @@ -95,7 +107,14 @@ class IdeSetup extends BaseIdeSetup { const coreSlashPrefix = await this.getCoreSlashPrefix(installDir); const coreAgents = selectedAgent ? [selectedAgent] : await this.getCoreAgentIds(installDir); const coreTasks = await this.getCoreTaskIds(installDir); - await this.setupCrushForPackage(installDir, "core", coreSlashPrefix, coreAgents, coreTasks, ".bmad-core"); + await this.setupCrushForPackage( + installDir, + 'core', + coreSlashPrefix, + coreAgents, + coreTasks, + '.bmad-core', + ); // Setup expansion pack commands const expansionPacks = await this.getInstalledExpansionPacks(installDir); @@ -107,7 +126,14 @@ class IdeSetup extends BaseIdeSetup { if (packAgents.length > 0 || packTasks.length > 0) { // Use the actual directory name where the expansion pack is installed const rootPath = path.relative(installDir, packInfo.path); - await this.setupCrushForPackage(installDir, packInfo.name, packSlashPrefix, packAgents, packTasks, rootPath); + await this.setupCrushForPackage( + installDir, + packInfo.name, + packSlashPrefix, + packAgents, + packTasks, + rootPath, + ); } } @@ -119,7 +145,14 @@ class IdeSetup extends BaseIdeSetup { const coreSlashPrefix = await this.getCoreSlashPrefix(installDir); const coreAgents = selectedAgent ? [selectedAgent] : await this.getCoreAgentIds(installDir); const coreTasks = await this.getCoreTaskIds(installDir); - await this.setupClaudeCodeForPackage(installDir, "core", coreSlashPrefix, coreAgents, coreTasks, ".bmad-core"); + await this.setupClaudeCodeForPackage( + installDir, + 'core', + coreSlashPrefix, + coreAgents, + coreTasks, + '.bmad-core', + ); // Setup expansion pack commands const expansionPacks = await this.getInstalledExpansionPacks(installDir); @@ -131,17 +164,31 @@ class IdeSetup extends BaseIdeSetup { if (packAgents.length > 0 || packTasks.length > 0) { // Use the actual directory name where the expansion pack is installed const rootPath = path.relative(installDir, packInfo.path); - await this.setupClaudeCodeForPackage(installDir, packInfo.name, packSlashPrefix, packAgents, packTasks, rootPath); + await this.setupClaudeCodeForPackage( + installDir, + packInfo.name, + packSlashPrefix, + packAgents, + packTasks, + rootPath, + ); } } return true; } - async setupClaudeCodeForPackage(installDir, packageName, slashPrefix, agentIds, taskIds, rootPath) { - const commandsBaseDir = path.join(installDir, ".claude", "commands", slashPrefix); - const agentsDir = path.join(commandsBaseDir, "agents"); - const tasksDir = path.join(commandsBaseDir, "tasks"); + async setupClaudeCodeForPackage( + installDir, + packageName, + slashPrefix, + agentIds, + taskIds, + rootPath, + ) { + const commandsBaseDir = path.join(installDir, '.claude', 'commands', slashPrefix); + const agentsDir = path.join(commandsBaseDir, 'agents'); + const tasksDir = path.join(commandsBaseDir, 'tasks'); // Ensure directories exist await fileManager.ensureDirectory(agentsDir); @@ -151,18 +198,18 @@ class IdeSetup extends BaseIdeSetup { for (const agentId of agentIds) { // Find the agent file - for expansion packs, prefer the expansion pack version let agentPath; - if (packageName !== "core") { + if (packageName === 'core') { + // For core, use the normal search + agentPath = await this.findAgentPath(agentId, installDir); + } else { // For expansion packs, first try to find the agent in the expansion pack directory - const expansionPackPath = path.join(installDir, rootPath, "agents", `${agentId}.md`); + const expansionPackPath = path.join(installDir, rootPath, 'agents', `${agentId}.md`); if (await fileManager.pathExists(expansionPackPath)) { agentPath = expansionPackPath; } else { // Fall back to core if not found in expansion pack agentPath = await this.findAgentPath(agentId, installDir); } - } else { - // For core, use the normal search - agentPath = await this.findAgentPath(agentId, installDir); } const commandPath = path.join(agentsDir, `${agentId}.md`); @@ -172,7 +219,7 @@ class IdeSetup extends BaseIdeSetup { let agentContent = await fileManager.readFile(agentPath); // Replace {root} placeholder with the appropriate root path for this context - agentContent = agentContent.replace(/{root}/g, rootPath); + agentContent = agentContent.replaceAll('{root}', rootPath); // Add command header let commandContent = `# /${agentId} Command\n\n`; @@ -188,18 +235,18 @@ class IdeSetup extends BaseIdeSetup { for (const taskId of taskIds) { // Find the task file - for expansion packs, prefer the expansion pack version let taskPath; - if (packageName !== "core") { + if (packageName === 'core') { + // For core, use the normal search + taskPath = await this.findTaskPath(taskId, installDir); + } else { // For expansion packs, first try to find the task in the expansion pack directory - const expansionPackPath = path.join(installDir, rootPath, "tasks", `${taskId}.md`); + const expansionPackPath = path.join(installDir, rootPath, 'tasks', `${taskId}.md`); if (await fileManager.pathExists(expansionPackPath)) { taskPath = expansionPackPath; } else { // Fall back to core if not found in expansion pack taskPath = await this.findTaskPath(taskId, installDir); } - } else { - // For core, use the normal search - taskPath = await this.findTaskPath(taskId, installDir); } const commandPath = path.join(tasksDir, `${taskId}.md`); @@ -209,7 +256,7 @@ class IdeSetup extends BaseIdeSetup { let taskContent = await fileManager.readFile(taskPath); // Replace {root} placeholder with the appropriate root path for this context - taskContent = taskContent.replace(/{root}/g, rootPath); + taskContent = taskContent.replaceAll('{root}', rootPath); // Add command header let commandContent = `# /${taskId} Task\n\n`; @@ -221,15 +268,17 @@ class IdeSetup extends BaseIdeSetup { } } - console.log(chalk.green(`\n✓ Created Claude Code commands for ${packageName} in ${commandsBaseDir}`)); + console.log( + chalk.green(`\n✓ Created Claude Code commands for ${packageName} in ${commandsBaseDir}`), + ); console.log(chalk.dim(` - Agents in: ${agentsDir}`)); console.log(chalk.dim(` - Tasks in: ${tasksDir}`)); } async setupCrushForPackage(installDir, packageName, slashPrefix, agentIds, taskIds, rootPath) { - const commandsBaseDir = path.join(installDir, ".crush", "commands", slashPrefix); - const agentsDir = path.join(commandsBaseDir, "agents"); - const tasksDir = path.join(commandsBaseDir, "tasks"); + const commandsBaseDir = path.join(installDir, '.crush', 'commands', slashPrefix); + const agentsDir = path.join(commandsBaseDir, 'agents'); + const tasksDir = path.join(commandsBaseDir, 'tasks'); // Ensure directories exist await fileManager.ensureDirectory(agentsDir); @@ -239,18 +288,18 @@ class IdeSetup extends BaseIdeSetup { for (const agentId of agentIds) { // Find the agent file - for expansion packs, prefer the expansion pack version let agentPath; - if (packageName !== "core") { + if (packageName === 'core') { + // For core, use the normal search + agentPath = await this.findAgentPath(agentId, installDir); + } else { // For expansion packs, first try to find the agent in the expansion pack directory - const expansionPackPath = path.join(installDir, rootPath, "agents", `${agentId}.md`); + const expansionPackPath = path.join(installDir, rootPath, 'agents', `${agentId}.md`); if (await fileManager.pathExists(expansionPackPath)) { agentPath = expansionPackPath; } else { // Fall back to core if not found in expansion pack agentPath = await this.findAgentPath(agentId, installDir); } - } else { - // For core, use the normal search - agentPath = await this.findAgentPath(agentId, installDir); } const commandPath = path.join(agentsDir, `${agentId}.md`); @@ -260,7 +309,7 @@ class IdeSetup extends BaseIdeSetup { let agentContent = await fileManager.readFile(agentPath); // Replace {root} placeholder with the appropriate root path for this context - agentContent = agentContent.replace(/{root}/g, rootPath); + agentContent = agentContent.replaceAll('{root}', rootPath); // Add command header let commandContent = `# /${agentId} Command\n\n`; @@ -276,18 +325,18 @@ class IdeSetup extends BaseIdeSetup { for (const taskId of taskIds) { // Find the task file - for expansion packs, prefer the expansion pack version let taskPath; - if (packageName !== "core") { + if (packageName === 'core') { + // For core, use the normal search + taskPath = await this.findTaskPath(taskId, installDir); + } else { // For expansion packs, first try to find the task in the expansion pack directory - const expansionPackPath = path.join(installDir, rootPath, "tasks", `${taskId}.md`); + const expansionPackPath = path.join(installDir, rootPath, 'tasks', `${taskId}.md`); if (await fileManager.pathExists(expansionPackPath)) { taskPath = expansionPackPath; } else { // Fall back to core if not found in expansion pack taskPath = await this.findTaskPath(taskId, installDir); } - } else { - // For core, use the normal search - taskPath = await this.findTaskPath(taskId, installDir); } const commandPath = path.join(tasksDir, `${taskId}.md`); @@ -297,7 +346,7 @@ class IdeSetup extends BaseIdeSetup { let taskContent = await fileManager.readFile(taskPath); // Replace {root} placeholder with the appropriate root path for this context - taskContent = taskContent.replace(/{root}/g, rootPath); + taskContent = taskContent.replaceAll('{root}', rootPath); // Add command header let commandContent = `# /${taskId} Task\n\n`; @@ -315,10 +364,10 @@ class IdeSetup extends BaseIdeSetup { } async setupWindsurf(installDir, selectedAgent) { - const windsurfRulesDir = path.join(installDir, ".windsurf", "rules"); + const windsurfWorkflowDir = path.join(installDir, '.windsurf', 'workflows'); const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); - await fileManager.ensureDirectory(windsurfRulesDir); + await fileManager.ensureDirectory(windsurfWorkflowDir); for (const agentId of agents) { // Find the agent file @@ -326,49 +375,28 @@ class IdeSetup extends BaseIdeSetup { if (agentPath) { const agentContent = await fileManager.readFile(agentPath); - const mdPath = path.join(windsurfRulesDir, `${agentId}.md`); + const mdPath = path.join(windsurfWorkflowDir, `${agentId}.md`); - // Create MD content (similar to Cursor but without frontmatter) - let mdContent = `# ${agentId.toUpperCase()} Agent Rule\n\n`; - mdContent += `This rule is triggered when the user types \`@${agentId}\` and activates the ${await this.getAgentTitle( - agentId, - installDir - )} agent persona.\n\n`; - mdContent += "## Agent Activation\n\n"; - mdContent += - "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:\n\n"; - mdContent += "```yaml\n"; - // Extract just the YAML content from the agent file - const yamlContent = extractYamlFromAgent(agentContent); - if (yamlContent) { - mdContent += yamlContent; - } else { - // If no YAML found, include the whole content minus the header - mdContent += agentContent.replace(/^#.*$/m, "").trim(); - } - mdContent += "\n```\n\n"; - mdContent += "## File Reference\n\n"; - const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/'); - mdContent += `The complete agent definition is available in [${relativePath}](${relativePath}).\n\n`; - mdContent += "## Usage\n\n"; - mdContent += `When the user types \`@${agentId}\`, activate this ${await this.getAgentTitle( - agentId, - installDir - )} persona and follow all instructions defined in the YAML configuration above.\n`; + // Write the agent file contents prefixed with Windsurf frontmatter + let mdContent = `---\n`; + mdContent += `description: ${agentId}\n`; + mdContent += `auto_execution_mode: 3\n`; + mdContent += `---\n\n`; + mdContent += agentContent; await fileManager.writeFile(mdPath, mdContent); - console.log(chalk.green(`✓ Created rule: ${agentId}.md`)); + console.log(chalk.green(`✓ Created workflow: ${agentId}.md`)); } } - console.log(chalk.green(`\n✓ Created Windsurf rules in ${windsurfRulesDir}`)); + console.log(chalk.green(`\n✓ Created Windsurf workflows in ${windsurfWorkflowDir}`)); return true; } async setupTrae(installDir, selectedAgent) { - const traeRulesDir = path.join(installDir, ".trae", "rules"); - const agents = selectedAgent? [selectedAgent] : await this.getAllAgentIds(installDir); + const traeRulesDir = path.join(installDir, '.trae', 'rules'); + const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); await fileManager.ensureDirectory(traeRulesDir); @@ -384,29 +412,28 @@ class IdeSetup extends BaseIdeSetup { let mdContent = `# ${agentId.toUpperCase()} Agent Rule\n\n`; mdContent += `This rule is triggered when the user types \`@${agentId}\` and activates the ${await this.getAgentTitle( agentId, - installDir + installDir, )} agent persona.\n\n`; - mdContent += "## Agent Activation\n\n"; + mdContent += '## Agent Activation\n\n'; mdContent += - "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:\n\n"; - mdContent += "```yaml\n"; + '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:\n\n'; + mdContent += '```yaml\n'; // Extract just the YAML content from the agent file const yamlContent = extractYamlFromAgent(agentContent); if (yamlContent) { mdContent += yamlContent; - } - else { + } else { // If no YAML found, include the whole content minus the header - mdContent += agentContent.replace(/^#.*$/m, "").trim(); + mdContent += agentContent.replace(/^#.*$/m, '').trim(); } - mdContent += "\n```\n\n"; - mdContent += "## File Reference\n\n"; - const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/'); + mdContent += '\n```\n\n'; + mdContent += '## File Reference\n\n'; + const relativePath = path.relative(installDir, agentPath).replaceAll('\\', '/'); mdContent += `The complete agent definition is available in [${relativePath}](${relativePath}).\n\n`; - mdContent += "## Usage\n\n"; + mdContent += '## Usage\n\n'; mdContent += `When the user types \`@${agentId}\`, activate this ${await this.getAgentTitle( agentId, - installDir + installDir, )} persona and follow all instructions defined in the YAML configuration above.\n`; await fileManager.writeFile(mdPath, mdContent); @@ -418,14 +445,14 @@ class IdeSetup extends BaseIdeSetup { async findAgentPath(agentId, installDir) { // Try to find the agent file in various locations const possiblePaths = [ - path.join(installDir, ".bmad-core", "agents", `${agentId}.md`), - path.join(installDir, "agents", `${agentId}.md`) + path.join(installDir, '.bmad-core', 'agents', `${agentId}.md`), + path.join(installDir, 'agents', `${agentId}.md`), ]; // Also check expansion pack directories - const glob = require("glob"); - const expansionDirs = glob.sync(".*/agents", { cwd: installDir }); - for (const expDir of expansionDirs) { + const glob = require('glob'); + const expansionDirectories = glob.sync('.*/agents', { cwd: installDir }); + for (const expDir of expansionDirectories) { possiblePaths.push(path.join(installDir, expDir, `${agentId}.md`)); } @@ -439,26 +466,26 @@ class IdeSetup extends BaseIdeSetup { } async getAllAgentIds(installDir) { - const glob = require("glob"); + const glob = require('glob'); const allAgentIds = []; // Check core agents in .bmad-core or root - let agentsDir = path.join(installDir, ".bmad-core", "agents"); + let agentsDir = path.join(installDir, '.bmad-core', 'agents'); if (!(await fileManager.pathExists(agentsDir))) { - agentsDir = path.join(installDir, "agents"); + agentsDir = path.join(installDir, 'agents'); } if (await fileManager.pathExists(agentsDir)) { - const agentFiles = glob.sync("*.md", { cwd: agentsDir }); - allAgentIds.push(...agentFiles.map((file) => path.basename(file, ".md"))); + const agentFiles = glob.sync('*.md', { cwd: agentsDir }); + allAgentIds.push(...agentFiles.map((file) => path.basename(file, '.md'))); } // Also check for expansion pack agents in dot folders - const expansionDirs = glob.sync(".*/agents", { cwd: installDir }); - for (const expDir of expansionDirs) { + const expansionDirectories = glob.sync('.*/agents', { cwd: installDir }); + for (const expDir of expansionDirectories) { const fullExpDir = path.join(installDir, expDir); - const expAgentFiles = glob.sync("*.md", { cwd: fullExpDir }); - allAgentIds.push(...expAgentFiles.map((file) => path.basename(file, ".md"))); + const expAgentFiles = glob.sync('*.md', { cwd: fullExpDir }); + allAgentIds.push(...expAgentFiles.map((file) => path.basename(file, '.md'))); } // Remove duplicates @@ -469,15 +496,15 @@ class IdeSetup extends BaseIdeSetup { const allAgentIds = []; // Check core agents in .bmad-core or root only - let agentsDir = path.join(installDir, ".bmad-core", "agents"); + let agentsDir = path.join(installDir, '.bmad-core', 'agents'); if (!(await fileManager.pathExists(agentsDir))) { - agentsDir = path.join(installDir, "bmad-core", "agents"); + agentsDir = path.join(installDir, 'bmad-core', 'agents'); } if (await fileManager.pathExists(agentsDir)) { - const glob = require("glob"); - const agentFiles = glob.sync("*.md", { cwd: agentsDir }); - allAgentIds.push(...agentFiles.map((file) => path.basename(file, ".md"))); + const glob = require('glob'); + const agentFiles = glob.sync('*.md', { cwd: agentsDir }); + allAgentIds.push(...agentFiles.map((file) => path.basename(file, '.md'))); } return [...new Set(allAgentIds)]; @@ -487,22 +514,22 @@ class IdeSetup extends BaseIdeSetup { const allTaskIds = []; // Check core tasks in .bmad-core or root only - let tasksDir = path.join(installDir, ".bmad-core", "tasks"); + let tasksDir = path.join(installDir, '.bmad-core', 'tasks'); if (!(await fileManager.pathExists(tasksDir))) { - tasksDir = path.join(installDir, "bmad-core", "tasks"); + tasksDir = path.join(installDir, 'bmad-core', 'tasks'); } if (await fileManager.pathExists(tasksDir)) { - const glob = require("glob"); - const taskFiles = glob.sync("*.md", { cwd: tasksDir }); - allTaskIds.push(...taskFiles.map((file) => path.basename(file, ".md"))); + const glob = require('glob'); + const taskFiles = glob.sync('*.md', { cwd: tasksDir }); + allTaskIds.push(...taskFiles.map((file) => path.basename(file, '.md'))); } // Check common tasks - const commonTasksDir = path.join(installDir, "common", "tasks"); + const commonTasksDir = path.join(installDir, 'common', 'tasks'); if (await fileManager.pathExists(commonTasksDir)) { - const commonTaskFiles = glob.sync("*.md", { cwd: commonTasksDir }); - allTaskIds.push(...commonTaskFiles.map((file) => path.basename(file, ".md"))); + const commonTaskFiles = glob.sync('*.md', { cwd: commonTasksDir }); + allTaskIds.push(...commonTaskFiles.map((file) => path.basename(file, '.md'))); } return [...new Set(allTaskIds)]; @@ -511,14 +538,14 @@ class IdeSetup extends BaseIdeSetup { async getAgentTitle(agentId, installDir) { // Try to find the agent file in various locations const possiblePaths = [ - path.join(installDir, ".bmad-core", "agents", `${agentId}.md`), - path.join(installDir, "agents", `${agentId}.md`) + path.join(installDir, '.bmad-core', 'agents', `${agentId}.md`), + path.join(installDir, 'agents', `${agentId}.md`), ]; // Also check expansion pack directories - const glob = require("glob"); - const expansionDirs = glob.sync(".*/agents", { cwd: installDir }); - for (const expDir of expansionDirs) { + const glob = require('glob'); + const expansionDirectories = glob.sync('.*/agents', { cwd: installDir }); + for (const expDir of expansionDirectories) { possiblePaths.push(path.join(installDir, expDir, `${agentId}.md`)); } @@ -542,49 +569,50 @@ class IdeSetup extends BaseIdeSetup { } // Fallback to formatted agent ID - return agentId.split('-').map(word => - word.charAt(0).toUpperCase() + word.slice(1) - ).join(' '); + return agentId + .split('-') + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); } async getAllTaskIds(installDir) { - const glob = require("glob"); + const glob = require('glob'); const allTaskIds = []; // Check core tasks in .bmad-core or root - let tasksDir = path.join(installDir, ".bmad-core", "tasks"); + let tasksDir = path.join(installDir, '.bmad-core', 'tasks'); if (!(await fileManager.pathExists(tasksDir))) { - tasksDir = path.join(installDir, "bmad-core", "tasks"); + tasksDir = path.join(installDir, 'bmad-core', 'tasks'); } if (await fileManager.pathExists(tasksDir)) { - const taskFiles = glob.sync("*.md", { cwd: tasksDir }); - allTaskIds.push(...taskFiles.map((file) => path.basename(file, ".md"))); + const taskFiles = glob.sync('*.md', { cwd: tasksDir }); + allTaskIds.push(...taskFiles.map((file) => path.basename(file, '.md'))); } // Check common tasks - const commonTasksDir = path.join(installDir, "common", "tasks"); + const commonTasksDir = path.join(installDir, 'common', 'tasks'); if (await fileManager.pathExists(commonTasksDir)) { - const commonTaskFiles = glob.sync("*.md", { cwd: commonTasksDir }); - allTaskIds.push(...commonTaskFiles.map((file) => path.basename(file, ".md"))); + const commonTaskFiles = glob.sync('*.md', { cwd: commonTasksDir }); + allTaskIds.push(...commonTaskFiles.map((file) => path.basename(file, '.md'))); } // Also check for expansion pack tasks in dot folders - const expansionDirs = glob.sync(".*/tasks", { cwd: installDir }); - for (const expDir of expansionDirs) { + const expansionDirectories = glob.sync('.*/tasks', { cwd: installDir }); + for (const expDir of expansionDirectories) { const fullExpDir = path.join(installDir, expDir); - const expTaskFiles = glob.sync("*.md", { cwd: fullExpDir }); - allTaskIds.push(...expTaskFiles.map((file) => path.basename(file, ".md"))); + const expTaskFiles = glob.sync('*.md', { cwd: fullExpDir }); + allTaskIds.push(...expTaskFiles.map((file) => path.basename(file, '.md'))); } // Check expansion-packs folder tasks - const expansionPacksDir = path.join(installDir, "expansion-packs"); + const expansionPacksDir = path.join(installDir, 'expansion-packs'); if (await fileManager.pathExists(expansionPacksDir)) { - const expPackDirs = glob.sync("*/tasks", { cwd: expansionPacksDir }); - for (const expDir of expPackDirs) { + const expPackDirectories = glob.sync('*/tasks', { cwd: expansionPacksDir }); + for (const expDir of expPackDirectories) { const fullExpDir = path.join(expansionPacksDir, expDir); - const expTaskFiles = glob.sync("*.md", { cwd: fullExpDir }); - allTaskIds.push(...expTaskFiles.map((file) => path.basename(file, ".md"))); + const expTaskFiles = glob.sync('*.md', { cwd: fullExpDir }); + allTaskIds.push(...expTaskFiles.map((file) => path.basename(file, '.md'))); } } @@ -595,25 +623,25 @@ class IdeSetup extends BaseIdeSetup { async findTaskPath(taskId, installDir) { // Try to find the task file in various locations const possiblePaths = [ - path.join(installDir, ".bmad-core", "tasks", `${taskId}.md`), - path.join(installDir, "bmad-core", "tasks", `${taskId}.md`), - path.join(installDir, "common", "tasks", `${taskId}.md`) + path.join(installDir, '.bmad-core', 'tasks', `${taskId}.md`), + path.join(installDir, 'bmad-core', 'tasks', `${taskId}.md`), + path.join(installDir, 'common', 'tasks', `${taskId}.md`), ]; // Also check expansion pack directories - const glob = require("glob"); + const glob = require('glob'); // Check dot folder expansion packs - const expansionDirs = glob.sync(".*/tasks", { cwd: installDir }); - for (const expDir of expansionDirs) { + const expansionDirectories = glob.sync('.*/tasks', { cwd: installDir }); + for (const expDir of expansionDirectories) { possiblePaths.push(path.join(installDir, expDir, `${taskId}.md`)); } // Check expansion-packs folder - const expansionPacksDir = path.join(installDir, "expansion-packs"); + const expansionPacksDir = path.join(installDir, 'expansion-packs'); if (await fileManager.pathExists(expansionPacksDir)) { - const expPackDirs = glob.sync("*/tasks", { cwd: expansionPacksDir }); - for (const expDir of expPackDirs) { + const expPackDirectories = glob.sync('*/tasks', { cwd: expansionPacksDir }); + for (const expDir of expPackDirectories) { possiblePaths.push(path.join(expansionPacksDir, expDir, `${taskId}.md`)); } } @@ -629,24 +657,24 @@ class IdeSetup extends BaseIdeSetup { async getCoreSlashPrefix(installDir) { try { - const coreConfigPath = path.join(installDir, ".bmad-core", "core-config.yaml"); + const coreConfigPath = path.join(installDir, '.bmad-core', 'core-config.yaml'); if (!(await fileManager.pathExists(coreConfigPath))) { // Try bmad-core directory - const altConfigPath = path.join(installDir, "bmad-core", "core-config.yaml"); + const altConfigPath = path.join(installDir, 'bmad-core', 'core-config.yaml'); if (await fileManager.pathExists(altConfigPath)) { const configContent = await fileManager.readFile(altConfigPath); const config = yaml.load(configContent); - return config.slashPrefix || "BMad"; + return config.slashPrefix || 'BMad'; } - return "BMad"; // fallback + return 'BMad'; // fallback } const configContent = await fileManager.readFile(coreConfigPath); const config = yaml.load(configContent); - return config.slashPrefix || "BMad"; + return config.slashPrefix || 'BMad'; } catch (error) { console.warn(`Failed to read core slashPrefix, using default 'BMad': ${error.message}`); - return "BMad"; + return 'BMad'; } } @@ -654,32 +682,34 @@ class IdeSetup extends BaseIdeSetup { const expansionPacks = []; // Check for dot-prefixed expansion packs in install directory - const glob = require("glob"); - const dotExpansions = glob.sync(".bmad-*", { cwd: installDir }); + const glob = require('glob'); + const dotExpansions = glob.sync('.bmad-*', { cwd: installDir }); for (const dotExpansion of dotExpansions) { - if (dotExpansion !== ".bmad-core") { + if (dotExpansion !== '.bmad-core') { const packPath = path.join(installDir, dotExpansion); - const packName = dotExpansion.substring(1); // remove the dot + const packName = dotExpansion.slice(1); // remove the dot expansionPacks.push({ name: packName, - path: packPath + path: packPath, }); } } // Check for expansion-packs directory style - const expansionPacksDir = path.join(installDir, "expansion-packs"); + const expansionPacksDir = path.join(installDir, 'expansion-packs'); if (await fileManager.pathExists(expansionPacksDir)) { - const packDirs = glob.sync("*", { cwd: expansionPacksDir }); + const packDirectories = glob.sync('*', { cwd: expansionPacksDir }); - for (const packDir of packDirs) { + for (const packDir of packDirectories) { const packPath = path.join(expansionPacksDir, packDir); - if ((await fileManager.pathExists(packPath)) && - (await fileManager.pathExists(path.join(packPath, "config.yaml")))) { + if ( + (await fileManager.pathExists(packPath)) && + (await fileManager.pathExists(path.join(packPath, 'config.yaml'))) + ) { expansionPacks.push({ name: packDir, - path: packPath + path: packPath, }); } } @@ -690,7 +720,7 @@ class IdeSetup extends BaseIdeSetup { async getExpansionPackSlashPrefix(packPath) { try { - const configPath = path.join(packPath, "config.yaml"); + const configPath = path.join(packPath, 'config.yaml'); if (await fileManager.pathExists(configPath)) { const configContent = await fileManager.readFile(configPath); const config = yaml.load(configContent); @@ -704,15 +734,15 @@ class IdeSetup extends BaseIdeSetup { } async getExpansionPackAgents(packPath) { - const agentsDir = path.join(packPath, "agents"); + const agentsDir = path.join(packPath, 'agents'); if (!(await fileManager.pathExists(agentsDir))) { return []; } try { - const glob = require("glob"); - const agentFiles = glob.sync("*.md", { cwd: agentsDir }); - return agentFiles.map(file => path.basename(file, ".md")); + const glob = require('glob'); + const agentFiles = glob.sync('*.md', { cwd: agentsDir }); + return agentFiles.map((file) => path.basename(file, '.md')); } catch (error) { console.warn(`Failed to read expansion pack agents from ${packPath}: ${error.message}`); return []; @@ -720,15 +750,15 @@ class IdeSetup extends BaseIdeSetup { } async getExpansionPackTasks(packPath) { - const tasksDir = path.join(packPath, "tasks"); + const tasksDir = path.join(packPath, 'tasks'); if (!(await fileManager.pathExists(tasksDir))) { return []; } try { - const glob = require("glob"); - const taskFiles = glob.sync("*.md", { cwd: tasksDir }); - return taskFiles.map(file => path.basename(file, ".md")); + const glob = require('glob'); + const taskFiles = glob.sync('*.md', { cwd: tasksDir }); + return taskFiles.map((file) => path.basename(file, '.md')); } catch (error) { console.warn(`Failed to read expansion pack tasks from ${packPath}: ${error.message}`); return []; @@ -739,9 +769,9 @@ class IdeSetup extends BaseIdeSetup { const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); // Check for existing .roomodes file in project root - const roomodesPath = path.join(installDir, ".roomodes"); + const roomodesPath = path.join(installDir, '.roomodes'); let existingModes = []; - let existingContent = ""; + let existingContent = ''; if (await fileManager.pathExists(roomodesPath)) { existingContent = await fileManager.readFile(roomodesPath); @@ -754,7 +784,7 @@ class IdeSetup extends BaseIdeSetup { } // Create new modes content - let newModesContent = ""; + let newModesContent = ''; // Load dynamic agent permissions from configuration const config = await this.loadIdeAgentConfig(); @@ -786,14 +816,15 @@ class IdeSetup extends BaseIdeSetup { const whenToUseMatch = yaml.match(/whenToUse:\s*"(.+)"/); const roleDefinitionMatch = yaml.match(/roleDefinition:\s*"(.+)"/); - const title = titleMatch ? titleMatch[1].trim() : await this.getAgentTitle(agentId, installDir); - const icon = iconMatch ? iconMatch[1].trim() : "🤖"; + const title = titleMatch + ? titleMatch[1].trim() + : await this.getAgentTitle(agentId, installDir); + const icon = iconMatch ? iconMatch[1].trim() : '🤖'; const whenToUse = whenToUseMatch ? whenToUseMatch[1].trim() : `Use for ${title} tasks`; const roleDefinition = roleDefinitionMatch ? roleDefinitionMatch[1].trim() : `You are a ${title} specializing in ${title.toLowerCase()} tasks and responsibilities.`; - // Add permissions based on agent type const permissions = agentPermissions[agentId]; // Build mode entry with proper formatting (matching exact indentation) @@ -802,12 +833,12 @@ class IdeSetup extends BaseIdeSetup { newModesContent += ` - slug: ${slug}\n`; newModesContent += ` name: '${icon} ${title}'\n`; if (permissions) { - newModesContent += ` description: '${permissions.description}'\n`; + newModesContent += ` description: '${permissions.description}'\n`; } newModesContent += ` roleDefinition: ${roleDefinition}\n`; newModesContent += ` whenToUse: ${whenToUse}\n`; // Get relative path from installDir to agent file - const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/'); + const relativePath = path.relative(installDir, agentPath).replaceAll('\\', '/'); newModesContent += ` customInstructions: CRITICAL Read the full YAML from ${relativePath} start activation to alter your state of being follow startup section instructions stay in this being until told to exit this mode\n`; newModesContent += ` groups:\n`; newModesContent += ` - read\n`; @@ -826,42 +857,45 @@ class IdeSetup extends BaseIdeSetup { } // Build final roomodes content - let roomodesContent = ""; + let roomodesContent = ''; if (existingContent) { // If there's existing content, append new modes to it - roomodesContent = existingContent.trim() + "\n" + newModesContent; + roomodesContent = existingContent.trim() + '\n' + newModesContent; } else { // Create new .roomodes file with proper YAML structure - roomodesContent = "customModes:\n" + newModesContent; + roomodesContent = 'customModes:\n' + newModesContent; } // Write .roomodes file await fileManager.writeFile(roomodesPath, roomodesContent); - console.log(chalk.green("✓ Created .roomodes file in project root")); + console.log(chalk.green('✓ Created .roomodes file in project root')); console.log(chalk.green(`\n✓ Roo Code setup complete!`)); - console.log(chalk.dim("Custom modes will be available when you open this project in Roo Code")); + console.log(chalk.dim('Custom modes will be available when you open this project in Roo Code')); return true; } async setupKilocode(installDir, selectedAgent) { - const filePath = path.join(installDir, ".kilocodemodes"); + const filePath = path.join(installDir, '.kilocodemodes'); const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); - let existingModes = [], existingContent = ""; + let existingModes = [], + existingContent = ''; if (await fileManager.pathExists(filePath)) { existingContent = await fileManager.readFile(filePath); for (const match of existingContent.matchAll(/- slug: ([\w-]+)/g)) { existingModes.push(match[1]); } - console.log(chalk.yellow(`Found existing .kilocodemodes file with ${existingModes.length} modes`)); + console.log( + chalk.yellow(`Found existing .kilocodemodes file with ${existingModes.length} modes`), + ); } const config = await this.loadIdeAgentConfig(); const permissions = config['roo-permissions'] || {}; // reuse same roo permissions block (Kilo Code understands same mode schema) - let newContent = ""; + let newContent = ''; for (const agentId of agents) { const slug = agentId.startsWith('bmad-') ? agentId : `bmad-${agentId}`; @@ -886,13 +920,15 @@ class IdeSetup extends BaseIdeSetup { const yaml = yamlMatch[1]; // Robust fallback for title and icon - const title = (yaml.match(/title:\s*(.+)/)?.[1]?.trim()) || await this.getAgentTitle(agentId, installDir); - const icon = (yaml.match(/icon:\s*(.+)/)?.[1]?.trim()) || '🤖'; - const whenToUse = (yaml.match(/whenToUse:\s*"(.+)"/)?.[1]?.trim()) || `Use for ${title} tasks`; - const roleDefinition = (yaml.match(/roleDefinition:\s*"(.+)"/)?.[1]?.trim()) || + const title = + yaml.match(/title:\s*(.+)/)?.[1]?.trim() || (await this.getAgentTitle(agentId, installDir)); + const icon = yaml.match(/icon:\s*(.+)/)?.[1]?.trim() || '🤖'; + const whenToUse = yaml.match(/whenToUse:\s*"(.+)"/)?.[1]?.trim() || `Use for ${title} tasks`; + const roleDefinition = + yaml.match(/roleDefinition:\s*"(.+)"/)?.[1]?.trim() || `You are a ${title} specializing in ${title.toLowerCase()} tasks and responsibilities.`; - const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/'); + const relativePath = path.relative(installDir, agentPath).replaceAll('\\', '/'); const customInstructions = `CRITICAL Read the full YAML from ${relativePath} start activation to alter your state of being follow startup section instructions stay in this being until told to exit this mode`; // Add permissions from config if they exist @@ -902,7 +938,7 @@ class IdeSetup extends BaseIdeSetup { newContent += ` - slug: ${slug}\n`; newContent += ` name: '${icon} ${title}'\n`; if (agentPermission) { - newContent += ` description: '${agentPermission.description}'\n`; + newContent += ` description: '${agentPermission.description}'\n`; } newContent += ` roleDefinition: ${roleDefinition}\n`; @@ -911,7 +947,6 @@ class IdeSetup extends BaseIdeSetup { newContent += ` groups:\n`; newContent += ` - read\n`; - if (agentPermission) { newContent += ` - - edit\n`; newContent += ` - fileRegex: ${agentPermission.fileRegex}\n`; @@ -925,19 +960,19 @@ class IdeSetup extends BaseIdeSetup { } const finalContent = existingContent - ? existingContent.trim() + "\n" + newContent - : "customModes:\n" + newContent; + ? existingContent.trim() + '\n' + newContent + : 'customModes:\n' + newContent; await fileManager.writeFile(filePath, finalContent); - console.log(chalk.green("✓ Created .kilocodemodes file in project root")); + console.log(chalk.green('✓ Created .kilocodemodes file in project root')); console.log(chalk.green(`✓ KiloCode setup complete!`)); - console.log(chalk.dim("Custom modes will be available when you open this project in KiloCode")); + console.log(chalk.dim('Custom modes will be available when you open this project in KiloCode')); return true; } async setupCline(installDir, selectedAgent) { - const clineRulesDir = path.join(installDir, ".clinerules"); + const clineRulesDir = path.join(installDir, '.clinerules'); const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); await fileManager.ensureDirectory(clineRulesDir); @@ -961,26 +996,28 @@ class IdeSetup extends BaseIdeSetup { // Create MD content for Cline (focused on project standards and role) let mdContent = `# ${await this.getAgentTitle(agentId, installDir)} Agent\n\n`; mdContent += `This rule defines the ${await this.getAgentTitle(agentId, installDir)} persona and project standards.\n\n`; - mdContent += "## Role Definition\n\n"; + mdContent += '## Role Definition\n\n'; mdContent += - "When the user types `@" + agentId + "`, adopt this persona and follow these guidelines:\n\n"; - mdContent += "```yaml\n"; + 'When the user types `@' + + agentId + + '`, adopt this persona and follow these guidelines:\n\n'; + mdContent += '```yaml\n'; // Extract just the YAML content from the agent file const yamlContent = extractYamlFromAgent(agentContent); if (yamlContent) { mdContent += yamlContent; } else { // If no YAML found, include the whole content minus the header - mdContent += agentContent.replace(/^#.*$/m, "").trim(); + mdContent += agentContent.replace(/^#.*$/m, '').trim(); } - mdContent += "\n```\n\n"; - mdContent += "## Project Standards\n\n"; + mdContent += '\n```\n\n'; + mdContent += '## Project Standards\n\n'; mdContent += `- Always maintain consistency with project documentation in .bmad-core/\n`; mdContent += `- Follow the agent's specific guidelines and constraints\n`; mdContent += `- Update relevant project files when making changes\n`; - const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/'); + const relativePath = path.relative(installDir, agentPath).replaceAll('\\', '/'); mdContent += `- Reference the complete agent definition in [${relativePath}](${relativePath})\n\n`; - mdContent += "## Usage\n\n"; + mdContent += '## Usage\n\n'; mdContent += `Type \`@${agentId}\` to activate this ${await this.getAgentTitle(agentId, installDir)} persona.\n`; await fileManager.writeFile(mdPath, mdContent); @@ -994,12 +1031,12 @@ class IdeSetup extends BaseIdeSetup { } async setupGeminiCli(installDir) { - const geminiDir = path.join(installDir, ".gemini"); - const bmadMethodDir = path.join(geminiDir, "bmad-method"); + const geminiDir = path.join(installDir, '.gemini'); + const bmadMethodDir = path.join(geminiDir, 'bmad-method'); await fileManager.ensureDirectory(bmadMethodDir); // Update logic for existing settings.json - const settingsPath = path.join(geminiDir, "settings.json"); + const settingsPath = path.join(geminiDir, 'settings.json'); if (await fileManager.pathExists(settingsPath)) { try { const settingsContent = await fileManager.readFile(settingsPath); @@ -1010,7 +1047,7 @@ class IdeSetup extends BaseIdeSetup { if (settings.contextFileName && Array.isArray(settings.contextFileName)) { const originalLength = settings.contextFileName.length; settings.contextFileName = settings.contextFileName.filter( - (fileName) => !fileName.startsWith("agents/") + (fileName) => !fileName.startsWith('agents/'), ); if (settings.contextFileName.length !== originalLength) { updated = true; @@ -1018,30 +1055,26 @@ class IdeSetup extends BaseIdeSetup { } if (updated) { - await fileManager.writeFile( - settingsPath, - JSON.stringify(settings, null, 2) + await fileManager.writeFile(settingsPath, JSON.stringify(settings, null, 2)); + console.log( + chalk.green('✓ Updated .gemini/settings.json - removed agent file references'), ); - console.log(chalk.green("✓ Updated .gemini/settings.json - removed agent file references")); } } catch (error) { - console.warn( - chalk.yellow("Could not update .gemini/settings.json"), - error - ); + console.warn(chalk.yellow('Could not update .gemini/settings.json'), error); } } // Remove old agents directory - const agentsDir = path.join(geminiDir, "agents"); + const agentsDir = path.join(geminiDir, 'agents'); if (await fileManager.pathExists(agentsDir)) { await fileManager.removeDirectory(agentsDir); - console.log(chalk.green("✓ Removed old .gemini/agents directory")); + console.log(chalk.green('✓ Removed old .gemini/agents directory')); } // Get all available agents const agents = await this.getAllAgentIds(installDir); - let concatenatedContent = ""; + let concatenatedContent = ''; for (const agentId of agents) { // Find the source agent file @@ -1054,39 +1087,38 @@ class IdeSetup extends BaseIdeSetup { let agentRuleContent = `# ${agentId.toUpperCase()} Agent Rule\n\n`; agentRuleContent += `This rule is triggered when the user types \`*${agentId}\` and activates the ${await this.getAgentTitle( agentId, - installDir + installDir, )} agent persona.\n\n`; - agentRuleContent += "## Agent Activation\n\n"; + agentRuleContent += '## Agent Activation\n\n'; agentRuleContent += - "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:\n\n"; - agentRuleContent += "```yaml\n"; + '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:\n\n'; + agentRuleContent += '```yaml\n'; // Extract just the YAML content from the agent file const yamlContent = extractYamlFromAgent(agentContent); if (yamlContent) { agentRuleContent += yamlContent; - } - else { + } else { // If no YAML found, include the whole content minus the header - agentRuleContent += agentContent.replace(/^#.*$/m, "").trim(); + agentRuleContent += agentContent.replace(/^#.*$/m, '').trim(); } - agentRuleContent += "\n```\n\n"; - agentRuleContent += "## File Reference\n\n"; - const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/'); + agentRuleContent += '\n```\n\n'; + agentRuleContent += '## File Reference\n\n'; + const relativePath = path.relative(installDir, agentPath).replaceAll('\\', '/'); agentRuleContent += `The complete agent definition is available in [${relativePath}](${relativePath}).\n\n`; - agentRuleContent += "## Usage\n\n"; + agentRuleContent += '## Usage\n\n'; agentRuleContent += `When the user types \`*${agentId}\`, activate this ${await this.getAgentTitle( agentId, - installDir + installDir, )} persona and follow all instructions defined in the YAML configuration above.\n`; // Add to concatenated content with separator - concatenatedContent += agentRuleContent + "\n\n---\n\n"; + concatenatedContent += agentRuleContent + '\n\n---\n\n'; console.log(chalk.green(`✓ Added context for @${agentId}`)); } } // Write the concatenated content to GEMINI.md - const geminiMdPath = path.join(bmadMethodDir, "GEMINI.md"); + const geminiMdPath = path.join(bmadMethodDir, 'GEMINI.md'); await fileManager.writeFile(geminiMdPath, concatenatedContent); console.log(chalk.green(`\n✓ Created GEMINI.md in ${bmadMethodDir}`)); @@ -1094,12 +1126,12 @@ class IdeSetup extends BaseIdeSetup { } async setupQwenCode(installDir, selectedAgent) { - const qwenDir = path.join(installDir, ".qwen"); - const bmadMethodDir = path.join(qwenDir, "bmad-method"); + const qwenDir = path.join(installDir, '.qwen'); + const bmadMethodDir = path.join(qwenDir, 'bmad-method'); await fileManager.ensureDirectory(bmadMethodDir); // Update logic for existing settings.json - const settingsPath = path.join(qwenDir, "settings.json"); + const settingsPath = path.join(qwenDir, 'settings.json'); if (await fileManager.pathExists(settingsPath)) { try { const settingsContent = await fileManager.readFile(settingsPath); @@ -1110,7 +1142,7 @@ class IdeSetup extends BaseIdeSetup { if (settings.contextFileName && Array.isArray(settings.contextFileName)) { const originalLength = settings.contextFileName.length; settings.contextFileName = settings.contextFileName.filter( - (fileName) => !fileName.startsWith("agents/") + (fileName) => !fileName.startsWith('agents/'), ); if (settings.contextFileName.length !== originalLength) { updated = true; @@ -1118,30 +1150,24 @@ class IdeSetup extends BaseIdeSetup { } if (updated) { - await fileManager.writeFile( - settingsPath, - JSON.stringify(settings, null, 2) - ); - console.log(chalk.green("✓ Updated .qwen/settings.json - removed agent file references")); + await fileManager.writeFile(settingsPath, JSON.stringify(settings, null, 2)); + console.log(chalk.green('✓ Updated .qwen/settings.json - removed agent file references')); } } catch (error) { - console.warn( - chalk.yellow("Could not update .qwen/settings.json"), - error - ); + console.warn(chalk.yellow('Could not update .qwen/settings.json'), error); } } // Remove old agents directory - const agentsDir = path.join(qwenDir, "agents"); + const agentsDir = path.join(qwenDir, 'agents'); if (await fileManager.pathExists(agentsDir)) { await fileManager.removeDirectory(agentsDir); - console.log(chalk.green("✓ Removed old .qwen/agents directory")); + console.log(chalk.green('✓ Removed old .qwen/agents directory')); } // Get all available agents const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); - let concatenatedContent = ""; + let concatenatedContent = ''; for (const agentId of agents) { // Find the source agent file @@ -1154,50 +1180,54 @@ class IdeSetup extends BaseIdeSetup { let agentRuleContent = `# ${agentId.toUpperCase()} Agent Rule\n\n`; agentRuleContent += `This rule is triggered when the user types \`*${agentId}\` and activates the ${await this.getAgentTitle( agentId, - installDir + installDir, )} agent persona.\n\n`; - agentRuleContent += "## Agent Activation\n\n"; + agentRuleContent += '## Agent Activation\n\n'; agentRuleContent += - "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:\n\n"; - agentRuleContent += "```yaml\n"; + '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:\n\n'; + agentRuleContent += '```yaml\n'; // Extract just the YAML content from the agent file const yamlContent = extractYamlFromAgent(agentContent); if (yamlContent) { agentRuleContent += yamlContent; - } - else { + } else { // If no YAML found, include the whole content minus the header - agentRuleContent += agentContent.replace(/^#.*$/m, "").trim(); + agentRuleContent += agentContent.replace(/^#.*$/m, '').trim(); } - agentRuleContent += "\n```\n\n"; - agentRuleContent += "## File Reference\n\n"; - const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/'); + agentRuleContent += '\n```\n\n'; + agentRuleContent += '## File Reference\n\n'; + const relativePath = path.relative(installDir, agentPath).replaceAll('\\', '/'); agentRuleContent += `The complete agent definition is available in [${relativePath}](${relativePath}).\n\n`; - agentRuleContent += "## Usage\n\n"; + agentRuleContent += '## Usage\n\n'; agentRuleContent += `When the user types \`*${agentId}\`, activate this ${await this.getAgentTitle( agentId, - installDir + installDir, )} persona and follow all instructions defined in the YAML configuration above.\n`; // Add to concatenated content with separator - concatenatedContent += agentRuleContent + "\n\n---\n\n"; + concatenatedContent += agentRuleContent + '\n\n---\n\n'; console.log(chalk.green(`✓ Added context for *${agentId}`)); } } // Write the concatenated content to QWEN.md - const qwenMdPath = path.join(bmadMethodDir, "QWEN.md"); + const qwenMdPath = path.join(bmadMethodDir, 'QWEN.md'); await fileManager.writeFile(qwenMdPath, concatenatedContent); console.log(chalk.green(`\n✓ Created QWEN.md in ${bmadMethodDir}`)); return true; } - async setupGitHubCopilot(installDir, selectedAgent, spinner = null, preConfiguredSettings = null) { + async setupGitHubCopilot( + installDir, + selectedAgent, + spinner = null, + preConfiguredSettings = null, + ) { // Configure VS Code workspace settings first to avoid UI conflicts with loading spinners await this.configureVsCodeSettings(installDir, spinner, preConfiguredSettings); - const chatmodesDir = path.join(installDir, ".github", "chatmodes"); + const chatmodesDir = path.join(installDir, '.github', 'chatmodes'); const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); await fileManager.ensureDirectory(chatmodesDir); @@ -1223,7 +1253,7 @@ class IdeSetup extends BaseIdeSetup { } let chatmodeContent = `--- -description: "${description.replace(/"/g, '\\"')}" +description: "${description.replaceAll('"', String.raw`\"`)}" tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems', 'usages', 'editFiles', 'runCommands', 'runTasks', 'runTests', 'search', 'searchResults', 'terminalLastCommand', 'terminalSelection', 'testFailure'] --- @@ -1242,8 +1272,8 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems } async configureVsCodeSettings(installDir, spinner, preConfiguredSettings = null) { - const vscodeDir = path.join(installDir, ".vscode"); - const settingsPath = path.join(vscodeDir, "settings.json"); + const vscodeDir = path.join(installDir, '.vscode'); + const settingsPath = path.join(vscodeDir, 'settings.json'); await fileManager.ensureDirectory(vscodeDir); @@ -1253,9 +1283,9 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems try { const existingContent = await fileManager.readFile(settingsPath); existingSettings = JSON.parse(existingContent); - console.log(chalk.yellow("Found existing .vscode/settings.json. Merging BMad settings...")); - } catch (error) { - console.warn(chalk.yellow("Could not parse existing settings.json. Creating new one.")); + console.log(chalk.yellow('Found existing .vscode/settings.json. Merging BMad settings...')); + } catch { + console.warn(chalk.yellow('Could not parse existing settings.json. Creating new one.')); existingSettings = {}; } } @@ -1268,8 +1298,10 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems } else { // Clear any previous output and add spacing to avoid conflicts with loaders console.log('\n'.repeat(2)); - console.log(chalk.blue("🔧 Github Copilot Agent Settings Configuration")); - console.log(chalk.dim("BMad works best with specific VS Code settings for optimal agent experience.")); + console.log(chalk.blue('🔧 Github Copilot Agent Settings Configuration')); + console.log( + chalk.dim('BMad works best with specific VS Code settings for optimal agent experience.'), + ); console.log(''); // Add extra spacing const response = await inquirer.prompt([ @@ -1280,19 +1312,19 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems choices: [ { name: 'Use recommended defaults (fastest setup)', - value: 'defaults' + value: 'defaults', }, { name: 'Configure each setting manually (customize to your preferences)', - value: 'manual' + value: 'manual', }, { - name: 'Skip settings configuration (I\'ll configure manually later)', - value: 'skip' - } + name: "Skip settings configuration (I'll configure manually later)", + value: 'skip', + }, ], - default: 'defaults' - } + default: 'defaults', + }, ]); configChoice = response.configChoice; } @@ -1300,28 +1332,28 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems let bmadSettings = {}; if (configChoice === 'skip') { - console.log(chalk.yellow("⚠️ Skipping VS Code settings configuration.")); - console.log(chalk.dim("You can manually configure these settings in .vscode/settings.json:")); - console.log(chalk.dim(" • chat.agent.enabled: true")); - console.log(chalk.dim(" • chat.agent.maxRequests: 15")); - console.log(chalk.dim(" • github.copilot.chat.agent.runTasks: true")); - console.log(chalk.dim(" • chat.mcp.discovery.enabled: true")); - console.log(chalk.dim(" • github.copilot.chat.agent.autoFix: true")); - console.log(chalk.dim(" • chat.tools.autoApprove: false")); + console.log(chalk.yellow('⚠️ Skipping VS Code settings configuration.')); + console.log(chalk.dim('You can manually configure these settings in .vscode/settings.json:')); + console.log(chalk.dim(' • chat.agent.enabled: true')); + console.log(chalk.dim(' • chat.agent.maxRequests: 15')); + console.log(chalk.dim(' • github.copilot.chat.agent.runTasks: true')); + console.log(chalk.dim(' • chat.mcp.discovery.enabled: true')); + console.log(chalk.dim(' • github.copilot.chat.agent.autoFix: true')); + console.log(chalk.dim(' • chat.tools.autoApprove: false')); return true; } if (configChoice === 'defaults') { // Use recommended defaults bmadSettings = { - "chat.agent.enabled": true, - "chat.agent.maxRequests": 15, - "github.copilot.chat.agent.runTasks": true, - "chat.mcp.discovery.enabled": true, - "github.copilot.chat.agent.autoFix": true, - "chat.tools.autoApprove": false + 'chat.agent.enabled': true, + 'chat.agent.maxRequests': 15, + 'github.copilot.chat.agent.runTasks': true, + 'chat.mcp.discovery.enabled': true, + 'github.copilot.chat.agent.autoFix': true, + 'chat.tools.autoApprove': false, }; - console.log(chalk.green("✓ Using recommended BMad defaults for Github Copilot settings")); + console.log(chalk.green('✓ Using recommended BMad defaults for Github Copilot settings')); } else { // Manual configuration console.log(chalk.blue("\n📋 Let's configure each setting for your preferences:")); @@ -1340,37 +1372,37 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems message: 'Maximum requests per agent session (recommended: 15)?', default: '15', validate: (input) => { - const num = parseInt(input); - if (isNaN(num) || num < 1 || num > 50) { + const number_ = Number.parseInt(input); + if (isNaN(number_) || number_ < 1 || number_ > 50) { return 'Please enter a number between 1 and 50'; } return true; - } + }, }, { type: 'confirm', name: 'runTasks', message: 'Allow agents to run workspace tasks (package.json scripts, etc.)?', - default: true + default: true, }, { type: 'confirm', name: 'mcpDiscovery', message: 'Enable MCP (Model Context Protocol) server discovery?', - default: true + default: true, }, { type: 'confirm', name: 'autoFix', message: 'Enable automatic error detection and fixing in generated code?', - default: true + default: true, }, { type: 'confirm', name: 'autoApprove', message: 'Auto-approve ALL tools without confirmation? (⚠️ EXPERIMENTAL - less secure)', - default: false - } + default: false, + }, ]); // Restart spinner if it was active before prompts @@ -1379,15 +1411,15 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems } bmadSettings = { - "chat.agent.enabled": true, // Always enabled - required for BMad agents - "chat.agent.maxRequests": parseInt(manualSettings.maxRequests), - "github.copilot.chat.agent.runTasks": manualSettings.runTasks, - "chat.mcp.discovery.enabled": manualSettings.mcpDiscovery, - "github.copilot.chat.agent.autoFix": manualSettings.autoFix, - "chat.tools.autoApprove": manualSettings.autoApprove + 'chat.agent.enabled': true, // Always enabled - required for BMad agents + 'chat.agent.maxRequests': Number.parseInt(manualSettings.maxRequests), + 'github.copilot.chat.agent.runTasks': manualSettings.runTasks, + 'chat.mcp.discovery.enabled': manualSettings.mcpDiscovery, + 'github.copilot.chat.agent.autoFix': manualSettings.autoFix, + 'chat.tools.autoApprove': manualSettings.autoApprove, }; - console.log(chalk.green("✓ Custom settings configured")); + console.log(chalk.green('✓ Custom settings configured')); } // Merge settings (existing settings take precedence to avoid overriding user preferences) @@ -1396,13 +1428,13 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems // Write the updated settings await fileManager.writeFile(settingsPath, JSON.stringify(mergedSettings, null, 2)); - console.log(chalk.green("✓ VS Code workspace settings configured successfully")); - console.log(chalk.dim(" Settings written to .vscode/settings.json:")); - Object.entries(bmadSettings).forEach(([key, value]) => { + console.log(chalk.green('✓ VS Code workspace settings configured successfully')); + console.log(chalk.dim(' Settings written to .vscode/settings.json:')); + for (const [key, value] of Object.entries(bmadSettings)) { console.log(chalk.dim(` • ${key}: ${value}`)); - }); - console.log(chalk.dim("")); - console.log(chalk.dim("You can modify these settings anytime in .vscode/settings.json")); + } + console.log(chalk.dim('')); + console.log(chalk.dim('You can modify these settings anytime in .vscode/settings.json')); } } diff --git a/tools/installer/lib/installer.js b/tools/installer/lib/installer.js index 04da0864..e709b4cf 100644 --- a/tools/installer/lib/installer.js +++ b/tools/installer/lib/installer.js @@ -1,13 +1,13 @@ -const path = require("node:path"); -const fs = require("fs-extra"); -const chalk = require("chalk").default || require("chalk"); -const ora = require("ora").default || require("ora"); -const inquirer = require("inquirer").default || require("inquirer"); -const fileManager = require("./file-manager"); -const configLoader = require("./config-loader"); -const ideSetup = require("./ide-setup"); -const { extractYamlFromAgent } = require("../../lib/yaml-utils"); -const resourceLocator = require("./resource-locator"); +const path = require('node:path'); +const fs = require('fs-extra'); +const chalk = require('chalk'); +const ora = require('ora'); +const inquirer = require('inquirer'); +const fileManager = require('./file-manager'); +const configLoader = require('./config-loader'); +const ideSetup = require('./ide-setup'); +const { extractYamlFromAgent } = require('../../lib/yaml-utils'); +const resourceLocator = require('./resource-locator'); class Installer { async getCoreVersion() { @@ -16,29 +16,29 @@ class Installer { const packagePath = path.join(__dirname, '..', '..', '..', 'package.json'); const packageJson = require(packagePath); return packageJson.version; - } catch (error) { + } catch { console.warn("Could not read version from package.json, using 'unknown'"); - return "unknown"; + return 'unknown'; } } async install(config) { - const spinner = ora("Analyzing installation directory...").start(); - + const spinner = ora('Analyzing installation directory...').start(); + try { // Store the original CWD where npx was executed const originalCwd = process.env.INIT_CWD || process.env.PWD || process.cwd(); - + // Resolve installation directory relative to where the user ran the command - let installDir = path.isAbsolute(config.directory) - ? config.directory + let installDir = path.isAbsolute(config.directory) + ? config.directory : path.resolve(originalCwd, config.directory); - + if (path.basename(installDir) === '.bmad-core') { // If user points directly to .bmad-core, treat its parent as the project root installDir = path.dirname(installDir); } - + // Log resolved path for clarity if (!path.isAbsolute(config.directory)) { spinner.text = `Resolving "${config.directory}" to: ${installDir}`; @@ -48,7 +48,7 @@ class Installer { if (!(await fileManager.pathExists(installDir))) { spinner.stop(); console.log(`\nThe directory ${installDir} does not exist.`); - + const { action } = await inquirer.prompt([ { type: 'list', @@ -57,52 +57,61 @@ class Installer { choices: [ { name: 'Create the directory and continue', - value: 'create' + value: 'create', }, { name: 'Choose a different directory', - value: 'change' + value: 'change', }, { name: 'Cancel installation', - value: 'cancel' - } - ] - } + value: 'cancel', + }, + ], + }, ]); - if (action === 'cancel') { + switch (action) { + case 'cancel': { console.log('Installation cancelled.'); - process.exit(0); - } else if (action === 'change') { - const { newDirectory } = await inquirer.prompt([ - { - type: 'input', - name: 'newDirectory', - message: 'Enter the new directory path:', - validate: (input) => { - if (!input.trim()) { - return 'Please enter a valid directory path'; - } - return true; - } - } - ]); - // Preserve the original CWD for the recursive call - config.directory = newDirectory; - return await this.install(config); // Recursive call with new directory - } else if (action === 'create') { - try { - await fileManager.ensureDirectory(installDir); - console.log(`✓ Created directory: ${installDir}`); - } catch (error) { - console.error(`Failed to create directory: ${error.message}`); - console.error('You may need to check permissions or use a different path.'); - process.exit(1); + process.exit(0); + + break; } + case 'change': { + const { newDirectory } = await inquirer.prompt([ + { + type: 'input', + name: 'newDirectory', + message: 'Enter the new directory path:', + validate: (input) => { + if (!input.trim()) { + return 'Please enter a valid directory path'; + } + return true; + }, + }, + ]); + // Preserve the original CWD for the recursive call + config.directory = newDirectory; + return await this.install(config); // Recursive call with new directory + } + case 'create': { + try { + await fileManager.ensureDirectory(installDir); + console.log(`✓ Created directory: ${installDir}`); + } catch (error) { + console.error(`Failed to create directory: ${error.message}`); + console.error('You may need to check permissions or use a different path.'); + process.exit(1); + } + + break; + } + // No default } - - spinner.start("Analyzing installation directory..."); + + spinner.start('Analyzing installation directory...'); } // If this is an update request from early detection, handle it directly @@ -121,39 +130,28 @@ class Installer { // Handle different states switch (state.type) { - case "clean": + case 'clean': { return await this.performFreshInstall(config, installDir, spinner); + } - case "v4_existing": - return await this.handleExistingV4Installation( - config, - installDir, - state, - spinner - ); + case 'v4_existing': { + return await this.handleExistingV4Installation(config, installDir, state, spinner); + } - case "v3_existing": - return await this.handleV3Installation( - config, - installDir, - state, - spinner - ); + case 'v3_existing': { + return await this.handleV3Installation(config, installDir, state, spinner); + } - case "unknown_existing": - return await this.handleUnknownInstallation( - config, - installDir, - state, - spinner - ); + case 'unknown_existing': { + return await this.handleUnknownInstallation(config, installDir, state, spinner); + } } } catch (error) { // Check if modules were initialized if (spinner) { - spinner.fail("Installation failed"); + spinner.fail('Installation failed'); } else { - console.error("Installation failed:", error.message); + console.error('Installation failed:', error.message); } throw error; } @@ -161,7 +159,7 @@ class Installer { async detectInstallationState(installDir) { const state = { - type: "clean", + type: 'clean', hasV4Manifest: false, hasV3Structure: false, hasBmadCore: false, @@ -176,11 +174,11 @@ class Installer { } // Check for V4 installation (has .bmad-core with manifest) - const bmadCorePath = path.join(installDir, ".bmad-core"); - const manifestPath = path.join(bmadCorePath, "install-manifest.yaml"); + const bmadCorePath = path.join(installDir, '.bmad-core'); + const manifestPath = path.join(bmadCorePath, 'install-manifest.yaml'); if (await fileManager.pathExists(manifestPath)) { - state.type = "v4_existing"; + state.type = 'v4_existing'; state.hasV4Manifest = true; state.hasBmadCore = true; state.manifest = await fileManager.readManifest(installDir); @@ -188,25 +186,25 @@ class Installer { } // Check for V3 installation (has bmad-agent directory) - const bmadAgentPath = path.join(installDir, "bmad-agent"); + const bmadAgentPath = path.join(installDir, 'bmad-agent'); if (await fileManager.pathExists(bmadAgentPath)) { - state.type = "v3_existing"; + state.type = 'v3_existing'; state.hasV3Structure = true; return state; } // Check for .bmad-core without manifest (broken V4 or manual copy) if (await fileManager.pathExists(bmadCorePath)) { - state.type = "unknown_existing"; + state.type = 'unknown_existing'; state.hasBmadCore = true; return state; } // Check if directory has other files - const files = await resourceLocator.findFiles("**/*", { + const files = await resourceLocator.findFiles('**/*', { cwd: installDir, nodir: true, - ignore: ["**/.git/**", "**/node_modules/**"], + ignore: ['**/.git/**', '**/node_modules/**'], }); if (files.length > 0) { @@ -223,167 +221,184 @@ class Installer { } async performFreshInstall(config, installDir, spinner, options = {}) { - spinner.text = "Installing BMad Method..."; + spinner.text = 'Installing BMad Method...'; let files = []; - if (config.installType === "full") { - // Full installation - copy entire .bmad-core folder as a subdirectory - spinner.text = "Copying complete .bmad-core folder..."; - const sourceDir = resourceLocator.getBmadCorePath(); - const bmadCoreDestDir = path.join(installDir, ".bmad-core"); - await fileManager.copyDirectoryWithRootReplacement(sourceDir, bmadCoreDestDir, ".bmad-core"); - - // Copy common/ items to .bmad-core - spinner.text = "Copying common utilities..."; - await this.copyCommonItems(installDir, ".bmad-core", spinner); - - // Copy documentation files from docs/ to .bmad-core - spinner.text = "Copying documentation files..."; - await this.copyDocsItems(installDir, ".bmad-core", spinner); + switch (config.installType) { + case 'full': { + // Full installation - copy entire .bmad-core folder as a subdirectory + spinner.text = 'Copying complete .bmad-core folder...'; + const sourceDir = resourceLocator.getBmadCorePath(); + const bmadCoreDestDir = path.join(installDir, '.bmad-core'); + await fileManager.copyDirectoryWithRootReplacement( + sourceDir, + bmadCoreDestDir, + '.bmad-core', + ); - // Get list of all files for manifest - const foundFiles = await resourceLocator.findFiles("**/*", { - cwd: bmadCoreDestDir, - nodir: true, - ignore: ["**/.git/**", "**/node_modules/**"], - }); - files = foundFiles.map((file) => path.join(".bmad-core", file)); - } else if (config.installType === "single-agent") { - // Single agent installation - spinner.text = `Installing ${config.agent} agent...`; + // Copy common/ items to .bmad-core + spinner.text = 'Copying common utilities...'; + await this.copyCommonItems(installDir, '.bmad-core', spinner); - // Copy agent file with {root} replacement - const agentPath = configLoader.getAgentPath(config.agent); - const destAgentPath = path.join( - installDir, - ".bmad-core", - "agents", - `${config.agent}.md` - ); - await fileManager.copyFileWithRootReplacement(agentPath, destAgentPath, ".bmad-core"); - files.push(`.bmad-core/agents/${config.agent}.md`); + // Copy documentation files from docs/ to .bmad-core + spinner.text = 'Copying documentation files...'; + await this.copyDocsItems(installDir, '.bmad-core', spinner); - // Copy dependencies - const { all: dependencies } = await resourceLocator.getAgentDependencies( - config.agent - ); - const sourceBase = resourceLocator.getBmadCorePath(); + // Get list of all files for manifest + const foundFiles = await resourceLocator.findFiles('**/*', { + cwd: bmadCoreDestDir, + nodir: true, + ignore: ['**/.git/**', '**/node_modules/**'], + }); + files = foundFiles.map((file) => path.join('.bmad-core', file)); - for (const dep of dependencies) { - spinner.text = `Copying dependency: ${dep}`; + break; + } + case 'single-agent': { + // Single agent installation + spinner.text = `Installing ${config.agent} agent...`; - if (dep.includes("*")) { - // Handle glob patterns with {root} replacement - const copiedFiles = await fileManager.copyGlobPattern( - dep.replace(".bmad-core/", ""), - sourceBase, - path.join(installDir, ".bmad-core"), - ".bmad-core" - ); - files.push(...copiedFiles.map(f => `.bmad-core/${f}`)); - } else { - // Handle single files with {root} replacement if needed - const sourcePath = path.join( - sourceBase, - dep.replace(".bmad-core/", "") - ); - const destPath = path.join( - installDir, - dep - ); + // Copy agent file with {root} replacement + const agentPath = configLoader.getAgentPath(config.agent); + const destinationAgentPath = path.join( + installDir, + '.bmad-core', + 'agents', + `${config.agent}.md`, + ); + await fileManager.copyFileWithRootReplacement( + agentPath, + destinationAgentPath, + '.bmad-core', + ); + files.push(`.bmad-core/agents/${config.agent}.md`); - const needsRootReplacement = dep.endsWith('.md') || dep.endsWith('.yaml') || dep.endsWith('.yml'); - let success = false; - - if (needsRootReplacement) { - success = await fileManager.copyFileWithRootReplacement(sourcePath, destPath, ".bmad-core"); + // Copy dependencies + const { all: dependencies } = await resourceLocator.getAgentDependencies(config.agent); + const sourceBase = resourceLocator.getBmadCorePath(); + + for (const dep of dependencies) { + spinner.text = `Copying dependency: ${dep}`; + + if (dep.includes('*')) { + // Handle glob patterns with {root} replacement + const copiedFiles = await fileManager.copyGlobPattern( + dep.replace('.bmad-core/', ''), + sourceBase, + path.join(installDir, '.bmad-core'), + '.bmad-core', + ); + files.push(...copiedFiles.map((f) => `.bmad-core/${f}`)); } else { - success = await fileManager.copyFile(sourcePath, destPath); - } + // Handle single files with {root} replacement if needed + const sourcePath = path.join(sourceBase, dep.replace('.bmad-core/', '')); + const destinationPath = path.join(installDir, dep); - if (success) { - files.push(dep); + const needsRootReplacement = + dep.endsWith('.md') || dep.endsWith('.yaml') || dep.endsWith('.yml'); + let success = false; + + success = await (needsRootReplacement + ? fileManager.copyFileWithRootReplacement(sourcePath, destinationPath, '.bmad-core') + : fileManager.copyFile(sourcePath, destinationPath)); + + if (success) { + files.push(dep); + } } } - } - - // Copy common/ items to .bmad-core - spinner.text = "Copying common utilities..."; - const commonFiles = await this.copyCommonItems(installDir, ".bmad-core", spinner); - files.push(...commonFiles); - - // Copy documentation files from docs/ to .bmad-core - spinner.text = "Copying documentation files..."; - const docFiles = await this.copyDocsItems(installDir, ".bmad-core", spinner); - files.push(...docFiles); - } else if (config.installType === "team") { - // Team installation - spinner.text = `Installing ${config.team} team...`; - - // Get team dependencies - const teamDependencies = await configLoader.getTeamDependencies(config.team); - const sourceBase = resourceLocator.getBmadCorePath(); - - // Install all team dependencies - for (const dep of teamDependencies) { - spinner.text = `Copying team dependency: ${dep}`; - - if (dep.includes("*")) { - // Handle glob patterns with {root} replacement - const copiedFiles = await fileManager.copyGlobPattern( - dep.replace(".bmad-core/", ""), - sourceBase, - path.join(installDir, ".bmad-core"), - ".bmad-core" - ); - files.push(...copiedFiles.map(f => `.bmad-core/${f}`)); - } else { - // Handle single files with {root} replacement if needed - const sourcePath = path.join(sourceBase, dep.replace(".bmad-core/", "")); - const destPath = path.join(installDir, dep); - - const needsRootReplacement = dep.endsWith('.md') || dep.endsWith('.yaml') || dep.endsWith('.yml'); - let success = false; - - if (needsRootReplacement) { - success = await fileManager.copyFileWithRootReplacement(sourcePath, destPath, ".bmad-core"); - } else { - success = await fileManager.copyFile(sourcePath, destPath); - } - if (success) { - files.push(dep); + // Copy common/ items to .bmad-core + spinner.text = 'Copying common utilities...'; + const commonFiles = await this.copyCommonItems(installDir, '.bmad-core', spinner); + files.push(...commonFiles); + + // Copy documentation files from docs/ to .bmad-core + spinner.text = 'Copying documentation files...'; + const documentFiles = await this.copyDocsItems(installDir, '.bmad-core', spinner); + files.push(...documentFiles); + + break; + } + case 'team': { + // Team installation + spinner.text = `Installing ${config.team} team...`; + + // Get team dependencies + const teamDependencies = await configLoader.getTeamDependencies(config.team); + const sourceBase = resourceLocator.getBmadCorePath(); + + // Install all team dependencies + for (const dep of teamDependencies) { + spinner.text = `Copying team dependency: ${dep}`; + + if (dep.includes('*')) { + // Handle glob patterns with {root} replacement + const copiedFiles = await fileManager.copyGlobPattern( + dep.replace('.bmad-core/', ''), + sourceBase, + path.join(installDir, '.bmad-core'), + '.bmad-core', + ); + files.push(...copiedFiles.map((f) => `.bmad-core/${f}`)); + } else { + // Handle single files with {root} replacement if needed + const sourcePath = path.join(sourceBase, dep.replace('.bmad-core/', '')); + const destinationPath = path.join(installDir, dep); + + const needsRootReplacement = + dep.endsWith('.md') || dep.endsWith('.yaml') || dep.endsWith('.yml'); + let success = false; + + success = await (needsRootReplacement + ? fileManager.copyFileWithRootReplacement(sourcePath, destinationPath, '.bmad-core') + : fileManager.copyFile(sourcePath, destinationPath)); + + if (success) { + files.push(dep); + } } } + + // Copy common/ items to .bmad-core + spinner.text = 'Copying common utilities...'; + const commonFiles = await this.copyCommonItems(installDir, '.bmad-core', spinner); + files.push(...commonFiles); + + // Copy documentation files from docs/ to .bmad-core + spinner.text = 'Copying documentation files...'; + const documentFiles = await this.copyDocsItems(installDir, '.bmad-core', spinner); + files.push(...documentFiles); + + break; } - - // Copy common/ items to .bmad-core - spinner.text = "Copying common utilities..."; - const commonFiles = await this.copyCommonItems(installDir, ".bmad-core", spinner); - files.push(...commonFiles); - - // Copy documentation files from docs/ to .bmad-core - spinner.text = "Copying documentation files..."; - const docFiles = await this.copyDocsItems(installDir, ".bmad-core", spinner); - files.push(...docFiles); - } else if (config.installType === "expansion-only") { - // Expansion-only installation - DO NOT create .bmad-core - // Only install expansion packs - spinner.text = "Installing expansion packs only..."; + case 'expansion-only': { + // Expansion-only installation - DO NOT create .bmad-core + // Only install expansion packs + spinner.text = 'Installing expansion packs only...'; + + break; + } + // No default } // Install expansion packs if requested - const expansionFiles = await this.installExpansionPacks(installDir, config.expansionPacks, spinner, config); + const expansionFiles = await this.installExpansionPacks( + installDir, + config.expansionPacks, + spinner, + config, + ); files.push(...expansionFiles); // Install web bundles if requested if (config.includeWebBundles && config.webBundlesDirectory) { - spinner.text = "Installing web bundles..."; + spinner.text = 'Installing web bundles...'; // Resolve web bundles directory using the same logic as the main installation directory const originalCwd = process.env.INIT_CWD || process.env.PWD || process.cwd(); - let resolvedWebBundlesDir = path.isAbsolute(config.webBundlesDirectory) - ? config.webBundlesDirectory + let resolvedWebBundlesDir = path.isAbsolute(config.webBundlesDirectory) + ? config.webBundlesDirectory : path.resolve(originalCwd, config.webBundlesDirectory); await this.installWebBundles(resolvedWebBundlesDir, config, spinner); } @@ -399,18 +414,21 @@ class Installer { } // Modify core-config.yaml if sharding preferences were provided - if (config.installType !== "expansion-only" && (config.prdSharded !== undefined || config.architectureSharded !== undefined)) { - spinner.text = "Configuring document sharding settings..."; + if ( + config.installType !== 'expansion-only' && + (config.prdSharded !== undefined || config.architectureSharded !== undefined) + ) { + spinner.text = 'Configuring document sharding settings...'; await fileManager.modifyCoreConfig(installDir, config); } // Create manifest (skip for expansion-only installations) - if (config.installType !== "expansion-only") { - spinner.text = "Creating installation manifest..."; + if (config.installType !== 'expansion-only') { + spinner.text = 'Creating installation manifest...'; await fileManager.createManifest(installDir, config, files); } - spinner.succeed("Installation complete!"); + spinner.succeed('Installation complete!'); this.showSuccessMessage(config, installDir, options); } @@ -421,44 +439,40 @@ class Installer { const newVersion = await this.getCoreVersion(); const versionCompare = this.compareVersions(currentVersion, newVersion); - console.log(chalk.yellow("\n🔍 Found existing BMad v4 installation")); + console.log(chalk.yellow('\n🔍 Found existing BMad v4 installation')); console.log(` Directory: ${installDir}`); console.log(` Current version: ${currentVersion}`); console.log(` Available version: ${newVersion}`); - console.log( - ` Installed: ${new Date( - state.manifest.installed_at - ).toLocaleDateString()}` - ); + console.log(` Installed: ${new Date(state.manifest.installed_at).toLocaleDateString()}`); // Check file integrity - spinner.start("Checking installation integrity..."); + spinner.start('Checking installation integrity...'); const integrity = await fileManager.checkFileIntegrity(installDir, state.manifest); spinner.stop(); - + const hasMissingFiles = integrity.missing.length > 0; const hasModifiedFiles = integrity.modified.length > 0; const hasIntegrityIssues = hasMissingFiles || hasModifiedFiles; - + if (hasIntegrityIssues) { - console.log(chalk.red("\n⚠️ Installation issues detected:")); + console.log(chalk.red('\n⚠️ Installation issues detected:')); if (hasMissingFiles) { console.log(chalk.red(` Missing files: ${integrity.missing.length}`)); if (integrity.missing.length <= 5) { - integrity.missing.forEach(file => console.log(chalk.dim(` - ${file}`))); + for (const file of integrity.missing) console.log(chalk.dim(` - ${file}`)); } } if (hasModifiedFiles) { console.log(chalk.yellow(` Modified files: ${integrity.modified.length}`)); if (integrity.modified.length <= 5) { - integrity.modified.forEach(file => console.log(chalk.dim(` - ${file}`))); + for (const file of integrity.modified) console.log(chalk.dim(` - ${file}`)); } } } // Show existing expansion packs if (Object.keys(state.expansionPacks).length > 0) { - console.log(chalk.cyan("\n📦 Installed expansion packs:")); + console.log(chalk.cyan('\n📦 Installed expansion packs:')); for (const [packId, packInfo] of Object.entries(state.expansionPacks)) { if (packInfo.hasManifest && packInfo.manifest) { console.log(` - ${packId} (v${packInfo.manifest.version || 'unknown'})`); @@ -469,236 +483,251 @@ class Installer { } let choices = []; - + if (versionCompare < 0) { - console.log(chalk.cyan("\n⬆️ Upgrade available for BMad core")); - choices.push({ name: `Upgrade BMad core (v${currentVersion} → v${newVersion})`, value: "upgrade" }); + console.log(chalk.cyan('\n⬆️ Upgrade available for BMad core')); + choices.push({ + name: `Upgrade BMad core (v${currentVersion} → v${newVersion})`, + value: 'upgrade', + }); } else if (versionCompare === 0) { if (hasIntegrityIssues) { // Offer repair option when files are missing or modified - choices.push({ - name: "Repair installation (restore missing/modified files)", - value: "repair" + choices.push({ + name: 'Repair installation (restore missing/modified files)', + value: 'repair', }); } - console.log(chalk.yellow("\n⚠️ Same version already installed")); - choices.push({ name: `Force reinstall BMad core (v${currentVersion} - reinstall)`, value: "reinstall" }); + console.log(chalk.yellow('\n⚠️ Same version already installed')); + choices.push({ + name: `Force reinstall BMad core (v${currentVersion} - reinstall)`, + value: 'reinstall', + }); } else { - console.log(chalk.yellow("\n⬇️ Installed version is newer than available")); - choices.push({ name: `Downgrade BMad core (v${currentVersion} → v${newVersion})`, value: "reinstall" }); + console.log(chalk.yellow('\n⬇️ Installed version is newer than available')); + choices.push({ + name: `Downgrade BMad core (v${currentVersion} → v${newVersion})`, + value: 'reinstall', + }); } - + choices.push( - { name: "Add/update expansion packs only", value: "expansions" }, - { name: "Cancel", value: "cancel" } + { name: 'Add/update expansion packs only', value: 'expansions' }, + { name: 'Cancel', value: 'cancel' }, ); const { action } = await inquirer.prompt([ { - type: "list", - name: "action", - message: "What would you like to do?", + type: 'list', + name: 'action', + message: 'What would you like to do?', choices: choices, }, ]); switch (action) { - case "upgrade": + case 'upgrade': { return await this.performUpdate(config, installDir, state.manifest, spinner); - case "repair": + } + case 'repair': { // For repair, restore missing/modified files while backing up modified ones return await this.performRepair(config, installDir, state.manifest, integrity, spinner); - case "reinstall": + } + case 'reinstall': { // For reinstall, don't check for modifications - just overwrite return await this.performReinstall(config, installDir, spinner); - case "expansions": { + } + case 'expansions': { // Ask which expansion packs to install const availableExpansionPacks = await resourceLocator.getExpansionPacks(); - + if (availableExpansionPacks.length === 0) { - console.log(chalk.yellow("No expansion packs available.")); + console.log(chalk.yellow('No expansion packs available.')); return; } - + const { selectedPacks } = await inquirer.prompt([ { type: 'checkbox', name: 'selectedPacks', message: 'Select expansion packs to install/update:', - choices: availableExpansionPacks.map(pack => ({ + choices: availableExpansionPacks.map((pack) => ({ name: `${pack.name} (v${pack.version}) .${pack.id}`, value: pack.id, - checked: state.expansionPacks[pack.id] !== undefined - })) - } + checked: state.expansionPacks[pack.id] !== undefined, + })), + }, ]); - + if (selectedPacks.length === 0) { - console.log(chalk.yellow("No expansion packs selected.")); + console.log(chalk.yellow('No expansion packs selected.')); return; } - - spinner.start("Installing expansion packs..."); - const expansionFiles = await this.installExpansionPacks(installDir, selectedPacks, spinner, { ides: config.ides || [] }); - spinner.succeed("Expansion packs installed successfully!"); - - console.log(chalk.green("\n✓ Installation complete!")); + + spinner.start('Installing expansion packs...'); + const expansionFiles = await this.installExpansionPacks( + installDir, + selectedPacks, + spinner, + { ides: config.ides || [] }, + ); + spinner.succeed('Expansion packs installed successfully!'); + + console.log(chalk.green('\n✓ Installation complete!')); console.log(chalk.green(`✓ Expansion packs installed/updated:`)); for (const packId of selectedPacks) { console.log(chalk.green(` - ${packId} → .${packId}/`)); } return; } - case "cancel": - console.log("Installation cancelled."); + case 'cancel': { + console.log('Installation cancelled.'); return; + } } } async handleV3Installation(config, installDir, state, spinner) { spinner.stop(); - console.log( - chalk.yellow("\n🔍 Found BMad v3 installation (bmad-agent/ directory)") - ); + console.log(chalk.yellow('\n🔍 Found BMad v3 installation (bmad-agent/ directory)')); console.log(` Directory: ${installDir}`); const { action } = await inquirer.prompt([ { - type: "list", - name: "action", - message: "What would you like to do?", + type: 'list', + name: 'action', + message: 'What would you like to do?', choices: [ - { name: "Upgrade from v3 to v4 (recommended)", value: "upgrade" }, - { name: "Install v4 alongside v3", value: "alongside" }, - { name: "Cancel", value: "cancel" }, + { name: 'Upgrade from v3 to v4 (recommended)', value: 'upgrade' }, + { name: 'Install v4 alongside v3', value: 'alongside' }, + { name: 'Cancel', value: 'cancel' }, ], }, ]); switch (action) { - case "upgrade": { - console.log(chalk.cyan("\n📦 Starting v3 to v4 upgrade process...")); - const V3ToV4Upgrader = require("../../upgraders/v3-to-v4-upgrader"); + case 'upgrade': { + console.log(chalk.cyan('\n📦 Starting v3 to v4 upgrade process...')); + const V3ToV4Upgrader = require('../../upgraders/v3-to-v4-upgrader'); const upgrader = new V3ToV4Upgrader(); - return await upgrader.upgrade({ + return await upgrader.upgrade({ projectPath: installDir, - ides: config.ides || [] // Pass IDE selections from initial config + ides: config.ides || [], // Pass IDE selections from initial config }); } - case "alongside": + case 'alongside': { return await this.performFreshInstall(config, installDir, spinner); - case "cancel": - console.log("Installation cancelled."); + } + case 'cancel': { + console.log('Installation cancelled.'); return; + } } } async handleUnknownInstallation(config, installDir, state, spinner) { spinner.stop(); - console.log(chalk.yellow("\n⚠️ Directory contains existing files")); + console.log(chalk.yellow('\n⚠️ Directory contains existing files')); console.log(` Directory: ${installDir}`); if (state.hasBmadCore) { - console.log(" Found: .bmad-core directory (but no manifest)"); + console.log(' Found: .bmad-core directory (but no manifest)'); } if (state.hasOtherFiles) { - console.log(" Found: Other files in directory"); + console.log(' Found: Other files in directory'); } const { action } = await inquirer.prompt([ { - type: "list", - name: "action", - message: "What would you like to do?", + type: 'list', + name: 'action', + message: 'What would you like to do?', choices: [ - { name: "Install anyway (may overwrite files)", value: "force" }, - { name: "Choose different directory", value: "different" }, - { name: "Cancel", value: "cancel" }, + { name: 'Install anyway (may overwrite files)', value: 'force' }, + { name: 'Choose different directory', value: 'different' }, + { name: 'Cancel', value: 'cancel' }, ], }, ]); switch (action) { - case "force": + case 'force': { return await this.performFreshInstall(config, installDir, spinner); - case "different": { + } + case 'different': { const { newDir } = await inquirer.prompt([ { - type: "input", - name: "newDir", - message: "Enter new installation directory:", - default: path.join(path.dirname(installDir), "bmad-project"), + type: 'input', + name: 'newDir', + message: 'Enter new installation directory:', + default: path.join(path.dirname(installDir), 'bmad-project'), }, ]); config.directory = newDir; return await this.install(config); } - case "cancel": - console.log("Installation cancelled."); + case 'cancel': { + console.log('Installation cancelled.'); return; + } } } async performUpdate(newConfig, installDir, manifest, spinner) { - spinner.start("Checking for updates..."); + spinner.start('Checking for updates...'); try { // Get current and new versions const currentVersion = manifest.version; const newVersion = await this.getCoreVersion(); const versionCompare = this.compareVersions(currentVersion, newVersion); - + // Only check for modified files if it's an actual version upgrade let modifiedFiles = []; if (versionCompare !== 0) { - spinner.text = "Checking for modified files..."; - modifiedFiles = await fileManager.checkModifiedFiles( - installDir, - manifest - ); + spinner.text = 'Checking for modified files...'; + modifiedFiles = await fileManager.checkModifiedFiles(installDir, manifest); } if (modifiedFiles.length > 0) { - spinner.warn("Found modified files"); - console.log(chalk.yellow("\nThe following files have been modified:")); + spinner.warn('Found modified files'); + console.log(chalk.yellow('\nThe following files have been modified:')); for (const file of modifiedFiles) { console.log(` - ${file}`); } const { action } = await inquirer.prompt([ { - type: "list", - name: "action", - message: "How would you like to proceed?", + type: 'list', + name: 'action', + message: 'How would you like to proceed?', choices: [ - { name: "Backup and overwrite modified files", value: "backup" }, - { name: "Skip modified files", value: "skip" }, - { name: "Cancel update", value: "cancel" }, + { name: 'Backup and overwrite modified files', value: 'backup' }, + { name: 'Skip modified files', value: 'skip' }, + { name: 'Cancel update', value: 'cancel' }, ], }, ]); - if (action === "cancel") { - console.log("Update cancelled."); + if (action === 'cancel') { + console.log('Update cancelled.'); return; } - if (action === "backup") { - spinner.start("Backing up modified files..."); + if (action === 'backup') { + spinner.start('Backing up modified files...'); for (const file of modifiedFiles) { const filePath = path.join(installDir, file); const backupPath = await fileManager.backupFile(filePath); - console.log( - chalk.dim(` Backed up: ${file} → ${path.basename(backupPath)}`) - ); + console.log(chalk.dim(` Backed up: ${file} → ${path.basename(backupPath)}`)); } } } // Perform update by re-running installation - spinner.text = versionCompare === 0 ? "Reinstalling files..." : "Updating files..."; + spinner.text = versionCompare === 0 ? 'Reinstalling files...' : 'Updating files...'; const config = { installType: manifest.install_type, agent: manifest.agent, @@ -707,23 +736,23 @@ class Installer { }; await this.performFreshInstall(config, installDir, spinner, { isUpdate: true }); - + // Clean up .yml files that now have .yaml counterparts - spinner.text = "Cleaning up legacy .yml files..."; + spinner.text = 'Cleaning up legacy .yml files...'; await this.cleanupLegacyYmlFiles(installDir, spinner); } catch (error) { - spinner.fail("Update failed"); + spinner.fail('Update failed'); throw error; } } async performRepair(config, installDir, manifest, integrity, spinner) { - spinner.start("Preparing to repair installation..."); + spinner.start('Preparing to repair installation...'); try { // Back up modified files if (integrity.modified.length > 0) { - spinner.text = "Backing up modified files..."; + spinner.text = 'Backing up modified files...'; for (const file of integrity.modified) { const filePath = path.join(installDir, file); if (await fileManager.pathExists(filePath)) { @@ -734,42 +763,42 @@ class Installer { } // Restore missing and modified files - spinner.text = "Restoring files..."; + spinner.text = 'Restoring files...'; const sourceBase = resourceLocator.getBmadCorePath(); const filesToRestore = [...integrity.missing, ...integrity.modified]; - + for (const file of filesToRestore) { // Skip the manifest file itself if (file.endsWith('install-manifest.yaml')) continue; - + const relativePath = file.replace('.bmad-core/', ''); - const destPath = path.join(installDir, file); - + const destinationPath = path.join(installDir, file); + // Check if this is a common/ file that needs special processing const commonBase = path.dirname(path.dirname(path.dirname(path.dirname(__filename)))); const commonSourcePath = path.join(commonBase, 'common', relativePath); - + if (await fileManager.pathExists(commonSourcePath)) { // This is a common/ file - needs template processing - const fs = require('fs').promises; + const fs = require('node:fs').promises; const content = await fs.readFile(commonSourcePath, 'utf8'); - const updatedContent = content.replace(/\{root\}/g, '.bmad-core'); - await fileManager.ensureDirectory(path.dirname(destPath)); - await fs.writeFile(destPath, updatedContent, 'utf8'); + const updatedContent = content.replaceAll('{root}', '.bmad-core'); + await fileManager.ensureDirectory(path.dirname(destinationPath)); + await fs.writeFile(destinationPath, updatedContent, 'utf8'); spinner.text = `Restored: ${file}`; } else { // Regular file from bmad-core const sourcePath = path.join(sourceBase, relativePath); if (await fileManager.pathExists(sourcePath)) { - await fileManager.copyFile(sourcePath, destPath); + await fileManager.copyFile(sourcePath, destinationPath); spinner.text = `Restored: ${file}`; - + // If this is a .yaml file, check for and remove corresponding .yml file if (file.endsWith('.yaml')) { const ymlFile = file.replace(/\.yaml$/, '.yml'); const ymlPath = path.join(installDir, ymlFile); if (await fileManager.pathExists(ymlPath)) { - const fs = require('fs').promises; + const fs = require('node:fs').promises; await fs.unlink(ymlPath); console.log(chalk.dim(` Removed legacy: ${ymlFile} (replaced by ${file})`)); } @@ -779,187 +808,192 @@ class Installer { } } } - + // Clean up .yml files that now have .yaml counterparts - spinner.text = "Cleaning up legacy .yml files..."; + spinner.text = 'Cleaning up legacy .yml files...'; await this.cleanupLegacyYmlFiles(installDir, spinner); - - spinner.succeed("Repair completed successfully!"); - + + spinner.succeed('Repair completed successfully!'); + // Show summary - console.log(chalk.green("\n✓ Installation repaired!")); + console.log(chalk.green('\n✓ Installation repaired!')); if (integrity.missing.length > 0) { console.log(chalk.green(` Restored ${integrity.missing.length} missing files`)); } if (integrity.modified.length > 0) { - console.log(chalk.green(` Restored ${integrity.modified.length} modified files (backups created)`)); + console.log( + chalk.green(` Restored ${integrity.modified.length} modified files (backups created)`), + ); } - + // Warning for Cursor custom modes if agents were repaired const ides = manifest.ides_setup || []; if (ides.includes('cursor')) { - console.log(chalk.yellow.bold("\n⚠️ IMPORTANT: Cursor Custom Modes Update Required")); - console.log(chalk.yellow("Since agent files have been repaired, you need to update any custom agent modes configured in the Cursor custom agent GUI per the Cursor docs.")); + console.log(chalk.yellow.bold('\n⚠️ IMPORTANT: Cursor Custom Modes Update Required')); + console.log( + chalk.yellow( + 'Since agent files have been repaired, you need to update any custom agent modes configured in the Cursor custom agent GUI per the Cursor docs.', + ), + ); } - } catch (error) { - spinner.fail("Repair failed"); + spinner.fail('Repair failed'); throw error; } } async performReinstall(config, installDir, spinner) { - spinner.start("Preparing to reinstall BMad Method..."); + spinner.start('Preparing to reinstall BMad Method...'); // Remove existing .bmad-core - const bmadCorePath = path.join(installDir, ".bmad-core"); + const bmadCorePath = path.join(installDir, '.bmad-core'); if (await fileManager.pathExists(bmadCorePath)) { - spinner.text = "Removing existing installation..."; + spinner.text = 'Removing existing installation...'; await fileManager.removeDirectory(bmadCorePath); } - - spinner.text = "Installing fresh copy..."; + + spinner.text = 'Installing fresh copy...'; const result = await this.performFreshInstall(config, installDir, spinner, { isUpdate: true }); - + // Clean up .yml files that now have .yaml counterparts - spinner.text = "Cleaning up legacy .yml files..."; + spinner.text = 'Cleaning up legacy .yml files...'; await this.cleanupLegacyYmlFiles(installDir, spinner); - + return result; } showSuccessMessage(config, installDir, options = {}) { - console.log(chalk.green("\n✓ BMad Method installed successfully!\n")); + console.log(chalk.green('\n✓ BMad Method installed successfully!\n')); const ides = config.ides || (config.ide ? [config.ide] : []); if (ides.length > 0) { for (const ide of ides) { const ideConfig = configLoader.getIdeConfiguration(ide); if (ideConfig?.instructions) { - console.log( - chalk.bold(`To use BMad agents in ${ideConfig.name}:`) - ); + console.log(chalk.bold(`To use BMad agents in ${ideConfig.name}:`)); console.log(ideConfig.instructions); } } } else { - console.log(chalk.yellow("No IDE configuration was set up.")); - console.log( - "You can manually configure your IDE using the agent files in:", - installDir - ); + console.log(chalk.yellow('No IDE configuration was set up.')); + console.log('You can manually configure your IDE using the agent files in:', installDir); } // Information about installation components - console.log(chalk.bold("\n🎯 Installation Summary:")); - if (config.installType !== "expansion-only") { - console.log(chalk.green("✓ .bmad-core framework installed with all agents and workflows")); + console.log(chalk.bold('\n🎯 Installation Summary:')); + if (config.installType !== 'expansion-only') { + console.log(chalk.green('✓ .bmad-core framework installed with all agents and workflows')); } - + if (config.expansionPacks && config.expansionPacks.length > 0) { console.log(chalk.green(`✓ Expansion packs installed:`)); for (const packId of config.expansionPacks) { console.log(chalk.green(` - ${packId} → .${packId}/`)); } } - + if (config.includeWebBundles && config.webBundlesDirectory) { const bundleInfo = this.getWebBundleInfo(config); // Resolve the web bundles directory for display const originalCwd = process.env.INIT_CWD || process.env.PWD || process.cwd(); - const resolvedWebBundlesDir = path.isAbsolute(config.webBundlesDirectory) - ? config.webBundlesDirectory + const resolvedWebBundlesDir = path.isAbsolute(config.webBundlesDirectory) + ? config.webBundlesDirectory : path.resolve(originalCwd, config.webBundlesDirectory); - console.log(chalk.green(`✓ Web bundles (${bundleInfo}) installed to: ${resolvedWebBundlesDir}`)); + console.log( + chalk.green(`✓ Web bundles (${bundleInfo}) installed to: ${resolvedWebBundlesDir}`), + ); } - + if (ides.length > 0) { - const ideNames = ides.map(ide => { - const ideConfig = configLoader.getIdeConfiguration(ide); - return ideConfig?.name || ide; - }).join(", "); + const ideNames = ides + .map((ide) => { + const ideConfig = configLoader.getIdeConfiguration(ide); + return ideConfig?.name || ide; + }) + .join(', '); console.log(chalk.green(`✓ IDE rules and configurations set up for: ${ideNames}`)); } - - // Information about web bundles if (!config.includeWebBundles) { - console.log(chalk.bold("\n📦 Web Bundles Available:")); - console.log("Pre-built web bundles are available and can be added later:"); - console.log(chalk.cyan(" Run the installer again to add them to your project")); - console.log("These bundles work independently and can be shared, moved, or used"); - console.log("in other projects as standalone files."); + console.log(chalk.bold('\n📦 Web Bundles Available:')); + console.log('Pre-built web bundles are available and can be added later:'); + console.log(chalk.cyan(' Run the installer again to add them to your project')); + console.log('These bundles work independently and can be shared, moved, or used'); + console.log('in other projects as standalone files.'); } - if (config.installType === "single-agent") { - console.log( - chalk.dim( - "\nNeed other agents? Run: npx bmad-method install --agent=" - ) - ); - console.log( - chalk.dim("Need everything? Run: npx bmad-method install --full") - ); + if (config.installType === 'single-agent') { + console.log(chalk.dim('\nNeed other agents? Run: npx bmad-method install --agent=')); + console.log(chalk.dim('Need everything? Run: npx bmad-method install --full')); } // Warning for Cursor custom modes if agents were updated if (options.isUpdate && ides.includes('cursor')) { - console.log(chalk.yellow.bold("\n⚠️ IMPORTANT: Cursor Custom Modes Update Required")); - console.log(chalk.yellow("Since agents have been updated, you need to update any custom agent modes configured in the Cursor custom agent GUI per the Cursor docs.")); + console.log(chalk.yellow.bold('\n⚠️ IMPORTANT: Cursor Custom Modes Update Required')); + console.log( + chalk.yellow( + 'Since agents have been updated, you need to update any custom agent modes configured in the Cursor custom agent GUI per the Cursor docs.', + ), + ); } // Important notice to read the user guide - console.log(chalk.red.bold("\n📖 IMPORTANT: Please read the user guide at docs/user-guide.md (also installed at .bmad-core/user-guide.md)")); - console.log(chalk.red("This guide contains essential information about the BMad workflow and how to use the agents effectively.")); + console.log( + chalk.red.bold( + '\n📖 IMPORTANT: Please read the user guide at docs/user-guide.md (also installed at .bmad-core/user-guide.md)', + ), + ); + console.log( + chalk.red( + 'This guide contains essential information about the BMad workflow and how to use the agents effectively.', + ), + ); } // Legacy method for backward compatibility async update() { console.log(chalk.yellow('The "update" command is deprecated.')); console.log( - 'Please use "install" instead - it will detect and offer to update existing installations.' + 'Please use "install" instead - it will detect and offer to update existing installations.', ); const installDir = await this.findInstallation(); if (installDir) { const config = { - installType: "full", + installType: 'full', directory: path.dirname(installDir), ide: null, }; return await this.install(config); } - console.log(chalk.red("No BMad installation found.")); + console.log(chalk.red('No BMad installation found.')); } async listAgents() { const agents = await resourceLocator.getAvailableAgents(); - console.log(chalk.bold("\nAvailable BMad Agents:\n")); + console.log(chalk.bold('\nAvailable BMad Agents:\n')); for (const agent of agents) { console.log(chalk.cyan(` ${agent.id.padEnd(20)}`), agent.description); } - console.log( - chalk.dim("\nInstall with: npx bmad-method install --agent=\n") - ); + console.log(chalk.dim('\nInstall with: npx bmad-method install --agent=\n')); } async listExpansionPacks() { const expansionPacks = await resourceLocator.getExpansionPacks(); - console.log(chalk.bold("\nAvailable BMad Expansion Packs:\n")); + console.log(chalk.bold('\nAvailable BMad Expansion Packs:\n')); if (expansionPacks.length === 0) { - console.log(chalk.yellow("No expansion packs found.")); + console.log(chalk.yellow('No expansion packs found.')); return; } for (const pack of expansionPacks) { - console.log(chalk.cyan(` ${pack.id.padEnd(20)}`), - `${pack.name} v${pack.version}`); + console.log(chalk.cyan(` ${pack.id.padEnd(20)}`), `${pack.name} v${pack.version}`); console.log(chalk.dim(` ${' '.repeat(22)}${pack.description}`)); if (pack.author && pack.author !== 'Unknown') { console.log(chalk.dim(` ${' '.repeat(22)}by ${pack.author}`)); @@ -967,36 +1001,28 @@ class Installer { console.log(); } - console.log( - chalk.dim("Install with: npx bmad-method install --full --expansion-packs \n") - ); + console.log(chalk.dim('Install with: npx bmad-method install --full --expansion-packs \n')); } async showStatus() { const installDir = await this.findInstallation(); if (!installDir) { - console.log( - chalk.yellow("No BMad installation found in current directory tree") - ); + console.log(chalk.yellow('No BMad installation found in current directory tree')); return; } const manifest = await fileManager.readManifest(installDir); if (!manifest) { - console.log(chalk.red("Invalid installation - manifest not found")); + console.log(chalk.red('Invalid installation - manifest not found')); return; } - console.log(chalk.bold("\nBMad Installation Status:\n")); + console.log(chalk.bold('\nBMad Installation Status:\n')); console.log(` Directory: ${installDir}`); console.log(` Version: ${manifest.version}`); - console.log( - ` Installed: ${new Date( - manifest.installed_at - ).toLocaleDateString()}` - ); + console.log(` Installed: ${new Date(manifest.installed_at).toLocaleDateString()}`); console.log(` Type: ${manifest.install_type}`); if (manifest.agent) { @@ -1010,15 +1036,12 @@ class Installer { console.log(` Total Files: ${manifest.files.length}`); // Check for modifications - const modifiedFiles = await fileManager.checkModifiedFiles( - installDir, - manifest - ); + const modifiedFiles = await fileManager.checkModifiedFiles(installDir, manifest); if (modifiedFiles.length > 0) { console.log(chalk.yellow(` Modified Files: ${modifiedFiles.length}`)); } - console.log(""); + console.log(''); } async getAvailableAgents() { @@ -1042,34 +1065,35 @@ class Installer { for (const packId of selectedPacks) { spinner.text = `Installing expansion pack: ${packId}...`; - + try { const expansionPacks = await resourceLocator.getExpansionPacks(); - const pack = expansionPacks.find(p => p.id === packId); - + const pack = expansionPacks.find((p) => p.id === packId); + if (!pack) { console.warn(`Expansion pack ${packId} not found, skipping...`); continue; } - + // Check if expansion pack already exists let expansionDotFolder = path.join(installDir, `.${packId}`); const existingManifestPath = path.join(expansionDotFolder, 'install-manifest.yaml'); - + if (await fileManager.pathExists(existingManifestPath)) { spinner.stop(); const existingManifest = await fileManager.readExpansionPackManifest(installDir, packId); - + console.log(chalk.yellow(`\n🔍 Found existing ${pack.name} installation`)); console.log(` Current version: ${existingManifest.version || 'unknown'}`); console.log(` New version: ${pack.version}`); - + // Check integrity of existing expansion pack const packIntegrity = await fileManager.checkFileIntegrity(installDir, existingManifest); - const hasPackIntegrityIssues = packIntegrity.missing.length > 0 || packIntegrity.modified.length > 0; - + const hasPackIntegrityIssues = + packIntegrity.missing.length > 0 || packIntegrity.modified.length > 0; + if (hasPackIntegrityIssues) { - console.log(chalk.red(" ⚠️ Installation issues detected:")); + console.log(chalk.red(' ⚠️ Installation issues detected:')); if (packIntegrity.missing.length > 0) { console.log(chalk.red(` Missing files: ${packIntegrity.missing.length}`)); } @@ -1077,12 +1101,15 @@ class Installer { console.log(chalk.yellow(` Modified files: ${packIntegrity.modified.length}`)); } } - - const versionCompare = this.compareVersions(existingManifest.version || '0.0.0', pack.version); - + + const versionCompare = this.compareVersions( + existingManifest.version || '0.0.0', + pack.version, + ); + if (versionCompare === 0) { console.log(chalk.yellow(' ⚠️ Same version already installed')); - + const choices = []; if (hasPackIntegrityIssues) { choices.push({ name: 'Repair (restore missing/modified files)', value: 'repair' }); @@ -1090,75 +1117,92 @@ class Installer { choices.push( { name: 'Force reinstall (overwrite)', value: 'overwrite' }, { name: 'Skip this expansion pack', value: 'skip' }, - { name: 'Cancel installation', value: 'cancel' } + { name: 'Cancel installation', value: 'cancel' }, ); - - const { action } = await inquirer.prompt([{ - type: 'list', - name: 'action', - message: `${pack.name} v${pack.version} is already installed. What would you like to do?`, - choices: choices - }]); - - if (action === 'skip') { - spinner.start(); - continue; - } else if (action === 'cancel') { + + const { action } = await inquirer.prompt([ + { + type: 'list', + name: 'action', + message: `${pack.name} v${pack.version} is already installed. What would you like to do?`, + choices: choices, + }, + ]); + + switch (action) { + case 'skip': { + spinner.start(); + continue; + + break; + } + case 'cancel': { console.log('Installation cancelled.'); - process.exit(0); - } else if (action === 'repair') { - // Repair the expansion pack - await this.repairExpansionPack(installDir, packId, pack, packIntegrity, spinner); - continue; + process.exit(0); + + break; + } + case 'repair': { + // Repair the expansion pack + await this.repairExpansionPack(installDir, packId, pack, packIntegrity, spinner); + continue; + + break; + } + // No default } } else if (versionCompare < 0) { console.log(chalk.cyan(' ⬆️ Upgrade available')); - - const { proceed } = await inquirer.prompt([{ - type: 'confirm', - name: 'proceed', - message: `Upgrade ${pack.name} from v${existingManifest.version} to v${pack.version}?`, - default: true - }]); - + + const { proceed } = await inquirer.prompt([ + { + type: 'confirm', + name: 'proceed', + message: `Upgrade ${pack.name} from v${existingManifest.version} to v${pack.version}?`, + default: true, + }, + ]); + if (!proceed) { spinner.start(); continue; } } else { console.log(chalk.yellow(' ⬇️ Installed version is newer than available version')); - - const { action } = await inquirer.prompt([{ - type: 'list', - name: 'action', - message: 'What would you like to do?', - choices: [ - { name: 'Keep current version', value: 'skip' }, - { name: 'Downgrade to available version', value: 'downgrade' }, - { name: 'Cancel installation', value: 'cancel' } - ] - }]); - + + const { action } = await inquirer.prompt([ + { + type: 'list', + name: 'action', + message: 'What would you like to do?', + choices: [ + { name: 'Keep current version', value: 'skip' }, + { name: 'Downgrade to available version', value: 'downgrade' }, + { name: 'Cancel installation', value: 'cancel' }, + ], + }, + ]); + if (action === 'skip') { spinner.start(); continue; } else if (action === 'cancel') { - console.log('Installation cancelled.'); + console.log('Installation cancelled.'); process.exit(0); } } - + // If we get here, we're proceeding with installation spinner.start(`Removing old ${pack.name} installation...`); await fileManager.removeDirectory(expansionDotFolder); } const expansionPackDir = pack.path; - + // Ensure dedicated dot folder exists for this expansion pack expansionDotFolder = path.join(installDir, `.${packId}`); await fileManager.ensureDirectory(expansionDotFolder); - + // Define the folders to copy from expansion packs const foldersToSync = [ 'agents', @@ -1169,35 +1213,34 @@ class Installer { 'workflows', 'data', 'utils', - 'schemas' + 'schemas', ]; // Copy each folder if it exists for (const folder of foldersToSync) { const sourceFolder = path.join(expansionPackDir, folder); - + // Check if folder exists in expansion pack if (await fileManager.pathExists(sourceFolder)) { // Get all files in this folder const files = await resourceLocator.findFiles('**/*', { cwd: sourceFolder, - nodir: true + nodir: true, }); // Copy each file to the expansion pack's dot folder with {root} replacement for (const file of files) { const sourcePath = path.join(sourceFolder, file); - const destPath = path.join(expansionDotFolder, folder, file); - - const needsRootReplacement = file.endsWith('.md') || file.endsWith('.yaml') || file.endsWith('.yml'); + const destinationPath = path.join(expansionDotFolder, folder, file); + + const needsRootReplacement = + file.endsWith('.md') || file.endsWith('.yaml') || file.endsWith('.yml'); let success = false; - - if (needsRootReplacement) { - success = await fileManager.copyFileWithRootReplacement(sourcePath, destPath, `.${packId}`); - } else { - success = await fileManager.copyFile(sourcePath, destPath); - } - + + success = await (needsRootReplacement + ? fileManager.copyFileWithRootReplacement(sourcePath, destinationPath, `.${packId}`) + : fileManager.copyFile(sourcePath, destinationPath)); + if (success) { installedFiles.push(path.join(`.${packId}`, folder, file)); } @@ -1208,17 +1251,29 @@ class Installer { // Copy config.yaml with {root} replacement const configPath = path.join(expansionPackDir, 'config.yaml'); if (await fileManager.pathExists(configPath)) { - const configDestPath = path.join(expansionDotFolder, 'config.yaml'); - if (await fileManager.copyFileWithRootReplacement(configPath, configDestPath, `.${packId}`)) { + const configDestinationPath = path.join(expansionDotFolder, 'config.yaml'); + if ( + await fileManager.copyFileWithRootReplacement( + configPath, + configDestinationPath, + `.${packId}`, + ) + ) { installedFiles.push(path.join(`.${packId}`, 'config.yaml')); } } - + // Copy README if it exists with {root} replacement const readmePath = path.join(expansionPackDir, 'README.md'); if (await fileManager.pathExists(readmePath)) { - const readmeDestPath = path.join(expansionDotFolder, 'README.md'); - if (await fileManager.copyFileWithRootReplacement(readmePath, readmeDestPath, `.${packId}`)) { + const readmeDestinationPath = path.join(expansionDotFolder, 'README.md'); + if ( + await fileManager.copyFileWithRootReplacement( + readmePath, + readmeDestinationPath, + `.${packId}`, + ) + ) { installedFiles.push(path.join(`.${packId}`, 'README.md')); } } @@ -1226,10 +1281,16 @@ class Installer { // Copy common/ items to expansion pack folder spinner.text = `Copying common utilities to ${packId}...`; await this.copyCommonItems(installDir, `.${packId}`, spinner); - + // Check and resolve core dependencies - await this.resolveExpansionPackCoreDependencies(installDir, expansionDotFolder, packId, pack, spinner); - + await this.resolveExpansionPackCoreDependencies( + installDir, + expansionDotFolder, + packId, + pack, + spinner, + ); + // Check and resolve core agents referenced by teams await this.resolveExpansionPackCoreAgents(installDir, expansionDotFolder, packId, spinner); @@ -1240,17 +1301,22 @@ class Installer { expansionPackId: packId, expansionPackName: pack.name, expansionPackVersion: pack.version, - ides: config.ides || [] // Use ides_setup instead of ide_setup + ides: config.ides || [], // Use ides_setup instead of ide_setup }; - + // Get all files installed in this expansion pack const foundFiles = await resourceLocator.findFiles('**/*', { cwd: expansionDotFolder, - nodir: true + nodir: true, }); - const expansionPackFiles = foundFiles.map(f => path.join(`.${packId}`, f)); - - await fileManager.createExpansionPackManifest(installDir, packId, expansionConfig, expansionPackFiles); + const expansionPackFiles = foundFiles.map((f) => path.join(`.${packId}`, f)); + + await fileManager.createExpansionPackManifest( + installDir, + packId, + expansionConfig, + expansionPackFiles, + ); console.log(chalk.green(`✓ Installed expansion pack: ${pack.name} to ${`.${packId}`}`)); } catch (error) { @@ -1262,63 +1328,96 @@ class Installer { return installedFiles; } - async resolveExpansionPackCoreDependencies(installDir, expansionDotFolder, packId, pack, spinner) { + async resolveExpansionPackCoreDependencies( + installDir, + expansionDotFolder, + packId, + pack, + spinner, + ) { const yaml = require('js-yaml'); - const fs = require('fs').promises; - + const fs = require('node:fs').promises; + // Find all agent files in the expansion pack const agentFiles = await resourceLocator.findFiles('agents/*.md', { - cwd: expansionDotFolder + cwd: expansionDotFolder, }); for (const agentFile of agentFiles) { const agentPath = path.join(expansionDotFolder, agentFile); const agentContent = await fs.readFile(agentPath, 'utf8'); - + // Extract YAML frontmatter to check dependencies const yamlContent = extractYamlFromAgent(agentContent); if (yamlContent) { try { const agentConfig = yaml.load(yamlContent); const dependencies = agentConfig.dependencies || {}; - + // Check for core dependencies (those that don't exist in the expansion pack) - for (const depType of ['tasks', 'templates', 'checklists', 'workflows', 'utils', 'data']) { + for (const depType of [ + 'tasks', + 'templates', + 'checklists', + 'workflows', + 'utils', + 'data', + ]) { const deps = dependencies[depType] || []; - + for (const dep of deps) { - const depFileName = dep.endsWith('.md') || dep.endsWith('.yaml') ? dep : - (depType === 'templates' ? `${dep}.yaml` : `${dep}.md`); + const depFileName = + dep.endsWith('.md') || dep.endsWith('.yaml') + ? dep + : depType === 'templates' + ? `${dep}.yaml` + : `${dep}.md`; const expansionDepPath = path.join(expansionDotFolder, depType, depFileName); - + // Check if dependency exists in expansion pack dot folder if (!(await fileManager.pathExists(expansionDepPath))) { // Try to find it in expansion pack source const sourceDepPath = path.join(pack.path, depType, depFileName); - + if (await fileManager.pathExists(sourceDepPath)) { // Copy from expansion pack source spinner.text = `Copying ${packId} dependency ${dep}...`; - const destPath = path.join(expansionDotFolder, depType, depFileName); - await fileManager.copyFileWithRootReplacement(sourceDepPath, destPath, `.${packId}`); + const destinationPath = path.join(expansionDotFolder, depType, depFileName); + await fileManager.copyFileWithRootReplacement( + sourceDepPath, + destinationPath, + `.${packId}`, + ); console.log(chalk.dim(` Added ${packId} dependency: ${depType}/${depFileName}`)); } else { // Try to find it in core - const coreDepPath = path.join(resourceLocator.getBmadCorePath(), depType, depFileName); - - if (await fileManager.pathExists(coreDepPath)) { - spinner.text = `Copying core dependency ${dep} for ${packId}...`; - - // Copy from core to expansion pack dot folder with {root} replacement - const destPath = path.join(expansionDotFolder, depType, depFileName); - await fileManager.copyFileWithRootReplacement(coreDepPath, destPath, `.${packId}`); - - console.log(chalk.dim(` Added core dependency: ${depType}/${depFileName}`)); - } else { - console.warn(chalk.yellow(` Warning: Dependency ${depType}/${dep} not found in core or expansion pack`)); - } + const coreDepPath = path.join( + resourceLocator.getBmadCorePath(), + depType, + depFileName, + ); + + if (await fileManager.pathExists(coreDepPath)) { + spinner.text = `Copying core dependency ${dep} for ${packId}...`; + + // Copy from core to expansion pack dot folder with {root} replacement + const destinationPath = path.join(expansionDotFolder, depType, depFileName); + await fileManager.copyFileWithRootReplacement( + coreDepPath, + destinationPath, + `.${packId}`, + ); + + console.log(chalk.dim(` Added core dependency: ${depType}/${depFileName}`)); + } else { + console.warn( + chalk.yellow( + ` Warning: Dependency ${depType}/${dep} not found in core or expansion pack`, + ), + ); } } + } } } } catch (error) { @@ -1330,17 +1429,17 @@ class Installer { async resolveExpansionPackCoreAgents(installDir, expansionDotFolder, packId, spinner) { const yaml = require('js-yaml'); - const fs = require('fs').promises; - + const fs = require('node:fs').promises; + // Find all team files in the expansion pack const teamFiles = await resourceLocator.findFiles('agent-teams/*.yaml', { - cwd: expansionDotFolder + cwd: expansionDotFolder, }); // Also get existing agents in the expansion pack const existingAgents = new Set(); const agentFiles = await resourceLocator.findFiles('agents/*.md', { - cwd: expansionDotFolder + cwd: expansionDotFolder, }); for (const agentFile of agentFiles) { const agentName = path.basename(agentFile, '.md'); @@ -1351,79 +1450,132 @@ class Installer { for (const teamFile of teamFiles) { const teamPath = path.join(expansionDotFolder, teamFile); const teamContent = await fs.readFile(teamPath, 'utf8'); - + try { const teamConfig = yaml.load(teamContent); const agents = teamConfig.agents || []; - + // Add bmad-orchestrator if not present (required for all teams) if (!agents.includes('bmad-orchestrator')) { agents.unshift('bmad-orchestrator'); } - + // Check each agent in the team for (const agentId of agents) { if (!existingAgents.has(agentId)) { // Agent not in expansion pack, try to get from core - const coreAgentPath = path.join(resourceLocator.getBmadCorePath(), 'agents', `${agentId}.md`); - + const coreAgentPath = path.join( + resourceLocator.getBmadCorePath(), + 'agents', + `${agentId}.md`, + ); + if (await fileManager.pathExists(coreAgentPath)) { spinner.text = `Copying core agent ${agentId} for ${packId}...`; - + // Copy agent file with {root} replacement - const destPath = path.join(expansionDotFolder, 'agents', `${agentId}.md`); - await fileManager.copyFileWithRootReplacement(coreAgentPath, destPath, `.${packId}`); + const destinationPath = path.join(expansionDotFolder, 'agents', `${agentId}.md`); + await fileManager.copyFileWithRootReplacement( + coreAgentPath, + destinationPath, + `.${packId}`, + ); existingAgents.add(agentId); - + console.log(chalk.dim(` Added core agent: ${agentId}`)); - + // Now resolve this agent's dependencies too const agentContent = await fs.readFile(coreAgentPath, 'utf8'); const yamlContent = extractYamlFromAgent(agentContent, true); - + if (yamlContent) { try { - const agentConfig = yaml.load(yamlContent); const dependencies = agentConfig.dependencies || {}; - + // Copy all dependencies for this agent - for (const depType of ['tasks', 'templates', 'checklists', 'workflows', 'utils', 'data']) { + for (const depType of [ + 'tasks', + 'templates', + 'checklists', + 'workflows', + 'utils', + 'data', + ]) { const deps = dependencies[depType] || []; - + for (const dep of deps) { - const depFileName = dep.endsWith('.md') || dep.endsWith('.yaml') ? dep : - (depType === 'templates' ? `${dep}.yaml` : `${dep}.md`); + const depFileName = + dep.endsWith('.md') || dep.endsWith('.yaml') + ? dep + : depType === 'templates' + ? `${dep}.yaml` + : `${dep}.md`; const expansionDepPath = path.join(expansionDotFolder, depType, depFileName); - + // Check if dependency exists in expansion pack if (!(await fileManager.pathExists(expansionDepPath))) { // Try to find it in core - const coreDepPath = path.join(resourceLocator.getBmadCorePath(), depType, depFileName); - + const coreDepPath = path.join( + resourceLocator.getBmadCorePath(), + depType, + depFileName, + ); + if (await fileManager.pathExists(coreDepPath)) { - const destDepPath = path.join(expansionDotFolder, depType, depFileName); - await fileManager.copyFileWithRootReplacement(coreDepPath, destDepPath, `.${packId}`); - console.log(chalk.dim(` Added agent dependency: ${depType}/${depFileName}`)); + const destinationDepPath = path.join( + expansionDotFolder, + depType, + depFileName, + ); + await fileManager.copyFileWithRootReplacement( + coreDepPath, + destinationDepPath, + `.${packId}`, + ); + console.log( + chalk.dim(` Added agent dependency: ${depType}/${depFileName}`), + ); } else { // Try common folder - const sourceBase = path.dirname(path.dirname(path.dirname(path.dirname(__filename)))); // Go up to project root - const commonDepPath = path.join(sourceBase, 'common', depType, depFileName); + const sourceBase = path.dirname( + path.dirname(path.dirname(path.dirname(__filename))), + ); // Go up to project root + const commonDepPath = path.join( + sourceBase, + 'common', + depType, + depFileName, + ); if (await fileManager.pathExists(commonDepPath)) { - const destDepPath = path.join(expansionDotFolder, depType, depFileName); - await fileManager.copyFile(commonDepPath, destDepPath); - console.log(chalk.dim(` Added agent dependency from common: ${depType}/${depFileName}`)); + const destinationDepPath = path.join( + expansionDotFolder, + depType, + depFileName, + ); + await fileManager.copyFile(commonDepPath, destinationDepPath); + console.log( + chalk.dim( + ` Added agent dependency from common: ${depType}/${depFileName}`, + ), + ); } } } } } } catch (error) { - console.warn(` Warning: Could not parse agent ${agentId} dependencies: ${error.message}`); + console.warn( + ` Warning: Could not parse agent ${agentId} dependencies: ${error.message}`, + ); } } } else { - console.warn(chalk.yellow(` Warning: Core agent ${agentId} not found for team ${path.basename(teamFile, '.yaml')}`)); + console.warn( + chalk.yellow( + ` Warning: Core agent ${agentId} not found for team ${path.basename(teamFile, '.yaml')}`, + ), + ); } } } @@ -1435,16 +1587,19 @@ class Installer { getWebBundleInfo(config) { const webBundleType = config.webBundleType || 'all'; - + switch (webBundleType) { - case 'all': + case 'all': { return 'all bundles'; - case 'agents': + } + case 'agents': { return 'individual agents only'; - case 'teams': - return config.selectedWebBundleTeams ? - `teams: ${config.selectedWebBundleTeams.join(', ')}` : - 'selected teams'; + } + case 'teams': { + return config.selectedWebBundleTeams + ? `teams: ${config.selectedWebBundleTeams.join(', ')}` + : 'selected teams'; + } case 'custom': { const parts = []; if (config.selectedWebBundleTeams && config.selectedWebBundleTeams.length > 0) { @@ -1455,17 +1610,17 @@ class Installer { } return parts.length > 0 ? parts.join(' + ') : 'custom selection'; } - default: + default: { return 'selected bundles'; + } } } async installWebBundles(webBundlesDirectory, config, spinner) { - try { // Find the dist directory in the BMad installation const distDir = configLoader.getDistPath(); - + if (!(await fileManager.pathExists(distDir))) { console.warn('Web bundles not found. Run "npm run build" to generate them.'); return; @@ -1473,18 +1628,21 @@ class Installer { // Ensure web bundles directory exists await fileManager.ensureDirectory(webBundlesDirectory); - + const webBundleType = config.webBundleType || 'all'; - + if (webBundleType === 'all') { // Copy the entire dist directory structure await fileManager.copyDirectory(distDir, webBundlesDirectory); console.log(chalk.green(`✓ Installed all web bundles to: ${webBundlesDirectory}`)); } else { let copiedCount = 0; - + // Copy specific selections based on type - if (webBundleType === 'agents' || (webBundleType === 'custom' && config.includeIndividualAgents)) { + if ( + webBundleType === 'agents' || + (webBundleType === 'custom' && config.includeIndividualAgents) + ) { const agentsSource = path.join(distDir, 'agents'); const agentsTarget = path.join(webBundlesDirectory, 'agents'); if (await fileManager.pathExists(agentsSource)) { @@ -1493,27 +1651,29 @@ class Installer { copiedCount += 10; // Approximate count for agents } } - - if (webBundleType === 'teams' || webBundleType === 'custom') { - if (config.selectedWebBundleTeams && config.selectedWebBundleTeams.length > 0) { - const teamsSource = path.join(distDir, 'teams'); - const teamsTarget = path.join(webBundlesDirectory, 'teams'); - await fileManager.ensureDirectory(teamsTarget); - - for (const teamId of config.selectedWebBundleTeams) { - const teamFile = `${teamId}.txt`; - const sourcePath = path.join(teamsSource, teamFile); - const targetPath = path.join(teamsTarget, teamFile); - - if (await fileManager.pathExists(sourcePath)) { - await fileManager.copyFile(sourcePath, targetPath); - copiedCount++; - console.log(chalk.green(`✓ Copied team bundle: ${teamId}`)); - } + + if ( + (webBundleType === 'teams' || webBundleType === 'custom') && + config.selectedWebBundleTeams && + config.selectedWebBundleTeams.length > 0 + ) { + const teamsSource = path.join(distDir, 'teams'); + const teamsTarget = path.join(webBundlesDirectory, 'teams'); + await fileManager.ensureDirectory(teamsTarget); + + for (const teamId of config.selectedWebBundleTeams) { + const teamFile = `${teamId}.txt`; + const sourcePath = path.join(teamsSource, teamFile); + const targetPath = path.join(teamsTarget, teamFile); + + if (await fileManager.pathExists(sourcePath)) { + await fileManager.copyFile(sourcePath, targetPath); + copiedCount++; + console.log(chalk.green(`✓ Copied team bundle: ${teamId}`)); } } } - + // Always copy expansion packs if they exist const expansionSource = path.join(distDir, 'expansion-packs'); const expansionTarget = path.join(webBundlesDirectory, 'expansion-packs'); @@ -1521,8 +1681,10 @@ class Installer { await fileManager.copyDirectory(expansionSource, expansionTarget); console.log(chalk.green(`✓ Copied expansion pack bundles`)); } - - console.log(chalk.green(`✓ Installed ${copiedCount} selected web bundles to: ${webBundlesDirectory}`)); + + console.log( + chalk.green(`✓ Installed ${copiedCount} selected web bundles to: ${webBundlesDirectory}`), + ); } } catch (error) { console.error(`Failed to install web bundles: ${error.message}`); @@ -1530,89 +1692,88 @@ class Installer { } async copyCommonItems(installDir, targetSubdir, spinner) { - - const fs = require('fs').promises; + const fs = require('node:fs').promises; const sourceBase = path.dirname(path.dirname(path.dirname(path.dirname(__filename)))); // Go up to project root const commonPath = path.join(sourceBase, 'common'); const targetPath = path.join(installDir, targetSubdir); const copiedFiles = []; - + // Check if common/ exists if (!(await fileManager.pathExists(commonPath))) { console.warn('Warning: common/ folder not found'); return copiedFiles; } - + // Copy all items from common/ to target const commonItems = await resourceLocator.findFiles('**/*', { cwd: commonPath, - nodir: true + nodir: true, }); - + for (const item of commonItems) { const sourcePath = path.join(commonPath, item); - const destPath = path.join(targetPath, item); - + const destinationPath = path.join(targetPath, item); + // Read the file content const content = await fs.readFile(sourcePath, 'utf8'); - + // Replace {root} with the target subdirectory - const updatedContent = content.replace(/\{root\}/g, targetSubdir); - + const updatedContent = content.replaceAll('{root}', targetSubdir); + // Ensure directory exists - await fileManager.ensureDirectory(path.dirname(destPath)); - + await fileManager.ensureDirectory(path.dirname(destinationPath)); + // Write the updated content - await fs.writeFile(destPath, updatedContent, 'utf8'); + await fs.writeFile(destinationPath, updatedContent, 'utf8'); copiedFiles.push(path.join(targetSubdir, item)); } - + console.log(chalk.dim(` Added ${commonItems.length} common utilities`)); return copiedFiles; } async copyDocsItems(installDir, targetSubdir, spinner) { - const fs = require('fs').promises; + const fs = require('node:fs').promises; const sourceBase = path.dirname(path.dirname(path.dirname(path.dirname(__filename)))); // Go up to project root const docsPath = path.join(sourceBase, 'docs'); const targetPath = path.join(installDir, targetSubdir); const copiedFiles = []; - + // Specific documentation files to copy - const docFiles = [ + const documentFiles = [ 'enhanced-ide-development-workflow.md', 'user-guide.md', - 'working-in-the-brownfield.md' + 'working-in-the-brownfield.md', ]; - + // Check if docs/ exists if (!(await fileManager.pathExists(docsPath))) { console.warn('Warning: docs/ folder not found'); return copiedFiles; } - + // Copy specific documentation files from docs/ to target - for (const docFile of docFiles) { - const sourcePath = path.join(docsPath, docFile); - const destPath = path.join(targetPath, docFile); - + for (const documentFile of documentFiles) { + const sourcePath = path.join(docsPath, documentFile); + const destinationPath = path.join(targetPath, documentFile); + // Check if the source file exists if (await fileManager.pathExists(sourcePath)) { // Read the file content const content = await fs.readFile(sourcePath, 'utf8'); - + // Replace {root} with the target subdirectory - const updatedContent = content.replace(/\{root\}/g, targetSubdir); - + const updatedContent = content.replaceAll('{root}', targetSubdir); + // Ensure directory exists - await fileManager.ensureDirectory(path.dirname(destPath)); - + await fileManager.ensureDirectory(path.dirname(destinationPath)); + // Write the updated content - await fs.writeFile(destPath, updatedContent, 'utf8'); - copiedFiles.push(path.join(targetSubdir, docFile)); + await fs.writeFile(destinationPath, updatedContent, 'utf8'); + copiedFiles.push(path.join(targetSubdir, documentFile)); } } - + if (copiedFiles.length > 0) { console.log(chalk.dim(` Added ${copiedFiles.length} documentation files`)); } @@ -1621,56 +1782,56 @@ class Installer { async detectExpansionPacks(installDir) { const expansionPacks = {}; - const glob = require("glob"); - + const glob = require('glob'); + // Find all dot folders that might be expansion packs - const dotFolders = glob.sync(".*", { + const dotFolders = glob.sync('.*', { cwd: installDir, - ignore: [".git", ".git/**", ".bmad-core", ".bmad-core/**"], + ignore: ['.git', '.git/**', '.bmad-core', '.bmad-core/**'], }); - + for (const folder of dotFolders) { const folderPath = path.join(installDir, folder); const stats = await fileManager.pathExists(folderPath); - + if (stats) { // Check if it has a manifest - const manifestPath = path.join(folderPath, "install-manifest.yaml"); + const manifestPath = path.join(folderPath, 'install-manifest.yaml'); if (await fileManager.pathExists(manifestPath)) { - const manifest = await fileManager.readExpansionPackManifest(installDir, folder.substring(1)); + const manifest = await fileManager.readExpansionPackManifest(installDir, folder.slice(1)); if (manifest) { - expansionPacks[folder.substring(1)] = { + expansionPacks[folder.slice(1)] = { path: folderPath, manifest: manifest, - hasManifest: true + hasManifest: true, }; } } else { // Check if it has a config.yaml (expansion pack without manifest) - const configPath = path.join(folderPath, "config.yaml"); + const configPath = path.join(folderPath, 'config.yaml'); if (await fileManager.pathExists(configPath)) { - expansionPacks[folder.substring(1)] = { + expansionPacks[folder.slice(1)] = { path: folderPath, manifest: null, - hasManifest: false + hasManifest: false, }; } } } } - + return expansionPacks; } async repairExpansionPack(installDir, packId, pack, integrity, spinner) { spinner.start(`Repairing ${pack.name}...`); - + try { const expansionDotFolder = path.join(installDir, `.${packId}`); - + // Back up modified files if (integrity.modified.length > 0) { - spinner.text = "Backing up modified files..."; + spinner.text = 'Backing up modified files...'; for (const file of integrity.modified) { const filePath = path.join(installDir, file); if (await fileManager.pathExists(filePath)) { @@ -1679,51 +1840,52 @@ class Installer { } } } - + // Restore missing and modified files - spinner.text = "Restoring files..."; + spinner.text = 'Restoring files...'; const filesToRestore = [...integrity.missing, ...integrity.modified]; - + for (const file of filesToRestore) { // Skip the manifest file itself if (file.endsWith('install-manifest.yaml')) continue; - + const relativePath = file.replace(`.${packId}/`, ''); const sourcePath = path.join(pack.path, relativePath); - const destPath = path.join(installDir, file); - + const destinationPath = path.join(installDir, file); + // Check if this is a common/ file that needs special processing const commonBase = path.dirname(path.dirname(path.dirname(path.dirname(__filename)))); const commonSourcePath = path.join(commonBase, 'common', relativePath); - + if (await fileManager.pathExists(commonSourcePath)) { // This is a common/ file - needs template processing - const fs = require('fs').promises; + const fs = require('node:fs').promises; const content = await fs.readFile(commonSourcePath, 'utf8'); - const updatedContent = content.replace(/\{root\}/g, `.${packId}`); - await fileManager.ensureDirectory(path.dirname(destPath)); - await fs.writeFile(destPath, updatedContent, 'utf8'); + const updatedContent = content.replaceAll('{root}', `.${packId}`); + await fileManager.ensureDirectory(path.dirname(destinationPath)); + await fs.writeFile(destinationPath, updatedContent, 'utf8'); spinner.text = `Restored: ${file}`; } else if (await fileManager.pathExists(sourcePath)) { // Regular file from expansion pack - await fileManager.copyFile(sourcePath, destPath); + await fileManager.copyFile(sourcePath, destinationPath); spinner.text = `Restored: ${file}`; } else { console.warn(chalk.yellow(` Warning: Source file not found: ${file}`)); } } - + spinner.succeed(`${pack.name} repaired successfully!`); - + // Show summary console.log(chalk.green(`\n✓ ${pack.name} repaired!`)); if (integrity.missing.length > 0) { console.log(chalk.green(` Restored ${integrity.missing.length} missing files`)); } if (integrity.modified.length > 0) { - console.log(chalk.green(` Restored ${integrity.modified.length} modified files (backups created)`)); + console.log( + chalk.green(` Restored ${integrity.modified.length} modified files (backups created)`), + ); } - } catch (error) { if (spinner) spinner.fail(`Failed to repair ${pack.name}`); console.error(`Error: ${error.message}`); @@ -1734,37 +1896,37 @@ class Installer { // Simple semver comparison const parts1 = v1.split('.').map(Number); const parts2 = v2.split('.').map(Number); - - for (let i = 0; i < 3; i++) { - const part1 = parts1[i] || 0; - const part2 = parts2[i] || 0; - + + for (let index = 0; index < 3; index++) { + const part1 = parts1[index] || 0; + const part2 = parts2[index] || 0; + if (part1 > part2) return 1; if (part1 < part2) return -1; } - + return 0; } async cleanupLegacyYmlFiles(installDir, spinner) { const glob = require('glob'); - const fs = require('fs').promises; - + const fs = require('node:fs').promises; + try { // Find all .yml files in the installation directory const ymlFiles = glob.sync('**/*.yml', { cwd: installDir, - ignore: ['**/node_modules/**', '**/.git/**'] + ignore: ['**/node_modules/**', '**/.git/**'], }); - + let deletedCount = 0; - + for (const ymlFile of ymlFiles) { // Check if corresponding .yaml file exists const yamlFile = ymlFile.replace(/\.yml$/, '.yaml'); const ymlPath = path.join(installDir, ymlFile); const yamlPath = path.join(installDir, yamlFile); - + if (await fileManager.pathExists(yamlPath)) { // .yaml counterpart exists, delete the .yml file await fs.unlink(ymlPath); @@ -1772,11 +1934,10 @@ class Installer { console.log(chalk.dim(` Removed legacy: ${ymlFile} (replaced by ${yamlFile})`)); } } - + if (deletedCount > 0) { console.log(chalk.green(`✓ Cleaned up ${deletedCount} legacy .yml files`)); } - } catch (error) { console.warn(`Warning: Could not cleanup legacy .yml files: ${error.message}`); } @@ -1787,8 +1948,8 @@ class Installer { let currentDir = process.cwd(); while (currentDir !== path.dirname(currentDir)) { - const bmadDir = path.join(currentDir, ".bmad-core"); - const manifestPath = path.join(bmadDir, "install-manifest.yaml"); + const bmadDir = path.join(currentDir, '.bmad-core'); + const manifestPath = path.join(bmadDir, 'install-manifest.yaml'); if (await fileManager.pathExists(manifestPath)) { return currentDir; // Return parent directory, not .bmad-core itself @@ -1798,8 +1959,8 @@ class Installer { } // Also check if we're inside a .bmad-core directory - if (path.basename(process.cwd()) === ".bmad-core") { - const manifestPath = path.join(process.cwd(), "install-manifest.yaml"); + if (path.basename(process.cwd()) === '.bmad-core') { + const manifestPath = path.join(process.cwd(), 'install-manifest.yaml'); if (await fileManager.pathExists(manifestPath)) { return path.dirname(process.cwd()); // Return parent directory } @@ -1809,22 +1970,22 @@ class Installer { } async flatten(options) { - const { spawn } = require('child_process'); + const { spawn } = require('node:child_process'); const flattenerPath = path.join(__dirname, '..', '..', 'flattener', 'main.js'); - - const args = []; + + const arguments_ = []; if (options.input) { - args.push('--input', options.input); + arguments_.push('--input', options.input); } if (options.output) { - args.push('--output', options.output); + arguments_.push('--output', options.output); } - - const child = spawn('node', [flattenerPath, ...args], { + + const child = spawn('node', [flattenerPath, ...arguments_], { stdio: 'inherit', - cwd: process.cwd() + cwd: process.cwd(), }); - + child.on('exit', (code) => { process.exit(code); }); diff --git a/tools/installer/lib/memory-profiler.js b/tools/installer/lib/memory-profiler.js index d1db3d87..045273f0 100644 --- a/tools/installer/lib/memory-profiler.js +++ b/tools/installer/lib/memory-profiler.js @@ -3,7 +3,7 @@ * Helps identify memory leaks and optimize resource usage */ -const v8 = require('v8'); +const v8 = require('node:v8'); class MemoryProfiler { constructor() { @@ -19,7 +19,7 @@ class MemoryProfiler { checkpoint(label) { const memUsage = process.memoryUsage(); const heapStats = v8.getHeapStatistics(); - + const checkpoint = { label, timestamp: Date.now() - this.startTime, @@ -28,18 +28,18 @@ class MemoryProfiler { heapTotal: this.formatBytes(memUsage.heapTotal), heapUsed: this.formatBytes(memUsage.heapUsed), external: this.formatBytes(memUsage.external), - arrayBuffers: this.formatBytes(memUsage.arrayBuffers || 0) + arrayBuffers: this.formatBytes(memUsage.arrayBuffers || 0), }, heap: { totalHeapSize: this.formatBytes(heapStats.total_heap_size), usedHeapSize: this.formatBytes(heapStats.used_heap_size), heapSizeLimit: this.formatBytes(heapStats.heap_size_limit), mallocedMemory: this.formatBytes(heapStats.malloced_memory), - externalMemory: this.formatBytes(heapStats.external_memory) + externalMemory: this.formatBytes(heapStats.external_memory), }, raw: { - heapUsed: memUsage.heapUsed - } + heapUsed: memUsage.heapUsed, + }, }; // Track peak memory @@ -55,8 +55,8 @@ class MemoryProfiler { * Force garbage collection (requires --expose-gc flag) */ forceGC() { - if (global.gc) { - global.gc(); + if (globalThis.gc) { + globalThis.gc(); return true; } return false; @@ -67,16 +67,16 @@ class MemoryProfiler { */ getSummary() { const currentMemory = process.memoryUsage(); - + return { currentUsage: { rss: this.formatBytes(currentMemory.rss), heapTotal: this.formatBytes(currentMemory.heapTotal), - heapUsed: this.formatBytes(currentMemory.heapUsed) + heapUsed: this.formatBytes(currentMemory.heapUsed), }, peakMemory: this.formatBytes(this.peakMemory), totalCheckpoints: this.checkpoints.length, - runTime: `${((Date.now() - this.startTime) / 1000).toFixed(2)}s` + runTime: `${((Date.now() - this.startTime) / 1000).toFixed(2)}s`, }; } @@ -86,12 +86,12 @@ class MemoryProfiler { getDetailedReport() { const summary = this.getSummary(); const memoryGrowth = this.calculateMemoryGrowth(); - + return { summary, memoryGrowth, checkpoints: this.checkpoints, - recommendations: this.getRecommendations(memoryGrowth) + recommendations: this.getRecommendations(memoryGrowth), }; } @@ -100,23 +100,23 @@ class MemoryProfiler { */ calculateMemoryGrowth() { if (this.checkpoints.length < 2) return []; - + const growth = []; - for (let i = 1; i < this.checkpoints.length; i++) { - const prev = this.checkpoints[i - 1]; - const curr = this.checkpoints[i]; - - const heapDiff = curr.raw.heapUsed - prev.raw.heapUsed; - + for (let index = 1; index < this.checkpoints.length; index++) { + const previous = this.checkpoints[index - 1]; + const current = this.checkpoints[index]; + + const heapDiff = current.raw.heapUsed - previous.raw.heapUsed; + growth.push({ - from: prev.label, - to: curr.label, + from: previous.label, + to: current.label, heapGrowth: this.formatBytes(Math.abs(heapDiff)), isIncrease: heapDiff > 0, - timeDiff: `${((curr.timestamp - prev.timestamp) / 1000).toFixed(2)}s` + timeDiff: `${((current.timestamp - previous.timestamp) / 1000).toFixed(2)}s`, }); } - + return growth; } @@ -125,40 +125,41 @@ class MemoryProfiler { */ getRecommendations(memoryGrowth) { const recommendations = []; - + // Check for large memory growth - const largeGrowths = memoryGrowth.filter(g => { + const largeGrowths = memoryGrowth.filter((g) => { const bytes = this.parseBytes(g.heapGrowth); return bytes > 50 * 1024 * 1024; // 50MB }); - + if (largeGrowths.length > 0) { recommendations.push({ type: 'warning', message: `Large memory growth detected in ${largeGrowths.length} operations`, - details: largeGrowths.map(g => `${g.from} → ${g.to}: ${g.heapGrowth}`) + details: largeGrowths.map((g) => `${g.from} → ${g.to}: ${g.heapGrowth}`), }); } - + // Check peak memory - if (this.peakMemory > 500 * 1024 * 1024) { // 500MB + if (this.peakMemory > 500 * 1024 * 1024) { + // 500MB recommendations.push({ type: 'warning', message: `High peak memory usage: ${this.formatBytes(this.peakMemory)}`, - suggestion: 'Consider processing files in smaller batches' + suggestion: 'Consider processing files in smaller batches', }); } - + // Check for potential memory leaks const continuousGrowth = this.checkContinuousGrowth(); if (continuousGrowth) { recommendations.push({ type: 'error', message: 'Potential memory leak detected', - details: 'Memory usage continuously increases without significant decreases' + details: 'Memory usage continuously increases without significant decreases', }); } - + return recommendations; } @@ -167,14 +168,14 @@ class MemoryProfiler { */ checkContinuousGrowth() { if (this.checkpoints.length < 5) return false; - + let increasingCount = 0; - for (let i = 1; i < this.checkpoints.length; i++) { - if (this.checkpoints[i].raw.heapUsed > this.checkpoints[i - 1].raw.heapUsed) { + for (let index = 1; index < this.checkpoints.length; index++) { + if (this.checkpoints[index].raw.heapUsed > this.checkpoints[index - 1].raw.heapUsed) { increasingCount++; } } - + // If memory increases in more than 80% of checkpoints, might be a leak return increasingCount / (this.checkpoints.length - 1) > 0.8; } @@ -184,31 +185,31 @@ class MemoryProfiler { */ formatBytes(bytes) { if (bytes === 0) return '0 B'; - + const k = 1024; const sizes = ['B', 'KB', 'MB', 'GB']; - const i = Math.floor(Math.log(bytes) / Math.log(k)); - - return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; + const index = Math.floor(Math.log(bytes) / Math.log(k)); + + return Number.parseFloat((bytes / Math.pow(k, index)).toFixed(2)) + ' ' + sizes[index]; } /** * Parse human-readable bytes back to number */ - parseBytes(str) { - const match = str.match(/^([\d.]+)\s*([KMGT]?B?)$/i); + parseBytes(string_) { + const match = string_.match(/^([\d.]+)\s*([KMGT]?B?)$/i); if (!match) return 0; - - const value = parseFloat(match[1]); + + const value = Number.parseFloat(match[1]); const unit = match[2].toUpperCase(); - + const multipliers = { - 'B': 1, - 'KB': 1024, - 'MB': 1024 * 1024, - 'GB': 1024 * 1024 * 1024 + B: 1, + KB: 1024, + MB: 1024 * 1024, + GB: 1024 * 1024 * 1024, }; - + return value * (multipliers[unit] || 1); } @@ -221,4 +222,4 @@ class MemoryProfiler { } // Export singleton instance -module.exports = new MemoryProfiler(); \ No newline at end of file +module.exports = new MemoryProfiler(); diff --git a/tools/installer/lib/module-manager.js b/tools/installer/lib/module-manager.js index d90ff7a5..ff829b44 100644 --- a/tools/installer/lib/module-manager.js +++ b/tools/installer/lib/module-manager.js @@ -17,13 +17,13 @@ class ModuleManager { const modules = await Promise.all([ this.getModule('chalk'), this.getModule('ora'), - this.getModule('inquirer') + this.getModule('inquirer'), ]); return { chalk: modules[0], ora: modules[1], - inquirer: modules[2] + inquirer: modules[2], }; } @@ -64,18 +64,24 @@ class ModuleManager { */ async _loadModule(moduleName) { switch (moduleName) { - case 'chalk': + case 'chalk': { return (await import('chalk')).default; - case 'ora': + } + case 'ora': { return (await import('ora')).default; - case 'inquirer': + } + case 'inquirer': { return (await import('inquirer')).default; - case 'glob': + } + case 'glob': { return (await import('glob')).glob; - case 'globSync': + } + case 'globSync': { return (await import('glob')).globSync; - default: + } + default: { throw new Error(`Unknown module: ${moduleName}`); + } } } @@ -93,13 +99,11 @@ class ModuleManager { * @returns {Promise} Object with module names as keys */ async getModules(moduleNames) { - const modules = await Promise.all( - moduleNames.map(name => this.getModule(name)) - ); + const modules = await Promise.all(moduleNames.map((name) => this.getModule(name))); - return moduleNames.reduce((acc, name, index) => { - acc[name] = modules[index]; - return acc; + return moduleNames.reduce((accumulator, name, index) => { + accumulator[name] = modules[index]; + return accumulator; }, {}); } } @@ -107,4 +111,4 @@ class ModuleManager { // Singleton instance const moduleManager = new ModuleManager(); -module.exports = moduleManager; \ No newline at end of file +module.exports = moduleManager; diff --git a/tools/installer/lib/resource-locator.js b/tools/installer/lib/resource-locator.js index 8aa86ed1..b52651ce 100644 --- a/tools/installer/lib/resource-locator.js +++ b/tools/installer/lib/resource-locator.js @@ -43,18 +43,18 @@ class ResourceLocator { */ async findFiles(pattern, options = {}) { const cacheKey = `${pattern}:${JSON.stringify(options)}`; - + if (this._globCache.has(cacheKey)) { return this._globCache.get(cacheKey); } const { glob } = await moduleManager.getModules(['glob']); const files = await glob(pattern, options); - + // Cache for 5 minutes this._globCache.set(cacheKey, files); setTimeout(() => this._globCache.delete(cacheKey), 5 * 60 * 1000); - + return files; } @@ -65,7 +65,7 @@ class ResourceLocator { */ async getAgentPath(agentId) { const cacheKey = `agent:${agentId}`; - + if (this._pathCache.has(cacheKey)) { return this._pathCache.get(cacheKey); } @@ -96,7 +96,7 @@ class ResourceLocator { */ async getAvailableAgents() { const cacheKey = 'all-agents'; - + if (this._pathCache.has(cacheKey)) { return this._pathCache.get(cacheKey); } @@ -107,14 +107,11 @@ class ResourceLocator { // Get agents from bmad-core const coreAgents = await this.findFiles('agents/*.md', { - cwd: this.getBmadCorePath() + cwd: this.getBmadCorePath(), }); for (const agentFile of coreAgents) { - const content = await fs.readFile( - path.join(this.getBmadCorePath(), agentFile), - 'utf8' - ); + const content = await fs.readFile(path.join(this.getBmadCorePath(), agentFile), 'utf8'); const yamlContent = extractYamlFromAgent(content); if (yamlContent) { try { @@ -123,9 +120,9 @@ class ResourceLocator { id: path.basename(agentFile, '.md'), name: metadata.agent_name || path.basename(agentFile, '.md'), description: metadata.description || 'No description available', - source: 'core' + source: 'core', }); - } catch (e) { + } catch { // Skip invalid agents } } @@ -144,7 +141,7 @@ class ResourceLocator { */ async getExpansionPacks() { const cacheKey = 'expansion-packs'; - + if (this._pathCache.has(cacheKey)) { return this._pathCache.get(cacheKey); } @@ -154,7 +151,7 @@ class ResourceLocator { if (await fs.pathExists(expansionPacksPath)) { const entries = await fs.readdir(expansionPacksPath, { withFileTypes: true }); - + for (const entry of entries) { if (entry.isDirectory()) { const configPath = path.join(expansionPacksPath, entry.name, 'config.yaml'); @@ -167,11 +164,12 @@ class ResourceLocator { name: config.name || entry.name, version: config.version || '1.0.0', description: config.description || 'No description available', - shortTitle: config['short-title'] || config.description || 'No description available', + shortTitle: + config['short-title'] || config.description || 'No description available', author: config.author || 'Unknown', - path: path.join(expansionPacksPath, entry.name) + path: path.join(expansionPacksPath, entry.name), }); - } catch (e) { + } catch { // Skip invalid packs } } @@ -193,13 +191,13 @@ class ResourceLocator { */ async getTeamConfig(teamId) { const cacheKey = `team:${teamId}`; - + if (this._pathCache.has(cacheKey)) { return this._pathCache.get(cacheKey); } const teamPath = path.join(this.getBmadCorePath(), 'agent-teams', `${teamId}.yaml`); - + if (await fs.pathExists(teamPath)) { try { const yaml = require('js-yaml'); @@ -207,7 +205,7 @@ class ResourceLocator { const config = yaml.load(content); this._pathCache.set(cacheKey, config); return config; - } catch (e) { + } catch { return null; } } @@ -222,7 +220,7 @@ class ResourceLocator { */ async getAgentDependencies(agentId) { const cacheKey = `deps:${agentId}`; - + if (this._pathCache.has(cacheKey)) { return this._pathCache.get(cacheKey); } @@ -244,11 +242,11 @@ class ResourceLocator { const yaml = require('js-yaml'); const metadata = yaml.load(yamlContent); const dependencies = metadata.dependencies || {}; - + // Flatten dependencies const allDeps = []; const byType = {}; - + for (const [type, deps] of Object.entries(dependencies)) { if (Array.isArray(deps)) { byType[type] = deps; @@ -261,7 +259,7 @@ class ResourceLocator { const result = { all: allDeps, byType }; this._pathCache.set(cacheKey, result); return result; - } catch (e) { + } catch { return { all: [], byType: {} }; } } @@ -281,13 +279,13 @@ class ResourceLocator { */ async getIdeConfig(ideId) { const cacheKey = `ide:${ideId}`; - + if (this._pathCache.has(cacheKey)) { return this._pathCache.get(cacheKey); } const idePath = path.join(this.getBmadCorePath(), 'ide-rules', `${ideId}.yaml`); - + if (await fs.pathExists(idePath)) { try { const yaml = require('js-yaml'); @@ -295,7 +293,7 @@ class ResourceLocator { const config = yaml.load(content); this._pathCache.set(cacheKey, config); return config; - } catch (e) { + } catch { return null; } } @@ -307,4 +305,4 @@ class ResourceLocator { // Singleton instance const resourceLocator = new ResourceLocator(); -module.exports = resourceLocator; \ No newline at end of file +module.exports = resourceLocator; diff --git a/tools/installer/package.json b/tools/installer/package.json index 22fd61cb..d168e975 100644 --- a/tools/installer/package.json +++ b/tools/installer/package.json @@ -2,14 +2,6 @@ "name": "bmad-method", "version": "5.0.0", "description": "BMad Method installer - AI-powered Agile development framework", - "main": "lib/installer.js", - "bin": { - "bmad": "./bin/bmad.js", - "bmad-method": "./bin/bmad.js" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, "keywords": [ "bmad", "agile", @@ -19,8 +11,24 @@ "installer", "agents" ], - "author": "BMad Team", + "homepage": "https://github.com/bmad-team/bmad-method#readme", + "bugs": { + "url": "https://github.com/bmad-team/bmad-method/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/bmad-team/bmad-method.git" + }, "license": "MIT", + "author": "BMad Team", + "main": "lib/installer.js", + "bin": { + "bmad": "./bin/bmad.js", + "bmad-method": "./bin/bmad.js" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, "dependencies": { "chalk": "^4.1.2", "commander": "^14.0.0", @@ -32,13 +40,5 @@ }, "engines": { "node": ">=20.0.0" - }, - "repository": { - "type": "git", - "url": "https://github.com/bmad-team/bmad-method.git" - }, - "bugs": { - "url": "https://github.com/bmad-team/bmad-method/issues" - }, - "homepage": "https://github.com/bmad-team/bmad-method#readme" + } } diff --git a/tools/lib/dependency-resolver.js b/tools/lib/dependency-resolver.js index decab6b1..c2cf0559 100644 --- a/tools/lib/dependency-resolver.js +++ b/tools/lib/dependency-resolver.js @@ -1,5 +1,5 @@ -const fs = require('fs').promises; -const path = require('path'); +const fs = require('node:fs').promises; +const path = require('node:path'); const yaml = require('js-yaml'); const { extractYamlFromAgent } = require('./yaml-utils'); @@ -14,23 +14,23 @@ class DependencyResolver { async resolveAgentDependencies(agentId) { const agentPath = path.join(this.bmadCore, 'agents', `${agentId}.md`); const agentContent = await fs.readFile(agentPath, 'utf8'); - + // Extract YAML from markdown content with command cleaning const yamlContent = extractYamlFromAgent(agentContent, true); if (!yamlContent) { throw new Error(`No YAML configuration found in agent ${agentId}`); } - + const agentConfig = yaml.load(yamlContent); - + const dependencies = { agent: { id: agentId, path: agentPath, content: agentContent, - config: agentConfig + config: agentConfig, }, - resources: [] + resources: [], }; // Personas are now embedded in agent configs, no need to resolve separately @@ -52,49 +52,49 @@ class DependencyResolver { const teamPath = path.join(this.bmadCore, 'agent-teams', `${teamId}.yaml`); const teamContent = await fs.readFile(teamPath, 'utf8'); const teamConfig = yaml.load(teamContent); - + const dependencies = { team: { id: teamId, path: teamPath, content: teamContent, - config: teamConfig + config: teamConfig, }, agents: [], - resources: new Map() // Use Map to deduplicate resources + resources: new Map(), // Use Map to deduplicate resources }; // Always add bmad-orchestrator agent first if it's a team const bmadAgent = await this.resolveAgentDependencies('bmad-orchestrator'); dependencies.agents.push(bmadAgent.agent); - bmadAgent.resources.forEach(res => { + for (const res of bmadAgent.resources) { dependencies.resources.set(res.path, res); - }); + } // Resolve all agents in the team let agentsToResolve = teamConfig.agents || []; - + // Handle wildcard "*" - include all agents except bmad-master if (agentsToResolve.includes('*')) { const allAgents = await this.listAgents(); // Remove wildcard and add all agents except those already in the list and bmad-master - agentsToResolve = agentsToResolve.filter(a => a !== '*'); + agentsToResolve = agentsToResolve.filter((a) => a !== '*'); for (const agent of allAgents) { if (!agentsToResolve.includes(agent) && agent !== 'bmad-master') { agentsToResolve.push(agent); } } } - + for (const agentId of agentsToResolve) { if (agentId === 'bmad-orchestrator' || agentId === 'bmad-master') continue; // Already added or excluded const agentDeps = await this.resolveAgentDependencies(agentId); dependencies.agents.push(agentDeps.agent); - + // Add resources with deduplication - agentDeps.resources.forEach(res => { + for (const res of agentDeps.resources) { dependencies.resources.set(res.path, res); - }); + } } // Resolve workflows @@ -104,7 +104,7 @@ class DependencyResolver { } // Convert Map back to array - dependencies.resources = Array.from(dependencies.resources.values()); + dependencies.resources = [...dependencies.resources.values()]; return dependencies; } @@ -123,12 +123,12 @@ class DependencyResolver { try { filePath = path.join(this.bmadCore, type, id); content = await fs.readFile(filePath, 'utf8'); - } catch (e) { + } catch { // If not found in bmad-core, try common folder try { filePath = path.join(this.common, type, id); content = await fs.readFile(filePath, 'utf8'); - } catch (e2) { + } catch { // File not found in either location } } @@ -142,7 +142,7 @@ class DependencyResolver { type, id, path: filePath, - content + content, }; this.cache.set(cacheKey, resource); @@ -156,10 +156,8 @@ class DependencyResolver { async listAgents() { try { const files = await fs.readdir(path.join(this.bmadCore, 'agents')); - return files - .filter(f => f.endsWith('.md')) - .map(f => f.replace('.md', '')); - } catch (error) { + return files.filter((f) => f.endsWith('.md')).map((f) => f.replace('.md', '')); + } catch { return []; } } @@ -167,10 +165,8 @@ class DependencyResolver { async listTeams() { try { const files = await fs.readdir(path.join(this.bmadCore, 'agent-teams')); - return files - .filter(f => f.endsWith('.yaml')) - .map(f => f.replace('.yaml', '')); - } catch (error) { + return files.filter((f) => f.endsWith('.yaml')).map((f) => f.replace('.yaml', '')); + } catch { return []; } } diff --git a/tools/lib/yaml-utils.js b/tools/lib/yaml-utils.js index 67c95c49..f645869a 100644 --- a/tools/lib/yaml-utils.js +++ b/tools/lib/yaml-utils.js @@ -10,20 +10,20 @@ */ function extractYamlFromAgent(agentContent, cleanCommands = false) { // Remove carriage returns and match YAML block - const yamlMatch = agentContent.replace(/\r/g, "").match(/```ya?ml\n([\s\S]*?)\n```/); + const yamlMatch = agentContent.replaceAll('\r', '').match(/```ya?ml\n([\s\S]*?)\n```/); if (!yamlMatch) return null; - + let yamlContent = yamlMatch[1].trim(); - + // Clean up command descriptions if requested // Converts "- command - description" to just "- command" if (cleanCommands) { - yamlContent = yamlContent.replace(/^(\s*-)(\s*"[^"]+")(\s*-\s*.*)$/gm, '$1$2'); + yamlContent = yamlContent.replaceAll(/^(\s*-)(\s*"[^"]+")(\s*-\s*.*)$/gm, '$1$2'); } - + return yamlContent; } module.exports = { - extractYamlFromAgent -}; \ No newline at end of file + extractYamlFromAgent, +}; diff --git a/tools/semantic-release-sync-installer.js b/tools/semantic-release-sync-installer.js index 0a980005..37bad0cf 100644 --- a/tools/semantic-release-sync-installer.js +++ b/tools/semantic-release-sync-installer.js @@ -2,8 +2,8 @@ * Semantic-release plugin to sync installer package.json version */ -const fs = require('fs'); -const path = require('path'); +const fs = require('node:fs'); +const path = require('node:path'); // This function runs during the "prepare" step of semantic-release function prepare(_, { nextRelease, logger }) { @@ -14,13 +14,13 @@ function prepare(_, { nextRelease, logger }) { if (!fs.existsSync(file)) return logger.log('Installer package.json not found, skipping'); // Read and parse the package.json file - const pkg = JSON.parse(fs.readFileSync(file, 'utf8')); + const package_ = JSON.parse(fs.readFileSync(file, 'utf8')); // Update the version field with the next release version - pkg.version = nextRelease.version; + package_.version = nextRelease.version; // Write the updated JSON back to the file - fs.writeFileSync(file, JSON.stringify(pkg, null, 2) + '\n'); + fs.writeFileSync(file, JSON.stringify(package_, null, 2) + '\n'); // Log success message logger.log(`Synced installer package.json to version ${nextRelease.version}`); diff --git a/tools/shared/bannerArt.js b/tools/shared/bannerArt.js index 19dbfdd1..0ab7017c 100644 --- a/tools/shared/bannerArt.js +++ b/tools/shared/bannerArt.js @@ -1,8 +1,8 @@ // ASCII banner art definitions extracted from banners.js to separate art from logic -const BMAD_TITLE = "BMAD-METHOD"; -const FLATTENER_TITLE = "FLATTENER"; -const INSTALLER_TITLE = "INSTALLER"; +const BMAD_TITLE = 'BMAD-METHOD'; +const FLATTENER_TITLE = 'FLATTENER'; +const INSTALLER_TITLE = 'INSTALLER'; // Large ASCII blocks (block-style fonts) const BMAD_LARGE = ` diff --git a/tools/sync-installer-version.js b/tools/sync-installer-version.js index e994c50f..c2dc813e 100644 --- a/tools/sync-installer-version.js +++ b/tools/sync-installer-version.js @@ -1,28 +1,26 @@ -#!/usr/bin/env node - /** * Sync installer package.json version with main package.json * Used by semantic-release to keep versions in sync */ -const fs = require('fs'); -const path = require('path'); +const fs = require('node:fs'); +const path = require('node:path'); function syncInstallerVersion() { // Read main package.json const mainPackagePath = path.join(__dirname, '..', 'package.json'); const mainPackage = JSON.parse(fs.readFileSync(mainPackagePath, 'utf8')); - + // Read installer package.json const installerPackagePath = path.join(__dirname, 'installer', 'package.json'); const installerPackage = JSON.parse(fs.readFileSync(installerPackagePath, 'utf8')); - + // Update installer version to match main version installerPackage.version = mainPackage.version; - + // Write back installer package.json fs.writeFileSync(installerPackagePath, JSON.stringify(installerPackage, null, 2) + '\n'); - + console.log(`Synced installer version to ${mainPackage.version}`); } @@ -31,4 +29,4 @@ if (require.main === module) { syncInstallerVersion(); } -module.exports = { syncInstallerVersion }; \ No newline at end of file +module.exports = { syncInstallerVersion }; diff --git a/tools/update-expansion-version.js b/tools/update-expansion-version.js index 1174e897..0841742d 100755 --- a/tools/update-expansion-version.js +++ b/tools/update-expansion-version.js @@ -1,18 +1,16 @@ -#!/usr/bin/env node - -const fs = require('fs'); -const path = require('path'); +const fs = require('node:fs'); +const path = require('node:path'); const yaml = require('js-yaml'); -const args = process.argv.slice(2); +const arguments_ = process.argv.slice(2); -if (args.length < 2) { +if (arguments_.length < 2) { console.log('Usage: node update-expansion-version.js '); console.log('Example: node update-expansion-version.js bmad-creator-tools 1.1.0'); process.exit(1); } -const [packId, newVersion] = args; +const [packId, newVersion] = arguments_; // Validate version format if (!/^\d+\.\d+\.\d+$/.test(newVersion)) { @@ -24,31 +22,32 @@ async function updateVersion() { try { // Update in config.yaml const configPath = path.join(__dirname, '..', 'expansion-packs', packId, 'config.yaml'); - + if (!fs.existsSync(configPath)) { console.error(`Error: Expansion pack '${packId}' not found`); process.exit(1); } - + const configContent = fs.readFileSync(configPath, 'utf8'); const config = yaml.load(configContent); const oldVersion = config.version || 'unknown'; - + config.version = newVersion; - + const updatedYaml = yaml.dump(config, { indent: 2 }); fs.writeFileSync(configPath, updatedYaml); - + console.log(`✓ Updated ${packId}/config.yaml: ${oldVersion} → ${newVersion}`); console.log(`\n✓ Successfully updated ${packId} to version ${newVersion}`); console.log('\nNext steps:'); console.log('1. Test the changes'); - console.log('2. Commit: git add -A && git commit -m "chore: bump ' + packId + ' to v' + newVersion + '"'); - + console.log( + '2. Commit: git add -A && git commit -m "chore: bump ' + packId + ' to v' + newVersion + '"', + ); } catch (error) { console.error('Error updating version:', error.message); process.exit(1); } } -updateVersion(); \ No newline at end of file +updateVersion(); diff --git a/tools/upgraders/v3-to-v4-upgrader.js b/tools/upgraders/v3-to-v4-upgrader.js index 2a14b244..006afbc4 100644 --- a/tools/upgraders/v3-to-v4-upgrader.js +++ b/tools/upgraders/v3-to-v4-upgrader.js @@ -1,15 +1,15 @@ -const fs = require("fs").promises; -const path = require("path"); -const { glob } = require("glob"); +const fs = require('node:fs').promises; +const path = require('node:path'); +const { glob } = require('glob'); // Dynamic imports for ES modules let chalk, ora, inquirer; // Initialize ES modules async function initializeModules() { - chalk = (await import("chalk")).default; - ora = (await import("ora")).default; - inquirer = (await import("inquirer")).default; + chalk = (await import('chalk')).default; + ora = (await import('ora')).default; + inquirer = (await import('inquirer')).default; } class V3ToV4Upgrader { @@ -25,23 +25,15 @@ class V3ToV4Upgrader { process.stdin.resume(); // 1. Welcome message - console.log( - chalk.bold("\nWelcome to BMad-Method V3 to V4 Upgrade Tool\n") - ); - console.log( - "This tool will help you upgrade your BMad-Method V3 project to V4.\n" - ); - console.log(chalk.cyan("What this tool does:")); - console.log("- Creates a backup of your V3 files (.bmad-v3-backup/)"); - console.log("- Installs the new V4 .bmad-core structure"); - console.log( - "- Preserves your PRD, Architecture, and Stories in the new format\n" - ); - console.log(chalk.yellow("What this tool does NOT do:")); - console.log( - "- Modify your document content (use doc-migration-task after upgrade)" - ); - console.log("- Touch any files outside bmad-agent/ and docs/\n"); + console.log(chalk.bold('\nWelcome to BMad-Method V3 to V4 Upgrade Tool\n')); + console.log('This tool will help you upgrade your BMad-Method V3 project to V4.\n'); + console.log(chalk.cyan('What this tool does:')); + console.log('- Creates a backup of your V3 files (.bmad-v3-backup/)'); + console.log('- Installs the new V4 .bmad-core structure'); + console.log('- Preserves your PRD, Architecture, and Stories in the new format\n'); + console.log(chalk.yellow('What this tool does NOT do:')); + console.log('- Modify your document content (use doc-migration-task after upgrade)'); + console.log('- Touch any files outside bmad-agent/ and docs/\n'); // 2. Get project path const projectPath = await this.getProjectPath(options.projectPath); @@ -49,15 +41,11 @@ class V3ToV4Upgrader { // 3. Validate V3 structure const validation = await this.validateV3Project(projectPath); if (!validation.isValid) { - console.error( - chalk.red("\nError: This doesn't appear to be a V3 project.") - ); - console.error("Expected to find:"); - console.error("- bmad-agent/ directory"); - console.error("- docs/ directory\n"); - console.error( - "Please check you're in the correct directory and try again." - ); + console.error(chalk.red("\nError: This doesn't appear to be a V3 project.")); + console.error('Expected to find:'); + console.error('- bmad-agent/ directory'); + console.error('- docs/ directory\n'); + console.error("Please check you're in the correct directory and try again."); return; } @@ -68,15 +56,15 @@ class V3ToV4Upgrader { if (!options.dryRun) { const { confirm } = await inquirer.prompt([ { - type: "confirm", - name: "confirm", - message: "Continue with upgrade?", + type: 'confirm', + name: 'confirm', + message: 'Continue with upgrade?', default: true, }, ]); if (!confirm) { - console.log("Upgrade cancelled."); + console.log('Upgrade cancelled.'); return; } } @@ -106,7 +94,7 @@ class V3ToV4Upgrader { process.exit(0); } catch (error) { - console.error(chalk.red("\nUpgrade error:"), error.message); + console.error(chalk.red('\nUpgrade error:'), error.message); process.exit(1); } } @@ -118,9 +106,9 @@ class V3ToV4Upgrader { const { projectPath } = await inquirer.prompt([ { - type: "input", - name: "projectPath", - message: "Please enter the path to your V3 project:", + type: 'input', + name: 'projectPath', + message: 'Please enter the path to your V3 project:', default: process.cwd(), }, ]); @@ -129,45 +117,45 @@ class V3ToV4Upgrader { } async validateV3Project(projectPath) { - const spinner = ora("Validating project structure...").start(); + const spinner = ora('Validating project structure...').start(); try { - const bmadAgentPath = path.join(projectPath, "bmad-agent"); - const docsPath = path.join(projectPath, "docs"); + const bmadAgentPath = path.join(projectPath, 'bmad-agent'); + const docsPath = path.join(projectPath, 'docs'); const hasBmadAgent = await this.pathExists(bmadAgentPath); const hasDocs = await this.pathExists(docsPath); if (hasBmadAgent) { - spinner.text = "✓ Found bmad-agent/ directory"; - console.log(chalk.green("\n✓ Found bmad-agent/ directory")); + spinner.text = '✓ Found bmad-agent/ directory'; + console.log(chalk.green('\n✓ Found bmad-agent/ directory')); } if (hasDocs) { - console.log(chalk.green("✓ Found docs/ directory")); + console.log(chalk.green('✓ Found docs/ directory')); } const isValid = hasBmadAgent && hasDocs; if (isValid) { - spinner.succeed("This appears to be a valid V3 project"); + spinner.succeed('This appears to be a valid V3 project'); } else { - spinner.fail("Invalid V3 project structure"); + spinner.fail('Invalid V3 project structure'); } return { isValid, hasBmadAgent, hasDocs }; } catch (error) { - spinner.fail("Validation failed"); + spinner.fail('Validation failed'); throw error; } } async analyzeProject(projectPath) { - const docsPath = path.join(projectPath, "docs"); - const bmadAgentPath = path.join(projectPath, "bmad-agent"); + const docsPath = path.join(projectPath, 'docs'); + const bmadAgentPath = path.join(projectPath, 'bmad-agent'); // Find PRD - const prdCandidates = ["prd.md", "PRD.md", "product-requirements.md"]; + const prdCandidates = ['prd.md', 'PRD.md', 'product-requirements.md']; let prdFile = null; for (const candidate of prdCandidates) { const candidatePath = path.join(docsPath, candidate); @@ -178,11 +166,7 @@ class V3ToV4Upgrader { } // Find Architecture - const archCandidates = [ - "architecture.md", - "Architecture.md", - "technical-architecture.md", - ]; + const archCandidates = ['architecture.md', 'Architecture.md', 'technical-architecture.md']; let archFile = null; for (const candidate of archCandidates) { const candidatePath = path.join(docsPath, candidate); @@ -194,9 +178,9 @@ class V3ToV4Upgrader { // Find Front-end Architecture (V3 specific) const frontEndCandidates = [ - "front-end-architecture.md", - "frontend-architecture.md", - "ui-architecture.md", + 'front-end-architecture.md', + 'frontend-architecture.md', + 'ui-architecture.md', ]; let frontEndArchFile = null; for (const candidate of frontEndCandidates) { @@ -209,10 +193,10 @@ class V3ToV4Upgrader { // Find UX/UI spec const uxSpecCandidates = [ - "ux-ui-spec.md", - "ux-ui-specification.md", - "ui-spec.md", - "ux-spec.md", + 'ux-ui-spec.md', + 'ux-ui-specification.md', + 'ui-spec.md', + 'ux-spec.md', ]; let uxSpecFile = null; for (const candidate of uxSpecCandidates) { @@ -224,12 +208,7 @@ class V3ToV4Upgrader { } // Find v0 prompt or UX prompt - const uxPromptCandidates = [ - "v0-prompt.md", - "ux-prompt.md", - "ui-prompt.md", - "design-prompt.md", - ]; + const uxPromptCandidates = ['v0-prompt.md', 'ux-prompt.md', 'ui-prompt.md', 'design-prompt.md']; let uxPromptFile = null; for (const candidate of uxPromptCandidates) { const candidatePath = path.join(docsPath, candidate); @@ -240,19 +219,19 @@ class V3ToV4Upgrader { } // Find epic files - const epicFiles = await glob("epic*.md", { cwd: docsPath }); + const epicFiles = await glob('epic*.md', { cwd: docsPath }); // Find story files - const storiesPath = path.join(docsPath, "stories"); + const storiesPath = path.join(docsPath, 'stories'); let storyFiles = []; if (await this.pathExists(storiesPath)) { - storyFiles = await glob("*.md", { cwd: storiesPath }); + storyFiles = await glob('*.md', { cwd: storiesPath }); } // Count custom files in bmad-agent - const bmadAgentFiles = await glob("**/*.md", { + const bmadAgentFiles = await glob('**/*.md', { cwd: bmadAgentPath, - ignore: ["node_modules/**"], + ignore: ['node_modules/**'], }); return { @@ -268,279 +247,233 @@ class V3ToV4Upgrader { } async showPreflightCheck(analysis, options) { - console.log(chalk.bold("\nProject Analysis:")); + console.log(chalk.bold('\nProject Analysis:')); console.log( - `- PRD found: ${ - analysis.prdFile - ? `docs/${analysis.prdFile}` - : chalk.yellow("Not found") - }` + `- PRD found: ${analysis.prdFile ? `docs/${analysis.prdFile}` : chalk.yellow('Not found')}`, ); console.log( `- Architecture found: ${ - analysis.archFile - ? `docs/${analysis.archFile}` - : chalk.yellow("Not found") - }` + analysis.archFile ? `docs/${analysis.archFile}` : chalk.yellow('Not found') + }`, ); if (analysis.frontEndArchFile) { - console.log( - `- Front-end Architecture found: docs/${analysis.frontEndArchFile}` - ); + console.log(`- Front-end Architecture found: docs/${analysis.frontEndArchFile}`); } console.log( `- UX/UI Spec found: ${ - analysis.uxSpecFile - ? `docs/${analysis.uxSpecFile}` - : chalk.yellow("Not found") - }` + analysis.uxSpecFile ? `docs/${analysis.uxSpecFile}` : chalk.yellow('Not found') + }`, ); console.log( `- UX/Design Prompt found: ${ - analysis.uxPromptFile - ? `docs/${analysis.uxPromptFile}` - : chalk.yellow("Not found") - }` - ); - console.log( - `- Epic files found: ${analysis.epicFiles.length} files (epic*.md)` - ); - console.log( - `- Stories found: ${analysis.storyFiles.length} files in docs/stories/` + analysis.uxPromptFile ? `docs/${analysis.uxPromptFile}` : chalk.yellow('Not found') + }`, ); + console.log(`- Epic files found: ${analysis.epicFiles.length} files (epic*.md)`); + console.log(`- Stories found: ${analysis.storyFiles.length} files in docs/stories/`); console.log(`- Custom files in bmad-agent/: ${analysis.customFileCount}`); if (!options.dryRun) { - console.log("\nThe following will be backed up to .bmad-v3-backup/:"); - console.log("- bmad-agent/ (entire directory)"); - console.log("- docs/ (entire directory)"); + console.log('\nThe following will be backed up to .bmad-v3-backup/:'); + console.log('- bmad-agent/ (entire directory)'); + console.log('- docs/ (entire directory)'); if (analysis.epicFiles.length > 0) { console.log( chalk.green( - "\nNote: Epic files found! They will be placed in docs/prd/ with an index.md file." - ) + '\nNote: Epic files found! They will be placed in docs/prd/ with an index.md file.', + ), ); console.log( - chalk.green( - "Since epic files exist, you won't need to shard the PRD after upgrade." - ) + chalk.green("Since epic files exist, you won't need to shard the PRD after upgrade."), ); } } } async createBackup(projectPath) { - const spinner = ora("Creating backup...").start(); + const spinner = ora('Creating backup...').start(); try { - const backupPath = path.join(projectPath, ".bmad-v3-backup"); + const backupPath = path.join(projectPath, '.bmad-v3-backup'); // Check if backup already exists if (await this.pathExists(backupPath)) { - spinner.fail("Backup directory already exists"); - console.error( - chalk.red( - "\nError: Backup directory .bmad-v3-backup/ already exists." - ) - ); - console.error("\nThis might mean an upgrade was already attempted."); - console.error( - "Please remove or rename the existing backup and try again." - ); - throw new Error("Backup already exists"); + spinner.fail('Backup directory already exists'); + console.error(chalk.red('\nError: Backup directory .bmad-v3-backup/ already exists.')); + console.error('\nThis might mean an upgrade was already attempted.'); + console.error('Please remove or rename the existing backup and try again.'); + throw new Error('Backup already exists'); } // Create backup directory await fs.mkdir(backupPath, { recursive: true }); - spinner.text = "✓ Created .bmad-v3-backup/"; - console.log(chalk.green("\n✓ Created .bmad-v3-backup/")); + spinner.text = '✓ Created .bmad-v3-backup/'; + console.log(chalk.green('\n✓ Created .bmad-v3-backup/')); // Move bmad-agent - const bmadAgentSrc = path.join(projectPath, "bmad-agent"); - const bmadAgentDest = path.join(backupPath, "bmad-agent"); - await fs.rename(bmadAgentSrc, bmadAgentDest); - console.log(chalk.green("✓ Moved bmad-agent/ to backup")); + const bmadAgentSource = path.join(projectPath, 'bmad-agent'); + const bmadAgentDestination = path.join(backupPath, 'bmad-agent'); + await fs.rename(bmadAgentSource, bmadAgentDestination); + console.log(chalk.green('✓ Moved bmad-agent/ to backup')); // Move docs - const docsSrc = path.join(projectPath, "docs"); - const docsDest = path.join(backupPath, "docs"); + const docsSrc = path.join(projectPath, 'docs'); + const docsDest = path.join(backupPath, 'docs'); await fs.rename(docsSrc, docsDest); - console.log(chalk.green("✓ Moved docs/ to backup")); + console.log(chalk.green('✓ Moved docs/ to backup')); - spinner.succeed("Backup created successfully"); + spinner.succeed('Backup created successfully'); } catch (error) { - spinner.fail("Backup failed"); + spinner.fail('Backup failed'); throw error; } } async installV4Structure(projectPath) { - const spinner = ora("Installing V4 structure...").start(); + const spinner = ora('Installing V4 structure...').start(); try { // Get the source bmad-core directory (without dot prefix) - const sourcePath = path.join(__dirname, "..", "..", "bmad-core"); - const destPath = path.join(projectPath, ".bmad-core"); + const sourcePath = path.join(__dirname, '..', '..', 'bmad-core'); + const destinationPath = path.join(projectPath, '.bmad-core'); // Copy .bmad-core - await this.copyDirectory(sourcePath, destPath); - spinner.text = "✓ Copied fresh .bmad-core/ directory from V4"; - console.log( - chalk.green("\n✓ Copied fresh .bmad-core/ directory from V4") - ); + await this.copyDirectory(sourcePath, destinationPath); + spinner.text = '✓ Copied fresh .bmad-core/ directory from V4'; + console.log(chalk.green('\n✓ Copied fresh .bmad-core/ directory from V4')); // Create docs directory - const docsPath = path.join(projectPath, "docs"); + const docsPath = path.join(projectPath, 'docs'); await fs.mkdir(docsPath, { recursive: true }); - console.log(chalk.green("✓ Created new docs/ directory")); + console.log(chalk.green('✓ Created new docs/ directory')); // Create install manifest for future updates await this.createInstallManifest(projectPath); - console.log(chalk.green("✓ Created install manifest")); + console.log(chalk.green('✓ Created install manifest')); console.log( - chalk.yellow( - "\nNote: Your V3 bmad-agent content has been backed up and NOT migrated." - ) + chalk.yellow('\nNote: Your V3 bmad-agent content has been backed up and NOT migrated.'), ); console.log( chalk.yellow( - "The new V4 agents are completely different and look for different file structures." - ) + 'The new V4 agents are completely different and look for different file structures.', + ), ); - spinner.succeed("V4 structure installed successfully"); + spinner.succeed('V4 structure installed successfully'); } catch (error) { - spinner.fail("V4 installation failed"); + spinner.fail('V4 installation failed'); throw error; } } async migrateDocuments(projectPath, analysis) { - const spinner = ora("Migrating your project documents...").start(); + const spinner = ora('Migrating your project documents...').start(); try { - const backupDocsPath = path.join(projectPath, ".bmad-v3-backup", "docs"); - const newDocsPath = path.join(projectPath, "docs"); + const backupDocsPath = path.join(projectPath, '.bmad-v3-backup', 'docs'); + const newDocsPath = path.join(projectPath, 'docs'); let copiedCount = 0; // Copy PRD if (analysis.prdFile) { - const src = path.join(backupDocsPath, analysis.prdFile); - const dest = path.join(newDocsPath, analysis.prdFile); - await fs.copyFile(src, dest); + const source = path.join(backupDocsPath, analysis.prdFile); + const destination = path.join(newDocsPath, analysis.prdFile); + await fs.copyFile(source, destination); console.log(chalk.green(`\n✓ Copied PRD to docs/${analysis.prdFile}`)); copiedCount++; } // Copy Architecture if (analysis.archFile) { - const src = path.join(backupDocsPath, analysis.archFile); - const dest = path.join(newDocsPath, analysis.archFile); - await fs.copyFile(src, dest); - console.log( - chalk.green(`✓ Copied Architecture to docs/${analysis.archFile}`) - ); + const source = path.join(backupDocsPath, analysis.archFile); + const destination = path.join(newDocsPath, analysis.archFile); + await fs.copyFile(source, destination); + console.log(chalk.green(`✓ Copied Architecture to docs/${analysis.archFile}`)); copiedCount++; } // Copy Front-end Architecture if exists if (analysis.frontEndArchFile) { - const src = path.join(backupDocsPath, analysis.frontEndArchFile); - const dest = path.join(newDocsPath, analysis.frontEndArchFile); - await fs.copyFile(src, dest); + const source = path.join(backupDocsPath, analysis.frontEndArchFile); + const destination = path.join(newDocsPath, analysis.frontEndArchFile); + await fs.copyFile(source, destination); console.log( - chalk.green( - `✓ Copied Front-end Architecture to docs/${analysis.frontEndArchFile}` - ) + chalk.green(`✓ Copied Front-end Architecture to docs/${analysis.frontEndArchFile}`), ); console.log( chalk.yellow( - "Note: V4 uses a single full-stack-architecture.md - use doc-migration-task to merge" - ) + 'Note: V4 uses a single full-stack-architecture.md - use doc-migration-task to merge', + ), ); copiedCount++; } // Copy UX/UI Spec if exists if (analysis.uxSpecFile) { - const src = path.join(backupDocsPath, analysis.uxSpecFile); - const dest = path.join(newDocsPath, analysis.uxSpecFile); - await fs.copyFile(src, dest); - console.log( - chalk.green(`✓ Copied UX/UI Spec to docs/${analysis.uxSpecFile}`) - ); + const source = path.join(backupDocsPath, analysis.uxSpecFile); + const destination = path.join(newDocsPath, analysis.uxSpecFile); + await fs.copyFile(source, destination); + console.log(chalk.green(`✓ Copied UX/UI Spec to docs/${analysis.uxSpecFile}`)); copiedCount++; } // Copy UX/Design Prompt if exists if (analysis.uxPromptFile) { - const src = path.join(backupDocsPath, analysis.uxPromptFile); - const dest = path.join(newDocsPath, analysis.uxPromptFile); - await fs.copyFile(src, dest); - console.log( - chalk.green( - `✓ Copied UX/Design Prompt to docs/${analysis.uxPromptFile}` - ) - ); + const source = path.join(backupDocsPath, analysis.uxPromptFile); + const destination = path.join(newDocsPath, analysis.uxPromptFile); + await fs.copyFile(source, destination); + console.log(chalk.green(`✓ Copied UX/Design Prompt to docs/${analysis.uxPromptFile}`)); copiedCount++; } // Copy stories if (analysis.storyFiles.length > 0) { - const storiesDir = path.join(newDocsPath, "stories"); + const storiesDir = path.join(newDocsPath, 'stories'); await fs.mkdir(storiesDir, { recursive: true }); for (const storyFile of analysis.storyFiles) { - const src = path.join(backupDocsPath, "stories", storyFile); - const dest = path.join(storiesDir, storyFile); - await fs.copyFile(src, dest); + const source = path.join(backupDocsPath, 'stories', storyFile); + const destination = path.join(storiesDir, storyFile); + await fs.copyFile(source, destination); } console.log( - chalk.green( - `✓ Copied ${analysis.storyFiles.length} story files to docs/stories/` - ) + chalk.green(`✓ Copied ${analysis.storyFiles.length} story files to docs/stories/`), ); copiedCount += analysis.storyFiles.length; } // Copy epic files to prd subfolder if (analysis.epicFiles.length > 0) { - const prdDir = path.join(newDocsPath, "prd"); + const prdDir = path.join(newDocsPath, 'prd'); await fs.mkdir(prdDir, { recursive: true }); for (const epicFile of analysis.epicFiles) { - const src = path.join(backupDocsPath, epicFile); - const dest = path.join(prdDir, epicFile); - await fs.copyFile(src, dest); + const source = path.join(backupDocsPath, epicFile); + const destination = path.join(prdDir, epicFile); + await fs.copyFile(source, destination); } console.log( - chalk.green( - `✓ Found and copied ${analysis.epicFiles.length} epic files to docs/prd/` - ) + chalk.green(`✓ Found and copied ${analysis.epicFiles.length} epic files to docs/prd/`), ); // Create index.md for the prd folder await this.createPrdIndex(projectPath, analysis); - console.log(chalk.green("✓ Created index.md in docs/prd/")); + console.log(chalk.green('✓ Created index.md in docs/prd/')); console.log( chalk.green( - "\nNote: Epic files detected! These are compatible with V4 and have been copied." - ) - ); - console.log( - chalk.green( - "You won't need to shard the PRD since epics already exist." - ) + '\nNote: Epic files detected! These are compatible with V4 and have been copied.', + ), ); + console.log(chalk.green("You won't need to shard the PRD since epics already exist.")); copiedCount += analysis.epicFiles.length; } spinner.succeed(`Migrated ${copiedCount} documents successfully`); } catch (error) { - spinner.fail("Document migration failed"); + spinner.fail('Document migration failed'); throw error; } } @@ -548,21 +481,21 @@ class V3ToV4Upgrader { async setupIDE(projectPath, selectedIdes) { // Use the IDE selections passed from the installer if (!selectedIdes || selectedIdes.length === 0) { - console.log(chalk.dim("No IDE setup requested - skipping")); + console.log(chalk.dim('No IDE setup requested - skipping')); return; } - const ideSetup = require("../installer/lib/ide-setup"); - const spinner = ora("Setting up IDE rules for all agents...").start(); + const ideSetup = require('../installer/lib/ide-setup'); + const spinner = ora('Setting up IDE rules for all agents...').start(); try { const ideMessages = { - cursor: "Rules created in .cursor/rules/bmad/", - "claude-code": "Commands created in .claude/commands/BMad/", - windsurf: "Rules created in .windsurf/rules/", - trae: "Rules created in.trae/rules/", - roo: "Custom modes created in .roomodes", - cline: "Rules created in .clinerules/", + cursor: 'Rules created in .cursor/rules/bmad/', + 'claude-code': 'Commands created in .claude/commands/BMad/', + windsurf: 'Rules created in .windsurf/workflows/', + trae: 'Rules created in.trae/rules/', + roo: 'Custom modes created in .roomodes', + cline: 'Rules created in .clinerules/', }; // Setup each selected IDE @@ -573,17 +506,15 @@ class V3ToV4Upgrader { } spinner.succeed(`IDE setup complete for ${selectedIdes.length} IDE(s)!`); - } catch (error) { - spinner.fail("IDE setup failed"); - console.error( - chalk.yellow("IDE setup failed, but upgrade is complete.") - ); + } catch { + spinner.fail('IDE setup failed'); + console.error(chalk.yellow('IDE setup failed, but upgrade is complete.')); } } showCompletionReport(projectPath, analysis) { - console.log(chalk.bold.green("\n✓ Upgrade Complete!\n")); - console.log(chalk.bold("Summary:")); + console.log(chalk.bold.green('\n✓ Upgrade Complete!\n')); + console.log(chalk.bold('Summary:')); console.log(`- V3 files backed up to: .bmad-v3-backup/`); console.log(`- V4 structure installed: .bmad-core/ (fresh from V4)`); @@ -596,50 +527,36 @@ class V3ToV4Upgrader { analysis.storyFiles.length; console.log( `- Documents migrated: ${totalDocs} files${ - analysis.epicFiles.length > 0 - ? ` + ${analysis.epicFiles.length} epics` - : "" - }` + analysis.epicFiles.length > 0 ? ` + ${analysis.epicFiles.length} epics` : '' + }`, ); - console.log(chalk.bold("\nImportant Changes:")); - console.log( - "- The V4 agents (sm, dev, etc.) expect different file structures than V3" - ); - console.log( - "- Your V3 bmad-agent content was NOT migrated (it's incompatible)" - ); + console.log(chalk.bold('\nImportant Changes:')); + console.log('- The V4 agents (sm, dev, etc.) expect different file structures than V3'); + console.log("- Your V3 bmad-agent content was NOT migrated (it's incompatible)"); if (analysis.epicFiles.length > 0) { - console.log( - "- Epic files were found and copied - no PRD sharding needed!" - ); + console.log('- Epic files were found and copied - no PRD sharding needed!'); } if (analysis.frontEndArchFile) { console.log( - "- Front-end architecture found - V4 uses full-stack-architecture.md, migration needed" + '- Front-end architecture found - V4 uses full-stack-architecture.md, migration needed', ); } if (analysis.uxSpecFile || analysis.uxPromptFile) { - console.log( - "- UX/UI design files found and copied - ready for use with V4" - ); + console.log('- UX/UI design files found and copied - ready for use with V4'); } - console.log(chalk.bold("\nNext Steps:")); - console.log("1. Review your documents in the new docs/ folder"); + console.log(chalk.bold('\nNext Steps:')); + console.log('1. Review your documents in the new docs/ folder'); console.log( - "2. Use @bmad-master agent to run the doc-migration-task to align your documents with V4 templates" + '2. Use @bmad-master agent to run the doc-migration-task to align your documents with V4 templates', ); if (analysis.epicFiles.length === 0) { - console.log( - "3. Use @bmad-master agent to shard the PRD to create epic files" - ); + console.log('3. Use @bmad-master agent to shard the PRD to create epic files'); } console.log( - chalk.dim( - "\nYour V3 backup is preserved in .bmad-v3-backup/ and can be restored if needed." - ) + chalk.dim('\nYour V3 backup is preserved in .bmad-v3-backup/ and can be restored if needed.'), ); } @@ -652,67 +569,61 @@ class V3ToV4Upgrader { } } - async copyDirectory(src, dest) { - await fs.mkdir(dest, { recursive: true }); - const entries = await fs.readdir(src, { withFileTypes: true }); + async copyDirectory(source, destination) { + await fs.mkdir(destination, { recursive: true }); + const entries = await fs.readdir(source, { withFileTypes: true }); for (const entry of entries) { - const srcPath = path.join(src, entry.name); - const destPath = path.join(dest, entry.name); + const sourcePath = path.join(source, entry.name); + const destinationPath = path.join(destination, entry.name); - if (entry.isDirectory()) { - await this.copyDirectory(srcPath, destPath); - } else { - await fs.copyFile(srcPath, destPath); - } + await (entry.isDirectory() + ? this.copyDirectory(sourcePath, destinationPath) + : fs.copyFile(sourcePath, destinationPath)); } } async createPrdIndex(projectPath, analysis) { - const prdIndexPath = path.join(projectPath, "docs", "prd", "index.md"); - const prdPath = path.join( - projectPath, - "docs", - analysis.prdFile || "prd.md" - ); + const prdIndexPath = path.join(projectPath, 'docs', 'prd', 'index.md'); + const prdPath = path.join(projectPath, 'docs', analysis.prdFile || 'prd.md'); - let indexContent = "# Product Requirements Document\n\n"; + let indexContent = '# Product Requirements Document\n\n'; // Try to read the PRD to get the title and intro content if (analysis.prdFile && (await this.pathExists(prdPath))) { try { - const prdContent = await fs.readFile(prdPath, "utf8"); - const lines = prdContent.split("\n"); + const prdContent = await fs.readFile(prdPath, 'utf8'); + const lines = prdContent.split('\n'); // Find the first heading - const titleMatch = lines.find((line) => line.startsWith("# ")); + const titleMatch = lines.find((line) => line.startsWith('# ')); if (titleMatch) { - indexContent = titleMatch + "\n\n"; + indexContent = titleMatch + '\n\n'; } // Get any content before the first ## section - let introContent = ""; + let introContent = ''; let foundFirstSection = false; for (const line of lines) { - if (line.startsWith("## ")) { + if (line.startsWith('## ')) { foundFirstSection = true; break; } - if (!line.startsWith("# ")) { - introContent += line + "\n"; + if (!line.startsWith('# ')) { + introContent += line + '\n'; } } if (introContent.trim()) { - indexContent += introContent.trim() + "\n\n"; + indexContent += introContent.trim() + '\n\n'; } - } catch (error) { + } catch { // If we can't read the PRD, just use default content } } // Add sections list - indexContent += "## Sections\n\n"; + indexContent += '## Sections\n\n'; // Sort epic files for consistent ordering const sortedEpics = [...analysis.epicFiles].sort(); @@ -720,38 +631,36 @@ class V3ToV4Upgrader { for (const epicFile of sortedEpics) { // Extract epic name from filename const epicName = epicFile - .replace(/\.md$/, "") - .replace(/^epic-?/i, "") - .replace(/-/g, " ") - .replace(/^\d+\s*/, "") // Remove leading numbers + .replace(/\.md$/, '') + .replace(/^epic-?/i, '') + .replaceAll('-', ' ') + .replace(/^\d+\s*/, '') // Remove leading numbers .trim(); const displayName = epicName.charAt(0).toUpperCase() + epicName.slice(1); - indexContent += `- [${ - displayName || epicFile.replace(".md", "") - }](./${epicFile})\n`; + indexContent += `- [${displayName || epicFile.replace('.md', '')}](./${epicFile})\n`; } await fs.writeFile(prdIndexPath, indexContent); } async createInstallManifest(projectPath) { - const fileManager = require("../installer/lib/file-manager"); - const { glob } = require("glob"); + const fileManager = require('../installer/lib/file-manager'); + const { glob } = require('glob'); // Get all files in .bmad-core for the manifest - const bmadCorePath = path.join(projectPath, ".bmad-core"); - const files = await glob("**/*", { + const bmadCorePath = path.join(projectPath, '.bmad-core'); + const files = await glob('**/*', { cwd: bmadCorePath, nodir: true, - ignore: ["**/.git/**", "**/node_modules/**"], + ignore: ['**/.git/**', '**/node_modules/**'], }); // Prepend .bmad-core/ to file paths for manifest - const manifestFiles = files.map((file) => path.join(".bmad-core", file)); + const manifestFiles = files.map((file) => path.join('.bmad-core', file)); const config = { - installType: "full", + installType: 'full', agent: null, ide: null, // Will be set if IDE setup is done later }; diff --git a/tools/version-bump.js b/tools/version-bump.js index ba8ce3b0..c6ce4eb4 100755 --- a/tools/version-bump.js +++ b/tools/version-bump.js @@ -1,8 +1,6 @@ -#!/usr/bin/env node - -const fs = require('fs'); -const { execSync } = require('child_process'); -const path = require('path'); +const fs = require('node:fs'); +const { execSync } = require('node:child_process'); +const path = require('node:path'); // Dynamic import for ES module let chalk; @@ -26,7 +24,7 @@ function getCurrentVersion() { async function bumpVersion(type = 'patch') { await initializeModules(); - + const validTypes = ['patch', 'minor', 'major']; if (!validTypes.includes(type)) { console.error(chalk.red(`Invalid version type: ${type}. Use: ${validTypes.join(', ')}`)); @@ -43,37 +41,37 @@ async function bumpVersion(type = 'patch') { console.log(''); console.log(chalk.dim('Example: git commit -m "feat: add new installer features"')); console.log(chalk.dim('Then push to main branch to trigger automatic release.')); - + return null; } async function main() { await initializeModules(); - + const type = process.argv[2] || 'patch'; const currentVersion = getCurrentVersion(); - + console.log(chalk.blue(`Current version: ${currentVersion}`)); - + // Check if working directory is clean try { execSync('git diff-index --quiet HEAD --'); - } catch (error) { + } catch { console.error(chalk.red('❌ Working directory is not clean. Commit your changes first.')); process.exit(1); } - + const newVersion = await bumpVersion(type); - + console.log(chalk.green(`\n🎉 Version bump complete!`)); console.log(chalk.blue(`📦 ${currentVersion} → ${newVersion}`)); } if (require.main === module) { - main().catch(error => { + main().catch((error) => { console.error('Error:', error); process.exit(1); }); } -module.exports = { bumpVersion, getCurrentVersion }; \ No newline at end of file +module.exports = { bumpVersion, getCurrentVersion }; diff --git a/tools/yaml-format.js b/tools/yaml-format.js index 4b24f39e..8ede68f4 100755 --- a/tools/yaml-format.js +++ b/tools/yaml-format.js @@ -1,9 +1,7 @@ -#!/usr/bin/env node - -const fs = require('fs'); -const path = require('path'); +const fs = require('node:fs'); +const path = require('node:path'); const yaml = require('js-yaml'); -const { execSync } = require('child_process'); +const { execSync } = require('node:child_process'); // Dynamic import for ES module let chalk; @@ -26,43 +24,50 @@ async function formatYamlContent(content, filename) { // First try to fix common YAML issues let fixedContent = content // Fix "commands :" -> "commands:" - .replace(/^(\s*)(\w+)\s+:/gm, '$1$2:') + .replaceAll(/^(\s*)(\w+)\s+:/gm, '$1$2:') // Fix inconsistent list indentation - .replace(/^(\s*)-\s{3,}/gm, '$1- '); - + .replaceAll(/^(\s*)-\s{3,}/gm, '$1- '); + // Skip auto-fixing for .roomodes files - they have special nested structure if (!filename.includes('.roomodes')) { fixedContent = fixedContent // Fix unquoted list items that contain special characters or multiple parts - .replace(/^(\s*)-\s+(.*)$/gm, (match, indent, content) => { + .replaceAll(/^(\s*)-\s+(.*)$/gm, (match, indent, content) => { // Skip if already quoted if (content.startsWith('"') && content.endsWith('"')) { return match; } // If the content contains special YAML characters or looks complex, quote it // BUT skip if it looks like a proper YAML key-value pair (like "key: value") - if ((content.includes(':') || content.includes('-') || content.includes('{') || content.includes('}')) && - !content.match(/^\w+:\s/)) { + if ( + (content.includes(':') || + content.includes('-') || + content.includes('{') || + content.includes('}')) && + !/^\w+:\s/.test(content) + ) { // Remove any existing quotes first, escape internal quotes, then add proper quotes - const cleanContent = content.replace(/^["']|["']$/g, '').replace(/"/g, '\\"'); + const cleanContent = content + .replaceAll(/^["']|["']$/g, '') + .replaceAll('"', String.raw`\"`); return `${indent}- "${cleanContent}"`; } return match; }); } - + // Debug: show what we're trying to parse if (fixedContent !== content) { console.log(chalk.blue(`🔧 Applied YAML fixes to ${filename}`)); } - + // Parse and re-dump YAML to format it const parsed = yaml.load(fixedContent); const formatted = yaml.dump(parsed, { indent: 2, lineWidth: -1, // Disable line wrapping noRefs: true, - sortKeys: false // Preserve key order + sortKeys: false, // Preserve key order }); return formatted; } catch (error) { @@ -80,7 +85,7 @@ async function processMarkdownFile(filePath) { // Fix untyped code blocks by adding 'text' type // Match ``` at start of line followed by newline, but only if it's an opening fence - newContent = newContent.replace(/^```\n([\s\S]*?)\n```$/gm, '```text\n$1\n```'); + newContent = newContent.replaceAll(/^```\n([\s\S]*?)\n```$/gm, '```text\n$1\n```'); if (newContent !== content) { modified = true; console.log(chalk.blue(`🔧 Added 'text' type to untyped code blocks in ${filePath}`)); @@ -90,30 +95,30 @@ async function processMarkdownFile(filePath) { const yamlBlockRegex = /```ya?ml\n([\s\S]*?)\n```/g; let match; const replacements = []; - + while ((match = yamlBlockRegex.exec(newContent)) !== null) { const [fullMatch, yamlContent] = match; const formatted = await formatYamlContent(yamlContent, filePath); if (formatted !== null) { // Remove trailing newline that js-yaml adds const trimmedFormatted = formatted.replace(/\n$/, ''); - + if (trimmedFormatted !== yamlContent) { modified = true; console.log(chalk.green(`✓ Formatted YAML in ${filePath}`)); } - + replacements.push({ start: match.index, end: match.index + fullMatch.length, - replacement: `\`\`\`yaml\n${trimmedFormatted}\n\`\`\`` + replacement: `\`\`\`yaml\n${trimmedFormatted}\n\`\`\``, }); } } - + // Apply replacements in reverse order to maintain indices - for (let i = replacements.length - 1; i >= 0; i--) { - const { start, end, replacement } = replacements[i]; + for (let index = replacements.length - 1; index >= 0; index--) { + const { start, end, replacement } = replacements[index]; newContent = newContent.slice(0, start) + replacement + newContent.slice(end); } @@ -128,11 +133,11 @@ async function processYamlFile(filePath) { await initializeModules(); const content = fs.readFileSync(filePath, 'utf8'); const formatted = await formatYamlContent(content, filePath); - + if (formatted === null) { return false; // Syntax error } - + if (formatted !== content) { fs.writeFileSync(filePath, formatted); return true; @@ -155,10 +160,10 @@ async function lintYamlFile(filePath) { async function main() { await initializeModules(); - const args = process.argv.slice(2); + const arguments_ = process.argv.slice(2); const glob = require('glob'); - - if (args.length === 0) { + + if (arguments_.length === 0) { console.error('Usage: node yaml-format.js [file2] ...'); process.exit(1); } @@ -169,38 +174,44 @@ async function main() { // Expand glob patterns and collect all files const allFiles = []; - for (const arg of args) { - if (arg.includes('*')) { + for (const argument of arguments_) { + if (argument.includes('*')) { // It's a glob pattern - const matches = glob.sync(arg); + const matches = glob.sync(argument); allFiles.push(...matches); } else { // It's a direct file path - allFiles.push(arg); + allFiles.push(argument); } } for (const filePath of allFiles) { if (!fs.existsSync(filePath)) { // Skip silently for glob patterns that don't match anything - if (!args.some(arg => arg.includes('*') && filePath === arg)) { + if (!arguments_.some((argument) => argument.includes('*') && filePath === argument)) { console.error(chalk.red(`❌ File not found: ${filePath}`)); hasErrors = true; } continue; } - const ext = path.extname(filePath).toLowerCase(); + const extension = path.extname(filePath).toLowerCase(); const basename = path.basename(filePath).toLowerCase(); - + try { let changed = false; - if (ext === '.md') { + if (extension === '.md') { changed = await processMarkdownFile(filePath); - } else if (ext === '.yaml' || ext === '.yml' || basename.includes('roomodes') || basename.includes('.yaml') || basename.includes('.yml')) { + } else if ( + extension === '.yaml' || + extension === '.yml' || + basename.includes('roomodes') || + basename.includes('.yaml') || + basename.includes('.yml') + ) { // Handle YAML files and special cases like .roomodes changed = await processYamlFile(filePath); - + // Also run linting const lintPassed = await lintYamlFile(filePath); if (!lintPassed) hasErrors = true; @@ -208,7 +219,7 @@ async function main() { // Skip silently for unsupported files continue; } - + if (changed) { hasChanges = true; filesProcessed.push(filePath); @@ -220,8 +231,10 @@ async function main() { } if (hasChanges) { - console.log(chalk.green(`\n✨ YAML formatting completed! Modified ${filesProcessed.length} files:`)); - filesProcessed.forEach(file => console.log(chalk.blue(` 📝 ${file}`))); + console.log( + chalk.green(`\n✨ YAML formatting completed! Modified ${filesProcessed.length} files:`), + ); + for (const file of filesProcessed) console.log(chalk.blue(` 📝 ${file}`)); } if (hasErrors) { @@ -231,10 +244,10 @@ async function main() { } if (require.main === module) { - main().catch(error => { + main().catch((error) => { console.error('Error:', error); process.exit(1); }); } -module.exports = { formatYamlContent, processMarkdownFile, processYamlFile }; \ No newline at end of file +module.exports = { formatYamlContent, processMarkdownFile, processYamlFile };