formal-spec-generator

formal-spec-generator is a skill for Claude Code, Codex from ArabelaTso/Skills-4-SE. It costs 119 tokens per session (1,281 once invoked), scanned A, original, Apache-2.0.

A tool that turns informal requirements, source code, pseudocode, or mathematical descriptions into formal specifications for Isabelle/HOL or Coq. These specifications define rules such as data properties and conditions before and after a function runs.

In plain words
What is it for?
Use it to describe algorithms, data structures, function contracts, predicates, and invariants in Isabelle/HOL or Coq.
Why use it?
It helps make an algorithm's expected behavior precise enough to check with a formal proof system.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to describe algorithms, data structures, function contracts, predicates, and invariants in Isabelle/HOL or Coq.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arabelatso/skills-4-se/formal-spec-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ArabelaTso/Skills-4-SE --skill formal-spec-generator
Clone the repo
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for formal-spec-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/arabelatso/skills-4-se/formal-spec-generator/github.svg)](https://agentmods.dev/skills/arabelatso/skills-4-se/formal-spec-generator)
Your own site
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/formal-spec-generator"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/formal-spec-generator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for formal-spec-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/formal-spec-generator"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/formal-spec-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 119 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,281 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00119 $0.01281
Opus 5 $0.00060 $0.00641
Sonnet 5 $0.00024 $0.00256
Haiku 4.5 $0.00012 $0.00128

Measured 9d ago against content hash 4273f85a6897, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

formal-spec-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/formal-spec-generator/SKILL.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Formal Specification Generator

Generate formal specifications in Isabelle/HOL or Coq from informal descriptions, source code, or mathematical statements.

Workflow

1. Understand the Input

Identify what type of input is provided:

  • Informal requirements: Natural language descriptions (e.g., "a function that sorts a list")
  • Source code: Existing implementations in Python, C, Java, or other languages
  • Pseudocode: Algorithmic descriptions with semi-formal structure
  • Mathematical definitions: Properties or theorems to formalize

2. Choose Target System

Ask the user which formal proof assistant to target:

  • Isabelle/HOL: Preferred for higher-order logic, functional programming style
  • Coq: Preferred for constructive logic, dependent types, proof automation
  • Both: Generate specifications in both systems when requested

If not specified, default to generating both versions.

3. Identify Specification Components

Determine what needs to be formalized:

  • Function definitions: Type signatures and implementations
  • Data types: Algebraic data types, records, or inductive types
  • Predicates: Properties and logical relationships
  • Pre/post-conditions: Function contracts and correctness specifications
  • Invariants: Loop invariants or data structure invariants

4. Generate Formal Specifications

Use the reference files for syntax and patterns:

Generate specifications that include:

  1. Type definitions for data structures
  2. Function definitions with proper types
  3. Predicates describing properties
  4. Correctness specifications relating inputs to outputs
  5. Theorem statements (proofs can be left as sorry in Isabelle or Admitted in Coq)

5. Structure the Output

Organize the generated specifications clearly:

Read the full file on GitHub · 172 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 172 lines · 119 tokens per session scan A 4273f85a6897

Subscribe to this mod's changes

formal-spec-generator is a skill published in the GitHub repository ArabelaTso/Skills-4-SE (252 stars, last pushed 22d ago), licensed Apache-2.0. It adds 119 tokens to every session and 1,281 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

understand-explain

Use when you need a deep-dive explanation of a specific file, function, or module in the codebase.

Egonex-AI/Understand-Anything · 27 tokens

eli5

WHAT: Explains a codebase, a folder, a feature, a command or a pull request to someone who knows nothing about it, as a PR Lens canvas whose walkthrough builds the picture one part at a time. WHEN: /eli5 , or asked to explain code simply, for a beginner, a new hire, a non-engineer, or 'like I'm five'. KEYWORDS: eli5…

coldteadotai/pr-lens · 105 tokens

master-debate

A skill for running an adversarial, multi-round debate between two Buddhist teachers. It is designed for questions where the teachers argue from different positions.

xr843/Master-skill · 127 tokens

master-milarepa

A reference skill for answering questions about Milarepa, a Tibetan Buddhist teacher associated with the Kagyu tradition. It covers retreat, hardship, Mahamudra, inner heat practices, and devotion to a teacher.

xr843/Master-skill · 258 tokens

learning-and-development

Builds capability — skills gaps, career frameworks, training that transfers to the job, and internal mobility. Use this to design a career ladder, close a capability gap, decide whether to build or hire a skill, structure onboarding into a role, or work out why training keeps failing to change anything.

cbrock84/headcount · 64 tokens

team-onboarding-playbook

Design a structured onboarding experience that gets new team members productive in 30, 60, and 90 days. Use when a new hire is joining, when contractors or agency partners need to ramp up, when an existing team is restructuring and members are switching focus, or when current onboarding feels chaotic and slow. Also…

rampstackco/claude-skills · 124 tokens