poka-yoke
Skill by github
Poka-Yoke makes code hard to misuse by designing mistakes out of it, instead of warning against them. It suits developers designing interfaces, schemas or state machines, and auditing code for footguns in money, auth, deletion and migrations.
Install poka-yoke
Built from the published package, never by AI.
git clone --depth 1 https://github.com/github/awesome-copilot /tmp/awesome-copilot && mkdir -p ~/.claude/skills && cp -r /tmp/awesome-copilot/skills/poka-yoke ~/.claude/skills/poka-yokeRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/github/awesome-copilot /tmp/awesome-copilot && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/awesome-copilot/skills/poka-yoke ~/.gemini/antigravity-cli/skills/poka-yokeAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
Poka-Yoke is a skill that guides an AI assistant to make misuse of code impossible rather than relying on comments, docs or reminders. It ranks each finding by what happens when a mistake occurs (control, warning, detection or rung zero) and by how the device notices it, using contact, fixed-value and motion-step lenses. It includes a bundled Python scanner, detect_hazards.py, that checks a tree, staged files or a diff for risky code shapes.
The skill is written for developers who want interfaces, schemas and state machines that are hard to get wrong, and for teams auditing existing code. It also covers reviewing a bug for its class after an incident. The scanner needs Python 3.9+ and no third-party packages.
Written from the project's SKILL.md and checked against it.
What it can do
- Hazard scanningRuns detect_hazards.py across a whole tree, staged files or a diff, with an optional severity filter.
- JSON output for CIThe scanner's --json mode supports CI, where it exits non-zero when findings exist.
- Design guidanceShows how to make invalid states unrepresentable, parse input at the boundary and encode call order.
- Codebase auditRanks existing code findings by blast radius times ease of the mistake, anchored to lines.
- Incident analysisSeparates defect, mistake and hazard after a failure, then sweeps for the same shape elsewhere.
- Language referencesIncludes a hazard catalog and patterns for Python, TypeScript, and Rust and Go.
What you need
- Python 3.9+ to run the bundled scanner
Try asking
- Make invalid states unrepresentable in this order model
- Audit this repo for footguns in our payment code
- Review this diff for ways to get it wrong
Good to know
- The scanner reports only textually detectable shapes, so other hazards need reading by hand.
- A pre-commit hook can be skipped with --no-verify, so CI is needed as a real gate.
- The benchmark measured first-turn responses, not behaviour across a long working session.
- The method made responses somewhat worse at spotting a specific defect already on the page.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/poka-yoke/SKILL.md, skills/poka-yoke/scripts/detect_hazards.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md11 KB -
references/hazard-catalog.md20 KB -
references/lang-python.md7 KB -
references/lang-rust-go.md8 KB -
references/lang-typescript.md6 KB
Show all 6 files
-
scripts/detect_hazards.py26 KB
Alternatives to poka-yoke
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
poka-yoke: common questions
What is a poka-yoke in software?
The skill describes it as a device that stops a mistake from becoming a defect, such as a type, database constraint or permission check. A comment or reminder does not count as one.
Does the scanner work in CI or pre-commit?
The source says it has no dependencies, so it can run in CI and in a pre-commit hook without an install step. It exits non-zero on findings in --diff mode.
When should I use this instead of a code reviewer?
The source says to use a reviewer to find a bug already on the page, and this skill to make that class of bug no longer expressible.
How do I install poka-yoke?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is poka-yoke free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is poka-yoke safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to poka-yoke?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
