formal-methods-guide

formal-methods-guide is a skill for Claude Code from kotaroyamame/formal-agent-contracts. It costs 104 tokens per session (1,485 once invoked), scanned A, original, MIT.

A reference guide to formal methods, which use mathematics to describe and check how software should behave, with a focus on the VDM-SL specification language. It explains VDM-SL types, conditions, invariants, and proof obligations in developer-friendly terms.

In plain words
What is it for?
Use it to answer questions about VDM-SL syntax and types, preconditions, invariants, proof obligations, and the main areas of formal methods.
Why use it?
It helps developers understand unfamiliar formal-specification concepts without having to infer their meaning from mathematical notation alone.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the formal-agent-contracts plugin — 15 skills shipped together

Good fit Use it to answer questions about VDM-SL syntax and types, preconditions, invariants, proof obligations, and the main areas of formal methods.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kotaroyamame/formal-agent-contracts/formal-methods-guide
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 kotaroyamame/formal-agent-contracts --skill formal-methods-guide
Clone the repo
git clone --depth 1 https://github.com/kotaroyamame/formal-agent-contracts

Made for: Claude Code.

Or install formal-agent-contracts, the plugin that ships this one along with the rest of its 15 skills.

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-methods-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/kotaroyamame/formal-agent-contracts/formal-methods-guide/github.svg)](https://agentmods.dev/skills/kotaroyamame/formal-agent-contracts/formal-methods-guide)
Your own site
<a href="https://agentmods.dev/skills/kotaroyamame/formal-agent-contracts/formal-methods-guide"><img src="https://agentmods.dev/badge/skills/kotaroyamame/formal-agent-contracts/formal-methods-guide/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-methods-guide

Your own site · 80×15
<a href="https://agentmods.dev/skills/kotaroyamame/formal-agent-contracts/formal-methods-guide"><img src="https://agentmods.dev/badge/skills/kotaroyamame/formal-agent-contracts/formal-methods-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,485 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.
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.00104 $0.01485
Opus 5 $0.00052 $0.00743
Sonnet 5 $0.00021 $0.00297
Haiku 4.5 $0.00010 $0.00148

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

Security

Grade A, and why

formal-methods-guide 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 12d 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-methods-guide/SKILL.md · 139 lines

How it starts

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

Formal Methods Guide

Answer questions about formal methods and VDM-SL in developer-friendly language. Always accompany technical terminology with plain explanations.

形式手法やVDM-SLに関する質問に、開発者が理解しやすい言葉で説明する。 専門用語を使う場合は必ず平易な説明を添える。

Three Pillars of Formal Methods

Formal methods are broadly divided into three areas:

形式手法は大きく3つの分野に分かれる:

  1. Formal Specification (形式的仕様記述) — Mathematically describe system behavior (VDM-SL, TLA+, B-Method, Z)
  2. Model Checking (モデル検査) — Exhaustively explore state spaces to verify properties (SPIN, NuSMV, TLA+)
  3. Theorem Proving (定理証明) — Prove properties through logical reasoning (Coq, Isabelle/HOL, Lean)

This plugin focuses on Formal Specification, specifically VDM-SL.

本プラグインは形式的仕様記述、特にVDM-SLを中心に扱う。

VDM-SL Core Concepts

Types

The VDM-SL type system is the foundation for rigorously defining "what is exchanged" in inter-agent contracts.

VDM-SLの型システムは、エージェント間の契約で「何を受け渡すか」を厳密に定義する基盤。

Basic types:

  • nat — natural numbers ≥ 0, nat1 — natural numbers ≥ 1
  • int — integers, real — real numbers
  • bool — boolean, char — character, token — abstract token

Compound types:

  • seq of T — sequence (list) of T, seq1 of T — non-empty sequence
  • set of T — set of T
  • map K to V — map from K to V (dictionary)
  • Record type — T :: field1 : Type1 field2 : Type2 defines a struct

Invariants (不変条件)

Declare conditions that "must always hold" for a type or state.

型や状態に対して「常に成り立つべき条件」を宣言する。

types
  Age = nat
  inv a == a <= 150;

This means "age must be between 0 and 150". This constraint is automatically included in verification targets wherever the type is used.

「年齢は0以上150以下」という制約。型を使うすべての箇所で自動的に検証対象になる。

Pre-conditions and Post-conditions (事前条件と事後条件)

Define "caller's responsibility" and "implementation's guarantee" for functions and operations.

関数や操作に対して「呼び出し側の責任」と「実装側の保証」を定義する。

functions
  divide: real * real -> real
  divide(a, b) == a / b
  pre b <> 0
  post RESULT * b = a;

Read the full file on GitHub · 139 lines

Files

What ships with it

2 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. 12d ago First seen · 139 lines · 104 tokens per session scan A d64e3da27e3e

Subscribe to this mod's changes

formal-methods-guide is a skill published in the GitHub repository kotaroyamame/formal-agent-contracts (1 stars, last pushed 2mo ago), licensed MIT. It adds 104 tokens to every session and 1,485 once invoked, about $0.0005 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-08-31.

Related

Other skills, from other repositories

add-didactic-comments

Comment tagged files so the user learns the APIs they are studying, with a doc link in every comment.

MK27MK/no-bs-skills · 27 tokens

ccc-research

In addition to web search, research can use connected channels as surfaces.

KevinZai/commander · 35 tokens

dp-patterns

Reference for dynamic programming patterns — recognition signals, constraint mapping, Python templates, edge cases, and common mistakes for 8 core DP techniques.

sequenzia/agent-alchemy · 31 tokens

data-structures

Reference for advanced data structure patterns used in competitive programming and technical interviews. Covers heaps, monotonic stacks, tries, segment trees, Fenwick trees, stack-based parsing, and ordered sets with Python templates, recognition signals, and edge case guidance.

sequenzia/agent-alchemy · 53 tokens

math-and-combinatorics

Reference patterns for mathematical and combinatorial problem-solving. Covers modular arithmetic, prime sieves, GCD/LCM, binomial coefficients, fast exponentiation, counting techniques, inclusion-exclusion, and game theory. Load this skill when a problem involves number theory, combinatorics, modular operations, or…

sequenzia/agent-alchemy · 72 tokens

search-and-optimization

Reference patterns for search, optimization, and greedy algorithms. Covers binary search (classic and on-answer), two pointers, sliding window, greedy strategies, prefix sums, merge intervals, and monotonic stack. Use when solving problems that involve searching sorted data, optimizing over constraints, processing…

sequenzia/agent-alchemy · 70 tokens