--- 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
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 -->|"BUILD"| BUILDChecks["BUILD Phase Validation"] %% Universal checks that apply to all phases DetectPhase --> UniversalChecks["🔍 UNIVERSAL VALIDATION"] UniversalChecks --> MemoryBankCheck["1️⃣ MEMORY BANK VERIFICATION
Check consistency & updates"] MemoryBankCheck --> TaskTrackingCheck["2️⃣ TASK TRACKING VERIFICATION
Validate tasks.md as source of truth"] TaskTrackingCheck --> ReferenceCheck["3️⃣ REFERENCE VALIDATION
Verify cross-references between docs"] %% Phase-specific validations feed into comprehensive report VANChecks & PLANChecks & CREATIVEChecks & BUILDChecks --> PhaseSpecificResults["Phase-Specific Results"] ReferenceCheck & PhaseSpecificResults --> ValidationResults{"✅ All Checks
Passed?"} %% Results Processing ValidationResults -->|"Yes"| SuccessReport["📝 GENERATE SUCCESS REPORT
All validations passed"] ValidationResults -->|"No"| FailureReport["⚠️ GENERATE FAILURE REPORT
With specific fix instructions"] %% Success Path SuccessReport --> UpdateMB["📚 Update Memory Bank
Record successful validation"] UpdateMB --> ContinueProcess["🚦 CONTINUE: Phase processes
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
for current phase"] CheckActive --> CheckProgress["Check progress.md
for recent activities"] CheckProgress --> CheckTasks["Check tasks.md
for task status"] CheckTasks --> PhaseResult{"Determine
Current Phase"} PhaseResult -->|"VAN"| VAN["VAN Phase
Initialization"] PhaseResult -->|"PLAN"| PLAN["PLAN Phase
Task Planning"] PhaseResult -->|"CREATIVE"| CREATIVE["CREATIVE Phase
Design Decisions"] PhaseResult -->|"BUILD"| BUILD["BUILD Phase
Implementation"] VAN & PLAN & CREATIVE & BUILD --> LoadChecks["Load Phase-Specific
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
Verification"] --> CoreCheck["Check Core Files Exist"] CoreCheck --> CoreFiles["Verify Required Files:
projectbrief.md
activeContext.md
tasks.md
progress.md"] CoreFiles --> ContentCheck["Verify Content
Consistency"] ContentCheck --> LastModified["Check Last Modified
Timestamps"] LastModified --> CrossRef["Validate Cross-
References"] CrossRef --> ConsistencyCheck{"All Files
Consistent?"} ConsistencyCheck -->|"Yes"| PassMB["✅ Memory Bank
Verification Passed"] ConsistencyCheck -->|"No"| FailMB["❌ Memory Bank
Inconsistencies Found"] FailMB --> FixSuggestions["Generate Fix
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
Verification"] --> CheckTasksFile["Check tasks.md
Existence & Format"] CheckTasksFile --> VerifyReferences["Verify Task References
in Other Documents"] VerifyReferences --> ProgressCheck["Check Consistency with
progress.md"] ProgressCheck --> StatusCheck["Verify Task Status
Accuracy"] StatusCheck --> TaskConsistency{"Tasks Properly
Tracked?"} TaskConsistency -->|"Yes"| PassTasks["✅ Task Tracking
Verification Passed"] TaskConsistency -->|"No"| FailTasks["❌ Task Tracking
Issues Found"] FailTasks --> TaskFixSuggestions["Generate Task Tracking
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
Validation"] --> FindRefs["Find Cross-References
in Documents"] FindRefs --> VerifyRefs["Verify Reference
Accuracy"] VerifyRefs --> CheckBackRefs["Check Bidirectional
References"] CheckBackRefs --> RefConsistency{"References
Consistent?"} RefConsistency -->|"Yes"| PassRefs["✅ Reference Validation
Passed"] RefConsistency -->|"No"| FailRefs["❌ Reference
Issues Found"] FailRefs --> RefFixSuggestions["Generate Reference
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
Validation"] --> InitCheck["Check Initialization
Completeness"] InitCheck --> PlatformCheck["Verify Platform
Detection"] PlatformCheck --> ComplexityCheck["Validate Complexity
Determination"] ComplexityCheck --> VANConsistency{"VAN Phase
Complete?"} VANConsistency -->|"Yes"| PassVAN["✅ VAN Phase
Validation Passed"] VANConsistency -->|"No"| FailVAN["❌ VAN Phase
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
Validation"] --> PlanCheck["Check Planning
Documentation"] PlanCheck --> TaskBreakdown["Verify Task
Breakdown"] TaskBreakdown --> ScopeCheck["Validate Scope
Definition"] ScopeCheck --> PLANConsistency{"PLAN Phase
Complete?"} PLANConsistency -->|"Yes"| PassPLAN["✅ PLAN Phase
Validation Passed"] PLANConsistency -->|"No"| FailPLAN["❌ PLAN Phase
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
Validation"] --> DesignCheck["Check Design
Documents"] DesignCheck --> ArchCheck["Verify Architectural
Decisions"] ArchCheck --> PatternCheck["Validate Design
Patterns"] PatternCheck --> CREATIVEConsistency{"CREATIVE Phase
Complete?"} CREATIVEConsistency -->|"Yes"| PassCREATIVE["✅ CREATIVE Phase
Validation Passed"] CREATIVEConsistency -->|"No"| FailCREATIVE["❌ CREATIVE Phase
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 ``` ### BUILD Phase Technical Validation This retains the original QA validation from the previous version: ```mermaid graph TD BUILD["BUILD Phase
Validation"] --> ReadDesign["Read Design Decisions"] ReadDesign --> FourChecks["Four-Point Technical
Validation"] FourChecks --> DepCheck["1️⃣ Dependency
Verification"] DepCheck --> ConfigCheck["2️⃣ Configuration
Validation"] ConfigCheck --> EnvCheck["3️⃣ Environment
Validation"] EnvCheck --> MinBuildCheck["4️⃣ Minimal Build
Test"] MinBuildCheck --> BUILDConsistency{"Technical
Prerequisites Met?"} BUILDConsistency -->|"Yes"| PassBUILD["✅ BUILD Phase
Validation Passed"] BUILDConsistency -->|"No"| FailBUILD["❌ BUILD Phase
Issues Found"] style BUILD fill:#4da6ff,stroke:#0066cc,color:white style FourChecks fill:#f6546a,stroke:#c30052,color:white style BUILDConsistency fill:#f6546a,stroke:#c30052,color:white style PassBUILD fill:#10b981,stroke:#059669,color:white style FailBUILD 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/BUILD] PHASE VALIDATION │ │ ✓ [Phase-specific check 1]: [Status] │ │ ✓ [Phase-specific check 2]: [Status] │ │ ✓ [Phase-specific check 3]: [Status] │ │ │ │ [Technical validation section shown only for BUILD 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
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.