skills/formal-verify/SKILL.md
Continuous formal verification of architectural constraints and code quality. Use when asked to verify, audit, or validate codebase integrity. Runs automatically via hooks on every edit (structural) and pre-commit (full). Catches ownership violations, boundary crossings, state machine bugs, and code smells that grep ratchets miss. Triggers: "verify", "formal verify", "check architecture", "audit code quality", "run verification", "/verify", "/verify --bootstrap", "/verify --grade".
npx skillsauth add petekp/claude-code-setup formal-verifyInstall 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.
Use this skill when architectural intent matters more than "it compiles."
This skill runs a three-layer verification loop:
The layers are intentionally tiered:
/verify: all three layersBootstrap a target project with:
/verify --bootstrap
Bootstrap runs four phases:
.verifier//verify
Runs all layers in verbose mode and prints a unified report./verify --bootstrap
Installs dependencies, creates .verifier/, and scaffolds the first rule set./verify --evolve
Checks for drift between architectural docs and existing verification specs./verify --grade
Runs Layer 3 only and reports the current elegance grade.The runner extracts facts from Rust and Swift source files, then checks
structural.yaml rules such as:
Structural checks are the default PostToolUse hook because they are the fastest.
Behavioral verification covers state transitions and protocol contracts:
Use this layer at slice checkpoints, before risky merges, and whenever a change touches coordination logic or cross-language contracts.
Elegance auditing scores code for:
It produces a grade and line-level deductions so the agent can clean up code, not just make it technically correct.
When a violation is found, tailor the output to the audience:
If the agent fails to resolve the same violation three times, stop the fix loop and escalate with:
Bootstrap creates and maintains:
.verifier/
├── structural.yaml
├── elegance.yaml
├── specs/
├── facts/
└── reports/
structural.yaml stores declarative Layer 1 ruleselegance.yaml stores thresholds and grade policyspecs/ stores Z3Py and TLA+ behavioral specsfacts/ caches extracted AST factsreports/ stores the most recent verification outputsfacts/ and reports/ should be gitignored in the target project.
/verify before claiming a migration is complete./verify --grade when the code is correct but still feels rough.SKILL.md focused on orchestration; pull detailed mechanics from the
references below.@references/layer1-structural.md
Fact extraction, Z3 encoding, reachability, and incremental invalidation.@references/layer2-behavioral.md
When to use TLA+/Apalache versus Z3Py, plus spec execution contracts.@references/layer3-elegance.md
Metric families, grading, thresholds, and the Layer 3 sub-module layout.@references/constraint-yaml-spec.md
Structural rule schema, selectors, assertions, and fact pattern operators.@references/bootstrap-process.md
The install, discover, interview, validate bootstrap workflow.@references/agent-feedback-loop.md
Hook integration, violation injection, retries, and escalation policy.@references/spec-authoring-guide.md
Translating plain-English architectural intent into formal specs.development
Draft short, plainspoken notes in the author's voice that help reviewers understand non-obvious choices, boundaries, and preserved behavior in the author's own pull request or local diff. Use when the user asks to self-review, annotate, or add reviewer context to their PR or changes. Draft locally when no PR exists, and post approved notes as one GitHub review when a PR does exist. Do not use for reviewing someone else's PR, writing code comments, explaining code generally, or drafting a PR description. Never post without explicit approval.
tools
Design and build pure-CSS (zero-JavaScript) Tailwind CSS v4 plugins of unusual depth and craft. Use when the user wants to create, architect, or refine a Tailwind utility plugin or CSS effect — e.g. "make a tailwind plugin", "build a tw-* plugin", "a CSS-only shimmer/fade/glow/grain/noise utility", "tailwind v4 @utility", "package this effect as a plugin", or wants an effect with surprising visual depth (gradients, masks, filters, SVG filter tricks, scroll-driven animation). Pairs deep CSS/SVG technique research with a bespoke tuning workbench for dialing the effect in. Inspired by tw-fade and tw-shimmer.
content-media
Create clear, polished before-and-after screenshots for a GitHub pull request. Use when a UI change needs visual proof: capture matching states, crop to the relevant UI, stitch and caption one comparison image, attach it natively to the PR, and keep the image out of the repository.
testing
--- name: latent-potential description: First-principles, team-of-experts assessment of a software project that surfaces latent potential; underexploited assets, a sharper north star, missing high-leverage capabilities, better framing and messaging. Produces a prioritized, evidence-grounded report with cheap probes, a reframe candidate, a stop-doing list, and an honest skeptic's case. Use whenever the user wants fresh eyes on a project they have built: "what am I sitting on", "what could this be