Skip to content

feat(docs): serve llms.txt, the docs as Markdown and llms-full.txt - #58

Merged
kalaspuff merged 3 commits into
mainfrom
fctl/266-let-s-create-an-llms-txt-that-should-be
Oct 24, 2026
Merged

kalaspuff merged 3 commits into
mainfrom
fctl/266-let-s-create-an-llms-txt-that-should-be

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Serves fctl's guide for agents and its docs in the forms agents read best (llms.txt):

  • /llms.txt: fctl's new docs/llms.txt, copied as it is.
  • /docs/<slug>.md: each docs page as Markdown (the overview at /docs/index.md), with every link made absolute: to the other pages' Markdown, or to the file on GitHub. Each HTML page links its Markdown as an alternate.
  • /llms-full.txt: llms.txt followed by every page, each with its address.

_headers declares these files UTF-8: Cloudflare sends .txt and .md without a charset (app.fctl.sh's /llms.txt does today), and clients that then read them as Latin-1 garble their →, … and —. fctl's two new pages, For agents and HTTP API, join the navigation after the CLI. Heading ids now drop apostrophes as GitHub's do. Before, "Confirming it's you" got confirming-it-39-s-you, so links to architecture.md#confirming-its-you missed it. The page mapping and link rewriting moved to scripts/pages.mjs, with tests. The deploy's smoke test also fetches /llms.txt and a Markdown page.

hyperstructure/fctl#267 is merged and fctl's CI pinned it (fctl-docs.ref at 45e0368), which this branch now has from main, so the build finds the new pages. Verified at that commit: npm run build renders 11 pages, their Markdown (all links absolute) and llms-full.txt. Under wrangler dev, /llms.txt and /llms-full.txt answer as text/plain; charset=utf-8 and /docs/*.md as text/markdown; charset=utf-8, and HTML pages are unchanged. npm run check reports only the two !important warnings that main has, and npm test passes all 18 tests.

Screenshots

The new pages, built from fctl's branch, served by wrangler dev: For agents in the light theme and HTTP API in the dark one, at 1440 px; HTTP API's session table at 390 px.

agents-light.png

api-dark.png

api-light-390.png

Worth confirming

  • Decision: The Markdown pages' links point at the other pages' Markdown (https://fctl.sh/docs/cli.md), not their HTML, so an agent that follows them keeps reading Markdown.
  • Decision: /docs/cli.md and the like now serve Markdown where they used to give the 404 page's "Did you mean /docs/cli/?".

fctl session

For agents (https://llmstxt.org): fctl's docs/llms.txt is at /llms.txt,
each docs page at /docs/<slug>.md as Markdown with absolute links (the
overview at /docs/index.md), and /llms-full.txt is llms.txt followed by
every page. Each HTML page links its Markdown as an alternate.

fctl's new pages, For agents and the HTTP API, join the navigation, and
heading ids drop apostrophes as GitHub's do, so links like
architecture.md#confirming-its-you land on their heading. The deploy's
smoke test fetches llms.txt and a Markdown page.
@fctl-sh

This comment has been minimized.

Comment thread scripts/pages.mjs Resolved
@fctl-sh

fctl-sh Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

The failing build check is the expected one: it reads fctl's docs at the commit fctl-docs.ref pins (6247af4), which has no docs/agents.md yet (ENOENT in the run). The check and test steps before it passed.

The same build passes once fctl has those docs: FCTL_DOCS_REF=639bc94 npm run build, which fetches hyperstructure/fctl#267's head the way CI fetches the pinned commit, renders 11 pages, their Markdown, llms.txt and llms-full.txt. So nothing here changes. Once #267 merges and fctl's CI pins its commit, I'll merge main into this branch and the check passes. Until then, this pull request waits.

kalaspuff pushed a commit to hyperstructure/fctl that referenced this pull request Oct 24, 2026
…it (#267)

## Summary

Adds `docs/llms.txt`, a guide for agents in the [llms.txt
format](https://llmstxt.org). It covers what fctl is, its vocabulary
(instance, workspace, project, session, runner, host, sandbox, schedule,
memory…) and roles. It also covers the session lifecycle, how agents
work with GitHub (branches, pull requests, follow-ups for comments,
failed checks and conflicts, review agents) and Claude credentials. Then
it says how to drive the CLI and the API safely from another agent or
program, gives 14 recipes (delegating and waiting, fan-out, starting
agents from any tool, schedules, review agents, Linear, project and host
setup, reports) and lists what to avoid, with links to every doc. Every
instance now serves it at `/llms.txt`: the web app's build emits it, and
the standalone image copies it in. fctl.sh serves it once the fctl-site
pull request below merges.

The details it links to are in two new docs: `docs/agents.md` (tokens,
which commands return, waiting for a turn, reading transcripts,
pitfalls, full recipes, what agents do in their sandbox) and
`docs/api.md` (the HTTP API's conventions and the endpoints programs
use). `docs/cli.md` now covers the CLI behaviors the task's notes
listed, each checked against the source and a running stack. `fctl run`
without `-d`, `fctl attach` and `fctl logs -f` keep following after a
session stops. Without text, `run` and `send` wait for stdin to close.
`fctl logs --json` prints one event per line, and usage errors exit with
2. `--env` values aren't secret. It also documents the flags it lacked
(`--confirm` for deletions without a terminal, `schedules add --paused`,
`projects create --slug`, `host install --name` and `--image`, and
others). A new xtask test checks that every link in `docs/` resolves:
files, headings, and fctl.sh's Markdown pages.

Verified with `cargo xtask check --quick` and against `cargo xtask dev`:
the documented wait loops (CLI and API), idempotent sends with
`client_id`, a when-asked schedule run by a token with context, and the
transcript filters. A production web build served by workerd answers
`/llms.txt` as `text/plain; charset=utf-8`.

Refs #266, which records what the CLI can't do yet (project secrets,
members, sharing and archiving sessions, a project's model, effort and
instructions); the docs send people to the web app or the API for those.

- hyperstructure/fctl-site#58

## Worth confirming

- **Decision:** The file lives in `docs/llms.txt` rather than at the
repository's root. That way CI pins it to fctl.sh with the other docs,
and the standalone image's build copies it from there; the README links
to it.
- **Decision:** Instances' `robots.txt` now allows `/llms.txt` and still
disallows the rest of the app, so fetchers that honor robots.txt can
read it.
- **Decision:** Links in `llms.txt` point at fctl.sh's Markdown pages
(`https://fctl.sh/docs/<page>.md`, `/llms-full.txt`). Those exist only
after the fctl-site pull request merges, which waits for this one to be
merged and pinned.
- **Assumption:** The HTTP API may be documented for programs to call
directly, as `automation.md` already does for two endpoints.
`docs/api.md` describes today's routes and bodies.

[fctl session](https://app.fctl.sh/s/ses_01M5QX2QPKNQY8VJ8YYY0K547J)

---------

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
fctl-sh Bot added 2 commits October 24, 2026 22:32
Cloudflare's static assets send .txt and .md files without a charset,
and clients that read such text as Latin-1 garble the docs' UTF-8 (→,
…, —). _headers rules declare charset=utf-8 for them.
kalaspuff pushed a commit to hyperstructure/fctl that referenced this pull request Oct 24, 2026
## Summary

Since #267, app.fctl.sh serves `/llms.txt` as `text/plain` without a
charset. Cloudflare's static assets declare none for `.txt`, unlike
`wrangler dev` and the standalone server, which add `charset=utf-8`. The
file has UTF-8 characters (→, …, ⌘), and clients that read text without
a charset as Latin-1 garble them: browsers often do, and so does
Python's `requests` (`response.text`). A rule in `web/public/_headers`
now declares `text/plain; charset=utf-8` for it. Cloudflare's docs say
`_headers` rules override the headers it ordinarily sends.

Verified: `curl -sI https://app.fctl.sh/llms.txt` says `content-type:
text/plain` today. Under `wrangler dev` the built assets answer
`/llms.txt` with a single `text/plain; charset=utf-8`, and a scratch
rule with a distinct value replaced the default rather than being joined
to it. `npm run check` and `npm test` pass for the web app.

hyperstructure/fctl-site#58 does the same for fctl.sh's `/llms.txt`,
`/llms-full.txt` and Markdown pages:

- hyperstructure/fctl-site#58

[fctl session](https://app.fctl.sh/s/ses_01M5QX2QPKNQY8VJ8YYY0K547J)

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
@kalaspuff
kalaspuff merged commit 07fd405 into main Oct 24, 2026
5 checks passed
@kalaspuff
kalaspuff deleted the fctl/266-let-s-create-an-llms-txt-that-should-be branch October 24, 2026 22:37
@fctl-sh fctl-sh Bot mentioned this pull request Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant