Skip to content

feat(skills): add a planning skill for documentation evals - #259

Merged
czenko merged 20 commits into
mainfrom
feat/docs-eval-planning-skill
Sep 17, 2026
Merged

czenko merged 20 commits into
mainfrom
feat/docs-eval-planning-skill

Conversation

@czenko

@czenko czenko commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes DOCS-1228

Merge #304 first. It keeps a skill folder under evals/docs/ from stopping eval discovery. This PR's checks pass either way, because no check on a PR runs discovery, but every eval run does.

Problem

Four build-docs-* evals exist and each was designed from scratch. The most recent cost three false reds and one false green, all of them mistakes an earlier author had already made or could have warned about. The only authoring guidance that exists is a five-step how-to buried in build-docs-001/README.md.

Solution

  • The skill. evals/docs/.claude/skills/docs-eval-planning/: SKILL.md plus four references. It sits inside evals/docs/, which CODEOWNERS gives to the docs team, so the skill and the evals it plans have the same owner.
  • Six phases. Enter plan mode and read CONTRIBUTING.md, gather the evidence, pick the one claim the page has to transmit, draft the prompt, design the checks, write the plan, and feed the catalog once the baseline lands.
  • references/sources.md lists every evidence source. The Access column reads Public or Supabase, and a contributor without a connector drops that source and keeps going. Planning from the public sources alone is a supported outcome. What is not optional is recording which sources the inventory came from, because one built from public sources alone reads as complete when it is not.
  • references/check-rules.md is ordered by what a violation costs. The first three are observability, behavior over structure, and positive controls a literal cannot satisfy.
  • references/flakiness.md is mined from review feedback on twenty-one PRs, with a citation per entry. Nine of those PRs were outside the set I started from, including feat: add docs homepage quickstart eval #108, which carries a CHANGES_REQUESTED review, and feat: move eval execution from GitHub Actions to Vercel Sandboxes #192, where the CI reproducibility work happened.
  • references/prompt-rules.md carries the prompt discipline. The file, frontmatter, and README conventions live in SKILL.md itself.

Not asserted here: the skill is deliberately not installable into an eval sandbox. A run must never load it, or an eval that measures a docs page would be measuring this skill instead.

Manual testing

  1. Confirm the skill is discovered and its description reads correctly.

    ls evals/docs/.claude/skills/docs-eval-planning
  2. Confirm every relative link resolves and every path the skill names exists.

    grep -oE '\(references/[a-z-]+\.md\)' evals/docs/.claude/skills/docs-eval-planning/SKILL.md
  3. Confirm the skill folder does not break eval discovery, with fix(framework): skip directories with no PROMPT.md during eval discovery #304 applied.

    pnpm eval:dry -- --suite docs --experiment-suite docs

    Plans all seven docs evals. Without fix(framework): skip directories with no PROMPT.md during eval discovery #304 the same command fails with ENOENT: ... evals/docs/.claude/PROMPT.md.

  4. Typecheck and run the harness unit tests.

    pnpm typecheck && pnpm --filter @supabase-evals/framework test

    Clean, 8 passed.

  5. Confirm Biome does not process the skill, since it ships no markdown formatter.

    ./node_modules/.bin/biome check evals/docs/.claude

    No files were processed in the specified paths.

Four build-docs evals exist and each was designed from scratch. The most
recent cost three false reds and one false green, all of them mistakes an
earlier author had already made.

The skill plans a documentation eval and stops at the plan. Six phases: enter
plan mode and read CONTRIBUTING.md, gather the evidence, pick the one claim the
page has to transmit, draft the prompt, design the checks, write the plan, and
feed the catalog once the baseline lands.

Five references carry the catalogs. sources.md lists every evidence source and
marks which need an MCP connector or private access, because an agent that
silently skips a gated source produces a thin inventory that reads as complete.
check-rules.md is ordered by what a violation costs, and the first three rules
are the ones that have sunk a run. flakiness.md is mined from the review
feedback on twenty-one PRs, with a citation per entry.

