Verify Command
Run a local verification loop for the current branch before creating or updating a PR.
Use /verify for local pre-PR checks. Use /run-ci when you need .agents/bin/ci-detect or want to reproduce CI job selection locally.
Instructions
- Read
AGENTS.md first. It is the canonical source for boundaries and repository safety rules. Read .agents/bin/README.md and .agents/agent-workflow.yml for workflow commands and policy.
- Resolve
BASE_BRANCH from .agents/agent-workflow.yml key base_branch, then inspect the current branch diff
with git status --short, git diff --name-only "origin/${BASE_BRANCH}...HEAD", and
git diff --stat "origin/${BASE_BRANCH}...HEAD".
- Decide the required verification set that covers the changed surface area using the Scope Guide below. Always
include
.agents/bin/lint when present, and always include .agents/bin/validate before
creating a commit, including documentation-only changes. The repository wrapper owns its required coverage;
execute selection through its trusted-base wrapper or protected entry point under the
delivery coverage contract.
Do not infer reduced coverage from file extensions, project labels, or a candidate's changed policy.
- Run each command in order; on failure, pause the command sequence to diagnose and fix it. Record the failing command, relevant error output, and next fix to attempt.
- For formatting failures (auto-fixable formatter or lint offenses), run the repo's documented autofix command or
.agents/bin/lint mode when it supports fixes; do not manually edit formatting-only changes.
- After one or more edits for a failure, restart at the failed command and continue forward. Track a loop counter per
command:
- Increment the counter when the same command fails on the same first item (test name, lint offense, or formatter
file) as the previous run.
- Reset the counter when the first failing item changes or when you advance to a different command.
- After three consecutive cycles on the same item, stop blind retries. Perform one bounded diagnosis pass:
reproduce/minimize the failure, compare a supported hypothesis with evidence, and try a scoped correction
only if justified. If it still fails or no safe correction is supported, return the evidence and smallest next
action to the coordinator; a solo agent acts as coordinator. Do not reset the counter to repeat this pass.
- If a later fix regresses a previously passing file, symbol, or test, pause edits and isolate the cause.
Preserve unrelated work; use a supported correction or independent review rather than a blind revert.
- The coordinator resolves decisions within existing authority. Ask the user only when a required scope,
permission, product, or consequential tradeoff decision cannot be resolved from available evidence.
A failed check stays failed until it passes; diagnosis or escalation never waives a required gate.
- Do not claim a failure is fixed until the command passes locally.
- Report required commands, results, and any escalation reason. When the wrapper reports delivery
coverage, preserve its phase, candidate/base identity, selected or full coverage, omitted checks,
and selection reason. A selected pass does not qualify an omitted
promotion check. Once the required checks pass, continue
the authorized task; repeat or broaden verification only after relevant changes, failures, unresolved
concerns, or an explicit repository requirement.
For evidence passed between verification, review, and closeout, read
Verification evidence reuse. Reuse is conservative and
never overrides a required repeat, current-head CI, or independent review.
Default Verification Order
Use this order unless the changed files make a narrower or broader set clearly appropriate:
- Formatting and whitespace:
git diff --check "origin/${BASE_BRANCH}...HEAD" for committed branch content before creating or updating a PR; detects trailing whitespace and conflict markers, not source formatting
.agents/bin/lint when present, or the repo's documented formatter check
- Mandatory pre-commit gate:
.agents/bin/validate - mandatory gate before every commit/PR update, using the repository's documented coverage; promotion requires its complete invocation
- Ruby (or the repo's equivalent backend language):
- the repo's type/signature validation command when signatures or public APIs changed
- the repo's targeted unit-test command for the changed backend behavior
- JavaScript and TypeScript (or the repo's equivalent frontend/package language):
- the repo's package build command
- the repo's package lint command
- the repo's type-check command
- the repo's targeted package-test command for the changed package, or a targeted single-test-file run scoped to the
changed package
- the repo's full package-test command when broad package behavior changed or the touched files are not covered by a narrower package test
- the repo's end-to-end/browser test command when the branch changes performance- or framework-sensitive areas such
as SSR rendering, client hydration, or browser-visible integration behavior; on fresh Linux environments, install
the e2e browser dependencies first per the repo's e2e setup
- Docs:
- the repo's docs-sidebar/coverage check when docs under the repo's documented docs directories changed
- the repo's link checker when Markdown URLs were added or edited; do not substitute an ad hoc link checker unless the
branch changes the link checker, its config, or the documented link-check workflow itself
- CI workflows and YAML:
actionlint when any .github/workflows/ file changed
yamllint .github/ when any .github/workflows/ file changed
- Do not run the repo's source linter on
.yml files
- Broad suite — pick the narrowest command that covers the change:
- the repo's broad-but-fast suite command for broad coverage without the slowest generated/example suites
- the repo's full suite command when shared runtime behavior, generators, cross-package contracts, or release-critical paths changed
- the repo's complete lint gate when a branch intentionally needs the full lint pass across all source languages and
formatting; otherwise keep using the narrower lint commands above
Scope Guide
- Core library/backend changes: run the repo's targeted unit tests, the mandatory pre-commit lint gate, and type/signature validation when signatures or public APIs changed.
- Integration or test-app changes: run the repo's integration test command or a targeted integration spec scoped to the changed surface. For changes that affect performance- or framework-sensitive areas such as SSR rendering or client-side behavior, also run the repo's end-to-end/browser test command.
- Frontend/package changes: run the repo's package build, package tests, package lint, and type-check commands.
- Generated examples or scripts: run the relevant generator/script command plus formatting and linting.
- Documentation-only changes: run the repo's formatter check, the docs-sidebar/coverage check for the documented docs directories, and the link checker for new or changed URLs. If committing, still run the mandatory pre-commit lint gate; see Instructions step 3 for why this applies even to docs-only commits. The lint gate does not validate Markdown.
- Package-specific frontend changes (for example a separately-packaged area with its own scripts, per
AGENTS.md): run that package's own local formatter check via its own scripts plus any focused tests for the changed surface.
- Package-specific backend changes: run that package's own lint command (with any package-scoped flags it documents) and any targeted unit tests.
- GitHub Actions workflow changes: run
actionlint and yamllint .github/. Do not run the repo's source linter on .yml files.
- Anything not listed above (for example, build-script edits, generator templates, signature-only changes, or build scripts): apply the narrowest set of checks that covers the changed surface and explain the choice in the output.
Output Format
Use this concise summary. Include delivery coverage and omissions only when
the wrapper reports them; always include required results and any escalation:
Verification:
- Delivery coverage: <phase; candidate/base identities; selected|full>
- PASS git diff --check "origin/${BASE_BRANCH}...HEAD"
- FAIL <repo formatter check>
- Omissions: <checks or none>; reason: <trusted selection or escalation>
Next fix:
- Run the repo's format/autofix command to fix formatting, then rerun the formatter check.
If a command is intentionally skipped, explain why in one line. Prefer local verification over waiting for CI.
1---2name: verify3description: Run a local verification loop for the current branch before creating or updating a PR, selecting checks from the repo's binstub contract and changed files. Use when asked to verify, test, or prepare PR changes.4---56# Verify Command78Run a local verification loop for the current branch before creating or updating a PR.910Use `/verify` for local pre-PR checks. Use `/run-ci` when you need `.agents/bin/ci-detect` or want to reproduce CI job selection locally.1112## Instructions13141. Read `AGENTS.md` first. It is the canonical source for boundaries and repository safety rules. Read `.agents/bin/README.md` and `.agents/agent-workflow.yml` for workflow commands and policy.152. Resolve `BASE_BRANCH` from `.agents/agent-workflow.yml` key `base_branch`, then inspect the current branch diff16 with `git status --short`, `git diff --name-only "origin/${BASE_BRANCH}...HEAD"`, and17 `git diff --stat "origin/${BASE_BRANCH}...HEAD"`.183. Decide the required verification set that covers the changed surface area using the **Scope Guide** below. Always19 include `.agents/bin/lint` when present, and always include `.agents/bin/validate` before20 creating a commit, including documentation-only changes. The repository wrapper owns its required coverage;21 execute selection through its trusted-base wrapper or protected entry point under the22 [delivery coverage contract](references/verification-evidence.md#delivery-coverage).23 Do not infer reduced coverage from file extensions, project labels, or a candidate's changed policy.244. Run each command in order; on failure, pause the command sequence to diagnose and fix it. Record the failing command, relevant error output, and next fix to attempt.255. For formatting failures (auto-fixable formatter or lint offenses), run the repo's documented autofix command or `.agents/bin/lint` mode when it supports fixes; do not manually edit formatting-only changes.266. After one or more edits for a failure, restart at the failed command and continue forward. Track a loop counter per27 command:28 - Increment the counter when the same command fails on the same first item (test name, lint offense, or formatter29 file) as the previous run.30 - Reset the counter when the first failing item changes or when you advance to a different command.31 - After three consecutive cycles on the same item, stop blind retries. Perform one bounded diagnosis pass:32 reproduce/minimize the failure, compare a supported hypothesis with evidence, and try a scoped correction33 only if justified. If it still fails or no safe correction is supported, return the evidence and smallest next34 action to the coordinator; a solo agent acts as coordinator. Do not reset the counter to repeat this pass.35 - If a later fix regresses a previously passing file, symbol, or test, pause edits and isolate the cause.36 Preserve unrelated work; use a supported correction or independent review rather than a blind revert.37 - The coordinator resolves decisions within existing authority. Ask the user only when a required scope,38 permission, product, or consequential tradeoff decision cannot be resolved from available evidence.39 A failed check stays failed until it passes; diagnosis or escalation never waives a required gate.40 - Do not claim a failure is fixed until the command passes locally.417. Report required commands, results, and any escalation reason. When the wrapper reports delivery42 coverage, preserve its phase, candidate/base identity, selected or full coverage, omitted checks,43 and selection reason. A selected pass does not qualify an omitted44 promotion check. Once the required checks pass, continue45 the authorized task; repeat or broaden verification only after relevant changes, failures, unresolved46 concerns, or an explicit repository requirement.4748For evidence passed between verification, review, and closeout, read49[Verification evidence reuse](references/verification-evidence.md). Reuse is conservative and50never overrides a required repeat, current-head CI, or independent review.5152## Default Verification Order5354Use this order unless the changed files make a narrower or broader set clearly appropriate:55561. Formatting and whitespace:57 - `git diff --check "origin/${BASE_BRANCH}...HEAD"` for committed branch content before creating or updating a PR; detects trailing whitespace and conflict markers, not source formatting58 - `.agents/bin/lint` when present, or the repo's documented formatter check592. Mandatory pre-commit gate:60 - `.agents/bin/validate` - **mandatory gate before every commit/PR update**, using the repository's documented coverage; promotion requires its complete invocation613. Ruby (or the repo's equivalent backend language):62 - the repo's type/signature validation command when signatures or public APIs changed63 - the repo's targeted unit-test command for the changed backend behavior644. JavaScript and TypeScript (or the repo's equivalent frontend/package language):65 - the repo's package build command66 - the repo's package lint command67 - the repo's type-check command68 - the repo's targeted package-test command for the changed package, or a targeted single-test-file run scoped to the69 changed package70 - the repo's full package-test command when broad package behavior changed or the touched files are not covered by a narrower package test71 - the repo's end-to-end/browser test command when the branch changes performance- or framework-sensitive areas such72 as SSR rendering, client hydration, or browser-visible integration behavior; on fresh Linux environments, install73 the e2e browser dependencies first per the repo's e2e setup745. Docs:75 - the repo's docs-sidebar/coverage check when docs under the repo's documented docs directories changed76 - the repo's link checker when Markdown URLs were added or edited; do not substitute an ad hoc link checker unless the77 branch changes the link checker, its config, or the documented link-check workflow itself786. CI workflows and YAML:79 - `actionlint` when any `.github/workflows/` file changed80 - `yamllint .github/` when any `.github/workflows/` file changed81 - Do not run the repo's source linter on `.yml` files827. Broad suite — pick the narrowest command that covers the change:83 - the repo's broad-but-fast suite command for broad coverage without the slowest generated/example suites84 - the repo's full suite command when shared runtime behavior, generators, cross-package contracts, or release-critical paths changed85 - the repo's complete lint gate when a branch intentionally needs the full lint pass across all source languages and86 formatting; otherwise keep using the narrower lint commands above8788## Scope Guide8990- Core library/backend changes: run the repo's targeted unit tests, the mandatory pre-commit lint gate, and type/signature validation when signatures or public APIs changed.91- Integration or test-app changes: run the repo's integration test command or a targeted integration spec scoped to the changed surface. For changes that affect performance- or framework-sensitive areas such as SSR rendering or client-side behavior, also run the repo's end-to-end/browser test command.92- Frontend/package changes: run the repo's package build, package tests, package lint, and type-check commands.93- Generated examples or scripts: run the relevant generator/script command plus formatting and linting.94- Documentation-only changes: run the repo's formatter check, the docs-sidebar/coverage check for the documented docs directories, and the link checker for new or changed URLs. If committing, still run the mandatory pre-commit lint gate; see Instructions step 3 for why this applies even to docs-only commits. The lint gate does not validate Markdown.95- Package-specific frontend changes (for example a separately-packaged area with its own scripts, per `AGENTS.md`): run that package's own local formatter check via its own scripts plus any focused tests for the changed surface.96- Package-specific backend changes: run that package's own lint command (with any package-scoped flags it documents) and any targeted unit tests.97- GitHub Actions workflow changes: run `actionlint` and `yamllint .github/`. Do not run the repo's source linter on `.yml` files.98- Anything not listed above (for example, build-script edits, generator templates, signature-only changes, or build scripts): apply the narrowest set of checks that covers the changed surface and explain the choice in the output.99100## Output Format101102Use this concise summary. Include delivery coverage and omissions only when103the wrapper reports them; always include required results and any escalation:104105```text106Verification:107- Delivery coverage: <phase; candidate/base identities; selected|full>108- PASS git diff --check "origin/${BASE_BRANCH}...HEAD"109- FAIL <repo formatter check>110- Omissions: <checks or none>; reason: <trusted selection or escalation>111112Next fix:113- Run the repo's format/autofix command to fix formatting, then rerun the formatter check.114```115116If a command is intentionally skipped, explain why in one line. Prefer local verification over waiting for CI.