loop-engineering

Formalize natural-language requirements into TLA+ specifications and model-check them into Gherkin acceptance tests.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill loop-engineering-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: loop-engineering
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/loop-engineering
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill loop-engineering-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Concurrent, stateful, and protocol-heavy designs hide interaction bugs that manual testing cannot enumerate. This Skill routes natural-language requirements through a triple feedback loop—EARS structuring, TLA+ exhaustive model checking, and counterexample-to-Gherkin conversion—so design correctness is verified before implementation begins. ## Core Features & Use Cases - Two-question activation gate: Starts only when transitions, ordering, or concurrency exist and the state space can be bounded; otherwise defers to TDD or property-based testing. - Four-phase pipeline: Delegates to loopeng-extract (requirement ledger), loopeng-formalize (EARS to TLA+ spec), loopeng-modelcheck (TLC plus mutation oracle), and loopeng-gherkin (counterexamples to acceptance scenarios). - Compliance review gate: Requires dispatching a loop-engineering-reviewer subagent before claiming the design is verified, checking ledger completeness and artifact hygiene. - Use Case: Designing a connection lifecycle with retries and locks—extract every requirement into a numbered ledger, write a bounded TLA+ spec, let TLC exhaustively check invariants, and convert any counterexample trace into a failing Gherkin scenario. ## Quick Start Ask the AI to verify the design of your stateful protocol or concurrency logic with loop-engineering, providing the requirement text or specification file path.

Frequently Asked Questions about loop-engineering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify a concurrent design with TLA+ before writing code?

Structure requirements with EARS notation, write a bounded TLA+ spec with Init/Next/Invariants, then run TLC to exhaustively check all reachable states. Counterexample traces are converted into Gherkin scenarios that become failing acceptance tests for implementation.

When should I use TLA+ model checking instead of unit tests?

Use TLA+ when the design involves transition intermediate states, ordering, or concurrency—such as locks, queues, retries, or protocol lifecycles—that manual tests cannot enumerate. For plain CRUD or sequential logic, standard TDD or property-based testing is sufficient.

What is the difference between TLA+ model checking and Lean formal verification?

TLA+ verifies that the design itself is correct by exhaustively exploring bounded state spaces. Lean 4 proves that an implementation mathematically satisfies its specification. This Skill handles the TLA+ design side and hands critical implementation pieces to formal-verification.

Why does TLA+ model checking fail on unbounded state spaces?

TLC requires finite state spaces, so counters, unbounded collections, free strings, timestamps, and unlimited retries must be abstracted into small CONSTANT ranges like maximum 3 connections. If the property cannot survive that abstraction, use property-based testing instead.

Can I use this for infrastructure-as-code validation?

Yes, for dynamic IaC aspects like resource lifecycle ordering, parallel apply, state locking, and rollback idempotency. Static checks like naming conventions or required fields belong to terraform validate, tflint, or OPA/Conftest instead.