amend
Skill1 starsChanged 3 months agoMITView on GitHub
One-step re-freeze of a living, already-authorized spec (/foundry:amend). Recomputes spec_sha256/contract_sha256, bumps auth_seq, and records the amendment WITHOUT an operator step — unless the change widens a boundary (scope, checkpoint intended/ack, system_grounding, an identifier token in a checkpoint locator/expect.value, or a checkpoint-rigor reduction) or the contract's mandatory_review names a security review, in which case it refuses and routes to /foundry:authorize. Trigger when the operator or agent says "amend <spec>", "/foundry:amend", or implementation reality has changed an authorized spec's normative text or its contract after /foundry:authorize already ran.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- KazukiShinomiya/sdd-startertheir own version, first seen Jul 18, 2026
- Nagiliant/Genesis-Legacy-V2their own version, first seen Jun 18, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- Nagiliant/Genesis-Legacy-V2★ 2same name
- KazukiShinomiya/sdd-starter★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository71 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- auditSkill
- authorize-releaseSkill
- authorizeSkill
- certify-localSkill
- certify-stagingSkill
- coherence-checkSkill
- command-deckSkill
- contextSkill
- cut-releaseSkill
- dashboards-as-codeSkill
- data-tier-cutoverSkill
- decommission-gateSkill
- deploy-statusSkill
- dispatchSkill
- doctorSkill
- drift-sweepSkill
- env-hygieneSkill
- extract-specSkill
- fleetSkill
- grounding-conformanceSkill
- id-applySkill
- id-architectSkill
- id-baselineSkill
- id-discoverSkill
- id-documentSkill
- id-driftSkill
- id-impactSkill
- id-implementSkill
- id-importSkill
- id-planSkill
- id-promoteSkill
- id-reviewSkill
- id-rollbackSkill
- id-simulateSkill
- id-syncSkill
- id-testSkill
- id-validateSkill
- id-verifySkill
- indexSkill
- infra-sandboxed-applySkill
- initSkill
- intakeSkill
- learn-captureSkill
- learn-distillSkill
- merge-when-greenSkill
- mode-autonomousSkill
- mode-interactiveSkill
- modeSkill
- post-upgradeSkill
- releaseSkill
- relockSkill
- report-citation-graphSkill
- reposSkill
- research-captureSkill
- research-firstSkill
- revertSkill
- sd-debugSkill
- sd-discoverSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
After a spec's normative text or its acceptance-contract.yaml is edited during implementation of an already-AUTHORIZED atom (an authorized: …
- Very specific: line 111
Re-implementing the freeze: Always invoke foundry-amend.py.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/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.yamlis edited during implementation of an already-AUTHORIZED atom (anauthorized: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
- Commit the last-authorized baseline first.
/foundry:amenddiffs the working tree against a git commit — the frozenauthorized:trailer stores only hashes, never the prior field values, so the diff needs a commit that reproduces them. It does NOT trust--ref(defaultHEAD) at face value: it walks the commit history backwards from--refand VERIFIES each candidate by recomputing both hashes, using the first commit whose (spec, contract) blobs both match the trailer'sspec_sha256/contract_sha256— the exact state that was signed.--refis only a starting point for that walk, never a trusted override (a caller who commits an already-widened contract and then runs/foundry:amendagainst HEAD is still refused — the walk finds the earlier, correctly-matching commit and diffs against THAT). If no commit in that history matches, the CLI fails closed rather than guessing.operator_id/merge_autonomy_modefor the re-freeze are read from that VERIFIED baseline commit's own trailer, never from the mutable working-tree trailer (which sits below the hash sentinel and could be hand-edited without moving any hash). - Run the CLI.
It prints (a) the normative-region diff, then (b)/(c)/(d) any boundary/identifier/rigor changes it found.python3 "${CLAUDE_PLUGIN_ROOT}/scripts/foundry-amend.py" \ --spec <spec> --contract <contract> [--why "<what reality required>"] - Non-widening → done, no operator turn. The spec MUST already carry a
## Amendmentssection located after<!-- /normative -->and outside any fenced code block — if not, the CLI refuses before any write (nothing recorded, contract byte-identical). Otherwise: the## Amendmentsrow is appended FIRST (outside the normative region — its own hash is asserted unchanged by the append, or the CLI reverts and refuses), THEN the freeze-write, THEN the completion record. Net effect on success:spec_sha256/contract_sha256recomputed,auth_seqbumped,supersedesset to the priorcontract_sha256, the## Amendmentsrow, and a.foundry/security-audit.jsonlrecord naming the spec + both new hashes + the newauth_seq(plus the verified baseline commit — see step 1). No audit-ledger row is required or consulted anywhere in this path — mirrors/foundry:authorize's own audit-drops-precondition posture, one step further (amend does not even look at the §8 audit ledger). - Widening or security-flagged → refuses, routes to authorize. A non-zero exit with a
structured
{status: "needs-operator", widened_fields: [...], diff_summary: "...", remediation: "/foundry:authorize <spec>"}on stdout, and the contract is left byte-unchanged. A boundary field changed (scope,checkpoints[].intended/ack,system_grounding,preconditions,build_gates,post_apply_checks,mandatory_review,requires_capabilities, andtarget_repo— a round-2 addition, STRICTER than the frozen AC-AMND-1(b) list: a silent venue change is never non-widening even though the spec text doesn't name it), a checkpoint'slocator/expect.valueintroduced a new identifier token (AWS account id,arn:case-insensitive, an IPv4 literal, a hostname/URL, or a grounded artifact identifier — including a checkpoint whoseac_idis absent from the baseline, new or renamed-away-from, checked against an EMPTY baseline so any identifier token in it convicts), a checkpoint's rigor was reduced (expect.valuelowered, or itsmatchesregex value changed AT ALL — direction unknowable;expect.opweakened, or changed to/from an op outside the fixed ranking — direction unknowable;expect.baselinepre-change→none;surfacerepointed OR DELETED), or the CANDIDATE contract'smandatory_reviewnamessecurityat all (regardless of whether that field changed this amendment) — hand the printed remediation to/foundry:authorize(skills/authorize/SKILL.md) and get the operator's explicit confirmation there. Do NOT retry/foundry:amendon the same diff, and do NOT hand-edit the contract to route around the refusal. - Report the resulting
auth_seqand both hashes (non-widening path), or the refusal'swidened_fields+ remediation (widening path).
Inputs
<spec>/<acceptance-contract.yaml>— the ALREADY-AUTHORIZED pair, edited in place.--ref(defaultHEAD) — a STARTING POINT for the backwards git-log walk that resolves the verified baseline commit; never a trusted override (see step 1).--why— optional free text for the## Amendmentsrow's "why reality required it" column.
Residuals — accepted identifier-token limitations (RISK R3)
The identifier-token classifier (AC-AMND-1(c)) is a fixed, testable set of regexes, not a full grounding oracle. Two classes of token it does NOT catch, accepted for this wave:
- A bare single-label host (no dot:
prod-db,localhost) — the hostname pattern requires a dot-separated label + a letters-only suffix, so a single-label name never matches. - Unicode homoglyph/confusable substitutions in a hostname (e.g. a Cyrillic-lookalike
аfor Latina) — the classifier compares literal codepoints, not visual similarity.
Both are named here rather than silently absorbed into "it just works" — a widening that relies on either to slip past the classifier is a real gap, not a false negative this atom claims to close.
Outputs
- Non-widening: an
acceptance-contract.yamlwith a re-frozenauthorized:block, a new row in the spec's## Amendmentstable, andamend-intent+amend-completeentries in.foundry/security-audit.jsonl. - Widening: nothing written; a structured refusal on stdout naming the exact widened fields.
Anti-patterns
- Re-implementing the freeze. Always invoke
foundry-amend.py; it delegates the actual write tofoundry_authz.authorize— never hand-bumpauth_seqor hand-edit theauthorized:block. - Treating a security-flagged atom as amendable.
mandatory_reviewnamingsecurityALWAYS routes to/foundry:authorize, even for a change that widens nothing else. - Amending a DRAFT. No
authorized:trailer means there is nothing to re-freeze — run/foundry:authorizefor the first freeze. - Retrying past a refusal. A
needs-operatorrefusal is the classifier working as designed; hand it to/foundry:authorize, don't loosen the diff or the classifier to make it pass.
See also
skills/authorize/SKILL.md— the FIRST freeze (DRAFT → AUTHORIZED) and the destination for every widening/security-flagged amendment this skill refuses.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

