Agent skill

Verify Cascade

by alinaqi in alinaqi/maggy

Verification-gated model escalation — run a cheap model, verify its output with decomposed per-field checks, and escalate to a strong model only when a flag fires.

MITAuto-check: notes

Install Verify Cascade

skills CLI
$ npx skills add alinaqi/maggy --skill verify-cascade -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alinaqi/maggy verify-cascade --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alinaqi/maggy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/verify-cascade .claude/skills/verify-cascade && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
verify-cascade
GitHub stars
707
Token cost
~1.4k tokens
SKILL.md length
485 words
Files
2
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

Verification-gated model escalation — run a cheap model, verify its output with decomposed per-field checks, and escalate to a strong model only when a flag fires.

  • SKILL.md covers The loop, Verifiers (pluggable) —…, What makes a good verifier… and When to reach for it vs plain…, plus 1 more section
  • Runs Python scripts from its folder; calls python3 and pip; needs TYPESAFE_API_KEY

What it does

Verify Cascade is an agent skill from alinaqi/maggy. Verification-gated model escalation — run a cheap model, verify its output with decomposed per-field checks, and escalate to a strong model only when a flag fires. Optional TypeSafe (jev) verifier.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `verify_cascade.py`).

The repository describes itself as: What started as an opinionated Claude Code setup kit is now an autonomous AI engineering command center. The licence is MIT.

Example prompts

  • “/verify-cascade”

Requirements

  • Python 3
  • A credential in TYPESAFE_API_KEY
  • Pre-approved tools (allowed-tools): Bash, Read, Write

What it can do on your machine

Read from SKILL.md and the folder at commit 72a456e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Write

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • TYPESAFE_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Verify Cascade loads about 1.4k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 485 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Write

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alinaqi/maggy at commit 72a456e, republished under its MIT licence (© alinaqi). 485 words, ~1,357 tokens.

Download SKILL.mdSave it as .claude/skills/verify-cascade/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
verify-cascade
description
Verification-gated model escalation — run a cheap model, verify its output with decomposed per-field checks, and escalate to a strong model only when a flag fires. Optional TypeSafe (jev) verifier.
allowed-tools
Bash, Read, Write
when-to-use
When you want the token economy of a cheap model but the reliability of a strong one — structured extraction, data pulls, patch/summary checks — and would…
user-invocable
true
effort
medium

Verify-Cascade — extract cheap, verify, escalate only on a flag

maggy already routes by task complexity. This makes routing output-aware: a cheap model does the work, a decomposed verifier checks it, and you escalate to a strong model (Claude) only when the verifier flags a real problem. The cheap rung handles the easy items for near-free; only flagged items pay for the strong model — most of the quality of the big model at a fraction of the cost.

It's the same discipline as the security-audit finder ≠ validator gate, applied to routing: an independent verifier catches the cheap model's blind spots.

The loop

1. EXTRACT   cheap model produces an output (extraction / answer / summary)
2. VERIFY    a decomposed verifier asks narrow per-field yes/no questions,
             framed so "bad = true", and returns P(wrong) per question
3. GATE      escalate if ANY question's P(wrong) > fire threshold (max, not mean)
4. ESCALATE  only the flagged items pay for the strong model; the rest keep the cheap answer

Schema-validation is necessary but not sufficient: a cheap model produces confident, schema-valid fabrications (a blank field filled with a plausible invented value). A structural check can't see that — a semantic verifier can.

Verifiers (pluggable) — verify_cascade.py

bash
VC="$(cat ~/.claude/.bootstrap-dir)/skills/verify-cascade/verify_cascade.py"
python3 "$VC"          # self-test (stubbed judge, no network, no model)
LocalVerifier — the default, nothing leaves your machine

Runs the whole decomposed question battery through a cheap CLI model in one call and returns {field::metric: P(wrong)}. No external service.

