Skilllibrary verification-before-advance
install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/05-agentic-orchestration-and-autonomy/verification-before-advance" ~/.claude/skills/merceralex397-collab-skilllibrary-verification-before-advance && rm -rf "$T"
manifest:
05-agentic-orchestration-and-autonomy/verification-before-advance/SKILL.mdsource content
Purpose
Enforces explicit gate checks between workflow stages so that no agent advances to the next step until concrete evidence proves the current step is complete — replacing optimistic "looks good" status with verified pass/fail criteria.
When to use
- A multi-step workflow exists where later steps depend on earlier outputs.
- The user requests quality gates, checkpoints, or "don't proceed until…" conditions.
- Prior runs have failed because an agent skipped verification and built on incomplete work.
- A CI-like approve/reject flow is needed inside an agent workflow.
Do NOT use when
- The task is a single atomic action with no downstream stages.
- The user explicitly opts out of verification ("just do it, skip checks").
- Verification would require external human approval that cannot be
simulated (use
for human-in-the-loop instead).approval-gates - The workflow is purely exploratory with no concrete deliverable.
Operating procedure
- List all workflow stages. Run through the current plan, ticket, or
task description and extract each distinct stage. Number them sequentially
in a markdown list:
,Stage 1: …
, etc.Stage 2: … - Define gate criteria per stage. For each stage, write 1–4 verifiable
criteria. Each criterion must be a concrete check, not a subjective
judgment. Examples:
- "All unit tests in
pass (src/auth/
)."npm test -- --grep auth - "File
contains an entry for every route indocs/API.md
."src/routes/ - "No
orTODO
comments remain in changed files."FIXME
- "All unit tests in
- Assign evidence type to each criterion. Tag every criterion with one
of:
(run a command, check exit code or output),command_output
(grep/view a file for expected content),file_content
(glob for a required file),artifact_exists
(numeric value ≥ or ≤ N).metric_threshold - Execute the current stage's work. Perform the actual task for the stage — write code, generate docs, run migrations, etc.
- Run the gate check. For each criterion of the completed stage: (a) Execute the check (run the command, grep the file, glob for the artifact). (b) Record the result: PASS with evidence snippet, or FAIL with the actual vs. expected output.
- Evaluate the gate. Apply the pass/fail threshold (default: ALL
criteria must PASS). If the gate passes, record a
line and proceed to the next stage. If it fails, go to step 7.✅ Gate N passed - Handle gate failure. List every FAIL criterion with its evidence. Attempt a fix for each (re-run the command after correction, edit the file, regenerate the artifact). Re-run the gate check (step 5). If the gate still fails after 2 retry cycles, halt the workflow and report the blockers to the user.
- Log the gate trace. Append a
section to the output with: stage name, criteria, evidence, pass/fail, retry count.## Gate Log
Decision rules
- Never advance past a failed gate — no exceptions without explicit user override.
- If a criterion is ambiguous (cannot be checked mechanically), replace it with a concrete alternative or remove it and note the gap.
- If the stage itself produced no observable output (e.g., a "think about architecture" step), require at least one written artifact as evidence (a decision record, a diagram description, a pros/cons list).
- Treat flaky checks (pass on retry without code change) as a WARN — advance but record the flakiness in the gate log.
- Default threshold is ALL-pass. The user may lower it to N-of-M; record the custom threshold in the gate definition.
Output requirements
- Gate Definition Table — markdown table:
.| Stage | Criterion | Evidence Type | Threshold | - Gate Results — per stage:
.| Criterion | Result | Evidence Snippet | - Gate Log — append-only log of all gate evaluations, retries, and overrides across the entire workflow run.
References
— checkpoint file format for gate state.references/checkpoint-rules.md
— escalation paths when gates fail.references/failure-escalation.md
Related skills
— persisting gate state across sessions.workflow-state-memory
— gathering evidence to satisfy gate criteria.subagent-research-patterns
— running gate checks across parallel agent outputs.swarm-patterns
— human-in-the-loop approval (complementary to this).approval-gates
Failure handling
- Gate criterion is untestable: Replace it with the closest testable proxy, or remove it and add an explicit "unverified assumption" note.
- Retry budget exhausted: Stop the workflow, emit all FAIL evidence, and ask the user for guidance — never silently skip.
- Stage produces no output: Treat missing output as automatic gate failure; do not invent evidence.
- User requests override: Record the override in the gate log with
timestamp and reason, then advance with a
tag.⚠️ OVERRIDDEN