Verification gate

From BbgnsurfTech/claude-skills-collection · View interactive version

Verification gate is an AI agent skill from the GitHub repository BbgnsurfTech/claude-skills-collection. Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit, MultiEdit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or actio

How to use this skill

Skill file

Verification Gate

Overview

This skill implements mandatory verification checkpoints that prevent pattern-matching from training data from overriding explicit reasoning. It enforces structural gates between hypothesis formation and action execution, ensuring actions align with verified hypotheses rather than reflexive pattern-matching responses.

When to use this skill:

Core principle: Verification is not advisory—it is a mandatory gate. Actions that don't align with verified hypotheses are BLOCKED.

Mandatory Pre-Action Verification Gate

Before executing ANY implementation action, complete ALL checkpoints in sequence. If any checkpoint fails, HALT and report the failure.

Checkpoint 1: Hypothesis Stated

Requirement: Have I explicitly stated what system/component the issue affects?

Test:

If NO:

BLOCKED - Hypothesis not stated
REQUIRED: State hypothesis explicitly before proceeding
EXAMPLE: "Hypothesis: The issue affects [specific system/component]"

If YES: Proceed to Checkpoint 2

Checkpoint 2: Hypothesis Verified

Requirement: Have I gathered evidence to confirm or refute my hypothesis?

Verification methods:

Test:

If NO:

BLOCKED - Hypothesis not verified
REQUIRED: Gather evidence before proceeding
NEXT STEPS:
1. Identify what evidence would confirm/refute hypothesis
2. Use appropriate tools to gather that evidence
3. Document findings with file paths and line numbers
4. Revise hypothesis if evidence contradicts it

If YES: Proceed to Checkpoint 3

Checkpoint 3: Hypothesis-Action Alignment

Requirement: Does my planned action target the SAME system as my hypothesis identified?

Alignment template:

┌─────────────────────────────────────────────────────────┐
│ HYPOTHESIS SYSTEM: [What system does my hypothesis     │
│                     identify as the problem location?]  │
├─────────────────────────────────────────────────────────┤
│ ACTION SYSTEM:     [What system does my planned action  │
│                     operate on or modify?]              │
├─────────────────────────────────────────────────────────┤
│ ALIGNMENT CHECK:   [Same system = ✓ Proceed]           │
│                    [Different systems = ✗ BLOCKED]      │
└─────────────────────────────────────────────────────────┘

Common misalignments:

| Hypothesis System | Wrong Action System | Why Blocked |

| ---------------------------------------- | ---------------------------- | ----------------------------- |

| PEP 723 inline metadata (# /// script) | uv sync (pyproject.toml) | Different dependency systems |

| Docker container config | Host network settings | Different network layers |

| Git repository state | File system permissions | Different system domains |

| Python virtual environment | Global pip install | Different installation scopes |

| Application code logic | Infrastructure configuration | Different operational layers |

If MISALIGNED:

✗ BLOCKED - Hypothesis-action misalignment detected
HYPOTHESIS targets: [system A]
ACTION operates on: [system B]

REQUIRED: Either:
1. Revise action to target same system as hypothesis
2. Revise hypothesis after gathering new evidence
3. Report that systems are unrelated and task needs clarification

If ALIGNED: Proceed to Checkpoint 4

Checkpoint 4: Pattern-Matching Detection

Requirement: Is this action based on verified project reality or pattern-matching from training data?

Detection questions:

  1. Did I read any files in THIS project to verify this approach?
  2. Did I check official documentation for THIS version/tool?
  3. Is my action based on what THIS project actually uses?
  4. Or is my action based on common patterns I've seen in training data?

Pattern-matching indicators:

Note on research tools: Prefer MCP tools for verification:

Web resource access, definitive guide for getting accurate data for high quality results

If pattern-matching detected:

⚠ PATTERN-MATCHING WARNING
I am using training data patterns without project verification.

REQUIRED actions:
1. State: "I am pattern-matching from training data without verification"
2. Read relevant files to understand current project setup
3. Check project documentation or configuration
4. Verify approach against project reality
5. Return to Checkpoint 2 with gathered evidence

If verified against project reality: Proceed to execution

Execution Decision

After completing ALL four checkpoints:

✓ ALL CHECKPOINTS PASSED → EXECUTE ACTION

Document verification trail:

VERIFICATION COMPLETE:
✓ Checkpoint 1: Hypothesis stated - [brief hypothesis]
✓ Checkpoint 2: Verified via [files/docs read]
✓ Checkpoint 3: Aligned - both target [system name]
✓ Checkpoint 4: Verified against project reality

EXECUTING: [action description]

✗ ANY CHECKPOINT FAILED → HALT

Report failure explicitly:

EXECUTION BLOCKED
Failed checkpoint: [number and name]
Reason: [specific failure reason]
Required before proceeding: [specific next steps]

Common Verification Scenarios

Scenario 1: Dependency Error

Observation: ModuleNotFoundError: No module named 'pydantic'

Verification workflow:

  1. Checkpoint 1 - State hypothesis:
  1. Checkpoint 2 - Gather evidence:
  1. Checkpoint 3 - Verify alignment:
  1. Checkpoint 4 - Pattern-matching check:

Result: Execute action

WRONG approach (BLOCKED):

Scenario 2: Configuration Change

Observation: Application not respecting new timeout setting

Verification workflow:

  1. Checkpoint 1 - State hypothesis:
  1. Checkpoint 2 - Gather evidence:
  1. Checkpoint 3 - Verify alignment:
  1. Checkpoint 4 - Pattern-matching check:

Result: Execute action

Scenario 3: Build Failure

Observation: npm build fails with module resolution error

Verification workflow:

  1. Checkpoint 1 - State hypothesis:
  1. Investigation required:
  1. After investigation:

Result: Execute action

Integration with Existing Workflows

When This Skill Activates

The model must activate this skill:

Automatically before:

On detection of:

Compatibility with Other Skills

This skill works in conjunction with:

Integration with CLAUDE.md Rules

This skill enforces existing CLAUDE.md verification protocols by adding structural gates:

CLAUDE.md states: "The model must verify behavior with authoritative sources"

This skill enforces: "Cannot execute until verification completed and documented"

CLAUDE.md states: "Never cargo cult code without verification"

This skill enforces: "Checkpoint 4 detects and blocks pattern-matching behavior"

CLAUDE.md states: "Distinguish verified information from assumptions"

This skill enforces: "Checkpoint 2 requires evidence before proceeding"

Reference Materials

This skill includes reference documentation:

[./references/research-foundations.md](./references/research-foundations.md)

Authoritative research backing the verification gate approach:

Load this reference when:

[./references/failure-patterns.md](./references/failure-patterns.md)

Common failure modes and how verification prevents them:

Load this reference when:

Self-Monitoring

The model must actively monitor for verification violations:

Warning signs:

When warning signs detected:

⚠ VERIFICATION VIOLATION DETECTED
I attempted to bypass verification checkpoint.
HALTING and returning to Checkpoint [number].

Verification is Not Optional

This skill implements defensive programming for LLM reasoning. Just as compilers block syntactically invalid code, verification gates block logically misaligned actions.

Key principle: Speed without verification is not efficiency—it's error propagation. Taking time to verify prevents cascading failures, reduces debugging cycles, and builds user confidence.

Overhead justification: 2-3 Read operations (50-100 tokens each) prevent wrong implementations requiring 20+ tool calls to debug and fix (4000+ tokens). Verification is a 5% cost for 95% reliability improvement.

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.