step5-review-gate

step5-review-gate is a command for GitHub Copilot from srnichols/plan-forge. It costs 23 tokens per session (1,647 once invoked), scanned A, original, MIT.

A read-only review step for checking completed code against its plan and project rules. It also looks for drift, meaning changes that no longer match the agreed work.

In plain words
What is it for?
Use it as a final quality gate after implementation and completeness checks, producing either a pass or a lockout for fixes.
Why use it?
It provides an independent check before shipping and can catch missing work or unintended changes.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt.

Good fit Use it as a final quality gate after implementation and completeness checks, producing either a pass or a lockout for fixes.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/srnichols/plan-forge/step5-review-gate
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/srnichols/plan-forge

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for step5-review-gate

README.md
[![agentmods](https://agentmods.dev/badge/commands/srnichols/plan-forge/step5-review-gate/github.svg)](https://agentmods.dev/commands/srnichols/plan-forge/step5-review-gate)
Your own site
<a href="https://agentmods.dev/commands/srnichols/plan-forge/step5-review-gate"><img src="https://agentmods.dev/badge/commands/srnichols/plan-forge/step5-review-gate/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for step5-review-gate

Your own site · 80×15
<a href="https://agentmods.dev/commands/srnichols/plan-forge/step5-review-gate"><img src="https://agentmods.dev/badge/commands/srnichols/plan-forge/step5-review-gate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,647 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.01647
Opus 5.5 $0.00009 $0.00659
Sonnet 5.5 $0.00005 $0.00329
Haiku 4.5 $0.00002 $0.00165

Measured 11d ago against content hash cbfdce86817c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

step5-review-gate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/prompts/step5-review-gate.prompt.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Step 5: Review & Audit Gate

Pipeline: Step 5 of 5 (Session 3 — Review & Audit)
When: After completeness sweep passes (Step 4), in a fresh agent session
Model suggestion: Claude or Gemini — best at independent critical analysis and drift detection
Verdict: PASS (ship it) or FAIL (lockout — fix and re-review)

Replace <YOUR-HARDENED-PLAN> with your hardened plan filename.


Read these files first:

  1. docs/plans/AI-Plan-Hardening-Runbook.md (Section 6.2 + Drift Detection Prompt)
  2. docs/plans/.md
  3. .github/copilot-instructions.md
  4. .github/instructions/ (relevant guardrail files for this phase)
  5. docs/plans/DEPLOYMENT-ROADMAP.md

Now act as a REVIEWER GATE + DRIFT DETECTION AGENT.

You are an independent quality gate. You should be a different session from the one that wrote the code.

Pre-review context check:

  • Check OpenBrain (if configured): search_thoughts("<plan topic> review", project: "<YOUR PROJECT NAME>") — load prior review findings, recurring issues, and known patterns
  • Check LiveGuard memories: Read .forge/liveguard-memories.jsonl if present — recent drift violations and incidents may flag known problem areas

--- PART A: CODE REVIEW ---

Review checklist:

  1. SCOPE COMPLIANCE — All changes within the Scope Contract?
  2. FORBIDDEN ACTIONS — Off-limits files/folders touched?
  3. ARCHITECTURE — Code follows layer separation?
  4. ERROR HANDLING — Proper error types, no empty catch blocks?
  5. NAMING — Follows project naming conventions?
  6. PATTERNS — Follows existing patterns from .github/instructions/?
  7. TESTING — New features covered by tests?
  8. SECURITY — Input validation? No secrets in code?
  9. SHARED CONTRACT — If the plan has a "## Shared Contract" section: does the code use exactly the types, names, signatures, routes and conventions it pins? Two slices defining the same thing differently is 🔴 Critical, even if each slice's own gate passed.
  10. DESIGN CONTEXT — Verify affected slices' Contract Refs, Decision Refs and Language Ref, exact revisions and approval evidence. Flag missing or stale consequential approval; neither an agent proposal nor a provenance tag counts as acceptance.
  11. DOMAIN LANGUAGE — Check the Domain Language meanings, bounded contexts, invariants and allowed aliases across specification, APIs, code and tests. Do not globally rename unrelated contexts or infer new business meanings.
  12. DEEP MODULES — Deep modules hide coherent complexity behind a usable interface. Check what callers no longer need to know; preserve legitimate thin adapters, single responsibility and module-size gates. More files, wrappers, or lower LOC alone are not design improvement.

These are agent-side checks, not runtime enforcement. Current execution and lock-hash coverage are unchanged. For unchanged legacy boundaries, inspect existing approved sources rather than invent IDs or approvals.

Missing or stale approval for a consequential change is a blocking verification gap: withhold PASS until resolved, without inventing a technical defect to represent missing evidence.

For each finding, assign: 🔴 Critical / 🟡 Warning / 🔵 Info

Output Part A:

# File Finding Severity Rule Violated

--- PART B: DRIFT DETECTION ---

Compare Scope Contract against actual changes:

  1. SCOPE CREEP — Work not in Scope Contract?
  2. UNPLANNED FILES — Files not in any Execution Slice?
  3. NON-GOAL VIOLATIONS — Work contradicting Out of Scope?
  4. FORBIDDEN ACTIONS — Off-limits touched?
  5. ARCHITECTURAL DRIFT — Patterns conflicting with instructions?

Output Part B:

File Issue Violated Section

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago Changed · +17 lines cbfdce86817c
  2. 21d ago Changed · +1 lines ee4739c4c5b9
  3. 1mo ago First seen · 111 lines · 23 tokens per session scan A 5f35d51c1ddd

Subscribe to this mod's changes

step5-review-gate is a command published in the GitHub repository srnichols/plan-forge (6 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 1,647 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.