# Best Practices - GitHub Issue Workflow Comprehensive best practices for the GitHub Issue Resolution Workflow. ## Core Principles ### 1. Always Confirm Understanding **Why:** Prevents misunderstandings and wasted effort. **How:** - Present issue summary to user before implementing - Use **AskUserQuestion** for explicit confirmation - Repeat requirements in your own words - Verify assumptions before proceeding **Example:** ``` ❌ Bad: Reads issue, starts implementing immediately ✅ Good: "I understand you want to add email validation. Is that correct?" ``` --- ### 2. Ask Early, Ask Specific **Why:** Identifying ambiguities early prevents rework. **How:** - Identify gaps in Phase 2 (requirements analysis) - Ask specific, concrete questions - Present options when possible (multiple choice) - Wait for answers before proceeding **Example:** ``` ❌ Bad: "What do you want?" (too vague) ✅ Good: "Should validation be on client-side, server-side, or both?" ``` --- ### 3. Keep Changes Focused **Why:** Smaller, focused changes are easier to review and test. **How:** - Only modify what's necessary to resolve the issue - Don't add "nice to have" features not in requirements - Separate concerns into multiple commits/PRs if needed - Resist the urge to refactor unrelated code **Example:** ``` ❌ Bad: Fix bug + refactor 10 other files + add new feature ✅ Good: Fix bug only, create separate issues for other work ``` --- ### 4. Follow Branch Naming Convention **Why:** Consistent naming makes navigation and automation easier. **Convention:** - Features: `feature/-` - Bug fixes: `fix/-` - Refactors: `refactor/-` **Examples:** - ✅ `feature/42-add-email-validation` - ✅ `fix/15-login-timeout` - ❌ `my-branch` (no issue ID or type) - ❌ `feature-42` (missing description) --- ### 5. Reference the Issue **Why:** Maintains traceability between work and requirements. **How:** - Every commit must reference the issue number - Every PR must close the issue with "Closes #N" - Use issue number in branch names - Link PR to issue in description **Example:** ``` Commit message: "feat(auth): add JWT support Closes #42" PR description: "## Related Issue Closes #42" ``` --- ### 6. Run Existing Tests **Why:** Catches regressions early. **How:** - Never skip verification - Run full test suite, not just related tests - Fix all test failures before proceeding - Add new tests for new functionality **Example:** ``` ❌ Bad: "Tests probably pass, let's skip to save time" ✅ Good: Run full test suite, fix any failures, then proceed ``` --- ### 7. Review Before Committing **Why:** Code review prevents shipping bugs. **How:** - Launch code review sub-agent in Phase 6 - Address critical and major issues - Present minor issues to user for decision - Re-run tests after fixes **Example:** ``` Phase 6 Checklist: - [ ] Code review sub-agent launched - [ ] Critical issues fixed - [ ] Major issues fixed - [ ] Minor issues reviewed with user - [ ] Tests re-run after fixes ``` --- ### 8. Use Conventional Commits **Why:** Consistent commit history aids navigation and automation. **Format:** ``` ():