aif-evolve

Analyzes patches and codebase patterns to generate project-specific rules for AI Factory skills.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI coding assistants repeat the same mistakes because generic skill instructions never learn from a project's actual bug history. This Skill closes that loop by analyzing accumulated fix patches, recurring error patterns, and codebase conventions, then writing project-specific rules that make every other AI Factory skill smarter over time. ## Core Features & Use Cases - Incremental patch analysis: Reads patches from .ai-factory/patches/ using a cursor file with an overlap window, extracting every independent prevention point into a registry mapped to target skills. - Stale rule detection: Compares skill-context rules against updated base SKILL.md files, classifying them as fully covered, conflicting, or partially overlapping, and collects user decisions before applying changes. - Safe rule application: Writes improvements only to .ai-factory/skill-context/<skill-name>/SKILL.md for built-in aif-* skills (never editing package-owned files), while allowing direct edits for custom skills, and logs every evolution with a timestamped report. - Use Case: After ten bug-fix sessions, run the evolve command to discover that six patches involved null-reference errors, then automatically add a prioritized null-check guard rule to the fix skill's project context. ## Quick Start Ask the AI to run /aif-evolve all to analyze accumulated patches and propose project-specific rule improvements for every installed skill.

Frequently Asked Questions about aif-evolve

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

FAQPage Schema
How do I improve AI coding skills based on past bug fixes?

Run /aif-evolve with a skill name or 'all' to analyze patches in .ai-factory/patches. It extracts prevention points from each patch, checks which ones existing rules already cover, and proposes new project-specific rules for your approval.

What is the difference between skill-context rules and base SKILL.md files?

Base SKILL.md files ship with the ai-factory package and are overwritten on updates. Skill-context files under .ai-factory/skill-context hold project-specific overrides that take priority over base rules and survive package updates.

Can aif-evolve modify built-in aif-* skill files directly?

No. The skill explicitly forbids editing any files inside skills/aif-*/ directories because package updates overwrite them. All improvements for built-in skills are written to .ai-factory/skill-context/<skill-name>/SKILL.md instead.

How does incremental patch analysis avoid reprocessing old patches?

A cursor file at evolutions/patch-cursor.json records the last processed patch filename. Each run reads only newer patches plus a five-patch overlap window, and the cursor advances only after improvements are successfully applied.

What happens when a skill-context rule conflicts with an updated base skill?

The stale rule analysis classifies it as fully covered, conflicting, or partially overlapping, then presents both versions in a report. You decide via prompts whether to keep, rewrite, narrow, or remove the skill-context rule.

When should I run a full rescan instead of incremental evolution?

Run a full rescan when the cursor references a deleted or renamed patch, or when you need complete historical coverage counts. Delete the patch-cursor.json file and rerun /aif-evolve to reprocess all patches.