b-create-dev

A command for creating an executable B formal specification from a plain-language description or an existing Z specification. B and Z are formal methods for describing software systems precisely and checking their behavior.

In plain words
What is it for?
Use it to create files in a specs directory, translate .tex Z specifications, and verify that the probcli tool is available.
Why use it?
It turns an informal design or Z document into a form that can be checked, simulated, and refined toward an implementation.

Command

Part of the z-spec-dev plugin — 42 commands, 1 hook shipped together

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.

agentmods
npx agentmods add commands/punt-labs/z-spec/b-create-dev
Clone the repo
git clone --depth 1 https://github.com/punt-labs/z-spec

Or install z-spec-dev, the plugin that ships this one along with the rest of its 42 commands, 1 hook.

Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,909 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00012 $0.01909
Opus 5 $0.00006 $0.00955
Sonnet 5 $0.00002 $0.00382
Haiku 4.5 $0.00001 $0.00191

Measured 2d ago against content hash 2a9d8f4b37cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

b-create-dev 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 2d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • b-create — 94% identical, 6 lines differ
plugin/commands/b-create-dev.md · 315 lines

How it starts

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

/z-spec-dev:b-create-dev - Create B Machine

You are creating a B Abstract Machine Notation (AMN) specification. B machines are executable formal specifications that can be type-checked, animated, model-checked, and refined toward implementation --- all using probcli.

This command has two modes:

  1. Description mode: Create a B machine from a natural language description
  2. Translation mode: Translate an existing Z specification (.tex) to a B machine

Input

Hint: $ARGUMENTS

Determine the mode:

  • If the argument is a path to a .tex file: translation mode
  • Otherwise: description mode (treat as natural language description)

Process

0. Check Prerequisites

Verify probcli is installed:

PROBCLI="${PROBCLI:-$HOME/Applications/ProB/probcli}"
if ! which probcli >/dev/null 2>&1 && [ ! -x "$PROBCLI" ]; then
    echo "PROBCLI_NOT_FOUND"
fi

If probcli not found: Stop and tell the user:

probcli is not installed. Run /z-spec-dev:setup-dev probcli first.

1. Create specs/ Directory

mkdir -p specs

Update .gitignore if needed:

for pattern in "specs/*.prob" "specs/*.prob2project"; do
    grep -qxF "$pattern" .gitignore 2>/dev/null || echo "$pattern" >> .gitignore
done

2a. Description Mode

If working from a natural language description:

Analyze the Description

Extract:

  • Entities: What things does the system track?
  • Attributes: What properties do entities have?
  • Constraints: What must always be true?
  • Operations: What state transitions exist?
  • Relationships: How do entities relate to each other?
Generate the Machine

Create a .mch file following this structure:

MACHINE MachineName

SETS
    /* Deferred sets for entity identifiers */
    ID;
    /* Enumerated sets for status values */
    STATUS = {active, inactive}

CONSTANTS
    max_capacity

PROPERTIES
    max_capacity : NAT &
    max_capacity = 100

VARIABLES
    /* State variables */
    entries,
    statuses

INVARIANT
    /* Typing constraints */
    entries : ID +-> NAT &
    statuses : ID +-> STATUS &
    /* Domain consistency */
    dom(entries) = dom(statuses) &
    /* Business invariants */
    card(entries) <= max_capacity

INITIALISATION
    entries := {} ||
    statuses := {}

OPERATIONS
    /* Operations with PRE/THEN substitutions */
    add(id, val) =
        PRE id : ID & val : NAT &
            id /: dom(entries) &
            card(entries) < max_capacity
        THEN
            entries := entries \/ {id |-> val} ||
            statuses := statuses \/ {id |-> active}
        END;

    remove(id) =
        PRE id : ID & id : dom(entries)
        THEN
            entries := {id} <<| entries ||
            statuses := {id} <<| statuses
        END;

    nn <-- count =
        nn := card(entries)
END

Read the full file on GitHub · 315 lines

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

Subscribe to this mod's changes

b-create-dev is a command published in the GitHub repository punt-labs/z-spec (5 stars, last pushed 3d ago), licensed MIT. It adds 12 tokens to every session and 1,909 once invoked, about $0.0001 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 commands, from other repositories

cross-language-check

Replicate a quantitative analysis in a second language (R↔Python↔Stata↔Julia) and compare outputs for implementation errors. Use when an existing empirical result needs independent cross-language verification. Not for reviewing one implementation in place; use $code-suite.

flonat/flonat-research · 54 tokens

lean-check

Formalize a self-authored lemma or theorem in Lean 4/mathlib and require a clean lake build without sorry. Use when the mathematical claim can be stated faithfully and machine-checked. For numerical falsification or symbolic algebra, use $numerical-check or $symbolic-check.

flonat/flonat-research · 60 tokens

experiment-design

Design empirical studies through power analysis, pre-analysis planning, QSF parsing, and survey architecture. Use when specifying sampling, measurement, treatment, or analysis before data collection. Not for causal identification alone; use $causal-design.

flonat/flonat-research · 46 tokens

feedback

Incorporate feedback into PR/FAQ and redraft affected sections.

punt-labs/prfaq · 13 tokens

causal-design

Design or audit the identification strategy for an observational study. Use when the task concerns estimands, causal assumptions, threats to identification, or defensible research design rather than model implementation.

flonat/flonat-research · 36 tokens

computational-experiments

Scaffold, execute, analyse, and publish computational research experiments through a reproducible staged workflow. Use when a research question requires simulations or computational sweeps rather than a one-off script.

flonat/flonat-research · 37 tokens