跳到正文
Skillpedia
写作48k · #4480

docs-guard

它能做什么

检查 AI 生成的文档是否正确,并与实际代码保持一致。它会确保文档中关于代码的所有描述,比如函数名和示例,都是准确的。

适用场景

  • ✓当 AI 写完 README 之后。
  • ✓当你在检查 API 文档时。
  • ✓在发布教程或指南之前。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/docs-guard/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/docs-guard/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请检查这份文档,确保所有代码示例都能运行,函数名也都正确。”

每周 5 个新技能,1 分钟读完。

工作原理

它会把文档中的内容与实际代码逐一对比。如果发现有不一致的地方,或者有无法验证的内容,它会指出错误。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Docs Guard

You are reviewing generated or changed documentation before it ships. Apply the rules below as a guard pass after the first documentation pass. The core principle: documentation is a set of claims about a codebase, and every claim is checkable. Your job is to check them.

These rules exist because AI agents document from memory of how APIs usually look, not from the code in front of them. Published research: half of AI answers to programming questions contain incorrect information, and models produce valid invocations for infrequent APIs barely a third of the time — yet the prose sounds authoritative either way. Readers cannot tell verified docs from hallucinated docs. You can, because you have the source.

When to Use

Use this skill when reviewing generated or changed documentation before it ships. Activate it reactively after an agent writes or updates READMEs, API references, docstrings, PHPDoc/JSDoc, changelogs, tutorials, or doc sites.

How to use this skill

Guard-pass mode (recommended): after documentation or docstrings have been generated or edited, verify every claim against the source and run the self-check before delivery.

Live mode (explicit): when the user invokes this skill before writing docs, verify before you write — read the actual implementation, then document what it does. Run the self-check before delivery.

Review mode (the user asks you to review, audit, or fact-check docs): walk references/review-checklist.md against the target docs and produce a findings report with file:line evidence. Do not rewrite in review mode unless asked.

Adapt to the project first

  1. Read the project's agent instructions (CLAUDE.md, AGENTS.md) and any docs style guide. Project conventions win on conflict.
  2. Identify the docs surfaces that must move together: README, reference docs, docstrings, changelog, examples, config samples. A change to one usually owes a change to others (Rule 6).
  3. Note the documented version policy: which versions does the project support, and where are features version-tagged?

The Rules

Accuracy — must fix

  1. Every referenced symbol must exist. Every function, method, class, hook, CLI command, flag, endpoint, config key, env var, and file path mentioned in the docs gets verified against the actual source, CLI help output, route table, or schema — by reading it, not recalling it. The verification procedure is in references/verification.md. An unverifiable reference does not ship.

  2. Every code sample must work. Imports resolve, APIs exist with the documented signatures (names, argument order, defaults, return shape), and the sample runs outside the author's machine — no hardcoded local paths, no real credentials, no implicit prior state. Sample rules: references/code-samples.md.

  3. Document the code's actual behavior, not its intended behavior. Read the implementation before describing it. Where code and comments/specs disagree, the code is the truth — and flag the disagreement to the user instead of silently picking a side.

  4. No unverifiable claims. Performance numbers, compatibility matrices, scale limits, and "production-ready" assertions require a source in the repository (benchmark script, CI matrix, changelog entry) or they come out. "Fast" is marketing; "O(n log n), benchmarked in bench/sort.md" is documentation.

Versioning and drift

  1. Versions are explicit. Features, flags, and behaviors state the version that introduced them when the project tracks versions. Prerequisites are pinned or ranged, never "latest". Deprecated items say so, with the replacement.

  2. A code change owes a docs change. When editing code whose behavior is documented — rename, signature change, new default, removed flag — update every doc surface that mentions it in the same change. Grep the docs for the old symbol before finishing.

Substance — should fix

  1. No filler, no slop. Delete: docstrings that paraphrase the signature ("Gets the user by ID" above get_user_by_id), sections that restate their heading, marketing adjectives in technical prose ("powerful", "seamless", "blazingly fast"), and intro padding ("In this section, we will explore…"). A docstring earns its place by adding contracts the signature cannot express: units, ranges, error conditions, side effects, threading/ordering guarantees.

…

常见问题

为什么 AI 会在文档中出错?

AI 有时会依据事物通常的样子来推测,而不是依据实际要记录的代码,因此可能出现错误。

文档中的“声明”(claims)是什么?

它指的是文档对代码所作的各种陈述,比如某个函数的作用、接受哪些参数,或者如何使用它。

什么是 Guard-pass 模式?

这是推荐使用的模式。文档写完后,AI 会再次审查,确保内容无误后才能发布。

详情

作者的原始描述

Review generated or changed documentation before it ships, including READMEs, API references, docstrings, changelogs, tutorials, and documentation sites.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4480
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能