How every page on docs.marfa.so is written. Read it before you write a page. Passing pnpm test isn't the same as following this file.
- Prose: the Google developer documentation style guide, which decides where this file is silent.
- Structure: Diátaxis. Each page is one kind of page.
- Spelling: American English: color, organization, canceled.
Write for someone new to Marfa. Home and Use must make sense to a reader who doesn't know software.
- Someone finding out what Marfa is, or starting it, reads Home.
- Someone using Marfa every day reads Use, and Run when they look after their own instance.
- Someone building on Marfa, a connector author included, reads Build, then Catalog and Reference.
Never bury a user in technical detail, and always give a builder the exact reference. Use and Run never need HTTP.
Agents read the docs most, as Markdown, usually for one of these people. A page a newcomer can follow serves an agent too. Never write that Marfa is only for technical people.
- Marfa is the home for everything a person keeps, files first. It isn't a notes, tasks or bookmarks app, and no page's examples may make it sound like one.
- The docs cover Marfa itself: the instance, the CLI, MCP for agents, synced folders, the API, the SDKs and connectors. Apps built on Marfa, such as MAPP, aren't documented; a page may say where one is found, and nothing more.
- The docs cover working with Marfa, not maintaining it. How Marfa is built inside, such as its modules or storage, belongs in the marfa repository.
| Tab | What it holds |
|---|---|
| Home | Get started: What Marfa is, the Quickstart, Connect your agent, How Marfa works, with no HTTP. Resources: Glossary, Changelog, Get help |
| Use | Everyday jobs: agents, the CLI, synced folders, connectors, access and keys, Limits |
| Run | Looking after an instance: where it runs, its address, sign-in, settings, health, backups, upgrades, telemetry, troubleshooting |
| Build | Concepts at full depth, then tutorials and guides for apps, types, working copies and connectors |
| Catalog | What Marfa ships, generated from the code: types, edge types, events, permissions, connectors |
| Reference | The HTTP API and errors, the SDKs, the CLI, the MCP servers, folder rules, settings, the contract |
- Every address starts with its tab's segment, such as
/use/sync-a-folder. Home's segment is the root, so its pages sit at/,/quickstartor/glossary.src/lib/addresses.test.tsenforces it. - No tab or group has a landing page, and no page is a grid of cards that repeats the sidebar.
- Say each thing once, and link to it. Use and Run say what to do; Build explains why.
- The Catalog lists what Marfa ships and explains nothing. A page that needs one of its lists links to it.
content/AGENTS.md says how to add a page and wire it in.
| Kind | What goes in | What goes elsewhere |
|---|---|---|
| Tutorial | You'll build, You need and You'll have, each true; then steps, the code each adds and a check that each worked | Options to a how-to; a refusal to a fix page, unless it is the lesson |
| How-to | One job, what the reader needs in one line, the everyday steps | Explanation to a concept, options to the reference, errors to a fix page, another vendor's rules to its help |
| Fix page | Entries headed by the exact text the reader sees: the cause in a sentence, the fix in a step | Rare messages and error codes to Errors |
| Concept | One idea: what it is, why it works this way, the rules met in normal use, one example | Lists to the Catalog, numbers to the reference, steps to a how-to |
| Reference | Tables, generated where possible, with a line of prose at most for each entry | Teaching and order |
| Catalog | Generated tables, one example for a core type; a connector page adds only "What goes back" and "What to know" | Everything that explains |
- One page, one job. The
jobline names one job, with no "and" or "or" joining two. A page with two jobs is two pages. - A ceiling is a limit, not a target. Cut before you add. A page past its ceiling is usually two pages, or holds detail that belongs in the reference.
- Ask of each section which part of the job it serves, and cut or move one that serves none.
- Give a page more room only when it can't be split, with its reason in
page-limits.json.
Four rules decide most pages:
- Write for this reader, doing this job, now. Cut a sentence the reader doesn't need at this point, however true, and link to where they will need it.
- Use words the reader knows, or explain each in plain words where it first appears on the page. A Glossary link doesn't replace that line.
- Output only proves the step. Show the lines that prove a step worked. Never write a sentence only to explain confusing output: open an issue on withmarfa/marfa to change the message.
- Files first. Where a page covers both, answer for an ordinary file, such as a PDF, a photo or a spreadsheet, before a note.
And:
- The everyday path comes first. Error cases, rare choices and recovery go in their own section or page, linked from the step.
- Answer first. The
descriptionis the lead under the title; the first paragraph adds what it can't. Never restate it, or open with "This page explains". - Keep paragraphs to one idea, in one to three sentences.
- Describe the present: no history, no "now" or "new".
- Bold the few words a skimmer must not miss, and the lead-in of each item in a scanned list. Never bold a whole sentence.
- Use a list for parallel items. Never open a page with one, except a tutorial's opening lines, and never let one stand in for an explanation.
- Use a table to compare or to look up, with short cells and headers that read as labels, because at phone width each cell shows under its header. Never turn a table into a list.
- Keep headings plain text, with no code or links.
- Cut filler: simply, just, easy, basically, really, actually, very.
- A title is the words a reader would type, such as "Upgrade an instance". A concept or reference page takes its subject's name.
- A title stands alone in search, without its tab or group. Name the object: "Manage keys for scripts and agents", not "Manage keys".
- A sidebar label may lean on its group heading, but must be true on its own. Set
sidebar_labelonly when the title wraps. Name a page from its steps, not its first sentence. - A
descriptionsays what the page gives the reader, not what it contains. - Add a
headTitle, the name in browser tabs and search, when the title is shared or doesn't name the page outside the site.
Marfa's GLOSSARY.md, synced as src/generated/GLOSSARY.md, decides every term and its sense. Link to /glossary rather than redefine a term; if the glossary doesn't settle one, ask the owners of the contract.
- The CLI is the
marfaprogram; a command is one of its commands, such asmarfa items list. - An operation is one thing the API does.
- A folder is on the instance; a directory is on disk. The first time a page needs both, say so in one line: "The folder lives on your instance; the directory is where its files sit on this computer."
- The bin is where a deleted item goes, and move to the bin is the act. Use
trashonly in a literal name, such astrashed.
- Check every claim against withmarfa/marfa: each name, field, error code, rule and sample value, against the contract (
conformance/spec/),openapi.jsonand the code. If they disagree, don't choose: raise it with the owners of the contract. - Run a command for real, on a test instance, where a wrong step can lose data, such as deleting, restoring, upgrading or changing a synced folder.
- Link the contract chapter a page draws on, and an exact rule by its heading, which is its ID.
- Don't restate the API reference. Explain how the pieces fit, the order and the reason, then link to the operation.
- Never edit
src/generated/oropenapi.json. Fix the source in marfa and run the sync.
- Show the smallest real example that makes the point, with real names and values, and the response when it teaches something.
- Examples work from any computer with a key, or the browser. Only claiming an instance and recovering the owner's password run on the server.
- Choose clients for the reader. Use and Run show the CLI, with HTTP only where needed; a connector guide shows TypeScript and HTTP.
- Show one task in several clients as code tabs, in the order CLI, HTTP, TypeScript, Swift, with
tab-group="client", and no tab for a client that lacks it. - A block holds only code a reader runs or copies. A command and what it prints go in
<Terminal>. - Write raw HTTP in
httpblocks titledRequestandResponse. - Show the code a step adds, not the whole file, and give a block a
titlewhen the reader needs to know where it goes. - Mark a block that holds another tool's command
command-check="other-tool", and a deliberate wrong examplecommand-check="counterexample".
| Component | Use it for |
|---|---|
Steps |
An ordered procedure. Each step opens with a ### heading |
Steps paged |
A tutorial. Keep its steps close in length, with the next steps in the last one |
Terminal |
A command and what it prints |
Accordion |
Entries opened one at a time, never a reference list |
Callout |
Only what must interrupt, such as a step that can't be undone (type="warn"). Its title says what happens |
Cards |
Where to go next, never an index |
- Write an object's fields as a Markdown table (field, type, description).
- Agents read the Markdown copy, which
source.config.tswrites. It leaves out a component it doesn't handle, so add one there before a page relies on it.
- A diagram earns its place by showing what prose can't. Most pages need none, and a table often suits a comparison.
- Draw a real example, not a category: a beach photo attached to a packing list, not boxes named "Items".
- Choose the form: a
Figurefor a shape, with arrows that say what moves or links, never a list of boxes; aSequencefor order in time; an interactive figure only when exploring cause and effect is the point. - Every diagram has a text form. The prose carries every fact, and the sentence before a figure states the fact it shows. A static figure takes a
label, a sentence or two that the Markdown copy and screen readers read, which counts toward the page's words. - Use the theme tokens,
--color-fd-*and--marfa-diagram-accent, with no images or hard-coded colors. The accent marks the one thing the page is about. - Fit 375 px with no sideways scroll, and labels of a few words.
- Build controls only from
Controls,ChoicesandMenuinsrc/components/visuals/interactive.tsx. A choice changes the highlight and the text, never a size or the layout, and works by keyboard.
- Rewrite whole, never append. Rewrite the sentence or section so it reads as if it had always been that way.
- A code change opens a docs issue, and the docs agent rewrites pages from the issues: the root
AGENTS.md, "Docs pass at each release".
The tests hold the numbers and the details.
- Word ceilings, caps, kinds, budgets, job lines, title and description lengths:
@withmarfa/docs-kit/page-limits(the check) andsrc/lib/page-limits.json(the numbers). - Frontmatter, em dashes, banned and avoided terms, statement numbers, connector counts, "coming soon", callout titles, tutorial steps, links and includes:
src/lib/content-lint.test.ts. - Commands, options, markers and the allowlist:
src/lib/command-check.test.ts. - The Glossary page against
GLOSSARY.md:src/lib/glossary.test.ts. - Generated files included only where they belong:
src/lib/docs-structure.test.ts. - Unique head titles:
src/lib/head-titles.test.ts. Core type examples:src/lib/catalog.test.ts. - Addresses under their tab's segment:
pnpm test.