spec-kit-amend-artifacts
Skill6 starsChanged 2 months agoApache-2.0View on GitHub
Apply an already-decided change — a pre-pr-review finding, a refuted [SONDA] premise, or unplanned scope the user resolved — to spec.md/plan.md/tasks.md in one confirmed pass, starting at the lowest artifact that owns the change and propagating only downward, by running each generating skill's own "Updating an Existing X" procedure with scoped validation. Records every decision in amendments.md before editing (write-ahead, so a stopped amendment can be resumed or undone), reworks closed tasks only through the Task Lifecycle, lets each owning procedure refresh its state.json entry, and hands off to spec-kit-execute-tasks. Never decides a change for the user and never writes product code. When an artifact-amender agent is requested, generates compatible definitions for both Kiro CLI and Claude Code.
In this repository22 other files it gives its agents.
- backend-api-standardsSkill
- brain-orchestratorSkill
- brand-guidelinesSkill
- code-architecture-explainerSkill
- code-documentationSkill
- create-pull-requestSkill
- frontend-architectureSkill
- frontend-designSkill
- gh-stackSkill
- git-commitsSkill
- latex-academic-reportsSkill
- pre-pr-reviewSkill
- project-intelligenceSkill
- project-setupSkill
- spec-kit-analyze-consistencySkill
- spec-kit-establish-constitutionSkill
- spec-kit-execute-tasksSkill
- spec-kit-generate-planSkill
- spec-kit-generate-specSkill
- spec-kit-generate-tasksSkill
- spec-kit-sync-artifactsSkill
- verify-before-implementSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 4 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Always consider the complete user message and any files or attachments available in the current conversation, even when $ARGUMENTS appears …
- Distinctive: line 50
Every edit runs through the owning skill's own update procedure, so the rules for each artifact stay defined in one place.
- Very specific: line 55
Only decided changes: If a finding has no recorded decision, stop and present it with its options.
- Very specific: line 76
No runtime premise at
read: If the change rests on runtime behavior of a library or the project's wiring, obtain executed evidence (a … - Very specific: line 88
Generate portable agent pairs: If this workflow creates an artifact-amender (or other support agent), it must generate and validate both a …
- Very specific: line 129
If logging is off (RUN_LOG: off), continue normally.
- Distinctive: line 135
If the user gave an explicit feature directory, use it.
- Distinctive: line 137
If neither resolves, stop and ask:
- Very specific: line 142
Read spec.md, plan.md, tasks.md (whichever exist), their checklists, amendments.md if present, and state.json.
- Very specific: line 144
If amendments.md has an entry with Status: planned or stopped, handle it first (§ Resuming or Undoing an Open Amendment) — a new amendment …
- Very specific: line 177
Read spec-kit-sync-artifacts/SKILL.md and follow its Phase 1/2 procedure across the chain.
- Distinctive: line 239
Run any probe listed under "Evidence still needed" now, before asking — the plan shown for confirmation must state the observed result, not …
- Very specific: line 265
After each layer validates, add it to the entry's Layers done.
- Very specific: line 279
Run spec-kit-analyze-consistency (read-only).
- Very specific: line 286
Before Fase 0, check .speckit/extensions.yml per spec-kit-shared/artifact-conventions.md's schema, reading hooks.before_amend.
- Very specific: line 292
After Phase 6, process hooks.after_amend the same way, using the same emit-then-execute format the other spec-kit skills use.
≈ “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
Amend Artifacts — Decided-Change Skill
Purpose
Give a decided change a short, governed path into the artifacts. Without it, every review finding
costs the full chain — spec-kit-generate-spec → spec-kit-generate-plan →
spec-kit-generate-tasks → spec-kit-analyze-consistency → spec-kit-execute-tasks, one
confirmed hop at a time, each re-running its full checklist — even when the change is one line in
plan.md and the spec has nothing to say about it.
This skill keeps the chain's guarantees — no decision only in chat, no silent edit of closed work, no implementation against stale intent — and removes the overhead that does not buy safety:
- It writes the change in the lowest artifact that owns it
(
spec-kit-shared/artifact-conventions.md§ Layer Ownership), so a technical change never forces a spec version. - It applies every affected layer in one pass, after one confirmation of a concrete amendment plan.
- It validates what changed, not the whole artifact again.
It does not replace the chain: a change that adds a story or an entity, changes a Safe Deferral condition, needs a new dependency, or can flip a Constitution gate goes through the generating skills (§ Escalation).
User Input
$ARGUMENTSAlways consider the complete user message and any files or attachments available in the current
conversation, even when $ARGUMENTS appears literally or is empty. The most common inputs are: a
pre-pr-review report or finding IDs plus the user's decision for each, a refuted [SONDA] result,
or a short description of a change the user already decided.
Core Principle
Decided changes only. Lowest layer first, downward only. One plan, one confirmation, one pass.
- The decision belongs to the user (or to whoever the review named as decider). This skill turns a decision into artifact edits; it never chooses between options.
- The layer is the one that owns everything the change touches. When unsure, the higher layer — skipping a cascade is the goal, hiding a behavior change from the spec is never acceptable.
- Every edit runs through the owning skill's own update procedure, so the rules for each artifact stay defined in one place.
Non-Negotiable Rules
- Only decided changes. If a finding has no recorded decision, stop and present it with its
options; do not pick one. A
pre-pr-review🟡reads "This requires a … decision" for a reason. - Lowest affected layer, propagating downward only. Classify per
artifact-conventions.md§ Layer Ownership. A change that touches no requirement, entity, invariant, safeguard, or scope does not touchspec.md. - Delegate the edits. Apply each layer through its owner's update procedure —
spec-kit-generate-spec/references/updating.md,spec-kit-generate-plan/references/updating.md,spec-kit-generate-tasks/references/updating.md— reading only that file (and the checklist template it validates against), not the whole skill, and following it inline. Never reimplement their rules here. - Never edit a closed task. Rework follows the Task Lifecycle in
artifact-conventions.md:[ENMIENDA T0XX]tasks, aSuperada por:line only when a task is replaced, and a new[CIERRE]only when the story'sR-ACset changes. - One confirmation, then one pass. Present the full amendment plan (§ Phase 3) once. After confirmation, apply every layer without asking again, unless a step's validation fails.
- Write ahead, stop cleanly, resume mechanically. The
amendments.mdentry is written withStatus: plannedand the base hashes before any artifact is edited, and updated after each layer validates. If a validation fails, stop, setStatus: stoppedwithStopped at, and do not refreshstate.jsonfor any artifact that did not validate. A later invocation resumes or undoes that entry from its record (§ Resuming or Undoing an Open Amendment) — never by guessing what was already done. - No runtime premise at
read. If the change rests on runtime behavior of a library or the project's wiring, obtainexecutedevidence (a scratch probe,verify-before-implement§6.9) before writing it intoplan.md, or record it asassumptionwith a[SONDA]task. - Every decision is written down. In
spec.md(R-D##plus an Evidence Catalog row for the decision text) for a spec-layer change, inplan.md(PL-D##) for a plan-layer change, and always inamendments.md— includingLayer: none(Status: accepted) for a🟡accepted without changes. Because the entry is written ahead (Rule 6), a decision is recorded even when applying it fails. - No product code. This skill changes artifacts only; implementation is
spec-kit-execute-tasks's job. - Escalate what does not fit. Changes listed in § Escalation go through the regular chain, with this skill only recording the decision.
- Generate portable agent pairs. If this workflow creates an
artifact-amender(or other support agent), it must generate and validate both a Kiro CLI and a Claude Code definition per the shared portability contract.
Shared Files
spec-kit-shared/… paths resolve against <skills-root>, the parent of this skill's own
directory: .claude/skills/ or the host's equivalent once installed, the repository root in a
checkout of the kit. Run shared scripts from the project root as
node <skills-root>/spec-kit-shared/scripts/<script>.mjs, with <skills-root> written out as an
absolute path; a bare spec-kit-shared/… script path resolves against the project and fails.
Cross-Platform Agent Compatibility
The complete portability contract lives in spec-kit-shared/agent-portability.md. Before
generating, validating, or reporting on the artifact-amender role — or any other agent this skill
materializes — read that file completely and follow it exactly. If the active host cannot resolve
the reference, follow its fallback section.
artifact-amender is the standard role for this skill: applying one confirmed amendment plan
across spec/plan/tasks in isolation. Do not invent a different name or redefine it for another
purpose.
Artifact Conventions
The .speckit/ layout, state.json, the Content Fingerprint Convention, Stable ID Namespaces,
Layer Ownership, Evidence Levels, Task Lifecycle, and the amendments.md format all live in
spec-kit-shared/artifact-conventions.md. Read it before Fase 0 below.
Run Log
Record this run per spec-kit-shared/artifact-conventions.md § Run Log (<dir> is the feature directory): start with
node <skills-root>/spec-kit-shared/scripts/log-event.mjs <dir> run.start --skill spec-kit-amend-artifacts mode=<mode> and pass the printed RUN_ID to every
later call; end with a run.end event (status, reason when it stops, next), also when the run stops early.
Pass --log <RUN_ID> --skill spec-kit-amend-artifacts to fingerprint.mjs --record (through the owning procedures), fingerprint.mjs --state, and lint-artifacts.mjs so they record their own results.
Record these decisions, each with a one- or two-sentence rationale citing its IDs:
layer— the layer chosen for eachAM-##and why, citing the IDs it changesescalation— when a change goes to the regular chain instead, and which rule triggered ituser— the single amendment-plan confirmation
If logging is off (RUN_LOG: off), continue normally.
Input Contract
Resolving the Target Feature
- If the user gave an explicit feature directory, use it.
- Otherwise, read
.speckit/feature.jsonfor the active feature directory. If neither resolves, stop and ask:
Provide the feature directory the change applies to, and the decided change (or the review findings plus your decision for each).
- Read
spec.md,plan.md,tasks.md(whichever exist), their checklists,amendments.mdif present, andstate.json. - If
amendments.mdhas an entry withStatus: plannedorstopped, handle it first (§ Resuming or Undoing an Open Amendment) — a new amendment never starts on top of a half-applied one.
Resuming or Undoing an Open Amendment
An open entry (planned or stopped) records its decision, its plan, the layers already done,
and the state.json hashes it started from. Compare each artifact's current hash
(fingerprint.mjs) with the entry's Base hashes:
- Equal → that artifact was not touched by the amendment.
- Different and listed in
Layers done→ applied and validated by the amendment; keep it. - Different and not in
Layers done→ the edit at the stopped layer, or an edit made outside the kit. Show the diff; never assume which.
Then offer exactly two options:
- Resume — after the user fixes or confirms the cause in
Stopped at, continue Phase 4 from the first layer not inLayers done, re-validating the stopped layer from scratch. Fase 0 treats drift on artifacts this entry touched as expected; any other drift still stops it. - Undo — restore every artifact the entry touched to its base version (for example
git restorewhen the base version is committed — only with the user's confirmation, since it discards edits), confirm withfingerprint.mjsthat each one matches its base hash again, and setStatus: abandonedwith the reason. The decision stays recorded.
Resolving the Decision
For each change to apply, establish: origin (finding ID and head SHA, [SONDA] task, or user
request), decision (the exact change chosen), and decider. A review report with several
findings becomes one AM-## per root cause — not one per finding, not one for everything.
Fase 0 — Staleness Check
Read spec-kit-sync-artifacts/SKILL.md and follow its Phase 1/2 procedure across the chain. An
amendment is a delta against artifacts that agree with each other; it cannot repair drift it did
not cause.
- Everything matches → proceed.
- Drift exists that the user explains as part of this same decided change (e.g. they already
hand-edited
plan.mdfor it) → include that edit in the amendment plan and validate it like any other change. - Drift on an artifact touched by the open amendment being resumed → expected (§ Resuming or Undoing an Open Amendment).
- Any other drift → stop and recommend the one-hop fix
spec-kit-sync-artifactsnames.
Workflow
Phase 1 — Classify Each Change
For each AM-##, using artifact-conventions.md § Layer Ownership:
| Layer | When | Touches |
spec | Scope, observable behavior, a business rule, an R-AC, an entity, an invariant, a safeguard, a sensitive-data channel, a user-visible error or status | spec.md → plan.md → tasks.md |
plan | A technical decision, a refuted or newly executed runtime premise, a library call, a wiring point or file, a concrete value still inside the stated R-QR/S-SG | plan.md → tasks.md |
tasks | A task's wording or Validación, a file within an existing PL-O##, an extra task inside an existing PL-O##, rework of a closed task with no new R-AC | tasks.md |
none | A 🟡 accepted as-is | amendments.md only |
List the exact IDs each layer will change, and every closed task ([x]) the change affects.
Phase 2 — Escalation
Hand the change to the regular chain instead (record the decision in amendments.md with
Status: escalated, then recommend the nearest generating skill) when it:
- adds, removes, or re-prioritizes a user story (
R-US##), or adds/removes an entity (E-##); - changes a Safe Deferral entry's condition or target story;
- needs a dependency that is not installed;
- could change a Constitution Check gate result;
- changes the
R-ACset of more than one story at once.
These change the shape of the plan or the task structure, which the full procedures exist for.
Phase 3 — Amendment Plan (one confirmation)
Present everything before touching any file:
## Amendment Plan: AM-NN — [title]
**Origin**: [...] **Decision**: [...] **Decider**: [...]
**Layer**: spec | plan | tasks | none
| Artifact | ID | Before | After |
| -------- | -- | ------ | ----- |
| spec.md | R-AC06 | "timeout → failed" | "definitive failure → failed; timeout/5xx → pending, retried by sweep" |
| plan.md | PL-D07 | [...] | [...] |
| tasks.md | T046 (new) | — | [ENMIENDA T018] [...] — Validación: [...] |
**Closed tasks affected**: T018 → `Superada por: T046 (AM-NN)` | T009 → re-walked via T047
**Closure**: R-AC set of US1 unchanged → no new [CIERRE]; T052's Verifica re-walked after T046
**Evidence still needed**: [probe to run before writing PL-D07, or "none"]
**Validation scope**: [checklist items per artifact that will be re-validated]Run any probe listed under "Evidence still needed" now, before asking — the plan shown for confirmation must state the observed result, not an expectation. Then ask once.
On confirmation, write the AM-NN entry in amendments.md before editing anything (Rule 6):
the confirmed plan's origin, decision, decider, layer, and IDs; Base hashes copied from the
current state.json; Layers done: none yet; Status: planned. For Layer: none, write it with
Status: accepted and stop here — there is nothing to apply.
Phase 4 — Apply, Top-Down
For each layer the change touches, highest first. Each owning procedure refreshes its own
state.json entry after it validates — the update procedures already do so, and this skill never
writes state.json itself (artifact-conventions.md § Write Ownership):
spec.md— followspec-kit-generate-spec/references/updating.md. Record the decision asR-D##and add an Evidence Catalog row for the decision text (fingerprint: SHA-256 of the exact text, per the convention). Validate with thespec.mdscope ofartifact-conventions.md§ Scoped Validation.plan.md— followspec-kit-generate-plan/references/updating.md. Record a technical decision as aPL-D##with its evidence level (Rule 7). If the spec changed but the plan needs no edit, say so explicitly ("plan reviewed for AM-NN: no change") — the plan'sbased_on_spec_hashis refreshed only after that review. Validate with theplan.mdscope ofartifact-conventions.md§ Scoped Validation.tasks.md— followspec-kit-generate-tasks/references/updating.mdand the Task Lifecycle (Rule 4). Every new task carriesEnmienda: AM-NN. Validate with thetasks.mdscope ofartifact-conventions.md§ Scoped Validation.
After each layer validates, add it to the entry's Layers done. At the first failed validation,
set Status: stopped and Stopped at: <layer> — <failed item>, and stop (Rule 6).
Phase 5 — Confirm State and Close the Entry
- Confirm the chain:
node <skills-root>/spec-kit-shared/scripts/fingerprint.mjs --state <feature-dir>must reportARTIFACT_DRIFT: NO, andnode <skills-root>/spec-kit-shared/scripts/lint-artifacts.mjs <feature-dir>must report noBLOCKINGfinding other than L19 for this entry itself (stillplanneduntil step 2). Drift here means an owning procedure did not refresh its entry — stop withStatus: stoppedandStopped at: state — <artifact>rather than writing the hash on its behalf. - Set the entry's
Status: applied.
Phase 6 — Consistency and Hand-Off
- Run
spec-kit-analyze-consistency(read-only). Its Previously Reported section keeps an unchanged history short; onlyREADY_FOR_EXECUTION: YESlets the hand-off proceed. - Hand off to
spec-kit-execute-tasksscoped to the new amendment tasks. If the user's confirmation in Phase 3 included "and continue", invoke it directly; otherwise recommend it.
Pre-Execution Extension Hooks
Before Fase 0, check .speckit/extensions.yml per spec-kit-shared/artifact-conventions.md's
schema, reading hooks.before_amend. Follow the same enablement/condition/mandatory-vs-optional
rules the other spec-kit skills use.
Mandatory Post-Execution Hooks
After Phase 6, process hooks.after_amend the same way, using the same emit-then-execute format the
other spec-kit skills use.
Completion Report
Report:
RUN_ID: this run's log ID, oroff.SPECIFY_FEATURE_DIRECTORY: resolved feature directory.AMENDMENTS: eachAM-##with origin, layer, and status (applied/accepted/escalated/stoppedwithStopped at/abandoned), and any open entry resumed or undone this run.ARTIFACTS_CHANGED: per artifact, the IDs changed, or "unchanged" (with "reviewed, no change" where applicable).CLOSED_TASKS: superseded tasks and re-walked[CIERRE]tasks, or "none".EVIDENCE: probes run for this amendment and their observed results, or "none".VALIDATION: scoped checklist results per artifact.STATE:fingerprint.mjs --stateresult.CONSISTENCY:READY_FOR_EXECUTIONverdict and anyBLOCKINGfinding.AGENTS:none, or every generated Kiro/Claude path with validation and parity status.NEXT:spec-kit-execute-tasksscoped to the amendment tasks, or the escalation target.
Done When
- The run was logged from
run.starttorun.end(or logging is off). - Every applied change had a recorded decision and decider; none was decided here.
- Fase 0 confirmed the chain consistent before any edit (or the drift was part of this change).
- Each change was classified to its lowest owning layer; escalation conditions were checked.
- The amendment plan was confirmed once, with any needed probe already run.
- Every edit went through the owning skill's update procedure, validated before the next layer.
- No closed task was edited beyond an appended
Superada por:line. - Every decision is recorded in the owning artifact and in
amendments.md, the entry having been written asplannedbefore any edit. - Any open (
planned/stopped) entry was resumed or undone before new work started. state.jsonwas refreshed only by the owning procedures, for validated artifacts, andfingerprint.mjs --statereports no drift.spec-kit-analyze-consistencyreturnedREADY_FOR_EXECUTION: YESbefore hand-off.- No product code was written.
- Every generated support agent has a validated Kiro/Claude pair, or
AGENTS: noneis reported.
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.

