← ClaudeAtlas

stateful-artifactslisted

Build artifacts where the page itself is the record - trackers, checklists, sign-off boards, approval queues, polls, and collectors that remember what viewers do and share it across everyone who opens the page. Covers live-document sync regions, the classic publish model, conflict handling, read-only viewers, and local-only scratch UI. Trigger on "tracker", "checklist", "the page should remember", "shared state", "sign-off", "collect responses", "collaborative page", "save state in the artifact".
Lukehle/chartroom · ★ 0 · Data & Documents · score 70
Install: claude install-skill Lukehle/chartroom
# Stateful artifacts Some pages are not reports — they are **records**. A close checklist that several people tick through, a sign-off board, an approval queue, an input collector. The page holds the state and everyone who opens it sees the same thing. For shared persistence, declare `capabilities: { artifact: {} }`. Load the host's `artifact-capabilities` skill when available for the authoritative contract. If it is unavailable, build the local-only scratch mode below and label it clearly; do not claim shared persistence. --- ## Two models — pick deliberately ### Live document (preferred for trackers and checklists) Mark the region people edit. **The markup inside that region is the shared document.** Whatever a click or keystroke does to that DOM in your handlers is saved and reaches every view — and Claude. ```html <artifact-sync> <ul id="close-tasks"> <li data-id="C02"><input type="checkbox"> Bank rec — operating</li> <li data-id="C03"><input type="checkbox"> AR subledger to GL</li> </ul> </artifact-sync> ``` Or put the `artifact-sync` attribute directly on a `<tbody>` or `<ul>`. **The one rule that decides whether this works:** > Write the synced content as HTML in the page and **mutate that DOM directly**. Never render it from > a JavaScript object. A region re-rendered from JS state is not saved — by design. This is the mistake that costs an afternoon: everything looks correct locally, nothing persists. ```js // RIGHT - mutate the live DOM; this