playwright-rust: Skill for Claude Code

.claude/skills/doctest-conventions/SKILL.md

doctest-conventions is a skill for Claude Code from padamson/playwright-rust. It costs 49 tokens per session (732 once invoked), scanned A, original, Apache-2.0.

Guidelines for writing Rust documentation examples that are checked by the compiler as doctests.

In plain words
What is it for?
Use it when adding or reviewing rustdoc examples, especially examples involving browser automation or the Playwright server.
Why use it?
They help documentation stay correct over time and explain when browser-based examples should be compiled without being run.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is padamson/playwright-rust's own configuration. It tells Claude Code how to work on playwright-rust itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything playwright-rust configures →

Reuse

Borrowing it

Nothing to install: this file belongs to padamson/playwright-rust. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/padamson/playwright-rust/main/.claude/skills/doctest-conventions/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/padamson/playwright-rust

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for doctest-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/padamson/playwright-rust/doctest-conventions/github.svg)](https://agentmods.dev/skills/padamson/playwright-rust/doctest-conventions)
Your own site
<a href="https://agentmods.dev/skills/padamson/playwright-rust/doctest-conventions"><img src="https://agentmods.dev/badge/skills/padamson/playwright-rust/doctest-conventions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for doctest-conventions

Your own site · 80×15
<a href="https://agentmods.dev/skills/padamson/playwright-rust/doctest-conventions"><img src="https://agentmods.dev/badge/skills/padamson/playwright-rust/doctest-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 732 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.00732
Opus 5.5 $0.00020 $0.00293
Sonnet 5.5 $0.00010 $0.00146
Haiku 4.5 $0.00005 $0.00073

Measured 1mo ago against content hash 0b708b51e60f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

doctest-conventions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/doctest-conventions/SKILL.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

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:

/// # 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(())
/// # }
/// ```

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 89 lines · 49 tokens per session scan A 0b708b51e60f

Subscribe to this mod's changes

doctest-conventions is a skill published in the GitHub repository padamson/playwright-rust (163 stars, last pushed 2d ago), licensed Apache-2.0. It adds 49 tokens to every session and 732 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

rust-development

Idiomatisk Rust-utvikling med cargo, clippy, error handling, async/tokio, unsafe og testing.

navikt/copilot · 27 tokens

rust-testing

Rust testing conventions and frameworks: built-in #[test], integration, and doctest layout plus the cargo-nextest runner and the proptest, insta, criterion, mockall, and rstest ecosystem. Invoke whenever task involves any interaction with Rust tests — writing, running, configuring, or debugging tests in .rs files and…

xobotyi/cc-foundry · 70 tokens

rust-testing-quality

Use when writing, organizing, or running Rust tests — unit, integration, doc-tests, proptest, criterion benchmarks, or cargo-mutants. Not for CI pipeline wiring (rust-tooling-cicd).

fusengine/agents · 46 tokens

testing-rust

Writes tests following TDD (using cargo test, proptest, and insta) best practices. Use when writing unit tests, integration tests, or property-based tests in Rust.

qte77/claude-code-plugins · 39 tokens

rust-best-practices

Write, review, refactor, or optimize Rust, including ownership, errors, Tokio, traits, tests, benchmarks, Clippy, and documentation. Excludes other languages and architecture unrelated to Rust idioms.

pedronauck/skills · 48 tokens

testing

Rust testing — unit/integration layout, mocking with mockall, async test patterns, property testing, snapshot testing. Use whenever writing or reviewing Rust tests, setting up test infrastructure, choosing mocking strategies, organizing test modules, debugging test failures, or when the user asks about testing…

napalmpapalam/skills · 68 tokens