It lives under .claude/skills/ rather than skills/, which holds product skills
that experiments install into eval sandboxes.

Closes DOCS-1228
@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Preview Sep 17, 2026 12:28am UTC

Request Review

@czenko

czenko commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

I plan to stress test this SKILL before merging by creating another Docs Eval.

@czenko czenko left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback on my own PR 😁

@czenko
czenko requested a lite review from Copilot September 2, 2026 23:46
Applies review feedback. Every reference now states the decision rather than
the case that produced it, per Google's timeless documentation guidance.

canonical-shape.md drops the genre background, the scorer-structure history,
and the reasoning behind not committing solutions. It says to model on
build-docs-003 or later, and to never commit solutions.

check-rules.md and prompt-rules.md drop their worked examples and state what to
do. The motivation guidance now names the constant behind every one of these
evals: evidence that an agent can read the page and do the task correctly.

sources.md opens with the note that Linear, Slack, Hex, and Supacademy are
internal to Supabase, since this repository is open source, and that planning
from the public sources alone is a supported outcome.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new skill is committed under .claude/skills/, but the harness resolves/installable skills from skills/<name>, so it won’t be discoverable via the normal skills mechanism as-is.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new “docs-eval-planning” agent skill intended to standardize how documentation-page evals are planned in this repo, capturing prior failure modes and conventions so new evals don’t repeat avoidable mistakes.

Changes:

  • Introduces a new planning skill (SKILL.md) describing a phased workflow for designing docs eval prompts and checks.
  • Adds reference documents covering evidence sources, prompt authoring rules, check design rules, canonical eval shape, and a flakiness catalog.
File summaries
File Description
.claude/skills/docs-eval-planning/SKILL.md Main skill entrypoint describing phases and how to produce a planning artifact.
.claude/skills/docs-eval-planning/references/sources.md Catalog of evidence sources to derive checks from (internal + public).
.claude/skills/docs-eval-planning/references/prompt-rules.md Rules for writing prompts that test the page rather than the model.
.claude/skills/docs-eval-planning/references/check-rules.md Ordered checklist of check-design constraints and common traps.
.claude/skills/docs-eval-planning/references/flakiness.md Curated list of previously observed false reds/greens and nondeterminism sources.
.claude/skills/docs-eval-planning/references/canonical-shape.md Conventions for docs-eval folder shape, README content, and orchestration patterns.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

canonical-shape.md read as a thin spec once its background came out. Its six
items move into SKILL.md: the naming and id rule, the file layout, the EVAL.ts
shape, the README section set, and the guide-read check go into a shape section
before the phases; the seed rules and the contract choice join Phase 3, where
the seed is drafted; judges join Phase 4; example solutions join Phase 5, where
verification is planned.

SKILL.md is 1,587 words, inside the range a skill body should hold.
Running the skill on auth/server-side/creating-a-client found five things it
does not say.

Phase 2 now ends by confirming the harness can measure the claim, before any
check is designed. A claim the harness cannot observe is not the claim, and
finding that in Phase 4 is a rewrite rather than a design change. The three
questions are where the end state lives, whether the scorer can run what has to
run, and what the time budget is.

Phase 2 also gives a basis for picking. A dense page yields ten evidenced
candidates, so pick on consequence and prefer the failure the page itself warns
about.

sources.md adds the ticket as a source and says to read its rationale as
evidence rather than instruction, because a ticket written before the page
changed will name a method the page no longer recommends. The diff step now
says the page wins on what is acceptable and the check names the class.

flakiness.md gains the two entries behind the feasibility step: a framework the
eval seeds is not on the host, and a first-of-its-kind toolchain in a scorer is
a risk to state rather than a detail.

