Agent Skillssupabase/supabase › test-the-docs

test-the-docs

GitHub

在隔离的 Docker Compose 沙箱中运行文档中的代码片段和示例,验证 CLI、SQL 及代码的正确性,生成 PR 验证报告。

.agents/skills/test-the-docs/SKILL.md supabase/supabase

触发场景

测试文档内容 事实核查代码片段 运行示例以验证

安装

npx skills add supabase/supabase --skill test-the-docs -g -y
更多选项

非标准路径

npx skills add https://github.com/supabase/supabase/tree/master/.agents/skills/test-the-docs -g -y

不安装直接使用

npx skills use supabase/supabase@test-the-docs

指定 Agent (Claude Code)

npx skills add supabase/supabase --skill test-the-docs -a claude-code -g -y

安装 repo 全部 skill

npx skills add supabase/supabase --all -g -y

预览 repo 内 skill

npx skills add supabase/supabase --list

SKILL.md

Frontmatter
{
    "name": "test-the-docs",
    "description": "Execute runnable docs snippets and examples inside a disposable Docker Compose sandbox (runner container + local Supabase stack via `supabase start`). Use after Draft or during Self-review when asked to test the docs, fact-check CLI\/SQL\/code samples, or produce a verification report for a docs PR. Complements review-the-docs build and review checks; does not replace them."
}

Test the docs

Runs procedural docs content inside disposable containers, not on the host shell and not against production. Produces a verification report for the PR body / self-review note.

For markdown rebuilds, example-app triage, and PR review, use review-the-docs. For Frame/Shape and cross-repo product lookup, use pm-the-docs.

When to invoke

  • After Draft, before or during Self-review (checklist Stage 4).
  • Standalone: "test the docs", "fact-check these snippets", "run the examples".
  • Content or tutorial PRs that add or change procedural fenced blocks.

Not for: generated reference pages, docs-app architecture questions, or hosted/production projects.

Core rules

  1. Never run against production. Local stack or temp dir only.
  2. Never run MDX fences on the host shell. Use the Compose sandbox — see reference/sandbox-setup.md and sandbox/run.sh.
  3. Proportional: Tier A (one end-to-end path) is required; Tier B spot-checks new/changed procedural blocks, not every fence on every page.
  4. Product bugs found while testing get linked or filed separately; fix docs only when the docs are wrong.

Phases

1. Scope

From explicit MDX paths, or:

git diff --name-only master...HEAD -- 'apps/docs/content/**'

Skip generated reference output under features/docs/generated/.

2. Extract

List runnable artifacts from changed MDX:

  • Fenced blocks: bash, sh, sql, javascript, typescript, tsx, jsx
  • $CodeSample paths → treat as example-app (build under examples/)
  • Skip: mermaid, incomplete illustrative fragments, partial-only includes

3. Classify

Assign each artifact a class per reference/snippet-classes.md:

Class Action
runnable-local Run in temp stack / temp dir
runnable-with-setup Run after documented setup (migrations, seed)
example-app npm install && npm run build in examples/…
illustrative-only No run required
deferred Record reason; do not silently skip

4. Sandbox setup

Follow reference/sandbox-setup.md and drive lifecycle with sandbox/run.sh:

  1. Refuse if the host is running as root.
  2. Require docker + docker info + docker compose on the host for any in-container run.
  3. Gate profiles per artifact class:
    • runnable-local / runnable-with-setup that need DB/API: ./sandbox/run.sh up-stack (DinD + runner → supabase init / supabase start in /work).
    • CLI-only blocks with no DB: still use a runner profile so fences stay off-host; skip supabase start when unused.
    • example-app: TTD_EXAMPLE_DIR=<repo>/examples/<app> ./sandbox/run.sh up-examples (Node in runner; no DinD). Do not defer solely because the host lacks a global Supabase CLI.
  4. Always ./sandbox/run.sh down when finished (cleanup trap on the host session).
  5. Capture connection URLs only inside the runner; never paste credential fields into notes or logs.

If a required prerequisite for that artifact is unavailable, mark that artifact deferred with the specific reason — never silent skip, and do not defer unrelated classes.

5. Execute

  • Tier A: one copy-pasteable end-to-end path from the page.
  • Tier B: each new/changed block classified runnable-* or example-app (build and record the result).
  • Run every fence via ./sandbox/run.sh exec or exec-timeout (never a bare host shell).
  • Bound every artifact: default 60s for shell / SQL / JS / TypeScript / tsx / jsx; allow longer for example-app install/build (e.g. 5m). On timeout, kill the process group inside the runner, then record fail or deferred with reason.
  • curl / wget only to filtered stack URLs (or page-documented local endpoints). npm / npx / node only for mounted example-app builds.
  • Capture exit code, stdout/stderr (redact secrets), and observed vs expected behavior.

6. Report

Write a verification report per reference/verification-report.md for the PR body / self-review note.

Related skills

版本历史

  • 59e2122 当前 2026-09-23 10:29

同 Skill 集合

.agents/skills/api-types/SKILL.md
.agents/skills/copywriting/SKILL.md
.agents/skills/dev-toolbar-review/SKILL.md
.agents/skills/edit-the-docs/SKILL.md
.agents/skills/review-the-docs/SKILL.md
.agents/skills/studio-e2e-tests/SKILL.md
.agents/skills/studio-error-handling/SKILL.md
.agents/skills/studio-mock-api-tests/SKILL.md
.agents/skills/studio-queries/SKILL.md
.agents/skills/studio-shortcuts/SKILL.md
.agents/skills/studio-testing/SKILL.md
.agents/skills/studio-ui-patterns/SKILL.md
.agents/skills/telemetry-standards/SKILL.md
.agents/skills/vercel-composition-patterns/SKILL.md
.agents/skills/vitest/SKILL.md
.agents/skills/write-the-docs/SKILL.md
.claude/skills/copywriting/SKILL.md
.claude/skills/dev-toolbar-review/SKILL.md
.claude/skills/docs-content/SKILL.md
.claude/skills/studio-e2e-tests/SKILL.md
.claude/skills/studio-error-handling/SKILL.md
.claude/skills/studio-mock-api-tests/SKILL.md
.claude/skills/studio-queries/SKILL.md
.claude/skills/studio-testing/SKILL.md
.claude/skills/studio-ui-patterns/SKILL.md
.claude/skills/telemetry-standards/SKILL.md
.claude/skills/vercel-composition-patterns/SKILL.md
apps/studio/.claude/skills/explorer/SKILL.md
.agents/skills/ask-the-docs/SKILL.md
.agents/skills/clickhouse-logs-queries/SKILL.md
.agents/skills/pm-the-docs/SKILL.md
.agents/skills/react-hook-form/SKILL.md
.agents/skills/safe-sql-execution/SKILL.md
.claude/skills/clickhouse-logs-queries/SKILL.md
.claude/skills/react-hook-form/SKILL.md
.claude/skills/safe-sql-execution/SKILL.md

元信息

文件数
0
版本
59e2122
Hash
eae3b8c7
收录时间
2026-09-23 10:29

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-23 15:21
浙ICP备14020137号-1