/plans:publishfrom plans
Publish, verify, and delete artifacts (HTML plans, images, video) through the installed Plans CLI against a self-hosted Plans server, turning a file or stdin into a viewable URL with a TTL or permanent retention. Use for "artifact", "upload a plan", "publish this page", "host this", "share this screenshot", "upload the recording". Not claude.ai Artifacts.
Ships in plans. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use the installed plans CLI as the supported client for a self-hosted Plans server (plansd, from the same repository as the CLI). Treat publishing as an external write and each returned viewer URL as a sensitive read capability.
Run command -v plans when client availability is uncertain. If it is missing, tell the user to run go install github.com/jakub/plans/cmd/plans@latest. Do not run it yourself. The server it talks to is plansd, built from the same repository.
Run plans version when version evidence matters.
The CLI has no default endpoint. It takes the API URL from the first of these that is set:
--api-url flag$PLANS_API_URL$XDG_CONFIG_HOME/plans/api-url, or ~/.config/plans/api-url when XDG_CONFIG_HOME is unsetWith none of the three set, the CLI exits with an error naming all of them before it sends a request. When that happens, stop and tell the user to configure one. Never guess, invent, or borrow an endpoint: the CLI sends the bearer token and the artifact to whatever origin it is given.
The token comes from $PLANS_TOKEN, then --token-file (which defaults to $PLANS_TOKEN_FILE), then $XDG_CONFIG_HOME/plans/token or ~/.config/plans/token. Rely on this resolution unless the user requests an override.
Never print, inspect, copy, or return the raw bearer token. Do not regenerate or replace it without explicit authorization.
This section is the one statement of when to publish, how long to keep an artifact, and where its URL may go. plans:show and plans:doc follow it and do not repeat it.
--public flag or any other way to make an artifact reachable outside the private viewer. The client in the reference below has no such flag.--keep when the user explicitly asks for permanence, or when the artifact is PR evidence.--ttl 12h for a Document that replaces an Inline render the host could not show.--ttl <duration>. For example, three days is --ttl 3d. A duration uses hours, whole days, or whole weeks, and cannot exceed 365 days.--ttl and --keep.Attachments inherit the plan's retention, so --keep on a plan makes its media permanent too.
Each viewer URL is a read capability. Anyone who has it can open the artifact.
Each upload is one file, and the CLI infers its media type from the extension. Anything outside this table fails before the network is touched, and the server rejects an unlisted type with 415:
| Extension | Content type |
|---|---|
.html, .htm | text/html |
.png | image/png |
.jpg, .jpeg | image/jpeg |
.webp | image/webp |
.gif | image/gif |
.svg | image/svg+xml |
.mp4 | video/mp4 |
.webm | video/webm |
Publish an image or a video directly when the user just wants a screenshot or recording hosted. Publish HTML when the deliverable is a plan, report, or visualization. Stdin (-) is always treated as HTML.
Inline the plan's own code, because the viewer's CSP blocks external network access:
img-src and media-src are 'self', so a media element resolves against the viewer origin. Every other external request is denied.Inline scripts work, but the sandbox omits allow-same-origin, blocks outbound connections, blocks forms and embedding, and prevents the artifact from escaping its origin.
Publishing an HTML file auto-publishes the local media it references. The CLI scans src attributes on img, video, audio, and source for relative paths (./shot.png, assets/clip.webm), publishes each referenced file as its own artifact with the plan's TTL, splices the capability URLs into the document, and publishes the plan last, naming those artifacts as its bundled attachments.
Write plans that use this rather than embedding large media as base64:
.. path or a symlink out of that directory is rejected — the CLI will not upload a file from elsewhere on disk.src attributes only. srcset, poster, CSS url(), and anything JavaScript builds pass through untouched; inline those as data: URIs or point them at already-published artifact URLs.shot.png?v=2), and percent-escapes are decoded when locating the file. The whole reference is replaced by the capability URL.//) pass through.src naming a local .html file is rejected; no media element renders HTML.Each attachment is an ordinary artifact with its own key and the plan's TTL, but the plan bundles it: they share the plan's lifetime settings, and deleting the plan deletes them. Human output lists the attachments on stderr (capability URL first, then the reference as written) while stdout stays the single plan URL. --json lists them under attachments, each entry a full artifact response plus the path as written in the document.
If an attachment upload, the splice, or the plan upload fails, the CLI deletes what it already published and names anything it could not delete. That rollback belongs to the CLI. Report each key it names as unresolved, and run plans delete on one only when the user asks you to.
Publish only under the authorization in the delivery policy.
Prefer JSON output so the result can be checked precisely:
plans publish --json report.html
plans publish --ttl 2w --json report.html
plans publish --keep --json handbook.html
plans publish --json shot.png
plans publish --json recording.mp4
plans publish --json -
The response contains key, url, content_type, created_at, size, and sha256, plus expires_at unless the artifact was published with --keep, plus an attachments array when an HTML publish carried media. Redirect the JSON to a file and parse it afterwards: a parse failure on a piped response loses the keys of artifacts that were already created. Do not expose keys separately when returning full URLs.
After publishing, verify the live artifact unless the user explicitly asks for upload only:
200 OK and a Content-Type matching the artifact: text/html; charset=utf-8 for a plan, the verbatim allowlisted type (image/png, video/mp4, …) for media.Cache-Control includes no-store and that a sandboxed Content-Security-Policy is present.Accept-Ranges: bytes and that a Range request returns 206 — seeking depends on it. A HEAD is enough to check headers without pulling the whole file.Use a temporary file for downloaded verification bytes. Send the URL only where the delivery policy allows.
The render check loads the live page in a real browser and looks for the faults that the headers cannot show. Run it on every HTML artifact unless the user asked for upload only.
prefers-color-scheme.plans:doc built, change one answer and type one note, where the page has them, then check each of the four views again. If the page has a response region, check that Copy response either reports "Copied" or selects the whole response. A page with no response region shows no response controls, such as a note box or a Copy response button.security, or a failed request with blockedReason: csp. Chromium 155 prints no "Refused to" line for a CSP block, so a check that matches only that text misses it.206 response is healthy, because the browser requests media in ranges.Lead with the clickable viewer URL. Then state:
Do not include the bearer token, its digest, or internal artifact storage paths.
Delete only with explicit user intent because deletion is destructive:
plans delete --json <key-or-full-viewer-url>
The client accepts either the capability key or the full viewer URL. Deleting a plan deletes the plan and then every attachment it bundled, so one key in can be several keys out:
deleted <key> line per removed key, plan first.--json prints {"deleted":["<plan-key>","<attachment-key>", ...]}.1. The server reports it in one of two forms:
--json adds "failed":[...] and "error", and stderr ends with still present, delete each directly: <keys>. Run plans delete on each of those keys.--json has "error" and no "failed". Delete the attachment keys you already know from the original publish result. If you have none, tell the user that attachment cleanup is unresolved. Do not guess keys.The plan's metadata was the only server-side record of its attachments, so keep the publish result and the delete output until cleanup is confirmed.
Verify a subsequent viewer request returns 404 when confirmation matters.
API errors print as plans: plans API returned HTTP <code>: <message>.
plans: command not found: report the missing client and give the user the install command (go install github.com/jakub/plans/cmd/plans@latest); check whether Go's bin directory ($(go env GOPATH)/bin) is on PATH first. Do not install it yourself.no plans API URL configured: stop and tell the user to pass --api-url, set PLANS_API_URL, or write the URL to the file path the error names ($XDG_CONFIG_HOME/plans/api-url, or ~/.config/plans/api-url when XDG_CONFIG_HOME is unset). Do not guess an endpoint.401 (unauthorized): treat the local token and the server's stored digest as out of sync; do not rotate credentials automatically.413 (artifact exceeds the upload limit): reduce the artifact below the server's upload limit — re-encode video, or drop resolution rather than splitting the file.415 (unsupported artifact content type): the declared type is outside the eight-type allowlist.404 Not Found when viewing: treat the key as unknown, expired, or deleted; do not try to enumerate alternatives.plans publish [--ttl 12h|7d|2w | --keep] [--json] [--api-url URL] [--token-file FILE] FILE|-
plans delete [--json] [--api-url URL] [--token-file FILE] KEY|URL
plans token [--json | --write FILE]
plans version
plans token generates a new upload token and the digest the server stores. It is a server-setup command: do not run it during normal publishing, and never show its output.
What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/docWrite a long HTML Document that explains one thing to a reader, such as a plan, a review, a walkthrough or a report, in a technical-drawing look with inline SVG figures and optional native-input questions that return one markdown response, then build and browser-check it for plans:publish. Use when plans:show routes a visual to a Document, or when the user asks for an HTML plan, review, walkthrough, report or explainer page./showDecide when a reply needs a visual and where it goes, whenever a visual, chart, table, diagram, mockup, screenshot set or any HTML output is in play. Says when to show one by default, then picks one of three tiers by seven ordered rules, among a Sketch in chat, an Inline HTML render in the T3 thread and a published Document, says when to ask through the host question tool instead of a page, and covers the fallbacks when render tools, the plans CLI, Node or Chromium are missing. Use it on a reply that compares numbers, explains a code change or reports a UI change, before plans:doc, before plans:publish, and before any html_render call.Other plugins' skills for the same job
npx claudepluginhub jakub/marketplace-plugins --plugin plans