--- description: Visual process map for BUILD mode (Code Implementation) globs: implementation-mode-map.mdc alwaysApply: false --- # BUILD MODE: CODE EXECUTION PROCESS MAP > **TL;DR:** This visual map guides the BUILD mode process, focusing on efficient code implementation based on the planning and creative phases, with proper command execution and progress tracking. ## 🧭 BUILD MODE PROCESS FLOW ```mermaid graph TD Start["START BUILD MODE"] --> ReadDocs["Read Reference Documents
Core/command-execution.md"] %% Initialization ReadDocs --> CheckLevel{"Determine
Complexity Level
from tasks.md"} %% Level 1 Implementation CheckLevel -->|"Level 1
Quick Bug Fix"| L1Process["LEVEL 1 PROCESS
Level1/quick-bug-workflow.md"] L1Process --> L1Review["Review Bug
Report"] L1Review --> L1Examine["Examine
Relevant Code"] L1Examine --> L1Fix["Implement
Targeted Fix"] L1Fix --> L1Test["Test
Fix"] L1Test --> L1Update["Update
tasks.md"] %% Level 2 Implementation CheckLevel -->|"Level 2
Simple Enhancement"| L2Process["LEVEL 2 PROCESS
Level2/enhancement-workflow.md"] L2Process --> L2Review["Review Build
Plan"] L2Review --> L2Examine["Examine Relevant
Code Areas"] L2Examine --> L2Implement["Implement Changes
Sequentially"] L2Implement --> L2Test["Test
Changes"] L2Test --> L2Update["Update
tasks.md"] %% Level 3-4 Implementation CheckLevel -->|"Level 3-4
Feature/System"| L34Process["LEVEL 3-4 PROCESS
Level3/feature-workflow.md
Level4/system-workflow.md"] L34Process --> L34Review["Review Plan &
Creative Decisions"] L34Review --> L34Phase{"Creative Phase
Documents
Complete?"} L34Phase -->|"No"| L34Error["ERROR:
Return to CREATIVE Mode"] L34Phase -->|"Yes"| L34DirSetup["Create Directory
Structure"] L34DirSetup --> L34VerifyDirs["VERIFY Directories
Created Successfully"] L34VerifyDirs --> L34Implementation["Build
Phase"] %% Implementation Phases L34Implementation --> L34Phase1["Phase 1
Build"] L34Phase1 --> L34VerifyFiles["VERIFY Files
Created Successfully"] L34VerifyFiles --> L34Test1["Test
Phase 1"] L34Test1 --> L34Document1["Document
Phase 1"] L34Document1 --> L34Next1{"Next
Phase?"} L34Next1 -->|"Yes"| L34Implementation L34Next1 -->|"No"| L34Integration["Integration
Testing"] L34Integration --> L34Document["Document
Integration Points"] L34Document --> L34Update["Update
tasks.md"] %% Command Execution L1Fix & L2Implement & L34Phase1 --> CommandExec["COMMAND EXECUTION
Core/command-execution.md"] CommandExec --> DocCommands["Document Commands
& Results"] %% Completion & Transition L1Update & L2Update & L34Update --> VerifyComplete["Verify Build
Complete"] VerifyComplete --> UpdateProgress["Update progress.md
with Status"] UpdateProgress --> Transition["NEXT MODE:
REFLECT MODE"] ``` ## 📋 REQUIRED FILE STATE VERIFICATION Before implementation can begin, verify file state: ```mermaid graph TD Start["File State
Verification"] --> CheckTasks{"tasks.md has
planning complete?"} CheckTasks -->|"No"| ErrorPlan["ERROR:
Return to PLAN Mode"] CheckTasks -->|"Yes"| CheckLevel{"Task
Complexity?"} CheckLevel -->|"Level 1"| L1Ready["Ready for
Implementation"] CheckLevel -->|"Level 2"| L2Ready["Ready for
Implementation"] CheckLevel -->|"Level 3-4"| CheckCreative{"Creative phases
required?"} CheckCreative -->|"No"| L34Ready["Ready for
Implementation"] CheckCreative -->|"Yes"| VerifyCreative{"Creative phases
completed?"} VerifyCreative -->|"No"| ErrorCreative["ERROR:
Return to CREATIVE Mode"] VerifyCreative -->|"Yes"| L34Ready ``` ## 🔄 FILE SYSTEM VERIFICATION PROCESS ```mermaid graph TD Start["Start File
Verification"] --> CheckDir["Check Directory
Structure"] CheckDir --> DirResult{"Directories
Exist?"} DirResult -->|"No"| ErrorDir["❌ ERROR:
Missing Directories"] DirResult -->|"Yes"| CheckFiles["Check Each
Created File"] ErrorDir --> FixDir["Fix Directory
Structure"] FixDir --> CheckDir CheckFiles --> FileResult{"All Files
Exist?"} FileResult -->|"No"| ErrorFile["❌ ERROR:
Missing/Wrong Path Files"] FileResult -->|"Yes"| Complete["✅ Verification
Complete"] ErrorFile --> FixFile["Fix File Paths
or Recreate Files"] FixFile --> CheckFiles ``` ## 📋 DIRECTORY VERIFICATION STEPS Before beginning any file creation: ``` ✓ DIRECTORY VERIFICATION PROCEDURE 1. Create all directories first before any files 2. Use ABSOLUTE paths: /full/path/to/directory 3. Verify each directory after creation: ls -la /full/path/to/directory # Linux/Mac dir "C:\full\path\to\directory" # Windows 4. Document directory structure in progress.md 5. Only proceed to file creation AFTER verifying ALL directories exist ``` ## 📋 FILE CREATION VERIFICATION After creating files: ``` ✓ FILE VERIFICATION PROCEDURE 1. Use ABSOLUTE paths for all file operations: /full/path/to/file.ext 2. Verify each file creation was successful: ls -la /full/path/to/file.ext # Linux/Mac dir "C:\full\path\to\file.ext" # Windows 3. If verification fails: a. Check for path resolution issues b. Verify directory exists c. Try creating with corrected path d. Recheck file exists after correction 4. Document all file paths in progress.md ``` ## 🔄 COMMAND EXECUTION WORKFLOW ```mermaid graph TD Start["Command
Execution"] --> Analyze["Analyze Command
Requirements"] Analyze --> Complexity{"Command
Complexity?"} Complexity -->|"Simple"| Simple["Execute
Single Command"] Complexity -->|"Moderate"| Chain["Use Efficient
Command Chaining"] Complexity -->|"Complex"| Break["Break Into
Logical Steps"] Simple & Chain & Break --> Verify["Verify
Results"] Verify --> Document["Document
Command & Result"] Document --> Next["Next
Command"] ``` ## 📋 LEVEL-SPECIFIC BUILD APPROACHES ```mermaid graph TD subgraph "Level 1: Quick Bug Fix" L1A["Targeted Code
Examination"] L1B["Minimal
Change Scope"] L1C["Direct
Fix"] L1D["Verify
Fix"] end subgraph "Level 2: Enhancement" L2A["Sequential
Build"] L2B["Contained
Changes"] L2C["Standard
Testing"] L2D["Component
Documentation"] end subgraph "Level 3-4: Feature/System" L3A["Directory
Structure First"] L3B["Verify Dirs
Before Files"] L3C["Phased
Build"] L3D["Verify Files
After Creation"] L3E["Integration
Testing"] L3F["Detailed
Documentation"] end L1A --> L1B --> L1C --> L1D L2A --> L2B --> L2C --> L2D L3A --> L3B --> L3C --> L3D --> L3E --> L3F ``` ## 📝 BUILD DOCUMENTATION FORMAT Document builds with: ``` ## Build: [Component/Feature] ### Approach [Brief description of build approach] ### Directory Structure - [/absolute/path/to/dir1/]: [Purpose] - [/absolute/path/to/dir2/]: [Purpose] ### Code Changes - [/absolute/path/to/file1.ext]: [Description of changes] - [/absolute/path/to/file2.ext]: [Description of changes] ### Verification Steps - [✓] Directory structure created and verified - [✓] All files created in correct locations - [✓] File content verified ### Commands Executed ``` [Command 1] [Result] ``` ``` [Command 2] [Result] ``` ### Testing - [Test 1]: [Result] - [Test 2]: [Result] ### Status - [x] Build complete - [x] Testing performed - [x] File verification completed - [ ] Documentation updated ``` ## 📊 TASKS.MD UPDATE FORMAT During the build process, update tasks.md with progress: ``` ## Status - [x] Initialization complete - [x] Planning complete [For Level 3-4:] - [x] Creative phases complete - [x] Directory structure created and verified - [x] [Built component 1] - [x] [Built component 2] - [ ] [Remaining component] ## Build Progress - [Component 1]: Complete - Files: [/absolute/path/to/files] - [Details about implementation] - [Component 2]: Complete - Files: [/absolute/path/to/files] - [Details about implementation] - [Component 3]: In Progress - [Current status] ``` ## 📋 PROGRESS.MD UPDATE FORMAT Update progress.md with: ``` # Build Progress ## Directory Structure - [/absolute/path/to/dir1/]: Created and verified - [/absolute/path/to/dir2/]: Created and verified ## [Date]: [Component/Feature] Built - **Files Created**: - [/absolute/path/to/file1.ext]: Verified - [/absolute/path/to/file2.ext]: Verified - **Key Changes**: - [Change 1] - [Change 2] - **Testing**: [Test results] - **Next Steps**: [What comes next] ``` ## 📊 BUILD VERIFICATION CHECKLIST ``` ✓ BUILD VERIFICATION - Directory structure created correctly? [YES/NO] - All files created in correct locations? [YES/NO] - All file paths verified with absolute paths? [YES/NO] - All planned changes implemented? [YES/NO] - Testing performed for all changes? [YES/NO] - Code follows project standards? [YES/NO] - Edge cases handled appropriately? [YES/NO] - Build documented with absolute paths? [YES/NO] - tasks.md updated with progress? [YES/NO] - progress.md updated with details? [YES/NO] → If all YES: Build complete - ready for REFLECT mode → If any NO: Complete missing build elements ``` ## 🔄 MODE TRANSITION NOTIFICATION When the build is complete, notify user with: ``` ## BUILD COMPLETE ✅ Directory structure verified ✅ All files created in correct locations ✅ All planned changes implemented ✅ Testing performed successfully ✅ tasks.md updated with status ✅ progress.md updated with details → NEXT RECOMMENDED MODE: REFLECT MODE ```