Agent skill

API Doc Sync

by web-infra-dev in web-infra-dev/rstest

Verify hand-written API doc signatures match the exported types.

MITAuto-check passedDevelopment

Install API Doc Sync

skills CLI
$ npx skills add web-infra-dev/rstest --skill api-doc-sync -a claude-code

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

GitHub CLI
$ gh skill install web-infra-dev/rstest api-doc-sync --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/web-infra-dev/rstest.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/api-doc-sync .claude/skills/api-doc-sync && 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
api-doc-sync
GitHub stars
505
Token cost
~1.7k tokens
SKILL.md length
914 words
Files
2 (incl. scripts)
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Verify hand-written API doc signatures match the exported types.

  • Works in 4 steps: en/zh parity (deterministic — run the… → Source fidelity (per changed symbol —… → Fix drift at the doc layer → …
  • Tasks that involve Technical documentation
  • SKILL.md covers When to run, Procedure and Notes
  • Runs JavaScript scripts from its folder; calls pnpm, node and npx

What it does

API Doc Sync is an agent skill from web-infra-dev/rstest. Verify hand-written API doc signatures match the exported types. Use after changing a public type in packages/core/src/types/ or packages/core/src/api/types.ts, editing a Type:/类型: block in website/docs, or reviewing signature drift.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts.

It sits in Development, covering Technical documentation. The repository describes itself as: The JavaScript testing framework powered by Rspack. The licence is MIT.

When your agent uses it

  • Tasks that involve Technical documentation

Example prompts

  • “/api-doc-sync”

Requirements

  • Node.js

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. en/zh parity (deterministic — run the script first)
  2. Source fidelity (per changed symbol — let tsc judge)
  3. Fix drift at the doc layer
  4. Re-verify

What it can do on your machine

Read from SKILL.md and the folder at commit d56bf97. 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

    Ships 1 file in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • pnpm
    • node
    • npx

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

  • Network

    No URLs in SKILL.md. Its commands use pnpm and npx, which can reach the network depending on how they are called.

    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

API Doc Sync loads about 1.7k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 914 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from web-infra-dev/rstest at commit d56bf97, republished under its MIT licence (© web-infra-dev). 914 words, ~1,718 tokens.

Download SKILL.mdSave it as .claude/skills/api-doc-sync/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
api-doc-sync
description
Verify hand-written API doc signatures match the exported types. Use after changing a public type in packages/core/src/types/ or packages/core/src/api/types.ts, editing a `**Type:**`/`**类型:**` block in website/docs, or reviewing signature drift.
metadata.internal
true

API Doc Signature Sync

The **Type:** / **类型:** blocks in website/docs/{en,zh}/api/** are hand-written, curated copies of real exported types — there is no generation and no compiler check behind them, so they can be wrong the moment they are authored, not only when the type later changes. This skill catches both: it grounds every documented signature in the actual source type and the tsc oracle instead of trusting the prose.

Core rule — verify, never recall. Read the type from packages/core/src/types/*.ts or packages/core/src/api/types.ts (and, when built, the emitted .d.ts) and let tsc decide. Never judge a signature from memory or from the doc's own prose.

When to run

  • A public type in packages/core/src/types/ (e.g. api.ts, config.ts, mock.ts, runner.ts) or packages/core/src/api/types.ts changed.
  • A **Type:** / **类型:** block, or the prose describing a type's fields, was edited in website/docs/**/api/**.
  • Reviewing a PR that touches either side.

Scope: every page with a **Type:** block — api/runtime-api/** and api/javascript-api/**, both en and zh.

Procedure

1. en/zh parity (deterministic — run the script first)
bash
node .agents/skills/api-doc-sync/scripts/check-type-blocks.mjs

The en and zh pages must declare structurally identical signatures (only the label and translated // comments may differ). The script enforces this and exits non-zero on any mismatch, missing counterpart, or block-count difference. Fix every reported drift before moving on. Use --json for a machine-readable inventory of all blocks.

2. Source fidelity (per changed symbol — let tsc judge)

For each documented symbol whose page changed (or whose type changed):

  1. Find the source of truth. Locate the exported type in packages/core/src/types/ (start from types/index.ts re-exports) or packages/core/src/api/types.ts. Read its real shape: every overload, parameter order, optionality, generics, and union members. Prefer the built dist/**/*.d.ts when available — it is the exact surface users consume; build with pnpm --filter @rstest/core build if needed.

  2. Turn the doc into compile assertions. Write a throwaway .ts file inside the repo (e.g. the repo root or packages/core/, with a temp name like __doc-probe.ts) that imports the real type and exercises every call form the docs show as a positive case, plus a // @ts-expect-error for every form the docs say is invalid (e.g. "the options object cannot be the third argument"). It must live in the repo, not the external scratchpad: tsc resolves node_modules upward from the file's own directory, so only an in-workspace file can resolve @rstest/core. Run it, then delete it:

    bash
    npx tsc --noEmit --strict --skipLibCheck <scratch>.ts
    • A positive form that fails to compile → the docs show a call that does not exist. Drift.
    • An unused @ts-expect-error → a form the docs claim is rejected is actually accepted (or vice-versa). Drift.
  3. Check for under-documentation. Enumerate the overloads / fields that the source type actually has and confirm each is represented in the doc signature or prose. The bug this skill exists for was a missing overload (the (name, fn, timeout?) shorthand was dropped from the **Type:** line) — a positive-only check will not catch that, so explicitly diff the source's overload set against the documented one.

  4. Check field-level claims. When the prose lists option fields (timeout, retry, …), confirm each exists on the type with the stated optionality and meaning, and that no real field is omitted.

  5. Check entrypoint exports. For every named type in a **Type:** / **类型:** block, confirm it is exported from the package entrypoint that the page documents. A type that exists only in source or another entrypoint is not available to readers of that page.

  6. Check named-type linkability. A signature that names another type (TestContext, TestOptions, RstestUtilities, …) can be a bare, unlinked black box. For each named type a signature references, confirm the page either links it to its canonical definition or documents it inline. Only add a link when both hold:

    • (a) the type has a canonical anchor to point at — a real heading (### TestContext → #testcontext), not a loose bullet in a list (a bullet generates no anchor); and
    • (b) the type is foreign to the page — a data structure the reader must navigate elsewhere to understand, not a fluent/chaining return type that names the very object the current page documents.

    When both hold (e.g. TestContext at /api/runtime-api/test-api/test#testcontext), add a short prose link after the signature — do not re-inline the type's members, which creates a second copy that drifts. The link goes in an adjacent sentence, since a markdown link cannot live inside the backticked **Type:** code span.

    When either test fails, treat the type as already inline-documented and skip it — no link noise. RstestUtilities is the canonical skip: no heading anchor (only a bullet gloss in types.mdx), and => RstestUtilities is a fluent self-reference to the rs/rstest object these pages already document.

Show full SKILL.md (164 more words)Show less
3. Fix drift at the doc layer

Apply fixes to the .mdx directly. For each fix:

  • Update both en and zh; keep the signature blocks structurally identical (re-run the script in step 1 to confirm).
  • Preserve the curated style — friendly names like TestOptions, omitted internal generics (ExtraContext) — as long as the omission is a faithful simplification, not a missing overload or wrong arg order.
  • When a brand-new API/field is documented, set <ApiMeta addedVersion="…" /> per the convention in website/AGENTS.md.
4. Re-verify

Re-run step 1 (parity) and step 2 (compile assertions) until both are clean, then pnpm prettier --check the touched .mdx files.

Notes

  • The parity script is safe to wire into CI / pre-push as a hard gate — it is fully deterministic. The source-fidelity pass (step 2) is the judgement half and runs here, on demand.
  • This skill does not generate signatures from source. Generation would make drift impossible but discards the curated/simplified style the docs use on purpose; that trade-off is intentionally out of scope.

© web-infra-dev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in .agents/skills/api-doc-sync of web-infra-dev/rstest.

  • SKILL.md
  • scripts/check-type-blocks.mjs

Open the folder on GitHubat commit d56bf97

Compare with similar skills

API Doc Sync 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.

API Doc Sync compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
API Doc Sync this skillweb-infra-dev/rstest505—~1.7kAutomated safety check: PassMIT
Diagram Designcathrynlavery/diagram-design44k1 repos~7.5kAutomated safety check: PassMIT
Simple Englishmoeru-ai/airi50k2 repos~4.6kAutomated safety check: PassMIT
Get API Docs with chubandrewyng/context-hub14k2 repos~775Automated safety check: PassMIT
Doc SyncJetBrains/ideavim10k2 repos~2.6kAutomated safety check: PassMIT
Mailspring App ScreenshotsFoundry376/Mailspring18k—~1.4kAutomated safety check: PassGPL-3.0

Similar skills

  • Diagram Design

    cathrynlavery/diagram-design

    Creates branded diagrams, from architecture, flowchart and sequence to charts and maps, as self-contained HTML with inline SVG, with import from draw.io, Mermaid and Excalidraw.

    44k GitHub starsUsed in 1 repo~7.5k tokens
    DevelopmentAuto-check passed
  • Simple English

    moeru-ai/airi

    Write or rewrite technical text with the rules of ASD-STE100 Simplified Technical English so it is clear, unambiguous, and free of AI slop.

    50k GitHub starsUsed in 2 repos~4.6k tokens
    DevelopmentAuto-check passed
  • Get API Docs with chub

    andrewyng/context-hub

    Fetches current documentation for third-party APIs and SDKs with the chub CLI before the agent writes code against them, instead of relying on remembered API shapes.

    14k GitHub starsUsed in 2 repos~775 tokens
    DevelopmentAuto-check passed
  • Doc Sync

    JetBrains/ideavim

    Official

    Keeps IdeaVim documentation in sync with code changes. An agent skill from JetBrains/ideavim.

    10k GitHub starsUsed in 2 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Mailspring App Screenshots

    Foundry376/Mailspring

    Captures screenshots of the running Mailspring dev app for docs, PRs or visual checks by launching it with a debugging port, driving the UI and clipping to an element.

    18k GitHub stars~1.4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Draw.io Diagram Studio

    Agents365-ai/drawio-skill

    Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.

    10k GitHub stars~2.4k tokensUpdated 5 days ago
    DevelopmentAuto-check: notes

More from web-infra-dev/rstest

All 9 skills in this repo
  • Create Draft Release Notes

    web-infra-dev/rstest

    Create or update draft GitHub release notes, or output organized Markdown when draft creation is unavailable.

    505 GitHub stars~2.3k tokensUpdated 7 days ago
    Auto-check passed
  • Create Release Blog

    web-infra-dev/rstest

    Generate a narrative version release blog post from commits within a tag range.

    505 GitHub stars~4.7k tokensUpdated 7 days ago
    Auto-check passed
  • Testing

    web-infra-dev/rstest

    Testing workflow for the Rstest monorepo. An agent skill from web-infra-dev/rstest.

    505 GitHub stars~2.1k tokensUpdated 7 days ago
    Auto-check passed
  • Typescript

    web-infra-dev/rstest

    TypeScript anti-slop guardrails. An agent skill from web-infra-dev/rstest.

    505 GitHub stars~1.3k tokensUpdated 7 days ago
    Auto-check passed
  • Development

    web-infra-dev/rstest

    Feature and bug-fix development checklist for the Rstest monorepo.

    505 GitHub stars~2.8k tokensUpdated 7 days ago
    Auto-check passed
  • PR Creator

    web-infra-dev/rstest

    Create a pull request using repository branch rules, title conventions, templates, and concise English descriptions.

    505 GitHub stars~560 tokensUpdated 7 days ago
    Auto-check passed

Categories

Questions about API Doc Sync

What does API Doc Sync do?

Verify hand-written API doc signatures match the exported types. API Doc Sync is an agent skill from web-infra-dev/rstest. Verify hand-written API doc signatures match the exported types.

When should I use API Doc Sync?

API Doc Sync fits situations like: tasks that involve Technical documentation.

How do I install API Doc Sync in Claude Code?

Run `npx skills add web-infra-dev/rstest --skill api-doc-sync -a claude-code`. Or copy the skill folder (.agents/skills/api-doc-sync in web-infra-dev/rstest) into .claude/skills/api-doc-sync in your project. Claude Code loads it when a task matches its description.

How do I install API Doc Sync in Codex?

Run `npx skills add web-infra-dev/rstest --skill api-doc-sync -a codex`. Or copy the skill folder (.agents/skills/api-doc-sync in web-infra-dev/rstest) into .agents/skills/api-doc-sync in your project. Codex loads it when a task matches its description.

Can I use API Doc Sync 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 web-infra-dev/rstest --skill api-doc-sync -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-doc-sync, .gemini/skills/api-doc-sync, .github/skills/api-doc-sync and .opencode/skills/api-doc-sync in your project.

What does API Doc Sync need to run?

Going by SKILL.md and its folder, API Doc Sync needs JavaScript for the scripts in its folder and the command-line tools its instructions call (pnpm, node and npx). Our summary lists: Node.js.

Does API Doc Sync access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is API Doc Sync 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does API Doc Sync use?

API Doc Sync is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does API Doc Sync use?

About 1.7k tokens (SKILL.md is roughly 6.9k 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 API Doc Sync?

Skills that share tags, products or a category with API Doc Sync: Diagram Design (cathrynlavery/diagram-design, 44k stars), Simple English (moeru-ai/airi, 50k stars), Get API Docs with chub (andrewyng/context-hub, 14k stars) and Doc Sync (JetBrains/ideavim, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains API Doc Sync?

web-infra-dev (a GitHub organization) maintains it in web-infra-dev/rstest, which has 505 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on September 30, 2026.

Source: web-infra-dev/rstest on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.