poka-yoke
Was er macht
Poka-yoke ist eine Technik, um Systeme (zum Beispiel Computercode) so zu bauen, dass Fehler gar nicht erst passieren können. Statt vor einem Fehler zu warnen, verhindert sie ihn von vornherein.
Wann du ihn nutzt
- ✓Wenn du eine neue Oberfläche oder ein neues System entwirfst.
- ✓Wenn du alten Code durchsiehst, um Schwachstellen zu finden.
- ✓Wenn du sicherstellen willst, dass Nutzer das System nicht in einen ungültigen Zustand bringen können.
Link zum Skill
https://github.com/github/awesome-copilot/blob/main/skills/poka-yoke/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Wie kann ich dieses Formular so bauen, dass es nicht abgeschickt werden kann, wenn Angaben fehlen?”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Sie funktioniert, indem Regeln oder Strukturen geschaffen werden, die falsche Aktionen praktisch unmöglich machen. Stell dir ein USB-Kabel vor, das nur auf eine Weise passt: Du kannst es nicht falsch herum einstecken.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Poka-Yoke: Make the Mistake Unsayable
People will always make mistakes. That is not the problem worth solving. The problem is letting a mistake become a defect.
Shigeo Shingo, a Japanese industrial engineer, worked this out on a switch assembly line in 1961. Workers kept forgetting a spring. The fix was not a reminder: the job was split so the worker first laid both springs in a dish, then fitted them from the dish. A spring left over was the error announcing itself, before the unit could move on.
The dish is a device. "Please remember the spring" is not.
The line that does most of the work
A comment, a docstring, a wiki page, a review checklist, or a line in an instructions file saying "don't do X" is not a poka-yoke. It is training, and training degrades. A device does not. If your fix relies on someone remembering something, keep going.
This applies to your own instructions too. A rule written into a config file competes for attention with every other rule there and loses a little more as the file grows. A check that fails the build does not.
What this changes about the output
Given a design, models will readily list what to fix. They rarely state what the fix makes impossible, and that is the difference between advice you agree with and a constraint you can rely on. That habit is most of what this skill is for.
The other half is refusing to accept a non-device as a fix. "Add validation", "be careful with this function", "document the invariant" are all rung zero. Each has a real device behind it, and naming that device is the work.
Axis 1: what happens when the mistake occurs
Rank every finding on this ladder, and say which rung the current code sits on and which rung your fix reaches.
| Rung | Name | Meaning |
|---|---|---|
| 1 | Control | The wrong action cannot be performed. Type error, database constraint, missing permission. |
| 2 | Warning | It is possible, but announces itself as it happens. A linter, a runtime assertion, a confirmation you cannot skip. |
| 3 | Detection | It happens, and you find out afterwards. Tests, logging, monitoring, code review. |
| 0 | rung zero | Telling people to be careful. Docs, comments, "please remember to". |
Detection is not failure; sometimes it is all that is available. But a plan that stops at Detection should say so, rather than presenting it as prevention.
Axis 2: how the device notices
Shingo's three inspection lenses. They are a checklist for finding hazards, not decoration:
- Contact — can the wrong thing physically fit? Two adjacent parameters of the same type can be swapped silently. A
stringthat should be one of four values. Money as a float. - Fixed-value — is the set complete? A switch with no exhaustiveness check. A config where a missing key silently means "off". An enum handled in three of five places.
- Motion-step — is the order right, and did every step happen? A two-phase write with no transaction. A retry with no idempotency key. A resource acquired on one path and released on another.
Inspect at the source
The cheapest place to catch a mistake is where it is made, not where it surfaces. A validation that runs three layers below the input has already let the bad value travel, and the stack trace will point at the wrong module. Push the check to the boundary the value crosses.
Designing something new
Mistake-proofing is cheapest before the code has callers. Once it has them, every device is a migration; before it has them, a device is free.
Work from the call site. A signature that reads fine in isolation often reads terribly where it is used:
# the mistake is expressible: nothing stops refunding an order that was never paid
def refund(order: dict) -> Refund:
return payments.refund(order["payment_id"])
# the mistake is no longer expressible
def refund(order: PaidOrder) -> Refund: ...
The moves, roughly in order of how often they apply:
Make invalid states unrepresentable. A bag of optional fields where only certain combinations are legal becomes a discriminated union where the illegal ones cannot be constructed.
Parse, don't validate. Convert unstructured input into a type that carries proof at the boundary, once, rather than re-checking the same string in nine places.
Distinguish concepts that share a primitive. transfer(from: str, to: str) accepts its
…
Häufige Fragen
Was ist der Unterschied zwischen einer Warnung und einem Poka-yoke?
Eine Warnung sagt: „Pass auf, hier könnte etwas schiefgehen.“ Ein Poka-yoke verhindert dagegen, dass du etwas falsch machst, so wie ein Kabel, das nur auf eine Weise passt.
Warum ist es besser, Fehler zu verhindern, als vor ihnen zu warnen?
Menschen vergessen Warnungen oder überlesen sie. Ein fehlersicheres System sorgt dafür, dass der Fehler nicht passiert, egal wie aufmerksam die Person gerade ist.
Gilt das nur für Computercode?
Nein, die ursprüngliche Idee stammt aus der Industrie, wo Fertigungsfehler vermieden werden sollten. Das Konzept lässt sich aber auf jedes System anwenden, in dem Fehler passieren können.
Details
Originalbeschreibung des Autors
Mistake-proof code so misuse cannot be expressed, rather than warning against it. Use when designing an interface, schema, or state machine and the user wants it hard to get wrong ("make invalid states unrepresentable", "so callers cannot screw it up", "type-safe API", "pit of success"); when auditing existing code for footguns ("what could bite us here", "what is easy to misuse", "poka-yoke this
repo: github/awesome-copilot
Beliebtheit
- GitHub-Sterne
- 40k
- Platz im Ranking
- #7330
- Lizenz
- MIT
- Aktualisiert
- 15.10.2026
Kommentare
- …
Weitere Skills aus diesem Repository
acquire-codebase-knowledge
40kHilft deinem Agenten, ein bestehendes Code-Projekt zu verstehen und zu dokumentieren. Nützlich, um neue Teammitglieder einzuarbeiten oder die Architektur zu überblicken.
acreadiness-assess
40kErmöglicht deinem Agenten, die KI-Tauglichkeit eines Projekts zu prüfen und einen Bericht zu erstellen. So siehst du, wie gut das Projekt auf KI-Tools vorbereitet ist.
acreadiness-generate-instructions
40kHilft deinem Agenten, auf Basis einer Prüfung Anweisungen für KI-Tools zu erstellen. So arbeitet die KI besser mit dem Code und erkannte Lücken werden geschlossen.
acreadiness-policy
40kErmöglicht deinem Agenten, Richtlinien für die Bewertung von KI-Projekten festzulegen oder anzuwenden. So werden Projekte einheitlich geprüft und Vorgaben eingehalten.
Ähnliche Skills
diffs
394kLässt deinen Agenten einen echten, teilbaren Diff seiner Änderungen als Viewer-Link oder Bilddatei erstellen, statt einer handgeschriebenen Zusammenfassung.
coding-agent
394kHilft deinem Agenten, eine größere Programmieraufgabe als Hintergrund-Worker an Codex, Claude Code oder OpenCode zu übergeben und danach den Fortschritt zu prüfen.
gh-issues
394kHilft deinem Agenten, GitHub-Issues zu finden, die zu bearbeitenden auszuwählen und Pull Requests mit Korrekturen zu öffnen, einschließlich der Nacharbeit an Review-Kommentaren.