Skip to content
Back to skills

Self Improvement

ASecurity

Records, searches and re-verifies lessons in .opencastle/lessons/ with the opencastle lesson CLI. Use when a retry succeeds or a task fails, before work past lessons may cover, or when doctor reports a lesson's cited code changed.

  • 80 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 28, 2026
ai-agentsgobash

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 5, 2026

npx -y skills add monkilabs/opencastle --skill self-improvement --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Self Improvement?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Self Improvement
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/monkilabs-self-improvement/badge)](https://www.skillsdirectory.com/skills/monkilabs-self-improvement)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: self-improvement
description: "Records, searches and re-verifies lessons in .opencastle/lessons/ with the opencastle lesson CLI. Use when a retry succeeds or a task fails, before work past lessons may cover, or when doctor reports a lesson's cited code changed."
---

# Self-Improvement Protocol

## Core Rule

**Retry with different approach and it works → record a lesson immediately.** Lessons live in `.opencastle/lessons/`, one Markdown file each; `.opencastle/LESSONS-LEARNED.md` is the index of them every agent reads first.

## Writing a Lesson

> **⛔ HARD GATE — Use the CLI. Never write in `LESSONS-LEARNED.md`: it is rewritten from `lessons/` by every sync.**

```sh
opencastle lesson --title "Short descriptive title" --category general --severity high \
  --problem "What was observed" --wrong "Failing approach" --correct "Working solution" \
  --why "Root cause" --cite src/lib/payments.ts:42
```

Required: `--title`, `--category`, `--severity`, `--problem` · Optional: `--wrong`, `--correct`, `--why`, `--cite` (repeatable)

`--cite` names the code the lesson is about, relative to the project root. When that code changes, `doctor` says the lesson may no longer hold — cite whenever the lesson is about a specific file.

The command prints the new lesson's id (`2026-10-02-short-descriptive-title`). It refuses a lesson that would commit a credential, and a citation that does not exist.

After writing: if the lesson reveals a gap in a skill or instruction file, update that file too (prevents the pitfall at source).

## Workflow

1. Search past lessons for matching entries or similar errors (below).
2. Attempt task with conservative flags/options informed by lessons.
3. On failure: retry with modified approach (up to threshold); capture error details, context.
4. On success: run `opencastle lesson` to record the working approach.
5. Verify: the command printed an id, and `.opencastle/lessons/<id>.md` holds the title, category and severity you gave. If malformed → fix the flags and run it again, then delete the bad file.
6. If the lesson indicates a needed skill/instruction update: draft the change; propose a PR.

Search the lessons themselves, not the index — the index has titles only:

```bash
rg -i "CRON_SECRET" .opencastle/lessons/ || true
```

## When code a lesson cites has changed

`doctor` names it: `<id> cites <file>, which has changed since it was verified`. Read the lesson against the code now:

| Still true? | Run |
|-------------|-----|
| Yes, file unchanged in substance | `opencastle lesson verify <id>` |
| Yes, but the code moved | `opencastle lesson verify <id> --cite <new/path.ts>` |
| No longer applies | `opencastle lesson archive <id> --into <file that now covers it>` |

## Categories & Severity

Valid `--category` and `--severity` values: [LESSON-CATEGORIES.md](LESSON-CATEGORIES.md).

## Quality Rules

- Include exact error messages, commands, tool parameters
- Always fill both `--wrong` and `--correct` — the contrast is what makes the lesson usable
- One lesson per command; code blocks mandatory for commands
- Never paste a token, key or password — describe it ("the Stripe test key in `.env`")

## Anti-Patterns

Never duplicate an existing lesson · Never defer recording to end of session · Never edit `LESSONS-LEARNED.md` by hand

## Agent Memory

For expertise tracking, cross-session knowledge graphs, load **agent-memory** skill.

Files in this skill

  • LESSON-CATEGORIES.md1.2 KB
  • SKILL.md2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…