skills/council/prover/formal-spec/SKILL.md
Use when writing formal specifications in TLA+ to verify system properties, defining state variables, configuring TLC model checker, and documenting assumptions and limitations. Covers safety and liveness properties for protocols and concurrent systems. Do not use for security claim enumeration without specification intent (use invariant-analysis).
npx skillsauth add dtsong/my-claude-setup formal-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.
Extract properties from a system design, define state variables, write TLA+ specifications, identify invariants, configure the TLC model checker, and document assumptions and limitations.
Reads system designs, protocol descriptions, and existing specifications. Produces TLA+ specification files as output. Does not execute model checkers or modify implementation code.
No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.
Translate informal requirements into candidate formal properties:
Define the formal state space:
Produce a TLA+ module:
Define the key invariants to check:
Set up TLC model checking configuration:
Explicitly state:
Compaction resilience: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being analyzed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.
| ID | Property | Type | TLA+ Expression | Status |
|----|----------|------|-----------------|--------|
| S1 | Mutual exclusion | Safety | MutualExclusion == \A p1, p2 \in Procs: ... | Verified (N<=5) |
| L1 | Starvation freedom | Liveness | \A p \in Procs: []<>(state[p] = "done") | Requires fairness |
| ... | ... | ... | ... | ... |
---- MODULE [Name] ----
EXTENDS Integers, Sequences, FiniteSets, TLC
CONSTANTS NUM_PROCS
VARIABLES state, shared
vars == <<state, shared>>
TypeInvariant == ...
Init == ...
Action1(p) == ...
Next == \E p \in 1..NUM_PROCS: Action1(p) \/ ...
Spec == Init /\ [][Next]_vars /\ Fairness
====
development
Use when planning implementation steps, deciding commit format, or structuring development approach. Provides brainstorm-plan-implement flow with conventional commits. Triggers on 'how should I approach this', 'commit format'.
development
Security audit checklist for web applications. Use when reviewing, auditing, or hardening a web app's security posture. Covers rate limiting, auth headers, IP blocking, CORS, security middleware, input validation, file upload limits, ORM usage, and password hashing. Triggers on requests like "review security", "harden this app", "security audit", "check for vulnerabilities", or when building/reviewing API endpoints.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.