poka-yoke
Mistake-proofing for anything: code, config, a schema, a process, a runbook, a form.
Skill by rainmanjam
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/rainmanjam-poka-yoke
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/poka-yoke
What's inside
- Skill name
poka-yoke- Description
- Mistake-proofing for anything: code, config, a schema, a process, a runbook, a form. Use when someone says "poka-yoke this", "mistake-proof it", "make this harder to get wrong", or runs /poka-yoke with no mode named. Applies Shigeo Shingo's method directly to any subject, and hands off to a specialist mode when one clearly fits. Start here when no other poka-yoke mode obviously applies.
- License
- MIT
- Instructions
- 176 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Poka-Yoke: Mistake-Proofing for Software
Shigeo Shingo's insight, from the Toyota Production System: **people will always make
mistakes; that is not the problem worth solving. The problem is letting a mistake become a
defect.** So you stop trying to make humans more careful and start redesigning the work so
the mistake either cannot physically happen or announces itself immediately.
A poka-yoke ("poh-kah yoh-kay", ポカヨケ) is a *device*: a jig, a shape, a counter: not
an instruction. In software: a type, a constraint, a hook, a schema, a state machine. The
single most important consequence:
> **A comment, a docstring, a wiki page, a code review checklist, or a line in CLAUDE.md
> saying "don't do X" is not a poka-yoke.** It is training. Training degrades. A device
> does not. If your proposed fix relies on someone remembering something, keep going.
## The two axes
Every real poka-yoke answers two questions. Use both when you classify a hazard or propose a
device. They are the difference between this method and generic code review.
### Axis 1, Regulatory function: what happens when the mistake occurs?
This is a strict preference ladder. Always reach for the highest rung you can afford.
| Rung | Name | What it does | Software examples |
|---|---|---|---|
| **1** | **Control** | The mistake is **impossible**. The work cannot proceed. | Type won't compile · `NOT NULL` / `CHECK` / unique constraint · required function argument · private constructor + smart constructor · PreToolUse hook returns deny · protected branch |
| **2** | **Warning** | The mistake is possible but **announced at the moment it happens**. | Lint error in the editor · failing CI gate · runtime assertion that throws · confirmation prompt naming the exact thing being destroyed |
| **3** | **Detection** | The mistake ships, and something **finds it afterward**. | Tests · monitoring · alerting · reconciliation job |
| **0** | *(not a poka-yoke)* | Relies on a human remembering. | Docs · comments · training · "be careful" · review checklists |
Shingo's rule: prefer **control** over **warning**, always, and only settle for warning when
control is genuinely too expensive, then say *why* out loud. In software the honest reason
is usually "the language can't express it" or "it would break every existing caller," and
both are worth stating explicitly so the tradeoff is visible.
### Axis 2, Setting function: how does the device notice?
Shingo's three detection methods map cleanly onto software. These are your **inspection
lenses**, run all three over any interface and you will find hazards that a general
code review misses.
| Method | Factory floor | The question to ask code | Software devices |
|---|---|---|---|
| **Contact** | The part physically won't seat unless it's the right shape and orientation | **Can the wrong thing fit?** | Distinct types instead of shared primitives · branded/newtype IDs · parse-don't-validate at boundaries · units in the type · discriminated unions instead of bags of optionals |
| **Fixed-value** | A counter says all 6 screws were fitted | **Can the wrong count or an incomplete set pass?** | Exhaustive `match`/`switch` over an enum · required fields · "all migrations applied" check · row-count guard on a bulk write · checksums · config validated as a whole at boot |
| **Motion-step** | A sensor confirms step 3 happened before step 4 | **Can the steps happen in the wrong order, or be skipped?** | Typestate · builder that cannot `.build()` until required steps run · state machines with illegal transitions unrepresentable · idempotency keys · RAII / `defer` / context managers · transactions |
### The third principle: inspect at the source
Shingo separated **source inspection** from **informative inspection**, which finds the defect
only after it exists and comes in two forms. Ranked best first, that is three places you can
put the device.
1. **Source inspection**: check the *conditions* before the error can occur. Designed in
where you can, enforced at runtime where you cannot.
The type, the constraint, the signature.
2. **Self-check** (informative): the work checks itself as it happens. Runtime. Assertions,
fail-fast, validation at the boundary.
3. **Successive check** (informative): the next station checks the previous one. Review, CI,
QA.
Push every device as far up this list as it will go. A CI gate that catches a bad migration
is good; a schema that makes the bad migration unwritable is better and costs less forever.
## How to use this skill
You have been asked to apply the method. There are two ways to do that, and picking the
wrong one wastes the request.
**If a specialist mode clearly fits the subject, load it**: the table below maps them. Those
files carry the domain detail this one does not: what a tenant-scoping device looks like, what
expand/contract means, which lint rules catch silent failure.
**If none clearly fits, apply the method here.** This file is self-contained enough to do
that, and refusing to act because the subject is not on a list would be its own failure. A
Terraform module, a support runbook, a spreadsheet everyone edits, a release checklist, a
prompt template, an onboarding process, a physical workflow: the method works on any of them,
because Shingo developed it on an assembly line, for people fitting springs into switches, and
not for software at all.
Applying it directly means four steps, in order:
1. **Name what is being done, and by whom.** A device protects a specific action taken by a
specific person or system. "The pipeline" is not an action; "an engineer re-runs the deploy
job after it fails halfway" is.
2. **Run the three lenses** over that action, can the wrong thing fit, can an incomplete or
wrong-sized set pass, can the steps happen in the wrong order. Most subjects yield
something on at least one.
3. **For each hazard found, state it as a mistake someone could make**, what happens when they
do, whether it is silent, and what exists today to stop it.
4. **Propose the highest-rung device you can afford**, and say which rung it reaches. If you
land on Warning, say what Control would have required and why you did not take it.
Then apply the two rules in *How to talk about this* below: name the mistake rather than the
mistaken, and never let the answer come out as "be more careful" or "document it". Those are
rung zero, and the whole method exists because they do not work.
**If the request is bare**, `/poka-yoke` with nothing attached, look at what is actually in
front of you: the current diff, the file under discussion, the thing the conversation has been
about. Say what you picked in one line before starting, so it is cheap to redirect you. If
there is genuinely no subject, ask what they want mistake-proofed rather than guessing.
## Choosing a mode
These are specialist modes, each carrying the full working method for its domain. Load one
when it clearly fits. When two apply, do them in the order listed. When none does, apply the
method directly as described above: the table is a shortcut, not a gate.
| If they are… | Use | Typical asks |
|---|---|---|
| Looking at code that already exists and asking what could go wrong | **`audit`** | "poka-yoke this repo" · "what's easy to misuse here" · "find the footguns" · "review this PR for ways to screw it up" |
| About to write an API, module, schema, or data model | **`design`** | "design this so it can't be misused" · "make invalid states unrepresentable" · "what should this signature be" |
| Wanting mechanical enforcement in the pipeline | **`guardrails`** | "add pre-commit hooks" · "gate this in CI" · "enforce it so it can't be merged" · "lint rule for this" |
| Dealing with something that already broke | **`retro`** | "this happened again" · "postmortem" · "make sure this never recurs" · "why did this get through" |
| Building or reviewing a user interface | **`ux`** | "users keep deleting the wrong thing" · "make this form harder to get wrong" · "add a confirmation" · "this flow is error-prone" |
| Deploying, migrating, or changing infrastructure | **`ops`** | "deploy this safely" · "what's the blast radius" · "this migration is scary" · "add a kill switch" · "prevent accidental deletion" |
| Working on pipelines, warehouses, or metrics | **`data`** | "the numbers are wrong" · "add data quality checks" · "safe backfill" · "upstream changed the schema" |
| Working on multi-tenant, permissions, or endpoints | **`authz`** | "can users see each other's data" · "IDOR" · "tenant isolation" · "we forgot to filter by org_id" |From rainmanjam/poka-yoke, MIT.
More from rainmanjam/poka-yoke
- 0.607score
retro
rainmanjam
Turn a bug, outage or repeated mistake into a device that makes the whole class impossible.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
clean-code
rainmanjam
Software quality review and design guidance for any code: naming, cohesion, coupling, duplication, function size, dependency direction, and testability.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
authz
rainmanjam
Multi-tenant isolation, IDOR and row-level security.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
data
rainmanjam
Pipelines, warehouses, dbt models and metrics, where failure is silently wrong numbers rather than a crash.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
design
rainmanjam
Design APIs, schemas, types and state machines so misuse cannot be expressed.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
guardrails
rainmanjam
Pre-commit hooks, CI gates, lint rules, database constraints and branch protection.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
llm
rainmanjam
AI features you ship to users: structured output, tool schemas, prompt injection, evals.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
ops
rainmanjam
Deploys, schema migrations, rollback and infrastructure.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
ux
rainmanjam
Forms, destructive actions and flows users get wrong.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
defensive
rainmanjam
Defensive programming for any code: validating inputs at every boundary, checking for null and absent values, supplying safe fallbacks, catching and logging…
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
agent-guardrails
rainmanjam
Stop an AI agent damaging your repo: PreToolUse hooks, permission deny rules, protected paths, verification gates.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
audit
rainmanjam
Find footguns in code that already exists: swappable arguments, silent fallbacks, unguarded deletes, signatures that are easy to misuse.
SkillBFreshness: B★ 24Claude Code +9
Signals
- Stars
- 24
- Forks
- 3
- Open issues
- 0
- Last commit (this folder)
- Aug 23, 2026 (2 months ago)
- Last release
- Aug 25, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/rainmanjam/poka-yoke
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from rainmanjam
- 0.607score
agent-guardrails
rainmanjam
Stop an AI agent damaging your repo: PreToolUse hooks, permission deny rules, protected paths, verification gates.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
authz
rainmanjam
Multi-tenant isolation, IDOR and row-level security.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
clean-code
rainmanjam
Software quality review and design guidance for any code: naming, cohesion, coupling, duplication, function size, dependency direction, and testability.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
defensive
rainmanjam
Defensive programming for any code: validating inputs at every boundary, checking for null and absent values, supplying safe fallbacks, catching and logging…
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
audit
rainmanjam
Find footguns in code that already exists: swappable arguments, silent fallbacks, unguarded deletes, signatures that are easy to misuse.
SkillBFreshness: B★ 24Claude Code +9 - 0.607score
data
rainmanjam
Pipelines, warehouses, dbt models and metrics, where failure is silently wrong numbers rather than a crash.
SkillBFreshness: B★ 24Claude Code +9
Cite this page
poka-yoke skill. Agent Mart. https://agentmart.dev/skills/rainmanjam-poka-yoke (last updated 2026-10-24)