code-sample-validator
Extract, validate, and test code samples in documentation. Verify syntax, execute samples, check outputs, validate imports, and ensure code samples are up-to-date with current APIs.
npx skills add a5c-ai/babysitter --skill code-sample-validator --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Code Sample Validation Skill Extract, validate, and test code samples in documentation. ## Capabilities - Extract code blocks from Markdown/MDX - Syntax validation for multiple languages - Execute and verify code sample output - Snippet compilation testing - Version compatibility checking - Import/dependency verification - Code formatting validation (prettier, black) - Generate runnable code from documentation ## Usage Invoke this skill when you need to: - Validate code samples in documentation - Test code examples execute correctly - Check for outdated API usage - Verify import statements - Generate test files from documentation ## Inputs | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | inputPath | string | Yes | Path to documentation file or directory | | action | string | Yes | extract, validate, execute, format | | languages | array | No | Filter by language (js, python, etc.) | | outputDir | string | No | Directory for extracted runnable code | | timeout | number | No | Execution timeout in seconds | | config | object | No | Language-specific configuration | ### Input Example ```json { "inputPath": "./docs", "action": "validate",
- Capabilities
- Usage
- Inputs
- Input Example
- Output Structure
- Validation Report
- Code Extraction
- Markdown Code Block Patterns
- Extraction Configuration
- Language-Specific Validation
- JavaScript/TypeScript
- Python
- Go
- Test Generation
Validate all samples node scripts/validate-docs.js --input docs/ Extract and save runnable code node scripts/validate-docs.js --input docs/ --action extract --output tests/samples/ Generate test files node scripts/validate-docs.js --input docs/ --action generate-tests --output tests/docs/ Check formatting only node scripts/validate-docs.js --input docs/ --action format-check
What does the code-sample-validator skill do?
Extract, validate, and test code samples in documentation. Verify syntax, execute samples, check outputs, validate imports, and ensure code samples are up-to-date with current APIs.
How do I install it?
Run `npx skills add a5c-ai/babysitter --skill code-sample-validator --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From a5c-ai/babysitter, a repository with 1,642 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
