aif-fix

Diagnose and fix codebase bugs using a regression-first workflow with logging and self-improvement patches.

31|2|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/letuhao/lore-weave --skill aif-fix-letuhao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aif-fix
Source: https://github.com/letuhao/lore-weave/tree/main/.cursor/skills/aif-fix
Command: npx skills add https://github.com/letuhao/lore-weave --skill aif-fix-letuhao

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Fixing bugs with an AI assistant often means vague patches, no reproduction of the original failure, and no record of what was learned. This Skill enforces a disciplined bug-fix workflow: reproduce the problem with a minimal regression check, implement the smallest root-cause fix, verify the same check passes, and capture the lesson in a reusable patch file. ## Core Features & Use Cases - Regression-First Fixing: Identifies or creates the smallest regression check, confirms it fails before the fix, and reruns it after to prove the fix works. - Two Modes: Choose "Fix now" for immediate remediation or "Plan first" to generate a reviewable FIX_PLAN.md before any code changes; running with no arguments executes an existing plan. - Learning Patches: Every fix produces a timestamped patch file documenting the problem, root cause, solution, and prevention guidance, building a project knowledge base over time. - Use Case: You hit "TypeError: Cannot read property 'name' of undefined in UserProfile". Invoke the Skill with the error message; it locates the code, writes a failing regression test for the null case, applies a logged fix, verifies the test passes, and saves a patch so the same class of bug is prevented later. ## Quick Start Ask the assistant to fix a bug by running the aif-fix skill with your error message, for example: fix the bug where the orders API returns an empty array for authenticated users.

Frequently Asked Questions about aif-fix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a bug with a regression test first?

Invoke the Skill with the bug description or error message. It identifies the minimal regression check, runs it to confirm the failure, implements the smallest root-cause fix, then reruns the same check to verify the fix before suggesting broader test coverage.

What is the difference between fix-now and plan-first mode?

Fix-now investigates and applies the fix immediately. Plan-first creates a FIX_PLAN.md with analysis, a fix checklist, files to modify, and risks, then stops so you can review; running the Skill with no arguments later executes that saved plan.

What happens if a bug cannot be reproduced automatically?

The Skill documents the narrowest manual or runtime reproduction and treats it as the regression check. If no useful check exists, it records the reason and, in manual mode, asks whether to proceed with the likely fix or investigate further.

Does the fix workflow add logging to my code?

Yes, logging is mandatory for every fix. The Skill adds log statements with a [FIX] prefix around inputs, success paths, and errors so you can verify behavior and share logs if the issue persists.

What are the patch files created after each fix?

Each fix generates a timestamped Markdown patch in the patches directory recording the problem, root cause, solution, prevention guidance, and tags. These patches build a project knowledge base that informs future fixes.