python
import sys
sys.path.insert(0, f"{__import__('subprocess').check_output(['cat', __import__('os').path.expanduser('~/.claude/.bootstrap-dir')]).decode().strip()}/skills/verify-cascade")
# (or simply: sys.path.insert(0, "<bootstrap-dir>/skills/verify-cascade"))
from verify_cascade import get_verifier, build_questions, cascade
v = get_verifier("local")                     # uses $MAGGY_JUDGE_CMD (default: deepseek --flash)
result = cascade(
    extract  = lambda: cheap_extract(...),     # your cheap-model call -> dict
    verify   = lambda rec: v.verify({"source_text": source}, build_questions(rec, schema)),
    escalate = lambda: strong_extract(...),    # your strong-model call -> dict
    fire_t   = 0.7,
)
# result: {record, escalated: bool, fired: [qid...], scores: {qid: p}}

Set the judge model with MAGGY_JUDGE_CMD (e.g. qwen3, deepseek --flash) or pass your own judge=callable(prompt)->text. The default passes the prompt on stdin (no shell, so prompt content is never interpreted as a command), so MAGGY_JUDGE_CMD must read from stdin. Questions are scored in complete batches and an over-long source warns on stderr rather than being silently truncated.

TypeSafeVerifier — OPT-IN, and it sends data to a third party

TypeSafe's hosted jev model is purpose-built and calibrated for this. But:

⚠️ Data leaves your machine. TypeSafeVerifier.verify() POSTs the source_text, schema, and extraction to api.typesafe.ai. Only use it for content you are willing to send to a third party. It is off by default — it will not even construct without TYPESAFE_API_KEY, so nothing is sent unless you opt in.

bash
pip install typesafe_sdk
export TYPESAFE_API_KEY=…            # opt-in; enables the external call
python
v = get_verifier("typesafe")         # raises unless TYPESAFE_API_KEY is set

Everything else (questions, gate, cascade) is identical — the verifier is the only swap.

Show full SKILL.md (183 more words)Show less

What makes a good verifier signal

  • Narrow + grounded — one checkable yes/no about one field against the source, not a vague "is this good?".
  • Bad = TRUE, explicit criteria — frame the escalate case as the true case.
  • Per-field, aggregate with max — a per-field flag localizes the error and stays sparse; max means one confident red flag escalates instead of being averaged away.
  • Independent + cheap — a dedicated verifier judges the worker's output and catches its blind spots, and it has to be cheap or there are no savings left to capture.
  • Calibrated — high on real errors, low on correct ones, so one threshold splits accept vs escalate.

When to reach for it vs plain routing

Use verify-cascade when the output can be checked against a source (extractions, RAG answers, data pulls, structured summaries). For open-ended generation with no ground truth, stick to maggy's task-complexity routing. The two compose: classify to pick the cheap rung, verify to decide whether to escalate.

Attribution

Pattern from TypeSafe's public "SDE cascade" cookbook, rebuilt so the verifier is pluggable and the private LocalVerifier is the default; TypeSafe is an optional adapter.

© alinaqi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/verify-cascade of alinaqi/maggy.

  • SKILL.md
  • verify_cascade.py

Open the folder on GitHubat commit 72a456e

Compare with similar skills

Verify Cascade next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Verify Cascade compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Verify Cascade this skillalinaqi/maggy707—~1.4kAutomated safety check: NotesMIT
Gate Testsvercel/next.js143k—~2.8kAutomated safety check: PassMIT
Gateplugin87/ux-ui-agent-skills1.6k—~532Automated safety check: PassMIT
Brain Ingest Gategarrytan/gbrain31k—~3.9kAutomated safety check: PassMIT
Delivery Gateaffaan-m/ECC276k—~1.3kAutomated safety check: PassMIT
Bill Gatessickn33/agentic-awesome-skills47k2 repos~352Automated safety check: PassMIT

