qa-mode-map.mdcโข23.2 kB
---
description: QA Mode
globs: qa-mode-map.mdc
alwaysApply: false
---
> **TL;DR:** This enhanced QA mode provides comprehensive validation at any stage of development. It automatically detects the current phase, validates Memory Bank consistency, verifies task tracking, and performs phase-specific technical validation to ensure project quality throughout the development lifecycle.
## ๐ ENHANCED QA MODE PROCESS FLOW
```mermaid
graph TD
Start["๐ START QA MODE"] --> DetectPhase["๐งญ PHASE DETECTION<br>Determine current project phase"]
%% Phase detection decision path
DetectPhase --> PhaseDetermination{"Current Phase?"}
PhaseDetermination -->|"VAN"| VANChecks["VAN Phase Validation"]
PhaseDetermination -->|"PLAN"| PLANChecks["PLAN Phase Validation"]
PhaseDetermination -->|"CREATIVE"| CREATIVEChecks["CREATIVE Phase Validation"]
PhaseDetermination -->|"IMPLEMENT"| IMPLEMENTChecks["IMPLEMENT Phase Validation"]
%% Universal checks that apply to all phases
DetectPhase --> UniversalChecks["๐ UNIVERSAL VALIDATION"]
UniversalChecks --> MemoryBankCheck["1๏ธโฃ MEMORY BANK VERIFICATION<br>Check consistency & updates"]
MemoryBankCheck --> TaskTrackingCheck["2๏ธโฃ TASK TRACKING VERIFICATION<br>Validate tasks.md as source of truth"]
TaskTrackingCheck --> ReferenceCheck["3๏ธโฃ REFERENCE VALIDATION<br>Verify cross-references between docs"]
%% Phase-specific validations feed into comprehensive report
VANChecks & PLANChecks & CREATIVEChecks & IMPLEMENTChecks --> PhaseSpecificResults["Phase-Specific Results"]
ReferenceCheck & PhaseSpecificResults --> ValidationResults{"โ
All Checks<br>Passed?"}
%% Results Processing
ValidationResults -->|"Yes"| SuccessReport["๐ GENERATE SUCCESS REPORT<br>All validations passed"]
ValidationResults -->|"No"| FailureReport["โ ๏ธ GENERATE FAILURE REPORT<br>With specific fix instructions"]
%% Success Path
SuccessReport --> UpdateMB["๐ Update Memory Bank<br>Record successful validation"]
UpdateMB --> ContinueProcess["๐ฆ CONTINUE: Phase processes<br>can proceed"]
%% Failure Path
FailureReport --> IdentifyFixes["๐ง IDENTIFY REQUIRED FIXES"]
IdentifyFixes --> ApplyFixes["๐ ๏ธ APPLY FIXES"]
ApplyFixes --> Revalidate["๐ Re-run validation"]
Revalidate --> ValidationResults
%% Style nodes for clarity
style Start fill:#4da6ff,stroke:#0066cc,color:white
style DetectPhase fill:#f6ad55,stroke:#c27022,color:white
style UniversalChecks fill:#f6546a,stroke:#c30052,color:white
style MemoryBankCheck fill:#10b981,stroke:#059669,color:white
style TaskTrackingCheck fill:#10b981,stroke:#059669,color:white
style ReferenceCheck fill:#10b981,stroke:#059669,color:white
style ValidationResults fill:#f6546a,stroke:#c30052,color:white
style SuccessReport fill:#10b981,stroke:#059669,color:white
style FailureReport fill:#f6ad55,stroke:#c27022,color:white
style ContinueProcess fill:#10b981,stroke:#059669,color:white,stroke-width:2px
style IdentifyFixes fill:#f6ad55,stroke:#c27022,color:white
```
## ๐งญ PHASE DETECTION PROCESS
The enhanced QA mode first determines which phase the project is currently in:
```mermaid
graph TD
PD["Phase Detection"] --> CheckMB["Analyze Memory Bank Files"]
CheckMB --> CheckActive["Check activeContext.md<br>for current phase"]
CheckActive --> CheckProgress["Check progress.md<br>for recent activities"]
CheckProgress --> CheckTasks["Check tasks.md<br>for task status"]
CheckTasks --> PhaseResult{"Determine<br>Current Phase"}
PhaseResult -->|"VAN"| VAN["VAN Phase<br>Initialization"]
PhaseResult -->|"PLAN"| PLAN["PLAN Phase<br>Task Planning"]
PhaseResult -->|"CREATIVE"| CREATIVE["CREATIVE Phase<br>Design Decisions"]
PhaseResult -->|"IMPLEMENT"| IMPLEMENT["IMPLEMENT Phase<br>Implementation"]
VAN & PLAN & CREATIVE & IMPLEMENT --> LoadChecks["Load Phase-Specific<br>Validation Checks"]
style PD fill:#4da6ff,stroke:#0066cc,color:white
style PhaseResult fill:#f6546a,stroke:#c30052,color:white
style LoadChecks fill:#10b981,stroke:#059669,color:white
```
## ๐ UNIVERSAL MEMORY BANK VERIFICATION
This process ensures Memory Bank files are consistent and up-to-date regardless of phase:
```mermaid
graph TD
MBVS["Memory Bank<br>Verification"] --> CoreCheck["Check Core Files Exist"]
CoreCheck --> CoreFiles["Verify Required Files:<br>projectbrief.md<br>activeContext.md<br>tasks.md<br>progress.md"]
CoreFiles --> ContentCheck["Verify Content<br>Consistency"]
ContentCheck --> LastModified["Check Last Modified<br>Timestamps"]
LastModified --> CrossRef["Validate Cross-<br>References"]
CrossRef --> ConsistencyCheck{"All Files<br>Consistent?"}
ConsistencyCheck -->|"Yes"| PassMB["โ
Memory Bank<br>Verification Passed"]
ConsistencyCheck -->|"No"| FailMB["โ Memory Bank<br>Inconsistencies Found"]
FailMB --> FixSuggestions["Generate Fix<br>Suggestions"]
style MBVS fill:#4da6ff,stroke:#0066cc,color:white
style ConsistencyCheck fill:#f6546a,stroke:#c30052,color:white
style PassMB fill:#10b981,stroke:#059669,color:white
style FailMB fill:#ff5555,stroke:#dd3333,color:white
```
## ๐ TASK TRACKING VERIFICATION
This process validates tasks.md as the single source of truth:
```mermaid
graph TD
TTV["Task Tracking<br>Verification"] --> CheckTasksFile["Check tasks.md<br>Existence & Format"]
CheckTasksFile --> VerifyReferences["Verify Task References<br>in Other Documents"]
VerifyReferences --> ProgressCheck["Check Consistency with<br>progress.md"]
ProgressCheck --> StatusCheck["Verify Task Status<br>Accuracy"]
StatusCheck --> TaskConsistency{"Tasks Properly<br>Tracked?"}
TaskConsistency -->|"Yes"| PassTasks["โ
Task Tracking<br>Verification Passed"]
TaskConsistency -->|"No"| FailTasks["โ Task Tracking<br>Issues Found"]
FailTasks --> TaskFixSuggestions["Generate Task Tracking<br>Fix Suggestions"]
style TTV fill:#4da6ff,stroke:#0066cc,color:white
style TaskConsistency fill:#f6546a,stroke:#c30052,color:white
style PassTasks fill:#10b981,stroke:#059669,color:white
style FailTasks fill:#ff5555,stroke:#dd3333,color:white
```
## ๐ REFERENCE VALIDATION PROCESS
This process ensures proper cross-referencing between documents:
```mermaid
graph TD
RV["Reference<br>Validation"] --> FindRefs["Find Cross-References<br>in Documents"]
FindRefs --> VerifyRefs["Verify Reference<br>Accuracy"]
VerifyRefs --> CheckBackRefs["Check Bidirectional<br>References"]
CheckBackRefs --> RefConsistency{"References<br>Consistent?"}
RefConsistency -->|"Yes"| PassRefs["โ
Reference Validation<br>Passed"]
RefConsistency -->|"No"| FailRefs["โ Reference<br>Issues Found"]
FailRefs --> RefFixSuggestions["Generate Reference<br>Fix Suggestions"]
style RV fill:#4da6ff,stroke:#0066cc,color:white
style RefConsistency fill:#f6546a,stroke:#c30052,color:white
style PassRefs fill:#10b981,stroke:#059669,color:white
style FailRefs fill:#ff5555,stroke:#dd3333,color:white
```
## ๐จ PHASE-SPECIFIC VALIDATION PROCESSES
### VAN Phase Validation
```mermaid
graph TD
VAN["VAN Phase<br>Validation"] --> InitCheck["Check Initialization<br>Completeness"]
InitCheck --> PlatformCheck["Verify Platform<br>Detection"]
PlatformCheck --> ComplexityCheck["Validate Complexity<br>Determination"]
ComplexityCheck --> VANConsistency{"VAN Phase<br>Complete?"}
VANConsistency -->|"Yes"| PassVAN["โ
VAN Phase<br>Validation Passed"]
VANConsistency -->|"No"| FailVAN["โ VAN Phase<br>Issues Found"]
style VAN fill:#4da6ff,stroke:#0066cc,color:white
style VANConsistency fill:#f6546a,stroke:#c30052,color:white
style PassVAN fill:#10b981,stroke:#059669,color:white
style FailVAN fill:#ff5555,stroke:#dd3333,color:white
```
### PLAN Phase Validation
```mermaid
graph TD
PLAN["PLAN Phase<br>Validation"] --> PlanCheck["Check Planning<br>Documentation"]
PlanCheck --> TaskBreakdown["Verify Task<br>Breakdown"]
TaskBreakdown --> ScopeCheck["Validate Scope<br>Definition"]
ScopeCheck --> PLANConsistency{"PLAN Phase<br>Complete?"}
PLANConsistency -->|"Yes"| PassPLAN["โ
PLAN Phase<br>Validation Passed"]
PLANConsistency -->|"No"| FailPLAN["โ PLAN Phase<br>Issues Found"]
style PLAN fill:#4da6ff,stroke:#0066cc,color:white
style PLANConsistency fill:#f6546a,stroke:#c30052,color:white
style PassPLAN fill:#10b981,stroke:#059669,color:white
style FailPLAN fill:#ff5555,stroke:#dd3333,color:white
```
### CREATIVE Phase Validation
```mermaid
graph TD
CREATIVE["CREATIVE Phase<br>Validation"] --> DesignCheck["Check Design<br>Documents"]
DesignCheck --> ArchCheck["Verify Architectural<br>Decisions"]
ArchCheck --> PatternCheck["Validate Design<br>Patterns"]
PatternCheck --> CREATIVEConsistency{"CREATIVE Phase<br>Complete?"}
CREATIVEConsistency -->|"Yes"| PassCREATIVE["โ
CREATIVE Phase<br>Validation Passed"]
CREATIVEConsistency -->|"No"| FailCREATIVE["โ CREATIVE Phase<br>Issues Found"]
style CREATIVE fill:#4da6ff,stroke:#0066cc,color:white
style CREATIVEConsistency fill:#f6546a,stroke:#c30052,color:white
style PassCREATIVE fill:#10b981,stroke:#059669,color:white
style FailCREATIVE fill:#ff5555,stroke:#dd3333,color:white
```
### IMPLEMENT Phase Technical Validation
This retains the original QA validation from the previous version:
```mermaid
graph TD
IMPLEMENT["IMPLEMENT Phase<br>Validation"] --> ReadDesign["Read Design Decisions"]
ReadDesign --> FourChecks["Four-Point Technical<br>Validation"]
FourChecks --> DepCheck["1๏ธโฃ Dependency<br>Verification"]
DepCheck --> ConfigCheck["2๏ธโฃ Configuration<br>Validation"]
ConfigCheck --> EnvCheck["3๏ธโฃ Environment<br>Validation"]
EnvCheck --> MinBuildCheck["4๏ธโฃ Minimal Build<br>Test"]
MinBuildCheck --> IMPLEMENTConsistency{"Technical<br>Prerequisites Met?"}
IMPLEMENTConsistency -->|"Yes"| PassIMPLEMENT["โ
IMPLEMENT Phase<br>Validation Passed"]
IMPLEMENTConsistency -->|"No"| FailIMPLEMENT["โ IMPLEMENT Phase<br>Issues Found"]
style IMPLEMENT fill:#4da6ff,stroke:#0066cc,color:white
style FourChecks fill:#f6546a,stroke:#c30052,color:white
style IMPLEMENTConsistency fill:#f6546a,stroke:#c30052,color:white
style PassIMPLEMENT fill:#10b981,stroke:#059669,color:white
style FailIMPLEMENT fill:#ff5555,stroke:#dd3333,color:white
```
## ๐ UNIVERSAL VALIDATION COMMAND EXECUTION
### Memory Bank Verification Commands:
```bash
# Check Memory Bank file existence and recency
ls -la memory-bank/
find memory-bank/ -type f -mtime -7 | sort
# Check for consistency between files
grep -r "task" memory-bank/
grep -r "requirement" memory-bank/
```
### Task Tracking Verification Commands:
```bash
# Verify tasks.md as source of truth
test -f tasks.md && echo "โ
tasks.md exists" || echo "โ tasks.md missing"
# Check references to tasks in other files
grep -r "Task" --include="*.md" .
grep -r "task" --include="*.md" . | grep -v "tasks.md" | wc -l
# Verify task status consistency
grep -i "completed\|done\|finished" tasks.md
grep -i "in progress\|started" tasks.md
```
### Reference Validation Commands:
```bash
# Find cross-references between files
grep -r "see\|refer\|reference" --include="*.md" .
# Check for broken references
for file in $(grep -l "see\|refer\|reference" --include="*.md" .); do
for ref in $(grep -o '[a-zA-Z0-9_-]*\.md' $file); do
test -f $ref || echo "โ Broken reference: $ref in $file"
done
done
```
## ๐ 1๏ธโฃ DEPENDENCY VERIFICATION PROCESS (Original)
This validation point ensures all required packages are correctly installed.
### Command Execution:
```bash
# Check if packages are installed
npm list react react-dom tailwindcss postcss autoprefixer
# Verify package versions match requirements
npm list | grep -E "react|tailwind|postcss"
# Check for peer dependency warnings
npm ls --depth=0
```
### Validation Criteria:
- All required packages must be installed
- Versions must be compatible with requirements
- No critical peer dependency warnings
- Required dev dependencies must be present
### Common Fixes:
- `npm install [missing-package]` - Install missing packages
- `npm install [package]@[version]` - Fix version mismatches
- `npm install --save-dev [dev-dependency]` - Add development dependencies
## ๐ 2๏ธโฃ CONFIGURATION VALIDATION PROCESS (Original)
This validation point ensures configuration files are in the correct format for the project.
### Command Execution:
```bash
# Check package.json for module type
grep "\"type\":" package.json
# Verify configuration file extensions match module type
find . -name "*.config.*" | grep -E "\.(js|cjs|mjs)$"
# Test configuration syntax
node -c *.config.js || node -c *.config.cjs || node -c *.config.mjs
```
### Validation Criteria:
- Configuration file extensions must match module type in package.json
- File syntax must be valid
- Configuration must reference installed packages
### Common Fixes:
- Rename `.js` to `.cjs` for CommonJS in ES module projects
- Fix syntax errors in configuration files
- Adjust configuration to reference installed packages
## ๐ 3๏ธโฃ ENVIRONMENT VALIDATION PROCESS (Original)
This validation point ensures the development environment is correctly set up.
### Command Execution:
```bash
# Check build tools
npm run --help
# Verify node version compatibility
node -v
# Check for environment variables
printenv | grep -E "NODE_|PATH|HOME"
# Verify access permissions
ls -la .
```
### Validation Criteria:
- Node.js version must be compatible with requirements
- Build commands must be defined in package.json
- Environment must have necessary access permissions
- Required environment variables must be set
### Common Fixes:
- Update Node.js version
- Add missing scripts to package.json
- Fix file permissions with chmod/icacls
- Set required environment variables
## ๐ฅ 4๏ธโฃ MINIMAL BUILD TEST PROCESS (Original)
This validation point tests a minimal build to ensure basic functionality works.
### Command Execution:
```bash
# Run a minimal build
npm run build -- --dry-run || npm run dev -- --dry-run
# Test entry point file existence
find src -name "main.*" -o -name "index.*"
# Validate HTML entry point
grep -i "script.*src=" index.html
```
### Validation Criteria:
- Build process must complete without errors
- Entry point files must exist and be correctly referenced
- HTML must reference the correct JavaScript entry point
- Basic rendering must work in a test environment
### Common Fixes:
- Fix entry point references in HTML
- Correct import paths in JavaScript
- Fix build configuration errors
- Update incorrect paths or references
## ๐ ENHANCED COMPREHENSIVE QA REPORT FORMAT
```
โโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ ENHANCED QA VALIDATION REPORT โโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Project: [Project Name] Date: [Current Date] โ
โ Platform: [OS Platform] Detected Phase: [Current Phase] โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ UNIVERSAL VALIDATION RESULTS โโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ 1๏ธโฃ MEMORY BANK VERIFICATION โ
โ โ Core Files: [Status] โ
โ โ Content Consistency: [Status] โ
โ โ Last Modified: [Status] โ
โ โ
โ 2๏ธโฃ TASK TRACKING VERIFICATION โ
โ โ tasks.md Status: [Status] โ
โ โ Task References: [Status] โ
โ โ Status Consistency: [Status] โ
โ โ
โ 3๏ธโฃ REFERENCE VALIDATION โ
โ โ Cross-References: [Status] โ
โ โ Reference Accuracy: [Status] โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโ PHASE-SPECIFIC VALIDATION โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ [VAN/PLAN/CREATIVE/IMPLEMENT] PHASE VALIDATION โ
โ โ [Phase-specific check 1]: [Status] โ
โ โ [Phase-specific check 2]: [Status] โ
โ โ [Phase-specific check 3]: [Status] โ
โ โ
โ [Technical validation section shown only for IMPLEMENT phase] โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโ OVERALL STATUS โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โ
VALIDATION PASSED - Project quality verified for current phase โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
## ๐ซ ENHANCED FAILURE REPORT FORMAT
If validation fails, a detailed failure report is generated:
```
โโโโโโโโโโโโโโโโโโโโโโโโโโ โ ๏ธ QA VALIDATION FAILURES โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Project: [Project Name] Date: [Current Date] โ
โ Platform: [OS Platform] Detected Phase: [Current Phase] โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโ FAILED CHECKS โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โ MEMORY BANK ISSUES โ
โ โข [Specific issue details] โ
โ โข [Specific issue details] โ
โ โ
โ โ TASK TRACKING ISSUES โ
โ โข [Specific issue details] โ
โ โข [Specific issue details] โ
โ โ
โ โ REFERENCE ISSUES โ
โ โข [Specific issue details] โ
โ โข [Specific issue details] โ
โ โ
โ โ [PHASE]-SPECIFIC ISSUES โ
โ โข [Specific issue details] โ
โ โข [Specific issue details] โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโ REQUIRED FIXES โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ 1. [Specific fix instruction with command] โ
โ 2. [Specific fix instruction with command] โ
โ 3. [Specific fix instruction with command] โ
โ โ
โ โ ๏ธ VALIDATION FAILED - Please resolve issues before proceeding โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
## ๐ QA-ANYTIME ACTIVATION PROTOCOL
The enhanced QA mode can be activated at any time in the development process:
```mermaid
graph TD
Start["User Types: QA"] --> DetectContext["Detect Current Context"]
DetectContext --> RunQA["Run QA with Context-Aware Checks"]
RunQA --> GenerateReport["Generate Appropriate QA Report"]
GenerateReport --> UserResponse["Present Report to User"]
UserResponse --> FixNeeded{"Fixes<br>Needed?"}
FixNeeded -->|"Yes"| SuggestFixes["Display Fix Instructions"]
FixNeeded -->|"No"| ContinueWork["Continue Current Phase Work"]
style Start fill:#4da6ff,stroke:#0066cc,color:white
style FixNeeded fill:#f6546a,stroke:#c30052,color:white
style SuggestFixes fill:#ff5555,stroke:#dd3333,color:white
style ContinueWork fill:#10b981,stroke:#059669,color:white
```
This enhanced QA mode serves as a "quality guardian" throughout the development process, ensuring documentation is consistently maintained and all phase requirements are met before proceeding to the next phase.