formal-spec-extract-properties
Extracts and classifies verifiable properties from formal logic specifications for automated testing and analysis.
Install
mkdir -p .claude/skills/formal-spec-extract-properties && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16916" && unzip -o skill.zip -d .claude/skills/formal-spec-extract-properties && rm skill.zipInstalls to .claude/skills/formal-spec-extract-properties
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Extract properties from a formal spec (TLA+/Lean/ProVerif) into AutoSpec's structured format. Classifies each property with id, statement, essence, and type. Works on formal-spec output or any existing formal spec.Key capabilities
- →Parse properties from TLA+, Lean, or ProVerif formal specs
- →Extract invariants, theorems, and queries from formal specs
- →Assign unique IDs, statements, and formal definitions to properties
- →Classify property types as safety, liveness, or security
- →Write plain-language essences for each property
- →Present extracted properties for user review and correction
How it works
The skill parses a formal specification file, extracts verifiable properties, classifies them by type, and generates a plain-language essence for each. It then presents these for user review before outputting a structured JSON file.
Inputs & outputs
When to use formal-spec-extract-properties
- →Extract invariants from TLA+ specs
- →Convert ProVerif queries for analysis
- →Classify formal theorems for verification
About this skill
Property Extraction
Takes a formal spec and produces a structured properties file for AutoSpec consumption.
Input
- Path to a formal spec (TLA+, Lean, or ProVerif)
- Optional: the mapping table from formal-spec (if this follows a formal-spec run)
- Optional: the English spec or code reference that the formal spec was derived from
Process
Step 1: Parse properties
Extract all verifiable properties from the spec:
- TLA+: everything declared as
INVARIANT,PROPERTY,THEOREM, or used in aSPECIFICATIONblock. Also standalone predicates that look like invariants (e.g.TypeOK,Agreement == \A r1, r2 ...). - Lean: all
theoremandlemmadeclarations. - ProVerif: all
querydeclarations (secrecy, correspondence, reachability).
For each property, extract:
id: assign P1, P2, ... in order of appearancestatement: the formal name (e.g. "Agreement", "TypeOK", "secrecy_key")formal_definition: the actual formal expression (the TLA+ predicate body, the Lean type, the ProVerif query)
Step 2: Classify type
For each property, determine its type:
| Type | Criteria |
|---|---|
| safety | "bad thing never happens". invariants, state predicates, \A quantified over states |
| liveness | "good thing eventually happens". temporal operators (eventually, leads-to), fairness |
| security | secrecy, authentication, non-forgery, non-equivocation. ProVerif queries, or TLA+ properties about signatures/keys/attestation |
If ambiguous, default to safety and flag for user review.
Step 3: Write essence
For each property, write a plain-language essence: what the property protects, stated as an intent, not a restatement of the formal definition.
Good essence: "no two replicas ever decide on different values" Bad essence: "for all r1, r2 in Replicas, decided[r1] != None and decided[r2] != None implies decided[r1] = decided[r2]"
The essence is what must survive even if the formal statement changes during AutoSpec optimization.
If a mapping table is provided (from formal-spec), use the English requirement as the basis for the essence. If an English spec is provided, trace each property back to its English requirement.
If neither is available, derive the essence from the formal definition. Flag these as "essence derived from formal definition, user should verify".
Step 4: User review
Present the extracted properties to the user in a table:
| id | statement | type | essence |
|----|-----------|------|---------|
| P1 | Agreement | safety | no two replicas ever decide on different values |
| P2 | ... | ... | ... |
Ask the user:
- Are any essences wrong or incomplete?
- Are any properties missing that should be tracked?
- Are any properties listed that should NOT be preserved (e.g. TypeOK is often just a sanity check, not a meaningful property)?
- Should any properties be merged (e.g. two properties that protect the same underlying guarantee)?
Apply corrections before writing the output.
Output
Write to <spec_name>_props.json:
[
{
"id": "P1",
"statement": "Agreement",
"essence": "no two replicas ever decide on different values",
"type": "safety",
"formal_definition": "\\A r1, r2 \\in Replicas : ...",
"source": "english_spec | mapping_table | derived",
"user_verified": true
}
]
Also print the autospec invocation command:
autospec <spec_path> --properties <spec_name>_props.json --trust-model <trust_model_path>
Invocation
formal-spec-extract-properties <spec_path>formal-spec-extract-properties <spec_path> --mapping <mapping_table_path>formal-spec-extract-properties <spec_path> --english <english_spec_path>
When not to use it
- →When the input is not a formal specification in TLA+, Lean, or ProVerif format
Limitations
- →The skill supports TLA+, Lean, or ProVerif formal specs.
- →The skill defaults to safety if property type is ambiguous.
- →The skill requires user verification for essences derived from formal definitions.
How it compares
This skill automates the extraction and classification of properties from formal specifications into a structured format for AutoSpec, including user review, which differs from manual analysis or general text parsing.
Compared to similar skills
formal-spec-extract-properties side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| formal-spec-extract-properties (this skill) | 0 | 5mo | No flags | Advanced |
| windows-ui-automation | 17 | 8mo | Review | Advanced |
| qa-tester | 29 | 9mo | No flags | Intermediate |
| reviewing-code | 21 | 9mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
windows-ui-automation
martinholovsky
Expert in Windows UI Automation (UIA) and Win32 APIs for desktop automation. Specializes in accessible, secure automation of Windows applications including element discovery, input simulation, and process interaction. HIGH-RISK skill requiring strict security controls for system access.
qa-tester
svilupp
Browser automation QA testing skill. Systematically tests web applications for functionality, security, and usability issues. Reports findings by severity (CRITICAL/HIGH/MEDIUM/LOW) with immediate alerts for critical failures.
reviewing-code
CaptainCrouton89
Systematically evaluate code changes for security, correctness, performance, and spec alignment. Use when reviewing PRs, assessing code quality, or verifying implementation against requirements.
web3-testing
wshobson
Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.
zod-4
prowler-cloud
Zod 4 schema validation patterns. Trigger: When creating or updating Zod v4 schemas for validation/parsing (forms, request payloads, adapters), including v3 -> v4 migration patterns.
pr-review
pytorch
Review PyTorch pull requests for code quality, test coverage, security, and backward compatibility. Use when reviewing PRs, when asked to review code changes, or when the user mentions "review PR", "code review", or "check this PR".