mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## 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>
137 lines
8.0 KiB
YAML
137 lines
8.0 KiB
YAML
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
|
|
|
|
# Don't inherit organization-level settings (they're tuned for other repos);
|
|
# this config is self-contained and unset values use CodeRabbit defaults.
|
|
inheritance: false
|
|
|
|
# Enrich linked issues with related code and potential solutions during review.
|
|
issue_enrichment:
|
|
auto_enrich:
|
|
enabled: true
|
|
|
|
reviews:
|
|
high_level_summary: false
|
|
# Skip machine-generated / vendored files (mirrors .prettierignore). Keeps
|
|
# reviews focused on hand-written code and preserves rate-limit budget on
|
|
# large codegen diffs.
|
|
path_filters:
|
|
- '!pnpm-lock.yaml'
|
|
- '!packages/api-types/types/**' # generated API types (api.d.ts, platform.d.ts)
|
|
- '!supabase/functions/common/database-types.ts' # generated by `pnpm generate:types`
|
|
- '!**/routeTree.gen.ts' # TanStack Router generated
|
|
- '!**/__generated__/**'
|
|
- '!apps/docs/features/docs/generated/**'
|
|
- '!apps/www/.generated/**'
|
|
- '!apps/design-system/__registry__/**'
|
|
- '!apps/ui-library/__registry__/**'
|
|
- '!apps/ui-library/public/r/**' # registry output
|
|
- '!packages/icons/__registry__/**'
|
|
- '!packages/icons/src/icons/**' # generated icon components
|
|
|
|
# Targeted, path-scoped review guidance, version-controlled alongside the code.
|
|
path_instructions:
|
|
- path: 'packages/common/telemetry-constants.ts'
|
|
instructions: |
|
|
Strictly enforce event naming: [object]_[verb] in snake_case. Only approved
|
|
verbs: opened, clicked, submitted, created, removed, updated, evaluated,
|
|
added, enabled, disabled, copied, exposed, failed, closed, completed,
|
|
applied. Properties must be camelCase for new events (match existing
|
|
convention when adding to existing events). Flag any usage of
|
|
useSendEventMutation. Verify @group Events and @source JSDoc tags are
|
|
accurate. Check that new interfaces are added to the TelemetryEvent union type.
|
|
- path: 'apps/studio/components/**/!(*.test).tsx' # production components only, not tests
|
|
instructions: |
|
|
Only suggest adding PostHog event tracking (via useTrack from
|
|
lib/telemetry/track, [object]_[verb] snake_case) when a new user-facing
|
|
interaction is growth-relevant: e.g. first-use of a feature, onboarding steps,
|
|
project/org creation, upgrade/billing actions, enabling or disabling a product
|
|
feature, or any action that signals activation or retention. Do not suggest
|
|
tracking for: passive views, page loads, UI-only state changes (e.g. expanding
|
|
a panel, switching tabs in a settings page), developer/internal tooling
|
|
interactions, or interactions clearly unrelated to product adoption.
|
|
- path: 'apps/docs/content/**/*.mdx'
|
|
instructions: |
|
|
Flag style, terminology, and structure issues as usual. When a page has two or
|
|
more of them, add one comment pointing the author at the `/write-the-docs` skill
|
|
for new content or `/edit-the-docs` for an existing page (canonical files in
|
|
`.agents/skills/`); both apply the docs style guide in
|
|
apps/docs/style-guide/. Skip that pointer on a single issue, so it stays a
|
|
signal that the author isn't using the skills rather than boilerplate.
|
|
- path: '{apps,packages}/**/*.{tsx,jsx,css,mdx}'
|
|
instructions: |
|
|
When reviewing UI changes, flag these accessibility gaps. Comments are
|
|
advisory. One comment per gap. Skip test files (*.test.*, *.spec.*) and
|
|
generated files. Skip Radix/shadcn primitives imported from ui for all
|
|
checks below. Do not flag issues axe-core already catches mechanically,
|
|
such as a missing alt attribute, an empty button or link name, or
|
|
invalid ARIA.
|
|
- State changes: if sighted users can see a status change (toast,
|
|
loading/empty swap, copy confirmation, async result) and nothing
|
|
announces it, suggest aria-live="polite" or role="status". Reserve
|
|
role="alert" for urgent errors or warnings. Skip if a live region,
|
|
Radix Toast, or Sonner is already there, or if the change is
|
|
decoration only. If a live region is created in the same conditional
|
|
as its message, flag that: the region must already exist in the DOM,
|
|
then receive the update, or screen readers often announce nothing.
|
|
- Mouse interaction: flag pointer-only handlers on a non-interactive
|
|
element (div, span, or similar) with no keyboard equivalent. The
|
|
listed handlers are illustrative: onClick, onMouseEnter,
|
|
onDoubleClick, onContextMenu, onPointerDown, onPointerUp,
|
|
onTouchStart, onTouchEnd, and equivalents. Also flag hover-only UI
|
|
(content revealed with onMouseEnter or CSS :hover) that has no focus
|
|
or keyboard path.
|
|
- Animation: flag animate-*, keyframes, or JS motion with no
|
|
reduced-motion treatment. Prefer Tailwind motion-reduce: /
|
|
motion-safe:, or matchMedia('(prefers-reduced-motion: reduce)').
|
|
packages/config/css/utilities.css only zeroes out .shimmer under
|
|
reduced motion, not all animation.
|
|
- Alt text: flag generic values such as Image, Icon, Photo, Picture, or
|
|
the filename. Flag alt that starts with "image of" or "picture of".
|
|
If adjacent visible text already names the image (blog thumbnail next
|
|
to its title, icon next to its label), flag it as redundant and
|
|
recommend alt="" plus aria-hidden on the image. For a decorative SVG
|
|
next to visible text, recommend aria-hidden on the SVG. If alt is
|
|
longer than about two sentences, suggest moving the extra into a
|
|
caption, adjacent text, or aria-describedby. Do not treat a character
|
|
count as a hard fail.
|
|
- Focus visibility: flag outline-none, outline-hidden, outline: none,
|
|
outline: 0, or equivalent :focus resets that are not paired with a
|
|
focus-visible ring or outline, or with the focus-ring or focus-inset
|
|
utility.
|
|
- Color-only state: flag status, validation, or selection that is
|
|
conveyed only by color. Suggest a text label, icon, or sr-only text
|
|
in addition.
|
|
- Link purpose: flag an accessible name that is only "click here",
|
|
"read more", or "learn more" when it does not describe the
|
|
destination. Skip if aria-label or wrapping context already names
|
|
where the link goes.
|
|
- Color contrast: flag non-large informative text below 4.5:1 and large informative
|
|
text (at least 24px regular or 18.5px bold) below 3:1. Skip logotypes and
|
|
decorative text. Treat expressive text at 40px or larger as advisory rather
|
|
than blocking.
|
|
|
|
# Applies our internal engineering skills (.agents/skills/) and the docs style
|
|
# guide (apps/docs/style-guide/) as CodeRabbit review guidelines. Both are the
|
|
# single source of truth — they are consumed directly, with no copy of their
|
|
# content elsewhere.
|
|
#
|
|
# `applyTo` decouples where a guideline file lives from the code it governs.
|
|
# Without it, CodeRabbit scopes a guideline file to its own directory and below;
|
|
# our skills live in .agents/skills/, which contains no code, so they would never
|
|
# reach apps/studio. `applyTo` points them at the right paths instead.
|
|
knowledge_base:
|
|
code_guidelines:
|
|
filePatterns:
|
|
# Studio code conventions — React/TS, UI patterns, composition, data fetching, errors
|
|
- files: '.agents/skills/{studio-ui-patterns,vercel-composition-patterns,studio-queries,studio-error-handling,react-hook-form}/SKILL.md'
|
|
applyTo: 'apps/studio/**/*.{ts,tsx}'
|
|
# Studio unit / component test conventions
|
|
- files: '.agents/skills/{studio-testing,studio-mock-api-tests}/SKILL.md'
|
|
applyTo: 'apps/studio/**/*.test.{ts,tsx}'
|
|
# Studio end-to-end (Playwright) test conventions
|
|
- files: '.agents/skills/studio-e2e-tests/SKILL.md'
|
|
applyTo: 'e2e/studio/**/*.spec.ts'
|
|
# Docs content: the style guide
|
|
- files: 'apps/docs/style-guide/*.md'
|
|
applyTo: 'apps/docs/content/**/*.mdx'
|