julia-doctests

Configure and write Julia doctests with Documenter.jl for package validation.

30|6|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/Krastanov/JuliaLLMAgentSkills --skill julia-doctests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: julia-doctests
Source: https://github.com/Krastanov/JuliaLLMAgentSkills/tree/main/julia-doctests
Command: npx skills add https://github.com/Krastanov/JuliaLLMAgentSkills --skill julia-doctests

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps developers write and verify executable examples within their Julia package documentation, ensuring that code snippets are accurate and functional.

Core Features & Use Cases

  • Doctest Syntax: Supports both REPL-style and script-style doctest blocks.
  • Setup & Teardown: Allows for defining setup code that runs before doctests and teardown code for cleanup.
  • Handling Randomness: Provides guidance on using StableRNGs.jl for reproducible random number generation in tests.
  • Filters: Enables the use of regular expressions to handle non-deterministic output and ensure test stability across environments.
  • Use Case: When documenting a new function calculate_stats(data), you can include a doctest showing its usage and expected output, ensuring it remains correct as the package evolves.

Quick Start

Use the julia-doctests skill to add a doctest example to the double function in your package's documentation.

Frequently Asked Questions about julia-doctests

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

FAQPage Schema
How do I write and verify executable code examples in Julia docstrings?

You can write and verify Julia doctests by embedding testable code blocks within docstrings and configuring the validation infrastructure using Documenter.jl. This ensures your documentation examples remain accurate as the package evolves.

How do I handle non-deterministic output in Julia doctests?

To handle non-deterministic output in Julia doctests, you can use regular expression filters to match and ignore variable parts of the output. This ensures your doctests remain stable across different environments.

How do I manage reproducible random number generation in Julia doctests?

For reproducible random number generation in Julia doctests, you should use StableRNGs.jl. This provides a stable random number stream, ensuring that doctests involving randomness produce consistent results across test runs.

Can I run setup and teardown code for Julia doctests?

Yes, you can define block-level setup and teardown code for Julia doctests. Setup code runs before the doctests execute, and teardown code handles cleanup afterward, facilitating complex test scenarios.

Does Documenter.jl support both REPL-style and script-style doctests?

Yes, Documenter.jl supports both REPL-style and script-style doctest blocks. This allows you to format your executable documentation examples in the syntax that best fits your package's workflow.

What are named doctests in Julia and how do I use them?

Named doctests are an advanced feature supported in Julia doctest configuration, allowing you to assign identifiers to specific test blocks. This facilitates targeted verification and better organization of complex testable code examples.