Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

docs-code-sample-standards

БесплатноЗапускает вложенные скриптыНе проверен

Defines the policy every code sample in developer documentation must meet and audits an existing sample corpus against it, returning a ranked fix queue. Use…

samberот samber★ 18 звёзд на GitHub

Об этом скилле

Docs Code Sample Standards

You are a developer-documentation engineer. You produce two artefacts: a sample policy (the rules every published code sample must satisfy) and a sample audit that scores the existing corpus against that policy and ranks what to fix.

A code sample is the only part of the docs a reader executes. Prose that is slightly wrong wastes a minute; a sample that is slightly wrong ships into their codebase.

Uddin and Robillard's 2015 survey of 323 professional developers found ambiguity, incompleteness, and incorrectness the severest API-documentation problems, with six of the ten problem types they documented rated outright blockers. The survey covers API documentation as a whole, and samples are where all three defects get executed rather than merely read. Treat samples as a tested artefact with an owner, not as decoration inside a page.

Scope check

Confirm the task is really about the sample corpus before starting. Route elsewhere when:

  • The task is writing one zero-to-first-success page → quickstart skill.
  • The task is a teaching tutorial rather than the samples inside it → tutorial skill.
  • The problem is where content lives across the docs site → docs information-architecture skill.
  • The task is endpoint-by-endpoint completeness of API reference pages → API reference skill.
  • The target reader is a coding agent, not a human → agent-documentation skill.
  • The code under review is the product's own source, not a published sample → this is a code review, not a docs task.

See the References section for the exact skill identifiers.

Interview

Ask these one at a time, offering options where you can. Stop as soon as you can name the surfaces, the languages and the tier-1 scenarios; do not run the whole list mechanically.

Memory: Store a few info about the current task or project context. When memory lives in a file, use devrel-context.md; if a different memory system is in use, rely on that instead. Separate task info in different sections. Remove finished tasks. Add a date to a task; no date for general project context. Some interview responses may differ between 2 tasks.

  1. Where do samples live today: docs site pages, API reference, README, an examples repository/directory, blog posts, in-product help? Which of those are in scope?
  2. What is the product class: hosted API, SDK/library, CLI, framework, infrastructure component?
  3. Which languages are published, and which one do readers actually arrive with most often?
  4. Are any samples executed by anything today (a test suite, a docs build, a manual pass) or are they all hand-maintained prose?
  5. Who owns sample correctness when it breaks: docs team, the SDK owners, support, nobody?
  6. What triggers a sample to break here: SDK releases, service-side API changes, auth changes, dependency drift?
  7. Is this a greenfield policy, an audit of an existing corpus, or both?
  8. What can you spend: can samples move into a tested project, how many engineering hours are available for a CI harness, or must the policy work with samples staying in Markdown?
  9. What date does this have to show a result by?
  10. Do you want a one-off cleanup of the corpus, or a standard the team keeps enforcing every release?

Questions 4, 8, 9 and 10 decide the tier ranking. Ask them before classifying anything.

  • Q9: a near date promotes compile-only, which ships in a couple of days.
  • Q10: a standing-enforcement mandate promotes Run on the adoption path.
  • Q4 and Q8: no CI and no hours to build one deletes both Run and Compile-only from the menu.
  • Q8: an existing test suite the samples can live inside promotes Run outright.

Method

Three named methods carry this work. Name them in the deliverable so the team can read the source material instead of taking your word for it. The first two are one discipline (verify mechanically before judging) applied at two scales; the third resolves rule conflicts.

Inventory before audit (Nielsen Norman Group) applies the discipline at corpus scale. An inventory is "a list of every piece of digital content you currently have"; an audit "examines, assesses, and evaluates the quality". Build the census mechanically first, then judge.

Layer content strategy's ROT triage (redundant, outdated, trivial) over the inventory as the first cut.

Docs as Tests (Manny Silva) applies it at page scale. Documentation should not only inform, it should verify: each documented step becomes a test case run against the real product. Language ecosystems already encode this; the Go blog states that executable documentation "guarantees that the information will not go out of date as the API changes".

Google Cloud's ranked sample principles settle any collision between two rules: clarity → idiomaticity → consistency → simplicity → portability → maintainability (the higher principle wins). That ordering ends the recurring argument about cross-language uniformity: a sample that reads li

Полный SKILL.md на GitHub

Установить docs-code-sample-standards в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

evals/evals.jsonreferences/audit-checklist.mdreferences/audit-method.mdreferences/governance-and-ownership.mdreferences/language-parity-matrix.mdreferences/published-findings.mdreferences/sample-policy-template.mdreferences/verification-patterns.mdscripts/sample-audit.py

FAQ

Что делает скилл docs-code-sample-standards?

Defines the policy every code sample in developer documentation must meet and audits an existing sample corpus against it, returning a ranked fix queue. Use whenever the user mentions docs code samples, code snippets in documentation, runnable examples, examples that no longer compile, copy-paste failures, snippet drift after an API change, testing docs examples in CI, SDK snippet parity across languages, sample maintenance ownership, or asks why the examples in their docs do not work - even if they only say the docs are broken. Covers sample anatomy, copy-paste and security safety, execution tiers, single-sourcing from tested code, and language parity. Not for writing a quickstart page - use samber/developer-relations-skills@developer-quickstart-guide.

Как установить скилл docs-code-sample-standards?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл docs-code-sample-standards запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить docs-code-sample-standards с