# Create formal verification skill

> Create formal verification skill is an open-source agent skill for developer tools. Builds a project-local skill that formally verifies the riskiest code paths. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/michael-denyer/pstack-claude/tree/main/plugins/pstack/skills/create-formal-verification-skill
- **Repository:** https://github.com/michael-denyer/pstack-claude
- **GitHub stars:** 5,057
- **License:** MIT
- **Skill name:** create-formal-verification-skill
- **Collection:** https://github.com/michael-denyer/pstack-claude
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill guides an agent to find the part of a repository where a bug would cost the most and ordinary tests reach least, then verify one property of that code. It favors a model checker over a small model of the design when the question is about event ordering, and a verifier that runs on the code itself when the question is about behavior for every input. Where no verifier supports the language, it falls back to generated inputs run against the real code rather than a hand-written model.

The output is a new project-local skill that a later agent can use to check whether a change touches the verified code, run the check, tell a genuine bug from a modeling error, and update the verification when a change is intended. The generated skill records which files and functions each check covers and the commit at which the verification was last confirmed to match the code. The workflow also requires testing the generated skill against a deliberately broken variant of the code to confirm it catches the break, and it treats real counterexamples as findings to report rather than reasons to weaken the property.

## When your agent uses it

> Generate a project-local skill that formally verifies the code where a bug costs the most and tests reach the least, in any language, with whichever verification tool fits. Use for /create-formal-verification-skill, "model-check this race", "prove this invariant", or when concurrency, retries, state machines, parsers, or unsafe code need more than tests.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/create-formal-verification-skill)
- [License: MIT](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/create-formal-verification-skill)

## Features

- **Target selection from code:** Identifies the strongest promise the codebase makes where failures harm users and tests rarely reach.
- **Tool choice by question:** Matches the property to a model checker, a code verifier, or a proof tool, and explains the choice.
- **Generated verification skill:** Writes a project-local skill with frontmatter, coverage records and a sync commit for future agents.
- **Broken-variant testing:** Requires each property to fail on a deliberately broken version of the guarded code before handoff.
- **Scope and assumption notes:** States what the verification covers, under which bounds, and what it leaves out.
- **Counterexample reporting:** Reports real violations in the code's own terms without weakening the property or changing product code.

## Good for

- Model-check a race condition in a concurrent module
- Prove an invariant holds for a data structure
- Verify retry logic or a state machine against its intended behavior
- Check a parser or unsafe code path more rigorously than unit tests allow

## Install

### Claude Code

This skill ships in the `pstack` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claude
```

Or copy only this skill to `~/.claude/skills/create-formal-verification-skill`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/create-formal-verification-skill &&
cp -R "$tmp/plugins/pstack/skills/create-formal-verification-skill" ~/.claude/skills/create-formal-verification-skill &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/create-formal-verification-skill` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/create-formal-verification-skill` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/create-formal-verification-skill &&
cp -R "$tmp/plugins/pstack/skills/create-formal-verification-skill" ~/.agents/skills/create-formal-verification-skill &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/create-formal-verification-skill` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/create-formal-verification-skill` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/create-formal-verification-skill &&
cp -R "$tmp/plugins/pstack/skills/create-formal-verification-skill" ~/.cursor/skills/create-formal-verification-skill &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/create-formal-verification-skill` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/create-formal-verification-skill
```

Or copy the folder to `~/.gemini/skills/create-formal-verification-skill` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/create-formal-verification-skill`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/create-formal-verification-skill &&
cp -R "$tmp/plugins/pstack/skills/create-formal-verification-skill" ~/.copilot/skills/create-formal-verification-skill &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/create-formal-verification-skill` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git
```

Then copy `pstack-claude/plugins/pstack/skills/create-formal-verification-skill` into your agent's skills folder as `create-formal-verification-skill`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Create formal verification skill need to run?

It is a Claude Code plugin skill. Its generated output depends on the target language and the verification tool chosen for the repository, and it asks the user only for facts it cannot observe in the codebase.

### When does Create formal verification skill trigger?

It triggers on the command /create-formal-verification-skill, on requests such as model-check this race or prove this invariant, and when concurrency, retries, state machines, parsers or unsafe code need more than tests.

### Does Create formal verification skill change product code?

No. The skill states that product code is not changed unless the user asks for it. Counterexamples found in the current code are reported as findings.

### Which follow-up skill maintains the output?

After changes that were not rechecked, the skill points users to /maintain-formal-verification-skill to bring the verification back in line with the code.

### How do I install Create formal verification skill in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/create-formal-verification-skill to use it in all your projects, or to .claude/skills/create-formal-verification-skill in one project. Or install the pstack plugin, which includes it: /plugin marketplace add michael-denyer/pstack-claude, then /plugin install pstack@pstack-claude.

### Does Create formal verification skill run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Create formal verification skill?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Create formal verification skill?

The closest alternatives to Create formal verification skill are Maintain formal verification skill, Create verification skill, Maintain verification skill, Principle prove it works and Principle build the lever.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Maintain formal verification skill](https://ai-powered.com/skills/maintain-formal-verification-skill): Maintain formal verification skill is an open-source agent skill for security.
- [Create verification skill](https://ai-powered.com/skills/create-verification-skill): Create verification skill is an open-source agent skill for developer tools.
- [Maintain verification skill](https://ai-powered.com/skills/maintain-verification-skill): Maintain verification skill is an open-source agent skill for developer tools.
- [Principle prove it works](https://ai-powered.com/skills/principle-prove-it-works): Principle prove it works is an open-source agent skill for developer tools.
- [Principle build the lever](https://ai-powered.com/skills/principle-build-the-lever): Principle build the lever is an open-source agent skill for developer tools.
- [Dopamine](https://ai-powered.com/skills/dopamine): Dopamine is an open-source agent skill for developer tools.
- [Blast radius](https://ai-powered.com/skills/blast-radius-michael-denyer): Blast radius is an open-source agent skill for developer tools.
- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/create-formal-verification-skill
