Skip to content

mcpx docs: an agent-markdown twin of every page, and the bot home page carries the install prompt #1947

Closed

Description

@dezren39

Relocated from dezren39/darwin-nix#120 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).

Parent: #90

Summary

Every page of the docs site gets a machine-readable twin written for agents. On top of that, the site publishes llms.txt and llms-full.txt. The agent twin of the home page carries a one-shot install prompt: a procedure an agent can execute to install mcpx, verify it, and wire it into the harness it is running in. The same agent docs should also ship inside the binary, so an offline agent gets docs that match its version.

Original notes

  • documentation
    • make a book using whatever is the most common and simple modern choice
      • specialized agent markdown all pages
        • home page has install prompt built into the bot version

Current state

The conventions (llms.txt v2)

Fetched from llmstxt.org (v2, modified 2026-08-10):

  • /llms.txt is markdown in a fixed order:

    1. an H1 with the project name (the only required part);
    2. a blockquote summary;
    3. optional non-heading prose;
    4. H2 sections that are "file lists" of [name](url): notes.

    An ## Optional section by convention holds links an agent can skip. The file may sit at any path and covers the pages under it, e.g. /docs/llms.txt.

  • A clean markdown version of each page at the same URL, with .md appended (page.html.md) or replacing the extension (page.md). URLs without a file name use index.html.md / index.md.

  • Discovery: <link rel="alternate" type="text/markdown" href="...md"> in each page, and rel="describedby" pointing at the llms.txt that covers the page. These can also be sent as an HTTP Link: header, but GitHub Pages cannot set headers, so we use HTML <link> elements only.

  • llms-full.txt is not in the spec. It is a widely used convention: every page concatenated, used by Starlight, Docusaurus and Mintlify plugins.

  • No content negotiation. GitHub Pages is static: it cannot answer Accept: text/markdown with the markdown twin at the same URL, and it cannot set Link: headers. Agents have to be pointed at .md URLs explicitly (in llms.txt, the <link> element and the home page). Say so on the site, so nobody expects negotiation to work.

Caveat: Zensical's own analysis (ZAP 009) notes limited evidence that vendors' agents consume llms.txt. The per-page .md twin and the embedded docs are the parts that pay off regardless. llms.txt is cheap once the twin exists.

What "specialized" means

