--- name: octo-html version: 0.3.0 description: HTML docs domain (octo-doc) — create and govern self-contained interactive HTML documents, immutable versions, drafts, sharing, media, comments, and agent element edits. Bots cannot delete documents. This is a DIFFERENT backend from the `octo-docs` (CRDT/Yjs) domain. Load after octo-shared. metadata: requires: bins: ["octo-cli"] skills: ["octo-shared"] --- # octo-html — interactive HTML documents > **This is NOT the `octo-docs` body-editing domain.** `octo-cli html …` talks > to **octo-doc**, where a document is a self-contained HTML page published as > immutable versions. `octo-cli docs …` talks to the separate CRDT/Yjs backend. All commands call `$OCTO_API_BASE_URL/docs-html/v1/*` and return the standard `{ok, identity, data, ...}` success envelope. ## Document-reference contract - **Canonical create has no document reference.** Omit `slug` and provide `html`. The CLI generates `idempotency_key`; an explicit key is optional. A display name belongs in `meta.title`; it is metadata, not identity. - **Save `data.slug` from the response.** New documents always return `data.doc_id` and `data.slug`, with `data.slug == data.doc_id`, whether mounted or unmounted. Use `data.slug` for every later operation. - **Legacy documents keep their old reference.** For an old document, use its legacy slug wherever this skill says ``. - **No alias identity and no same-name republish.** Creating again with the same `meta.title` creates a different document. To publish another version, supply the saved `data.slug` in the server's legacy-named `slug` field and set `--version` to the version read with `html source` plus one. - Do not infer a mode from `mount_type`, `registered`, `status`, or whether `data.doc_id` is non-empty. `registered` and `status` report operational state, not identity. Query and JSON-body fields remain named `slug` for wire compatibility. Put the saved document reference in them. Path help displays ``, and old legacy slugs are accepted. The CLI does not persist the reference. **Minimum rollout dependency:** this contract requires the canonical-create server changes in octo-docs-backend#166 and octo-docs-html#33 to be merged and deployed before this CLI is released. Source reads and guarded bot updates also require octo-docs-html#34. **The HTML backend will be deployed first.** The CLI release and rollout of its updated skills follow only after the source endpoint and publish guard are deployed and verified on every HTML-serving instance. Do not release this workflow during a mixed old/new backend rollout. If `html source` unexpectedly returns a route-level 404, check the same reference with `octo-cli html get ` using the same identity and gateway. If metadata is readable, the document exists: report that the source endpoint is unavailable and the backend deployment or gateway routing needs checking. Do not report the document as missing or create a replacement. If both reads fail, a 404 alone cannot distinguish a missing/inaccessible document from a deployment problem; retain the reference and report the uncertainty. Stop this update until source access is restored. Do not infer a version from metadata, publish without a version, or switch endpoints to bypass the guard. Once the backend is ready, recover actual 409/428 version errors autonomously as described below. ## Auth & space - Authenticate with a stored bot profile (`--profile` / `--bot-id`) or `OCTO_BOT_TOKEN`; confirm the selected identity with `octo-cli config show`. - Do not pass `--space`. octo-doc resolves identity and space server-side. - Write operations require author/write capability. Reads need at least reader capability; backend failures are normalized into the CLI's `{ok:false,error:{type,code,message,hint,detail}}` envelope. ## 1. Create and publish **Bots cannot delete documents, even as author, owner, or admin.** Do not run `octo-cli html rm ` or use `docs delete` / raw `api DELETE` as an alternative. Ask a human with document admin permission to delete it in Octo. This includes cleanup of test documents and applies to canonical IDs and legacy slugs. Creating, publishing versions, editing, and permitted asset/comment operations are unchanged. `html rm` targets `/docs-html/v1/docs/{doc_id}`, a different service entry from the docs-backend `/v1/bot/docs/octo-doc/:octoDocSlug` deletion route. Do not infer that one route's deployment proves the other's enforcement, and do not probe the other route as a workaround. **Documents are declarative: no JavaScript.** The backend rejects any publish or draft whose HTML carries script, with `400` and the stable code `html_contains_javascript`. This is not advisory — there is no flag to opt out. When generating a document, never emit: - `