Skip to content

feat: add llms.txt, which tells agents what fctl is and how to drive it - #267

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

kalaspuff merged 5 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

Adds docs/llms.txt, a guide for agents in the llms.txt format. 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.

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

fctl-sh Bot added 5 commits October 24, 2026 22:04
docs/llms.txt sums fctl up for agents: what it is, its words, roles,
the session lifecycle, how agents work with GitHub, how to drive the CLI
safely, recipes and what to avoid, with links to every doc.
docs/agents.md and docs/api.md hold the details. The CLI reference now
says which commands keep following, how they read stdin, exit codes,
--confirm for deletions without a terminal, and the flags it lacked.
The web app's build emits docs/llms.txt as /llms.txt, and Vite serves it
in development, so app.fctl.sh and self-hosted instances answer agents
with it. robots.txt lets crawlers fetch it while the app stays out of
their indexes. The standalone image copies the file for its web build.
Links between docs, to their headings, to files of the repository and
to fctl.sh's Markdown pages must resolve, and llms.txt keeps the shape
llmstxt.org asks for, with absolute links only.
@kalaspuff
kalaspuff merged commit 45e0368 into main Oct 24, 2026
12 of 13 checks passed
@kalaspuff
kalaspuff deleted the fctl/266-let-s-create-an-llms-txt-that-should-be branch October 24, 2026 22:26
kalaspuff pushed a commit 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 pushed a commit to hyperstructure/fctl-site that referenced this pull request Oct 24, 2026
## Summary

Serves fctl's guide for agents and its docs in the forms agents read
best ([llms.txt](https://llmstxt.org)):

- `/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.

- hyperstructure/fctl#267
- hyperstructure/fctl#268

## 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](https://app.fctl.sh/api/v1/published/wNcWGYMpGmJiyoKnXBBQEUcxHphFSrnH16plYUvKoLR/agents-light.png)


![api-dark.png](https://app.fctl.sh/api/v1/published/5lzJT91QrYmcgNVQSUgnPZM5u20it7mQiFo30SkLX2d/api-dark.png)


![api-light-390.png](https://app.fctl.sh/api/v1/published/5Q0XpLwhg443hcjjGCcr0dl3xk3lUWlp2H5MhZyulF5/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](https://app.fctl.sh/s/ses_01M5QX2QPKNQY8VJ8YYY0K547J)

---------

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
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