Fix

From InugamiDev/ultrathink-oss · View interactive version

Fix is an AI agent skill from the GitHub repository InugamiDev/ultrathink-oss. Apply targeted, verified fixes with minimal blast radius and rollback safety

How to use this skill

Skill file

Fix Skill

Purpose

Apply targeted, minimal, verified code fixes. This skill takes a diagnosed problem (typically from debug) and implements the smallest correct change that resolves it. The emphasis is on precision, safety, and verification -- not on improvement or refactoring.

A fix is not a feature. A fix is not a refactor. A fix changes the minimum code necessary to make the incorrect behavior correct.

Workflow

Phase 1: Fix Planning

  1. Confirm the diagnosis -- Restate the root cause. If coming from debug, validate that the diagnosis is specific enough to act on. If the diagnosis is vague (e.g., "something wrong with auth"), send back to debug.
  1. Identify the fix location(s) -- Determine exactly which file(s) and line(s) need to change. Read each file to confirm current state.
  1. Design the minimal fix -- What is the smallest change that corrects the behavior?
  1. Assess blast radius
  1. Choose fix strategy:

Phase 2: Implementation

  1. Read the target file(s) completely (or the relevant sections for large files).
  1. Apply the fix using the Edit tool with precise old_string / new_string replacements.
  1. If multiple files need changes, apply them in dependency order (shared code first, then consumers).

Phase 3: Verification

  1. Self-review the changes
  1. Run relevant tests (if they exist)
  1. Manual verification (if applicable)

Phase 4: Report

  1. Produce the fix report using the template below.
  2. Recommend next steps -- typically test to add regression tests, or code-review for complex fixes.

Fix Report Template

# Fix Report

## Root Cause
[One sentence restating the diagnosed issue]

## Changes Made
### [filename]
- **What changed**: [description]
- **Why**: [reasoning]
- **Lines affected**: [line range]

### [filename 2] (if applicable)
- ...

## Verification
- [ ] Self-review: Changes match intent
- [ ] Tests pass: [test command and result]
- [ ] Manual check: [what was checked]

## Blast Radius
- **Direct impact**: [what is directly affected]
- **Indirect risk**: [what might be affected]
- **Confidence**: High | Medium | Low

## Regression Risk
[What could this fix break? What should be watched?]

## Recommended Follow-up
- [ ] Add regression test via `test` skill
- [ ] Review via `code-review` skill (if high risk)

Usage

After debugging

/fix Apply the fix identified in the debug report

Direct fix request

/fix The getUserById function in src/lib/users.ts returns null instead of throwing NotFoundError when the user does not exist

With constraints

/fix The date parsing is wrong in the invoice generator. Must maintain backwards compatibility with existing invoices.

Quick fix

/fix Typo in the error message on line 42 of src/app/api/auth/route.ts: "authenication" should be "authentication"

Examples

Example: Null check fix

Diagnosis: UserList component crashes because API returns { error: "..." } without items field on failure.

Fix:

// Before
const items = data.items.map(...)

// After
const items = (data.items ?? []).map(...)

Plus add proper error handling:

if (data.error) {
  return <ErrorDisplay message={data.error} />
}
const items = data.items.map(...)

Example: Destructuring fix

Diagnosis: createOrder() does not include discount in destructured input.

Fix:

// Before
const { customerId, items, total } = input

// After
const { customerId, items, total, discount } = input

And ensure discount is passed to the database create call.

Example: Configuration fix

Diagnosis: CORS errors in production because allowed origins list does not include the new domain.

Fix: Add the domain to the CORS configuration, not to the code. This is a configuration fix, not a code fix.

Guidelines

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.