Skip to content

Write docs

This page explains how to run the Utming docs on your computer, how to write a page that reads like the rest of the site, and which components and diagrams you can use.

The short version: write for a busy person who has never seen Utming's code. Lead with the answer. Use short sentences, "you", and a diagram whenever something moves between parts.

The docs are an Astro Starlight site in the docs folder. It has its own lockfile, like desktop.

For a documentation-only change, use Node.js 24.21.0 or newer and pnpm 10.34.5. You do not need the app dependencies, Docker, a running Utming instance, or a model connection.

  1. Install the docs dependencies.

    Terminal
    pnpm --dir docs install --frozen-lockfile
  2. Start the dev server. It reloads when you save a page.

    Terminal
    pnpm --dir docs dev
  3. Open http://localhost:4321/docs/ in your browser.

  4. Before you open a pull request, build the site. The build fails on a broken link or a missing heading anchor.

    Terminal
    pnpm --dir docs build

On every pull request that changes the site, the Docs workflow builds the site, checks internal links, and attaches the utming-site artifact. It does not deploy the site.

The public landing page and documentation at utming.com use a Cloudflare Worker with versioned static assets in Workers KV. Your assistant runs in the desktop app or on your own server.

Build the complete public site from the repository root:

Terminal
pnpm site:build

The command builds and validates the docs, then runs deployment/cloudflare/build-site.mjs. It writes the assembled site to .local/site and compressed upload batches to .local/site-pack. The Docs workflow uploads .local/site as utming-site; it does not deploy it.

The assembled site puts documentation under /docs/ and the landing page from src/pages/next.astro at /. It also includes the missing-page response, icons, search assets and security disclosure files.

deployment/cloudflare/site.mjs serves the public files. It requires a SITE KV binding, a RELEASE_ID matching the generated manifest, and PUBLIC_ORIGIN set to https://utming.com. See Publish the public site for the manual release steps.

Publication requires explicit authorization. The repository has no automatic site deploy job. The authorized deployment uses the connected Cloudflare API; account credentials and CLI tokens stay outside the repository and public assets.

The Worker applies response headers from deployment/cloudflare/site.mjs. docs/public/_headers records the matching policy for static hosts. Keep both policies in sync.

The headers set HSTS for one year, block framing, prevent content type guessing, and disable camera, microphone, location, payment, and USB access. The Content Security Policy limits scripts, connections, fonts, and frames to the site and required services. Images can load from HTTPS addresses. Inline scripts and styles support the generated site. WebAssembly is allowed for local docs search. The policy allows no third-party script, font, frame or connection endpoints. The site does not load a tag manager.

When you add a script, font, embed, or external request, update the policy only for the source it needs. Check the built site in a browser for blocked resources. After deployment, use curl -sI https://utming.com/ and curl -sI https://utming.com/docs/ to check the headers. Cloudflare zone settings can change the final response. Check that HSTS has max-age=31536000 or a longer lifetime.

docs/public/.well-known/security.txt lists the private reporting routes and security policy. The workflow publishes it at /.well-known/security.txt and /security.txt. The site artifact includes hidden files so the .well-known folder reaches the deploy job. Keep the reporting links current and renew Expires before it passes, with a date less than one year ahead.

  • Directorydocs/
    • astro.config.mjs site settings, sidebar and plugins
    • Directorysrc/
      • Directorycontent/docs/ every page, one file per page
        • index.mdx the home page
        • Directoryget-started/
          • …
        • Directoryuse/
          • …
        • Directorytrust/
          • …
        • Directoryconnect/
          • …
        • Directoryhow-it-works/
          • …
        • Directorydeploy/
          • …
        • Directorycontribute/
          • …
      • Directoryassets/ images and screenshots
        • …
      • styles/theme.css the Utming theme

Each folder under src/content/docs is one sidebar section. The file name becomes the URL, so trust/payments.md is published at /trust/payments/. Set the order inside a section with sidebar.order in the front matter.

Use .md for most pages. Use .mdx only when the page needs a component such as <Steps> or <Tabs>.

src/content/docs/use/example.md
---
title: Do the thing
description: One sentence that says what this page helps you do. Search engines and link previews show it.
sidebar:
order: 3
---
One sentence that answers the question this page is about.
A short paragraph with the context a newcomer needs.
## Do the thing
1. Open **Settings → Example**.
2. Turn on **Example**.
## How it works
A diagram, then two or three short paragraphs.
## Related resources
- [Parent page](/use/chat/)
- [Sibling page](/use/tasks/)

Write for a reader who has not seen the code. Use the following house style.

