Repository navigation
Closed
Description
Goal
A skill in the Claude plugin (plugin/skills/) that publishes a map view of a space as a private Claude artifact, refreshes its data, and reads comments left on the artifact. The renderer, template page and export command live in structured-context-map-views; this skill is the agent-facing steps. Plan and evidence: mindsocket/structured-context-map-views#17.
Steps the skill carries
- Run
structured-context-map-views export <space>(map-views#18) for the graph, validation results, schema id and applicable map view definitions as one JSON document. - Fetch the template
artifact.htmlfor a pinned map-views version (from the npm package via jsDelivr) and publish it unchanged with the Artifact tool, declaring only thedbcapability (map-views#19). - Write the export into the artifact db with
write_db(onespaces/<space>document, JSON as strings). Refreshing a space is the same write with the document's currentif_version; the page does not change. - Reading comments: a thread's
[location]reads likebutton "<view>/<nodeId>: <type> <title>…"(map-views#20 makes the host's labelling exact). Look the node up in thespaces/<space>document to get its fields, parent and validation messages. The location is the card even when the comment is on a child element of the card; parameter values (orientation, overlay level) are not in it, so ask if they matter. - A one-line note that the space's content is stored in the artifact and its database. No confirmation gate.
Decisions already taken
- Placement: a skill in this plugin, not a CLI command in core and not a plugin-bundled dependency. The command lives in map-views (it depends on core's library API; core depending on map-views would be a cycle and would pull React into this CLI). Rationale and rejected options: map-views#17.
- No wait on validate --json: emit the validateSpace result shape, not a second derived one #198: the export calls
validateSpace()directly. validate --json: emit the validateSpace result shape, not a second derived one #198 (onevalidate --jsonshape) remains worthwhile for consistency. - Where a setting lives: the skill passes the space name and relies on config as the CLI does (no new environment variables).
Findings the skill should encode
- Comments reach the agent only as
[location](accessible name of the element) and the[anchored at]DOM path. Page-invented anchor names (customAnchors) andonSendToClaudedid not work for the viewer tested, so the skill must not suggest them. - Per-document size limit of the artifact db is unknown; for a large space the skill should chunk (
write_dbbatches of 50) and say so. - Needs the Artifact tool; not usable from a plain CLI session.
Definition of done (this repo)
- New skill under
plugin/skills/; update the command list inplugin/skills/structured-context/SKILL.mdif it should be discoverable from there; troubleshooting entries for the failures seen (blank page from a duplicate React,dbunavailable, doc missing). docs/: one short mention where map views are described, if any; keep detail in the skill.- Plugin version bumps via the pre-commit hook; do not edit it.
Blocked by
map-views#18 (export), #19 (template and host), and ideally #20 (data-node-id). Write the skill as if these are released, test against local checkouts until they are.
Metadata
Metadata
Assignees
Labels
No labels
Activity
feat(plugin): publish-map-view skill