poka-yoke-patterns

seanchatmangpt's avatarfrom seanchatmangpt

Master Poka-Yoke error-proofing from Toyota Production System. Design systems that prevent mistakes through structure, not vigilance. Covers: path protection, FMEA analysis, quality gates, andon signals, timeout enforcement, type-safe designs. When designing systems, preventing defects, implementing safety mechanisms, or analyzing failure modes.

⭐1stars🔀1forks📁View on GitHub🕐Updated Jan 8, 2026

When & Why to Use This Skill

This Claude skill integrates Poka-Yoke error-proofing principles from the Toyota Production System into the software development lifecycle. It enables the design of systems that inherently prevent defects through structural constraints, type-safe architectures, and automated quality gates, shifting the focus from human vigilance to systemic reliability and robust error management.

Use Cases

  • System Architecture: Designing type-safe systems that make invalid states unrepresentable using patterns like NewType and Result types.
  • Risk Mitigation: Conducting FMEA (Failure Mode and Effects Analysis) to proactively identify potential failure modes and implement structural safety mechanisms.
  • CI/CD Optimization: Implementing automated quality gates, such as pre-commit hooks and strict compiler checks, to prevent defective code from reaching production.
  • Operational Monitoring: Setting up 'Andon signals' and timeout enforcements to ensure immediate detection and recovery from system hangs or failures.
namepoka-yoke-patterns
description"Master Poka-Yoke error-proofing from Toyota Production System. Design systems that prevent mistakes through structure, not vigilance."
allowed_tools"Read, Write, Edit, Bash(cargo make:*)"

Poka-Yoke Patterns

What is Poka-Yoke?

Poka-Yoke (ポカ・ヨケ): Japanese for "mistake-proofing"

Design systems so mistakes become impossible or immediately obvious.

Three Types

1. Prevent (Make mistakes impossible)

  • Type system constraints (NewType patterns)
  • Compiler verification (Result<T,E>)
  • Zero unwrap/expect in production code

2. Detect (Catch mistakes immediately)

  • Andon signals (RED/YELLOW/GREEN)
  • Quality gates (pre-commit hooks)
  • SLO timeouts (prevent hanging)

3. Recover (Minimize damage)

  • Graceful degradation
  • Automatic rollback
  • Clear error messages

In ggen

  • Cargo Make Only: Prevents bypassing quality gates
  • Result<T,E>: Compiler enforces error handling
  • Clippy -D warnings: Zero tolerance for warnings
  • SHACL Validation: Prevents invalid specifications

Reference

See CLAUDE.md sections:

  • Constitutional Rules (Poka-Yoke)
  • Holographic Factory Metaphor (Quality Gates)