b-create

b-create is a command for coding agents from punt-labs/z-spec. It costs 12 tokens per session (1,901 once invoked), scanned A, a copy of b-create-dev, MIT.

A command that creates a B machine, which is a formal, checkable description of software behavior, from plain-language requirements or an existing Z specification. A Z specification is another formal notation for describing systems.

In plain words
What is it for?
Use it to create a B specification from a description or translate a .tex file containing a Z specification into a B machine.
Why use it?
It turns informal requirements or an existing formal document into a form that can be checked and tested with ProB.

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
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.

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 b-create

README.md
[![agentmods](https://agentmods.dev/badge/commands/punt-labs/z-spec/b-create.svg)](https://agentmods.dev/commands/punt-labs/z-spec/b-create)
Your own site
<a href="https://agentmods.dev/commands/punt-labs/z-spec/b-create"><img src="https://agentmods.dev/badge/commands/punt-labs/z-spec/b-create.svg" alt="Measured on agentmods" height="20"></a>
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,901 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 94% copy Near-identical to another mod 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.01901
Opus 5 $0.00006 $0.00950
Sonnet 5 $0.00002 $0.00380
Haiku 4.5 $0.00001 $0.00190

Measured 4d ago against content hash 2bd78a10216e, 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 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 4d 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

This is a copy

94% identical to b-create-dev — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugin/commands/b-create.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:b-create - 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:setup 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. 4d ago First seen · 315 lines · 12 tokens per session scan A 2bd78a10216e

Subscribe to this mod's changes

b-create is a command published in the GitHub repository punt-labs/z-spec (5 stars, last pushed today), licensed MIT. It adds 12 tokens to every session and 1,901 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to b-create-dev, differing in 6 lines, and is treated as a copy.