# Lesson that recurs after being written becomes a check

> Lesson that recurs after being written becomes a check is an open-source agent skill for developer tools. Turns a repeatedly broken written rule into an automatic check the agent can't skip. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/lesson-that-recurs-after-being-written-becomes-a-check
- **Repository:** https://github.com/wan-huiyan/agent-traffic-control
- **GitHub stars:** 5
- **License:** MIT
- **Skill name:** lesson-that-recurs-after-being-written-becomes-a-check
- **Collection:** https://github.com/wan-huiyan/agent-traffic-control
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill guides the agent when a lesson already recorded in a note, memory or house rule keeps being broken. Instead of adding more wording, it steers toward a mechanical check such as a tool-call hook, a pre-commit or CI step, or a script the workflow must run. It also helps decide which rules belong in a document and which belong in a program.

The guidance covers writing refusal messages that state the rule, its reason and the single allowed way through. It recommends failing open only when the check itself is missing, while refusing when the check cannot read its inputs, plus a named override that needs the owner's approval and is logged. It also advises keeping rule numbers in one place and noting what the check cannot see.

Verification is described as re-running the exact failing command to confirm refusal, running the allowed path to confirm it passes, and removing inputs on purpose to confirm the check refuses. The skill is plain Markdown with no scripts or bundled files, so it is written for the agent to apply to whatever project it is working in.

## When your agent uses it

