lesson-to-skill
Installation
SKILL.md
Lesson to Skill
A confirmed mistake is a lesson. Land it in one owning skill or rule file so future runs avoid repeating the error.
[!CAUTION] Safety Principle: Skills and rules are the agent's long-term memory. A wrong, hallucinated, or speculative rule poisons all future agent runs across the repository. Never land an unverified or speculative lesson directly into project rules.
Run this after cite-or-stop has stopped retries (or after the user names the mistake). Do not keep implementing code while landing a lesson.
Before any create or edit, follow project agent authoring guidelines (e.g. writing-for-agents if present).
0. Detect Repository Skills/Rules Location
Auto-detect the active agent configuration structure in the repository:
- Canonical skills directory: Look for
.agents/skills/,.github/skills/,.claude/skills/, or.cursor/skills/. If a directory is a symlink, target its canonical source. - Rules directory: Look for
.cursor/rules/,.windsurf/rules/,.gemini/rules/, or.cline/rules/. - Root instruction files: If neither exists, locate project instruction files such as
AGENTS.md,CLAUDE.md,GEMINI.md, or.cursorrules.