Phase 0 reads flakiness.md, which the intro already asked for.
Four framework entries and two on reading a result. The saturation pair is the
one that matters: a full-marks baseline is a finding when the fixtures prove the
checks can fail, and it still does not attribute the success to the page.
Follows apps/docs/CONTRIBUTING.md and WORD_LIST.md in supabase/supabase.

behaviour becomes behavior in four places. `while` marks simultaneity, not
contrast, so a name that overstates a class now reads "is false when the check
proves only a few members of it". Saturation is a predictable result rather than
a future event, so the prediction step drops `will`. The word list warns on
`easy`, so the results-export entry states what happens instead.

`REFERENCE` is set as code, and the ticket row in sources.md is split into two
sentences rather than one wall.

`repo` and `docs` stay: the word list allows both in informal contributor
instructions, which is what these files are.
Copilot flagged that `EnterPlanMode` has no other reference in this repo, and
an agent in a harness without it has nothing to act on. The rule now leads:
write nothing through Phase 4, the output is a plan. The tool is named as the
mechanism where a harness offers one.
@czenko
czenko marked this pull request as ready for review September 3, 2026 23:28
@czenko
czenko requested a review from a team September 3, 2026 23:28
A sandbox lost its database container mid-run, which cost the install check and
everything downstream. Nothing at the eval's level fixes that, so the entry says
to report the run as lost rather than average it in, and adds the companion rule
for reading a result.

Diffing two docs previews also needs the deployment host stripped first, or the
one real edit sits under dozens of rewritten links.
The tables guide eval sent an incomplete row on an anonymous insert, so a
not-null violation read as a refusal and a wide-open table scored as
protected. Recorded with the fix: send the whole contract row, confirm
absence as the superuser, and treat any code outside 42501 as
could-not-measure.

The leftover-directory trap recurred on the same eval, so its citation gains
a second PR and a note that it comes from switching onto the next eval's
branch.
The tables guide eval ran twice, once without the reliance instruction and
once with it. Unread and read produced the same substantive checks, so the
prior-knowledge confound is measured rather than hypothetical.

Two ways a result got misread on that eval. A missing reliance instruction
leaves a baseline that looks unremarkable, and only an empty docs.calls says
the page was never opened. Benign supabase status chatter at the head of a
failure note got a genuine missing-table failure filed as infrastructure.

@nrichers nrichers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a PR for me to approve but I did have a suggestion about softening the divide between open-source and Supabase. Very helpful skill - I think it could work for a broader audience.

When I tested the skill, it worked as expected: 🙌

I picked a real negative-feedback guide from obsidian-supabase → Priorities/03-Evidence based docs prioritization → the live prioritization manifest (docs-agent-skills): rank #17, BL-032, Storage/RLS, 11 linked FDBKIN issues. Followed the skill's phases (read CONTRIBUTING.md, the guide's .md variant, flakiness.md; gathered evidence via Linear MCP, GitHub agent-skills issues, and the live docs page; picked one claim; confirmed measurability):

The guide: storage/security/access-control.mdx ("Storage Access Control"). The one claim: RLS policies on storage.objects are completely irrelevant for reads once a bucket is marked public — a bucket's public URL bypasses RLS entirely — and the guide teaches elaborate RLS policies without ever warning that public-bucket status overrides all of them. Confirmed via Linear (FDBKIN-31412, "Improve security of default Storage policies in tutorials and docs," priority Urgent) plus its already-filed paired ticket STORAGE-478 ("Update Storage docs for RLS, listing, and public buckets" — created after "a recent incident where AI-generated setup appears to have added insecure policies"), and confirmed the tutorial's own copy-paste snippet (storage/quickstart.mdx) literally ships a policy named "Public Access" on bucket_id = 'public'. This gives the eval a behavioral check with no aliasing risk at all: query storage.buckets.public, and — the real proof — attempt an unauthenticated fetch of the agent-created object's public URL, which must fail if the bucket is truly private.

