Agent skill

Doctest Conventions

by padamson in padamson/playwright-rust

Conventions for authoring rustdoc doctests in playwright-rust — the norun annotation, module-level placement, hidden scaffolding lines, and how doctests are exercised in CI vs pre-commit.

Apache-2.0Auto-check passedTesting & QA

Install Doctest Conventions

skills CLI
$ npx skills add padamson/playwright-rust --skill doctest-conventions -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install padamson/playwright-rust doctest-conventions --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/padamson/playwright-rust.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/doctest-conventions .claude/skills/doctest-conventions && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
doctest-conventions
GitHub stars
154
Token cost
~749 tokens
SKILL.md length
256 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

Conventions for authoring rustdoc doctests in playwright-rust — the norun annotation, module-level placement, hidden scaffolding lines, and how doctests are exercised in CI vs pre-commit.

  • Tasks that involve Browser testing
  • SKILL.md covers Philosophy: documentation that…, The annotation: no_run, Structure and Running doctests, plus 1 more section
  • Calls cargo
  • Tasks that involve Project scaffolding

What it does

Doctest Conventions is an agent skill from padamson/playwright-rust. Conventions for authoring rustdoc doctests in playwright-rust — the norun annotation, module-level placement, hidden scaffolding lines, and how doctests are exercised in CI vs pre-commit.

Its SKILL.md is about 750 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Browser testing and Project scaffolding. It works with Playwright and Rust. The repository describes itself as: Rust language bindings for Microsoft Playwright. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Browser testing
  • Tasks that involve Project scaffolding

Example prompts

  • “Use the doctest-conventions skill to convention for authoring rustdoc doctests in playwright-rust — the norun annotation, module-level placement…”
  • “/doctest-conventions”

What it can do on your machine

Read from SKILL.md and the folder at commit 0cf5194. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Doctest Conventions loads about 749 tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 256 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~749

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from padamson/playwright-rust at commit 0cf5194, republished under its Apache-2.0 licence (© padamson). 256 words, ~749 tokens.

