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.
curl -O https://raw.githubusercontent.com/padamson/playwright-rust/main/.claude/skills/doctest-conventions/SKILL.mdgit clone --depth 1 https://github.com/padamson/playwright-rustWrote 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.
[](https://agentmods.dev/skills/padamson/playwright-rust/doctest-conventions)<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.
<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once 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 |
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.
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 runningcargo test --doc -- --ignored, believed to execute them. It never did: rustdoc surfacesignoreblocks as empty always-pass stubs (83 "passed" in 0.00s). The examples had zero protection and ~10 had silently rotted.no_runis 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(())
/// # }
/// ```
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.
- 1mo ago First seen · 89 lines · 49 tokens per session scan A 0b708b51e60f
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.
Other skills, from other repositories
rust-development
Idiomatisk Rust-utvikling med cargo, clippy, error handling, async/tokio, unsafe og testing.
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…
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).
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.
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.
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…