template-formal

template-formal is a skill for Claude Code, Codex from docxology/template. It costs 53 tokens per session (895 once invoked), scanned A, original, Apache-2.0.

A project template showing how strict types and runtime checks can enforce rules in a multi-agent ant-colony simulation. It models communication protocols and resource handling so invalid states are rejected.

In plain words
What is it for?
Use it to study strongly typed Python designs, validate multi-agent protocols, check resource rules, and pair type-checker tests with runtime tests.
Why use it?
It helps test whether design rules are actually enforced, rather than relying only on comments or successful-looking tests.

Skill for Claude CodeCodex

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 skills/docxology/template/template-formal
Any agent
npx skills add docxology/template --skill template-formal
Clone the repo
git clone --depth 1 https://github.com/docxology/template

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 template-formal

README.md
[![agentmods](https://agentmods.dev/badge/skills/docxology/template/template-formal.svg)](https://agentmods.dev/skills/docxology/template/template-formal)
Your own site
<a href="https://agentmods.dev/skills/docxology/template/template-formal"><img src="https://agentmods.dev/badge/skills/docxology/template/template-formal.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 895 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.00053 $0.00895
Opus 5 $0.00026 $0.00447
Sonnet 5 $0.00011 $0.00179
Haiku 4.5 $0.00005 $0.00089

Measured yesterday against content hash 2236f69d1e4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

template-formal 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 yesterday.

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.

projects/templates/template_formal/.agents/skills/template-formal/SKILL.md · 78 lines

How it starts

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

template-formal

Project-scoped skill for the in-repo exemplar at projects/templates/template_formal/. Load this when working inside the project.

When to Use

  • Working inside the template_formal exemplar — running scripts, editing src/template_formal/, or adding a new typed invariant.
  • Forking this exemplar as the starting scaffold for a project whose research subject is illegal-state-unrepresentable design or a decentralized multiagent simulation.
  • Adding a new strong-typing claim and needing the paired-proof pattern: every ADT/session-type/affine-handle claim needs both a tests/mypy_fixtures/ negative-control fixture (mypy rejects the bad program) and a runtime unit test (the discipline actually raises).
  • Validating that the exemplar's contracts (thin-orchestrator, zero-mock testing, no compile-time linear/dependent-type claims) still hold after changes.

Quick Reference

# From the repository root
uv run pytest projects/templates/template_formal/tests --cov=projects/templates/template_formal/src --cov-fail-under=90
MYPYPATH=projects/templates/template_formal/src \
  uv run mypy --strict --explicit-package-bases --namespace-packages \
  projects/templates/template_formal/src
uv run python projects/templates/template_formal/scripts/02_run_analysis.py
uv run python scripts/pipeline/stage_03_render.py --project templates/template_formal
uv run python scripts/pipeline/stage_04_validate.py --project templates/template_formal
uv run python scripts/pipeline/stage_05_copy.py --project templates/template_formal

# Optional formal side-specs (non-default; require lake/elan + a Java runtime)
projects/templates/template_formal/scripts/check_formal_specs.sh

Pitfalls

  • Never claim compile-time linear or dependent type guarantees. Python has neither. Affine handles (TransactionHandle, protocol-phase objects) are a runtime-guarded discipline — they raise on reuse, they are not type-checked against reuse. Grep for "dependent type" and "linear type" outside the manuscript's explicit limitations/scoping section must return zero matches.
  • Every strong typing claim needs a paired proof. A mypy-oracle negative-control fixture under tests/mypy_fixtures/ proves what mypy --strict rejects; a runtime unit test proves what actually raises. One without the other is an unfalsifiable claim.
  • Keep scripts thin. Business logic belongs in src/template_formal/, not in scripts/.
  • No mocks. All tests use real on-disk SQLite files (tmp_path), a real in-process fault-injectable bus, and real mypy --strict subprocess invocations — never MagicMock/unittest.mock/mocker.patch.
  • No shared global state. Each Agent owns exactly one on-disk database and one protocol endpoint; the colony coordinator only ever holds the public Agent/PheromoneField interfaces.
  • Formal side-specs are optional and must stay wired. If formal/lean/ or formal/tla/ ship, they must be reachable from scripts/check_formal_specs.sh — never a vestigial, unwired file.

Read the full file on GitHub · 78 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. yesterday First seen · 78 lines · 53 tokens per session scan A 2236f69d1e4d

Subscribe to this mod's changes

template-formal is a skill published in the GitHub repository docxology/template (19 stars, last pushed today), licensed Apache-2.0. It adds 53 tokens to every session and 895 once invoked, about $0.0003 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

aerospace-engineering-technician

Use when a task needs the judgment of an Aerospace Engineering and Operations Technologist/Technician — verifying an installed fastener's preload against a drawing's torque callout via the T=K·D·F relationship, reducing strain-gauge data from a structural proof-load test into stress and checking it against an…

wonsukchoi/domain-experts · 169 tokens

agricultural-engineer

Use when a task needs the judgment of an agricultural engineer — sizing a center-pivot or drip irrigation system's peak capacity against crop water demand, computing lateral grain-bin wall pressure with Janssen's equation, sizing a waterway or tile-drainage system with Manning's equation and an NRCS design-storm…

wonsukchoi/domain-experts · 90 tokens

agricultural-sciences-professor

Use when a task needs the judgment of a tenure-track or tenured Agricultural Sciences faculty member at a land-grant university — deciding whether to submit a grant this cycle versus wait, allocating time across the teaching/research/extension appointment split, diagnosing a stalled graduate student or field trial, or…

wonsukchoi/domain-experts · 75 tokens

anthropologist-archeologist

Use when a task needs the judgment of an Anthropologist/Archeologist working in cultural resource management (CRM) — scoping a Section 106 Phase I identification survey, designing a shovel-test-pit sampling strategy, evaluating National Register of Historic Places eligibility under Criteria A-D, interpreting…

wonsukchoi/domain-experts · 106 tokens

automotive-engineering-technician

Use when a task needs the judgment of an Automotive Engineering Technician — setting up and instrumenting test equipment (strain-gauge bridges, thermocouples, load/torque sensors) to an engineer's written test plan, selecting DAQ sample rate and an SAE J211 CFC filter class for a vehicle test channel, verifying…

wonsukchoi/domain-experts · 207 tokens

calibration-technician

Use when a task needs the judgment of a Calibration Technologist/Technician — computing a Test Uncertainty Ratio (TUR) and deciding whether it meets the 4:1 target, building a measurement uncertainty budget (Type A/Type B, GUM-style) for a calibration, tracing a reference standard's chain of custody to NIST/SI…

wonsukchoi/domain-experts · 112 tokens