The skill worked well in practice: its phase ordering (evidence before claim, claim before checks) kept me from jumping straight to writing checks, and check-rules.md/flakiness.md directly shaped which check design I picked (behavioral over structural, given rule 2 and the aliasing bug I just reproduced in #257). One friction point worth relaying to the author: sources.md assumes Linear/Hex/Slack access that a fresh session doesn't have by default — I only got real evidence because Linear MCP happened to be reachable; the skill has no fallback guidance for "you got partial access, here's how much plan quality to expect."

Since the skill's own scope is "produces a plan, not files," I stopped there — want me to write up the full plan (prompt draft, seed spec, check table) as a proposal, or go further and actually build evals/build-docs-006-storage-access-control/?

Two false greens or reds in the scorer, one environment property that shapes
how a local secrets eval has to be built, and one instrumentation defect that
affected every docs eval rather than just this one.
Everything under evals/<suite>/ was read as an eval, so any other directory
there threw and stopped discovery for the whole repo.
The docs team owns evals/docs/ in CODEOWNERS, so the planning skill sits
with the evals it plans. Paths in the skill follow the evals/<suite>/<id>/
layout, and the frontmatter rule drops the suite field the folder now carries.
A download probe is not a positive control when the bucket flag decides
delivery. Correct SQL in an unapplied migration reds every check that reads
the database. One baseline's failure mode is not the eval's. A scorer cannot
delete from the Storage tables.

@nrichers nrichers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and this is great. 🙌 🚀

The guard lives in apps/, which CODEOWNERS assigns to the AI team. Splitting
it out leaves this PR scoped to evals/docs.
The access note told an outside contributor the plan would be smaller without
saying which sources to drop. The Access column now reads Public or Supabase,
and missing access is stated as out of scope rather than a blocker.
@czenko

czenko commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Applied feedback with a contributor audience in mind. Separated the PR for the AI codeowners piece. It has to merge first before this one.

czenko added a commit that referenced this pull request Sep 17, 2026
…ery (#304)

## Problem

`evals/docs/` belongs to the docs team in CODEOWNERS, so I went to add a
Claude Code skill there, at `evals/docs/.claude/skills/`. Eval discovery
stopped working for the whole repo.

`discoverEvals` walks `evals/<suite>/` and treats every directory it
finds as an eval, then opens that directory's `PROMPT.md`. A directory
that is not an eval has no `PROMPT.md`, so the first one throws and
nothing is discovered. Not just the docs suite. Nothing.

```
Error: ENOENT: no such file or directory, open '.../evals/docs/.claude/PROMPT.md'
    at discoverEvals (apps/framework/harness/run-eval.ts:160:9)
```

A leftover `solutions/` directory in an eval folder does the same thing,
which is a trap an author can hit without touching this file.

## Solution

- **Skip a directory with no `PROMPT.md`.** One line in `discoverEvals`,
before the read. A directory that is not an eval stops being read as
one, and the suite it sits in keeps working.

**Why this is its own PR:** `apps/` belongs to the AI team,
`evals/docs/` belongs to docs. This line is the only part of
[#259](#259) that needs an AI
review, so splitting it leaves the skill itself inside the docs team's
own scope. Merge this one first.

## Manual testing

1. Put a directory that is not an eval inside a suite.

   ```bash
   mkdir -p evals/docs/.scratch-probe
   ```

2. Discover the docs evals.

   ```bash
   pnpm eval:dry -- --suite docs --experiment-suite docs
   ```

All seven `build-docs-*` evals are planned. On `main` the same command
fails with the `ENOENT` above.

3. Typecheck and run the harness unit tests.

   ```bash
   pnpm typecheck && pnpm --filter @supabase-evals/framework test
   ```

   Clean, 8 passed.

**Not covered by a test:** `discoverEvals` is not exported and reads the
filesystem directly, so a unit test means refactoring more of this file
than the fix changes.
@czenko
czenko merged commit ad1acac into main Sep 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants