Skip to content

feat(writing-plans): add Evaluator section + self-review check - #1627

Open
suresh2824 wants to merge 1 commit into
obra:devfrom
suresh2824:feat-writing-plans-evaluator-section
Open

suresh2824 wants to merge 1 commit into
obra:devfrom
suresh2824:feat-writing-plans-evaluator-section

Conversation

@suresh2824

@suresh2824 suresh2824 commented May 24, 2026 •

Copy link
Copy Markdown

Who is submitting this PR? (required)

Field Value
Your model + version Claude Opus 4.8 (1M context), claude-opus-4-8
Harness + version Claude Code (CLI)
All plugins installed superpowers; plan-evaluator-gate (a downstream companion that enforces this same gate while this PR is pending)
Human partner who reviewed this diff Suresh (@suresh2824) — directed the work and reviewed the diff + eval

What problem are you trying to solve?

writing-plans produces plans with task-level verification (Step: Run test to verify it fails/passes), a pre-implementation plan-document-reviewer (checks the plan is well-written), and a subjective ## Self-Review. What it does not produce is a single deterministic, plan-level completion gate — one runnable check that answers "is the whole plan actually done?" Today that question is answered only by fresh-eyes review.

Concrete failure (a real writing-plans-driven session): a plan was moved to completed/ and its PR declared the ticket "done", but a staging slip meant the change never reached main — the PR merged with only a doc rename. Every per-task test was green; "done" rode on merge-state + the subjective review, and the miss survived until a manual re-verify (costing a follow-up PR). A goal-level Evaluator gate would have failed and caught it immediately.

What does this PR change?

Adds an ## Evaluator section to the plan template requiring exactly one deterministic, goal-level completion check (a test/curl/query/verify-* run) that gates the plan's completion. It does not touch the existing per-task tests or Self-Review.

Is this change appropriate for the core library?

Yes — it's general-purpose: any plan in any project benefits from a deterministic "definition of done." The PR keeps the ## Evaluator section as the core ask; the partial/→completed/ lifecycle phrasing is advisory wording, not a directory convention imported into core.

What alternatives did you consider?

  • Rely on the existing per-task tests — they prove each step works in isolation; they do not prove the aggregate goal was achieved or that the change reached the merged surface (see the incident).
  • Rely on plan-document-reviewer — it runs before implementation and checks the plan is well-written, not that the result is done.
  • Rely on Self-Review — subjective, not deterministic; the failure above passed it.

Does this PR contain multiple unrelated changes?

No — a single new section in one file (skills/writing-plans/SKILL.md).

Existing PRs

None that add a plan-level completion gate. This does not duplicate an open PR.

Environment tested

Harness Harness version Model Model version/ID
Claude Code current Claude Opus claude-opus-4-8 (1M)

Eval generations were produced with claude --safe-mode (CLAUDE.md/plugins/hooks/skills disabled) so only the bare skill drove behavior.

Evaluation

RED/GREEN behavioral eval posted as a PR comment — summary: RED 0/3 plans contain a plan-level gate; GREEN 3/3 do, all deterministic and goal-level, with no bloat (every GREEN plan ≤ +1% / shorter than RED). 3 diverse prompts (auth / streamed-CSV / irreversible tz-migration), one being this repo's own tests/skill-triggering/prompts/writing-plans.txt. Falsifiable: RED>0 would withdraw the PR; it scored 0/3.

Rigor

