mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## I have read the CONTRIBUTING.md file.
YES
## What kind of change does this PR introduce?
**Skill update.** The `write-the-docs` and `edit-the-docs` skills and
the `pm-the-docs` checklist now say when content belongs in `/kb`
instead of `/docs`. The docs skills also get a consistency pass.
Closes DOCS-1559.
## What is the current behavior?
The skills and the checklist do not mention `/kb`. Writers get no prompt
to put comparisons or migration guides there. The skills also still
place troubleshooting in `apps/docs`, disagree about which skill owns
the Shape stage, and link to skills that are not in this repo.
## What is the new behavior?
| File | Change |
|---|---|
| `.agents/skills/write-the-docs/reference/content-type-gate.md` | Adds
a `/kb` row and a short "What goes in `/docs` and what goes in `/kb`"
section. Troubleshooting now points to `/kb`. |
| `.agents/skills/write-the-docs/SKILL.md` | Adds `/kb` to the content
types. `/kb` guides use the template gate, and `/kb` FAQs are exempt.
Phase 2 sends `/kb` content to `apps/kb/AGENTS.md`. Removes duplicate
steps and links to skills outside this repo. |
| `.agents/skills/write-the-docs/reference/drafting-mechanics.md` | Says
oxfmt instead of Prettier |
| `.agents/skills/edit-the-docs/SKILL.md` | Adds a content-type gate
check before additions |
| `.agents/skills/pm-the-docs/reference/write-the-docs-checklist.md` |
Adds a stage 2 (Shape) item to decide if content belongs in `/kb`. Shape
now points to `/pm-the-docs` for placement decisions. |
| `.agents/skills/pm-the-docs/SKILL.md`,
`.agents/skills/ask-the-docs/SKILL.md` | Agree that `pm-the-docs` owns
Frame and Shape, and `ask-the-docs` owns docs-app mechanics. Removes
links to skills outside this repo. |
| `.agents/skills/ask-the-docs/reference/*.md` | Says oxfmt instead of
Prettier, updates the troubleshooting known issue, and removes links to
skills outside this repo |
## Additional context
Skill docs only. No preview needed. Troubleshooting now lives in `/kb`
and takes no direct contributions. The skills now say so.
### Test plan
- [ ] Read the diffs. The `/docs` and `/kb` rule matches the
content-type gate.
- [ ] `grep -rn docs-agent-skills
.agents/skills/{write,ask,pm}-the-docs` returns nothing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Nik Richers <nik@validmind.ai>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com>
6.4 KiB
6.4 KiB
apps/docs gotchas
Specific traps to watch for. One-liner per item.
Markdown pipeline
- JSX with no schema handler is unwrapped, not dropped. Children pass
through as plain markdown. If a component should disappear entirely from
.mdoutput, its handler must return''. - Handlers run bottom-up. Children are already-serialized markdown
strings by the time the parent handler sees them. Don't try to inspect
child JSX from a parent handler — use
node.childrenonly for structure decisions. mdxFlowExpression/mdxTextExpression/mdxjsEsmare skipped. Anything wrapped in{...}won't appear in markdown output.<AiPrompt id="…" />carries only an ID. Prompt text lives indata/ai-prompts.data.ts; don't inline prompt strings in MDX. Markdown export handles thePromptPanelparts viainternals/markdown-schema/PromptPanel.ts(dropsPromptCopy).<$Partial>recursion is silent. A missing or unreadable partial is dropped without error. Checkpartials/paths when content seems missing from generated.md.$Partialvariablesare runtime-only unless wired in markdown export.partialsRemarksubstitutes{{ .key }}placeholders;inlinePartialsingenerate-guides-markdown.tsmust do the same or nested partials likepath="{{ .prompt }}"fail silently (file not found).GlassPanel/IconPanelmarkdown handlers must include children. A handler that returns onlyprops.titledrops nested content. Seeinternals/markdown-schema/Panel.ts.
Markdown handler authoring
- Handler files in
internals/markdown-schema/must be named after the component (ContentListings.ts, notListings.ts). The registry key ingenerate-guides-markdown.tsis the JSX element name. - Use the existing
withDocsBasePath/addBaseUrlPrefixfrominternal-links.tsfor URL prefixing — don't roll your own. - If a handler needs data, the JSX prop carries an
idand the handler looks the data up from the same registry the runtime component uses. Don't serialize data into JSX props. - Push a blank line right after each exported block (heading, description, list). Keeps handler logic linear and avoids redundant trailing-empty-line branches.
React / MDX components
not-proseis the canonical opt-out from the surrounding.prosetypography. Wrap structural layout innot-prose; keep headings outside so they inherit prose styles.<Heading>fromMdxBase.shared.tsxis the canonical heading. Don't roll your own<h2>/<h3>markup in MDX components — typography drifts.<Link>fromnext/linkworks withtarget="_blank"for external destinations. Don't construct<a>directly.- A
useSendTelemetryEvent()call inside a render path returns a function; don't invoke it directly inside the JSX, build a callback first. $Showreads staticenabled-featuresflags only. It cannot read PostHog flags. See feature-flags.md.
Data modules
- Shared zod schemas for MDX components should use HTML heading levels
(
'h2'|'h3'|'h4'), not markdown marker strings ('##'). Markdown markers belong only ininternals/markdown-schema/handlers (via aRecord/Maplookup). getXById(id)lookups belong in*.utils.ts, not in the data file or the schema file. Schema files hold schemas; data files hold data; utils hold functions.- Each
.data.tsexports named groups; the topicindex.tsaggregates them into aRecord<id, group>map. The aggregation file is the single source of truth for "all valid IDs."
URL handling
- External-link detection is not just
/^https?:\/\//. Protocol-relative (//host),mailto:,tel:, custom schemes — all external. Prefernew URL(href, base)or a broader regex. withDocsBasePath('/guides/foo')→/docs/guides/foo. Already-prefixed URLs are passed through. Use it consistently in markdown output to avoid broken links.
Build / CI
pnpm build --filter=docsruns markdown generation. A failure ingenerate-guides-markdown.tsblocks the build — read its console output rather than the cryptic CI error.pnpm formatfrom the repo root catches most oxfmt drift. Run it before opening a PR; CI is unforgiving.- Auto-import sorting can silently shuffle imports across files you didn't
touch. Reset those files (
git checkout master -- <path>) before pushing.
Federated docs
See federated-docs.md for the full surface — the
short version:
- No GitHub App credentials in dev =
$CodeSampleshows a warning, not real content. Don't assume the page is broken. pageMapis manual. Upstream renames break links until a maintainer updates the route file.- Wrappers pin to release tags (
docs_v*.*.*). If tagging breaks upstream, build fails. - Search and federated content interact poorly — search infrastructure
is currently decoupled from the markdown generation. See
docs-app-direction.md.
Reference pages
- SDK and CLI reference pages don't go through the standard MDX path —
they're too long for the AST parser in preview environments. Generated
from
spec/instead, output tofeatures/docs/generated/**. - Reference page length is a known UX/LLM problem. Long-term plan: split
into smaller modular pages. Management API is already one endpoint per
page (DOCS-1268); see
management-api-reference.md. - Management API Redocly bundle omits
--dereferencedbecause of a circular$ref. Don't "fix" that by adding--dereferencedwithout checking codegen's cycle-saferesolveRefs. - Don't propose Scalar/Redoc/Elements as the Management API page UI
without covering markdown export, search, and
x-*extension fields.
PR hygiene
- No incidental import reorders or whitespace edits in a feature PR. Reset files that are conceptually unchanged.
- When resetting unrelated files (
git checkout master -- <path>), verify the result matches currentmaster— rebases can resurrect stale file versions. - File names must match the primary export. Rename rather than aliasing on import.
- Single-use helpers stay in the consuming file. Don't add new files in unrelated folders for one-shot utilities.
- Two components with the same JSX shape and different classes → collapse with a discriminator prop. Don't ship near-duplicates.