Repository navigation
feat(docs): serve llms.txt, the docs as Markdown and llms-full.txt - #58
Merged
kalaspuff merged 3 commits intoOct 24, 2026
Merged
Conversation
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.
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
The failing The same build passes once fctl has those docs: |
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>
…-an-llms-txt-that-should-be
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
approved these changes
Oct 24, 2026
kalaspuff
deleted the
fctl/266-let-s-create-an-llms-txt-that-should-be
branch
October 24, 2026 22:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Serves fctl's guide for agents and its docs in the forms agents read best (llms.txt):
/llms.txt: fctl's newdocs/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.txtfollowed by every page, each with its address._headersdeclares these files UTF-8: Cloudflare sends.txtand.mdwithout a charset (app.fctl.sh's/llms.txtdoes 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" gotconfirming-it-39-s-you, so links toarchitecture.md#confirming-its-youmissed it. The page mapping and link rewriting moved toscripts/pages.mjs, with tests. The deploy's smoke test also fetches/llms.txtand a Markdown page.hyperstructure/fctl#267 is merged and fctl's CI pinned it (
fctl-docs.refat 45e0368), which this branch now has frommain, so the build finds the new pages. Verified at that commit:npm run buildrenders 11 pages, their Markdown (all links absolute) andllms-full.txt. Underwrangler dev,/llms.txtand/llms-full.txtanswer astext/plain; charset=utf-8and/docs/*.mdastext/markdown; charset=utf-8, and HTML pages are unchanged.npm run checkreports only the two!importantwarnings thatmainhas, andnpm testpasses 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.Worth confirming
https://fctl.sh/docs/cli.md), not their HTML, so an agent that follows them keeps reading Markdown./docs/cli.mdand the like now serve Markdown where they used to give the 404 page's "Did you mean /docs/cli/?".fctl session