skills/council/prover/invariant-analysis/SKILL.md
Use when enumerating security claims from a design, formalizing them as invariants, checking for hidden assumptions, and assessing verification feasibility. Covers safety invariants, temporal properties, and verification tool recommendations. Do not use for writing TLA+ specifications directly (use formal-spec) or implementation-level security review.
npx skillsauth add dtsong/my-claude-setup invariant-analysisInstall 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.
Enumerate security claims made by a design, formalize them as invariants, check for hidden assumptions, assess verification feasibility, and propose a specification approach for proving or disproving the claims.
Reads system designs, security documentation, and existing formal specifications. Does not modify implementation code or execute verification tools. Does not access production systems for testing.
No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.
Extract all security claims from the design, whether explicit or implicit:
For each security claim, produce a formal invariant:
For each invariant, enumerate the assumptions required for it to hold:
For each invariant, evaluate whether formal verification is practical:
Recommend a verification strategy for the highest-priority invariants:
Compaction resilience: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being analyzed, then resume from the earliest incomplete step.
| ID | Claim | Type | Source | Formalized | Assumptions |
|----|-------|------|--------|------------|-------------|
| I1 | "No unauthorized memory access" | Safety | Design doc 3.2 | \A p: access[p] => authorized[p] | MMU enabled, no HW bugs |
| I2 | "All requests eventually complete" | Liveness | Implicit | \A r: []<>(status[r] = "done") | Fair scheduling, no deadlock |
| ... | ... | ... | ... | ... | ... |
| Invariant | Assumption | Category | Verifiable? | Risk if Violated | |-----------|-----------|----------|-------------|------------------| | I1 | MMU correctly configured | Implementation | Yes — audit kernel config | Critical — full bypass | | I2 | No circular wait | Design | Yes — deadlock analysis | High — livelock | | ... | ... | ... | ... | ... |
| Invariant | State Space | Tool | Approach | Effort | Confidence | |-----------|------------|------|----------|--------|------------| | I1 | ~10^6 (bounded) | TLC | Model checking, N<=4 | 3 days | High (bounded) | | I2 | Infinite | — | Runtime monitoring | 1 day | Medium | | ... | ... | ... | ... | ... | ... |
development
Use when the council needs to surface organizational knowledge buried across multiple internal sources (wikis, design docs, ADRs, past tickets, postmortems, chat archives, code repos). Plans where to look, what to cross-reference, and how to synthesize findings into evidence the council can act on. Do not use for external market research (use competitive-analysis), library evaluation (use library-evaluation), or technology trend assessment (use technology-radar).
testing
Use to convert a Word .docx file to PDF and/or verify its page count. Triggers on: converting docx to pdf, rendering a document, checking how many pages a docx produces, or asserting a page-count constraint (e.g. a resume must stay 2 pages). Wraps LibreOffice headless conversion.
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
Interactive wizard to craft effective prompts using Claude Code best practices