Download SKILL.mdSave it as .claude/skills/doctest-conventions/SKILL.md (or your agent's skills folder).
name
doctest-conventions
description
Conventions for authoring rustdoc doctests in playwright-rust — the `no_run` annotation, module-level placement, hidden scaffolding lines, and how doctests are exercised in CI vs pre-commit.
metadata.internal
true

Doctest Conventions

Philosophy: documentation that cannot rot

Every rustdoc example is compile-checked on every cargo test --doc (pre-commit and CI). Browser automation can't execute in a doctest harness, so examples are compiled but not run — same contract as the agent-doc snippets (verify-agent-docs) and landing-page snippets (verify-site-snippets).

The annotation: no_run

text
no_run  — compiled every time, never executed.  ← use this
ignore  — never compiled, never executed; rustdoc only highlights it.
(none)  — compiled AND executed; only for pure, browser-free examples.

**Use ```no_run for anything that would launch a browser or talk to the Playwright server.** Plain ```rust is fine for pure logic (selector builders, option construction) that can really execute.

**Never use ```ignore** except when the code genuinely cannot compile in this crate — the only sanctioned case is the macros/trace crates' module docs showing downstream playwright-rs usage, which would need a cyclic dev-dependency to compile.

History. Until 2026-06, the convention was ignore + a CI step running cargo test --doc -- --ignored, believed to execute them. It never did: rustdoc surfaces ignore blocks as empty always-pass stubs (83 "passed" in 0.00s). The examples had zero protection and ~10 had silently rotted. no_run is what the convention always intended.

Structure

Prefer one comprehensive module-level doctest (//!) per protocol file, demonstrating related APIs in a realistic scenario. Per-function examples are allowed where they pull their weight — they must compile like everything else.

Use hidden scaffolding lines (# -prefixed) so the rendered docs show only the instructive lines while the compiler sees a complete program:

rust
/// # Example
///
/// ```no_run
/// # use playwright_rs::Playwright;
/// # async fn example() -> Result<(), Box<dyn std::error::Error>> {
/// # let pw = Playwright::launch().await?;
/// # let page = pw.chromium().launch().await?.new_page().await?;
/// page.goto("https://example.com", None).await?;
/// let title = page.title().await?;
/// # Ok(())
/// # }
/// ```

Module-level (//!) doctests use //! # for hidden lines. A full #[tokio::main] async fn main() is also fine when showing the whole program is the point.

Running doctests

bash
# Compile-check all doctests (pre-commit AND CI run exactly this)
cargo test --doc --workspace

# Pure examples without no_run also execute in the same pass

CI / pre-commit integration

Both run the same command — there is no separate execution lane:

yaml
- name: Compile doc-tests
  run: cargo test --doc --workspace

© padamson, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/doctest-conventions of padamson/playwright-rust.

Open the folder on GitHubat commit 0cf5194

Compare with similar skills

Doctest Conventions next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Doctest Conventions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Doctest Conventions this skillpadamson/playwright-rust154—~749Automated safety check: PassApache-2.0
Desktopgridaco/grida2.7k—~3.2kAutomated safety check: NotesApache-2.0
Playwright Component Testingmellowagain/gitarena1151 repos~2.6kAutomated safety check: PassMIT
UI Regression Recorderxuxh21/ui-regression-recorder-skill112—~4.4kAutomated safety check: PassNone
Playwright Tracemellowagain/gitarena1151 repos~1.2kAutomated safety check: PassMIT
Hydra Devstreamband/hydra-srt147—~995Automated safety check: PassApache-2.0

Similar skills

  • Desktop

    gridaco/grida

    Grida Desktop Electron shell and release-impact work: BrowserWindow, preload, window.grida, menus, protocol/deep links, file associations, Forge, path-scoped bridge security, Electron-only UI bugs…

    2.7k GitHub stars~3.2k tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • Playwright Component Testing

    mellowagain/gitarena

    Set up component testing with Playwright using a story gallery — scaffold stories and a gallery dev page driven by the built-in mount fixture, no dedicated component-testing runtime.

    115 GitHub starsUsed in 1 repo~2.6k tokens
    Testing & QAAuto-check passed
  • UI Regression Recorder

    xuxh21/ui-regression-recorder-skill

    A skill your agent uses when the user says to initialize the current project for UI regression, record an operation, convert Playwright codegen recordings into stable tests, extract shared helpers…

    112 GitHub stars~4.4k tokensUpdated 4 mo ago
    Testing & QAAuto-check passed
  • Playwright Trace

    mellowagain/gitarena

    Inspect Playwright trace files from the command line — list actions, view requests, console, errors, snapshots and screenshots.

    115 GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Hydra Dev

    streamband/hydra-srt

    Run HydraSRT development workflows: mix q quality gate, Elixir unit/E2E tests, native Rust tests, web Vitest/Playwright, and make dev.

    147 GitHub stars~995 tokensUpdated 23 days ago
    Testing & QAAuto-check passed
  • Learn Lab Coach

    debs-obrien/playwright-movies-app

    Coach a learner through the learn/ Playwright Movies curriculum.

    103 GitHub stars~487 tokensUpdated 8 days ago
    Testing & QAAuto-check: notes

More from padamson/playwright-rust

  • Playwright Rs Usage

    padamson/playwright-rust

    Procedural reference for using playwright-rs in Rust browser-automation code — object model (Browser/Context/Page/Locator), the locator!() macro, builder pattern for options, auto-wait semantics…

    154 GitHub stars~5.3k tokensUpdated 5 days ago
    Auto-check passed
  • Release Process

    padamson/playwright-rust

    End-to-end release runbook for playwright-rust — version bump, supply-chain refresh, per-crate CHANGELOGs, tag-prefix routing for the three workspace crates, the safer push-then-tag workflow that…

    154 GitHub stars~4.1k tokensUpdated 5 days ago
    Auto-check passed
  • Supply Chain

    padamson/playwright-rust

    Procedure for keeping playwright-rust's cargo audit / cargo deny / cargo vet checks green when bumping the project's own version, when external crates change, and when a security advisory drops.

    154 GitHub stars~722 tokensUpdated 5 days ago
    Auto-check passed

Works with

Categories

Questions about Doctest Conventions

What does Doctest Conventions do?

Conventions for authoring rustdoc doctests in playwright-rust — the norun annotation, module-level placement, hidden scaffolding lines, and how doctests are exercised in CI vs pre-commit. Doctest Conventions is an agent skill from padamson/playwright-rust. Conventions for authoring rustdoc doctests in playwright-rust — the norun annotation, module-level placement, hidden scaffolding lines, and how doctests are exercised in CI vs pre-commit.

When should I use Doctest Conventions?

Doctest Conventions fits situations like: tasks that involve Browser testing; tasks that involve Project scaffolding.

How do I install Doctest Conventions in Claude Code?

Run `npx skills add padamson/playwright-rust --skill doctest-conventions -a claude-code`. Or copy the skill folder (.claude/skills/doctest-conventions in padamson/playwright-rust) into .claude/skills/doctest-conventions in your project. Claude Code loads it when a task matches its description.

How do I install Doctest Conventions in Codex?

Run `npx skills add padamson/playwright-rust --skill doctest-conventions -a codex`. Or copy the skill folder (.claude/skills/doctest-conventions in padamson/playwright-rust) into .agents/skills/doctest-conventions in your project. Codex loads it when a task matches its description.

Can I use Doctest Conventions in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add padamson/playwright-rust --skill doctest-conventions -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/doctest-conventions, .gemini/skills/doctest-conventions, .github/skills/doctest-conventions and .opencode/skills/doctest-conventions in your project.

What does Doctest Conventions need to run?

Going by SKILL.md and its folder, Doctest Conventions needs the command-line tools its instructions call (cargo).

Does Doctest Conventions access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Doctest Conventions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Doctest Conventions use?

Doctest Conventions is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Doctest Conventions use?

About 749 tokens (SKILL.md is roughly 3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Doctest Conventions?

Skills that share tags, products or a category with Doctest Conventions: Desktop (gridaco/grida, 2.7k stars), Playwright Component Testing (mellowagain/gitarena, 115 stars), UI Regression Recorder (xuxh21/ui-regression-recorder-skill, 112 stars) and Playwright Trace (mellowagain/gitarena, 115 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Doctest Conventions?

padamson (a GitHub user) maintains it in padamson/playwright-rust, which has 154 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 4, 2026.

Source: padamson/playwright-rust on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.