# Correct

Prevent repeated mistakes in a repository by enforcing type safety, lints, and tests, each proven on past errors.

**Canonical URL:** https://skillshunter.net/skills/discovered-4e3cb12843100d86b67cc8aa133403cbabbdfc9cbe0685fa

**JSON URL:** https://skillshunter.net/api/public/v1/skills/discovered-4e3cb12843100d86b67cc8aa133403cbabbdfc9cbe0685fa

**Markdown URL:** https://skillshunter.net/skills/discovered-4e3cb12843100d86b67cc8aa133403cbabbdfc9cbe0685fa.md

**Instructions download URL:** https://skillshunter.net/skills/discovered-4e3cb12843100d86b67cc8aa133403cbabbdfc9cbe0685fa/download

**Category:** Software & Development

**Source URL:** https://github.com/jueyi6/empstack/blob/74181e31d2f00313f8683ba157966efcabbe109e/skills/correct/SKILL.md

**Source commit:** 74181e31d2f00313f8683ba157966efcabbe109e

**Listing approved at:** 2026-12-02

**Created at:** 2026-11-30T08:55:30.000000Z

**Updated at:** 2026-12-02T09:15:13.000000Z

## Catalog information

The following descriptions are catalog information. Listing approval does not mean the skill has been tested or is safe for every environment.

### Editor's note

Before applying corrections, ensure that all contributors are aware of the new rules and that the repository's CI/CD pipeline is updated to enforce the new checks. The first deliverable is a table in the agent instruction file that pairs each rule with what enforces it.

### When to use it

- Eliminate recurring bugs by enforcing type safety and linting rules.
- Ensure consistent code quality by preventing past mistakes from reoccurring.
- Automate error prevention with CI/CD checks that fail on known bad patterns.

## Skill instructions

---
name: correct
description: Make repeated agent mistakes in this repo impossible with types, lints, or tests, each proved on a past mistake.
disable-model-invocation: true
---

# Correct

The operator keeps correcting agents in this repo for the same mistakes. Change the repo so the next agent can't make them.

Assume every contributor is an agent that sees only the files it opened, copies the nearest example, and takes the shortest path that compiles. Design the repo so a change that looks right from one file is right for the whole repo.

## Find the mistake classes

First, read recent commits, reverts, review comments, agent instruction files, and comments that explain workarounds. Group the mistakes into classes. A class counts once it has happened twice.

## Fix each class at the highest level that works

1. **Eliminate it with architecture.** Give each piece of state one owner and each task one supported way. Hide internals so the wrong import fails. Replace hand-synced lists with one source of truth. Delete old ways and dead code an agent would copy.
2. **Enforce it with types so the bad state can't be written.** If bad code still compiles, add a lint or CI check whose error names the file, type, or function to use instead. If the pattern is already common, fail only when a change adds more.
3. **Test the behavior.** Fix or delete any test that still passes when the behavior it checks breaks, or that fails when only the internals change.
4. **Write docs or agent rules last, only for judgment calls.** Nothing fails when an agent skips them.

## Fix and prove

Then fix the most frequent classes now, one commit each. Prove each new check fails on a real past mistake. Run the same command locally and in CI. Exceptions go on the offending line with a reason, an expiry date, and a human's approval.

## Keep the rule table

Last, keep a table in the agent instruction file that pairs each rule with what enforces it. When the operator corrects you, fix the mistake and add the rule. If the rule was already there and nothing enforces it, that's a repeat, so fix it at the highest level in the same change. Drop a rule once its mistake can't happen.

**Reply:** each class with its evidence, the level you picked, and why a higher level didn't work.

