mcpbeat Sign in

Verify Skill for Claude

Drive this repo's build/release scripts end-to-end without touching the network. Use when verifying changes to scripts/download_cli.py, scripts/build_wheel.py, scripts/update_cli_version.py, or scripts/_cli_version_validation.py.

922 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
7800
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/anthropics/defending-code-reference-harness --skill verify

What it tells the agent to use

found in the instruction text
Bash runs shell commands — read the instruction before connecting

The instruction itself

5 sections, as written by the author

Verifying the build scripts

The SDK itself is a library (drive it through import claude_agent_sdk), but

the scripts/ directory is a set of CLIs run by the release workflows.

Verify them by running them, not by importing them.

NEVER run the real installer

scripts/download_cli.py shells out to curl https://claude.ai/install.sh | bash

(and the PowerShell equivalent). Running it for real **overwrites the claude

binary on the developer's machine**. Do not run bash install.sh, and do not

invoke download_cli.py with latest/stable (or any case variant) against

the real network.

Instead, put stub curl / bash / powershell on a temp PATH and drive the

script under env -i with an isolated HOME (so find_installed_cli() cannot

discover the real binary and copy it into src/claude_agent_sdk/_bundled/).

The harness

SB=$(mktemp -d); mkdir -p $SB/stub $SB/home $SB/repo/src/claude_agent_sdk
cp scripts/{download_cli.py,build_wheel.py,update_cli_version.py,_cli_version_validation.py} $SB/repo/scripts/
printf '__cli_version__ = "2.1.208"\n' > $SB/repo/src/claude_agent_sdk/_cli_version.py

cat > $SB/stub/curl <<'EOF'
#!/bin/bash
out=""; prev=""; for a in "$@"; do [ "$prev" = "-o" ] && out="$a"; prev="$a"; done
echo "[stub curl] argv: $*" >> "$MARKER"
[ -n "$out" ] && printf '%b' "${CURL_BODY:-#!/bin/bash\necho hi\n}" > "$out"
exit ${CURL_EXIT:-0}
EOF
cat > $SB/stub/bash <<'EOF'
#!/bin/bash
{ echo "[stub bash] argc=$#"; for a in "$@"; do echo "    <$a>"; done; } >> "$MARKER"
EOF
chmod +x $SB/stub/*

cd $SB/repo
env -i HOME=$SB/home PATH=$SB/stub:/usr/bin:/bin MARKER=$SB/m \
    CLAUDE_CLI_VERSION=2.1.208 .venv/bin/python scripts/download_cli.py

run_command() captures the child's output, so the stubs must log to a

$MARKER file — printing to stderr is swallowed.

Flows worth driving

  • update_cli_version.py <version> — the whole validator surface is

reachable here: a concrete version writes the file; latest/stable,

v2.1.207, next, 2.1, and a quote-breakout string each exit 1 with a

distinct message and leave the file untouched.

  • build_wheel.py --skip-sdist — reads the pin, then chains into

download_cli.py. Rewrite _cli_version.py in the sandbox to a moving tag /

single quotes / garbage / delete it: each must fail *before* any subprocess

is spawned. --cli-version <v> bypasses the pin (intentional escape hatch;

the release workflow does not use it).

  • download_cli.py — set CURL_BODY to an HTML error page or an empty

string to prove the body check refuses it with no retry; empty the PATH to

prove a missing curl fails fast in one attempt; CURL_EXIT=22 to prove a

genuine transient failure still retries 3×.

  • The Windows path is unreachable on Linux. It is behind

platform.system() == "Windows". Drive it with a small runner that

patch.object(m.platform, "system", return_value="Windows") and a stub

powershell that reads the -Command text and honours

$env:CLAUDE_CLI_INSTALL_SCRIPT. This is the one place where forcing the

platform is legitimate.

Gotchas

  • ${CURL_BODY:-default} treats an *empty* body as unset. Use a separate stub

that does : > "$out" to test the empty-body branch.

  • The retry path really sleeps (jitter up to 5s, then 2s + 4s). A full

three-attempt run takes ~10s; budget for it rather than assuming a hang.

Other skills for the same job

different authors, same section of the catalogue
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens
Pylabrobot
by christophacham
×4

Vendor-agnostic lab automation framework. Use when controlling multiple equipment types (Hamilton, Tecan, Opentrons, plate readers, pumps) or needing unified programming across different vendors. Best for complex workflows, multi-vendor setups, simulation. For Opentrons-only protocols with official API, opentrons-integration may be simpler.

21k tokens

How to use it

Copy the folder

Take anthropics/verify from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.