/checkpickerupper-skills:correct-by-constructionfrom checkpickerupper-skills
Eliminates entire classes of bugs by making invalid states unrepresentable at the type level. Guides type design, drift analysis, and enforcement rules.
Ships in checkpickerupper-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A bug is a state the design lets someone write. The fix is not a check beside it; it is a design in which the state cannot be written at all, owned by the earliest place that knows the rule, with every other route to the state removed. One fact has one owner; every other copy is derived from it or deleted.
"By construction" means the next caller receives a valid value, contract or route without relying on memory, a final defensive check or a workaround. For a class of invalid states, a type composition is the construction fix. A runtime writer, parser, validator, clamp, evaluator or brand-minting function is evidence or a residual boundary, never the type-level enforcer or the closure proof.
The same standard covers two targets: a bad state that can be written or constructed, and evaded behavior that gets around a rule through another wording, token, route, wrapper or surface. Find the writer of the state or the mechanism that enables the behavior, then close the whole class.
Never say the type system cannot express a rule until you have written the type-level forms and pasted the compiler output for each: a parameter typed as the domain object instead of its id, a non-string type for a value that must not be printed, a tagged template or function whose parameter types refuse the bad value, a generic constraint, a closed union. A claimed residual with no pasted compiler output is a guess. A residual never licenses a custom checker per finding: if the class recurs, the fix is a type, not a new script.
writer → transformations and boundaries → invalid state → observed failure.
A fix written before the chain is known is a guess.The fix is one closed type of states, each state carrying only its own data, and one transition function per allowed move as the only writer, so a forbidden move does not compile or cannot be called. Report every one found with its states, the moves the code performs, and the forbidden moves it still permits.
Run these steps in order. Diagnosis and prevention are one answer.
Preserve the request's quantifiers: "every", "all" and "the whole class" need class-wide coverage. Decide whether edits are authorized. Read-only means no edits, never no prescription.
Done when the scope, target and edit authority are stated and the work has not narrowed itself to the first visible symptom.
Do I know who or what wrote the bad state? If not, keep tracing.
Read the code, artifact, transcript, configuration, generator, hook or workflow that proves how the state or behavior is created: who writes, constructs, persists, generates, copies or mutates it; who chooses the route; which transformations change it; which boundary reports or compensates for it. A reader, parser, importer, crash site or failing consumer is evidence about the result. When a reader rejects a malformed file, trace what wrote, truncated, templated or copied the file; when a screen hides a button, trace who persisted or dropped the state.
Done when one concrete writer is named with the path, symbol, artifact or transcript line that proves it.
State the smallest real value, relationship, artifact, transition or route the
design permits, not a smell category: "status is error while
errorMessage is null", not "the state can be inconsistent". Keep the
incident's exact value in the evidence, not in the class name.
Remove the words inherited from the witnessed case: proper names, feature, file and function names, commands, screens, framework terms, local lifecycle words, values and timings. Then run the swap test:
If the incident nouns are replaced with a sibling case, does the stripped sentence still describe the failure?
Add a word back only when it defines every member of the class. Good: "a capped value can be stored above its maximum." Bad: "this job increments this counter after this limit record is missing."
Write the rule the system guarantees by construction: callers receive a domain value, not a raw shape; one owner exposes one classification per fact; a generated artifact has one source; an operation's cost is represented honestly; an enforcement surface blocks the intent while valid boundary cases stay available. The rule never depends on a caller remembering a checklist.
Test every candidate owner with both questions:
Either yes means the candidate is too low. Prefer the earliest place that knows enough, in this order:
A judge is whatever refuses an artifact before a human must notice: a compiler, type checker, linter, schema validator, owning generator, or a test or CI job that runs on every change. A checklist is not a judge. Unrepresentable beats refused: once the class has been witnessed more than once, a judge outranks any lower manual fix, because recurrence proves site fixes are not holding, but never outranks a type or source of truth that removes the state. When no judge covers a recurring class, that gap is the finding.
An existing owner is evidence, not closure. Answer all four:
Without an answer to 3, the bug can still happen; say so.
When the owner is a judge, run it; do not read it. Run it against the artifact that carries the bug and paste the result. Prove: its mechanism can express the property (a linter cannot see a type invariant, a type checker cannot see whether a write was readable, a schema cannot see a cross-file relationship); its matcher matches this shape, not only the shape it was written for; it reaches the artifact by language, path and selection; and it runs where the artifact is authored. For a judge that does not exist yet, show it refusing the pre-fix artifact before prescribing it. A judge that allows the file containing the bug is a second finding.
Runtime enforcement is valid only after the raw bad shape is gone: a constructor may clamp, normalize or reject using runtime facts, but callers receive a domain value they cannot fake with a plain number, string, map entry or loose record.
When a new site of a class you are already fixing turns up partway through (from a reviewer, a worker, a test or your own search), your can't-come-back proof has failed. Stop fixing sites. Go back to this step and move the rule to an earlier owner before the next site is fixed. Fixing a list of sites is never the response to a new site.
Done when one earliest owner is named, both tests pass, and any judge has a demonstrated refusal.
When the bad state sits in one member of a family, many things built the same way (payment methods, discount types, form submissions), the earliest owner is usually a step every member passes through, not the member.
Done when every step is listed as shared or per member, and each per-member
step has its shared owner named. Worked families are in
references/family-steps.md.
Before accepting a mapping, switch, lookup table, normalizer, adapter or paired classification, ask:
Do the two sides answer different domain questions, or are they competing spellings of one fact?
Signals of competing spellings: identity cases pass through while others are
renamed or collapsed; collapsed cases differ only by scope or a value that
could live inside one case; the target exists so a consumer can recover a
category the source should expose; a hand-written type maintained beside a
runtime schema of the same data. Keep both only when each has an independent
meaning or belongs to an external contract this owner cannot replace, a source
distinction changes behavior outside the projection, and one side is derived
at the boundary rather than stored as a second authority. Otherwise put the
fact in one classification, move real variation into payload or a nested
closed type, have consumers read the owner, and delete the translator.
Deriving from the one source (type Order = Static<typeof orderSchema>) is
correct; two that must agree is the defect. Exhaustiveness proves coverage,
not single ownership.
For every alias, projection, label, status, wrapper, carved subset or reconstructed contract, inspect at least one place above the boundary that actually knows the value.
If consumers received the authoritative value, state or transition directly, would this representation still have a job?
If not, carry the owner's value with its branch-specific evidence and delete the representation. A representation that cannot drift can still be unnecessary. "Best within the current design" is not owner proof when changing the design deletes it. Do not wait to be asked whether going higher changes the answer.
Name the route each lower fix leaves open. Patch signals: a local null check, clamp, broad catch, default or fallback; a larger timeout, retry or buffer; a token-only regex; a doc warning, comment or reviewer checklist; a binding remap, adapter, compatibility or legacy lane; a second classification kept in sync by a conversion. Keep one only with an independent domain purpose and the bad state already impossible upstream.
Name the surface, symbol or path that must change; what it must own or accept; every writer, lane, adapter, fallback or escape to remove, redirect, seal or make uncallable; and the observable result that proves the next consumer no longer compensates. "Use the existing owner" is not a change.
When editing is authorized, change the enforcing place so future callers receive the protected state by construction: the public contract, type algebra, schema, generator, generic constraint or closed registry. No local runtime patch, shim or call-site fix while the old type is still available. When editing is not authorized, return the same prescription and mark closure unproved.
Sweep direct constructors and raw literals, manual copies beside generated output, alternate APIs and wrappers, fallback branches, configuration and fixtures that spell the raw form, rules that cover one token or path, and consumer surfaces still exposing the old contract. Redirect or remove each. No expert mode, legacy lane or lower-level escape survives that can recreate the state.
any;Report the verification command, its exit code and the evidence that the old writer is gone. Only after this proof, look for sibling classes (references below).
Load the matching reference and fold its result into the one answer. Load more than one when the bad state spans them. Do not hand the user a menu of these.
| Load | When the bad state is |
|---|---|
references/data-shape.md | a local data shape or a type that carves or loosens its source: a struct, union, enum, field cluster, outcome type, optional field, Pick/Omit, cast |
references/public-surface.md | a public surface that lets callers assemble an invalid design or sequence: an API, CLI, test runner, macro set, generator, workflow, or several public lanes for one intent |
references/unit-cohesion.md | a boundary between units of delivery: one whole split by aspect, independent wholes fused under one name, or a shared capability placed under its first caller |
references/enforcement.md | the work product is enforcement (a hook, lint, guard, schema rule, skill or agent-behavior rule), or a guard fired and someone wants to weaken it |
references/one-fact-sweep.md | a sweep rather than one located bad state: where can facts drift, which facts have two owners, where can construction replace checks across a target |
references/similar-classes.md | the original class is closed and the user asks where else the same shape can happen |
When step 7 found a family, the bold sentence is followed by three short lines and nothing else about the family:
Add a class block only for a step that needs a Where or Proof those lines do not carry. Never list each member's copy of a shared step.
End with What needs you: only when the user must decide or do something, naming exactly what.
Write each bullet as one fact in the field's standard terms. Add a small code shape only when it makes the bad or fixed shape clearer. No preamble, no paragraphs under a label, and no closing summary that repeats the blocks.
Example:Replays send notifications twice, and server code builds client pieces.
1. Replays send duplicate notifications
2. Server construction needs client presentation
references/data-shape.md (opens in a new tab)references/enforcement.md (opens in a new tab)references/family-steps.md (opens in a new tab)references/one-fact-sweep.md (opens in a new tab)references/public-surface.md (opens in a new tab)references/similar-classes.md (opens in a new tab)references/unit-cohesion.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (checkpickerupper/skills) — no native marketplace selected
npx claudepluginhub p/checkpickerupper-checkpickerupper-skills23 skills in this plugin
/agent-mdlintReview AGENTS.md changes for Markdown defects, duplicated or conflicting instructions, and unintended semantic drift. Use when editing or reviewing agent instruction files, especially large rewrites or diffs that remove existing rules./anti-ai-slop-writingUse whenever writing or editing prose for people to read: website and landing-page copy, articles, blog posts, documents, READMEs, emails, replies, comments, docstrings, reviews, release notes, cover letters, bios, and any rewrite or edit of existing text. Bans every sign of AI writing, including answering a different question, windup openers, padded lists of three, puffed-up significance, promotional tone, corporate verbs such as owning or spearheading, 'not X but Y', privatives, abstraction laundering, AI vocabulary, em dashes, trailing -ing clauses, signpost transitions, choppy disconnected sentences, chatbot talk, notes to the writer, placeholders and summary endings./antimatter-codebase-structure-reviewPedantic structural audit of a commit, PR or branch, selected directory or module, or an entire codebase — hierarchy, nesting, naming, ownership, dependency boundaries, and growth readiness. Use when a change may distort repository shape, when a file or folder needs structural review, or when deciding whether to reorganize before expansion. Every finding must survive adversarial refutation and include evidence plus a concrete current→proposed change.Other plugins' skills for the same job