본문으로 건너뛰기
Skillpedia
일반 코딩40k · #7330

poka-yoke

하는 일

포카요케(poka-yoke)는 실수를 불가능하게 만드는 시스템(예: 컴퓨터 코드)을 만드는 기법입니다. 오류를 경고하는 대신, 오류가 일어나지 않도록 막습니다.

사용하는 경우

  • ✓새 인터페이스나 시스템을 설계할 때.
  • ✓오래된 코드를 검토해 실패 지점을 찾을 때.
  • ✓사용자가 시스템을 잘못된 상태로 만들 수 없게 하고 싶을 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/poka-yoke/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/poka-yoke/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“정보가 빠지면 제출할 수 없도록 이 양식을 만들려면 어떻게 해야 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

잘못된 동작을 물리적으로 막는 규칙이나 구조를 만들어 작동합니다. 한 방향으로만 들어가는 USB 케이블을 생각해 보세요. 잘못 꽂을 수가 없습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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 string that 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

…

자주 묻는 질문

경고와 포카요케의 차이는 무엇인가요?

경고는 '조심하세요, 잘못될 수 있습니다'라고 말합니다. 포카요케는 한 방향으로만 맞는 케이블처럼 잘못된 행동을 물리적으로 막습니다.

오류를 경고하기보다 예방하는 것이 왜 더 나은가요?

사람은 경고를 잊거나 무시합니다. 오류가 나지 않는 시스템은 사람이 얼마나 주의하는지와 상관없이 실수가 일어나지 않도록 보장합니다.

이것은 컴퓨터 코드에만 쓰이나요?

아니요. 이 개념은 제조 오류를 막기 위한 산업공학에서 나왔지만, 실수가 일어날 수 있는 모든 시스템에 적용할 수 있습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
40k
순위
#7330
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