> The same mistake keeps happening even though a note, memory or house rule already says not to. Use when you find a lesson written down that was broken again, or when deciding whether a new rule belongs in a document or in an automatic check.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/wan-huiyan/agent-traffic-control/tree/HEAD/plugins/agent-traffic-control/skills/lesson-that-recurs-after-being-written-becomes-a-check)
- [License: MIT](https://github.com/wan-huiyan/agent-traffic-control/tree/HEAD/plugins/agent-traffic-control/skills/lesson-that-recurs-after-being-written-becomes-a-check)

## Features

- **Turning rules into checks:** Guides replacing a repeatedly broken written rule with a hook, CI step or script.
- **Refusal message design:** Explains how a refusal should name the rule, its reason and the allowed route.
- **Fail-open versus fail-closed:** Distinguishes a missing check from one that cannot decide, and sets behavior for each.
- **Logged owner overrides:** Describes a named override that requires the owner's approval and records each use.
- **Verifying a new check:** Lists tests: the blocked command is refused, the allowed path passes, and missing inputs cause refusal.
- **Document versus check decisions:** Helps decide whether a rule is mechanical enough for a program or needs human judgement.

## Good for

- Stop an agent from repeating a mistake already noted in project memory
- Decide whether a new coding rule belongs in documentation or a pre-commit hook
- Add a hook that blocks a risky shell command after it was run wrongly before
- Design a refusal message that explains a rule and the correct alternative
- Test that a newly added guard refuses the original mistake

## Install

### Claude Code

This skill ships in the `agent-traffic-control` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add wan-huiyan/agent-traffic-control
/plugin install agent-traffic-control@wan-huiyan-agent-traffic-control
```

Or copy only this skill to `~/.claude/skills/lesson-that-recurs-after-being-written-becomes-a-check`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/lesson-that-recurs-after-being-written-becomes-a-check &&
cp -R "$tmp/plugins/agent-traffic-control/skills/lesson-that-recurs-after-being-written-becomes-a-check" ~/.claude/skills/lesson-that-recurs-after-being-written-becomes-a-check &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/lesson-that-recurs-after-being-written-becomes-a-check` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/lesson-that-recurs-after-being-written-becomes-a-check` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/lesson-that-recurs-after-being-written-becomes-a-check &&
cp -R "$tmp/plugins/agent-traffic-control/skills/lesson-that-recurs-after-being-written-becomes-a-check" ~/.agents/skills/lesson-that-recurs-after-being-written-becomes-a-check &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/lesson-that-recurs-after-being-written-becomes-a-check` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/lesson-that-recurs-after-being-written-becomes-a-check` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/lesson-that-recurs-after-being-written-becomes-a-check &&
cp -R "$tmp/plugins/agent-traffic-control/skills/lesson-that-recurs-after-being-written-becomes-a-check" ~/.cursor/skills/lesson-that-recurs-after-being-written-becomes-a-check &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/lesson-that-recurs-after-being-written-becomes-a-check` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/wan-huiyan/agent-traffic-control.git --path plugins/agent-traffic-control/skills/lesson-that-recurs-after-being-written-becomes-a-check
```

Or copy the folder to `~/.gemini/skills/lesson-that-recurs-after-being-written-becomes-a-check` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/lesson-that-recurs-after-being-written-becomes-a-check`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/lesson-that-recurs-after-being-written-becomes-a-check &&
cp -R "$tmp/plugins/agent-traffic-control/skills/lesson-that-recurs-after-being-written-becomes-a-check" ~/.copilot/skills/lesson-that-recurs-after-being-written-becomes-a-check &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/lesson-that-recurs-after-being-written-becomes-a-check` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git
```

Then copy `agent-traffic-control/plugins/agent-traffic-control/skills/lesson-that-recurs-after-being-written-becomes-a-check` into your agent's skills folder as `lesson-that-recurs-after-being-written-becomes-a-check`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Lesson that recurs after being written becomes a check trigger?

It is meant for cases where a written lesson was broken again, or when deciding whether a new rule belongs in a document or an automatic check. Its description says the user invokes it when those situations arise.

### Does Lesson that recurs after being written becomes a check need any scripts or tools?

No scripts are included and no allowed tools are set. It is a single SKILL.md file that gives guidance only.

### What kinds of rules does Lesson that recurs after being written becomes a check suggest turning into checks?

Rules that a program can decide from a command line, a file's presence or a record on disk, especially where a wrong step is costly or hard to undo. Judgement calls stay in documents.

### How should a check verify itself?

The skill suggests re-running the exact command that broke the rule, running the allowed path, and removing the check's inputs to confirm it refuses rather than passes.

### How do I install Lesson that recurs after being written becomes a check in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/lesson-that-recurs-after-being-written-becomes-a-check to use it in all your projects, or to .claude/skills/lesson-that-recurs-after-being-written-becomes-a-check in one project. Or install the agent-traffic-control plugin, which includes it: /plugin marketplace add wan-huiyan/agent-traffic-control, then /plugin install agent-traffic-control@wan-huiyan-agent-traffic-control.

### Does Lesson that recurs after being written becomes a check run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Lesson that recurs after being written becomes a check?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Lesson that recurs after being written becomes a check?

The closest alternatives to Lesson that recurs after being written becomes a check are Principle encode lessons in structure, Correct, Agent refusal with evidence beats literal compliance, Writing rules and Principle build the lever.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Principle encode lessons in structure](https://ai-powered.com/skills/principle-encode-lessons-in-structure): Principle encode lessons in structure is an open-source agent skill for developer tools.
- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.
- [Agent refusal with evidence beats literal compliance](https://ai-powered.com/skills/agent-refusal-with-evidence-beats-literal-compliance): Agent refusal with evidence beats literal compliance is an open-source agent skill for developer tools.
- [Writing rules](https://ai-powered.com/skills/writing-rules-xiaolai): Writing rules is an open-source agent skill for developer tools.
- [Principle build the lever](https://ai-powered.com/skills/principle-build-the-lever): Principle build the lever is an open-source agent skill for developer tools.
- [Learning loop](https://ai-powered.com/skills/learning-loop): Learning loop is an open-source agent skill for developer tools.
- [Safety critical patterns](https://ai-powered.com/skills/safety-critical-patterns-ajyadav013): Safety critical patterns is an open-source agent skill for developer tools.
- [Vibe anti rationalization check](https://ai-powered.com/skills/vibe-anti-rationalization-check): Vibe anti rationalization check is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/lesson-that-recurs-after-being-written-becomes-a-check