A raw copy of the markdown source is not enough. An agent page should:

  • Drop decoration: the video, copy buttons, the rotating prompt, <details> wrappers (expanded instead), badges, theme HTML.
  • Inline what the HTML page links or includes: the generated reference (🎨 Palette: Improve accessibility of editor search panel #144), i.e. settings, flags and env vars, command usage, as plain markdown tables or text, with {{#include}} and shortcodes already resolved. Zensical makes the same point: markdown must be an output of the pipeline, not a copy of the source.
  • Carry agent instructions:
    • a short header (what this page is for, what to run next, the one command that answers the page's question: mcpx help <cmd>, mcpx config --schema, mcpx types <ns>);
    • version-matched: "these docs describe mcpx vX.Y. If mcpx --version differs, prefer mcpx help."
  • Be sourced from AGENTS.md where it applies. It already is the agent-facing instruction file, so the site's agent pages for the loop, scripts and results should be derived from it or include it, not rewritten. There should be one agent-facing text, not two that drift.
  • Keep the version history (🎨 Palette: Add ARIA labels and live regions to search panel #150) flattened but present. Agents need "since vX" more than humans do.

The bot home page: the install prompt

/index.md and the top of /llms.txt carry a procedure an agent can execute end to end, written as numbered imperative steps with the exact commands and the checks between them:

  1. Detect OS and architecture, the available package managers (nix, brew, go, ...) and the harness it is running in (opencode, claude code, codex, ...).
  2. Pick the channel from the list in amd host fails at evaluation: no outputHashes for p2panda-core-0.7.1 #158: nix profile / flake, Homebrew, go install, release binary, curl <short> | sh. Prefer one that installs per-user and needs no root. Say which channel was chosen and why.
  3. Install, then verify: mcpx --version, mcpx doctor, and mcpx ls, which must list namespaces or say clearly that none are configured.
  4. Wire the harness plugin for the detected harness: opencode via the plugin files (today a copy; a package once amd host fails at evaluation: no outputHashes for p2panda-core-0.7.1 #158 exists), or others via Update Rust crate anyhow to 1.0.75 #48's adapters or mcpx as an MCP server. Then verify from inside the harness.
  5. Optionally move the user's existing MCP servers behind mcpx. After the agent shows the diff and gets confirmation, it comments out (never deletes) the user's existing MCP server entries in the harness config, so that the servers are reached through mcpx instead of loaded directly. This echoes the home page prompts in 🎨 Palette: Add aria-labels to buttons and inputs #155. Whether mcpx should import them first (mcpx init or registry add) is an open question.
  6. Report what was installed, where, and how to undo it.

The human home page (#155) shows the same prompt behind a copy button. The bot page is the prompt, with nothing around it. Keep a single source for the text so the two cannot drift.

Shipping the agent docs in the binary

An agent with mcpx on PATH but no network, or with a different version than the site, should get docs that match the binary it has.

Prefer a format flag on an existing command over a new command:

  • mcpx help --format markdown (or mcpx man --format markdown|roff) prints the agent version of the command reference, generated from Commands() like the man page.
  • mcpx help agents (or a topic argument) prints the embedded AGENTS.md.

Coordinate with #144: the markdown emitter that feeds the site's reference pages should be the same one behind this flag, so the site's agent pages and the binary's output are byte-identical for the same version. Embedding AGENTS.md costs a few KB, and go:embed is already in use.

Approaches: how the twin is produced

Approach A (least recommended): generator plugin only

Examples: starlight-llms-txt, docusaurus-plugin-llms, mdbook-llms-txt-tools, or Hugo's built-in markdown output format with .RawContent.

  • It is fast to turn on.
  • But these plugins emit the source (or lightly cleaned HTML-to-markdown): shortcodes and includes are raw or dropped, decoration leaks in, there is no agent header, and the output shape changes with the plugin version.
  • It ties the twin to the generator chosen in chore(deps): update rust crate actix-files to v0.6.10 - autoclosed #117, and cannot produce the in-binary docs.

Approach B (middle): a build step emits .md + llms.txt from the same source

  • A small program in this repo reads the book after preprocessing and writes, per page:
    • <page>.md, with decoration stripped, includes resolved and an agent header prepended;
    • llms.txt (ordered like the site navigation, one ## per top-level section, with a one-line note per page taken from its lede);
    • llms-full.txt.
  • The source can be an mdBook preprocessor over the JSON book, as in fluree/db#1340, or a Hugo template.
  • It adds <link rel="alternate" type="text/markdown"> to every HTML page via the theme.
  • The result is deterministic, generator-light and checkable in CI. It still only derives the twin mechanically. Pages that need a different shape for agents (the home page, the install prompt) have no place to live.

Approach C (recommended): B, plus hand-written agent sources where they add value, plus the same emitters in the binary

Why C: it is the only option that gives agents something better than the human page with the chrome removed, and still keeps one source of truth per fact.

Open questions

  1. Where are hand-written agent pages allowed? Only the home page and the loop, or any page? Too many overrides and the twin drifts from the human page.
  2. Size budgets. llms.txt should stay small (a few KB; it is meant to be read whole). llms-full.txt for the whole compendium (docs(id): design plan, research, and n0 relay default #152) could run to megabytes (Fluree's is ~1.9 MB). Should we split it into llms-full.txt (levels 1 and 2) and a separate compendium file, or cap it and list the rest under ## Optional?
  3. Twin URL shape: page.md or page.html.md? Both are allowed by the spec. page.md is shorter; page.html.md never collides with a source file.
  4. Should the install prompt be versioned (pinned to the release it was published with), or always install latest?
  5. Which harnesses does the prompt cover at first: only opencode, or all of Update Rust crate anyhow to 1.0.75 #48's list?

Ease · Impact · Related

Ease M (B is S once #117 is chosen; the install prompt and the in-binary docs make it M) · Impact high (agents are a primary audience of mcpx) · Depends on / related: #117, #118, #155, #158, #144, #145, #150, #152, #44 (closed, fixed in #53), #48, #49

Security/auth deferred; see tracker.

Activity

  1. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    History carried over from dezren39/darwin-nix#120 (verbatim, oldest first):


    @dezren39 · 2026-09-30T07:20:18Z

    Integration pass. Placed in the DAG rooted at #181.


    @dezren39 · 2026-09-30T11:49:09Z

    Issues pass (2026-09-30, at 05c78b2).

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Oct 29, 2026
  4. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  5. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Triage verdict — not a duplicate; split: in-binary half unblocked and enqueued, site-twin half waits on #1941

    Dedupe: no existing code issue covers the agent-twin or in-binary docs. #1941 (build the site in CI, deploy to GitHub Pages) and #1903 (generated reference that cannot drift) are dependencies this issue coordinates with, not duplicates; the docs layer trackers (#1894/#1898/#1848) do not include per-page agent twins or llms.txt.

    Scope check against current pkgs/mcpx main (2026-10-29, via GitHub API):

    • No site pipeline exists in the repo yet and mcpx docs: build the site in CI and deploy to GitHub Pages #1941 is still open: pkgs/mcpx/docs is plain markdown, there is no generator config, and no llms.txt / twin machinery anywhere in pkgs/mcpx (llms appears only as mentions in docs/spec/requirements.md and docs/proposals.md). The per-page twin, llms.txt/llms-full.txt, discovery <link> elements and the bot home page / install prompt all attach to that site and cannot start before it.
    • The in-binary half is independent and untouched: AGENTS.md is not embedded (the only go:embed is internal/defaults/defaults.json), package.nix does not install it, and there is no mcpx help agents / docs topic (0 code hits).

    Follow-up enqueued: queue task 3244 (small_fix) — embed AGENTS.md via go:embed and print it verbatim via mcpx help agents, with a byte-identity test. The issue's mcpx help --format markdown emitter stays here too: it must be the same emitter as the generated-reference work (#144/#145 line), so it belongs with that coordination, not in 3244.

    Remainder on this issue: site twins + llms.txt + install prompt, gated on #1941; open questions (override allowance, size budgets, twin URL shape, prompt versioning, harness coverage) are Drew-facing design choices to settle when the site lands — not blocking 3244.

    Verification for the follow-up: pkgs/mcpx: go test ./... via CI on its PR.

  6. added and removed
    queue/claimedQueue worker lifecycle state
    on Oct 29, 2026
  7. 60 remaining items

  8. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · in progress

    • Agent: queue worker (repo-worker-code), Muse lane any-i
    • Session / ID: task 19668
    • Found via: queue claim
    • Task: mcpx docs: an agent-markdown twin of every page, and the bot home page carries the install prompt #1947 site half step 1 (Approach B+C) per task 15179's recorded design defaults: per-page .html.md twins from the preprocessed book source, llms.txt (≤10 KB) / llms-full.txt (levels 1–2, compendium in its own file, the rest under ## Optional), the bot home page install prompt (install latest; mcpx --version + prefer mcpx help on mismatch as the version guard), theme alternate links, and a CI twin-currency check. Overrides: hand-written only for the home/install-prompt page (and AGENTS.md-derived loop pages); any other override must state its reason.
    • Plan: new stdlib-only Go tool pkgs/mcpx/tools/docs-twins (emit + check), twin content rendered through the existing docs-history render --agent seam; hand-written home twin at pkgs/mcpx/agents-docs/index.md; wired into the .#mcpx-docs derivation (docs.nix) after mdbook build, with check as the build/CI gate; Go unit tests on fixtures.
  9. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 17, 2026
  10. added a commit that references this issue on Nov 17, 2026
  11. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), Muse lane any-i
    • Session / ID: task 19668
    • Found via: queue claim
    • Delivered: PR feat(mcpx): agent-markdown twins for every docs page (#1947) #11144 — MERGED 2026-11-17T08:03:13Z (merge commit f48d558). Closing this issue: every element of its scope has now landed — the in-binary agent docs via PR mcpx: embed AGENTS.md and print it via mcpx help agents (#1947) #2620, and the site half here.
    • What landed: pkgs/mcpx/tools/docs-twins (emit/check, stdlib-only Go) — per-page .html.md twins rendered through docs-history render --agent; llms.txt (8,788 bytes on the real book, ≤10 KB budget enforced), llms-full.txt (levels 1–2), llms-compendium.txt; discovery <link rel="alternate" type="text/markdown"> + describedby injected into every page; hand-written home twin with the one-shot install prompt at pkgs/mcpx/agents-docs/index.md (install latest via nix, mcpx --version/mcpx doctor verify, prefer mcpx help on mismatch, full opencode wiring, other harnesses as MCP-server use); overrides beyond the home/loop pages require a stated override-reason: or the build refuses them. Wired into the .#mcpx-docs derivation so the flake build itself is the twin-currency CI gate; mcpx-docs.yml asserts the staged site carries the agent surface.
    • Verification: go test ./tools/docs-twins/ pass; real-book emit+check over 104 chapters pass; nix build .#mcpx-docs succeeds with the gate green inside the build (docs-twins: wrote 107 files … check passed). Codex review failed to complete (usage limits, no findings delivered) and CodeRabbit was rate-limited — disposition recorded on PR feat(mcpx): agent-markdown twins for every docs page (#1947) #11144 (comment 6942255017).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

epic/mcpx-platformReprioritization program epic (2026-11-12)source/creatorFiled by the new-issue-creator jobstatus/donestatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions