sybil

Execute documentation code samples during pytest runs.

118|10|Updated Oct 13, 2025
One-click install
npx skills add https://github.com/anam-org/metaxy --skill sybil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sybil
Source: https://github.com/anam-org/metaxy/tree/main/.claude/skills/sybil
Command: npx skills add https://github.com/anam-org/metaxy --skill sybil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Sybil automates testing of code examples embedded in documentation and docstrings by parsing and executing them as part of normal test runs.

Core Features & Use Cases

  • Pytest integration: Integrates with pytest to collect and run code blocks from Markdown and Python docstrings during test runs.
  • Parsers and skip directives: Supports multiple Markdown codeblock parsers and skip directives to selectively run examples.
  • Namespace management: Allows pre-populating a namespace and teardown between examples to ensure isolation.
  • Documentation reliability: Keeps documentation aligned with implementation, catching drift and broken examples early.

Use cases include validating documentation snippets in API docs, tutorials, and inline docstrings to keep documentation accurate.

Quick Start

Install Sybil and integrate with pytest to start testing documentation samples. Example commands:

  • pip install 'sybil[pytest]'
  • Create a pytest configuration that uses Sybil, for example:
  • from sybil import Sybil
  • from sybil.parsers.markdown.codeblock import PythonCodeBlockParser
  • pytest_collect_file = Sybil(parsers=[PythonCodeBlockParser()], patterns=["docs/**/*.md"]).pytest()
  • Run pytest to execute the documentation examples.

Frequently Asked Questions about sybil

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

FAQPage Schema
How do I test code examples in markdown documentation automatically?

Testing code examples in markdown documentation automatically involves executing embedded Python code blocks during pytest runs. Sybil integrates with pytest to collect and run these documentation samples, catching drift and broken examples early.

Can I run pytest against Python docstrings to validate examples?

Yes, you can run pytest against Python docstrings to validate examples. Sybil parses and executes code samples embedded in inline docstrings during normal test runs, ensuring your API documentation stays aligned with your implementation.

How do I skip specific code blocks when testing documentation samples?

You can skip specific code blocks when testing documentation samples by using skip directives. Sybil supports configurable parsers and skip directives that allow you to selectively run or exclude embedded examples during pytest execution.

What is the best way to keep API documentation examples aligned with implementation?

The best way to keep API documentation examples aligned with implementation is automated documentation testing. Sybil executes embedded code snippets in docs during pytest runs, catching drift and broken examples early before they reach users.

Does pytest documentation testing support namespace management between examples?

Yes, pytest documentation testing supports namespace management between examples. Sybil allows pre-populating a namespace and applying teardown between examples to ensure isolation when executing code blocks from markdown or docstrings.