/ .claude / commands / feature-complete.md
feature-complete.md
  1  ---
  2  allowed-tools: Bash(git:*), Bash(gh:*), Read, TodoWrite, Bash(npm:*)
  3  description: Complete feature development with mandatory user testing, validation, and epic integration
  4  ---
  5  
  6  # Feature Complete Workflow
  7  
  8  ## Usage
  9  Execute: `/feature-complete` (automatically detects current feature from branch or context)
 10  Optional: `/feature-complete #287` or `/feature-complete additional context or instructions`
 11  
 12  ## CRITICAL USER TESTING PHASE
 13  
 14  **⚠️ MANDATORY BEFORE ANY COMMITS ⚠️**
 15  
 16  ### Phase 1: Intelligent Feature Detection & Pre-Testing Validation
 17  
 18  #### Feature Detection
 19  - **Current branch**: Run `git branch --show-current`
 20  - **Extract feature number**: Parse feature number from branch name (e.g., feature/287-something → #287)
 21  - **Process user context**: Handle any additional context provided after command
 22  - **Git status**: Run `git status --short`
 23  - **Feature issue**: Run `gh issue view DETECTED_FEATURE_NUMBER` (from branch name or user context)
 24  
 25  #### Implementation Completeness Check
 26  - [ ] All TodoWrite tasks marked complete
 27  - [ ] All acceptance criteria addressed in code
 28  - [ ] Unit tests written and passing
 29  - [ ] No obvious bugs or incomplete functionality
 30  
 31  ### Phase 2: Quality Assurance
 32  
 33  #### Code Quality Validation
 34  - **Run all checks**: Run `npm run check-all`
 35  - **Verify zero warnings**: Ensure clean lint, tests, and type checking
 36  - **Fix any issues**: Address all errors before proceeding
 37  
 38  #### Development Environment Check
 39  - **Obsidian ready**: Confirm development vault accessible for testing
 40  
 41  ### Phase 3: Stop for User Testing
 42  
 43  #### **MANDATORY USER TESTING REQUEST**
 44  
 45  **STOP IMPLEMENTATION** - Never proceed without user feedback
 46  
 47  Present to user:
 48  ```
 49  The feature implementation is complete and ready for testing.
 50  
 51  **Please test the following functionality:**
 52  [List specific features to test based on acceptance criteria]
 53  
 54  **Key interactions to verify:**
 55  [Mention any special interactions or edge cases]
 56  
 57  **Please check for:**
 58  - Feature works as expected
 59  - No console errors or broken functionality
 60  - User experience feels smooth and intuitive
 61  - Any unexpected behavior or issues
 62  
 63  Please provide feedback on anything that needs adjustment.
 64  ```
 65  
 66  #### Wait for User Feedback
 67  - **DO NOT PROCEED** until user provides testing feedback
 68  - **Document any issues** found during user testing
 69  - **Iterate implementation** based on feedback if needed
 70  
 71  #### Re-test Cycle (if needed)
 72  - **Fix reported issues** based on user feedback
 73  - **Re-run quality checks**: Run `npm run check-all`
 74  - **Request re-testing**: Ask user to verify fixes
 75  - **Repeat until user confirms** feature works correctly
 76  
 77  ## Phase 4: Feature Integration
 78  
 79  **Only proceed here AFTER user confirms feature works correctly**
 80  
 81  ### Git Operations
 82  
 83  #### Commit Feature Work
 84  - **Stage all changes**: Run `git add -A`
 85  - **Commit with summary**: Run `git commit -m "$(cat <<'EOF'
 86  Feature #DETECTED_FEATURE_NUMBER: [FEATURE_TITLE]
 87  
 88  [Brief summary of implementation]
 89  - [Key changes made]
 90  - [User testing completed successfully]
 91  
 92  🤖 Generated with [Claude Code](https://claude.ai/code)
 93  
 94  Co-Authored-By: Claude <noreply@anthropic.com>
 95  EOF
 96  )"`
 97  
 98  #### Epic Branch Integration
 99  
100  **⚠️ CRITICAL: LOCAL-ONLY WORKFLOW ⚠️**
101  - **Epic and feature branches are NEVER pushed to remote**
102  - **ONLY main branch gets pushed to remote (during epic completion)**
103  
104  - **Switch to epic branch**: Run `git checkout epic/EPIC_NUMBER-epic-name`
105  - **Merge feature**: Run `git merge feature/FEATURE_NAME-from-issue --no-ff`
106  - **NO PUSH**: Epic branch stays local until epic completion (merges to main)
107  
108  ### GitHub Issue Management
109  
110  #### Update Issue Body
111  Mark all acceptance criteria as complete:
112  ```markdown
113  ## Acceptance Criteria
114  - [x] [Completed criterion 1]
115  - [x] [Completed criterion 2]
116  - [x] [Completed criterion 3]
117  
118  ## Implementation Summary
119  [Brief summary of what was built]
120  
121  ## User Testing Results
122  ✅ User testing completed successfully
123  ✅ All functionality verified working
124  ✅ No outstanding issues identified
125  
126  ## Technical Notes
127  [Any important implementation details]
128  ```
129  
130  #### Close Feature Issue
131  - **Update issue**: Run `gh issue edit DETECTED_FEATURE_NUMBER --body "COMPLETED_ISSUE_BODY"`
132  - **Close with summary**: Run `gh issue close DETECTED_FEATURE_NUMBER --comment "Feature implementation complete. User testing passed. Merged to epic branch."` (using detected feature number)
133  
134  ### Project Board Management
135  - **Move to Complete**: Reference @CLAUDE.md (lines 680-727) for GraphQL project board updates
136  - **Update epic progress**: Note feature completion in epic tracking
137  
138  ## Phase 5: Cleanup & Next Steps
139  
140  ### Branch Cleanup
141  - **Delete local feature branch**: Run `git branch -d feature/FEATURE_NAME-from-issue`
142  - **NO remote cleanup needed**: Feature branches never pushed to remote
143  
144  ### TodoWrite Cleanup
145  - **Mark all feature todos complete**: Update any remaining TodoWrite tasks
146  - **Clear completed tasks**: Clean up task list for next feature
147  
148  ### Epic Progress Assessment
149  - **Check epic status**: Review remaining features in current epic
150  - **Identify next feature**: Prepare for next development cycle
151  - **Epic completion check**: Assess if epic is ready for completion
152  
153  ## Feature Completion Checklist
154  
155  - [ ] **Implementation Complete**: All acceptance criteria met
156  - [ ] **Quality Validated**: `npm run check-all` passes with zero warnings
157  - [ ] **User Testing Completed**: User confirmed feature works correctly
158  - [ ] **Issues Addressed**: All user feedback incorporated
159  - [ ] **Code Committed**: Proper commit message with testing confirmation
160  - [ ] **Epic Integration**: Feature merged to epic branch
161  - [ ] **GitHub Updated**: Issue body updated with completion status
162  - [ ] **Issue Closed**: Closed with completion summary
163  - [ ] **Project Board**: Moved to Complete status
164  - [ ] **Cleanup Done**: Feature branch deleted
165  - [ ] **TodoWrite Clean**: Task list updated
166  
167  ## Next Steps Options
168  
169  ### Continue Epic Development
170  If more features remain in epic:
171  1. **Use `/feature-start`** for next feature
172  2. **Follow epic roadmap** for feature prioritization
173  3. **Maintain epic branch hygiene**
174  
175  ### Complete Epic
176  If all epic features done:
177  1. **Use `/epic-complete`** for epic finalization
178  2. **Prepare for main branch merge**
179  3. **Plan next epic development**
180  
181  ## Reference Materials
182  
183  - **Testing Protocols**: @CLAUDE.md (lines 784-790)
184  - **Git Commit Philosophy**: User memory for commit patterns
185  - **GitHub CLI Commands**: @CLAUDE.md (lines 610-767)
186  - **Quality Standards**: @CLAUDE.md (lines 484-496)
187  - **Epic Integration**: @CLAUDE.md (lines 470-483)
188  
189  ## Critical Success Factors
190  
191  **✅ User Testing is Non-Negotiable**
192  - Never commit without user validation
193  - User feedback drives iteration cycles
194  - Feature is not complete until user confirms
195  
196  **✅ Quality Before Integration**
197  - All checks must pass before merge
198  - Zero warnings policy maintained
199  - Clean git history preserved
200  
201  **✅ Proper Epic Integration**
202  - Feature branch merged to epic branch
203  - Epic branch maintains clean state
204  - All GitHub tracking updated correctly
205  
206  This command ensures systematic feature completion following the **User Testing Protocol** from project memory.