adp-edit
Edit, publish or answer comments on an ADP artifact (adp/2: it has a manifest and a db). Load it before ANY edit, publish or comment reply on such an artifact, when a comment was sent to Claude, or wh
SKILL.mdplugins/artifacts-done-properly/skills/adp-edit/SKILL.md
GitHubEdit an ADP artifact (export, edit, propose)
Sites host: read the base ADP skill's refs/sites.md first. Keep this protocol;
use its native Sites calls and separate source/record revisions instead of the
Claude Artifact/ArtifactData calls below.
Changes are records: the page's record lives in its db, and every write to it is pinned to the version read (if_version); a refused write means someone wrote first. Full text: ~/.adp/catalog/kit/guides/artifact-dataplane.md (setup puts it there), read only if this road leaves a question open.
ADP means python3 -I <adp skill folder>/scripts/adp.py. DIR is the artifact laid out at its published paths and must hold EVERY published file. Batches are written to files (--out, default DIR.adp/) and printed as writes lists whose entries carry file_path. P.json maps "collection/doc" to the version you read, e.g. {"manifest/current": 4, "parts/home": 2}.
Docs (ArtifactData)
manifest/current, parts/<id>, content/<id>, changes/<NNNNNN> (append-only), agents/<name>, config/current, incoming/<pid>, requests/, presence/. Every doc read returns version; every write to an existing doc needs if_version.
Protocol
- Export (read).
ADP export DIR --url URLwithout its inputs prints the Artifact and ArtifactData reads and exits 2. Run them, save each result as the tool returned it (theArtifact listtext as it is, ArtifactData as JSON), run it again with--files-listing F.json --docs D.json [--version V]. It buildsDIR.adp/(incoming/,state.json, base/live/work,report.json) and merges live into work when nothing is held. A DIR that is missing or empty (a session editing a page it did not build) is filled with the live files by the first export, so nothing reads as held: do not read the page's files into DIR yourself (the Artifactreadreturnsindex.htmlinside the publish wrapper, and export stores it bare); read intoDIR.adp/incoming/filesas printed, or into any other folder. An empty ArtifactData collection is[](docs.jsonmay be{}for a page with no docs). A page with nomanifest/currentdoc was never seeded (a page built by an older session, or never opened by an editor): after this export merged, DIR equals live, so runADP seed DIR --by <you> --batches, write the printed batches (it is the record the editor open would have written; nothing else in the db changes), then export again and go on with step 2. A seed batch refused withversion_mismatchmeans another session seeded in the meantime: read the docs again, export again, and go on without seeding.ADP classify BASE.json LIVE.json INCOMING.jsonsorts parts and files into new, ours, theirs, applied, held, retired. - Edit in DIR. Keep every marker and
data-part; add both for a new part; never reuse a retired id. - Check.
ADP check DIR,ADP manifest DIR, thenADP diff OLD.json NEW.jsonorADP diff-pages OLD NEWfor the changed lines. - Propose.
ADP propose DIR --by <you> --summary S [--retire ID --reason R]writesincoming/<pid>and its batch; exit 2 lists what is held, unretired or missing an export. Resolve it, do not bypass it. Copy (content/<id>) is proposed only when its fragment changed after the export (src_copyin the state keeps the first copy the work tree had, andackadopts the copy as proposed), so a stale fallbackcontent.jsnever reverts a live copy doc; an edit made after a propose or before a re-export stays unsent until the next propose. - Applied. The page's inbox classifies the proposal against the manifest when an editor opens the page:
mergedis applied (by an editor's Apply, or at once where the page turns that on, as the catalog page does), which publishes the files in one call and records the change in What changed;heldmeans something moved since the export: an editor picks keep live or take the proposal for each held item in the inbox and then applies, or you export again and propose again;declinedis the owner's no. Readincoming/<pid>for itsstatus; once it isapplied,ADP ack DIR --proposal PIDmoves base. A proposal waits until an editor opens the page: tell the user it is waiting for them to open the page and apply.
Publish and record directly
Only for a page with no inbox (adp/1, or an adp/2 page that does not mount the inbox: one built from an older release, or from the artifact-data-protocol plugin's minimal template), or when the user wants the change live now and no editor will open the page. Hold before you edit (step 2), then publish and record in place of steps 4 and 5:
- Hold.
ADP hold DIR ID ... --by <you> [--hours H] (at most 2) [--pins P.json]prints one pinned batch and thehold_untilit set for the parts you will touch. A refused batch: export again. Someone else's live hold means hands off.P.jsonis{"parts/ID": version, "manifest/current": version}as read; a part you held is one version higher once the hold's batch has committed, so pin that one inrecord; itsneeds_pinlists what is missing or stale. - Publish to the same URL with
ADP files DIR [--since MANIFEST.json](only changed files; null removes one; MANIFEST.json isADP manifest DIRsaved right after the export, before your edit:manifest/currentlists parts and too few files) and alabelof at most 60 characters. On a conflict, merge onto the newer version; never force. Over 250 files use the printed batches. - Record.
ADP record OLD.json DIR --seq N --by <you> --summary "<what>" [--version V] [--threads T,..] [--pins P.json]prints the batch (OLD.json ismanifest/currentas read; at most 50 writes,manifest/currentlast). ThenADP ack DIR --result FILE, where FILE is the JSON the ArtifactData batch returned (it stores the new doc versions); a plain-text publish result is not accepted, so do not ack it.
ADP config shows the switches (a DIR is accepted and not read). If edit.locked is true, stop and tell the user who locked it; ADP config set KEY VALUE changes one.
Wording fixes need no publish
Copy lives in content/<part id>. Change it with an ArtifactData update with if_version, then record a change.
Comments and requests
- When a thread is sent to you, note the part its anchor sits in (anchors are part ids). Do not promise work in the thread.
- Make the change through the loop above (propose; publish and record only where that section says).
- Reply once it is applied, naming the version and the part ids.
- A page with the Work with Claude / Codex pane (the name is the host's agent label) keeps
requests/:ADP requests DUMP.jsonlists the open ones, withresolvedand, for a claimed one,lease. A host with a queue instead of a watching session (Sites) may need a guarded claim:ADP work DOCS.json --host claude|sites --artifact ID --path requests/RID --action claim|progress|checkpoint|block|complete --by <you>prints one pinned write (a lease with a token;completeneeds--tokenand--receiptwith passing checks); run it, read the doc back, and never blindly retry an unknown outcome. A reply from the page clears the claim. Answer one with a single ArtifactDataupdateofrequests/RID,{status: "done", response}(Markdown). A new request is version 1 and each write returns the next version, so the pin needs no read. On long work, first write{state: "working", progress: [{text}]}; after a page change, addchanged(part ids) andversion. Write no timestamps. A request a reply reopened is answered in the nextrequests/RID/turns/NNNN,{by: "claude", text}, with{status: "done"}on the request, pinned with its version as read;responsestays as it was.
Other
- Moving a page's records between hosts (Claude and Sites):
ADP bundle,ADP import-plan,ADP import-ack, described indocs/adp-export-import.md. They print the native calls; you run them; nothing syncs by itself. - Agents cannot join a room; they learn of changes from comment watches, the newer-version notice on an Artifact result, and
agents/.ADP log -n 20shows what the tool did.