adk-verify-snippets

Executes Python code blocks from Markdown files and reports pass/fail status with coverage.

21.4k|3.9k|Updated Apr 1, 2025
One-click install
npx skills add https://github.com/google/adk-python --skill adk-verify-snippets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adk-verify-snippets
Source: https://github.com/google/adk-python/tree/main/.agents/skills/adk-verify-snippets
Command: npx skills add https://github.com/google/adk-python --skill adk-verify-snippets

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires coverage, google-adk, and includes scripts (resource) components.

What problem does it solve?

Documentation code samples silently break as APIs evolve, and manually testing every snippet in a README or guide is tedious and error-prone. This Skill automatically extracts each Python block from a Markdown file, runs it in an isolated subprocess, and produces a per-snippet verification report.

Core Features & Use Cases

  • Automated snippet execution: Extracts every ```python block, writes it to a temp file, and runs it via a bundled harness that detects module-level ADK Workflow, Agent, or App components and executes them against the Gemini API.
  • Structured reporting: Generates a Markdown report with an Executive Summary table (load phase, run phase, coverage, details) plus per-snippet logs and tracebacks.
  • Selective skipping: Supports a <!-- verify-snippets: ignore --> annotation to exclude pseudo-code or setup-dependent blocks.
  • Use Case: Before publishing an updated ADK guide, run the verifier on the Markdown file to find which code samples fail to compile or run, then fix only the broken ones.

Quick Start

Ask the assistant to verify the Python code snippets in a specific Markdown documentation file and show the summary report.

Frequently Asked Questions about adk-verify-snippets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Python code snippets in a Markdown file?

Run the verify_md.py script with the path to the Markdown file. It extracts each python code block, executes it in an isolated subprocess via the bundled run.py harness, and writes a pass/fail report beside the source file.

How do I skip a code block during Markdown snippet verification?

Place the HTML comment <!-- verify-snippets: ignore --> on its own line immediately before the opening python fence. Blank lines are allowed, but any prose or heading between the annotation and the fence cancels the skip.

Does snippet verification require a Gemini API key?

A Gemini API key is only needed for snippets that define a module-level Agent, App, or Workflow, since those are executed against the live API. Load-only snippets with no ADK component run without any key.

Why does a correct snippet report as broken during verification?

Common causes include reliance on state from an earlier snippet (each runs in a fresh subprocess), exceeding the 120-second timeout, module-level asyncio.run() conflicting with the harness event loop, or a bare closing fence truncating the block.

Can I get code coverage for documentation snippets?

Yes, install the coverage package with uv pip install coverage before running the verifier. The harness then reports per-snippet line and branch coverage; without it the Coverage column shows a dash.