Clean-room method (see the comment's caveat): a first run inside a configured repo gave a false RED 3/3 because a downstream CLAUDE.md already mandated the gate — so the eval was re-run under --safe-mode with only the bare SKILL.md. Recommend running it that way in CI.

Human review

Reviewed by Suresh (@suresh2824), who directed the work, reviewed the diff, and reviewed the eval results before submission.

Adds a top-level `## Evaluator` section to the writing-plans skill so every
plan declares the deterministic check that gates moving the plan from
in-progress to complete. Without one, "done" defaults to vibes — a maintainer
reads the implementation, decides it looks right, and moves the plan to
completed. Weeks later a regression surfaces with no record of what
"passing" was supposed to mean.

This is the Planner → Generator → Evaluator topology that the rest of the
superpowers skillset already assumes: the writing-plans Planner produces the
spec, executing-plans / subagent-driven-development Generators execute the
tasks, and the Evaluator returns pass/fail before lifecycle transition.

The new section enumerates acceptable Evaluator forms — test command, HTTP
assertion, database query, skill invocation, or rubric pass-list — so plans
in any tech stack (pytest, playwright, cargo, go test, curl, DB queries,
project-local verify-* skills) can declare a fit-for-purpose check.

Placement: between the existing "Remember" and "Self-Review" sections.
Self-Review gets a new item obra#4 to verify the Evaluator section is present
before the plan is considered complete.

Inspired by the Planner → Generator → Evaluator pattern from Anthropic's
agentic-AI design guidance. Source content originally lived per-project
(mw-vastra/CLAUDE.md + docs/superpowers/plans/README.md); this PR promotes
it upstream so every Claude Code user benefits without per-project overlay.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@YOMXXX

YOMXXX commented May 24, 2026

Copy link
Copy Markdown

Review/triage note:

This is a behavior-shaping change to skills/writing-plans/SKILL.md, not just documentation. Based on recent maintainer feedback on similar skill-content PRs, I think this needs more evidence before line-by-line review is useful.

Specific gaps I would expect reviewers to ask about:

  • The PR targets main; current contribution flow appears to expect dev.
  • The PR body does not use the current PR template sections.
  • The problem statement is general and project-derived. It does not include a concrete Superpowers session where a generated plan lacked a completion evaluator and that caused a real bad outcome.
  • There is no RED/GREEN behavioral eval showing current writing-plans omits this gate on representative prompts, and that the new wording reliably adds useful evaluator sections without bloating plans or conflicting with the existing per-task verification steps.
  • The new section adds a mandatory lifecycle rule (may NOT move a plan to completed) but this repo's active workflow docs do not currently define that partial/ -> completed/ lifecycle as a core Superpowers behavior, so this may be importing a project-local convention into core.

The idea may be worth discussing, but I would treat it as a design/eval proposal first, not a ready-to-merge skill prose change.

suresh2824 added a commit to suresh2824/plan-evaluator-gate that referenced this pull request May 24, 2026
Ships the plan-evaluator-gate companion plugin for the
superpowers:writing-plans skill. Three components:

1. skills/plan-evaluator-gate/SKILL.md — invoked when Claude is about to
   mark a plan complete. Greps the plan for a top-level `## Evaluator`
   section with at least one fenced code block; returns BLOCK if absent,
   PASS otherwise. Mirrors the acceptable-forms list from upstream PR
   obra/superpowers#1627.

2. hooks/pretooluse-block-partial-move.sh — opt-in PreToolUse hook for
   teams that want enforcement at the `git mv .../partial/ .../completed/`
   boundary (independent of Claude's discipline). Exit 2 + advisory
   stderr on block. Bypass via PLAN_EVALUATOR_GATE_BYPASS=1.

3. tests/test_pretooluse_block_partial_move.sh — 5 smoke subtests
   covering PASS / no-Evaluator BLOCK / empty-Evaluator BLOCK /
   non-matching-command pass-through / bypass-env honored. All green.

Relationship to obra/superpowers: companion, not replacement. Upstream
PR #1627 proposes folding the Evaluator section directly into the
writing-plans SKILL.md. If/when that lands, this plugin becomes
redundant — users uninstall and rely on the upstream pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@obra obra added enhancement New feature or request plans Retired: use skill:writing-plans / skill:executing-plans needs-rebase-to-dev-branch PR targets main but should target dev pr-template-rules-ignored PR filed after template was added but didn't use it labels May 29, 2026
@suresh2824

Copy link
Copy Markdown
Author

RED/GREEN behavioral eval — results

Thanks for the triage note (@YOMXXX). Here's the evidence requested (gaps #3 + #4), plus a method caveat worth flagging.

Method (clean-room)

Each prompt was run through only the bare writing-plans/SKILL.md under claude --safe-mode (CLAUDE.md, plugins, hooks, skills, MCPs all disabled), so the result measures the skill, not the harness. RED = this PR's base; GREEN = this PR's head. 3 diverse prompts: P1 = the repo's own tests/skill-triggering/prompts/writing-plans.txt auth spec (verbatim); P2 = a server-streamed, rate-limited CSV export (UI+backend); P3 = an irreversible naive→tz-aware column migration.

Caveat (and why a first run was thrown out): running this through subagents inside a configured repo gave a false RED 3/3 — the agents inherited a downstream CLAUDE.md that already mandates an Evaluator (its RED plans even cited project-specific phrasing absent from the skill). The eval must run in a vanilla --safe-mode env, or you measure your config, not the skill. Recommend running it that way in CI.

Result

Prompt RED ## Evaluator? GREEN ## Evaluator? GREEN deterministic? bloat (GREEN vs RED lines)
P1 auth none (ends at ## Self-Review) yes npx prisma migrate deploy && npm test 870 vs 1253 (−31%)
P2 csv-stream none yes pytest tests/test_orders_export_csv.py -q 687 vs 682 (+0.7%)
P3 tz-migration none yes pytest …test_last_login_serializes_with_utc_offset …reads_back_aware_in_utc -v 405 vs 482 (−16%)
Totals 0/3 3/3 all runnable, exit-0 / goal-level all ≤ +12% (no bloat)
  • RED 0/3: today's writing-plans has per-task TDD steps + a pre-impl plan-document-reviewer + a subjective ## Self-Review, but no single deterministic plan-level "is the whole thing done?" gate. Completion rests on the fresh-eyes review.
  • GREEN 3/3: each plan gains one ## Evaluator that is runnable (G2), asserts the aggregate goal rather than repeating a task step (G3 — addresses your "redundant with per-task verification?" concern), and adds no bloat — every GREEN plan was shorter or within +1% of RED (G4). RED's Self-Review + per-task tests are retained in GREEN (G5 — no regression).
  • Falsifiable by design: if RED had scored >0/3, the PR would be unjustified. It scored 0/3.

Concrete incident (gap #3)

A real writing-plans-driven session (plans under docs/superpowers/plans/): a plan was moved to completed/ and its PR declared the ticket "done" — but a git add slip meant the actual change never reached main; the PR merged with only a doc rename. "Done" rode on merge-state + the subjective review; the miss survived until a manual re-verify, costing a follow-up PR. Per-task tests were all green — only a goal-level Evaluator gate (e.g. "done ⟺ git show origin/main:<file> contains the change and the prod metric passes") would have caught it. That is exactly the gap this PR closes.

Housekeeping for the other gaps

Happy to also (#1) retarget this PR main → dev and (#2) refill the body with the current PR template, and (#5) soften the wording so the ## Evaluator section is the core ask while the partial/→completed/ lifecycle phrasing stays advisory (not importing a directory convention into core). Let me know if you'd like that before a line-by-line review.

@suresh2824
suresh2824 changed the base branch from main to dev June 16, 2026 16:03
@obra
obra force-pushed the dev branch 3 times, most recently from 210b867 to b62616f Compare June 17, 2026 05:46
@obra obra added the skill:writing-plans The writing-plans skill label Sep 20, 2026
@obra obra removed plans Retired: use skill:writing-plans / skill:executing-plans needs-rebase-to-dev-branch PR targets main but should target dev labels Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pr-template-rules-ignored PR filed after template was added but didn't use it skill:writing-plans The writing-plans skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants