mcpField
L
learning-from-mistakes

learning-from-mistakes

github.com/bostonaholicAgent workflows265 installsUpdated 1d ago
Repository

About learning-from-mistakes

A skill that turns a recent mistake or correction into a specific rule in an agent's persistent instructions. It checks for overlap and requires approval before changing the chosen project or global file.

Key features

  1. 01Codify a recent correction
  2. 02Choose project or global scope
  3. 03Check for duplicate rules
  4. 04Require approval before writing

Use cases

  1. 01Preserve a codebase-specific lesson
  2. 02Carry a general behavior rule across sessions

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bostonaholic/skills --skill learning-from-mistakes

After installing, type/learning-from-mistakesin Claude Code to confirm it loaded.

Bundled filesagents/openai.yamlscripts/resolve-instructions-file.sh

Details

From the project README

Learn From Mistake

Turn the most recent mistake or correction in the conversation into a rule in the instructions file the agent reads, so the lesson persists across sessions. If no correction is clear, ask which one to codify.

  • The rule: one or two imperative sentences ("Do X", "Never Y"), specific enough to change behavior. A platitude ("be careful with tests") fails.
  • Target file: choose the scope, project for a lesson about this codebase, its conventions or tooling, or global for one that applies across projects, then run scripts/resolve-instructions-file.sh <claude|codex> <project|global> with claude in Claude Code and codex in Codex. Exit 0 prints the file to edit. On exit 2 (no repository) or 69 (no git), ask where to write. In another host, or on exit 3, ask which file it reads. On exit 4, report the loop. Exit 1 is a usage error: fix the arguments and rerun.
  • Overlap: if the rule already exists, stop and say where. If a related rule exists, refine it instead of adding a duplicate.
  • Approval: show the rule (or the old and new text of a refined rule), the file path, and the section: an existing section that fits, or else a new ## Learned Rules section. Never propose any other new heading. Write nothing until the user approves.

Comments

Markdown supported