Similar skills

  • Gate Tests

    vercel/next.js

    Official

    How to use the @gate / @force-gate test directives instead of it.skip or fake-green skip patterns.

    143k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Gate

    plugin87/ux-ui-agent-skills

    Run the one-command quality gate and report the real N/N result.

    1.6k GitHub stars~532 tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Brain Ingest Gate

    garrytan/gbrain

    Pre-write quality gate for content entering the brain. An agent skill from garrytan/gbrain.

    31k GitHub stars~3.9k tokensUpdated today
    Testing & QAAuto-check passed
  • Delivery Gate

    affaan-m/ECC

    Stop hook that blocks Claude from finishing until quality checks pass.

    276k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Bill Gates

    sickn33/agentic-awesome-skills

    Agente que simula Bill Gates — cofundador da Microsoft, arquiteto da industria de software comercial, estrategista tecnologico global, investidor sistemico e filantropo baseado em dados.

    47k GitHub starsUsed in 2 repos~352 tokens
    Auto-check passed
  • Skill Release Gate

    rohitg00/ai-engineering-from-scratch

    Evaluates an Agent Skill bundle before release for structure, trigger quality, artifact improvement, script correctness, safety, installed-tree integrity and host portability.

    66k GitHub stars~1k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from alinaqi/maggy

All 71 skills in this repo
  • Aeo Optimization

    alinaqi/maggy

    AI Engine Optimization - semantic triples, page templates, content clusters for AI citations

    707 GitHub stars~3.7k tokensUpdated 15 days ago
    Auto-check passed
  • Agent Teams

    alinaqi/maggy

    Claude Code Agent Teams - default team-based development with strict TDD pipeline enforcement

    707 GitHub stars~5k tokensUpdated 15 days ago
    Auto-check: notes
  • AI Models

    alinaqi/maggy

    Latest AI models reference - Claude, OpenAI, Gemini, Eleven Labs, Replicate

    707 GitHub stars~4.1k tokensUpdated 15 days ago
    Auto-check passed
  • Android Java

    alinaqi/maggy

    Android Java development with MVVM, ViewBinding, and Espresso testing

    707 GitHub stars~3.9k tokensUpdated 15 days ago
    Auto-check: notes
  • Android Kotlin

    alinaqi/maggy

    Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing

    707 GitHub stars~3k tokensUpdated 15 days ago
    Auto-check passed
  • Autonomous Testing

    alinaqi/maggy

    AI-driven testing agent that auto-discovers, generates, executes, evaluates, and fixes tests for any project type

    707 GitHub stars~1.1k tokensUpdated 15 days ago
    Auto-check passed

Questions about Verify Cascade

What does Verify Cascade do?

Verification-gated model escalation — run a cheap model, verify its output with decomposed per-field checks, and escalate to a strong model only when a flag fires. Verify Cascade is an agent skill from alinaqi/maggy. Verification-gated model escalation — run a cheap model, verify its output with decomposed per-field checks, and escalate to a strong model only when a flag fires.

How do I install Verify Cascade in Claude Code?

Run `npx skills add alinaqi/maggy --skill verify-cascade -a claude-code`. Or copy the skill folder (skills/verify-cascade in alinaqi/maggy) into .claude/skills/verify-cascade in your project. Claude Code loads it when a task matches its description.

How do I install Verify Cascade in Codex?

Run `npx skills add alinaqi/maggy --skill verify-cascade -a codex`. Or copy the skill folder (skills/verify-cascade in alinaqi/maggy) into .agents/skills/verify-cascade in your project. Codex loads it when a task matches its description.

Can I use Verify Cascade in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alinaqi/maggy --skill verify-cascade -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/verify-cascade, .gemini/skills/verify-cascade, .github/skills/verify-cascade and .opencode/skills/verify-cascade in your project.

What does Verify Cascade need to run?

Going by SKILL.md and its folder, Verify Cascade needs Python for the scripts in its folder, the command-line tools its instructions call (python3 and pip) and credentials named TYPESAFE_API_KEY. Our summary lists: Python 3; A credential in TYPESAFE_API_KEY. Its frontmatter pre-approves these tools: Bash, Read, Write.

Does Verify Cascade access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Verify Cascade safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Verify Cascade use?

Verify Cascade is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Verify Cascade use?

About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Verify Cascade?

Skills that share tags, products or a category with Verify Cascade: Gate Tests (vercel/next.js, 143k stars), Gate (plugin87/ux-ui-agent-skills, 1.6k stars), Brain Ingest Gate (garrytan/gbrain, 31k stars) and Delivery Gate (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Verify Cascade?

alinaqi (a GitHub user) maintains it in alinaqi/maggy, which has 707 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on September 24, 2026.

Source: alinaqi/maggy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.