bmad-method 4.37.0-beta.6 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/promote-to-stable.yml +144 -0
- package/CHANGELOG.md +27 -2
- package/bmad-core/agents/analyst.md +1 -1
- package/bmad-core/agents/architect.md +2 -3
- package/bmad-core/agents/bmad-master.md +0 -1
- package/bmad-core/agents/bmad-orchestrator.md +9 -10
- package/bmad-core/agents/dev.md +9 -10
- package/bmad-core/agents/po.md +1 -1
- package/bmad-core/agents/qa.md +38 -19
- package/bmad-core/agents/sm.md +1 -1
- package/bmad-core/agents/ux-expert.md +1 -1
- package/bmad-core/checklists/architect-checklist.md +0 -5
- package/bmad-core/checklists/pm-checklist.md +0 -5
- package/bmad-core/checklists/po-master-checklist.md +0 -9
- package/bmad-core/checklists/story-dod-checklist.md +0 -7
- package/bmad-core/checklists/story-draft-checklist.md +0 -3
- package/bmad-core/data/bmad-kb.md +5 -2
- package/bmad-core/data/elicitation-methods.md +20 -0
- package/bmad-core/data/test-levels-framework.md +146 -0
- package/bmad-core/data/test-priorities-matrix.md +172 -0
- package/bmad-core/tasks/create-brownfield-story.md +11 -3
- package/bmad-core/tasks/create-deep-research-prompt.md +0 -11
- package/bmad-core/tasks/document-project.md +15 -13
- package/bmad-core/tasks/facilitate-brainstorming-session.md +1 -1
- package/bmad-core/tasks/index-docs.md +0 -6
- package/bmad-core/tasks/kb-mode-interaction.md +3 -3
- package/bmad-core/tasks/nfr-assess.md +343 -0
- package/bmad-core/tasks/qa-gate.md +159 -0
- package/bmad-core/tasks/review-story.md +243 -74
- package/bmad-core/tasks/risk-profile.md +353 -0
- package/bmad-core/tasks/shard-doc.md +0 -2
- package/bmad-core/tasks/test-design.md +174 -0
- package/bmad-core/tasks/trace-requirements.md +264 -0
- package/bmad-core/templates/qa-gate-tmpl.yaml +102 -0
- package/common/tasks/execute-checklist.md +0 -7
- package/dist/agents/analyst.txt +20 -26
- package/dist/agents/architect.txt +14 -35
- package/dist/agents/bmad-master.txt +40 -70
- package/dist/agents/bmad-orchestrator.txt +28 -5
- package/dist/agents/dev.txt +0 -14
- package/dist/agents/pm.txt +0 -25
- package/dist/agents/po.txt +0 -18
- package/dist/agents/qa.txt +2079 -135
- package/dist/agents/sm.txt +0 -10
- package/dist/agents/ux-expert.txt +0 -7
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +0 -37
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +3 -12
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +0 -7
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +44 -90
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt +14 -49
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt +0 -46
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.txt +0 -15
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.txt +0 -17
- package/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt +38 -142
- package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +0 -2
- package/dist/teams/team-all.txt +2181 -261
- package/dist/teams/team-fullstack.txt +43 -57
- package/dist/teams/team-ide-minimal.txt +2064 -125
- package/dist/teams/team-no-ui.txt +43 -57
- package/docs/enhanced-ide-development-workflow.md +220 -15
- package/docs/user-guide.md +271 -18
- package/docs/working-in-the-brownfield.md +265 -32
- package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/README.md +14 -14
- package/expansion-packs/bmad-2d-phaser-game-dev/data/bmad-kb.md +0 -4
- package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +3 -5
- package/expansion-packs/bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md +0 -1
- package/expansion-packs/bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md +0 -18
- package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-architect-checklist.md +0 -5
- package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-story-dod-checklist.md +0 -8
- package/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md +0 -7
- package/expansion-packs/bmad-2d-unity-game-dev/data/development-guidelines.md +0 -4
- package/expansion-packs/bmad-2d-unity-game-dev/tasks/advanced-elicitation.md +0 -1
- package/expansion-packs/bmad-2d-unity-game-dev/tasks/correct-course-game.md +0 -10
- package/expansion-packs/bmad-2d-unity-game-dev/tasks/game-design-brainstorming.md +0 -18
- package/expansion-packs/bmad-infrastructure-devops/data/bmad-kb.md +0 -3
- package/expansion-packs/bmad-infrastructure-devops/tasks/review-infrastructure.md +0 -1
- package/expansion-packs/bmad-infrastructure-devops/tasks/validate-infrastructure.md +0 -1
- package/package.json +1 -1
- package/tools/installer/bin/bmad.js +33 -32
- package/tools/installer/config/install.config.yaml +11 -1
- package/tools/installer/lib/file-manager.js +1 -1
- package/tools/installer/lib/ide-base-setup.js +1 -1
- package/tools/installer/lib/ide-setup.js +197 -83
- package/tools/installer/lib/installer.js +3 -3
- package/tools/installer/package.json +1 -1
|
@@ -354,41 +354,60 @@ activation-instructions:
|
|
|
354
354
|
agent:
|
|
355
355
|
name: Quinn
|
|
356
356
|
id: qa
|
|
357
|
-
title:
|
|
357
|
+
title: Test Architect & Quality Advisor
|
|
358
358
|
icon: 🧪
|
|
359
|
-
whenToUse:
|
|
359
|
+
whenToUse: |
|
|
360
|
+
Use for comprehensive test architecture review, quality gate decisions,
|
|
361
|
+
and code improvement. Provides thorough analysis including requirements
|
|
362
|
+
traceability, risk assessment, and test strategy.
|
|
363
|
+
Advisory only - teams choose their quality bar.
|
|
360
364
|
customization: null
|
|
361
365
|
persona:
|
|
362
|
-
role:
|
|
363
|
-
style:
|
|
364
|
-
identity:
|
|
365
|
-
focus:
|
|
366
|
+
role: Test Architect with Quality Advisory Authority
|
|
367
|
+
style: Comprehensive, systematic, advisory, educational, pragmatic
|
|
368
|
+
identity: Test architect who provides thorough quality assessment and actionable recommendations without blocking progress
|
|
369
|
+
focus: Comprehensive quality analysis through test architecture, risk assessment, and advisory gates
|
|
366
370
|
core_principles:
|
|
367
|
-
-
|
|
368
|
-
-
|
|
369
|
-
-
|
|
370
|
-
-
|
|
371
|
-
-
|
|
372
|
-
-
|
|
373
|
-
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
371
|
+
- Depth As Needed - Go deep based on risk signals, stay concise when low risk
|
|
372
|
+
- Requirements Traceability - Map all stories to tests using Given-When-Then patterns
|
|
373
|
+
- Risk-Based Testing - Assess and prioritize by probability × impact
|
|
374
|
+
- Quality Attributes - Validate NFRs (security, performance, reliability) via scenarios
|
|
375
|
+
- Testability Assessment - Evaluate controllability, observability, debuggability
|
|
376
|
+
- Gate Governance - Provide clear PASS/CONCERNS/FAIL/WAIVED decisions with rationale
|
|
377
|
+
- Advisory Excellence - Educate through documentation, never block arbitrarily
|
|
378
|
+
- Technical Debt Awareness - Identify and quantify debt with improvement suggestions
|
|
379
|
+
- LLM Acceleration - Use LLMs to accelerate thorough yet focused analysis
|
|
380
|
+
- Pragmatic Balance - Distinguish must-fix from nice-to-have improvements
|
|
377
381
|
story-file-permissions:
|
|
378
382
|
- CRITICAL: When reviewing stories, you are ONLY authorized to update the "QA Results" section of story files
|
|
379
383
|
- CRITICAL: DO NOT modify any other sections including Status, Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Testing, Dev Agent Record, Change Log, or any other sections
|
|
380
384
|
- CRITICAL: Your updates must be limited to appending your review results in the QA Results section only
|
|
381
385
|
commands:
|
|
382
386
|
- help: Show numbered list of the following commands to allow selection
|
|
383
|
-
- review {story}:
|
|
384
|
-
|
|
387
|
+
- review {story}: |
|
|
388
|
+
Adaptive, risk-aware comprehensive review.
|
|
389
|
+
Produces: QA Results update in story file + gate file (PASS/CONCERNS/FAIL/WAIVED).
|
|
390
|
+
Gate file location: docs/qa/gates/{epic}.{story}-{slug}.yml
|
|
391
|
+
Executes review-story task which includes all analysis and creates gate decision.
|
|
392
|
+
- gate {story}: Execute qa-gate task to write/update quality gate decision in docs/qa/gates/
|
|
393
|
+
- trace {story}: Execute trace-requirements task to map requirements to tests using Given-When-Then
|
|
394
|
+
- risk-profile {story}: Execute risk-profile task to generate risk assessment matrix
|
|
395
|
+
- test-design {story}: Execute test-design task to create comprehensive test scenarios
|
|
396
|
+
- nfr-assess {story}: Execute nfr-assess task to validate non-functional requirements
|
|
397
|
+
- exit: Say goodbye as the Test Architect, and then abandon inhabiting this persona
|
|
385
398
|
dependencies:
|
|
386
399
|
tasks:
|
|
387
400
|
- review-story.md
|
|
401
|
+
- qa-gate.md
|
|
402
|
+
- trace-requirements.md
|
|
403
|
+
- risk-profile.md
|
|
404
|
+
- test-design.md
|
|
405
|
+
- nfr-assess.md
|
|
388
406
|
data:
|
|
389
407
|
- technical-preferences.md
|
|
390
408
|
templates:
|
|
391
409
|
- story-tmpl.yaml
|
|
410
|
+
- qa-gate-tmpl.yaml
|
|
392
411
|
```
|
|
393
412
|
==================== END: .bmad-core/agents/qa.md ====================
|
|
394
413
|
|
|
@@ -625,7 +644,7 @@ Provide a user-friendly interface to the BMad knowledge base without overwhelmin
|
|
|
625
644
|
|
|
626
645
|
## Instructions
|
|
627
646
|
|
|
628
|
-
When entering KB mode (
|
|
647
|
+
When entering KB mode (\*kb-mode), follow these steps:
|
|
629
648
|
|
|
630
649
|
### 1. Welcome and Guide
|
|
631
650
|
|
|
@@ -667,12 +686,12 @@ Or ask me about anything else related to BMad-Method!
|
|
|
667
686
|
When user is done or wants to exit KB mode:
|
|
668
687
|
|
|
669
688
|
- Summarize key points discussed if helpful
|
|
670
|
-
- Remind them they can return to KB mode anytime with
|
|
689
|
+
- Remind them they can return to KB mode anytime with \*kb-mode
|
|
671
690
|
- Suggest next steps based on what was discussed
|
|
672
691
|
|
|
673
692
|
## Example Interaction
|
|
674
693
|
|
|
675
|
-
**User**:
|
|
694
|
+
**User**: \*kb-mode
|
|
676
695
|
|
|
677
696
|
**Assistant**: I've entered KB mode and have access to the full BMad knowledge base. I can help you with detailed information about any aspect of BMad-Method.
|
|
678
697
|
|
|
@@ -1239,7 +1258,7 @@ Each status change requires user verification and approval before proceeding.
|
|
|
1239
1258
|
#### Greenfield Development
|
|
1240
1259
|
|
|
1241
1260
|
- Business analysis and market research
|
|
1242
|
-
- Product requirements and feature definition
|
|
1261
|
+
- Product requirements and feature definition
|
|
1243
1262
|
- System architecture and design
|
|
1244
1263
|
- Development execution
|
|
1245
1264
|
- Testing and deployment
|
|
@@ -1348,8 +1367,11 @@ Templates with Level 2 headings (`##`) can be automatically sharded:
|
|
|
1348
1367
|
|
|
1349
1368
|
```markdown
|
|
1350
1369
|
## Goals and Background Context
|
|
1351
|
-
|
|
1370
|
+
|
|
1371
|
+
## Requirements
|
|
1372
|
+
|
|
1352
1373
|
## User Interface Design Goals
|
|
1374
|
+
|
|
1353
1375
|
## Success Metrics
|
|
1354
1376
|
```
|
|
1355
1377
|
|
|
@@ -1506,16 +1528,19 @@ Use the **expansion-creator** pack to build your own:
|
|
|
1506
1528
|
## Core Reflective Methods
|
|
1507
1529
|
|
|
1508
1530
|
**Expand or Contract for Audience**
|
|
1531
|
+
|
|
1509
1532
|
- Ask whether to 'expand' (add detail, elaborate) or 'contract' (simplify, clarify)
|
|
1510
1533
|
- Identify specific target audience if relevant
|
|
1511
1534
|
- Tailor content complexity and depth accordingly
|
|
1512
1535
|
|
|
1513
1536
|
**Explain Reasoning (CoT Step-by-Step)**
|
|
1537
|
+
|
|
1514
1538
|
- Walk through the step-by-step thinking process
|
|
1515
1539
|
- Reveal underlying assumptions and decision points
|
|
1516
1540
|
- Show how conclusions were reached from current role's perspective
|
|
1517
1541
|
|
|
1518
1542
|
**Critique and Refine**
|
|
1543
|
+
|
|
1519
1544
|
- Review output for flaws, inconsistencies, or improvement areas
|
|
1520
1545
|
- Identify specific weaknesses from role's expertise
|
|
1521
1546
|
- Suggest refined version reflecting domain knowledge
|
|
@@ -1523,12 +1548,14 @@ Use the **expansion-creator** pack to build your own:
|
|
|
1523
1548
|
## Structural Analysis Methods
|
|
1524
1549
|
|
|
1525
1550
|
**Analyze Logical Flow and Dependencies**
|
|
1551
|
+
|
|
1526
1552
|
- Examine content structure for logical progression
|
|
1527
1553
|
- Check internal consistency and coherence
|
|
1528
1554
|
- Identify and validate dependencies between elements
|
|
1529
1555
|
- Confirm effective ordering and sequencing
|
|
1530
1556
|
|
|
1531
1557
|
**Assess Alignment with Overall Goals**
|
|
1558
|
+
|
|
1532
1559
|
- Evaluate content contribution to stated objectives
|
|
1533
1560
|
- Identify any misalignments or gaps
|
|
1534
1561
|
- Interpret alignment from specific role's perspective
|
|
@@ -1537,12 +1564,14 @@ Use the **expansion-creator** pack to build your own:
|
|
|
1537
1564
|
## Risk and Challenge Methods
|
|
1538
1565
|
|
|
1539
1566
|
**Identify Potential Risks and Unforeseen Issues**
|
|
1567
|
+
|
|
1540
1568
|
- Brainstorm potential risks from role's expertise
|
|
1541
1569
|
- Identify overlooked edge cases or scenarios
|
|
1542
1570
|
- Anticipate unintended consequences
|
|
1543
1571
|
- Highlight implementation challenges
|
|
1544
1572
|
|
|
1545
1573
|
**Challenge from Critical Perspective**
|
|
1574
|
+
|
|
1546
1575
|
- Adopt critical stance on current content
|
|
1547
1576
|
- Play devil's advocate from specified viewpoint
|
|
1548
1577
|
- Argue against proposal highlighting weaknesses
|
|
@@ -1551,12 +1580,14 @@ Use the **expansion-creator** pack to build your own:
|
|
|
1551
1580
|
## Creative Exploration Methods
|
|
1552
1581
|
|
|
1553
1582
|
**Tree of Thoughts Deep Dive**
|
|
1583
|
+
|
|
1554
1584
|
- Break problem into discrete "thoughts" or intermediate steps
|
|
1555
1585
|
- Explore multiple reasoning paths simultaneously
|
|
1556
1586
|
- Use self-evaluation to classify each path as "sure", "likely", or "impossible"
|
|
1557
1587
|
- Apply search algorithms (BFS/DFS) to find optimal solution paths
|
|
1558
1588
|
|
|
1559
1589
|
**Hindsight is 20/20: The 'If Only...' Reflection**
|
|
1590
|
+
|
|
1560
1591
|
- Imagine retrospective scenario based on current content
|
|
1561
1592
|
- Identify the one "if only we had known/done X..." insight
|
|
1562
1593
|
- Describe imagined consequences humorously or dramatically
|
|
@@ -1565,6 +1596,7 @@ Use the **expansion-creator** pack to build your own:
|
|
|
1565
1596
|
## Multi-Persona Collaboration Methods
|
|
1566
1597
|
|
|
1567
1598
|
**Agile Team Perspective Shift**
|
|
1599
|
+
|
|
1568
1600
|
- Rotate through different Scrum team member viewpoints
|
|
1569
1601
|
- Product Owner: Focus on user value and business impact
|
|
1570
1602
|
- Scrum Master: Examine process flow and team dynamics
|
|
@@ -1572,12 +1604,14 @@ Use the **expansion-creator** pack to build your own:
|
|
|
1572
1604
|
- QA: Identify testing scenarios and quality concerns
|
|
1573
1605
|
|
|
1574
1606
|
**Stakeholder Round Table**
|
|
1607
|
+
|
|
1575
1608
|
- Convene virtual meeting with multiple personas
|
|
1576
1609
|
- Each persona contributes unique perspective on content
|
|
1577
1610
|
- Identify conflicts and synergies between viewpoints
|
|
1578
1611
|
- Synthesize insights into actionable recommendations
|
|
1579
1612
|
|
|
1580
1613
|
**Meta-Prompting Analysis**
|
|
1614
|
+
|
|
1581
1615
|
- Step back to analyze the structure and logic of current approach
|
|
1582
1616
|
- Question the format and methodology being used
|
|
1583
1617
|
- Suggest alternative frameworks or mental models
|
|
@@ -1586,24 +1620,28 @@ Use the **expansion-creator** pack to build your own:
|
|
|
1586
1620
|
## Advanced 2025 Techniques
|
|
1587
1621
|
|
|
1588
1622
|
**Self-Consistency Validation**
|
|
1623
|
+
|
|
1589
1624
|
- Generate multiple reasoning paths for same problem
|
|
1590
1625
|
- Compare consistency across different approaches
|
|
1591
1626
|
- Identify most reliable and robust solution
|
|
1592
1627
|
- Highlight areas where approaches diverge and why
|
|
1593
1628
|
|
|
1594
1629
|
**ReWOO (Reasoning Without Observation)**
|
|
1630
|
+
|
|
1595
1631
|
- Separate parametric reasoning from tool-based actions
|
|
1596
1632
|
- Create reasoning plan without external dependencies
|
|
1597
1633
|
- Identify what can be solved through pure reasoning
|
|
1598
1634
|
- Optimize for efficiency and reduced token usage
|
|
1599
1635
|
|
|
1600
1636
|
**Persona-Pattern Hybrid**
|
|
1637
|
+
|
|
1601
1638
|
- Combine specific role expertise with elicitation pattern
|
|
1602
1639
|
- Architect + Risk Analysis: Deep technical risk assessment
|
|
1603
1640
|
- UX Expert + User Journey: End-to-end experience critique
|
|
1604
1641
|
- PM + Stakeholder Analysis: Multi-perspective impact review
|
|
1605
1642
|
|
|
1606
1643
|
**Emergent Collaboration Discovery**
|
|
1644
|
+
|
|
1607
1645
|
- Allow multiple perspectives to naturally emerge
|
|
1608
1646
|
- Identify unexpected insights from persona interactions
|
|
1609
1647
|
- Explore novel combinations of viewpoints
|
|
@@ -1612,18 +1650,21 @@ Use the **expansion-creator** pack to build your own:
|
|
|
1612
1650
|
## Game-Based Elicitation Methods
|
|
1613
1651
|
|
|
1614
1652
|
**Red Team vs Blue Team**
|
|
1653
|
+
|
|
1615
1654
|
- Red Team: Attack the proposal, find vulnerabilities
|
|
1616
1655
|
- Blue Team: Defend and strengthen the approach
|
|
1617
1656
|
- Competitive analysis reveals blind spots
|
|
1618
1657
|
- Results in more robust, battle-tested solutions
|
|
1619
1658
|
|
|
1620
1659
|
**Innovation Tournament**
|
|
1660
|
+
|
|
1621
1661
|
- Pit multiple alternative approaches against each other
|
|
1622
1662
|
- Score each approach across different criteria
|
|
1623
1663
|
- Crowd-source evaluation from different personas
|
|
1624
1664
|
- Identify winning combination of features
|
|
1625
1665
|
|
|
1626
1666
|
**Escape Room Challenge**
|
|
1667
|
+
|
|
1627
1668
|
- Present content as constraints to work within
|
|
1628
1669
|
- Find creative solutions within tight limitations
|
|
1629
1670
|
- Identify minimum viable approach
|
|
@@ -1632,6 +1673,7 @@ Use the **expansion-creator** pack to build your own:
|
|
|
1632
1673
|
## Process Control
|
|
1633
1674
|
|
|
1634
1675
|
**Proceed / No Further Actions**
|
|
1676
|
+
|
|
1635
1677
|
- Acknowledge choice to finalize current work
|
|
1636
1678
|
- Accept output as-is or move to next step
|
|
1637
1679
|
- Prepare to continue without additional elicitation
|
|
@@ -1721,7 +1763,6 @@ If the user asks or does not specify a specific checklist, list the checklists a
|
|
|
1721
1763
|
## Instructions
|
|
1722
1764
|
|
|
1723
1765
|
1. **Initial Assessment**
|
|
1724
|
-
|
|
1725
1766
|
- If user or the task being run provides a checklist name:
|
|
1726
1767
|
- Try fuzzy matching (e.g. "architecture checklist" -> "architect-checklist")
|
|
1727
1768
|
- If multiple matches found, ask user to clarify
|
|
@@ -1734,14 +1775,12 @@ If the user asks or does not specify a specific checklist, list the checklists a
|
|
|
1734
1775
|
- All at once (YOLO mode - recommended for checklists, there will be a summary of sections at the end to discuss)
|
|
1735
1776
|
|
|
1736
1777
|
2. **Document and Artifact Gathering**
|
|
1737
|
-
|
|
1738
1778
|
- Each checklist will specify its required documents/artifacts at the beginning
|
|
1739
1779
|
- Follow the checklist's specific instructions for what to gather, generally a file can be resolved in the docs folder, if not or unsure, halt and ask or confirm with the user.
|
|
1740
1780
|
|
|
1741
1781
|
3. **Checklist Processing**
|
|
1742
1782
|
|
|
1743
1783
|
If in interactive mode:
|
|
1744
|
-
|
|
1745
1784
|
- Work through each section of the checklist one at a time
|
|
1746
1785
|
- For each section:
|
|
1747
1786
|
- Review all items in the section following instructions for that section embedded in the checklist
|
|
@@ -1750,7 +1789,6 @@ If the user asks or does not specify a specific checklist, list the checklists a
|
|
|
1750
1789
|
- Get user confirmation before proceeding to next section or if any thing major do we need to halt and take corrective action
|
|
1751
1790
|
|
|
1752
1791
|
If in YOLO mode:
|
|
1753
|
-
|
|
1754
1792
|
- Process all sections at once
|
|
1755
1793
|
- Create a comprehensive report of all findings
|
|
1756
1794
|
- Present the complete analysis to the user
|
|
@@ -1758,7 +1796,6 @@ If the user asks or does not specify a specific checklist, list the checklists a
|
|
|
1758
1796
|
4. **Validation Approach**
|
|
1759
1797
|
|
|
1760
1798
|
For each checklist item:
|
|
1761
|
-
|
|
1762
1799
|
- Read and understand the requirement
|
|
1763
1800
|
- Look for evidence in the documentation that satisfies the requirement
|
|
1764
1801
|
- Consider both explicit mentions and implicit coverage
|
|
@@ -1772,7 +1809,6 @@ If the user asks or does not specify a specific checklist, list the checklists a
|
|
|
1772
1809
|
5. **Section Analysis**
|
|
1773
1810
|
|
|
1774
1811
|
For each section:
|
|
1775
|
-
|
|
1776
1812
|
- think step by step to calculate pass rate
|
|
1777
1813
|
- Identify common themes in failed items
|
|
1778
1814
|
- Provide specific recommendations for improvement
|
|
@@ -1782,7 +1818,6 @@ If the user asks or does not specify a specific checklist, list the checklists a
|
|
|
1782
1818
|
6. **Final Report**
|
|
1783
1819
|
|
|
1784
1820
|
Prepare a summary that includes:
|
|
1785
|
-
|
|
1786
1821
|
- Overall checklist completion status
|
|
1787
1822
|
- Pass rates by section
|
|
1788
1823
|
- List of failed items with context
|
|
@@ -1899,13 +1934,11 @@ CRITICAL: Use proper parsing that understands markdown context. A ## inside a co
|
|
|
1899
1934
|
For each extracted section:
|
|
1900
1935
|
|
|
1901
1936
|
1. **Generate filename**: Convert the section heading to lowercase-dash-case
|
|
1902
|
-
|
|
1903
1937
|
- Remove special characters
|
|
1904
1938
|
- Replace spaces with dashes
|
|
1905
1939
|
- Example: "## Tech Stack" → `tech-stack.md`
|
|
1906
1940
|
|
|
1907
1941
|
2. **Adjust heading levels**:
|
|
1908
|
-
|
|
1909
1942
|
- The level 2 heading becomes level 1 (# instead of ##) in the sharded new document
|
|
1910
1943
|
- All subsection levels decrease by 1:
|
|
1911
1944
|
|
|
@@ -2356,12 +2389,10 @@ PROJECT TYPE DETECTION:
|
|
|
2356
2389
|
First, determine the project type by checking:
|
|
2357
2390
|
|
|
2358
2391
|
1. Is this a GREENFIELD project (new from scratch)?
|
|
2359
|
-
|
|
2360
2392
|
- Look for: New project initialization, no existing codebase references
|
|
2361
2393
|
- Check for: prd.md, architecture.md, new project setup stories
|
|
2362
2394
|
|
|
2363
2395
|
2. Is this a BROWNFIELD project (enhancing existing system)?
|
|
2364
|
-
|
|
2365
2396
|
- Look for: References to existing codebase, enhancement/modification language
|
|
2366
2397
|
- Check for: brownfield-prd.md, brownfield-architecture.md, existing system analysis
|
|
2367
2398
|
|
|
@@ -2695,7 +2726,6 @@ Ask the user if they want to work through the checklist:
|
|
|
2695
2726
|
Generate a comprehensive validation report that adapts to project type:
|
|
2696
2727
|
|
|
2697
2728
|
1. Executive Summary
|
|
2698
|
-
|
|
2699
2729
|
- Project type: [Greenfield/Brownfield] with [UI/No UI]
|
|
2700
2730
|
- Overall readiness (percentage)
|
|
2701
2731
|
- Go/No-Go recommendation
|
|
@@ -2705,42 +2735,36 @@ Generate a comprehensive validation report that adapts to project type:
|
|
|
2705
2735
|
2. Project-Specific Analysis
|
|
2706
2736
|
|
|
2707
2737
|
FOR GREENFIELD:
|
|
2708
|
-
|
|
2709
2738
|
- Setup completeness
|
|
2710
2739
|
- Dependency sequencing
|
|
2711
2740
|
- MVP scope appropriateness
|
|
2712
2741
|
- Development timeline feasibility
|
|
2713
2742
|
|
|
2714
2743
|
FOR BROWNFIELD:
|
|
2715
|
-
|
|
2716
2744
|
- Integration risk level (High/Medium/Low)
|
|
2717
2745
|
- Existing system impact assessment
|
|
2718
2746
|
- Rollback readiness
|
|
2719
2747
|
- User disruption potential
|
|
2720
2748
|
|
|
2721
2749
|
3. Risk Assessment
|
|
2722
|
-
|
|
2723
2750
|
- Top 5 risks by severity
|
|
2724
2751
|
- Mitigation recommendations
|
|
2725
2752
|
- Timeline impact of addressing issues
|
|
2726
2753
|
- [BROWNFIELD] Specific integration risks
|
|
2727
2754
|
|
|
2728
2755
|
4. MVP Completeness
|
|
2729
|
-
|
|
2730
2756
|
- Core features coverage
|
|
2731
2757
|
- Missing essential functionality
|
|
2732
2758
|
- Scope creep identified
|
|
2733
2759
|
- True MVP vs over-engineering
|
|
2734
2760
|
|
|
2735
2761
|
5. Implementation Readiness
|
|
2736
|
-
|
|
2737
2762
|
- Developer clarity score (1-10)
|
|
2738
2763
|
- Ambiguous requirements count
|
|
2739
2764
|
- Missing technical details
|
|
2740
2765
|
- [BROWNFIELD] Integration point clarity
|
|
2741
2766
|
|
|
2742
2767
|
6. Recommendations
|
|
2743
|
-
|
|
2744
2768
|
- Must-fix before development
|
|
2745
2769
|
- Should-fix for quality
|
|
2746
2770
|
- Consider for improvement
|
|
@@ -3209,19 +3233,16 @@ Note: We don't need every file listed - just the important ones.]]
|
|
|
3209
3233
|
Generate a concise validation report:
|
|
3210
3234
|
|
|
3211
3235
|
1. Quick Summary
|
|
3212
|
-
|
|
3213
3236
|
- Story readiness: READY / NEEDS REVISION / BLOCKED
|
|
3214
3237
|
- Clarity score (1-10)
|
|
3215
3238
|
- Major gaps identified
|
|
3216
3239
|
|
|
3217
3240
|
2. Fill in the validation table with:
|
|
3218
|
-
|
|
3219
3241
|
- PASS: Requirements clearly met
|
|
3220
3242
|
- PARTIAL: Some gaps but workable
|
|
3221
3243
|
- FAIL: Critical information missing
|
|
3222
3244
|
|
|
3223
3245
|
3. Specific Issues (if any)
|
|
3224
|
-
|
|
3225
3246
|
- List concrete problems to fix
|
|
3226
3247
|
- Suggest specific improvements
|
|
3227
3248
|
- Identify any blocking dependencies
|
|
@@ -3276,14 +3297,12 @@ The goal is quality delivery, not just checking boxes.]]
|
|
|
3276
3297
|
1. **Requirements Met:**
|
|
3277
3298
|
|
|
3278
3299
|
[[LLM: Be specific - list each requirement and whether it's complete]]
|
|
3279
|
-
|
|
3280
3300
|
- [ ] All functional requirements specified in the story are implemented.
|
|
3281
3301
|
- [ ] All acceptance criteria defined in the story are met.
|
|
3282
3302
|
|
|
3283
3303
|
2. **Coding Standards & Project Structure:**
|
|
3284
3304
|
|
|
3285
3305
|
[[LLM: Code quality matters for maintainability. Check each item carefully]]
|
|
3286
|
-
|
|
3287
3306
|
- [ ] All new/modified code strictly adheres to `Operational Guidelines`.
|
|
3288
3307
|
- [ ] All new/modified code aligns with `Project Structure` (file locations, naming, etc.).
|
|
3289
3308
|
- [ ] Adherence to `Tech Stack` for technologies/versions used (if story introduces or modifies tech usage).
|
|
@@ -3295,7 +3314,6 @@ The goal is quality delivery, not just checking boxes.]]
|
|
|
3295
3314
|
3. **Testing:**
|
|
3296
3315
|
|
|
3297
3316
|
[[LLM: Testing proves your code works. Be honest about test coverage]]
|
|
3298
|
-
|
|
3299
3317
|
- [ ] All required unit tests as per the story and `Operational Guidelines` Testing Strategy are implemented.
|
|
3300
3318
|
- [ ] All required integration tests (if applicable) as per the story and `Operational Guidelines` Testing Strategy are implemented.
|
|
3301
3319
|
- [ ] All tests (unit, integration, E2E if applicable) pass successfully.
|
|
@@ -3304,14 +3322,12 @@ The goal is quality delivery, not just checking boxes.]]
|
|
|
3304
3322
|
4. **Functionality & Verification:**
|
|
3305
3323
|
|
|
3306
3324
|
[[LLM: Did you actually run and test your code? Be specific about what you tested]]
|
|
3307
|
-
|
|
3308
3325
|
- [ ] Functionality has been manually verified by the developer (e.g., running the app locally, checking UI, testing API endpoints).
|
|
3309
3326
|
- [ ] Edge cases and potential error conditions considered and handled gracefully.
|
|
3310
3327
|
|
|
3311
3328
|
5. **Story Administration:**
|
|
3312
3329
|
|
|
3313
3330
|
[[LLM: Documentation helps the next developer. What should they know?]]
|
|
3314
|
-
|
|
3315
3331
|
- [ ] All tasks within the story file are marked as complete.
|
|
3316
3332
|
- [ ] Any clarifications or decisions made during development are documented in the story file or linked appropriately.
|
|
3317
3333
|
- [ ] The story wrap up section has been completed with notes of changes or information relevant to the next story or overall project, the agent model that was primarily used during development, and the changelog of any changes is properly updated.
|
|
@@ -3319,7 +3335,6 @@ The goal is quality delivery, not just checking boxes.]]
|
|
|
3319
3335
|
6. **Dependencies, Build & Configuration:**
|
|
3320
3336
|
|
|
3321
3337
|
[[LLM: Build issues block everyone. Ensure everything compiles and runs cleanly]]
|
|
3322
|
-
|
|
3323
3338
|
- [ ] Project builds successfully without errors.
|
|
3324
3339
|
- [ ] Project linting passes
|
|
3325
3340
|
- [ ] Any new dependencies added were either pre-approved in the story requirements OR explicitly approved by the user during development (approval documented in story file).
|
|
@@ -3330,7 +3345,6 @@ The goal is quality delivery, not just checking boxes.]]
|
|
|
3330
3345
|
7. **Documentation (If Applicable):**
|
|
3331
3346
|
|
|
3332
3347
|
[[LLM: Good documentation prevents future confusion. What needs explaining?]]
|
|
3333
|
-
|
|
3334
3348
|
- [ ] Relevant inline code documentation (e.g., JSDoc, TSDoc, Python docstrings) for new public APIs or complex logic is complete.
|
|
3335
3349
|
- [ ] User-facing documentation updated, if changes impact users.
|
|
3336
3350
|
- [ ] Technical documentation (e.g., READMEs, system diagrams) updated if significant architectural changes were made.
|
|
@@ -3355,7 +3369,17 @@ Be honest - it's better to flag issues now than have them discovered later.]]
|
|
|
3355
3369
|
==================== START: .bmad-core/tasks/review-story.md ====================
|
|
3356
3370
|
# review-story
|
|
3357
3371
|
|
|
3358
|
-
|
|
3372
|
+
Perform a comprehensive test architecture review with quality gate decision. This adaptive, risk-aware review creates both a story update and a detailed gate file.
|
|
3373
|
+
|
|
3374
|
+
## Inputs
|
|
3375
|
+
|
|
3376
|
+
```yaml
|
|
3377
|
+
required:
|
|
3378
|
+
- story_id: "{epic}.{story}" # e.g., "1.3"
|
|
3379
|
+
- story_path: "docs/stories/{epic}.{story}.*.md"
|
|
3380
|
+
- story_title: "{title}" # If missing, derive from story file H1
|
|
3381
|
+
- story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated)
|
|
3382
|
+
```
|
|
3359
3383
|
|
|
3360
3384
|
## Prerequisites
|
|
3361
3385
|
|
|
@@ -3363,98 +3387,133 @@ When a developer agent marks a story as "Ready for Review", perform a comprehens
|
|
|
3363
3387
|
- Developer has completed all tasks and updated the File List
|
|
3364
3388
|
- All automated tests are passing
|
|
3365
3389
|
|
|
3366
|
-
## Review Process
|
|
3367
|
-
|
|
3368
|
-
1.
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3390
|
+
## Review Process - Adaptive Test Architecture
|
|
3391
|
+
|
|
3392
|
+
### 1. Risk Assessment (Determines Review Depth)
|
|
3393
|
+
|
|
3394
|
+
**Auto-escalate to deep review when:**
|
|
3395
|
+
|
|
3396
|
+
- Auth/payment/security files touched
|
|
3397
|
+
- No tests added to story
|
|
3398
|
+
- Diff > 500 lines
|
|
3399
|
+
- Previous gate was FAIL/CONCERNS
|
|
3400
|
+
- Story has > 5 acceptance criteria
|
|
3401
|
+
|
|
3402
|
+
### 2. Comprehensive Analysis
|
|
3403
|
+
|
|
3404
|
+
**A. Requirements Traceability**
|
|
3405
|
+
|
|
3406
|
+
- Map each acceptance criteria to its validating tests (document mapping with Given-When-Then, not test code)
|
|
3407
|
+
- Identify coverage gaps
|
|
3408
|
+
- Verify all requirements have corresponding test cases
|
|
3409
|
+
|
|
3410
|
+
**B. Code Quality Review**
|
|
3411
|
+
|
|
3412
|
+
- Architecture and design patterns
|
|
3413
|
+
- Refactoring opportunities (and perform them)
|
|
3414
|
+
- Code duplication or inefficiencies
|
|
3415
|
+
- Performance optimizations
|
|
3416
|
+
- Security vulnerabilities
|
|
3417
|
+
- Best practices adherence
|
|
3418
|
+
|
|
3419
|
+
**C. Test Architecture Assessment**
|
|
3420
|
+
|
|
3421
|
+
- Test coverage adequacy at appropriate levels
|
|
3422
|
+
- Test level appropriateness (what should be unit vs integration vs e2e)
|
|
3423
|
+
- Test design quality and maintainability
|
|
3424
|
+
- Test data management strategy
|
|
3425
|
+
- Mock/stub usage appropriateness
|
|
3426
|
+
- Edge case and error scenario coverage
|
|
3427
|
+
- Test execution time and reliability
|
|
3428
|
+
|
|
3429
|
+
**D. Non-Functional Requirements (NFRs)**
|
|
3430
|
+
|
|
3431
|
+
- Security: Authentication, authorization, data protection
|
|
3432
|
+
- Performance: Response times, resource usage
|
|
3433
|
+
- Reliability: Error handling, recovery mechanisms
|
|
3434
|
+
- Maintainability: Code clarity, documentation
|
|
3435
|
+
|
|
3436
|
+
**E. Testability Evaluation**
|
|
3437
|
+
|
|
3438
|
+
- Controllability: Can we control the inputs?
|
|
3439
|
+
- Observability: Can we observe the outputs?
|
|
3440
|
+
- Debuggability: Can we debug failures easily?
|
|
3441
|
+
|
|
3442
|
+
**F. Technical Debt Identification**
|
|
3443
|
+
|
|
3444
|
+
- Accumulated shortcuts
|
|
3445
|
+
- Missing tests
|
|
3446
|
+
- Outdated dependencies
|
|
3447
|
+
- Architecture violations
|
|
3448
|
+
|
|
3449
|
+
### 3. Active Refactoring
|
|
3450
|
+
|
|
3451
|
+
- Refactor code where safe and appropriate
|
|
3452
|
+
- Run tests to ensure changes don't break functionality
|
|
3453
|
+
- Document all changes in QA Results section with clear WHY and HOW
|
|
3454
|
+
- Do NOT alter story content beyond QA Results section
|
|
3455
|
+
- Do NOT change story Status or File List; recommend next status only
|
|
3456
|
+
|
|
3457
|
+
### 4. Standards Compliance Check
|
|
3458
|
+
|
|
3459
|
+
- Verify adherence to `docs/coding-standards.md`
|
|
3460
|
+
- Check compliance with `docs/unified-project-structure.md`
|
|
3461
|
+
- Validate testing approach against `docs/testing-strategy.md`
|
|
3462
|
+
- Ensure all guidelines mentioned in the story are followed
|
|
3463
|
+
|
|
3464
|
+
### 5. Acceptance Criteria Validation
|
|
3465
|
+
|
|
3466
|
+
- Verify each AC is fully implemented
|
|
3467
|
+
- Check for any missing functionality
|
|
3468
|
+
- Validate edge cases are handled
|
|
3469
|
+
|
|
3470
|
+
### 6. Documentation and Comments
|
|
3471
|
+
|
|
3472
|
+
- Verify code is self-documenting where possible
|
|
3473
|
+
- Add comments for complex logic if missing
|
|
3474
|
+
- Ensure any API changes are documented
|
|
3475
|
+
|
|
3476
|
+
## Output 1: Update Story File - QA Results Section ONLY
|
|
3430
3477
|
|
|
3431
3478
|
**CRITICAL**: You are ONLY authorized to update the "QA Results" section of the story file. DO NOT modify any other sections.
|
|
3432
3479
|
|
|
3480
|
+
**QA Results Anchor Rule:**
|
|
3481
|
+
|
|
3482
|
+
- If `## QA Results` doesn't exist, append it at end of file
|
|
3483
|
+
- If it exists, append a new dated entry below existing entries
|
|
3484
|
+
- Never edit other sections
|
|
3485
|
+
|
|
3433
3486
|
After review and any refactoring, append your results to the story file in the QA Results section:
|
|
3434
3487
|
|
|
3435
3488
|
```markdown
|
|
3436
3489
|
## QA Results
|
|
3437
3490
|
|
|
3438
3491
|
### Review Date: [Date]
|
|
3439
|
-
|
|
3492
|
+
|
|
3493
|
+
### Reviewed By: Quinn (Test Architect)
|
|
3440
3494
|
|
|
3441
3495
|
### Code Quality Assessment
|
|
3496
|
+
|
|
3442
3497
|
[Overall assessment of implementation quality]
|
|
3443
3498
|
|
|
3444
3499
|
### Refactoring Performed
|
|
3500
|
+
|
|
3445
3501
|
[List any refactoring you performed with explanations]
|
|
3502
|
+
|
|
3446
3503
|
- **File**: [filename]
|
|
3447
3504
|
- **Change**: [what was changed]
|
|
3448
3505
|
- **Why**: [reason for change]
|
|
3449
3506
|
- **How**: [how it improves the code]
|
|
3450
3507
|
|
|
3451
3508
|
### Compliance Check
|
|
3509
|
+
|
|
3452
3510
|
- Coding Standards: [✓/✗] [notes if any]
|
|
3453
3511
|
- Project Structure: [✓/✗] [notes if any]
|
|
3454
3512
|
- Testing Strategy: [✓/✗] [notes if any]
|
|
3455
3513
|
- All ACs Met: [✓/✗] [notes if any]
|
|
3456
3514
|
|
|
3457
3515
|
### Improvements Checklist
|
|
3516
|
+
|
|
3458
3517
|
[Check off items you handled yourself, leave unchecked for dev to address]
|
|
3459
3518
|
|
|
3460
3519
|
- [x] Refactored user service for better error handling (services/user.service.ts)
|
|
@@ -3464,22 +3523,142 @@ After review and any refactoring, append your results to the story file in the Q
|
|
|
3464
3523
|
- [ ] Update API documentation for new error codes
|
|
3465
3524
|
|
|
3466
3525
|
### Security Review
|
|
3526
|
+
|
|
3467
3527
|
[Any security concerns found and whether addressed]
|
|
3468
3528
|
|
|
3469
3529
|
### Performance Considerations
|
|
3530
|
+
|
|
3470
3531
|
[Any performance issues found and whether addressed]
|
|
3471
3532
|
|
|
3472
|
-
###
|
|
3473
|
-
|
|
3533
|
+
### Files Modified During Review
|
|
3534
|
+
|
|
3535
|
+
[If you modified files, list them here - ask Dev to update File List]
|
|
3536
|
+
|
|
3537
|
+
### Gate Status
|
|
3538
|
+
|
|
3539
|
+
Gate: {STATUS} → docs/qa/gates/{epic}.{story}-{slug}.yml
|
|
3540
|
+
Risk profile: docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md
|
|
3541
|
+
NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
|
|
3542
|
+
|
|
3543
|
+
### Recommended Status
|
|
3544
|
+
|
|
3545
|
+
[✓ Ready for Done] / [✗ Changes Required - See unchecked items above]
|
|
3546
|
+
(Story owner decides final status)
|
|
3547
|
+
```
|
|
3548
|
+
|
|
3549
|
+
## Output 2: Create Quality Gate File
|
|
3550
|
+
|
|
3551
|
+
**Template and Directory:**
|
|
3552
|
+
|
|
3553
|
+
- Render from `templates/qa-gate-tmpl.yaml`
|
|
3554
|
+
- Create `docs/qa/gates/` directory if missing
|
|
3555
|
+
- Save to: `docs/qa/gates/{epic}.{story}-{slug}.yml`
|
|
3556
|
+
|
|
3557
|
+
Gate file structure:
|
|
3558
|
+
|
|
3559
|
+
```yaml
|
|
3560
|
+
schema: 1
|
|
3561
|
+
story: "{epic}.{story}"
|
|
3562
|
+
story_title: "{story title}"
|
|
3563
|
+
gate: PASS|CONCERNS|FAIL|WAIVED
|
|
3564
|
+
status_reason: "1-2 sentence explanation of gate decision"
|
|
3565
|
+
reviewer: "Quinn (Test Architect)"
|
|
3566
|
+
updated: "{ISO-8601 timestamp}"
|
|
3567
|
+
|
|
3568
|
+
top_issues: [] # Empty if no issues
|
|
3569
|
+
waiver: { active: false } # Set active: true only if WAIVED
|
|
3570
|
+
|
|
3571
|
+
# Extended fields (optional but recommended):
|
|
3572
|
+
quality_score: 0-100 # 100 - (20*FAILs) - (10*CONCERNS) or use technical-preferences.md weights
|
|
3573
|
+
expires: "{ISO-8601 timestamp}" # Typically 2 weeks from review
|
|
3574
|
+
|
|
3575
|
+
evidence:
|
|
3576
|
+
tests_reviewed: { count }
|
|
3577
|
+
risks_identified: { count }
|
|
3578
|
+
trace:
|
|
3579
|
+
ac_covered: [1, 2, 3] # AC numbers with test coverage
|
|
3580
|
+
ac_gaps: [4] # AC numbers lacking coverage
|
|
3581
|
+
|
|
3582
|
+
nfr_validation:
|
|
3583
|
+
security:
|
|
3584
|
+
status: PASS|CONCERNS|FAIL
|
|
3585
|
+
notes: "Specific findings"
|
|
3586
|
+
performance:
|
|
3587
|
+
status: PASS|CONCERNS|FAIL
|
|
3588
|
+
notes: "Specific findings"
|
|
3589
|
+
reliability:
|
|
3590
|
+
status: PASS|CONCERNS|FAIL
|
|
3591
|
+
notes: "Specific findings"
|
|
3592
|
+
maintainability:
|
|
3593
|
+
status: PASS|CONCERNS|FAIL
|
|
3594
|
+
notes: "Specific findings"
|
|
3595
|
+
|
|
3596
|
+
recommendations:
|
|
3597
|
+
immediate: # Must fix before production
|
|
3598
|
+
- action: "Add rate limiting"
|
|
3599
|
+
refs: ["api/auth/login.ts"]
|
|
3600
|
+
future: # Can be addressed later
|
|
3601
|
+
- action: "Consider caching"
|
|
3602
|
+
refs: ["services/data.ts"]
|
|
3603
|
+
```
|
|
3604
|
+
|
|
3605
|
+
### Gate Decision Criteria
|
|
3606
|
+
|
|
3607
|
+
**Deterministic rule (apply in order):**
|
|
3608
|
+
|
|
3609
|
+
If risk_summary exists, apply its thresholds first (≥9 → FAIL, ≥6 → CONCERNS), then NFR statuses, then top_issues severity.
|
|
3610
|
+
|
|
3611
|
+
1. **Risk thresholds (if risk_summary present):**
|
|
3612
|
+
- If any risk score ≥ 9 → Gate = FAIL (unless waived)
|
|
3613
|
+
- Else if any score ≥ 6 → Gate = CONCERNS
|
|
3614
|
+
|
|
3615
|
+
2. **Test coverage gaps (if trace available):**
|
|
3616
|
+
- If any P0 test from test-design is missing → Gate = CONCERNS
|
|
3617
|
+
- If security/data-loss P0 test missing → Gate = FAIL
|
|
3618
|
+
|
|
3619
|
+
3. **Issue severity:**
|
|
3620
|
+
- If any `top_issues.severity == high` → Gate = FAIL (unless waived)
|
|
3621
|
+
- Else if any `severity == medium` → Gate = CONCERNS
|
|
3622
|
+
|
|
3623
|
+
4. **NFR statuses:**
|
|
3624
|
+
- If any NFR status is FAIL → Gate = FAIL
|
|
3625
|
+
- Else if any NFR status is CONCERNS → Gate = CONCERNS
|
|
3626
|
+
- Else → Gate = PASS
|
|
3627
|
+
|
|
3628
|
+
- WAIVED only when waiver.active: true with reason/approver
|
|
3629
|
+
|
|
3630
|
+
Detailed criteria:
|
|
3631
|
+
|
|
3632
|
+
- **PASS**: All critical requirements met, no blocking issues
|
|
3633
|
+
- **CONCERNS**: Non-critical issues found, team should review
|
|
3634
|
+
- **FAIL**: Critical issues that should be addressed
|
|
3635
|
+
- **WAIVED**: Issues acknowledged but explicitly waived by team
|
|
3636
|
+
|
|
3637
|
+
### Quality Score Calculation
|
|
3638
|
+
|
|
3639
|
+
```text
|
|
3640
|
+
quality_score = 100 - (20 × number of FAILs) - (10 × number of CONCERNS)
|
|
3641
|
+
Bounded between 0 and 100
|
|
3474
3642
|
```
|
|
3475
3643
|
|
|
3644
|
+
If `technical-preferences.md` defines custom weights, use those instead.
|
|
3645
|
+
|
|
3646
|
+
### Suggested Owner Convention
|
|
3647
|
+
|
|
3648
|
+
For each issue in `top_issues`, include a `suggested_owner`:
|
|
3649
|
+
|
|
3650
|
+
- `dev`: Code changes needed
|
|
3651
|
+
- `sm`: Requirements clarification needed
|
|
3652
|
+
- `po`: Business decision needed
|
|
3653
|
+
|
|
3476
3654
|
## Key Principles
|
|
3477
3655
|
|
|
3478
|
-
- You are a
|
|
3479
|
-
- You have the authority
|
|
3656
|
+
- You are a Test Architect providing comprehensive quality assessment
|
|
3657
|
+
- You have the authority to improve code directly when appropriate
|
|
3480
3658
|
- Always explain your changes for learning purposes
|
|
3481
3659
|
- Balance between perfection and pragmatism
|
|
3482
|
-
- Focus on
|
|
3660
|
+
- Focus on risk-based prioritization
|
|
3661
|
+
- Provide actionable recommendations with clear ownership
|
|
3483
3662
|
|
|
3484
3663
|
## Blocking Conditions
|
|
3485
3664
|
|
|
@@ -3495,11 +3674,1771 @@ Stop the review and request clarification if:
|
|
|
3495
3674
|
|
|
3496
3675
|
After review:
|
|
3497
3676
|
|
|
3498
|
-
1.
|
|
3499
|
-
2.
|
|
3500
|
-
3.
|
|
3677
|
+
1. Update the QA Results section in the story file
|
|
3678
|
+
2. Create the gate file in `docs/qa/gates/`
|
|
3679
|
+
3. Recommend status: "Ready for Done" or "Changes Required" (owner decides)
|
|
3680
|
+
4. If files were modified, list them in QA Results and ask Dev to update File List
|
|
3681
|
+
5. Always provide constructive feedback and actionable recommendations
|
|
3501
3682
|
==================== END: .bmad-core/tasks/review-story.md ====================
|
|
3502
3683
|
|
|
3684
|
+
==================== START: .bmad-core/tasks/qa-gate.md ====================
|
|
3685
|
+
# qa-gate
|
|
3686
|
+
|
|
3687
|
+
Create or update a quality gate decision file for a story based on review findings.
|
|
3688
|
+
|
|
3689
|
+
## Purpose
|
|
3690
|
+
|
|
3691
|
+
Generate a standalone quality gate file that provides a clear pass/fail decision with actionable feedback. This gate serves as an advisory checkpoint for teams to understand quality status.
|
|
3692
|
+
|
|
3693
|
+
## Prerequisites
|
|
3694
|
+
|
|
3695
|
+
- Story has been reviewed (manually or via review-story task)
|
|
3696
|
+
- Review findings are available
|
|
3697
|
+
- Understanding of story requirements and implementation
|
|
3698
|
+
|
|
3699
|
+
## Gate File Location
|
|
3700
|
+
|
|
3701
|
+
**ALWAYS** create file at: `docs/qa/gates/{epic}.{story}-{slug}.yml`
|
|
3702
|
+
|
|
3703
|
+
Slug rules:
|
|
3704
|
+
|
|
3705
|
+
- Convert to lowercase
|
|
3706
|
+
- Replace spaces with hyphens
|
|
3707
|
+
- Strip punctuation
|
|
3708
|
+
- Example: "User Auth - Login!" becomes "user-auth-login"
|
|
3709
|
+
|
|
3710
|
+
## Minimal Required Schema
|
|
3711
|
+
|
|
3712
|
+
```yaml
|
|
3713
|
+
schema: 1
|
|
3714
|
+
story: "{epic}.{story}"
|
|
3715
|
+
gate: PASS|CONCERNS|FAIL|WAIVED
|
|
3716
|
+
status_reason: "1-2 sentence explanation of gate decision"
|
|
3717
|
+
reviewer: "Quinn"
|
|
3718
|
+
updated: "{ISO-8601 timestamp}"
|
|
3719
|
+
top_issues: [] # Empty array if no issues
|
|
3720
|
+
waiver: { active: false } # Only set active: true if WAIVED
|
|
3721
|
+
```
|
|
3722
|
+
|
|
3723
|
+
## Schema with Issues
|
|
3724
|
+
|
|
3725
|
+
```yaml
|
|
3726
|
+
schema: 1
|
|
3727
|
+
story: "1.3"
|
|
3728
|
+
gate: CONCERNS
|
|
3729
|
+
status_reason: "Missing rate limiting on auth endpoints poses security risk."
|
|
3730
|
+
reviewer: "Quinn"
|
|
3731
|
+
updated: "2025-01-12T10:15:00Z"
|
|
3732
|
+
top_issues:
|
|
3733
|
+
- id: "SEC-001"
|
|
3734
|
+
severity: high # ONLY: low|medium|high
|
|
3735
|
+
finding: "No rate limiting on login endpoint"
|
|
3736
|
+
suggested_action: "Add rate limiting middleware before production"
|
|
3737
|
+
- id: "TEST-001"
|
|
3738
|
+
severity: medium
|
|
3739
|
+
finding: "No integration tests for auth flow"
|
|
3740
|
+
suggested_action: "Add integration test coverage"
|
|
3741
|
+
waiver: { active: false }
|
|
3742
|
+
```
|
|
3743
|
+
|
|
3744
|
+
## Schema when Waived
|
|
3745
|
+
|
|
3746
|
+
```yaml
|
|
3747
|
+
schema: 1
|
|
3748
|
+
story: "1.3"
|
|
3749
|
+
gate: WAIVED
|
|
3750
|
+
status_reason: "Known issues accepted for MVP release."
|
|
3751
|
+
reviewer: "Quinn"
|
|
3752
|
+
updated: "2025-01-12T10:15:00Z"
|
|
3753
|
+
top_issues:
|
|
3754
|
+
- id: "PERF-001"
|
|
3755
|
+
severity: low
|
|
3756
|
+
finding: "Dashboard loads slowly with 1000+ items"
|
|
3757
|
+
suggested_action: "Implement pagination in next sprint"
|
|
3758
|
+
waiver:
|
|
3759
|
+
active: true
|
|
3760
|
+
reason: "MVP release - performance optimization deferred"
|
|
3761
|
+
approved_by: "Product Owner"
|
|
3762
|
+
```
|
|
3763
|
+
|
|
3764
|
+
## Gate Decision Criteria
|
|
3765
|
+
|
|
3766
|
+
### PASS
|
|
3767
|
+
|
|
3768
|
+
- All acceptance criteria met
|
|
3769
|
+
- No high-severity issues
|
|
3770
|
+
- Test coverage meets project standards
|
|
3771
|
+
|
|
3772
|
+
### CONCERNS
|
|
3773
|
+
|
|
3774
|
+
- Non-blocking issues present
|
|
3775
|
+
- Should be tracked and scheduled
|
|
3776
|
+
- Can proceed with awareness
|
|
3777
|
+
|
|
3778
|
+
### FAIL
|
|
3779
|
+
|
|
3780
|
+
- Acceptance criteria not met
|
|
3781
|
+
- High-severity issues present
|
|
3782
|
+
- Recommend return to InProgress
|
|
3783
|
+
|
|
3784
|
+
### WAIVED
|
|
3785
|
+
|
|
3786
|
+
- Issues explicitly accepted
|
|
3787
|
+
- Requires approval and reason
|
|
3788
|
+
- Proceed despite known issues
|
|
3789
|
+
|
|
3790
|
+
## Severity Scale
|
|
3791
|
+
|
|
3792
|
+
**FIXED VALUES - NO VARIATIONS:**
|
|
3793
|
+
|
|
3794
|
+
- `low`: Minor issues, cosmetic problems
|
|
3795
|
+
- `medium`: Should fix soon, not blocking
|
|
3796
|
+
- `high`: Critical issues, should block release
|
|
3797
|
+
|
|
3798
|
+
## Issue ID Prefixes
|
|
3799
|
+
|
|
3800
|
+
- `SEC-`: Security issues
|
|
3801
|
+
- `PERF-`: Performance issues
|
|
3802
|
+
- `REL-`: Reliability issues
|
|
3803
|
+
- `TEST-`: Testing gaps
|
|
3804
|
+
- `MNT-`: Maintainability concerns
|
|
3805
|
+
- `ARCH-`: Architecture issues
|
|
3806
|
+
- `DOC-`: Documentation gaps
|
|
3807
|
+
- `REQ-`: Requirements issues
|
|
3808
|
+
|
|
3809
|
+
## Output Requirements
|
|
3810
|
+
|
|
3811
|
+
1. **ALWAYS** create gate file at: `docs/qa/gates/{epic}.{story}-{slug}.yml`
|
|
3812
|
+
2. **ALWAYS** append this exact format to story's QA Results section:
|
|
3813
|
+
```
|
|
3814
|
+
Gate: {STATUS} → docs/qa/gates/{epic}.{story}-{slug}.yml
|
|
3815
|
+
```
|
|
3816
|
+
3. Keep status_reason to 1-2 sentences maximum
|
|
3817
|
+
4. Use severity values exactly: `low`, `medium`, or `high`
|
|
3818
|
+
|
|
3819
|
+
## Example Story Update
|
|
3820
|
+
|
|
3821
|
+
After creating gate file, append to story's QA Results section:
|
|
3822
|
+
|
|
3823
|
+
```markdown
|
|
3824
|
+
## QA Results
|
|
3825
|
+
|
|
3826
|
+
### Review Date: 2025-01-12
|
|
3827
|
+
|
|
3828
|
+
### Reviewed By: Quinn (Test Architect)
|
|
3829
|
+
|
|
3830
|
+
[... existing review content ...]
|
|
3831
|
+
|
|
3832
|
+
### Gate Status
|
|
3833
|
+
|
|
3834
|
+
Gate: CONCERNS → docs/qa/gates/1.3-user-auth-login.yml
|
|
3835
|
+
```
|
|
3836
|
+
|
|
3837
|
+
## Key Principles
|
|
3838
|
+
|
|
3839
|
+
- Keep it minimal and predictable
|
|
3840
|
+
- Fixed severity scale (low/medium/high)
|
|
3841
|
+
- Always write to standard path
|
|
3842
|
+
- Always update story with gate reference
|
|
3843
|
+
- Clear, actionable findings
|
|
3844
|
+
==================== END: .bmad-core/tasks/qa-gate.md ====================
|
|
3845
|
+
|
|
3846
|
+
==================== START: .bmad-core/tasks/trace-requirements.md ====================
|
|
3847
|
+
# trace-requirements
|
|
3848
|
+
|
|
3849
|
+
Map story requirements to test cases using Given-When-Then patterns for comprehensive traceability.
|
|
3850
|
+
|
|
3851
|
+
## Purpose
|
|
3852
|
+
|
|
3853
|
+
Create a requirements traceability matrix that ensures every acceptance criterion has corresponding test coverage. This task helps identify gaps in testing and ensures all requirements are validated.
|
|
3854
|
+
|
|
3855
|
+
**IMPORTANT**: Given-When-Then is used here for documenting the mapping between requirements and tests, NOT for writing the actual test code. Tests should follow your project's testing standards (no BDD syntax in test code).
|
|
3856
|
+
|
|
3857
|
+
## Prerequisites
|
|
3858
|
+
|
|
3859
|
+
- Story file with clear acceptance criteria
|
|
3860
|
+
- Access to test files or test specifications
|
|
3861
|
+
- Understanding of the implementation
|
|
3862
|
+
|
|
3863
|
+
## Traceability Process
|
|
3864
|
+
|
|
3865
|
+
### 1. Extract Requirements
|
|
3866
|
+
|
|
3867
|
+
Identify all testable requirements from:
|
|
3868
|
+
|
|
3869
|
+
- Acceptance Criteria (primary source)
|
|
3870
|
+
- User story statement
|
|
3871
|
+
- Tasks/subtasks with specific behaviors
|
|
3872
|
+
- Non-functional requirements mentioned
|
|
3873
|
+
- Edge cases documented
|
|
3874
|
+
|
|
3875
|
+
### 2. Map to Test Cases
|
|
3876
|
+
|
|
3877
|
+
For each requirement, document which tests validate it. Use Given-When-Then to describe what the test validates (not how it's written):
|
|
3878
|
+
|
|
3879
|
+
```yaml
|
|
3880
|
+
requirement: "AC1: User can login with valid credentials"
|
|
3881
|
+
test_mappings:
|
|
3882
|
+
- test_file: "auth/login.test.ts"
|
|
3883
|
+
test_case: "should successfully login with valid email and password"
|
|
3884
|
+
# Given-When-Then describes WHAT the test validates, not HOW it's coded
|
|
3885
|
+
given: "A registered user with valid credentials"
|
|
3886
|
+
when: "They submit the login form"
|
|
3887
|
+
then: "They are redirected to dashboard and session is created"
|
|
3888
|
+
coverage: full
|
|
3889
|
+
|
|
3890
|
+
- test_file: "e2e/auth-flow.test.ts"
|
|
3891
|
+
test_case: "complete login flow"
|
|
3892
|
+
given: "User on login page"
|
|
3893
|
+
when: "Entering valid credentials and submitting"
|
|
3894
|
+
then: "Dashboard loads with user data"
|
|
3895
|
+
coverage: integration
|
|
3896
|
+
```
|
|
3897
|
+
|
|
3898
|
+
### 3. Coverage Analysis
|
|
3899
|
+
|
|
3900
|
+
Evaluate coverage for each requirement:
|
|
3901
|
+
|
|
3902
|
+
**Coverage Levels:**
|
|
3903
|
+
|
|
3904
|
+
- `full`: Requirement completely tested
|
|
3905
|
+
- `partial`: Some aspects tested, gaps exist
|
|
3906
|
+
- `none`: No test coverage found
|
|
3907
|
+
- `integration`: Covered in integration/e2e tests only
|
|
3908
|
+
- `unit`: Covered in unit tests only
|
|
3909
|
+
|
|
3910
|
+
### 4. Gap Identification
|
|
3911
|
+
|
|
3912
|
+
Document any gaps found:
|
|
3913
|
+
|
|
3914
|
+
```yaml
|
|
3915
|
+
coverage_gaps:
|
|
3916
|
+
- requirement: "AC3: Password reset email sent within 60 seconds"
|
|
3917
|
+
gap: "No test for email delivery timing"
|
|
3918
|
+
severity: medium
|
|
3919
|
+
suggested_test:
|
|
3920
|
+
type: integration
|
|
3921
|
+
description: "Test email service SLA compliance"
|
|
3922
|
+
|
|
3923
|
+
- requirement: "AC5: Support 1000 concurrent users"
|
|
3924
|
+
gap: "No load testing implemented"
|
|
3925
|
+
severity: high
|
|
3926
|
+
suggested_test:
|
|
3927
|
+
type: performance
|
|
3928
|
+
description: "Load test with 1000 concurrent connections"
|
|
3929
|
+
```
|
|
3930
|
+
|
|
3931
|
+
## Outputs
|
|
3932
|
+
|
|
3933
|
+
### Output 1: Gate YAML Block
|
|
3934
|
+
|
|
3935
|
+
**Generate for pasting into gate file under `trace`:**
|
|
3936
|
+
|
|
3937
|
+
```yaml
|
|
3938
|
+
trace:
|
|
3939
|
+
totals:
|
|
3940
|
+
requirements: X
|
|
3941
|
+
full: Y
|
|
3942
|
+
partial: Z
|
|
3943
|
+
none: W
|
|
3944
|
+
planning_ref: "docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md"
|
|
3945
|
+
uncovered:
|
|
3946
|
+
- ac: "AC3"
|
|
3947
|
+
reason: "No test found for password reset timing"
|
|
3948
|
+
notes: "See docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md"
|
|
3949
|
+
```
|
|
3950
|
+
|
|
3951
|
+
### Output 2: Traceability Report
|
|
3952
|
+
|
|
3953
|
+
**Save to:** `docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md`
|
|
3954
|
+
|
|
3955
|
+
Create a traceability report with:
|
|
3956
|
+
|
|
3957
|
+
```markdown
|
|
3958
|
+
# Requirements Traceability Matrix
|
|
3959
|
+
|
|
3960
|
+
## Story: {epic}.{story} - {title}
|
|
3961
|
+
|
|
3962
|
+
### Coverage Summary
|
|
3963
|
+
|
|
3964
|
+
- Total Requirements: X
|
|
3965
|
+
- Fully Covered: Y (Z%)
|
|
3966
|
+
- Partially Covered: A (B%)
|
|
3967
|
+
- Not Covered: C (D%)
|
|
3968
|
+
|
|
3969
|
+
### Requirement Mappings
|
|
3970
|
+
|
|
3971
|
+
#### AC1: {Acceptance Criterion 1}
|
|
3972
|
+
|
|
3973
|
+
**Coverage: FULL**
|
|
3974
|
+
|
|
3975
|
+
Given-When-Then Mappings:
|
|
3976
|
+
|
|
3977
|
+
- **Unit Test**: `auth.service.test.ts::validateCredentials`
|
|
3978
|
+
- Given: Valid user credentials
|
|
3979
|
+
- When: Validation method called
|
|
3980
|
+
- Then: Returns true with user object
|
|
3981
|
+
|
|
3982
|
+
- **Integration Test**: `auth.integration.test.ts::loginFlow`
|
|
3983
|
+
- Given: User with valid account
|
|
3984
|
+
- When: Login API called
|
|
3985
|
+
- Then: JWT token returned and session created
|
|
3986
|
+
|
|
3987
|
+
#### AC2: {Acceptance Criterion 2}
|
|
3988
|
+
|
|
3989
|
+
**Coverage: PARTIAL**
|
|
3990
|
+
|
|
3991
|
+
[Continue for all ACs...]
|
|
3992
|
+
|
|
3993
|
+
### Critical Gaps
|
|
3994
|
+
|
|
3995
|
+
1. **Performance Requirements**
|
|
3996
|
+
- Gap: No load testing for concurrent users
|
|
3997
|
+
- Risk: High - Could fail under production load
|
|
3998
|
+
- Action: Implement load tests using k6 or similar
|
|
3999
|
+
|
|
4000
|
+
2. **Security Requirements**
|
|
4001
|
+
- Gap: Rate limiting not tested
|
|
4002
|
+
- Risk: Medium - Potential DoS vulnerability
|
|
4003
|
+
- Action: Add rate limit tests to integration suite
|
|
4004
|
+
|
|
4005
|
+
### Test Design Recommendations
|
|
4006
|
+
|
|
4007
|
+
Based on gaps identified, recommend:
|
|
4008
|
+
|
|
4009
|
+
1. Additional test scenarios needed
|
|
4010
|
+
2. Test types to implement (unit/integration/e2e/performance)
|
|
4011
|
+
3. Test data requirements
|
|
4012
|
+
4. Mock/stub strategies
|
|
4013
|
+
|
|
4014
|
+
### Risk Assessment
|
|
4015
|
+
|
|
4016
|
+
- **High Risk**: Requirements with no coverage
|
|
4017
|
+
- **Medium Risk**: Requirements with only partial coverage
|
|
4018
|
+
- **Low Risk**: Requirements with full unit + integration coverage
|
|
4019
|
+
```
|
|
4020
|
+
|
|
4021
|
+
## Traceability Best Practices
|
|
4022
|
+
|
|
4023
|
+
### Given-When-Then for Mapping (Not Test Code)
|
|
4024
|
+
|
|
4025
|
+
Use Given-When-Then to document what each test validates:
|
|
4026
|
+
|
|
4027
|
+
**Given**: The initial context the test sets up
|
|
4028
|
+
|
|
4029
|
+
- What state/data the test prepares
|
|
4030
|
+
- User context being simulated
|
|
4031
|
+
- System preconditions
|
|
4032
|
+
|
|
4033
|
+
**When**: The action the test performs
|
|
4034
|
+
|
|
4035
|
+
- What the test executes
|
|
4036
|
+
- API calls or user actions tested
|
|
4037
|
+
- Events triggered
|
|
4038
|
+
|
|
4039
|
+
**Then**: What the test asserts
|
|
4040
|
+
|
|
4041
|
+
- Expected outcomes verified
|
|
4042
|
+
- State changes checked
|
|
4043
|
+
- Values validated
|
|
4044
|
+
|
|
4045
|
+
**Note**: This is for documentation only. Actual test code follows your project's standards (e.g., describe/it blocks, no BDD syntax).
|
|
4046
|
+
|
|
4047
|
+
### Coverage Priority
|
|
4048
|
+
|
|
4049
|
+
Prioritize coverage based on:
|
|
4050
|
+
|
|
4051
|
+
1. Critical business flows
|
|
4052
|
+
2. Security-related requirements
|
|
4053
|
+
3. Data integrity requirements
|
|
4054
|
+
4. User-facing features
|
|
4055
|
+
5. Performance SLAs
|
|
4056
|
+
|
|
4057
|
+
### Test Granularity
|
|
4058
|
+
|
|
4059
|
+
Map at appropriate levels:
|
|
4060
|
+
|
|
4061
|
+
- Unit tests for business logic
|
|
4062
|
+
- Integration tests for component interaction
|
|
4063
|
+
- E2E tests for user journeys
|
|
4064
|
+
- Performance tests for NFRs
|
|
4065
|
+
|
|
4066
|
+
## Quality Indicators
|
|
4067
|
+
|
|
4068
|
+
Good traceability shows:
|
|
4069
|
+
|
|
4070
|
+
- Every AC has at least one test
|
|
4071
|
+
- Critical paths have multiple test levels
|
|
4072
|
+
- Edge cases are explicitly covered
|
|
4073
|
+
- NFRs have appropriate test types
|
|
4074
|
+
- Clear Given-When-Then for each test
|
|
4075
|
+
|
|
4076
|
+
## Red Flags
|
|
4077
|
+
|
|
4078
|
+
Watch for:
|
|
4079
|
+
|
|
4080
|
+
- ACs with no test coverage
|
|
4081
|
+
- Tests that don't map to requirements
|
|
4082
|
+
- Vague test descriptions
|
|
4083
|
+
- Missing edge case coverage
|
|
4084
|
+
- NFRs without specific tests
|
|
4085
|
+
|
|
4086
|
+
## Integration with Gates
|
|
4087
|
+
|
|
4088
|
+
This traceability feeds into quality gates:
|
|
4089
|
+
|
|
4090
|
+
- Critical gaps → FAIL
|
|
4091
|
+
- Minor gaps → CONCERNS
|
|
4092
|
+
- Missing P0 tests from test-design → CONCERNS
|
|
4093
|
+
|
|
4094
|
+
### Output 3: Story Hook Line
|
|
4095
|
+
|
|
4096
|
+
**Print this line for review task to quote:**
|
|
4097
|
+
|
|
4098
|
+
```text
|
|
4099
|
+
Trace matrix: docs/qa/assessments/{epic}.{story}-trace-{YYYYMMDD}.md
|
|
4100
|
+
```
|
|
4101
|
+
|
|
4102
|
+
- Full coverage → PASS contribution
|
|
4103
|
+
|
|
4104
|
+
## Key Principles
|
|
4105
|
+
|
|
4106
|
+
- Every requirement must be testable
|
|
4107
|
+
- Use Given-When-Then for clarity
|
|
4108
|
+
- Identify both presence and absence
|
|
4109
|
+
- Prioritize based on risk
|
|
4110
|
+
- Make recommendations actionable
|
|
4111
|
+
==================== END: .bmad-core/tasks/trace-requirements.md ====================
|
|
4112
|
+
|
|
4113
|
+
==================== START: .bmad-core/tasks/risk-profile.md ====================
|
|
4114
|
+
# risk-profile
|
|
4115
|
+
|
|
4116
|
+
Generate a comprehensive risk assessment matrix for a story implementation using probability × impact analysis.
|
|
4117
|
+
|
|
4118
|
+
## Inputs
|
|
4119
|
+
|
|
4120
|
+
```yaml
|
|
4121
|
+
required:
|
|
4122
|
+
- story_id: "{epic}.{story}" # e.g., "1.3"
|
|
4123
|
+
- story_path: "docs/stories/{epic}.{story}.*.md"
|
|
4124
|
+
- story_title: "{title}" # If missing, derive from story file H1
|
|
4125
|
+
- story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated)
|
|
4126
|
+
```
|
|
4127
|
+
|
|
4128
|
+
## Purpose
|
|
4129
|
+
|
|
4130
|
+
Identify, assess, and prioritize risks in the story implementation. Provide risk mitigation strategies and testing focus areas based on risk levels.
|
|
4131
|
+
|
|
4132
|
+
## Risk Assessment Framework
|
|
4133
|
+
|
|
4134
|
+
### Risk Categories
|
|
4135
|
+
|
|
4136
|
+
**Category Prefixes:**
|
|
4137
|
+
|
|
4138
|
+
- `TECH`: Technical Risks
|
|
4139
|
+
- `SEC`: Security Risks
|
|
4140
|
+
- `PERF`: Performance Risks
|
|
4141
|
+
- `DATA`: Data Risks
|
|
4142
|
+
- `BUS`: Business Risks
|
|
4143
|
+
- `OPS`: Operational Risks
|
|
4144
|
+
|
|
4145
|
+
1. **Technical Risks (TECH)**
|
|
4146
|
+
- Architecture complexity
|
|
4147
|
+
- Integration challenges
|
|
4148
|
+
- Technical debt
|
|
4149
|
+
- Scalability concerns
|
|
4150
|
+
- System dependencies
|
|
4151
|
+
|
|
4152
|
+
2. **Security Risks (SEC)**
|
|
4153
|
+
- Authentication/authorization flaws
|
|
4154
|
+
- Data exposure vulnerabilities
|
|
4155
|
+
- Injection attacks
|
|
4156
|
+
- Session management issues
|
|
4157
|
+
- Cryptographic weaknesses
|
|
4158
|
+
|
|
4159
|
+
3. **Performance Risks (PERF)**
|
|
4160
|
+
- Response time degradation
|
|
4161
|
+
- Throughput bottlenecks
|
|
4162
|
+
- Resource exhaustion
|
|
4163
|
+
- Database query optimization
|
|
4164
|
+
- Caching failures
|
|
4165
|
+
|
|
4166
|
+
4. **Data Risks (DATA)**
|
|
4167
|
+
- Data loss potential
|
|
4168
|
+
- Data corruption
|
|
4169
|
+
- Privacy violations
|
|
4170
|
+
- Compliance issues
|
|
4171
|
+
- Backup/recovery gaps
|
|
4172
|
+
|
|
4173
|
+
5. **Business Risks (BUS)**
|
|
4174
|
+
- Feature doesn't meet user needs
|
|
4175
|
+
- Revenue impact
|
|
4176
|
+
- Reputation damage
|
|
4177
|
+
- Regulatory non-compliance
|
|
4178
|
+
- Market timing
|
|
4179
|
+
|
|
4180
|
+
6. **Operational Risks (OPS)**
|
|
4181
|
+
- Deployment failures
|
|
4182
|
+
- Monitoring gaps
|
|
4183
|
+
- Incident response readiness
|
|
4184
|
+
- Documentation inadequacy
|
|
4185
|
+
- Knowledge transfer issues
|
|
4186
|
+
|
|
4187
|
+
## Risk Analysis Process
|
|
4188
|
+
|
|
4189
|
+
### 1. Risk Identification
|
|
4190
|
+
|
|
4191
|
+
For each category, identify specific risks:
|
|
4192
|
+
|
|
4193
|
+
```yaml
|
|
4194
|
+
risk:
|
|
4195
|
+
id: "SEC-001" # Use prefixes: SEC, PERF, DATA, BUS, OPS, TECH
|
|
4196
|
+
category: security
|
|
4197
|
+
title: "Insufficient input validation on user forms"
|
|
4198
|
+
description: "Form inputs not properly sanitized could lead to XSS attacks"
|
|
4199
|
+
affected_components:
|
|
4200
|
+
- "UserRegistrationForm"
|
|
4201
|
+
- "ProfileUpdateForm"
|
|
4202
|
+
detection_method: "Code review revealed missing validation"
|
|
4203
|
+
```
|
|
4204
|
+
|
|
4205
|
+
### 2. Risk Assessment
|
|
4206
|
+
|
|
4207
|
+
Evaluate each risk using probability × impact:
|
|
4208
|
+
|
|
4209
|
+
**Probability Levels:**
|
|
4210
|
+
|
|
4211
|
+
- `High (3)`: Likely to occur (>70% chance)
|
|
4212
|
+
- `Medium (2)`: Possible occurrence (30-70% chance)
|
|
4213
|
+
- `Low (1)`: Unlikely to occur (<30% chance)
|
|
4214
|
+
|
|
4215
|
+
**Impact Levels:**
|
|
4216
|
+
|
|
4217
|
+
- `High (3)`: Severe consequences (data breach, system down, major financial loss)
|
|
4218
|
+
- `Medium (2)`: Moderate consequences (degraded performance, minor data issues)
|
|
4219
|
+
- `Low (1)`: Minor consequences (cosmetic issues, slight inconvenience)
|
|
4220
|
+
|
|
4221
|
+
**Risk Score = Probability × Impact**
|
|
4222
|
+
|
|
4223
|
+
- 9: Critical Risk (Red)
|
|
4224
|
+
- 6: High Risk (Orange)
|
|
4225
|
+
- 4: Medium Risk (Yellow)
|
|
4226
|
+
- 2-3: Low Risk (Green)
|
|
4227
|
+
- 1: Minimal Risk (Blue)
|
|
4228
|
+
|
|
4229
|
+
### 3. Risk Prioritization
|
|
4230
|
+
|
|
4231
|
+
Create risk matrix:
|
|
4232
|
+
|
|
4233
|
+
```markdown
|
|
4234
|
+
## Risk Matrix
|
|
4235
|
+
|
|
4236
|
+
| Risk ID | Description | Probability | Impact | Score | Priority |
|
|
4237
|
+
| -------- | ----------------------- | ----------- | ---------- | ----- | -------- |
|
|
4238
|
+
| SEC-001 | XSS vulnerability | High (3) | High (3) | 9 | Critical |
|
|
4239
|
+
| PERF-001 | Slow query on dashboard | Medium (2) | Medium (2) | 4 | Medium |
|
|
4240
|
+
| DATA-001 | Backup failure | Low (1) | High (3) | 3 | Low |
|
|
4241
|
+
```
|
|
4242
|
+
|
|
4243
|
+
### 4. Risk Mitigation Strategies
|
|
4244
|
+
|
|
4245
|
+
For each identified risk, provide mitigation:
|
|
4246
|
+
|
|
4247
|
+
```yaml
|
|
4248
|
+
mitigation:
|
|
4249
|
+
risk_id: "SEC-001"
|
|
4250
|
+
strategy: "preventive" # preventive|detective|corrective
|
|
4251
|
+
actions:
|
|
4252
|
+
- "Implement input validation library (e.g., validator.js)"
|
|
4253
|
+
- "Add CSP headers to prevent XSS execution"
|
|
4254
|
+
- "Sanitize all user inputs before storage"
|
|
4255
|
+
- "Escape all outputs in templates"
|
|
4256
|
+
testing_requirements:
|
|
4257
|
+
- "Security testing with OWASP ZAP"
|
|
4258
|
+
- "Manual penetration testing of forms"
|
|
4259
|
+
- "Unit tests for validation functions"
|
|
4260
|
+
residual_risk: "Low - Some zero-day vulnerabilities may remain"
|
|
4261
|
+
owner: "dev"
|
|
4262
|
+
timeline: "Before deployment"
|
|
4263
|
+
```
|
|
4264
|
+
|
|
4265
|
+
## Outputs
|
|
4266
|
+
|
|
4267
|
+
### Output 1: Gate YAML Block
|
|
4268
|
+
|
|
4269
|
+
Generate for pasting into gate file under `risk_summary`:
|
|
4270
|
+
|
|
4271
|
+
**Output rules:**
|
|
4272
|
+
|
|
4273
|
+
- Only include assessed risks; do not emit placeholders
|
|
4274
|
+
- Sort risks by score (desc) when emitting highest and any tabular lists
|
|
4275
|
+
- If no risks: totals all zeros, omit highest, keep recommendations arrays empty
|
|
4276
|
+
|
|
4277
|
+
```yaml
|
|
4278
|
+
# risk_summary (paste into gate file):
|
|
4279
|
+
risk_summary:
|
|
4280
|
+
totals:
|
|
4281
|
+
critical: X # score 9
|
|
4282
|
+
high: Y # score 6
|
|
4283
|
+
medium: Z # score 4
|
|
4284
|
+
low: W # score 2-3
|
|
4285
|
+
highest:
|
|
4286
|
+
id: SEC-001
|
|
4287
|
+
score: 9
|
|
4288
|
+
title: "XSS on profile form"
|
|
4289
|
+
recommendations:
|
|
4290
|
+
must_fix:
|
|
4291
|
+
- "Add input sanitization & CSP"
|
|
4292
|
+
monitor:
|
|
4293
|
+
- "Add security alerts for auth endpoints"
|
|
4294
|
+
```
|
|
4295
|
+
|
|
4296
|
+
### Output 2: Markdown Report
|
|
4297
|
+
|
|
4298
|
+
**Save to:** `docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md`
|
|
4299
|
+
|
|
4300
|
+
```markdown
|
|
4301
|
+
# Risk Profile: Story {epic}.{story}
|
|
4302
|
+
|
|
4303
|
+
Date: {date}
|
|
4304
|
+
Reviewer: Quinn (Test Architect)
|
|
4305
|
+
|
|
4306
|
+
## Executive Summary
|
|
4307
|
+
|
|
4308
|
+
- Total Risks Identified: X
|
|
4309
|
+
- Critical Risks: Y
|
|
4310
|
+
- High Risks: Z
|
|
4311
|
+
- Risk Score: XX/100 (calculated)
|
|
4312
|
+
|
|
4313
|
+
## Critical Risks Requiring Immediate Attention
|
|
4314
|
+
|
|
4315
|
+
### 1. [ID]: Risk Title
|
|
4316
|
+
|
|
4317
|
+
**Score: 9 (Critical)**
|
|
4318
|
+
**Probability**: High - Detailed reasoning
|
|
4319
|
+
**Impact**: High - Potential consequences
|
|
4320
|
+
**Mitigation**:
|
|
4321
|
+
|
|
4322
|
+
- Immediate action required
|
|
4323
|
+
- Specific steps to take
|
|
4324
|
+
**Testing Focus**: Specific test scenarios needed
|
|
4325
|
+
|
|
4326
|
+
## Risk Distribution
|
|
4327
|
+
|
|
4328
|
+
### By Category
|
|
4329
|
+
|
|
4330
|
+
- Security: X risks (Y critical)
|
|
4331
|
+
- Performance: X risks (Y critical)
|
|
4332
|
+
- Data: X risks (Y critical)
|
|
4333
|
+
- Business: X risks (Y critical)
|
|
4334
|
+
- Operational: X risks (Y critical)
|
|
4335
|
+
|
|
4336
|
+
### By Component
|
|
4337
|
+
|
|
4338
|
+
- Frontend: X risks
|
|
4339
|
+
- Backend: X risks
|
|
4340
|
+
- Database: X risks
|
|
4341
|
+
- Infrastructure: X risks
|
|
4342
|
+
|
|
4343
|
+
## Detailed Risk Register
|
|
4344
|
+
|
|
4345
|
+
[Full table of all risks with scores and mitigations]
|
|
4346
|
+
|
|
4347
|
+
## Risk-Based Testing Strategy
|
|
4348
|
+
|
|
4349
|
+
### Priority 1: Critical Risk Tests
|
|
4350
|
+
|
|
4351
|
+
- Test scenarios for critical risks
|
|
4352
|
+
- Required test types (security, load, chaos)
|
|
4353
|
+
- Test data requirements
|
|
4354
|
+
|
|
4355
|
+
### Priority 2: High Risk Tests
|
|
4356
|
+
|
|
4357
|
+
- Integration test scenarios
|
|
4358
|
+
- Edge case coverage
|
|
4359
|
+
|
|
4360
|
+
### Priority 3: Medium/Low Risk Tests
|
|
4361
|
+
|
|
4362
|
+
- Standard functional tests
|
|
4363
|
+
- Regression test suite
|
|
4364
|
+
|
|
4365
|
+
## Risk Acceptance Criteria
|
|
4366
|
+
|
|
4367
|
+
### Must Fix Before Production
|
|
4368
|
+
|
|
4369
|
+
- All critical risks (score 9)
|
|
4370
|
+
- High risks affecting security/data
|
|
4371
|
+
|
|
4372
|
+
### Can Deploy with Mitigation
|
|
4373
|
+
|
|
4374
|
+
- Medium risks with compensating controls
|
|
4375
|
+
- Low risks with monitoring in place
|
|
4376
|
+
|
|
4377
|
+
### Accepted Risks
|
|
4378
|
+
|
|
4379
|
+
- Document any risks team accepts
|
|
4380
|
+
- Include sign-off from appropriate authority
|
|
4381
|
+
|
|
4382
|
+
## Monitoring Requirements
|
|
4383
|
+
|
|
4384
|
+
Post-deployment monitoring for:
|
|
4385
|
+
|
|
4386
|
+
- Performance metrics for PERF risks
|
|
4387
|
+
- Security alerts for SEC risks
|
|
4388
|
+
- Error rates for operational risks
|
|
4389
|
+
- Business KPIs for business risks
|
|
4390
|
+
|
|
4391
|
+
## Risk Review Triggers
|
|
4392
|
+
|
|
4393
|
+
Review and update risk profile when:
|
|
4394
|
+
|
|
4395
|
+
- Architecture changes significantly
|
|
4396
|
+
- New integrations added
|
|
4397
|
+
- Security vulnerabilities discovered
|
|
4398
|
+
- Performance issues reported
|
|
4399
|
+
- Regulatory requirements change
|
|
4400
|
+
```
|
|
4401
|
+
|
|
4402
|
+
## Risk Scoring Algorithm
|
|
4403
|
+
|
|
4404
|
+
Calculate overall story risk score:
|
|
4405
|
+
|
|
4406
|
+
```
|
|
4407
|
+
Base Score = 100
|
|
4408
|
+
For each risk:
|
|
4409
|
+
- Critical (9): Deduct 20 points
|
|
4410
|
+
- High (6): Deduct 10 points
|
|
4411
|
+
- Medium (4): Deduct 5 points
|
|
4412
|
+
- Low (2-3): Deduct 2 points
|
|
4413
|
+
|
|
4414
|
+
Minimum score = 0 (extremely risky)
|
|
4415
|
+
Maximum score = 100 (minimal risk)
|
|
4416
|
+
```
|
|
4417
|
+
|
|
4418
|
+
## Risk-Based Recommendations
|
|
4419
|
+
|
|
4420
|
+
Based on risk profile, recommend:
|
|
4421
|
+
|
|
4422
|
+
1. **Testing Priority**
|
|
4423
|
+
- Which tests to run first
|
|
4424
|
+
- Additional test types needed
|
|
4425
|
+
- Test environment requirements
|
|
4426
|
+
|
|
4427
|
+
2. **Development Focus**
|
|
4428
|
+
- Code review emphasis areas
|
|
4429
|
+
- Additional validation needed
|
|
4430
|
+
- Security controls to implement
|
|
4431
|
+
|
|
4432
|
+
3. **Deployment Strategy**
|
|
4433
|
+
- Phased rollout for high-risk changes
|
|
4434
|
+
- Feature flags for risky features
|
|
4435
|
+
- Rollback procedures
|
|
4436
|
+
|
|
4437
|
+
4. **Monitoring Setup**
|
|
4438
|
+
- Metrics to track
|
|
4439
|
+
- Alerts to configure
|
|
4440
|
+
- Dashboard requirements
|
|
4441
|
+
|
|
4442
|
+
## Integration with Quality Gates
|
|
4443
|
+
|
|
4444
|
+
**Deterministic gate mapping:**
|
|
4445
|
+
|
|
4446
|
+
- Any risk with score ≥ 9 → Gate = FAIL (unless waived)
|
|
4447
|
+
- Else if any score ≥ 6 → Gate = CONCERNS
|
|
4448
|
+
- Else → Gate = PASS
|
|
4449
|
+
- Unmitigated risks → Document in gate
|
|
4450
|
+
|
|
4451
|
+
### Output 3: Story Hook Line
|
|
4452
|
+
|
|
4453
|
+
**Print this line for review task to quote:**
|
|
4454
|
+
|
|
4455
|
+
```
|
|
4456
|
+
Risk profile: docs/qa/assessments/{epic}.{story}-risk-{YYYYMMDD}.md
|
|
4457
|
+
```
|
|
4458
|
+
|
|
4459
|
+
## Key Principles
|
|
4460
|
+
|
|
4461
|
+
- Identify risks early and systematically
|
|
4462
|
+
- Use consistent probability × impact scoring
|
|
4463
|
+
- Provide actionable mitigation strategies
|
|
4464
|
+
- Link risks to specific test requirements
|
|
4465
|
+
- Track residual risk after mitigation
|
|
4466
|
+
- Update risk profile as story evolves
|
|
4467
|
+
==================== END: .bmad-core/tasks/risk-profile.md ====================
|
|
4468
|
+
|
|
4469
|
+
==================== START: .bmad-core/tasks/test-design.md ====================
|
|
4470
|
+
# test-design
|
|
4471
|
+
|
|
4472
|
+
Create comprehensive test scenarios with appropriate test level recommendations for story implementation.
|
|
4473
|
+
|
|
4474
|
+
## Inputs
|
|
4475
|
+
|
|
4476
|
+
```yaml
|
|
4477
|
+
required:
|
|
4478
|
+
- story_id: "{epic}.{story}" # e.g., "1.3"
|
|
4479
|
+
- story_path: "docs/stories/{epic}.{story}.*.md"
|
|
4480
|
+
- story_title: "{title}" # If missing, derive from story file H1
|
|
4481
|
+
- story_slug: "{slug}" # If missing, derive from title (lowercase, hyphenated)
|
|
4482
|
+
```
|
|
4483
|
+
|
|
4484
|
+
## Purpose
|
|
4485
|
+
|
|
4486
|
+
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.
|
|
4487
|
+
|
|
4488
|
+
## Test Level Decision Framework
|
|
4489
|
+
|
|
4490
|
+
### Unit Tests
|
|
4491
|
+
|
|
4492
|
+
**When to use:**
|
|
4493
|
+
|
|
4494
|
+
- Testing pure functions and business logic
|
|
4495
|
+
- Algorithm correctness
|
|
4496
|
+
- Input validation and data transformation
|
|
4497
|
+
- Error handling in isolated components
|
|
4498
|
+
- Complex calculations or state machines
|
|
4499
|
+
|
|
4500
|
+
**Characteristics:**
|
|
4501
|
+
|
|
4502
|
+
- Fast execution (immediate feedback)
|
|
4503
|
+
- No external dependencies (DB, API, file system)
|
|
4504
|
+
- Highly maintainable and stable
|
|
4505
|
+
- Easy to debug failures
|
|
4506
|
+
|
|
4507
|
+
**Example scenarios:**
|
|
4508
|
+
|
|
4509
|
+
```yaml
|
|
4510
|
+
unit_test:
|
|
4511
|
+
component: "PriceCalculator"
|
|
4512
|
+
scenario: "Calculate discount with multiple rules"
|
|
4513
|
+
justification: "Complex business logic with multiple branches"
|
|
4514
|
+
mock_requirements: "None - pure function"
|
|
4515
|
+
```
|
|
4516
|
+
|
|
4517
|
+
### Integration Tests
|
|
4518
|
+
|
|
4519
|
+
**When to use:**
|
|
4520
|
+
|
|
4521
|
+
- Testing component interactions
|
|
4522
|
+
- Database operations and queries
|
|
4523
|
+
- API endpoint behavior
|
|
4524
|
+
- Service layer orchestration
|
|
4525
|
+
- External service integration (with test doubles)
|
|
4526
|
+
|
|
4527
|
+
**Characteristics:**
|
|
4528
|
+
|
|
4529
|
+
- Moderate execution time
|
|
4530
|
+
- May use test databases or containers
|
|
4531
|
+
- Tests multiple components together
|
|
4532
|
+
- Validates contracts between components
|
|
4533
|
+
|
|
4534
|
+
**Example scenarios:**
|
|
4535
|
+
|
|
4536
|
+
```yaml
|
|
4537
|
+
integration_test:
|
|
4538
|
+
components: ["UserService", "UserRepository", "Database"]
|
|
4539
|
+
scenario: "Create user with duplicate email check"
|
|
4540
|
+
justification: "Tests transaction boundaries and constraint handling"
|
|
4541
|
+
test_doubles: "Mock email service, real test database"
|
|
4542
|
+
```
|
|
4543
|
+
|
|
4544
|
+
### End-to-End Tests
|
|
4545
|
+
|
|
4546
|
+
**When to use:**
|
|
4547
|
+
|
|
4548
|
+
- Critical user journeys
|
|
4549
|
+
- Cross-system workflows
|
|
4550
|
+
- UI interaction flows
|
|
4551
|
+
- Full stack validation
|
|
4552
|
+
- Production-like scenario testing
|
|
4553
|
+
|
|
4554
|
+
**Characteristics:**
|
|
4555
|
+
|
|
4556
|
+
- Keep under 90 seconds per test
|
|
4557
|
+
- Tests complete user scenarios
|
|
4558
|
+
- Uses real or production-like environment
|
|
4559
|
+
- Higher maintenance cost
|
|
4560
|
+
- More prone to flakiness
|
|
4561
|
+
|
|
4562
|
+
**Example scenarios:**
|
|
4563
|
+
|
|
4564
|
+
```yaml
|
|
4565
|
+
e2e_test:
|
|
4566
|
+
flow: "Complete purchase flow"
|
|
4567
|
+
scenario: "User browses, adds to cart, and completes checkout"
|
|
4568
|
+
justification: "Critical business flow requiring full stack validation"
|
|
4569
|
+
environment: "Staging with test payment gateway"
|
|
4570
|
+
```
|
|
4571
|
+
|
|
4572
|
+
## Test Design Process
|
|
4573
|
+
|
|
4574
|
+
### 1. Analyze Story Requirements
|
|
4575
|
+
|
|
4576
|
+
Break down each acceptance criterion into testable scenarios:
|
|
4577
|
+
|
|
4578
|
+
```yaml
|
|
4579
|
+
acceptance_criterion: "User can reset password via email"
|
|
4580
|
+
test_scenarios:
|
|
4581
|
+
- level: unit
|
|
4582
|
+
what: "Password validation rules"
|
|
4583
|
+
why: "Complex regex and business rules"
|
|
4584
|
+
|
|
4585
|
+
- level: integration
|
|
4586
|
+
what: "Password reset token generation and storage"
|
|
4587
|
+
why: "Database interaction with expiry logic"
|
|
4588
|
+
|
|
4589
|
+
- level: integration
|
|
4590
|
+
what: "Email service integration"
|
|
4591
|
+
why: "External service with retry logic"
|
|
4592
|
+
|
|
4593
|
+
- level: e2e
|
|
4594
|
+
what: "Complete password reset flow"
|
|
4595
|
+
why: "Critical security flow needing full validation"
|
|
4596
|
+
```
|
|
4597
|
+
|
|
4598
|
+
### 2. Apply Test Level Heuristics
|
|
4599
|
+
|
|
4600
|
+
Use these rules to determine appropriate test levels:
|
|
4601
|
+
|
|
4602
|
+
```markdown
|
|
4603
|
+
## Test Level Selection Rules
|
|
4604
|
+
|
|
4605
|
+
### Favor Unit Tests When:
|
|
4606
|
+
|
|
4607
|
+
- Logic can be isolated
|
|
4608
|
+
- No side effects involved
|
|
4609
|
+
- Fast feedback needed
|
|
4610
|
+
- High cyclomatic complexity
|
|
4611
|
+
|
|
4612
|
+
### Favor Integration Tests When:
|
|
4613
|
+
|
|
4614
|
+
- Testing persistence layer
|
|
4615
|
+
- Validating service contracts
|
|
4616
|
+
- Testing middleware/interceptors
|
|
4617
|
+
- Component boundaries critical
|
|
4618
|
+
|
|
4619
|
+
### Favor E2E Tests When:
|
|
4620
|
+
|
|
4621
|
+
- User-facing critical paths
|
|
4622
|
+
- Multi-system interactions
|
|
4623
|
+
- Regulatory compliance scenarios
|
|
4624
|
+
- Visual regression important
|
|
4625
|
+
|
|
4626
|
+
### Anti-patterns to Avoid:
|
|
4627
|
+
|
|
4628
|
+
- E2E testing for business logic validation
|
|
4629
|
+
- Unit testing framework behavior
|
|
4630
|
+
- Integration testing third-party libraries
|
|
4631
|
+
- Duplicate coverage across levels
|
|
4632
|
+
|
|
4633
|
+
### Duplicate Coverage Guard
|
|
4634
|
+
|
|
4635
|
+
**Before adding any test, check:**
|
|
4636
|
+
|
|
4637
|
+
1. Is this already tested at a lower level?
|
|
4638
|
+
2. Can a unit test cover this instead of integration?
|
|
4639
|
+
3. Can an integration test cover this instead of E2E?
|
|
4640
|
+
|
|
4641
|
+
**Coverage overlap is only acceptable when:**
|
|
4642
|
+
|
|
4643
|
+
- Testing different aspects (unit: logic, integration: interaction, e2e: user experience)
|
|
4644
|
+
- Critical paths requiring defense in depth
|
|
4645
|
+
- Regression prevention for previously broken functionality
|
|
4646
|
+
```
|
|
4647
|
+
|
|
4648
|
+
### 3. Design Test Scenarios
|
|
4649
|
+
|
|
4650
|
+
**Test ID Format:** `{EPIC}.{STORY}-{LEVEL}-{SEQ}`
|
|
4651
|
+
|
|
4652
|
+
- Example: `1.3-UNIT-001`, `1.3-INT-002`, `1.3-E2E-001`
|
|
4653
|
+
- Ensures traceability across all artifacts
|
|
4654
|
+
|
|
4655
|
+
**Naming Convention:**
|
|
4656
|
+
|
|
4657
|
+
- Unit: `test_{component}_{scenario}`
|
|
4658
|
+
- Integration: `test_{flow}_{interaction}`
|
|
4659
|
+
- E2E: `test_{journey}_{outcome}`
|
|
4660
|
+
|
|
4661
|
+
**Risk Linkage:**
|
|
4662
|
+
|
|
4663
|
+
- Tag tests with risk IDs they mitigate
|
|
4664
|
+
- Prioritize tests for high-risk areas (P0)
|
|
4665
|
+
- Link to risk profile when available
|
|
4666
|
+
|
|
4667
|
+
For each identified test need:
|
|
4668
|
+
|
|
4669
|
+
```yaml
|
|
4670
|
+
test_scenario:
|
|
4671
|
+
id: "1.3-INT-002"
|
|
4672
|
+
requirement: "AC2: Rate limiting on login attempts"
|
|
4673
|
+
mitigates_risks: ["SEC-001", "PERF-003"] # Links to risk profile
|
|
4674
|
+
priority: P0 # Based on risk score
|
|
4675
|
+
|
|
4676
|
+
unit_tests:
|
|
4677
|
+
- name: "RateLimiter calculates window correctly"
|
|
4678
|
+
input: "Timestamp array"
|
|
4679
|
+
expected: "Correct window calculation"
|
|
4680
|
+
|
|
4681
|
+
integration_tests:
|
|
4682
|
+
- name: "Login endpoint enforces rate limit"
|
|
4683
|
+
setup: "5 failed attempts"
|
|
4684
|
+
action: "6th attempt"
|
|
4685
|
+
expected: "429 response with retry-after header"
|
|
4686
|
+
|
|
4687
|
+
e2e_tests:
|
|
4688
|
+
- name: "User sees rate limit message"
|
|
4689
|
+
setup: "Trigger rate limit"
|
|
4690
|
+
validation: "Error message displayed, retry timer shown"
|
|
4691
|
+
```
|
|
4692
|
+
|
|
4693
|
+
## Deterministic Test Level Minimums
|
|
4694
|
+
|
|
4695
|
+
**Per Acceptance Criterion:**
|
|
4696
|
+
|
|
4697
|
+
- At least 1 unit test for business logic
|
|
4698
|
+
- At least 1 integration test if multiple components interact
|
|
4699
|
+
- At least 1 E2E test if it's a user-facing feature
|
|
4700
|
+
|
|
4701
|
+
**Exceptions:**
|
|
4702
|
+
|
|
4703
|
+
- Pure UI changes: May skip unit tests
|
|
4704
|
+
- Pure logic changes: May skip E2E tests
|
|
4705
|
+
- Infrastructure changes: May focus on integration tests
|
|
4706
|
+
|
|
4707
|
+
**When in doubt:** Start with unit tests, add integration for interactions, E2E for critical paths only.
|
|
4708
|
+
|
|
4709
|
+
## Test Quality Standards
|
|
4710
|
+
|
|
4711
|
+
### Core Testing Principles
|
|
4712
|
+
|
|
4713
|
+
**No Flaky Tests:** Ensure reliability through proper async handling, explicit waits, and atomic test design.
|
|
4714
|
+
|
|
4715
|
+
**No Hard Waits/Sleeps:** Use dynamic waiting strategies (e.g., polling, event-based triggers).
|
|
4716
|
+
|
|
4717
|
+
**Stateless & Parallel-Safe:** Tests run independently; use cron jobs or semaphores only if unavoidable.
|
|
4718
|
+
|
|
4719
|
+
**No Order Dependency:** Every it/describe/context block works in isolation (supports .only execution).
|
|
4720
|
+
|
|
4721
|
+
**Self-Cleaning Tests:** Test sets up its own data and automatically deletes/deactivates entities created during testing.
|
|
4722
|
+
|
|
4723
|
+
**Tests Live Near Source Code:** Co-locate test files with the code they validate (e.g., `*.spec.js` alongside components).
|
|
4724
|
+
|
|
4725
|
+
### Execution Strategy
|
|
4726
|
+
|
|
4727
|
+
**Shifted Left:**
|
|
4728
|
+
|
|
4729
|
+
- Start with local environments or ephemeral stacks
|
|
4730
|
+
- Validate functionality across all deployment stages (local → dev → stage)
|
|
4731
|
+
|
|
4732
|
+
**Low Maintenance:** Minimize manual upkeep (avoid brittle selectors, do not repeat UI actions, leverage APIs).
|
|
4733
|
+
|
|
4734
|
+
**CI Execution Evidence:** Integrate into pipelines with clear logs/artifacts.
|
|
4735
|
+
|
|
4736
|
+
**Visibility:** Generate test reports (e.g., JUnit XML, HTML) for failures and trends.
|
|
4737
|
+
|
|
4738
|
+
### Coverage Requirements
|
|
4739
|
+
|
|
4740
|
+
**Release Confidence:**
|
|
4741
|
+
|
|
4742
|
+
- Happy Path: Core user journeys are prioritized
|
|
4743
|
+
- Edge Cases: Critical error/validation scenarios are covered
|
|
4744
|
+
- Feature Flags: Test both enabled and disabled states where applicable
|
|
4745
|
+
|
|
4746
|
+
### Test Design Rules
|
|
4747
|
+
|
|
4748
|
+
**Assertions:** Keep them explicit in tests; avoid abstraction into helpers. Use parametrized tests for soft assertions.
|
|
4749
|
+
|
|
4750
|
+
**Naming:** Follow conventions (e.g., `describe('Component')`, `it('should do X when Y')`).
|
|
4751
|
+
|
|
4752
|
+
**Size:** Aim for files ≤200 lines; split/chunk large tests logically.
|
|
4753
|
+
|
|
4754
|
+
**Speed:** Target individual tests ≤90 seconds; optimize slow setups (e.g., shared fixtures).
|
|
4755
|
+
|
|
4756
|
+
**Careful Abstractions:** Favor readability over DRY when balancing helper reuse (page objects are okay, assertion logic is not).
|
|
4757
|
+
|
|
4758
|
+
**Test Cleanup:** Ensure tests clean up resources they create (e.g., closing browser, deleting test data).
|
|
4759
|
+
|
|
4760
|
+
**Deterministic Flow:** Tests should refrain from using conditionals (e.g., if/else) to control flow or try/catch blocks where possible.
|
|
4761
|
+
|
|
4762
|
+
### API Testing Standards
|
|
4763
|
+
|
|
4764
|
+
- Tests must not depend on hardcoded data → use factories and per-test setup
|
|
4765
|
+
- Always test both happy path and negative/error cases
|
|
4766
|
+
- API tests should run parallel safely (no global state shared)
|
|
4767
|
+
- Test idempotency where applicable (e.g., duplicate requests)
|
|
4768
|
+
- Tests should clean up their data
|
|
4769
|
+
- Response logs should only be printed in case of failure
|
|
4770
|
+
- Auth tests must validate token expiration and renewal
|
|
4771
|
+
|
|
4772
|
+
## Outputs
|
|
4773
|
+
|
|
4774
|
+
### Output 1: Test Design Document
|
|
4775
|
+
|
|
4776
|
+
**Save to:** `docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md`
|
|
4777
|
+
|
|
4778
|
+
Generate a comprehensive test design document:
|
|
4779
|
+
|
|
4780
|
+
```markdown
|
|
4781
|
+
# Test Design: Story {epic}.{story}
|
|
4782
|
+
|
|
4783
|
+
Date: {date}
|
|
4784
|
+
Reviewer: Quinn (Test Architect)
|
|
4785
|
+
|
|
4786
|
+
## Test Strategy Overview
|
|
4787
|
+
|
|
4788
|
+
- Total test scenarios: X
|
|
4789
|
+
- Unit tests: Y (A%)
|
|
4790
|
+
- Integration tests: Z (B%)
|
|
4791
|
+
- E2E tests: W (C%)
|
|
4792
|
+
|
|
4793
|
+
## Test Level Rationale
|
|
4794
|
+
|
|
4795
|
+
[Explain why this distribution was chosen]
|
|
4796
|
+
|
|
4797
|
+
## Detailed Test Scenarios
|
|
4798
|
+
|
|
4799
|
+
### Requirement: AC1 - {description}
|
|
4800
|
+
|
|
4801
|
+
#### Unit Tests (3 scenarios)
|
|
4802
|
+
|
|
4803
|
+
1. **ID**: 1.3-UNIT-001
|
|
4804
|
+
**Test**: Validate input format
|
|
4805
|
+
- **Why Unit**: Pure validation logic
|
|
4806
|
+
- **Coverage**: Input edge cases
|
|
4807
|
+
- **Mocks**: None needed
|
|
4808
|
+
- **Mitigates**: DATA-001 (if applicable)
|
|
4809
|
+
|
|
4810
|
+
#### Integration Tests (2 scenarios)
|
|
4811
|
+
|
|
4812
|
+
1. **ID**: 1.3-INT-001
|
|
4813
|
+
**Test**: Service processes valid request
|
|
4814
|
+
- **Why Integration**: Multiple components involved
|
|
4815
|
+
- **Coverage**: Happy path + error handling
|
|
4816
|
+
- **Test Doubles**: Mock external API
|
|
4817
|
+
- **Mitigates**: TECH-002
|
|
4818
|
+
|
|
4819
|
+
#### E2E Tests (1 scenario)
|
|
4820
|
+
|
|
4821
|
+
1. **ID**: 1.3-E2E-001
|
|
4822
|
+
**Test**: Complete user workflow
|
|
4823
|
+
- **Why E2E**: Critical user journey
|
|
4824
|
+
- **Coverage**: Full stack validation
|
|
4825
|
+
- **Environment**: Staging
|
|
4826
|
+
- **Max Duration**: 90 seconds
|
|
4827
|
+
- **Mitigates**: BUS-001
|
|
4828
|
+
|
|
4829
|
+
[Continue for all requirements...]
|
|
4830
|
+
|
|
4831
|
+
## Test Data Requirements
|
|
4832
|
+
|
|
4833
|
+
### Unit Test Data
|
|
4834
|
+
|
|
4835
|
+
- Static fixtures for calculations
|
|
4836
|
+
- Edge case values arrays
|
|
4837
|
+
|
|
4838
|
+
### Integration Test Data
|
|
4839
|
+
|
|
4840
|
+
- Test database seeds
|
|
4841
|
+
- API response fixtures
|
|
4842
|
+
|
|
4843
|
+
### E2E Test Data
|
|
4844
|
+
|
|
4845
|
+
- Test user accounts
|
|
4846
|
+
- Sandbox environment data
|
|
4847
|
+
|
|
4848
|
+
## Mock/Stub Strategy
|
|
4849
|
+
|
|
4850
|
+
### What to Mock
|
|
4851
|
+
|
|
4852
|
+
- External services (payment, email)
|
|
4853
|
+
- Time-dependent functions
|
|
4854
|
+
- Random number generators
|
|
4855
|
+
|
|
4856
|
+
### What NOT to Mock
|
|
4857
|
+
|
|
4858
|
+
- Core business logic
|
|
4859
|
+
- Database in integration tests
|
|
4860
|
+
- Critical security functions
|
|
4861
|
+
|
|
4862
|
+
## Test Execution Implementation
|
|
4863
|
+
|
|
4864
|
+
### Parallel Execution
|
|
4865
|
+
|
|
4866
|
+
- All unit tests: Fully parallel (stateless requirement)
|
|
4867
|
+
- Integration tests: Parallel with isolated databases
|
|
4868
|
+
- E2E tests: Sequential or limited parallelism
|
|
4869
|
+
|
|
4870
|
+
### Execution Order
|
|
4871
|
+
|
|
4872
|
+
1. Unit tests first (fail fast)
|
|
4873
|
+
2. Integration tests second
|
|
4874
|
+
3. E2E tests last (expensive, max 90 seconds each)
|
|
4875
|
+
|
|
4876
|
+
## Risk-Based Test Priority
|
|
4877
|
+
|
|
4878
|
+
### P0 - Must Have (Linked to Critical/High Risks)
|
|
4879
|
+
|
|
4880
|
+
- Security-related tests (SEC-\* risks)
|
|
4881
|
+
- Data integrity tests (DATA-\* risks)
|
|
4882
|
+
- Critical business flow tests (BUS-\* risks)
|
|
4883
|
+
- Tests for risks scored ≥6 in risk profile
|
|
4884
|
+
|
|
4885
|
+
### P1 - Should Have (Medium Risks)
|
|
4886
|
+
|
|
4887
|
+
- Edge case coverage
|
|
4888
|
+
- Performance tests (PERF-\* risks)
|
|
4889
|
+
- Error recovery tests
|
|
4890
|
+
- Tests for risks scored 4-5
|
|
4891
|
+
|
|
4892
|
+
### P2 - Nice to Have (Low Risks)
|
|
4893
|
+
|
|
4894
|
+
- UI polish tests
|
|
4895
|
+
- Minor validation tests
|
|
4896
|
+
- Tests for risks scored ≤3
|
|
4897
|
+
|
|
4898
|
+
## Test Maintenance Considerations
|
|
4899
|
+
|
|
4900
|
+
### High Maintenance Tests
|
|
4901
|
+
|
|
4902
|
+
[List tests that may need frequent updates]
|
|
4903
|
+
|
|
4904
|
+
### Stability Measures
|
|
4905
|
+
|
|
4906
|
+
- No retry strategies (tests must be deterministic)
|
|
4907
|
+
- Dynamic waits only (no hard sleeps)
|
|
4908
|
+
- Environment isolation
|
|
4909
|
+
- Self-cleaning test data
|
|
4910
|
+
|
|
4911
|
+
## Coverage Goals
|
|
4912
|
+
|
|
4913
|
+
### Unit Test Coverage
|
|
4914
|
+
|
|
4915
|
+
- Target: 80% line coverage
|
|
4916
|
+
- Focus: Business logic, calculations
|
|
4917
|
+
|
|
4918
|
+
### Integration Coverage
|
|
4919
|
+
|
|
4920
|
+
- Target: All API endpoints
|
|
4921
|
+
- Focus: Contract validation
|
|
4922
|
+
|
|
4923
|
+
### E2E Coverage
|
|
4924
|
+
|
|
4925
|
+
- Target: Critical paths only
|
|
4926
|
+
- Focus: User value delivery
|
|
4927
|
+
```
|
|
4928
|
+
|
|
4929
|
+
## Test Level Smells to Flag
|
|
4930
|
+
|
|
4931
|
+
### Over-testing Smells
|
|
4932
|
+
|
|
4933
|
+
- Same logic tested at multiple levels
|
|
4934
|
+
- E2E tests for calculations
|
|
4935
|
+
- Integration tests for framework features
|
|
4936
|
+
|
|
4937
|
+
### Under-testing Smells
|
|
4938
|
+
|
|
4939
|
+
- No unit tests for complex logic
|
|
4940
|
+
- Missing integration tests for data operations
|
|
4941
|
+
- No E2E tests for critical user paths
|
|
4942
|
+
|
|
4943
|
+
### Wrong Level Smells
|
|
4944
|
+
|
|
4945
|
+
- Unit tests with real database
|
|
4946
|
+
- E2E tests checking calculation results
|
|
4947
|
+
- Integration tests mocking everything
|
|
4948
|
+
|
|
4949
|
+
## Quality Indicators
|
|
4950
|
+
|
|
4951
|
+
Good test design shows:
|
|
4952
|
+
|
|
4953
|
+
- Clear level separation
|
|
4954
|
+
- No redundant coverage
|
|
4955
|
+
- Fast feedback from unit tests
|
|
4956
|
+
- Reliable integration tests
|
|
4957
|
+
- Focused e2e tests
|
|
4958
|
+
|
|
4959
|
+
## Key Principles
|
|
4960
|
+
|
|
4961
|
+
- Test at the lowest appropriate level
|
|
4962
|
+
- One clear owner per test
|
|
4963
|
+
- Fast tests run first
|
|
4964
|
+
- Mock at boundaries, not internals
|
|
4965
|
+
- E2E for user value, not implementation
|
|
4966
|
+
- Maintain test/production parity where critical
|
|
4967
|
+
- Tests must be atomic and self-contained
|
|
4968
|
+
- No shared state between tests
|
|
4969
|
+
- Explicit assertions in test files (not helpers)
|
|
4970
|
+
|
|
4971
|
+
### Output 2: Story Hook Line
|
|
4972
|
+
|
|
4973
|
+
**Print this line for review task to quote:**
|
|
4974
|
+
|
|
4975
|
+
```text
|
|
4976
|
+
Test design: docs/qa/assessments/{epic}.{story}-test-design-{YYYYMMDD}.md
|
|
4977
|
+
```
|
|
4978
|
+
|
|
4979
|
+
**For traceability:** This planning document will be referenced by trace-requirements task.
|
|
4980
|
+
|
|
4981
|
+
### Output 3: Test Count Summary
|
|
4982
|
+
|
|
4983
|
+
**Print summary for quick reference:**
|
|
4984
|
+
|
|
4985
|
+
```yaml
|
|
4986
|
+
test_summary:
|
|
4987
|
+
total: { total_count }
|
|
4988
|
+
by_level:
|
|
4989
|
+
unit: { unit_count }
|
|
4990
|
+
integration: { int_count }
|
|
4991
|
+
e2e: { e2e_count }
|
|
4992
|
+
by_priority:
|
|
4993
|
+
P0: { p0_count }
|
|
4994
|
+
P1: { p1_count }
|
|
4995
|
+
P2: { p2_count }
|
|
4996
|
+
coverage_gaps: [] # List any ACs without tests
|
|
4997
|
+
```
|
|
4998
|
+
==================== END: .bmad-core/tasks/test-design.md ====================
|
|
4999
|
+
|
|
5000
|
+
==================== START: .bmad-core/tasks/nfr-assess.md ====================
|
|
5001
|
+
# nfr-assess
|
|
5002
|
+
|
|
5003
|
+
Quick NFR validation focused on the core four: security, performance, reliability, maintainability.
|
|
5004
|
+
|
|
5005
|
+
## Inputs
|
|
5006
|
+
|
|
5007
|
+
```yaml
|
|
5008
|
+
required:
|
|
5009
|
+
- story_id: "{epic}.{story}" # e.g., "1.3"
|
|
5010
|
+
- story_path: "docs/stories/{epic}.{story}.*.md"
|
|
5011
|
+
|
|
5012
|
+
optional:
|
|
5013
|
+
- architecture_refs: "docs/architecture/*.md"
|
|
5014
|
+
- technical_preferences: "docs/technical-preferences.md"
|
|
5015
|
+
- acceptance_criteria: From story file
|
|
5016
|
+
```
|
|
5017
|
+
|
|
5018
|
+
## Purpose
|
|
5019
|
+
|
|
5020
|
+
Assess non-functional requirements for a story and generate:
|
|
5021
|
+
|
|
5022
|
+
1. YAML block for the gate file's `nfr_validation` section
|
|
5023
|
+
2. Brief markdown assessment saved to `docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md`
|
|
5024
|
+
|
|
5025
|
+
## Process
|
|
5026
|
+
|
|
5027
|
+
### 0. Fail-safe for Missing Inputs
|
|
5028
|
+
|
|
5029
|
+
If story_path or story file can't be found:
|
|
5030
|
+
|
|
5031
|
+
- Still create assessment file with note: "Source story not found"
|
|
5032
|
+
- Set all selected NFRs to CONCERNS with notes: "Target unknown / evidence missing"
|
|
5033
|
+
- Continue with assessment to provide value
|
|
5034
|
+
|
|
5035
|
+
### 1. Elicit Scope
|
|
5036
|
+
|
|
5037
|
+
**Interactive mode:** Ask which NFRs to assess
|
|
5038
|
+
**Non-interactive mode:** Default to core four (security, performance, reliability, maintainability)
|
|
5039
|
+
|
|
5040
|
+
```text
|
|
5041
|
+
Which NFRs should I assess? (Enter numbers or press Enter for default)
|
|
5042
|
+
[1] Security (default)
|
|
5043
|
+
[2] Performance (default)
|
|
5044
|
+
[3] Reliability (default)
|
|
5045
|
+
[4] Maintainability (default)
|
|
5046
|
+
[5] Usability
|
|
5047
|
+
[6] Compatibility
|
|
5048
|
+
[7] Portability
|
|
5049
|
+
[8] Functional Suitability
|
|
5050
|
+
|
|
5051
|
+
> [Enter for 1-4]
|
|
5052
|
+
```
|
|
5053
|
+
|
|
5054
|
+
### 2. Check for Thresholds
|
|
5055
|
+
|
|
5056
|
+
Look for NFR requirements in:
|
|
5057
|
+
|
|
5058
|
+
- Story acceptance criteria
|
|
5059
|
+
- `docs/architecture/*.md` files
|
|
5060
|
+
- `docs/technical-preferences.md`
|
|
5061
|
+
|
|
5062
|
+
**Interactive mode:** Ask for missing thresholds
|
|
5063
|
+
**Non-interactive mode:** Mark as CONCERNS with "Target unknown"
|
|
5064
|
+
|
|
5065
|
+
```text
|
|
5066
|
+
No performance requirements found. What's your target response time?
|
|
5067
|
+
> 200ms for API calls
|
|
5068
|
+
|
|
5069
|
+
No security requirements found. Required auth method?
|
|
5070
|
+
> JWT with refresh tokens
|
|
5071
|
+
```
|
|
5072
|
+
|
|
5073
|
+
**Unknown targets policy:** If a target is missing and not provided, mark status as CONCERNS with notes: "Target unknown"
|
|
5074
|
+
|
|
5075
|
+
### 3. Quick Assessment
|
|
5076
|
+
|
|
5077
|
+
For each selected NFR, check:
|
|
5078
|
+
|
|
5079
|
+
- Is there evidence it's implemented?
|
|
5080
|
+
- Can we validate it?
|
|
5081
|
+
- Are there obvious gaps?
|
|
5082
|
+
|
|
5083
|
+
### 4. Generate Outputs
|
|
5084
|
+
|
|
5085
|
+
## Output 1: Gate YAML Block
|
|
5086
|
+
|
|
5087
|
+
Generate ONLY for NFRs actually assessed (no placeholders):
|
|
5088
|
+
|
|
5089
|
+
```yaml
|
|
5090
|
+
# Gate YAML (copy/paste):
|
|
5091
|
+
nfr_validation:
|
|
5092
|
+
_assessed: [security, performance, reliability, maintainability]
|
|
5093
|
+
security:
|
|
5094
|
+
status: CONCERNS
|
|
5095
|
+
notes: "No rate limiting on auth endpoints"
|
|
5096
|
+
performance:
|
|
5097
|
+
status: PASS
|
|
5098
|
+
notes: "Response times < 200ms verified"
|
|
5099
|
+
reliability:
|
|
5100
|
+
status: PASS
|
|
5101
|
+
notes: "Error handling and retries implemented"
|
|
5102
|
+
maintainability:
|
|
5103
|
+
status: CONCERNS
|
|
5104
|
+
notes: "Test coverage at 65%, target is 80%"
|
|
5105
|
+
```
|
|
5106
|
+
|
|
5107
|
+
## Deterministic Status Rules
|
|
5108
|
+
|
|
5109
|
+
- **FAIL**: Any selected NFR has critical gap or target clearly not met
|
|
5110
|
+
- **CONCERNS**: No FAILs, but any NFR is unknown/partial/missing evidence
|
|
5111
|
+
- **PASS**: All selected NFRs meet targets with evidence
|
|
5112
|
+
|
|
5113
|
+
## Quality Score Calculation
|
|
5114
|
+
|
|
5115
|
+
```
|
|
5116
|
+
quality_score = 100
|
|
5117
|
+
- 20 for each FAIL attribute
|
|
5118
|
+
- 10 for each CONCERNS attribute
|
|
5119
|
+
Floor at 0, ceiling at 100
|
|
5120
|
+
```
|
|
5121
|
+
|
|
5122
|
+
If `technical-preferences.md` defines custom weights, use those instead.
|
|
5123
|
+
|
|
5124
|
+
## Output 2: Brief Assessment Report
|
|
5125
|
+
|
|
5126
|
+
**ALWAYS save to:** `docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md`
|
|
5127
|
+
|
|
5128
|
+
```markdown
|
|
5129
|
+
# NFR Assessment: {epic}.{story}
|
|
5130
|
+
|
|
5131
|
+
Date: {date}
|
|
5132
|
+
Reviewer: Quinn
|
|
5133
|
+
|
|
5134
|
+
<!-- Note: Source story not found (if applicable) -->
|
|
5135
|
+
|
|
5136
|
+
## Summary
|
|
5137
|
+
|
|
5138
|
+
- Security: CONCERNS - Missing rate limiting
|
|
5139
|
+
- Performance: PASS - Meets <200ms requirement
|
|
5140
|
+
- Reliability: PASS - Proper error handling
|
|
5141
|
+
- Maintainability: CONCERNS - Test coverage below target
|
|
5142
|
+
|
|
5143
|
+
## Critical Issues
|
|
5144
|
+
|
|
5145
|
+
1. **No rate limiting** (Security)
|
|
5146
|
+
- Risk: Brute force attacks possible
|
|
5147
|
+
- Fix: Add rate limiting middleware to auth endpoints
|
|
5148
|
+
|
|
5149
|
+
2. **Test coverage 65%** (Maintainability)
|
|
5150
|
+
- Risk: Untested code paths
|
|
5151
|
+
- Fix: Add tests for uncovered branches
|
|
5152
|
+
|
|
5153
|
+
## Quick Wins
|
|
5154
|
+
|
|
5155
|
+
- Add rate limiting: ~2 hours
|
|
5156
|
+
- Increase test coverage: ~4 hours
|
|
5157
|
+
- Add performance monitoring: ~1 hour
|
|
5158
|
+
```
|
|
5159
|
+
|
|
5160
|
+
## Output 3: Story Update Line
|
|
5161
|
+
|
|
5162
|
+
**End with this line for the review task to quote:**
|
|
5163
|
+
|
|
5164
|
+
```
|
|
5165
|
+
NFR assessment: docs/qa/assessments/{epic}.{story}-nfr-{YYYYMMDD}.md
|
|
5166
|
+
```
|
|
5167
|
+
|
|
5168
|
+
## Output 4: Gate Integration Line
|
|
5169
|
+
|
|
5170
|
+
**Always print at the end:**
|
|
5171
|
+
|
|
5172
|
+
```
|
|
5173
|
+
Gate NFR block ready → paste into docs/qa/gates/{epic}.{story}-{slug}.yml under nfr_validation
|
|
5174
|
+
```
|
|
5175
|
+
|
|
5176
|
+
## Assessment Criteria
|
|
5177
|
+
|
|
5178
|
+
### Security
|
|
5179
|
+
|
|
5180
|
+
**PASS if:**
|
|
5181
|
+
|
|
5182
|
+
- Authentication implemented
|
|
5183
|
+
- Authorization enforced
|
|
5184
|
+
- Input validation present
|
|
5185
|
+
- No hardcoded secrets
|
|
5186
|
+
|
|
5187
|
+
**CONCERNS if:**
|
|
5188
|
+
|
|
5189
|
+
- Missing rate limiting
|
|
5190
|
+
- Weak encryption
|
|
5191
|
+
- Incomplete authorization
|
|
5192
|
+
|
|
5193
|
+
**FAIL if:**
|
|
5194
|
+
|
|
5195
|
+
- No authentication
|
|
5196
|
+
- Hardcoded credentials
|
|
5197
|
+
- SQL injection vulnerabilities
|
|
5198
|
+
|
|
5199
|
+
### Performance
|
|
5200
|
+
|
|
5201
|
+
**PASS if:**
|
|
5202
|
+
|
|
5203
|
+
- Meets response time targets
|
|
5204
|
+
- No obvious bottlenecks
|
|
5205
|
+
- Reasonable resource usage
|
|
5206
|
+
|
|
5207
|
+
**CONCERNS if:**
|
|
5208
|
+
|
|
5209
|
+
- Close to limits
|
|
5210
|
+
- Missing indexes
|
|
5211
|
+
- No caching strategy
|
|
5212
|
+
|
|
5213
|
+
**FAIL if:**
|
|
5214
|
+
|
|
5215
|
+
- Exceeds response time limits
|
|
5216
|
+
- Memory leaks
|
|
5217
|
+
- Unoptimized queries
|
|
5218
|
+
|
|
5219
|
+
### Reliability
|
|
5220
|
+
|
|
5221
|
+
**PASS if:**
|
|
5222
|
+
|
|
5223
|
+
- Error handling present
|
|
5224
|
+
- Graceful degradation
|
|
5225
|
+
- Retry logic where needed
|
|
5226
|
+
|
|
5227
|
+
**CONCERNS if:**
|
|
5228
|
+
|
|
5229
|
+
- Some error cases unhandled
|
|
5230
|
+
- No circuit breakers
|
|
5231
|
+
- Missing health checks
|
|
5232
|
+
|
|
5233
|
+
**FAIL if:**
|
|
5234
|
+
|
|
5235
|
+
- No error handling
|
|
5236
|
+
- Crashes on errors
|
|
5237
|
+
- No recovery mechanisms
|
|
5238
|
+
|
|
5239
|
+
### Maintainability
|
|
5240
|
+
|
|
5241
|
+
**PASS if:**
|
|
5242
|
+
|
|
5243
|
+
- Test coverage meets target
|
|
5244
|
+
- Code well-structured
|
|
5245
|
+
- Documentation present
|
|
5246
|
+
|
|
5247
|
+
**CONCERNS if:**
|
|
5248
|
+
|
|
5249
|
+
- Test coverage below target
|
|
5250
|
+
- Some code duplication
|
|
5251
|
+
- Missing documentation
|
|
5252
|
+
|
|
5253
|
+
**FAIL if:**
|
|
5254
|
+
|
|
5255
|
+
- No tests
|
|
5256
|
+
- Highly coupled code
|
|
5257
|
+
- No documentation
|
|
5258
|
+
|
|
5259
|
+
## Quick Reference
|
|
5260
|
+
|
|
5261
|
+
### What to Check
|
|
5262
|
+
|
|
5263
|
+
```yaml
|
|
5264
|
+
security:
|
|
5265
|
+
- Authentication mechanism
|
|
5266
|
+
- Authorization checks
|
|
5267
|
+
- Input validation
|
|
5268
|
+
- Secret management
|
|
5269
|
+
- Rate limiting
|
|
5270
|
+
|
|
5271
|
+
performance:
|
|
5272
|
+
- Response times
|
|
5273
|
+
- Database queries
|
|
5274
|
+
- Caching usage
|
|
5275
|
+
- Resource consumption
|
|
5276
|
+
|
|
5277
|
+
reliability:
|
|
5278
|
+
- Error handling
|
|
5279
|
+
- Retry logic
|
|
5280
|
+
- Circuit breakers
|
|
5281
|
+
- Health checks
|
|
5282
|
+
- Logging
|
|
5283
|
+
|
|
5284
|
+
maintainability:
|
|
5285
|
+
- Test coverage
|
|
5286
|
+
- Code structure
|
|
5287
|
+
- Documentation
|
|
5288
|
+
- Dependencies
|
|
5289
|
+
```
|
|
5290
|
+
|
|
5291
|
+
## Key Principles
|
|
5292
|
+
|
|
5293
|
+
- Focus on the core four NFRs by default
|
|
5294
|
+
- Quick assessment, not deep analysis
|
|
5295
|
+
- Gate-ready output format
|
|
5296
|
+
- Brief, actionable findings
|
|
5297
|
+
- Skip what doesn't apply
|
|
5298
|
+
- Deterministic status rules for consistency
|
|
5299
|
+
- Unknown targets → CONCERNS, not guesses
|
|
5300
|
+
|
|
5301
|
+
---
|
|
5302
|
+
|
|
5303
|
+
## Appendix: ISO 25010 Reference
|
|
5304
|
+
|
|
5305
|
+
<details>
|
|
5306
|
+
<summary>Full ISO 25010 Quality Model (click to expand)</summary>
|
|
5307
|
+
|
|
5308
|
+
### All 8 Quality Characteristics
|
|
5309
|
+
|
|
5310
|
+
1. **Functional Suitability**: Completeness, correctness, appropriateness
|
|
5311
|
+
2. **Performance Efficiency**: Time behavior, resource use, capacity
|
|
5312
|
+
3. **Compatibility**: Co-existence, interoperability
|
|
5313
|
+
4. **Usability**: Learnability, operability, accessibility
|
|
5314
|
+
5. **Reliability**: Maturity, availability, fault tolerance
|
|
5315
|
+
6. **Security**: Confidentiality, integrity, authenticity
|
|
5316
|
+
7. **Maintainability**: Modularity, reusability, testability
|
|
5317
|
+
8. **Portability**: Adaptability, installability
|
|
5318
|
+
|
|
5319
|
+
Use these when assessing beyond the core four.
|
|
5320
|
+
|
|
5321
|
+
</details>
|
|
5322
|
+
|
|
5323
|
+
<details>
|
|
5324
|
+
<summary>Example: Deep Performance Analysis (click to expand)</summary>
|
|
5325
|
+
|
|
5326
|
+
```yaml
|
|
5327
|
+
performance_deep_dive:
|
|
5328
|
+
response_times:
|
|
5329
|
+
p50: 45ms
|
|
5330
|
+
p95: 180ms
|
|
5331
|
+
p99: 350ms
|
|
5332
|
+
database:
|
|
5333
|
+
slow_queries: 2
|
|
5334
|
+
missing_indexes: ["users.email", "orders.user_id"]
|
|
5335
|
+
caching:
|
|
5336
|
+
hit_rate: 0%
|
|
5337
|
+
recommendation: "Add Redis for session data"
|
|
5338
|
+
load_test:
|
|
5339
|
+
max_rps: 150
|
|
5340
|
+
breaking_point: 200 rps
|
|
5341
|
+
```
|
|
5342
|
+
|
|
5343
|
+
</details>
|
|
5344
|
+
==================== END: .bmad-core/tasks/nfr-assess.md ====================
|
|
5345
|
+
|
|
5346
|
+
==================== START: .bmad-core/templates/qa-gate-tmpl.yaml ====================
|
|
5347
|
+
template:
|
|
5348
|
+
id: qa-gate-template-v1
|
|
5349
|
+
name: Quality Gate Decision
|
|
5350
|
+
version: 1.0
|
|
5351
|
+
output:
|
|
5352
|
+
format: yaml
|
|
5353
|
+
filename: docs/qa/gates/{{epic_num}}.{{story_num}}-{{story_slug}}.yml
|
|
5354
|
+
title: "Quality Gate: {{epic_num}}.{{story_num}}"
|
|
5355
|
+
|
|
5356
|
+
# Required fields (keep these first)
|
|
5357
|
+
schema: 1
|
|
5358
|
+
story: "{{epic_num}}.{{story_num}}"
|
|
5359
|
+
story_title: "{{story_title}}"
|
|
5360
|
+
gate: "{{gate_status}}" # PASS|CONCERNS|FAIL|WAIVED
|
|
5361
|
+
status_reason: "{{status_reason}}" # 1-2 sentence summary of why this gate decision
|
|
5362
|
+
reviewer: "Quinn (Test Architect)"
|
|
5363
|
+
updated: "{{iso_timestamp}}"
|
|
5364
|
+
|
|
5365
|
+
# Always present but only active when WAIVED
|
|
5366
|
+
waiver: { active: false }
|
|
5367
|
+
|
|
5368
|
+
# Issues (if any) - Use fixed severity: low | medium | high
|
|
5369
|
+
top_issues: []
|
|
5370
|
+
|
|
5371
|
+
# Risk summary (from risk-profile task if run)
|
|
5372
|
+
risk_summary:
|
|
5373
|
+
totals: { critical: 0, high: 0, medium: 0, low: 0 }
|
|
5374
|
+
recommendations:
|
|
5375
|
+
must_fix: []
|
|
5376
|
+
monitor: []
|
|
5377
|
+
|
|
5378
|
+
# Example with issues:
|
|
5379
|
+
# top_issues:
|
|
5380
|
+
# - id: "SEC-001"
|
|
5381
|
+
# severity: high # ONLY: low|medium|high
|
|
5382
|
+
# finding: "No rate limiting on login endpoint"
|
|
5383
|
+
# suggested_action: "Add rate limiting middleware before production"
|
|
5384
|
+
# - id: "TEST-001"
|
|
5385
|
+
# severity: medium
|
|
5386
|
+
# finding: "Missing integration tests for auth flow"
|
|
5387
|
+
# suggested_action: "Add test coverage for critical paths"
|
|
5388
|
+
|
|
5389
|
+
# Example when waived:
|
|
5390
|
+
# waiver:
|
|
5391
|
+
# active: true
|
|
5392
|
+
# reason: "Accepted for MVP release - will address in next sprint"
|
|
5393
|
+
# approved_by: "Product Owner"
|
|
5394
|
+
|
|
5395
|
+
# ============ Optional Extended Fields ============
|
|
5396
|
+
# Uncomment and use if your team wants more detail
|
|
5397
|
+
|
|
5398
|
+
# quality_score: 75 # 0-100 (optional scoring)
|
|
5399
|
+
# expires: "2025-01-26T00:00:00Z" # Optional gate freshness window
|
|
5400
|
+
|
|
5401
|
+
# evidence:
|
|
5402
|
+
# tests_reviewed: 15
|
|
5403
|
+
# risks_identified: 3
|
|
5404
|
+
# trace:
|
|
5405
|
+
# ac_covered: [1, 2, 3] # AC numbers with test coverage
|
|
5406
|
+
# ac_gaps: [4] # AC numbers lacking coverage
|
|
5407
|
+
|
|
5408
|
+
# nfr_validation:
|
|
5409
|
+
# security: { status: CONCERNS, notes: "Rate limiting missing" }
|
|
5410
|
+
# performance: { status: PASS, notes: "" }
|
|
5411
|
+
# reliability: { status: PASS, notes: "" }
|
|
5412
|
+
# maintainability: { status: PASS, notes: "" }
|
|
5413
|
+
|
|
5414
|
+
# history: # Append-only audit trail
|
|
5415
|
+
# - at: "2025-01-12T10:00:00Z"
|
|
5416
|
+
# gate: FAIL
|
|
5417
|
+
# note: "Initial review - missing tests"
|
|
5418
|
+
# - at: "2025-01-12T15:00:00Z"
|
|
5419
|
+
# gate: CONCERNS
|
|
5420
|
+
# note: "Tests added but rate limiting still missing"
|
|
5421
|
+
|
|
5422
|
+
# risk_summary: # From risk-profile task
|
|
5423
|
+
# totals:
|
|
5424
|
+
# critical: 0
|
|
5425
|
+
# high: 0
|
|
5426
|
+
# medium: 0
|
|
5427
|
+
# low: 0
|
|
5428
|
+
# # 'highest' is emitted only when risks exist
|
|
5429
|
+
# recommendations:
|
|
5430
|
+
# must_fix: []
|
|
5431
|
+
# monitor: []
|
|
5432
|
+
|
|
5433
|
+
# recommendations:
|
|
5434
|
+
# immediate: # Must fix before production
|
|
5435
|
+
# - action: "Add rate limiting to auth endpoints"
|
|
5436
|
+
# refs: ["api/auth/login.ts:42-68"]
|
|
5437
|
+
# future: # Can be addressed later
|
|
5438
|
+
# - action: "Consider caching for better performance"
|
|
5439
|
+
# refs: ["services/data.service.ts"]
|
|
5440
|
+
==================== END: .bmad-core/templates/qa-gate-tmpl.yaml ====================
|
|
5441
|
+
|
|
3503
5442
|
==================== START: .bmad-core/data/technical-preferences.md ====================
|
|
3504
5443
|
# User-Defined Preferred Patterns and Preferences
|
|
3505
5444
|
|