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.
npx agentmods add commands/punt-labs/z-spec/model2codegit clone --depth 1 https://github.com/punt-labs/z-specWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00006 | $0.02153 |
| Opus 5 | $0.00003 | $0.01077 |
| Sonnet 5 | $0.00001 | $0.00431 |
| Haiku 4.5 | $0.00001 | $0.00215 |
Grade A, and why
model2code 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.
This is a copy
98% identical to model2code-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.
How it starts
The opening of the file, as written. The whole thing — 350 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/z-spec:model2code - Model to Code
Generate implementation code and unit tests from a Z specification.
Usage
/z-spec:model2code [spec.tex] [language]
Arguments:
spec.tex- Z specification file (default: search in docs/)language- Target: swift, typescript, python, kotlin (default: detect from project)
Workflow
Step 1: Validate the Specification
Before generating code, type-check the specification with fuzz:
fuzz -t <spec.tex>
If fuzz reports errors, fix them first. Code generation from invalid specs produces invalid code.
Step 2: Detect Target Language
If no language specified, detect from project files:
| File Present | Language |
|---|---|
Package.swift, *.xcodeproj |
Swift |
package.json, tsconfig.json |
TypeScript |
pyproject.toml, setup.py, requirements.txt |
Python |
build.gradle.kts, pom.xml |
Kotlin |
Step 3: Generate Code
Read the Z specification and translate each construct to idiomatic code for the target language.
Translation Principles
State Schemas → Classes/Structs
Z state schemas become data types with properties:
\begin{schema}{Account}
balance : \num \\
status : Status
\where
balance \geq 0 \lor status = suspended
\end{schema}
Swift:
struct Account {
var balance: Int
var status: Status
var isValid: Bool {
balance >= 0 || status == .suspended
}
}
TypeScript:
interface Account {
balance: number;
status: Status;
}
function isValidAccount(a: Account): boolean {
return a.balance >= 0 || a.status === Status.Suspended;
}
Free Types → Enums
\begin{zed}
Status ::= pending | active | suspended | closed
\end{zed}
Swift:
enum Status {
case pending, active, suspended, closed
}
TypeScript:
enum Status {
Pending = "pending",
Active = "active",
Suspended = "suspended",
Closed = "closed"
}
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.
- 2d ago First seen · 350 lines · 6 tokens per session scan A 082b37a102d3
model2code is a command published in the GitHub repository punt-labs/z-spec (5 stars, last pushed 2d ago), licensed MIT. It adds 6 tokens to every session and 2,153 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 98% identical to model2code-dev, differing in 6 lines, and is treated as a copy.
Other commands, from other repositories
meeting-listen
Play back a completed meeting summary as a voiced debate between personas.
meeting-hive
Run an autonomous PR/FAQ review meeting where four personas debate and reach consensus without user intervention.
vote
Assess whether a PR/FAQ should move forward with a structured go/no-go decision.
feedback
Incorporate feedback into PR/FAQ and redraft affected sections.
feedback-to-us
Tell us how the prfaq plugin is working for you (anonymous 1-5 feedback).
badge
Generate a stage-colored badge and embed it in your README.