Files
supabase/apps/docs/style-guide/03-page-structure.md
fb37145641 docs(skills): the docs review gives each new sentence a verdict and checks each claim (#54082)
## Problem

[#53996](https://github.com/supabase/supabase/pull/53996) passed an
author review, two agent readers, and a full agent review, and still
needed [#54013](https://github.com/supabase/supabase/pull/54013) to fix
it. The new section repeated three sections of the same page, described
worker-pool internals that a reader can't configure, and left the
Functions architecture guide saying the opposite.

`review-the-docs` and the style guide already named repeated facts. The
rule didn't hold, for these reasons:

- The Content review listed problems as examples ("they aren't the full
list"), and its checklist asked only that "each problem is reported". A
light review and a full one produced the same report.
- No rule gave content problems a severity, and core rule 6 called style
notes suggestions.
- No rule covered internals the reader can't act on, or a statement on
another page that says the opposite.
- The review had no claim check of its own. `write-the-docs` has an
accuracy pass, but a review runs on its own and can't count on the
author having used that skill. `test-the-docs` runs only snippets.

Tedd's own review skills filled these gaps with stricter copies of the
rules, so people, Tedd, and CodeRabbit reviewed against different rules.

Closes
[DOCS-1806](https://linear.app/supabase/issue/DOCS-1806/the-docs-review-checks-each-claim-and-gives-each-new-sentence-a)

## Solution

**The Content review in `review-the-docs` asks for a verdict on each
item.** Each new and changed sentence gets a verdict, and so does the
sentence right after each change. Each of these problems is a blocker:

- A repeated fact
- A disagreement with the docs, searched for in `apps/docs/content/` and
`apps/kb/src/content/` by the behavior's terms. The published page can
be the wrong one, so the Fact check decides which sentence is true, and
the change fixes the wrong one
- Mechanism the reader can't act on
- Detail that only fits one reporter's case. The fix for one error, or
an answer that depends on the reader's stack, belongs in `/kb`, per the
`/docs` and `/kb` split in `write-the-docs`
- An unanswered follow-up question

A change longer than the ask needs is a note, because no style guide
rule covers it.

The review also gives a verdict on each new section's place, each new
example's pattern, and each new link. The style pass counts the words of
each long sentence with a script, gives a verdict on each style guide
rule that applies to the changed lines, and checks the page's template
and WORD_LIST. The done criterion lists each verdict, so a skipped item
shows.

**A new Fact check gives each claim a verdict.** Each claim gets one
verdict: ran (a row in a `test-the-docs` verification report), traced to
the source at the version the page uses, or unverified. When a change
has more than 20 claims, or a claim needs a repo that the reviewer can't
read, the review asks the user before it continues. Each path an
instruction names is its own claim. A wrong claim is a blocker, and an
unverified claim is a note to the author. Code runs only through
`test-the-docs`, so the tutorial and example reviews ask to build
example apps there, not in the reviewer's checkout. Before a wrong claim
is made more exact, the review checks whether the reader needs it at
all.

**The `write-the-docs` accuracy pass checks that the reader needs a
claim.** Its old step 3 said to add an exception the code has, or narrow
the sentence, which pushed #53996 toward more internals. A new step 2
cuts a claim about mechanism the reader can't use, instead of making it
more exact. An exception goes in only when it changes what the reader
sees or does. The skill stays self-contained: it runs whether or not a
review follows.

**The style guide holds the rules the review applies.** New rules:
"Document what the reader can use", "Answer the reader's next question",
"Name what a command changes", "Model an example on the page's other
examples", and "Put text under the heading for its topic". "Cut repeated
points" now says to link to a fact that another section or page states.
Required text, such as the standard SQL snippet, doesn't count as a
repeat, and neither does a one-sentence term explanation or a warning
that the task needs. "Link selectively" now covers two sections that
send the reader to each other. The review links to each rule instead of
restating it.

**CodeRabbit reviews docs content against the style guide.**
`.coderabbit.yaml` applies each top-level file in
`apps/docs/style-guide/`, but not the templates, to
`apps/docs/content/**/*.mdx` as code guidelines, so a new rule file is
picked up without a config change.

**Stale references.** `ask-the-docs`'s `app-map.md` and `write-the-docs`
no longer point at `content/troubleshooting/`, which #52339 removed.

## Review instructions

1. Read the Content review and Fact check in `review-the-docs/SKILL.md`.
2. Check that each blocker links to a rule in `apps/docs/style-guide/`.

A fresh agent ran an earlier version of the Content review and Fact
check on #53996's merge commit, without seeing #54013. It requested
changes and reported the problems that #54013 fixed:

- The CPU cap and rotation across workers, as mechanism the reader can't
act on
- The same reuse fact stated four times in the section, and "runs once
per worker" repeated from a later section
- `guides/functions/architecture.mdx` saying "A new V8 isolate is spun
up for each invocation" and "each run is stateless"

It also traced each claim to `supabase/edge-runtime@v1.79.2`, and found
a repeated link, a 26-word sentence, and two unverified claims. Its
internals finding has a caveat: the new style guide example comes from
this same case.

After the review suggestions, a second fresh agent ran the current
Content review and Fact check on the same commit. It found the same
three problems, as blockers. It listed 17 claims, under the 20 at which
the Fact check asks before it continues, so it checked each one. It
reported the repeats inside the section as notes, not blockers.

## Checklist

- [ ] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

---------

Co-authored-by: Nik Richers <nik@validmind.ai>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Nik Richers <nrichers@gmail.com>
2026-11-30 17:24:56 -07:00

19 KiB
Raw Permalink Blame History

How to structure a page

A well-structured document drastically reduces cognitive load. This document breaks down how to segment information so it can be found at the right time and place.

Chunking is a major principle of effective technical writing. Break things up. If there are too many chunks, group the chunks, and maybe break up some more. We want to avoid a "too long, didn't read" situation.

Apply this document when you add a page or move content around on an existing one.

If you're deciding Read
Which document type to write, and how big it should be Document types
Which template a page follows Choose a template
What to put in a guide's frontmatter Write good frontmatter
Which reader question a chunk answers Information types
How to order sections on the page Grouping sections
How many items belong in one group Chunking
How to open a long page and connect its sections Navigation and glue
How to keep a page from going stale Write timeless documentation
What to leave out of the repo Keep internal context out

Document types

Supabase docs contain four types of document. Decide which one you need before you start writing.

Type Purpose Contains Doesn't contain Example
Explainer Learn a topic What it is, why, and when to use it Procedures past two steps Auth architecture
Tutorial Finish a multi-feature goal Procedures plus the reasoning — Build a Next.js app
Guide Finish one task Procedures in sequence Background; link to an explainer Passwordless logins
Reference Look something up Parameters, return types, samples Context and use cases JavaScript client

Reference content is generated from spec files rather than hand-authored. See CONTRIBUTING.md for the reference pipeline.

Choose a template

Pick the one template that matches the page, and follow only that one. Each template answers a reader question and names its Information Type.

Page purpose Reader question Information type Template
Learn a topic (explainer) What is it, and when do I use it? Concept explainer.md
Finish one task (guide) How do I do one task? Procedure how-to-guide.md

If no row fits the page, say so and ask the requester. Don't invent a structure.

Open a guide with a value statement

Name what the reader can do and why it matters to them. That's what tells a reader or an agent whether the page matches their goal.

  • Recommended: Restrict access to a shared table with Row Level Security. To learn how a policy is evaluated, see [Row Level Security](...).
  • Not recommended: Several paragraphs about how Row Level Security works before stating what the reader can do.

Keep procedures focused on what the reader must do. Move substantial background into a separate section or an explainer and cross-reference the authoritative explanation rather than repeating it. This keeps the action path scannable and maintains one source of truth.

Topic size

Each type above is one unit of work for the reader. An explainer covers one topic. A guide covers one targeted task. A tutorial covers one multi-feature goal. A reference page covers one thing the reader looks up.

One unit per page

Enabling Row Level Security is one guide. Writing policies is a second, and designing a multi-tenant schema is a third. A reader who lands on the page from search should be able to finish what they came for. Link to the related pages.

Keep a short piece inside its parent

A fact or a principle is often one sentence. Put it in the section it qualifies. A heading whose only job is to point somewhere else is a link.

Give the next unit its own page

Split when a section has grown its own subsections and shares little with the rest of the page beyond the subject word. The new page takes the second task or the second concept, and this page links to it.

Chunking limits how many items sit in one group. Topic size limits what those items are about. A procedure can have six steps and still cover two tasks.

  • Recommended: A passwordless email login guide with Send a one-time password and Verify the code.
  • Not recommended: An Authentication page that also covers passwords, OAuth, and session storage.

Write good frontmatter

Every guide sets title and description in its frontmatter.

Title

Keep the title to 35 characters or fewer, in sentence case.

  • Task pages: start with an imperative, such as Create a table.
  • Explainers: use a noun phrase, such as Auth architecture.

Name the product when the noun alone could belong to several products, such as Storage schema or Auth identities. Search results, browser tabs, and AI answers show the title without the navigation around it. Leave the product out when the noun is already specific, such as Keyword search.

Name the concept, not the page's place in the docs.

Not recommended: Avoid gerunds, such as Creating a table, and questions, such as What is a bucket?. Avoid placeholder words such as Fundamentals, Introduction, Overview, and Basics. A URL that already uses one of these words keeps it, because renaming a URL breaks links.

(Optional) Sidebar label

sidebar_label sets a shorter name for the page in the sidebar. The navigation section already names the product, so the label can drop it, such as CDN for Storage CDN. The label still names the same concept as the title.

(Optional) Subtitle

Subtitles are decorative to add more depth to a title. If it matches the first sentence of the page, leave it out.

  • Recommended: A page called Vault has the subtitle Manage secrets in Postgres.

Description

The description is the page's 150–160 character meta description. Say what the page helps the reader do with relevant keywords.

Information types

The Information Mapping method names six types of information. Each answers a different reader question, and each has a form that suits it.

Type Answers Present with Build it per
Procedure How do I do it? Numbered steps, or an if/then table Procedures, Tables
Process What is happening? How does it work? A stage-by-stage description, or a when/then table Tables, Diagrams
Structure What are its parts? A part and description table, or a labeled diagram Tables, Diagrams
Principle What should I do or not do? Text, a list, or an admonition Lists, Admonitions
Concept What is it? Text, a list, or a diagram Lists, Diagrams
Fact What are the facts? Text, a list, or a table Lists, Tables

Classify the content

  1. Split the content into chunks. One chunk is one thing you're telling the reader.
  2. For each chunk, ask which reader question it answers, and read its type off the table above.
  3. Build each chunk in the form its Present with column names. A chunk already in a different form is a defect. Fix it.
  4. Group the chunks by type, per Grouping sections.

Example below works one paragraph through these steps.

Separating the types

Separate a procedure, a process, a structure, or a concept

Each usually reads better in its own section. Procedure and process get blended most often, because both answer a question about how, and a reader following steps can't act on the process sentences.

Keep context out of the action path

A concept or a process tends to work better before the procedure or after it than threaded through the steps.

Let a principle or a fact ride along

Either is often a single sentence, so it can sit in the section it qualifies rather than getting one of its own. A fact about timing fits in the step it describes, and a principle can close the concept paragraph that motivates it.

Look again at a long paragraph

Past three or four sentences, it has often picked up a second kind of information. Label each sentence and see where the labels change.

Leave connective prose alone

An introduction, a transition, an outcome, and a navigation outline describe the page rather than the product, so none of this applies to them.

Example

Not recommended, because one paragraph blends a concept, a procedure, and a structure:

Row Level Security is a Postgres feature that restricts which rows a user can read
or write, and it's the main way to secure a table that several users share. Enable
it by running `alter table profiles enable row level security`, which takes effect
immediately. Be careful, because a table with Row Level Security enabled and no
policy returns no rows to every client, so write a policy before you deploy. The
`using` clause of a policy accepts any expression that returns a boolean.

Recommended, with each type in the presentation that suits it:

## Row Level Security

Row Level Security restricts which rows a user can read or write. It's the main way
to secure a table that several users share.

### Enable Row Level Security

1. Run `alter table profiles enable row level security`. The change takes effect
   immediately.
2. Write a policy that grants the access your app needs.

<Admonition type="caution">

A table with Row Level Security enabled and no policy returns no rows to `anon` or
`authenticated`. Write a policy before you deploy.

</Admonition>

### Policy reference

The `using` clause accepts any expression that returns a boolean.

Grouping sections

Information types apply at the page level too. Group sections of related types together, and keep the procedure group unbroken so context doesn't interrupt the action path.

Classify a section by what the reader is doing in it

On a page about tables every section is about tables, so subject matter tells you nothing. A reader opens a section on schemas to understand something, so it's context.

Put text under the heading for its topic

Each paragraph sits under a heading that names its topic, and fits with the sections beside it. When new text doesn't fit the heading above it, move it to the section it fits, or give it its own heading.

Split a section that serves two types

Filing it under the larger half buries the other one. Give the new half a heading, keep the heading text of the half that stays, and cross-reference the two.

One order that works: a short concept opener, then procedures, then concept and process, then structure and fact.

## What is a table?                    <- concept opener
## Creating and managing tables        <- procedures
### Creating tables
### Securing your tables
### Loading data
## How tables are organized            <- concept and process
### Primary keys
### Relationships between tables
### Schemas
## Reference                           <- structure and fact
### Data types

Chunking

Apply the Information Mapping chunking principle: present 5 ± 1 related items at a time. That gives readers a manageable chunk of four to six. Aim for the lower end when the task is complex or unfamiliar.

Information Mapping gives 7 ± 2 as the general limit and 5 ± 1 for content read on a screen. Screen reading is less accurate than the same content on paper. Supabase docs are read on a screen, so 5 ± 1 applies.

If a procedure has more than six steps, group related steps into named phases or smaller procedures. Don't add steps to reach a minimum. The range organizes information.

The same limit applies to sections in a group. A page with ten top-level headings needs grouping. Reordering them changes nothing.

Headings and lists are the other half of chunking. A long stretch of prose with no heading gives a reader no way in and no way to skip. A reader navigating by heading has nothing to navigate. Where a paragraph has grown past its one topic, a heading or a list usually serves better than a longer paragraph.

A lookup surface is the exception. When a reader arrives to find one entry rather than to read the page, the entries carry their own order: alphabetical, or the order of an API. Grouping them into fives would hide what they came for.

A reference document is the same case. A reader opens this style guide to find one rule. Its sections are a list to scan, not a sequence to hold in memory.

For how to format the steps inside a procedure, see 02-elements.md.

Navigation and glue

Begin a long guide with a short outline of its major section groups

Link to each group and say when a reader should use it. Don't add section navigation to a short guide when its headings already fit on one screen.

Connect your app to Postgres through a connection pooler, a direct connection, or a
Supabase client library.

- [Choose a connection method](#choose-a-connection-method) compares the options and
  their trade-offs. Start here if you aren't sure which one fits your app.
- [Connect your app](#connect-your-app) has the steps for each method.
- [Connection parameters](#connection-parameters) lists every parameter and its
  default.

Each link says what the reader gets from that group, so someone who already knows which method they want goes straight to the procedures.

Connect contextual sections to their procedures

Do this when the relationship helps readers navigate. Add a brief introduction to each section group, a transition when the information type changes, and an outcome after a procedure. Add links selectively rather than linking every adjacent section.

  • Group introduction: The following sections cover each connection method in turn. Every method needs your project reference, which you find on the project settings page.
  • Transition where the type changes: Those are the mechanics of opening a connection. To understand why a pooled connection behaves differently under load, see [Connection pooling](...).
  • Outcome after a procedure: Your app now connects through the pooler. Queries that used to fail at the connection limit queue instead.

Write timeless documentation

Document the product as it is now. Language that fixes a page to a moment goes stale, and a reader can't tell whether currently was written last week or three years ago.

Avoid words that anchor a sentence to a point in time

Avoid Avoid Avoid
as of this writing existing now
currently future, in the future old, older
does not yet latest presently, at present
eventually new, newer soon

WORD_LIST.md has entries for the two that come up most, currently and latest, new, and soon.

  • Recommended: The emulator supports the following filters.
  • Not recommended: The emulator now supports the following filters.

Don't promise a feature that hasn't shipped

Coming soon, will be available, and once finalized all decay into inaccuracy, and a reader can't act on any of them. When a phased rollout is real, state the criteria that decide who has it: Available to organizations on Pro and Enterprise plans.

Don't ship a placeholder page

A page saying This is a placeholder or More details coming soon promises content on no schedule. Wait until the page is worth reading, or ship the smaller thing that's true today. When navigation structure forces a page to exist, link out to resources that are complete.

Exceptions

Changelog, release notes, and blog content are time-sensitive by nature, and referencing the future is their job. Procedural content can use a time word for a state change the reader causes: The table now appears in the editor.

Keep internal context out

Supabase docs are open source. Keep planning notes, unshipped features, business intent, and references to ticketing systems out of the repo. Put review-time context in the pull request description and product context in the team's project-management tool.