Hotfix

From tinh2/skills-hub-registry · View interactive version

Hotfix is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Emergency bug fix pipeline — diagnose, fix, test, commit, push, and PR in 2 iterations max. Speed over perfection.

How to use this skill

Skill file

You are in EMERGENCY MODE. Fix the bug and ship. Do NOT ask the user questions. Infer everything from the error, stack trace, and codebase.

Maximum 2 iterations. Do NOT refactor surrounding code. Do NOT improve anything

beyond the bug. Apply the minimal correct fix.

============================================================

TARGET: $ARGUMENTS

============================================================

$ARGUMENTS contains the bug description, error message, stack trace, or area that is broken.

If $ARGUMENTS is empty:

  1. Check conversation context for an error message or bug report.
  2. Check recent git log for revert commits or fix attempts.
  3. Run the project test suite to find failing tests.
  4. If nothing is found, report that no bug was identified and suggest running /qa to find issues.

============================================================

PHASE 1: BRANCH SAFETY

============================================================

Before making any changes:

  1. Check the current branch: git branch --show-current
  2. If on main, master, or develop: create a hotfix branch first:

git checkout -b hotfix/{short-description}

Use a slugified version of the bug description (e.g., hotfix/null-pointer-user-login).

  1. If already on a feature or hotfix branch: stay on it.

============================================================

PHASE 2: DIAGNOSE AND FIX (Iteration 1)

============================================================

  1. DIAGNOSE:
  1. FIX:
  1. TEST:

Auto-detect the project type and run the appropriate test suite:

If no specific test identified: ENVIRONMENT=test sbt test

============================================================

PHASE 3: REFINE (Iteration 2 — only if iteration 1 tests failed)

============================================================

  1. Analyze the test failures from iteration 1.
  2. Adjust the fix based on what the tests revealed.
  3. Re-run the test suite.
  4. If still failing -> STOP. Report what you found and what you tried.

============================================================

PHASE 4: SHIP

============================================================

  1. Stage ONLY the files you changed (no unrelated files).
  2. Commit:

```

fix: {brief description of what was broken and fixed}

```

Do NOT include Co-Authored-By lines.

  1. Push immediately.
  2. Create PR with gh pr create:

```

## Summary

## Test Plan

```

============================================================

SELF-HEALING VALIDATION (max 2 iterations)

============================================================

After completing deployment/infrastructure changes, validate:

  1. Verify all generated files are syntactically valid (YAML, JSON, HCL, Dockerfile).
  2. Run validation commands if available (terraform validate, docker build --check, kubectl dry-run).
  3. Verify no secrets, credentials, or sensitive values are hardcoded.
  4. If validation fails, diagnose and fix the specific syntax or config error.
  5. Repeat up to 2 iterations.

IF STILL FAILING after 2 iterations:

============================================================

OUTPUT

============================================================

| Section | Detail |

|---------|--------|

| Bug | {what was broken} |

| Cause | {root cause} |

| Fix | {file:line — what changed} |

| Tests | {pass/fail, count} |

| PR | {URL} |

| Iterations | {1 or 2}/2 |

============================================================

NEXT STEPS

============================================================

After the hotfix is shipped:

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /hotfix — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

============================================================

DO NOT

============================================================

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.