write-the-docs

Rédigez un nouveau contenu ou une mise à jour de la documentation Supabase pour une fonctionnalité ou un lancement, en vous appuyant sur Linear (le ticket ainsi que son contexte produit/PM), une lecture du code réel, et…

npx skills add https://github.com/supabase/supabase --skill write-the-docs

Write the docs

Drafts net-new Supabase docs content (or product-grounded rewrites) for a feature or launch. Distinct from edit-the-docs, which restructures and tightens pages that already exist without gathering net-new product intent. This skill is for the case where the content doesn't exist yet (or must be rewritten from intent + code), grounded in four inputs rather than guessed.

Core rules

  1. Gather before drafting. Never draft from a ticket title alone. Pull all four inputs below first; a thin gather phase produces a draft that's wrong about how the feature actually works.
  2. Separate confirmed behavior from product intent from inference. Code tells you what the feature does today. Linear/PRD/PRFAQ (or prior Frame/Shape output) tells you what it's meant to do and how it should be positioned. Anything you had to guess, flag explicitly rather than stating it as fact.
  3. Follow the style guide for writing conventions, including voice, terminology, formatting, page structure, and elements. Never follow it for content accuracy. It is a style reference, not a source of truth: rule 2's Linear+code read is what governs what the page actually says. Don't invent voice or structure rules. When the guide and Google's developer documentation style guide both come up short, say so in the handoff rather than copying whatever the nearest page happens to do.
  4. Reuse, don't duplicate. Use ask-the-docs for docs-app architecture and pm-the-docs for placement decisions rather than re-deriving that knowledge here.
  5. Know what you're actually drafting. Not everything that looks like "docs for a feature" is a hand-written page — see the content-type gate below before you start writing. If the ask is restructure, reorder, connective text, or clarity on an existing page (no new product story), use edit-the-docs instead.

Phase 1 — Gather (read-only)

