implement-structural

A command that implements a policy change in a country’s PolicyEngine model after an analysis classifies it as structural. PolicyEngine is software that models the effects of laws and reforms.

In plain words
What is it for?
Use it with a backlog issue, report, or archived analysis to implement enacted laws or proposed reforms and optionally open a draft pull request.
Why use it?
It handles model changes that cannot be completed by the initial policy analysis, then records the analysis re-run needed to finish the work.

Command

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/policyengine/policyengine-claude/implement-structural
Clone the repo
git clone --depth 1 https://github.com/PolicyEngine/policyengine-claude
Per session 48 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,023 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.00048 $0.01023
Opus 5 $0.00024 $0.00511
Sonnet 5 $0.00010 $0.00205
Haiku 4.5 $0.00005 $0.00102

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

Security

Grade A, and why

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

commands/implement-structural.md · 87 lines

How it starts

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

Implement structural: $ARGUMENTS

When /analyze-policy classifies a reform as STRUCTURAL, the pipeline stops with a backlog issue. This command picks that issue up and implements the model extension, so the original analysis can re-run and publish.

Arguments

$ARGUMENTS should contain ONE of:

  • A structural backlog issue — policyengine-us#9051 or the issue URL
  • A structural-backlog report path — /tmp/<id>-structural-backlog.md
  • The archived structural analysis — analyses/<date>-<id>-structural.md

Options:

  • --draft — open the PR as draft
  • --no-rerun — skip recording the pending re-run command

Phase 1 — Read the spec and choose the mode

Read the backlog issue/report. It carries the classifier's findings: which parameters/variables are missing, the empirical verification, and the size estimate. Then choose:

  • Enacted law → BASELINE change. The statute is current law; the model is simply behind. Edit policyengine_us/parameters/... (and variables if needed) directly — e.g. HI SB3125/Act 24: append bracket [12] @ 13% to the five gov.states.hi.tax.income.rates.* scales, inert before 2027-01-01. NEVER implement enacted law under gov/contrib/.
  • Proposal → CONTRIB reform. Not yet law; implement as a gov/contrib/ factory reform with an in_effect toggle — delegate to /encode-reform, which owns that pattern, and stop here.

Phase 2 — Implement (baseline mode)

Invoke the structural-implementer agent — it owns this whole phase (statute verification, baseline edits, inertness + boundary tests, draft PR). Its non-negotiables include re-deriving the spec from the ENROLLED statute: backlog issues can be materially wrong (HI SB3125's issue said "append one bracket"; the act replaced the whole rate table). For complex multi-variable changes it may in turn use the country-models agents:

  1. rules-engineer — the parameter-schema change (exact YAML edits, statutory references on every value: bill section + effective date, and inert defaults for periods before the effective date — a new bracket's pre-effective threshold is .inf or its rate matches the bracket below, whichever the surrounding schema convention uses) AND any variable/formula changes. A pure bracket append usually needs no formula edit; verify the rate scale is consumed generically before assuming.
  2. test-creator — boundary tests proving: (a) pre-effective years are bit-identical to the old schema (the inertness test), (b) the new structure binds correctly in the effective year at, just below, and above each new threshold, per filing status.
  3. Load policyengine-standards: changelog entry, formatting (make format), naming conventions.

Read the full file on GitHub · 87 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 · 87 lines · 48 tokens per session scan A 400dbef2a4c1

Subscribe to this mod's changes

implement-structural is a command published in the GitHub repository PolicyEngine/policyengine-claude (31 stars, last pushed 7d ago), licensed MIT. It adds 48 tokens to every session and 1,023 once invoked, about $0.0002 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-30.