.pi/agent/skills/quint-spec/SKILL.md
Quint specification language reference for writing formal specs in plans. Use when a TODO needs a behavioral specification: state transitions, invariants, concurrency constraints. Write Quint modules to describe WHAT the system must do, not HOW to implement it.
npx skillsauth add popoffvg/dotfiles quint-specInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Quint is a typed specification language for describing system behavior formally. Use it in plan TODOs to specify state machines, invariants, and edge cases that pseudocode cannot express precisely.
Reference: https://quint-lang.org/docs/lang
When NOT to use Quint:
// Basic types
bool, int, str
// Collections
Set[int], List[str], Map[str, int]
// Tuples and records
(int, str)
{ name: str, age: int }
// Sum types (tagged unions)
type Status = Pending | Active(int) | Failed(str)
// Type aliases
type UserId = int
type TokenStore = Map[str, { userId: UserId, expiresAt: int }]
module Example {
// Constants — fixed for a given system instance
const MAX_RETRIES: int
const TIMEOUT: int
// State variables — change over time
var counter: int
var status: Status
// Pure functions — no state dependency
pure def clamp(x: int, lo: int, hi: int): int =
if (x < lo) lo else if (x > hi) hi else x
// State-dependent values
val isActive = status == Active
// Actions — state transitions (delayed assignment with ')
action init = all {
counter' = 0,
status' = Pending,
}
action increment = all {
counter < MAX_RETRIES, // guard: action enabled only when true
counter' = counter + 1,
status' = status, // unchanged
}
// Non-deterministic choice
action next = any {
increment,
reset,
timeout,
}
}
action withdraw(amount: int) = all {
amount > 0, // guard: positive amount
balance >= amount, // guard: sufficient funds
balance' = balance - amount,
}
action receiveRequest = {
nondet userId = oneOf(Users)
nondet amount = oneOf(1.to(MAX_AMOUNT))
processRequest(userId, amount)
}
// State invariant
val balanceNonNegative = balance >= 0
// Temporal: always true across all states
temporal safetyProperty = always(balanceNonNegative)
run happyPath =
init
.then(deposit(100))
.then(withdraw(50))
.expect(balance == 50)
run overdraftBlocked =
init
.then(deposit(10))
.then(withdraw(20))
.fail() // withdraw should be disabled
// Sets
Set(1, 2, 3)
S.contains(e) // membership
S.union(T) // S ∪ T
S.exists(x => P) // ∃ x ∈ S: P
S.forall(x => P) // ∀ x ∈ S: P
S.filter(x => P) // { x ∈ S | P }
S.map(x => e) // { e | x ∈ S }
S.fold(init, (acc, x => e))
S.size()
// Maps
Map("a" -> 1, "b" -> 2)
m.get(key) // lookup
m.keys() // domain
m.set(key, val) // update (returns new map)
m.put(key, val) // add entry
S.mapBy(x => e) // { x ↦ e | x ∈ S }
// Lists
[1, 2, 3]
l.head() // first element
l.tail() // all but first
l.append(e) // add to end
l.length()
l.foldl(init, (acc, x => e))
l[i] // 0-indexed access
// Records
{ name: "alice", age: 30 }
r.name // field access
r.with("name", "bob") // update field
When writing a Quint spec inside a TODO, keep it focused:
The spec is a contract: the implementer must satisfy the invariants and the runs must pass against the implementation logic.
Eval checklist:
Test inputs:
Can change: Quint examples, guard/invariant templates, selection criteria, run patterns Cannot change: WHAT-not-HOW principle, formal spec focus, skip criteria for simple workflows Min sessions before eval: 5 Runs per experiment: 3
testing
Use when the user asks to create test sets, enumerate scenarios, generate edge cases, or draft a coverage matrix before implementation.
testing
Use when the user asks to review, audit, score, or validate test sets for missed cases before execution or merge.
tools
Test harness plugins in isolation using tmux panes. Runs MCP servers, unit tests, typecheck, and Claude plugin loading. Use when user says "test plugin", "check plugin", "run plugin tests", "validate plugin", or names a specific plugin to test.
development
Guide for designing integration and e2e tests using BDD (Behavior-Driven Development) methodology with Cucumber-style Given/When/Then scenarios. Use when writing or reviewing tests for any service, API, or component. Language-agnostic — covers scenario structure, step notation, assertion principles, async patterns, and common anti-patterns.