SeniorGate + SeniorBench
SeniorGate is an open-source skill pack that asks a coding agent to work like a senior engineer: scope every call site, write a regression test and watch it fail on the old code, fix the root cause, and end with Risks and Rollback. SeniorBench is the pre-registered benchmark that tested it (PREREG.md). Version 0.3.1 is the primary pre-registered result (a 0.4 update follows the headline). Everything below is from the held-out test split (63 tasks, 3 runs each, 5 conditions); the full report is RESULTS.md.
Headline
- On Claude Sonnet 5.5, SeniorGate scores +7.9 pp over no skill on the senior rate (95% CI [+4.8, +11.2], Wilcoxon p = 1.3 × 10⁻⁵). Most of that is one behaviour: the share of runs that wrote the regression test the ticket implies went from 50% to 97%.
- It beats the best-known competing role-skill pack (alirezarezvani/claude-skills, about 30k★ when researched, pinned as condition B): +8.4 pp [+5.4, +11.8] on Sonnet. The competing skills were invoked in only 5 of 189 runs, and that condition scores like no skill.
- A one-line persona gets about three quarters of the gain. One sentence ("You are a senior backend engineer. Apply senior-level judgement, care and rigour to this task."; condition D) scores +5.8 pp over no skill and also writes the regression test 97% of the time. SeniorGate's edge over it is +2.1 pp [+0.7, +3.7], and it comes mostly from code review: on the 12 real-PR reviews it is +6.5 pp, where the persona does worse than no skill.
- The gates show no measurable gain on Sonnet. SeniorGate without its gates scores the same (C − E = +0.3 pp [−0.3, +1.1], p = 0.60). The gates' only trace is a small, not significant functional-rate edge (+1.3 pp, p = 0.066), and they nearly double median wall-clock.
- On Haiku 5.5 (the pre-registered primary model) the gain is small. C − A = +3.1 pp [+0.2, +6.4]: marginal, not robust to the Deviation 10 check (that analysis gives [−0.2, +5.8]; Wilcoxon p = 0.072). Against the persona, not significant (p = 0.48). No functional gain.
Costs and caveats. A SeniorGate run costs about 1.7–1.9× a no-skill run (mean) and takes about twice the turns. The skill author had seen the test criterion names, so treat the gains as an upper bound. Condition A already scores 0.85 (Haiku) and 0.83 (Sonnet), so there is little headroom. See Limitations.
Update: SeniorGate 0.4 (a smaller, later test; 0.3.1 above stays the primary result)
0.4 makes code review the core of the skill and turns the gates opt-in. It was tested only on 27 fresh real-PR review tasks (frozen and timestamped before tuning, repos the benchmark had never used), so it is a small test and its numbers are less certain than the 63-task results above. Full report: RESULTS.md.
- Sonnet 5.5 (5 runs per task): 0.4 scores +12.8 pp over the one-line persona [+7.7, +18.0] and +4.2 pp over 0.3.1 [+0.7, +7.7] on the senior rate; +9.1 pp over no skill [+2.7, +15.8]. Goals "0.4 above the persona" and "0.4 at least 0.3.1" were met.
- The wall-clock goal was not met: median 34.9 s for 0.4 against 33.9 s for 0.3.1.
- How it gains: it does not find the human reviewer's defect more often than no skill does (0.67 against 0.69). The gain is a cleaner review with far fewer extra findings (low_noise 1.00 against 0.70).
- Haiku 5.5 (3 runs): no comparison is shown at the usual level (0.4 minus 0.3.1 is −2.1 pp [−5.8, +1.6]). That is "not shown", not "no effect".
- With 27 tasks, claims are overall only; per-role numbers are descriptive.
What's in the pack
| Skill | Loads when | What it asks for |
|---|---|---|
| seniorgate-core | any change to code, tests, SQL, pipelines, config or infrastructure, and any review | Scope every call site. Write a regression test and watch it fail on the old code. Fix the root cause everywhere. Keep interfaces compatible. Use safe migrations. Run the gate. End with Risks and Rollback lines |
| seniorgate-backend | server code, APIs, database queries, migrations, auth | Query scaling and indexes, bound SQL parameters, idempotent writes enforced by the database, timeouts and bounded retries, password hashing, error handling, API compatibility, expand/contract migrations |
| seniorgate-data-engineer | ETL/ELT, SQL models, loads, backfills, exports | Idempotent reruns, atomic writes, resumable backfills, dedupe and latest-version rules, late-arriving data, join grain, reconciliation, schema drift, publish gates |
| seniorgate-devops | Dockerfiles, Kubernetes, Terraform, CI/CD, alerting | Pinned non-root images, zero-downtime rollouts and probes, private storage, least-privilege IAM, CI supply chain, secret rotation, symptom-based alerts with for: and runbooks |
Role modules load only when the task needs them (progressive disclosure). Only the skill names and descriptions sit in the agent's context until then.
Gates (seniorgate-core/checks/sg_check.py, Python standard library only) check what a script can decide:
- a code change comes with a test, and that test fails on the old code and passes on the new code;
- the suite passes, and no existing test file was deleted;
- applied migrations aren't edited, and destructive migrations are flagged;
- Prometheus alerts have for: and a runbook;
- Dockerfile, Kubernetes, CI workflow and Terraform rules hold;
- there are no hardcoded secrets;
- Python code doesn't build SQL from strings or turn off TLS verification;
- the final message has Risks and Rollback lines.
In Claude Code, hooks run the gates automatically: a snapshot at session start, a backup before each file's first edit, and a check at Stop that sends the agent back at most twice. Other agents run the same script at step 4 of the procedure.
Install
Clone this repository first. You need Python 3.12 or later for the gates (standard library only; nothing else to install).
Claude Code (skills + hooks that run the gates automatically):
claude --plugin-dir dist/claude-plugin
Codex (AGENTS.md): copy adapters/AGENTS.md and the folder adapters/.agents/skills/ into the root of your repository, keeping the names AGENTS.md and .agents/skills/. If you already have an AGENTS.md, append the contents instead of overwriting it.
Gemini CLI / Antigravity (GEMINI.md): copy adapters/GEMINI.md and adapters/.agents/skills/ into the root of your repository, keeping the names GEMINI.md and .agents/skills/. Merge with an existing GEMINI.md if you have one.
Cursor, Copilot and other Agent Skills clients: copy adapters/.agents/skills/.
The Codex and Gemini/Antigravity adapters are not benchmarked, and not yet tested end to end with those agents. All results in this repository are from Claude Code with Claude models. Outside Claude Code the hooks don't run; the agent is told to run the gate script itself at step 4 of the procedure.
Everything in dist/, adapters/ and conditions/ is generated from seniorgate/ by python tools/build_conditions.py. Don't edit those copies by hand.
Benchmark status
| Item | State |
|---|---|
| Pre-registration | PREREG.md , with 11 deviations (each logged with its date, and whether it was decided before or after seeing data) |
| Test split | 63 tasks, frozen ( bench/SPLITS.lock.json , sha256 925e4aff… ). Not opened, run or tuned on before Phase 3 |
| Dev split | 30 tasks. All skill tuning happened here (3 iterations, logged in BUILD_LOG.md ). Dev numbers are tuning data, not results |
| Version under test | SeniorGate 0.3.1 (git tag seniorgate-v0.3.1 ; results release tag seniorgate-v0.3.1-results ) |
| Conditions | A no skill · B best competitor (pinned) · C SeniorGate · D persona only · E SeniorGate without gates ( conditions/ ) |
| Confirmatory results | Haiku 5.5 (primary): done, RESULTS.md . Sonnet 5.5 (secondary): all five conditions done (945 runs), RESULTS.md |
Results: Haiku 5.5 (primary model; test split, 3 runs × 63 tasks × 5 conditions)
| C (SeniorGate) minus… | Senior rate Δ | 95% CI | Wilcoxon p | Registered goal |
|---|---|---|---|---|
| A, no skill | +3.1 pp | [+0.2, +6.4] | 0.072 | G1 (CI lower bound > 0): marginal, not robust to the Deviation 10 check (CI [−0.2, +5.8] with the 17 flagged runs excluded) |
| B, best competitor | +3.3 pp | [+0.7, +6.3] | 0.014 | G2 (≥ 0): met, and significant |
| D, persona only | +1.4 pp | [−1.0, +4.5] | 0.478 | G3 (> 0): not significant (p = 0.48) . CI includes 0, tasks won/lost 10/10 |
| E, SeniorGate without gates | +2.3 pp | [−0.2, +5.3] | 0.161 | exploratory |
- Senior rates: A 0.849, B 0.846, C 0.880, D 0.866, E 0.856.
- Functional rate (secondary): C 0.960 against A 0.962. C's three zero-scored timeouts are included; without that task the difference is +0.9 pp [−0.1, +2.4].
- Fixtures: C equals the one-sentence persona D (0.922 each). C's edge over D comes only from the 12 real-PR reviews.
- Cost: C costs 1.67× A per run on the mean and 1.78× on the median, with 2× the turns. That is over PLAN's 1.5× line.
- Timeouts: on one large repository (de-m04, sqlfluff), C hit the 40-minute limit in every attempt and is scored 0 there (Deviation 9).
- Dev vs test: on the dev split (tuning data, where the skills were iterated) C − A was +9.1 pp. On held-out test tasks it is +3.1 pp.
Results: Sonnet 5.5 (secondary model; all five conditions; does not gate the registered goals)
- C − A is +7.9 pp, 95% CI [+4.8, +11.2], Wilcoxon p = 1.3 × 10⁻⁵, d_z = 0.60 (A 0.827, C 0.906). With the Deviation 10 runs excluded it is +7.5 pp [+4.5, +10.8].
- It comes mostly from regression tests. Without the skill, Sonnet wrote the regression test in 50% of the runs that called for one; with SeniorGate, 97%. Haiku's A already wrote one in 91%, which is why its gain is smaller.
- Functional rate: +1.3 pp [−0.5, +4.0], both near ceiling.
- Cost: C/A 1.77× mean, 1.87× median.
- C − D (persona only): +2.1 pp [+0.7, +3.7], p = 0.008. The one-sentence persona D scores 0.885 and writes the regression test as often as C (97%), so it gets about three quarters of C's gain over A. C's remaining edge is mostly on the 12 PR reviews (+6.5 pp), where the persona does worse than no skill.
- The one-sentence persona D scores 0.885 and writes the regression test as often as C (97%), so it gets about three quarters of C's gain over A.
- C's remaining edge is mostly on the 12 PR reviews (+6.5 pp), where the persona does worse than no skill.
- C − B (best competitor skill): +8.4 pp [+5.4, +11.8]. The competitor skills were invoked in only 5 of 189 runs, and B scores like A (0.822). One B row whose grading was cut off by a machine standby was re-run under Deviation 11; with the original 0 row it was +8.9.
- C − E (SeniorGate without gates; exploratory): +0.3 pp [−0.3, +1.1], p = 0.60. E scores 0.903, writes the regression test in 97% of runs, and matches C on the PR reviews. The gates show only in the functional rate (+1.3 pp [+0.3, +2.9], p = 0.066). C/E cost is 1.08× mean, but C's median wall-clock is 69 s against E's 40 s.
Limitations
- The skill author saw the test criterion names. PREREG lists the names of every test task's criteria (Deviation 7), and the author of the SeniorGate skills read PREREG before writing them. No test task, grader or trace was opened. Mitigation: every checklist item and gate rule must trace to a dev task, a standard cited in RESEARCH §2, or the Phase 2 brief (PREREG Deviation 8a). Residual risk: that knowledge may still have shaped what was written. Treat a C-over-A gain with that in mind.
- Mitigation: every checklist item and gate rule must trace to a dev task, a standard cited in RESEARCH §2, or the Phase 2 brief (PREREG Deviation 8a).
- Residual risk: that knowledge may still have shaped what was written. Treat a C-over-A gain with that in mind.
- Agents run on the same machine as the benchmark. File-tool deny rules, a per-run private temp folder and a post-run audit of every tool call guard against reading the graders or other runs. An audited breach invalidates the run (re-run once, then excluded), and invalid counts are reported per condition (Deviation 8a). This is a guard, not an OS-level sandbox.
- Little headroom. Condition A already scores 0.849 on the test split, and 40 of 63 tasks tie between A and C.
- The G1 verdict depends on one task. be-t05 (path traversal) is a task where C scores 1.00 and A 0.67. The trace audit as first written flagged all of its runs; the flags were attack strings, not file access. The audit boundary was then moved, after seeing those flags, to match the in-run guard (Deviation 10). With those 17 runs excluded, the G1 criterion fails; that is why it is called marginal.
- Few real-world tasks. Only 15 of the 63 are real repositories (3 mined PRs, 12 PR reviews). On those, C − A is +1.4 and +1.9 pp, with wide CIs.
- Slow on large repositories. On the largest repository, C never finished within the time limit (above). E, which has no gates, was also slow there. A gate fix is for a later version, with its own dev check.
- One harness. All results are from Claude Code with Claude models. The Codex and Gemini adapters are not benchmarked.
- The Sonnet results are secondary. The pre-registered goals (G1–G3) and the ship rule apply to Haiku only. The Sonnet comparisons were registered as secondary analyses and are reported in full, but they do not gate anything.
- The Sonnet gain is mostly one behaviour. The regression-test criterion accounts for most of C's gain over A. On the 12 real-PR reviews, C adds almost nothing over no skill on Sonnet (+0.9 pp).
- Dev to test shrinkage on Haiku. C − A was +9.1 pp on the dev split, where the skills were tuned, and +3.1 pp on held-out tasks.
- Cost. Runs cost about 1.7–1.9× more than with no skill, above the 1.5× line the plan set. The cost case is weak on Haiku.
- Post-hoc decision. The trace-audit boundary was moved after its flags were seen (Deviation 10), and one Sonnet B row was re-run after the first C − B figure was computed (Deviation 11). Both are disclosed with their sensitivity analyses.
The full pre-registration is PREREG.md, including all 11 deviations; the full disclosures are in RESULTS.md.
- Adapters for Codex and Gemini/Antigravity aren't tested end to end yet.
Run the harness
You need Python 3.12 (standard library only) and the Claude Code CLI. Run everything from bench/:
python -m seniorbench.controls --split dev
python -m seniorbench.runner --split dev --condition C --model haiku --runs 3 --results results/C_dev.jsonl
python -m seniorbench.report results/C_dev.jsonl
How the runner behaves:
- It can be resumed. Re-running skips finished runs, and --shard i/N splits the work across parallel workers.
- On a plan usage limit it stops (exit 3) and records nothing for that call.
- The test split is refused unless the split lock verifies and you pass --confirm-test-run.
| File | What it is |
|---|---|
| RESEARCH.md | Competitors, career ladders, evidence, portability |
| PLAN.md | Architecture, roles in waves, quality gates, schedule |
| PREREG.md | Conditions A–E, grader, analysis, deviations |
| BUILD_LOG.md | What was built, in what order, and what went wrong |
Licence
SeniorGate's own content (the skills in seniorgate/, the benchmark harness and tools, and the documents) is released under the MIT licence.
Third-party material keeps its own licence and attribution. It is listed in THIRD_PARTY_NOTICES.md:
- condition B's files in conditions/B/ are from alirezarezvani/claude-skills (MIT, conditions/B/LICENSE), byte-identical apart from an added plugin.json;
- the benchmark tasks built from real pull requests (BSD-3-Clause, MIT and Apache-2.0 upstreams) carry a NOTICE.md or source record naming the upstream repository, pull request, commit and licence.