Four inputs, read in this sequence (sequence, not priority; Linear remains the product-intent source and code remains the behavior source per rule 2 and Phase 1 step 3):

  1. Style guide — voice/terminology reference. Read style-guide/README.md and follow the step that matches what you're drafting. The guide's closing section says what to consult when it's silent; follow that rather than matching a neighbouring page.
  2. Linear — the ticket and its product context. Linear is an internal Supabase tool: preferred when available, not required for open-source contributors. When a Linear issue is available, pull it, then its parent project/initiative description too (PRD, PRFAQ, RFC, or initiative narrative) and any PM comments. Product framing/positioning language usually lives one level up from the ticket, in the parent project or initiative description rather than the ticket body. Distinguish scope the ticket actually commits to from aspirational language in the PRD. If there is no Linear issue and no prior Frame/Shape product-intent output, stop drafting: ask internal authors for a Linear URL, otherwise hand off to pm-the-docs (Frame and Shape). Resume only after product intent exists — never invent positioning, and never run Frame/Shape inside this Draft skill.
  3. Code. Read the actual implementation before writing a single behavior claim — the PRD describes intent, the code describes what shipped. Check the Linear issue/project first for a linked supabase/supabase PR — its diff and description are the most precise "what actually shipped" source, more precise than a general codebase read. If no PR is linked, locate the feature directly in supabase/supabase (or the product's own repo), and apply ask-the-docs's reuse/minimalism lens: understand what exists before describing it. When behavior spans services (CLI, Auth, migrations, platform, …), follow pm-the-docs → universe-lookup capability gate (universe when accessible, else OSS public search / linked repos — not ask-the-docs). If code and PRD disagree, the code wins for behavior claims — flag the mismatch rather than silently picking one.
  4. Whatever else the author supplies. Screenshots, example projects, related pages, Slack threads, a specific voice sample. Screenshots are for more than general context — use them to verify the exact button/menu/field labels before writing instructional steps that reference them; a mismatched UI label is one of the easiest, most avoidable errors in a draft. Ask for these when the feature's user-facing shape is still unclear after 1–3, rather than guessing.

When the draft adds to or rewrites an existing page, also read the whole page, each page it links to, and other pages under apps/docs/content/ and apps/kb/src/content/ on the same topic. Search by the terms of the behavior as well as the page title. Note facts the draft must not repeat, and nearby text that the draft would make untrue, such as "the steps above".

Summarize all four back to the requester before drafting: what's confirmed, what's product intent vs. shipped behavior, what's still a gap. Stop and ask if a real gap would change the draft's structure or scope.

Phase 1.5 — Content-type gate

Before drafting, classify what's actually being asked for against the real content types (see ask-the-docs's app-map.md "Content types" table, and reference/content-type-gate.md here):

  • Guide / tutorial — hand-written MDX under content/guides/. This is what this skill drafts.
  • Troubleshooting: not in apps/docs. Troubleshooting articles live in /kb, fetched into apps/kb/src/content/troubleshooting/ from a private repo at build time, and they don't take direct contributions. See apps/kb/README.md.
  • Knowledge base (/kb): plain Markdown under apps/kb/src/content/ for content where the answer depends on the user's stack: comparisons, migration guides, buy-vs-build, applied how-tos. Also in scope, but follow apps/kb/AGENTS.md, not the apps/docs MDX conventions. Product facts stay in /docs; the /kb article links to them. See reference/content-type-gate.md.
  • Reference — generated from spec/ (OpenAPI, SDK YAML, CLI config) → features/docs/generated/**. Not hand-authored via the standard MDX path. If the ask is actually reference-type content (a new API endpoint, config option, or SDK method that needs a reference entry), stop drafting MDX — it would diverge from or get silently overwritten by the generator. Instead point to the spec/codegen pipeline (apps/docs/spec/, apps/docs/generator/; see ask-the-docs's management-api-reference.md for the OpenAPI-specific flow) and say so explicitly rather than producing a page that looks done but isn't the real fix.

When in doubt, ask ask-the-docs (Reference or Federated) or pm-the-docs (/docs vs /kb) rather than guessing — this classification is the one call in this skill most likely to be wrong if made from outside knowledge of the app.

Phase 1.6 — Template gate

Before drafting, pick the page's template and confirm it with the requester.

  1. Match the page's purpose, reader question, and Information Type to a row in Choose a template. Load only that template file.
  2. Tell the requester which template you chose, why, and the headings it requires. Wait for a yes or a different choice. If the requester is unavailable, go ahead with the template you recommend and record the choice in the handoff. If the page spans two templates, say so and propose a split.
  3. If no row fits, say so and ask. Don't invent a structure.
  4. Draft from the template's headings, and run its checklist in Phase 2.5.

For /kb, this gate applies to guides (apps/kb/src/content/guides/). Skip it for FAQs (apps/kb/src/content/faqs/): an FAQ answers its question in the first sentence of the body, as apps/kb/AGENTS.md defines.

Phase 2 — Draft

  • For apps/docs pages, follow apps/docs MDX conventions (component usage, frontmatter, code sample wiring). See ask-the-docs for the pipeline details rather than re-deriving them. For /kb content, follow apps/kb/AGENTS.md instead: plain GitHub-flavored Markdown, no components, and frontmatter with title, description, and topics.
  • Place the page using existing IA precedent; for a placement call that isn't obvious, consult pm-the-docs (Shape) rather than guessing a nav slot.
  • Wire it into navigation, not just onto disk. Placement (which section) and nav enablement (whether it actually shows up) are separate — confirm the current nav-registration mechanism via ask-the-docs rather than assuming a page is discoverable just because the file exists in the right folder.
  • Ground every behavior claim in Phase 1's code read (the linked PR when there is one); ground every "why this matters" framing in Linear/PM context or prior Frame/Shape output; mark inferred material inline (e.g. an HTML comment or a flagged line in the handoff summary) so a reviewer can find it fast.
  • Write timeless documentation, cut redundancy, and prefer a paragraph to a single-item list. See timeless documentation, brevity, and lists.
  • Strip internal business context before the final draft. HTML comments flagging PRD intent, roadmap speculation, internal ticket discussions, or "gap-fill" notes must be removed from MDX before handoff. Open-source docs shouldn't expose internal planning. Flag assumptions and open questions for reviewers in the PR description instead, not in the shipped content.
  • Search WORD_LIST.md when introducing or reviewing technical terms, UI actions, abbreviations, and potentially ambiguous language during drafting. Use the two-pass protocol in Use with an AI agent rather than reading the file end to end.
  • Reuse repeated content through apps/docs/content/_partials/ instead of copying it. For nav wiring, partials, and file placement, see ask-the-docs's app-map.md and federated-docs.md.

Phase 2.5 — Review checklist

Before handing off, confirm:

  • Style guide followed, or the gap named explicitly in the handoff
  • Every behavior claim traces to the code read (ideally the linked PR), not just the PRD, checked claim by claim in the accuracy pass
  • Every "why it matters" / positioning line traces to Linear/PM context or prior Frame/Shape output, not invented
  • Inferred or assumed material is flagged, not stated as fact
  • Content type confirmed as Guide or /kb (not Reference that belongs in generated output, and not Troubleshooting, which takes no direct contributions)
  • Nav placement and nav enablement both wired, not just the placement
  • Internal links resolve; first-use of new terms/acronyms is defined
  • Offered test-the-docs for runnable snippets (CLI, SQL, client code, or example apps)
  • Future promises minimized where possible (timeless documentation principle)
  • No unnecessary redundancy (same point restated multiple ways)
  • Single-item lists avoided unless there's a specific reason
  • Internal gap-fill and business context comments removed from MDX (keep only in PR description if needed for review)

Compliance checklist

Before handoff, run both passes from Use with an AI agent: read Phrase groups for the literal term lists, then grep '^### ' WORD_LIST.md and read only the entries matching words on the page. Cover terms you didn't introduce, not just the ones you searched while drafting. Then check the draft against each numbered file in the style guide.

  • Parentheses used only for acronyms or (Optional), not prose asides
  • Bold, italics, and code used only for their distinct purposes (UI labels, must-not-miss terms), not for visual emphasis alone
  • No dash-based asides where a direct sentence reads better
  • Terminology matches WORD_LIST.md (including any terms flagged as imprecise, not just spelling/capitalization)
  • Voice, tense, and brevity follow 01-voice-and-tone.md
  • Document type, section grouping, and chunking follow 03-page-structure.md
  • The page follows the template named in Choose a template (/kb FAQs are exempt; they answer the question in the first sentence)
  • Admonitions, headings, links, and other components follow 02-elements.md

Accuracy pass

Run this after the compliance checklist, as a separate pass. A clean style review does not show that the page is true. Run it in a fresh subagent that gets only the draft and the pinned version, so it checks the code and not the drafting agent's summary.

  1. List every behavior claim in the draft: what the feature accepts, rejects, returns, or requires. Include what each command or script the page tells readers to run changes, beyond its stated purpose.
  2. For each claim, check that the reader needs it. Cut a claim about internal mechanism, instead of making it more exact. See Document what the reader can use.
  3. For each claim you keep, open the source lines again at a pinned version: the commit your branch is based on, or the release tag when the code lives in another repo. Do not check against your notes or an earlier summary of the code.
  4. Compare the claim with every branch in those lines, including early returns, special cases, and fallbacks. If the code has an exception that the sentence leaves out, and the exception changes what the reader sees or does, add the exception or narrow the sentence.
  5. Treat any, all, always, only, and never as claims about every case. Keep them only when the code or a test covers every case.
  6. Put the file, line range, and version for each claim in the handoff, so a reviewer can check it.

When brevity and accuracy conflict, keep the sentence short and complete. Do not drop an exception to make a sentence read better.

Phase 2.6 — Moved or deleted pages (conditional)

Only apply this phase when the draft renames, moves, or deletes an existing page, so its URL changes or disappears. Skip it for new pages and for edits that keep the URL.

  • Every old URL that stops resolving gets a redirect. Follow apps/docs/lib/redirects/README.md:
    • One-to-one mappings go in static-redirects.json. Entries with params, splats, or conditions go in dynamic-redirects.js.
    • Use full public paths that start with /docs.
    • Don't add .md variants by hand for /docs/guides/ entries. The generator adds them.
  • Deleted pages with no replacement get a redirect to the closest live page, and the choice goes in the "needs review" section of the PR description.
  • Internal links, nav entries, and partials that point at the old URL are updated, so the redirect is only a fallback for external links.
  • Run pnpm -C apps/docs run redirects:generate and confirm the new entry appears in the generated output.

Phase 3 — Handoff

This skill stops at a reviewable draft. It does not open worktrees or PRs itself:

  • Offer test-the-docs when the draft includes runnable procedural snippets. Ask before starting verification. Gate prerequisites per artifact class (Docker Compose stack profile for DB/API artifacts; examples profile / Node in-runner for example-app). If declined, or a required prerequisite for that class is missing, record deferred for those artifacts only and continue. When accepted, attach the verification report to the PR body / self-review note.
  • Before opening the PR, run review-the-docs local self-review (build, classify, and run the Content review), including pnpm build:guides-markdown where applicable and the anchor checks in reference/drafting-mechanics.md.
  • When the PR is opened, carry the Phase 1/2 flagged-assumptions list into the PR description (for example, a "needs review" section) so a reviewer sees it, not just as an inline comment buried in the draft.
  • If the feature is UI-driven and the PR will need screenshots or GIFs, say so in the handoff rather than capturing evidence here.

Additional resources

Plus de skills de supabase

ask-the-docs
supabase
Répondre aux questions sur l’application de documentation Supabase (apps/docs) en utilisant l’architecture documentée, le pipeline de build et les notes sur les modèles de revue, et appliquer la conception de fonctionnalités…
clickhouse-logs-queries
supabase
Write, review, and migrate Supabase logs queries against the ClickHouse-backed `logs` table (the `logs.all.otel` analytics endpoint). Use this whenever a task…
copywriting
supabase
Rédigez ou auditez les textes d'interface (boutons, libellés, états vides, messages d'erreur, infobulles, textes de formulaire) où qu'ils se trouvent dans le monorepo. Chargez-le avant de livrer ou de réviser tout…
dev-toolbar-review
supabase
Utiliser lors de la revue de PRs qui touchent packages/dev-tools/, packages/common/posthog-client.ts,
docs-content
supabase
Rédiger, modifier, organiser et réviser le contenu Supabase partout dans apps/docs — guides, explications, tutoriels, entrées de dépannage, documentation de référence, et…
e2e-studio-tests
supabase
Exécutez les tests e2e dans l'application Studio. Utilisez
pm-the-docs
supabase
Support décisionnel Docs-PM pour le processus de rédaction « Write the docs » — prend des décisions sur l'audience, l'étape et la portée transversale pendant les étapes Frame et Shape,…
react-hook-form
supabase
Utilisation correcte de React Hook Form partout dans le monorepo — flux de données, abonnements, réinitialisation, état modifié, champs numériques et règles de saisie contrôlée. Chargez ceci…