amendlisted
Install: claude install-skill lukasrepublic/agentic-foundry
# /foundry:amend
The mechanical write is performed by `${CLAUDE_PLUGIN_ROOT}/scripts/foundry-amend.py`
(validated, logged, byte-canonical — it never re-implements the freeze logic, delegating to
`foundry_authz.validate_spec_contract` and `foundry_authz.authorize`, the SAME functions
`/foundry:authorize` calls). This skill drives when/how to invoke it.
## When to trigger
- Operator or agent: "amend `<spec>`", "/foundry:amend `<spec-or-contract>`".
- After a spec's normative text or its `acceptance-contract.yaml` is edited **during
implementation of an already-AUTHORIZED atom** (an `authorized:` trailer is already present)
— the spec is a living document; this is the normal path, not an exception.
- **Never** for a DRAFT (no `authorized:` trailer yet) — that is `/foundry:authorize`'s job, the
FIRST freeze. Amend only ever RE-freezes an existing authorization.
## Procedure
1. **Commit the last-authorized baseline first.** `/foundry:amend` diffs the working tree
against a git commit — the frozen `authorized:` trailer stores only hashes, never the prior
field values, so the diff needs a commit that reproduces them. It does NOT trust `--ref`
(default `HEAD`) at face value: it walks the commit history backwards from `--ref` and
VERIFIES each candidate by recomputing both hashes, using the first commit whose (spec,
contract) blobs both match the trailer's `spec_sha256`/`contract_sha256` — the exact state
that was signed. `--ref` is only a starting point f