Berdl review

From kbaseincubator/BERIL-research-observatory · View interactive version

Berdl review is an AI agent skill from the GitHub repository kbaseincubator/BERIL-research-observatory. Run an independent AI review of a project or research plan. Use when you want feedback without the full /submit checklist.

How to use this skill

Skill file

Project Review Skill

Run an independent AI review of a BERDL analysis project or research plan. /berdl-review is the canonical review tool: every artifact identifies the exact subject reviewed. Project reviews preserve the report-hash footer contract that /submit consumes; plan reviews carry a plan hash. Use it to iterate on feedback during development before approving the project via /submit.

The reviewer hunts evaluation-integrity failures (selection bias, metric misuse, and — when a model or threshold is fit — train/test leakage and baseline selection) and reads the numeric cell outputs (metrics, split sizes, class balances), not just the source. For an adversarial red-team that actively tries to break each Key Finding, run /berdl-refute after the review.

Usage

/berdl-review <project_id> [--type project|plan] [--reviewer claude|codex] [--model <model_id>]

Options:

If no <project_id> argument is provided, detect from the current working directory (if inside projects/{id}/).

Workflow

Step 1: Resolve Project

  1. Accept <project_id> from the argument, or detect from cwd if inside a projects/ subdirectory
  2. Validate that projects/{project_id}/ exists in the repository root
  3. If the directory does not exist, print an error and stop

Step 2: Status precondition (project reviews only)

Read projects/{project_id}/beril.yaml (skip silently if missing — pre-manifest projects bypass this check). For --type project reviews:

> "REPORT.md has changed since this project was approved ({approval.at}). Producing a review against the new report will leave the project in a confusing state: complete with a fresh review for an unapproved report. Demote to analysis first (the previous approval will be archived under previous_approvals) before running the new review? (y/n)"

For --type plan reviews this precondition does not apply (plans are reviewed independent of the lifecycle).

Step 3: Invoke Reviewer

Run tools/review.sh — the script automatically numbers the output file and appends exactly one canonical subject footer: report_hash for project reviews and plan_hash for plan reviews. It hashes before and after the reviewer and discards output if the subject changes:

bash tools/review.sh {project_id} --type {type} --reviewer {reviewer} --model {model}

Run this command from the repository root directory.

Step 4: Verify Review Completion

After the reviewer subprocess completes:

  1. Check that the output file was created and is non-empty (more than 0 bytes).
  2. Confirm the file ends with <!-- report_hash: sha256:... --> for a project review or <!-- plan_hash: sha256:... --> for a plan review.
  3. If the script aborted because of a TOCTOU mismatch, surface that error and explain which subject changed; let it stabilize and re-run.

Step 5: Update beril.yaml status and README (project reviews only)

For --type project reviews against a project at status: analysis (or coming out of the complete-with-mismatch demote in Step 2), flip status to reviewed after the new review writes successfully:

```

## Status

Reviewed — REVIEW_N.md drafted; awaiting /submit.

```

(Replace N with the numbered review just produced.) This keeps the README's user-facing status in sync with beril.yaml.status. Without this, the demote-then-review path leaves README stuck on the analysis wording even though beril.yaml advances to reviewed.

For reviewed starting status, refresh README.md ## Status similarly (the N updates) and ensure artifacts.review: true is still set; leave beril.yaml.status unchanged. Later reviews on an already-reviewed project still get a worklog entry — iterating on reviews is work worth recording. For complete (matching hash) starting status, leave both beril.yaml and README.md unchanged — re-running /berdl-review against an approved project only adds another opinion file; the project remains complete. Plan reviews never touch beril.yaml or README.md.

Step 6: Present Summary

Read the review file and present a brief summary to the user:

Step 7: Guidance

Based on the review outcome:

If the review has no critical or important issues:

If the review has critical or important issues:

Notes

Footer invariant

Anything that produces or modifies REVIEW_N.md must preserve exactly one final <!-- report_hash: sha256:[0-9a-f]{64} -->; /submit rejects any deviation. PLAN_REVIEW_N.md similarly preserves exactly one final <!-- plan_hash: sha256:[0-9a-f]{64} -->.

Pitfall Detection

When you encounter errors, unexpected results, retry cycles, performance issues, or data surprises during this task, follow the pitfall-capture protocol. Read .claude/skills/pitfall-capture/SKILL.md and follow its instructions to determine whether the issue should be added to the active project's projects/<id>/memories/pitfalls.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.