agentleFS
jtarorehjtaroreh/agystack/skills/create-formal-verification-skill/SKILL.md

create-formal-verification-skill

Skill128 starsChanged 3 days agoMITView on GitHub

Generate and apply formal specification models (TLA+, Alloy, Dafny, or state-machine model checkers) strictly for high-consequence concurrency, distributed consensus, complex state machines, and parsers.

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before authoring a formal specification or model checking harness, evaluate the target system against the gating criteria.

    line 13
  2. Very specific:

    When a target is non-applicable, reject formal verification immediately.

    line 31
  3. Distinctive:

    When a target satisfies the gating criteria, proceed with model authoring:

    line 35

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Formal Verification Skill

Generate project-local formal verification specifications and model checkers for high-consequence algorithms. Formal methods verify invariants mathematically across entire state spaces. They carry high authoring and maintenance costs, so strict gating is mandatory.

Applicability Gating Criteria

Before authoring a formal specification or model checking harness, evaluate the target system against the gating criteria.

Strictly Reserved Targets

Formal verification is strictly reserved for these high-consequence domains:

  1. Concurrency protocols: Multi-threaded synchronization primitives, lockless data structures, and non-blocking algorithms where interleavings defy testing.
  2. Distributed consensus: Raft, Paxos, leader election, quorum replication, and split-brain recovery protocols under network partitions.
  3. Complex state machines: Multi-actor lifecycle transitions with concurrent events, timeout hazards, and asynchronous state resets.
  4. Critical parsers and serializers: Untrusted input decoders, binary serialization boundaries, and cryptographic envelope validators where ambiguity introduces security vulnerabilities.

Reject Non-Applicable Targets

Immediately reject requests to formally verify non-applicable targets:

  • Ordinary CRUD APIs and database mutation endpoints.
  • Standard UI components, view layouts, styling systems, and render loops.
  • Simple linear business logic and sequential request-response handlers.
  • Routine configuration parsers, environment loaders, and CLI option parsing.

When a target is non-applicable, reject formal verification immediately. Redirect to standard automated unit tests, integration harnesses, property-based testing, or verification skills (/create-verification-skill).

Authoring Process for Applicable Targets

When a target satisfies the gating criteria, proceed with model authoring:

  1. Define state and actions. Name state variables and state boundaries. Formulate explicit next-state relations.
  2. Specify safety invariants. State properties that must never be violated (such as mutual exclusion or absence of deadlocks).
  3. Specify liveness properties. State conditions that must eventually occur (such as request fulfillment or eventual consensus).
  4. Run model checker. Model check finite state configurations to exhaustively search for counterexamples.
  5. Map counterexamples to code. Translate any model checker counterexample directly into a reproducible unit test in the target codebase.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.