KunanonJ/superstacks / plugins/superstacks/skills/mistake-to-constraint
mistake-to-constraint
VerifiedUse when a mistake repeats. Encode it as the strongest guard — type or runtime, lint, test, directory convention, then a rules line — and log it in CONSTRAINTS.md.
| File | Kind | Size |
|---|---|---|
| CONSTRAINTS.md | markdown | 331 B |
| SKILL.md | skill md | 1.4 KB |
| templates/eslint-rule.cjs | script | 618 B |
| templates/ruff-snippet.toml | config | 296 B |
| templates/runtime-guard.py | script | 369 B |
| templates/semgrep-rule.yml | config | 164 B |
SKILL.md
View on GitHub---
name: mistake-to-constraint
description: Use when a mistake repeats. Encode it as the strongest guard — type or runtime, lint, test, directory convention, then a rules line — and log it in CONSTRAINTS.md.
license: MIT
disable-model-invocation: true
---
# Mistake to constraint
A repeated mistake is an environment bug. Do not add another prompt paragraph first.
## Order (strongest first)
1. **Type narrowing or runtime guard** — make the illegal state unrepresentable. See `templates/runtime-guard.py`.
2. **Lint rule** — copy `templates/eslint-rule.cjs` or `templates/semgrep-rule.yml`. Prefer an existing ruff selector from `templates/ruff-snippet.toml` before a new plugin.
3. **Test** — a regression that fails if the mistake returns.
4. **Directory convention** — put the dangerous thing in a folder that review and CI already treat as special.
5. **Rules line** — last. Only when 1–4 cannot hold the line.
## Ledger
Keep `CONSTRAINTS.md` at the repo root of the consuming project. Start from the template next to this skill.
Each row: date, mistake, guard added, kind (`type` / `runtime` / `lint` / `test` / `directory` / `rules`).
## Rules
- One mistake, one guard. Do not stack a lint rule and a rules line for the same bug unless the lint cannot see it.
- Do not install ESLint, ruff, or semgrep. Wire the template into tools the repo already runs.
- Do not file tracker issues. Open a draft PR with the guard and a verify-loop command.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |