Skip to content
Back to skills

Learn

ASecurity

Turn confirmed mistakes into checks so they cannot come back, and keep the repo's rule table. Use after QA findings, after the user corrects you, or for "learn from this", "make sure this never happens again".

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentsrustswift

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add aivars/shipcrew --skill learn --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Learn?

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

Security grade badge for Learn
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aivars-learn/badge)](https://www.skillsdirectory.com/skills/aivars-learn)

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: learn
description: Turn confirmed mistakes into checks so they cannot come back, and keep the repo's rule table. Use after QA findings, after the user corrects you, or for "learn from this", "make sure this never happens again".
---

# Learn

A mistake that was caught once will be made again by the next agent, which sees only the files it opens and copies the nearest example. Change the repo so the mistake fails on its own.

## Input

The kept findings from a `ship` run, a correction the user just gave, or a look back: recent reverts, fix commits, review files and the notes in the agent instruction file that explain a workaround. Group them into classes. A one-off stays a one-off; a class has happened twice or would be expensive once.

## Fix each class at the highest level that works

1. **Make it impossible.** One owner for the state, one supported way to do the task, the wrong path removed: a type that cannot hold the bad value, a constructor that is the only way in, private access on what should not be reached.
2. **Make it fail the build or lint.** A custom lint rule (SwiftLint, ESLint, Ruff, whatever the repo runs) or a stricter compiler setting. The message names what to use instead.
3. **Make a test fail.** Two kinds earn their keep. A rule test on pure logic. A guard test that scans the source for the pattern and lists each allowed exception with its reason, so a new case fails until someone decides.
4. **Write it down.** Only for judgment calls nothing can check. One line, in the rule table.

Prove each new check: it must fail on the real mistake (restore the bad code, watch it fail, put the fix back). A check that never failed is not a check.

## The rule table

Keep `docs/agent-rules.md` in the repo: one row per rule.

| Rule | Enforced by | Since | Why |
|---|---|---|---|

- "Enforced by" names a test, a lint rule or a type. "prose" means nothing enforces it; those rows are the backlog.
- When a prose rule is broken again, move it up a level in the same change.
- Delete a row once the mistake cannot happen at all.

Point the agent instruction file at the table in one line. Do not copy the rules into it: a status log that grows with every session is read by every future session and trusted by none.

## Reply

Each class with its evidence, the level chosen, why a higher level did not work, and proof the check fails on the mistake. Then the rows added, moved and removed.

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.