assets/skills/hotfix/SKILL.md
Quick bug fix workflow with rollback plan. Use when fixing bugs, hotfixes, urgent issues, production bugs, or when user says "fix bug", "hotfix", "urgent fix", "production issue".
npx skillsauth add phuthuycoding/moicle hotfixInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fast-track workflow for fixing bugs with safety rollback plan.
Before fixing, you MUST read the appropriate architecture reference:
~/.claude/architecture/
├── clean-architecture.md # Core principles for all projects
├── flutter-mobile.md # Flutter + Riverpod
├── react-frontend.md # React + Vite + TypeScript
├── go-backend.md # Go + Gin
├── laravel-backend.md # Laravel + PHP
├── remix-fullstack.md # Remix fullstack
└── monorepo.md # Monorepo structure
.claude/architecture/ # Project overrides
Understand the codebase structure before making changes.
| Phase | Agent | Purpose |
|-------|-------|---------|
| FIX | @react-frontend-dev, @go-backend-dev, @laravel-backend-dev, @flutter-mobile-dev, @remix-fullstack-dev | Stack-specific bug fix |
| FIX | @security-audit | Security-related bugs |
| VERIFY | @test-writer | Regression test |
| VERIFY | @code-reviewer | Quick code review |
| DEPLOY | @devops | CI/CD & deployment |
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│1. IDENTIFY──▶│2. REPRODUCE──▶│ 3. FIX │──▶│4. VERIFY │──▶│5. DEPLOY │
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
│ │
│ Fail? │
│ ┌────────────────────┘
▼ ▼
┌──────────────────┐
│ 6. ROLLBACK │
│ (if needed) │
└──────────────────┘
Goal: Identify exactly what the bug is
Gather information:
Identify project stack and read architecture doc
Assess severity:
🔴 CRITICAL - Production down, data loss
🟠 HIGH - Major feature broken, many users affected
🟡 MEDIUM - Feature degraded, workaround exists
🟢 LOW - Minor issue, cosmetic
## Bug Report
**Severity**: [CRITICAL/HIGH/MEDIUM/LOW]
**Stack**: [Flutter/React/Go/Laravel/Remix]
**Architecture Doc**: [path]
**Error**: [error message]
**Steps**:
1. ...
2. ...
**Expected**: [what should happen]
**Actual**: [what happens]
**Environment**: [prod/staging/dev]
Goal: Reproduce the bug and find root cause
Read architecture doc to understand codebase structure
Reproduce locally following architecture patterns
Find root cause using 5 Whys:
Why did it fail? → [answer]
Why? → [deeper answer]
Why? → [even deeper]
Why? → [root cause emerging]
Why? → [ROOT CAUSE]
Identify fix location based on architecture:
Check git blame:
git log --oneline -10 -- [affected_file]
git blame [affected_file] | grep -A5 -B5 "[problem_area]"
## Root Cause Analysis
**Architecture Reference**: [path to doc]
**Affected Layer**: [layer from architecture doc]
**Root Cause**: [description]
**Introduced**: [commit/PR if known]
**Affected Files**:
- file1:123
- file2:456
**Fix Strategy**: [brief description following architecture patterns]
Goal: Implement minimal fix following architecture
Create hotfix branch:
git checkout -b hotfix/[issue-id]-[short-description]
Read architecture doc for the affected layer
Implement fix following architecture patterns:
Add inline comment explaining fix:
// HOTFIX: [issue-id] - [brief description]
// Root cause: [why this fixes it]
[your fix code]
Goal: Confirm fix works without breaking other things
Test the fix:
Run existing tests (use command from architecture doc):
flutter test # Flutter
go test ./... # Go
bun test # React/Remix
php artisan test # Laravel
Add regression test following architecture patterns:
// Test to prevent regression
it('should [expected behavior] - fixes #[issue-id]', () => {
// Arrange: setup that caused bug
// Act: trigger the bug scenario
// Assert: verify correct behavior
});
Manual verification:
If verification fails:
Goal: Ship the fix safely
Commit with clear message:
git add .
git commit -m "fix: [short description] (#[issue-id])
Root cause: [brief explanation]
Fix: [what was changed]
Fixes #[issue-id]"
Create PR:
gh pr create --title "fix: [description]" --body "$(cat <<'EOF'
## Summary
Fixes #[issue-id]
## Root Cause
[explanation]
## Fix
[what was changed, following architecture patterns]
## Testing
- [ ] Original bug no longer occurs
- [ ] Regression test added
- [ ] All tests pass
## Rollback Plan
Revert commit: `git revert [commit-sha]`
EOF
)"
Deploy (if applicable):
# Follow your deployment process
# Monitor for issues
Goal: Quickly revert if fix causes more problems
Quick Revert:
# Find the hotfix commit
git log --oneline -5
# Revert it
git revert [hotfix-commit-sha]
git push
Feature Flag (if available):
// Disable the fix temporarily
if (!featureFlags.hotfix_123_enabled) {
// Original behavior
}
Redeploy previous version:
# Deploy previous known-good version
git checkout [previous-tag]
# Run deploy
| Stack | Doc |
|-------|-----|
| All | clean-architecture.md |
| Flutter | flutter-mobile.md |
| React | react-frontend.md |
| Go | go-backend.md |
| Laravel | laravel-backend.md |
| Remix | remix-fullstack.md |
| Monorepo | monorepo.md |
| Aspect | Hotfix | Feature | |--------|--------|---------| | Speed | Fast (< 1 hour) | Thorough | | Scope | Minimal | Full | | Testing | Targeted | Comprehensive | | Design | Skip | Required | | Risk | Higher, has rollback | Lower |
| Severity | Response | Fix Target | |----------|----------|------------| | 🔴 CRITICAL | Immediate | < 1 hour | | 🟠 HIGH | Same day | < 4 hours | | 🟡 MEDIUM | Next sprint | < 1 week | | 🟢 LOW | Backlog | When convenient |
fix: [short description] (#issue-id)
Root cause: [why it happened]
Fix: [what was changed]
Fixes #[issue-id]
Add your team's emergency contacts here:
On-call: [contact]
Backend lead: [contact]
DevOps: [contact]
development
Test-Driven Development workflow. Use when doing TDD, writing tests first, or when user says "tdd", "test first", "test driven", "red green refactor".
development
Thorough pull request review workflow with architecture compliance checks. Use when reviewing pull requests, checking code changes, or when user says "review pr", "check pr", "review code", "pr review", "review pull request".
development
Review local branch changes for architecture compliance, conventions, and code quality before pushing/PR. Stack-aware — detects the project stack and applies the matching rules. Use when user says "review changes", "review branch", "check branch", "check changes", "review my code", "review before pr".
testing
DDD architecture compliance review with automated checks and review loop. Use when user says "architect-review", "architecture review", "review architecture", "check architecture", "review ddd", "ddd review".