← ClaudeAtlas

doc-amenderlisted

Event-driven LLM-amendment runner for Bucket-1(b) prompt-guided edits to fan-in destinations. Reads amender-eligible packets from ~/.claude/state/vault-staging/; runs operator-authored prompt asset (per governance/file-type-contracts/doc-amender-prompt.md.json) through `claude -p`; emits REPLACEMENT packet via lib/staging-emit.sh with packet_kind=amender-replacement. NEVER writes destination directly (R-34 boundary preserved via round-trip through staging). Triggered by launchd WatchPaths on staging root (NOT cron). Authored under Plan 81 SP14 Batch E T-28 (2026-05-19) per writer-pipeline-layering L-105..L-107.
peter-claude-vault/claude-stem · ★ 0 · Data & Documents · score 63
Install: claude install-skill peter-claude-vault/claude-stem
# Doc Amender Event-driven LLM-amendment runner for the Bucket-1(b) prompt-guided edit lane of the vault writer pipeline (Posture D — per-destination contract-driven hybrid; Session 4 L-41). Doc-amender sits BETWEEN `lib/staging-emit.sh` and `skills/writer-reconciler/` per writer-pipeline-layering L-106: it reads amender-eligible packets from staging, runs an operator-authored prompt asset through `claude -p`, and emits a REPLACEMENT packet back to staging via `lib/staging-emit.sh --packet-kind amender-replacement`. The 15-min reconciler tick then writes the destination mechanically per R-34. Doc-amender is **NOT** a cron skill. It is triggered by launchd `WatchPaths` on the staging root — every new packet that lands fires one process per event. Self-exclusion is critical: doc-amender's own emissions land in the same staging root and would re-fire the WatchPaths trigger. `process.sh` filters by `packet_kind ∈ {writer-emit, null}` (v1.0 back-compat) and explicitly excludes `packet_kind ∈ {amender-replacement, amender-conflict}` to prevent an infinite self-loop. Concurrent fires are coalesced (or blocked) via a global lockf on `$STAGING_ROOT/.doc-amender.lock`. Doc-amender is **NOT** a destination writer. R-34 is preserved structurally: all output round-trips through `lib/staging-emit.sh`, and the writer-reconciler owns the actual destination write on its 15-min tick. ## Pipeline ``` writer ─emit─► staging packet (packet_kind=writer-emit) │