Avoid Use instead
utilize, leverage use
in order to to
functionality, capabilities features, what it does
It's important to note that X X
Utming provides a powerful, seamless way to ... Utming lets you ...
The owner you
Pi, the agent, the LLM (in user pages) Utming, or the model
  • Lead with the answer. Put one sentence under the title that says what the page lets you do.
  • Keep sentences short. One idea each, under 25 words. Split anything held together by a semicolon.
  • Cut filler and marketing. No "simply", "powerful", "robust" or "seamless". Say what happens.
  • Be exact. Write "for 90 days", not "for a while". Write "Utming asks you", not "Utming may ask".
  • Lead with the action. "To stop Utming, select Stop", not "There is a button that stops Utming".
  • Talk to the reader as "you". Name Utming in the third person: "Utming asks", not "we ask".
  • Use active voice: "The server checks the action", not "The action is checked".
  • Use contractions: "don't", "can't", "you'll".
  • Use "they" for an unknown person.
  • Headings use sentence case and say what the section is about: "Approve a payment", not "Payments flow".
  • UI labels are bold and match the app exactly: Settings → Memory, Sign in again.
  • File names, commands, settings and code are in code. Placeholders look like <your-key>.
  • Use the Oxford comma, one space between sentences, and no em dashes or ellipses.
  • Write numbers from zero to nine as words and 10 or more as numerals, except for versions, sizes and percentages.
  • One page, one job. Split a page when it mixes how-to steps with a long explanation.
  • Self-contained sections. Someone may land on a heading from search. Restate the one fact the section needs instead of writing "as mentioned above".
  • Landing pages list their children under In this section, with one line each.
  • Child pages end with Related resources: a link to the parent and to sibling pages.
  • Explain limits honestly. If a check doesn't cover something, say so in a caution aside.

Write internal links as site paths that start and end with /. The build adds the /docs/ prefix and checks that every page and heading exists.

See [Approve one payment](/trust/payments/#approve-one-payment).

Link to source files with full GitHub URLs, such as src/server/trust.ts. Link at the first useful mention only.

Import components at the top of an .mdx page:

import { Aside, Steps, Tabs, TabItem } from '@astrojs/starlight/components';

Use an aside for one thing the reader must not miss. Keep it to two sentences.

:::caution[Back up the Vault key]
Saved logins can't be read without it.
:::

Asides work in .md and .mdx pages.

Wrap a numbered list in <Steps> for a procedure. Each step starts with a verb.

  1. Open Vault.
  2. Select Add, then Login.
  3. Enter the website, username and password, then select Save.

Use tabs when the same task differs by platform or setup.

Utming keeps the Vault key in the macOS Keychain.

Tabs with the same syncKey switch together across the page.

Use cards for a short grid of ideas, and link cards to send readers onward.

Card

Two lines at most.

Another card

Starlight's icon names work here.

Mark status inline: Preview Local only New.

<Badge text="Local only" variant="note" />

Give a code block a title when it's a file or a terminal. Mark lines to draw attention.

.env
PORT=4310
UTMING_VAULT_KEY=<your-key>
OPENAI_API_KEY=<your-key>
```sh title=".env" {2} ins={3}
PORT=4310
UTMING_VAULT_KEY=<your-key>
OPENAI_API_KEY=<your-key>
```

Store screenshots in src/assets/screens and use synthetic data only. Write alt text that says what the image shows.

Draw diagrams with Mermaid in a mermaid code block. They follow the site's light and dark theme. Keep each diagram small: about eight boxes, short labels and one idea. Draw decisions as hexagons, {{Like this?}}, because diamonds grow very tall. Prefer flowchart TD when a left-to-right chart would be wider than about five boxes.

Add a class to highlight a box:

Class Use it for
:::accent The part the page is about, or you
:::muted Background or optional parts
:::go A step that runs
:::stop A step that is refused or held

Use a flowchart for parts and the paths between them.

flowchart LR
  action[App action] --> check{{Allowed?}}
  check -- yes --> run[Run it]:::go
  check -- not sure --> ask[Ask you]:::accent
  ask -- no --> stop[Don't run]:::stop
  ask -- yes --> run
```mermaid
flowchart LR
action[App action] --> check{{Allowed?}}
check -- yes --> run[Run it]:::go
check -- not sure --> ask[Ask you]:::accent
ask -- no --> stop[Don't run]:::stop
ask -- yes --> run
```

Use a sequence diagram when the order of messages matters.

sequenceDiagram
  actor You
  participant Utming
  participant Server
  participant Site as Website
  You->>Utming: Read the report with my saved login
  Utming->>Server: Use this account on this website
  Server->>Server: Check task, account and website
  Server->>Site: Fill in and submit privately
  Site-->>Utming: Page after sign-in, secrets masked
  Utming-->>You: Here is the report

Use a state diagram for something that moves through a few states.

stateDiagram-v2
  direction LR
  [*] --> Running: claim saved
  Running --> Submitted: entry finished
  Running --> Uncertain: interrupted
  Submitted --> [*]
  Uncertain --> [*]
  • The first sentence answers what the page is for.
  • Every heading says what its section covers.
  • Steps start with a verb and match the labels in the app.
  • Diagrams have eight boxes or fewer and short labels.
  • No keys, real accounts or private data in text, code or screenshots.
  • pnpm --dir docs build passes.