# [Feature/Task Name] **Created**: [YYYY-MM-DD] **Total Steps**: [N] **Estimated Time**: [Duration] **Autonomous Mode**: [ENABLED / DISABLED] --- ## Workflow Overview **Goal**: [One sentence description] **Success Criteria**: - [Criterion 1] - [Criterion 2] - [Criterion 3] **Dependencies**: - [External dependency 1] - [External dependency 2] --- ## Step 1: [Descriptive Name] ### 🔴 PRE-FLIGHT **Status**: 🟢 CLEAR | 🟡 GAPS | 🔴 BLOCKED #### Context Inventory **Requirements Clarity**: - [ ] Task clearly defined - [ ] Success criteria explicit and measurable - [ ] Edge cases identified **Files Needed**: | File | Status | Notes | |------|--------|-------| | path/to/file1.ts | ✅ Have / ❌ Need / ⚠️ Partial | [Notes] | | path/to/file2.tsx | ✅ Have / ❌ Need / ⚠️ Partial | [Notes] | **Dependencies**: - [ ] All imported modules available - [ ] External APIs documented - [ ] Environment variables defined **Domain Knowledge**: - [ ] Existing patterns understood - [ ] Coding conventions known - [ ] Similar implementations reviewed **If GAPS or BLOCKED**: **Missing Context**: 1. [What's missing] 2. [What's missing] **Action Required**: - [ ] Request file: [filename] - [ ] Clarify requirement: [question] - [ ] Need documentation for: [topic] **Do NOT proceed to IMPLEMENT until status is 🟢 CLEAR** --- ### 🔴 IMPLEMENT **Pre-flight**: 🟢 CLEAR (verified above) **Task**: - [ ] Action item 1 - [ ] Action item 2 - [ ] Action item 3 **Files to Modify**: - path/to/file1.ts - path/to/file2.tsx **Expected Outcome**: [What should be true after implementation] **Complexity**: 🟢 Simple | 🟡 Moderate | 🔴 Complex **Estimated Time**: [N minutes] **Success Criteria**: - [ ] Criterion 1 (measurable) - [ ] Criterion 2 (measurable) - [ ] Criterion 3 (measurable) **AI Assistance Disclosure**: [Yes/No - was AI used to generate this code?] --- ### 🟢 VALIDATE #### Automated Checks | Check | Command | Result | Proves | |-------|---------|--------|--------| | Tests | `npm test` | ✅ / ❌ | Unit logic correct | | Build | `npm run build` | ✅ / ❌ | No compile errors | | Types | `npm run typecheck` | ✅ / ❌ | Type safety | | Lint | `npm run lint` | ✅ / ❌ | Code style | #### Code Quality - [ ] No console.log statements in production code - [ ] No @ts-expect-error directives added - [ ] No hardcoded credentials - [ ] Functions under 20 lines - [ ] Files under 200 lines #### Manual Verification | Scenario | Action | Expected | Actual | Status | |----------|--------|----------|--------|--------| | [Primary flow] | [Action] | [Expected] | [Actual] | ✅ / ❌ | | [Error flow] | [Action] | [Expected] | [Actual] | ✅ / ❌ | | [Edge case] | [Action] | [Expected] | [Actual] | ✅ / ❌ | #### Security (if applicable) - [ ] No exposed API keys - [ ] Input validation present - [ ] Authentication enforced - [ ] Authorization checked #### Validation Reasoning (REQUIRED) **Confidence**: HIGH | MEDIUM | LOW **Why This Validation Proves Correctness**: 1. [First reason - connects test to requirement] 2. [Second reason - explains coverage] 3. [Third reason - addresses edge cases] **Alternatives Checked**: - [x] Checked: [Alternative approach or scenario] - [x] Ruled out: [What was considered but rejected, and why] **Weaknesses Acknowledged**: - [ ] This validation does NOT verify: [Gap 1] - [ ] This validation does NOT verify: [Gap 2] - [ ] Assumption made: [What we're assuming is true] **Defense in Depth** (if confidence < HIGH): - Primary validation: [Main approach] - Secondary validation: [Backup approach] - Tertiary validation: [Additional check] #### COI Disclosure (if AI-generated code) **Code generated by**: [AI assistant name/model] **Validation performed by**: [AI assistant name/model] **Same model family**: Yes/No **Potential blind spots**: - AI may validate assumptions it made during generation - Test cases may miss scenarios AI didn't consider **Mitigation**: [Human review recommended for critical code] --- ### 🔵 CHECKPOINT: [Checkpoint Name] #### Status **Status**: 🔵 COMPLETE | 🟡 IN_PROGRESS | 🔴 BLOCKED **Confidence**: HIGH | MEDIUM | LOW **Validated**: [YYYY-MM-DDTHH:MM:SSZ] #### Metrics | Metric | Value | |--------|-------| | Complexity | 🟢 Simple / 🟡 Moderate / 🔴 Complex | | Estimated | [N] minutes | | Actual | [N] minutes | | Variance | [+/- N] minutes | | Tests | [X/Y] passing | | Coverage | [X]% (if tracked) | #### Validation Summary **What was proven**: - [Key validation 1] - [Key validation 2] **What was NOT proven** (acknowledged gaps): - [Gap 1] - [Gap 2] #### Rollback Procedure ```bash # Git rollback git revert [commit-hash] # OR file restore cp backup/[file].backup path/to/[file] # Verify rollback npm test && npm run build ``` **Backup Location**: `backup/step-1-[date].tar.gz` #### Validity Conditions **This checkpoint remains valid UNTIL**: - [ ] Dependencies change: [list which ones] - [ ] Related code modified: [list files] - [ ] [X] days elapsed: [specify timeframe] - [ ] External API changes (if applicable) **Re-validation required if**: - [ ] [Specific trigger 1] - [ ] [Specific trigger 2] #### Dependencies - **Depends on**: [Previous checkpoints] - **Blocks**: [Subsequent checkpoints] #### Lessons Learned - [Insight 1] - [Insight 2] --- ## Step 2: [Descriptive Name] ### 🔴 PRE-FLIGHT **Status**: 🟢 CLEAR | 🟡 GAPS | 🔴 BLOCKED [Same structure as Step 1...] --- ### 🔴 IMPLEMENT **Pre-flight**: 🟢 CLEAR (verified above) **Task**: - [ ] Action item 1 - [ ] Action item 2 **Files to Modify**: - path/to/file.ts **Dependencies**: - ✅ Step 1 COMPLETE [Continue with same structure...] --- ### 🟢 VALIDATE [Same structure as Step 1...] --- ### 🔵 CHECKPOINT: [Checkpoint Name] **Status**: 🟡 IN_PROGRESS **Confidence**: [TBD] **Dependencies**: - ✅ Step 1 (COMPLETE) [Continue with same structure...] --- ## Step 3: [Continue pattern...] --- ## Final Integration Checkpoint ### 🔵 CHECKPOINT: [Overall Workflow Name] Complete #### All Steps Status - ✅ Step 1: [Name] (COMPLETE) - Confidence: [HIGH/MEDIUM/LOW] - ✅ Step 2: [Name] (COMPLETE) - Confidence: [HIGH/MEDIUM/LOW] - ✅ Step 3: [Name] (COMPLETE) - Confidence: [HIGH/MEDIUM/LOW] #### End-to-End Test | Scenario | Action | Expected | Actual | Status | |----------|--------|----------|--------|--------| | [Complete user flow] | [Action] | [Expected] | [Actual] | ✅ / ❌ | **Verified**: [YYYY-MM-DD HH:MM] #### Overall Confidence Assessment **Combined Confidence**: HIGH | MEDIUM | LOW **Reasoning**: - [Why this overall confidence level] - [What the combined validation proves] **Remaining Gaps**: - [Any acknowledged gaps across all steps] #### Performance - [Metric 1]: [Result] ✅ - [Metric 2]: [Result] ✅ #### Security - Vulnerabilities: 0 ✅ - API keys secure: ✅ - Auth enforced: ✅ #### Rollback (if needed) ```bash # Multi-step rollback (reverse order) git revert [step-3-hash] git revert [step-2-hash] git revert [step-1-hash] # OR restore from full backup tar -xzf backup/pre-workflow-[date].tar.gz ``` #### Validity Conditions (Overall) **This workflow remains valid UNTIL**: - [ ] [Major dependency change] - [ ] [X] days elapsed - [ ] [External factor] **Re-validation triggers**: - [ ] [Trigger 1] - [ ] [Trigger 2] **Total Duration**: [Actual time taken] **Success**: ✅ All checkpoints passed --- ## Workflow State (JSON) ```json { "workflow": { "name": "[Task Name]", "version": "2.1", "started": "[ISO timestamp]", "completed": "[ISO timestamp]", "status": "COMPLETE", "overall_confidence": "HIGH|MEDIUM|LOW", "total_steps": 3, "completion_percentage": 100 }, "checkpoints": [ { "step": 1, "name": "[Step 1 Name]", "status": "COMPLETE", "confidence": "HIGH|MEDIUM|LOW", "preflight_status": "CLEAR", "validated": "[timestamp]", "validation_reasoning": "[Summary]", "weaknesses_acknowledged": ["[Gap 1]", "[Gap 2]"], "coi_disclosed": true, "rollback": "[command]", "validity_until": "[condition or date]" }, { "step": 2, "name": "[Step 2 Name]", "status": "COMPLETE", "confidence": "HIGH|MEDIUM|LOW", "preflight_status": "CLEAR", "validated": "[timestamp]", "rollback": "[command]" }, { "step": 3, "name": "[Step 3 Name]", "status": "COMPLETE", "confidence": "HIGH|MEDIUM|LOW", "preflight_status": "CLEAR", "validated": "[timestamp]", "rollback": "[command]" } ] } ``` --- ## Notes & Lessons Learned **What Went Well**: - [Observation 1] - [Observation 2] **Challenges**: - [Challenge 1]: Resolved by [solution] - [Challenge 2]: Blocked at [point], resolved with [action] **Pre-flight Value**: - [Did pre-flight catch any missing context?] - [What would have been missed without it?] **Confidence Accuracy**: - Step 1: Predicted [X], Actual [Y] - Step 2: Predicted [X], Actual [Y] **Future Improvements**: - [Improvement 1] - [Improvement 2] **Time Accuracy**: - Estimated: [N minutes] - Actual: [N minutes] - Variance: [+/- X%] --- **Template Version**: 2.1 **Matches Workflow Version**: JIMMYS-WORKFLOW.md v2.1 **See Full Documentation**: JIMMYS-WORKFLOW.md