technical-documentation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Technical Documentation

技术文档

Audit, write, and improve developer documentation the way Google's technical writers do: start from the reader's task, verify every fact against the code, then apply the style guide in severity order — structure before voice, voice before word choice.
按照谷歌技术文档作者的方式审核、编写和优化开发者文档:从读者的任务出发,对照代码验证所有事实,然后按优先级应用风格指南——结构优先于语气,语气优先于措辞。

Core Principle

核心原则

Write for the reader's task, not the product's feature list. Google's guide asks for prose that is conversational but not frivolous, precise, and consistent, because a developer reading docs is trying to get something done, not to admire the product. Two framing rules from the guide shape everything below:
  • Guidelines, not rules. Depart from the guide when doing so improves the content — established domain terminology wins — but stay consistent within the document.
  • Precedence. A project's own style guide comes first, then Google's guide, then Merriam-Webster (spelling), the Chicago Manual of Style (general style), and the Microsoft Writing Style Guide (technical style).
Rules come in two layers. Structural and content rules (headings, procedures, code samples, second person, active voice, timeless docs, accessibility) apply to documentation in any language. Rules tagged
[EN]
(spelling, serial comma, contractions, the word list) apply only to English text — skip them for other languages, and never translate a document unless asked.
为读者的任务而写,而非产品的功能列表。 谷歌指南要求文案既要口语化又不失严谨,精准且一致,因为阅读文档的开发者是为了完成某项工作,而非欣赏产品。指南中的两条框架规则决定了以下所有内容:
  • 指南而非硬性规则:当偏离指南能提升内容质量时,可以灵活调整——已确立的领域术语优先——但文档内部需保持一致。
  • 优先级顺序:项目自身的风格指南优先,其次是谷歌指南,然后是《韦氏词典》(拼写规则)、《芝加哥手册》(通用风格)和《微软写作风格指南》(技术风格)。
规则分为两层。结构和内容规则(标题、步骤、代码示例、第二人称、主动语态、永久有效文档、无障碍性)适用于任何语言的文档。标记为
[EN]
的规则(拼写、牛津逗号、缩写形式、词汇表)仅适用于英文文本——其他语言可跳过,且除非明确要求,否则不要翻译文档。

Scoring

评分标准

Goal: 10/10. Score = number of Quick Diagnostic rows passed (10 rows, 1 point each; the
[EN]
row auto-passes for non-English docs). Bands: 9-10 = ships as is; 7-8 = word- and voice-level edits only; 5-6 = restructure sections, then re-edit; ≤4 = rewrite from the doc-type skeleton. Blocking findings — wrong or unverifiable facts, a procedure that can't be completed, information that exists only in an image or in an image without alt text — are a separate gate: the doc is not shippable at any score until they're fixed. Report the score, the failed rows, and the exact edits that reach 10/10.
目标:10/10。评分=通过快速诊断项的数量(共10项,每项1分;非英文文档的
[EN]
项自动通过)。评分区间:9-10分 = 可直接发布;7-8分 = 仅需进行措辞和语气层面的编辑;5-6分 = 先重构章节,再重新编辑;≤4分 = 基于文档类型框架重写。阻断性问题——错误或无法验证的事实、无法完成的步骤、仅存在于图片中或无替代文本的图片信息——是单独的审核门槛:无论评分多少,此类问题修复前文档不可发布。需报告评分、未通过项以及能达到10/10分的具体修改内容。

Framework

框架

1. Know the Reader and the Document's Job

1. 明确读者与文档的用途

Core concept: Every page serves one reader with one task. Name both before writing a word — audience and level, what they'll be able to do afterwards — and pick the document type that fits: tutorial (learn by doing), how-to (accomplish a task), concept (understand), reference (look up), README (orient and start).
Why it works: Readers scan for their task; a page that mixes concept, procedure, and reference forces them to read everything to find anything.
Key insights:
  • Google's Technical Writing course opens a doc with an audience statement and a scope plus non-scope statement — the non-scope rescues readers who are on the wrong page
  • "Before you begin" lists prerequisites before step 1, not inside step 4 (convention)
  • Key points first: the intro states what the reader gets, not the product's history
  • Every procedural page ends with verification ("Confirm that…") and "What's next" (convention)
Applications:
ContextApplicationExample
READMEOrient: what it is, who it's for, three-step start, links outPurpose → install → first run → docs map
Mixed pageSplit concept from procedure into linked pages"How OAuth works" + "Configure OAuth"
Tutorial vs how-toTutorial teaches one path end to end; how-to assumes context"Build your first plugin" vs "Add a hook"
See references/document-types.md when choosing or restructuring a doc type — skeletons for README, getting started, tutorial, how-to, and concept pages, the audience and scope statements, and the self-editing pass for large doc sets.
核心概念:每个页面只为一类读者完成一项任务服务。动笔前需明确读者群体、水平,以及他们阅读后能完成的事情——同时选择匹配的文档类型:教程(边做边学)、操作指南(完成任务)、概念文档(理解原理)、参考文档(查阅信息)、README(快速了解并上手)。
设计原理:读者会围绕自身任务浏览内容;混合了概念、步骤和参考信息的页面会迫使读者通读全文才能找到所需内容。
关键要点
  • 谷歌技术写作课程要求文档开篇包含受众说明、范围及非范围声明——非范围声明能帮助进错页面的读者及时退出
  • 「开始之前」列表需在步骤1之前列出前置条件,而非步骤4中(通用规范)
  • 重点前置:引言需说明读者能获得什么,而非产品的历史
  • 每个操作类页面结尾需包含验证步骤(「确认……」)和「下一步」(通用规范)
应用场景
场景应用方式示例
README快速介绍:用途→安装→首次运行→文档导航用途 → 安装 → 首次运行 → 文档地图
混合内容页面将概念与步骤拆分到不同页面并添加链接「OAuth工作原理」 + 「配置OAuth」
教程 vs 操作指南教程全程教授一条完整路径;操作指南假设读者已有相关背景「构建你的第一个插件」 vs 「添加钩子」
选择或重构文档类型时,请参考references/document-types.md——包含README、入门指南、教程、操作指南、概念页面的框架模板,受众和范围声明模板,以及大型文档集的自我编辑流程。

2. Voice: You, Active, Present, Timeless

2. 语气:第二人称、主动语态、现在时态、永久有效

Core concept: Address the reader as "you", make the actor of every sentence explicit, describe behavior in the present tense, and write as if the page will be read in five years.
Key insights:
  • "We" hides who acts; "the user" turns the reader into a third party — both weaken an instruction
  • Passive voice is allowed only when the actor is unknown or irrelevant ("The file is encrypted at rest")
  • "Will" belongs only to genuinely later effects: "The server sends an ack", not "will send"
  • Contractions are fine — Google prefers "isn't" over "is not" for negations
    [EN]
  • Software doesn't want, see, or think: "The API detects", not "the API sees"
  • No "please" (reserve it for asking permission), no "simply / easily / just", no superlatives — if a step is easy, the reader will notice
  • Timeless: cut "currently", "new", and "soon"; never pre-announce unreleased features
Before → after:
  • "Please note that the new dashboard will simply be shown once the user has logged in." → "After you sign in, the dashboard appears."
  • "We recommend that the token is refreshed by the client." → "Refresh the token from the client."
See references/voice-and-words.md when a doc's tone is off or inconsistent — the voice rules with the guide's exact exceptions, inclusive and global-audience language, and the full word list.
核心概念:用「你」称呼读者,明确每个句子的主语,用现在时态描述行为,撰写时假设页面会在五年后被阅读。
关键要点
  • 「我们」会隐藏动作执行者;「用户」会将读者置于第三方视角——两者都会削弱指令的有效性
  • 仅当动作执行者未知或无关时才使用被动语态(例如:「文件在静止状态下已加密」)
  • 「will」仅用于描述真正的后续影响:「服务器发送确认消息」,而非「will send」
  • 允许使用缩写形式——谷歌更倾向于用「isn't」而非「is not」表示否定
    [EN]
  • 软件不会「想要」「看见」或「思考」:应该写「API检测到」,而非「API看见」
  • 不要使用「请」(仅用于请求许可),不要使用「简单地/轻松地/只需」,不要使用最高级——如果步骤真的简单,读者自然会注意到
  • 永久有效:删除「当前」「新」「即将」等词汇;绝不要提前宣布未发布的功能
修改示例
  • 「请注意,用户登录后新仪表盘将简单显示出来。」 → 「登录后,仪表盘会显示出来。」
  • 「我们建议客户端刷新令牌。」 → 「从客户端刷新令牌。」
文档语气不当或不一致时,请参考references/voice-and-words.md——包含指南中的语气规则及例外情况、包容性和面向全球受众的语言规范,以及完整词汇表。

3. Sentences and Words

3. 句子与措辞

Core concept: Put the condition before the instruction, keep one idea per sentence, and choose the plain word the guide's word list prefers.
Key insights:
  • "To delete the document, click Delete" — readers decide whether a step applies before they act, not after
  • Spell out an abbreviation on first use with the short form in parentheses; skip only universally known ones (URL, HTML)
  • Latin abbreviations translate and scan poorly: "for example", not "e.g."; "that is", not "i.e."; omit "etc." or finish the list
    [EN]
  • "can" = ability, "may" = permission, "might" = possibility
    [EN]
  • Word list samples
    [EN]
    : sign in (not log in) · set up as a verb · lets you (not allows you to) · through or by using (not via) · after (not once) · use (not leverage or utilize) · checkbox · email
  • Jargon is fine for the stated reader and a defect for anyone else — define it or link it
Before → after:
  • "Click Save in order to persist the settings once you are done, i.e. when all fields are filled." → "After you fill in all fields, click Save."
  • "The CLI utilizes the GCP SDK (e.g. for auth)." → "The CLI uses the Google Cloud SDK, for example for authentication."
See references/voice-and-words.md when auditing word choice — the word list table (avoid → use → why), abbreviation rules, and modal verbs.
核心概念:条件前置,一句一义,选择指南词汇表推荐的简洁词汇。
关键要点
  • 「要删除文档,请点击删除」——读者会先判断步骤是否适用,再执行操作,而非反之
  • 缩写首次出现时需拼写完整并在括号内标注缩写形式;仅无需解释的通用缩写可跳过(如URL、HTML)
  • 拉丁缩写翻译和可读性差:用「例如」而非「e.g.」;用「即」而非「i.e.」;避免使用「etc.」或完整列出所有项
    [EN]
  • 「can」表示能力,「may」表示许可,「might」表示可能性
    [EN]
  • 词汇表示例
    [EN]
    :sign in(而非log in)· set up作为动词使用 · lets you(而非allows you to)· through或by using(而非via)· after(而非once)· use(而非leverage或utilize)· checkbox · email
  • 针对目标读者的行话是可接受的,但对其他读者而言是缺陷——需定义或添加链接解释
修改示例
  • 「完成后,即所有字段填写完毕时,请点击保存以持久化设置。」 → 「填写完所有字段后,点击保存。」
  • 「CLI利用GCP SDK(例如用于认证)。」 → 「CLI使用Google Cloud SDK,例如用于认证。」
审核措辞时,请参考references/voice-and-words.md——包含词汇表对照表(避免使用→推荐使用→原因)、缩写规则和情态动词规范。

4. Structure: Headings, Lists, Tables, Notices

4. 结构:标题、列表、表格、提示信息

Core concept: Structure is the reader's map. Headings in sentence case read as a table of contents; lists carry parallel items introduced by a full sentence; tables have header rows; notices are rare and mean something.
Key insights:
  • Task headings are bare imperatives ("Create an instance"); concept headings are noun phrases ("Instance lifecycle"); no "-ing" headings
  • A list needs an introductory sentence ending in a colon, and every item in the same grammatical form; numbered only when order matters
  • Description lists (term → definition) beat two-column tables for paired data
  • Tables: header row, an intro sentence, no merged or empty cells — screen readers depend on it
  • Note = useful but optional; Caution = proceed carefully; Warning = harm or irreversible loss. Don't stack them; one per section is a practical ceiling (inferred)
  • Cross-references say "see", never "above" or "below" — pages reflow and get translated
  • Link text names the target ("see Configure a custom domain"), never "click here"
  • Alt text states the image's purpose; information must never live only in a picture
Applications:
ContextApplicationExample
Wall-of-text pageInsert a task heading wherever the task changes"Install", "Configure", "Verify"
Three stacked notesFold two into body text; keep the one that changes behaviorOne Caution about data loss
Options tableHeader row + intro sentence + parallel cell phrasing"The following flags control output:"
See references/structure-and-formatting.md when fixing page structure — heading, list, table, notice, cross-reference, link-text, image, number, and date rules with before/after pairs.
核心概念:结构是读者的导航图。句子格式的标题可作为目录;列表需由完整句子引出,且所有条目语法形式一致;表格需包含表头;提示信息应少用且具有明确意义。
关键要点
  • 任务类标题为祈使句(如「创建实例」);概念类标题为名词短语(如「实例生命周期」);不要使用「-ing」形式的标题
  • 列表需要以冒号结尾的引导句,且所有条目语法形式一致;仅当顺序重要时使用编号
  • 描述列表(术语→定义)比两列表格更适合成对数据
  • 表格:需包含表头、引导句,不要有合并单元格或空单元格——屏幕阅读器依赖这些结构
  • Note = 有用但可选;Caution = 需谨慎操作;Warning = 可能造成损害或不可逆损失。不要堆叠提示信息;每个章节最多使用一个(通用规范)
  • 交叉引用使用「请参见」,绝不要使用「上文」或「下文」——页面会重新排版或被翻译
  • 链接文本需明确指向目标(如「请参见配置自定义域名」),绝不要使用「点击此处」
  • 替代文本需说明图片的用途;信息绝不能仅存在于图片中
应用场景
场景应用方式示例
大段文本页面每次任务切换时添加任务类标题「安装」「配置」「验证」
三个堆叠的提示信息将其中两个融入正文;保留会改变操作行为的那个保留一个关于数据丢失的Caution
选项表格表头 + 引导句 + 格式一致的单元格内容「以下标志控制输出:」
修复页面结构时,请参考references/structure-and-formatting.md——包含标题、列表、表格、提示信息、交叉引用、链接文本、图片、数字和日期规则及修改示例。

5. Procedures and Code

5. 步骤与代码

Core concept: A procedure is a numbered list of single imperative actions, each stating where to act and what to expect. Code is set in code font, introduced by a sentence ending in a colon, and uses placeholders the reader can't mistake for literals.
Key insights:
  • One action per step; "Optional:" prefix for optional steps; a single step is a bullet, not "1."
  • Sub-steps run a, b, c; document the shortest path, not every alternative
  • UI element names in bold, matching on-screen casing; click for a mouse, tap for touch, select when device-agnostic
  • Code font for filenames, paths, commands, flags, parameters, and values — not for product names
  • Placeholders are
    ALL_CAPS_WITH_UNDERSCORES
    , never
    <your-key>
    or
    YOUR_API_KEY
    , and are explained right after the sample ("Replace
    PROJECT_ID
    with…")
  • Command syntax:
    [optional]
    ,
    {a|b}
    for exclusive choices,
    ...
    for repeatable arguments
  • Samples are runnable, minimal, wrapped at 80 characters, and show the expected output
Before → after:
  • "Run the command below with your key:
    shipit deploy --key=<your-key>
    " → "To deploy, run the following command:" → fenced
    shipit deploy --key=API_KEY
    → "Replace
    API_KEY
    with the key from the Settings page."
  • "1. You should now click on the Deploy button to deploy." → "1. Click Deploy. The status changes to Deploying."
See references/procedures-and-code.md when writing steps or samples — the full procedure rules, UI-element and device verbs, code-in-text, placeholder, command-line syntax, and the sample-code quality checklist.
核心概念:操作步骤是一系列编号的祈使句动作,每个步骤需说明操作位置和预期结果。代码需使用代码字体,以冒号结尾的句子引出,并使用读者不会误认为字面内容的占位符。
关键要点
  • 每个步骤对应一个动作;可选步骤前缀为「Optional:」;单个步骤使用项目符号,而非「1.」
  • 子步骤使用a、b、c编号;记录最短路径,而非所有替代方案
  • UI元素名称使用粗体,与屏幕显示大小写一致;鼠标操作使用「点击」,触屏操作使用「轻触」,设备无关时使用「选择」
  • 文件名、路径、命令、标志、参数和值使用代码字体——产品名称除外
  • 占位符使用
    ALL_CAPS_WITH_UNDERSCORES
    格式,绝不要使用
    <your-key>
    YOUR_API_KEY
    ,并在示例后立即说明(「将
    PROJECT_ID
    替换为……」)
  • 命令语法:
    [optional]
    表示可选,
    {a|b}
    表示互斥选项,
    ...
    表示可重复参数
  • 示例代码需可运行、精简、每行不超过80字符,并显示预期输出
修改示例
  • 「使用你的密钥运行以下命令:
    shipit deploy --key=<your-key>
    」 → 「要部署,请运行以下命令:」 → 围栏代码块
    shipit deploy --key=API_KEY
    → 「将
    API_KEY
    替换为设置页面中的密钥。」
  • 「1. 你现在应该点击部署按钮进行部署。」 → 「1. 点击部署。状态将变为部署中。」
编写步骤或示例代码时,请参考references/procedures-and-code.md——包含完整的步骤规则、UI元素和设备动词规范、文本内代码格式、占位符规则、命令行语法,以及示例代码质量检查表。

6. Reference Docs: API, Docstrings, CLI Help

6. 参考文档:API、文档字符串、CLI帮助

Core concept: Reference text is descriptive, complete, and formulaic on purpose — readers look things up, so every entry must exist and read the same way.
Key insights:
  • Document every public class, method, field, constant, and enum value; a missing entry reads as "unsupported"
  • Open method descriptions with the category verb: "Gets the…", "Sets the…", "Checks whether…", "Creates a…", "Returns…" — never "This method…"
  • Non-boolean parameters start "The…" or "A…"; booleans read "If true, … If false, …" (action) or "True if …; false otherwise" (state)
  • Document return values and exceptions ("Thrown when…") for every method that has them
  • A deprecated element names its replacement in the first sentence
  • CLI
    --help
    (convention — Google has no
    --help
    page): usage line in
    [optional]
    syntax, one-line synopsis, every flag described with the same placeholder style
Before → after:
  • "This method is used for getting the customer." → "Gets the customer for the given
    customerId
    . Throws
    NotFoundError
    when no customer exists."
  • "@param force - force flag" → "@param force If true, deletes the bucket even if it contains objects. If false, fails when the bucket isn't empty."
See references/api-reference.md when writing or auditing reference material — the verb-by-category table, parameter, return, and exception patterns, one complete JSDoc example, and CLI help conventions.
核心概念:参考文本需描述性、完整性和公式化——读者是来查阅信息的,因此每个条目必须存在且格式一致。
关键要点
  • 需记录所有公开类、方法、字段、常量和枚举值;缺失的条目会被视为「不支持」
  • 方法描述以分类动词开头:「获取……」「设置……」「检查是否……」「创建……」「返回……」——绝不要以「此方法……」开头
  • 非布尔参数以「The…」或「A…」开头;布尔参数描述为「如果为true,……如果为false,……」(动作)或「true表示……;否则为false」(状态)
  • 需记录每个方法的返回值和异常(「当……时抛出」)
  • 已废弃元素需在第一句中说明替代方案
  • CLI的
    --help
    (通用规范——谷歌无专门的
    --help
    页面):使用
    [optional]
    语法的使用行、一行简介、每个标志使用相同格式的占位符描述
修改示例
  • 「此方法用于获取客户。」 → 「根据给定的
    customerId
    获取客户。当不存在该客户时抛出
    NotFoundError
    。」
  • 「@param force - 强制标志」 → 「@param force 如果为true,即使存储桶包含对象也会删除。如果为false,存储桶非空时操作失败。」
编写或审核参考材料时,请参考references/api-reference.md——包含分类动词表、参数、返回值和异常模式、完整的JSDoc示例,以及CLI帮助规范。

7. Release Notes, Changelogs, Migration Guides

7. 发布说明、变更日志、迁移指南

Core concept: A changelog is documentation for the reader who is about to upgrade. Each entry states what changed, what it means for them, and what to do — in the structure of Keep a Changelog, in the voice of the rest of the docs.
Key insights:
  • Newest version first, an
    Unreleased
    section on top, ISO dates in version headings, version headings linked to diffs (Keep a Changelog)
  • Group entries under Added / Changed / Deprecated / Removed / Fixed / Security; never paste commit messages
  • Breaking changes go first in the version, with a link to migration steps (convention)
  • A deprecation entry names the replacement and the removal version or date
  • A migration guide is a procedure: "Before you begin" (versions, backups), numbered steps with before/after snippets, "Verify the migration", rollback
  • Apply the Google layer to every entry: second person for actions, no "currently/new", code font for flags and APIs, one tense used consistently
Before → after:
  • "Various improvements to the auth module (#412)" → "Changed:
    login()
    now returns a
    Session
    instead of a token string. Update callers that read
    .token
    — see Migrate to sessions."
See references/release-notes.md when writing release notes or a migration guide — the Keep a Changelog skeleton, entry patterns per category, deprecation wording, and the migration-guide procedure.
核心概念:变更日志是为即将升级的读者准备的文档。每个条目需说明变更内容、对读者的影响以及需执行的操作——遵循Keep a Changelog的结构,使用与其他文档一致的语气。
关键要点
  • 最新版本在前,顶部保留
    Unreleased
    章节,版本标题使用ISO日期,版本标题链接到差异对比(Keep a Changelog规范)
  • 条目按Added / Changed / Deprecated / Removed / Fixed / Security分组;绝不要直接粘贴提交信息
  • 破坏性变更需放在版本开头,并链接到迁移步骤(通用规范)
  • 废弃条目需说明替代方案和移除版本或日期
  • 迁移指南是操作步骤:「开始之前」(版本、备份)、带前后代码片段的编号步骤、「验证迁移」、回滚步骤
  • 每个条目需应用谷歌风格:操作使用第二人称,不使用「当前/新」,标志和API使用代码字体,时态保持一致
修改示例
  • 「认证模块的多项改进(#412)」 → 「变更:
    login()
    现在返回
    Session
    而非令牌字符串。请更新读取
    .token
    的调用方——参见迁移到会话。」
编写发布说明或迁移指南时,请参考references/release-notes.md——包含Keep a Changelog框架、各分类条目模板、废弃措辞规范,以及迁移指南步骤模板。

8. Running the Audit, Rewrite, or Write

8. 执行审核、重写或编写任务

Core concept: Three modes, one discipline: intake → local conventions → read as the reader → verify facts → apply rules by severity → output in a fixed shape.
Protocol:
  1. Intake. Confirm the mode (audit, improve, or write), document type, reader and level, and language. For write, the reader's task and the fact sources (code paths, existing docs) are required — don't start without them.
  2. Local style guide. Look for
    CONTRIBUTING.md
    ,
    STYLE.md
    ,
    docs/style-guide.md
    ,
    .vale.ini
    , and the conventions existing docs already follow (for example, "log in" everywhere). They win over Google. Vale with the
    Google
    package automates the
    [EN]
    word and punctuation layer if the project wants a linter.
  3. Read
    references/audit-checklist.md
    before any audit or improve pass — the rule IDs cited in findings live there; never cite an ID you haven't read.
  4. Read the doc cold as the target reader, then check every command, flag, parameter, and behavior against the code before judging style. A stylish wrong doc is worse than an ugly right one.
  5. Apply rules in severity order: Blocking → High (structure, accessibility, missing reference entries) → Medium (voice, notices, intro sentences) → Low (word list, punctuation
    [EN]
    ).
  6. Output. A finding's location is one the reader can find: the heading path, plus the line number when auditing a file. Improve = a one-line
    Score before → after
    , the full rewritten document, then a
    ## Change log
    table (Change | Rule ID + name | Why). Facts stay untouched — a fact stated in the source document counts as received from the user, so keep it (with
    TODO(verify): …
    when no code confirms it) rather than deleting it. Write = the document, with
    TODO(verify)
    for every gap. Never include a command, flag, or parameter you didn't see in code or receive from the user.
ALWAYS output audits in this format:
undefined
核心概念:三种模式,同一准则:接收需求 → 遵循本地规范 → 以读者视角阅读 → 验证事实 → 按优先级应用规则 → 输出固定格式内容。
流程
  1. 接收需求:确认模式(审核、优化或编写)、文档类型、读者群体及水平、语言。对于「编写」任务,必须明确读者的任务和事实来源(代码路径、现有文档)——否则不要开始。
  2. 本地风格指南:查找
    CONTRIBUTING.md
    STYLE.md
    docs/style-guide.md
    .vale.ini
    ,以及现有文档已遵循的规范(例如:统一使用「log in」)。本地规范优先于谷歌指南。如果项目需要代码检查工具,可使用带有
    Google
    包的Vale自动处理
    [EN]
    层面的词汇和标点规则。
  3. 阅读
    references/audit-checklist.md
    :执行任何审核或优化任务前需阅读该文档——问题中引用的规则ID均来自此处;绝不要引用未阅读过的规则ID。
  4. 以目标读者视角通读文档:然后对照代码检查每个命令、标志、参数和行为,再评判风格。美观但错误的文档比丑陋但正确的文档更糟糕。
  5. 按优先级应用规则:阻断性问题 → 高优先级(结构、无障碍性、缺失的参考条目) → 中优先级(语气、提示信息、引导句) → 低优先级(词汇表、标点
    [EN]
    )。
  6. 输出内容:问题的位置需让读者能找到:标题路径,审核文件时需添加行号。优化任务需输出一行
    修改前评分 → 修改后评分
    、完整的重写文档,然后是
    ## 修改日志
    表格(修改内容 | 规则ID+名称 | 原因)。事实内容保持不变——源文档中的事实视为来自用户,因此需保留(当无法通过代码验证时标注
    TODO(verify): …
    ),而非删除。编写任务需输出文档,并为每个信息缺口标注
    TODO(verify)
    。绝不要包含未在代码中看到或未从用户处获取的命令、标志或参数。
审核任务必须按以下格式输出:
undefined

Documentation Audit: [path or title]

文档审核:[路径或标题]

Score: X/10 — [band] Shippable: yes | no (blocking findings below) Diagnostic: N/10 — failed rows: [row numbers + one-line reason each] Doc type / reader: [type] for [audience, level] Language: [en | xx — [EN] rules skipped] Local style guide: [file found and honored | none — Google applies] Blocking: [wrong/unverifiable facts, unfollowable steps, image-only information — or "none"] Findings: | # | Location | Rule (ID + name) | Before | After | Severity | Rewrite plan: [ordered: structure → voice → words; what to do first to reach 10/10]

See [references/audit-checklist.md](references/audit-checklist.md) when running any audit or rewrite — the full rule table with IDs and severities, the severity rubric, non-English handling, a Vale configuration, and a worked mini-audit.
评分: X/10 — [评分区间] 可发布: 是 | 否(下方为阻断性问题) 诊断结果: N/10 — 未通过项:[项编号 + 一行原因] 文档类型 / 读者: [类型] 面向 [受众, 水平] 语言: [en | xx — 已跳过[EN]规则] 本地风格指南: [已找到并遵循 | 无 — 应用谷歌指南] 阻断性问题: [错误/无法验证的事实、无法执行的步骤、仅图片存在的信息 — 或「无」] 问题列表: | # | 位置 | 规则(ID+名称) | 修改前 | 修改后 | 优先级 | 重写计划: [按顺序:结构 → 语气 → 措辞;首次需完成的任务以达到10/10分]

执行任何审核或重写任务时,请参考[references/audit-checklist.md](references/audit-checklist.md)——包含带ID和优先级的完整规则表、优先级标准、非英文文档处理方式、Vale配置,以及一个完整的小型审核示例。

Common Mistakes

常见错误

MistakeWhy It FailsFix
Organizing by feature instead of reader taskReaders hunt across sections for one workflowName the reader's task; pick the doc type; one task per page
Fixing style before verifying factsPolished wrong instructions are trusted longerCheck every command and parameter against code first
"Click here" and "see below"Meaningless out of context, to screen readers, and after reflowLink text names the target; cross-refs say "see"
Steps buried in paragraphs, passive and future tenseReader can't tell who does what, or in what orderNumbered imperative steps, condition first, present tense
Stacked Note/Warning boxesEverything shouted, nothing heardOne notice per section; the rest becomes body text
<your-key>
or
YOUR_API_KEY
placeholders
Reader types the brackets or reads the prefix as a literal
API_KEY
in caps, explained after the sample
Rewriting the meaning while "fixing style"Reviewer approves prose, ships wrong behaviorFacts unchanged; unknowns become
TODO(verify)
错误问题原因修复方案
按功能而非读者任务组织内容读者需跨章节查找单个工作流明确读者的任务;选择匹配的文档类型;每个页面对应一个任务
先修复风格再验证事实经过润色的错误指令会被更久地信任先对照代码检查每个命令和参数
使用「点击此处」和「参见下文」脱离上下文后无意义,屏幕阅读器无法识别,页面重排版后失效链接文本明确指向目标;交叉引用使用「请参见」
步骤隐藏在段落中,使用被动语态和将来时态读者无法明确谁该做什么,以及顺序将段落转换为编号祈使句步骤,条件前置,使用现在时态
堆叠Note/Warning提示框所有内容都被强调,反而无法突出重点每个章节保留一个提示信息;其余内容融入正文
使用
<your-key>
YOUR_API_KEY
占位符
读者可能会输入括号或将前缀视为字面内容使用大写的
API_KEY
,并在示例后说明
「修复风格」时改写内容含义审核者认可文案,却发布了错误的行为说明事实内容保持不变;未知内容标注为
TODO(verify)

Quick Diagnostic

快速诊断

QuestionIf NoAction
Does the first paragraph say who the doc is for and what they'll be able to do?Readers can't tell if they're on the right pageAdd audience, outcome, and non-scope statements
Does the doc type match the reader's task (tutorial · how-to · concept · reference · README)?Concept and steps interleave; nothing is findableSplit by type; link between pages
Is every command, flag, parameter, and behavior verified against code or the user?The doc teaches something falseVerify or mark
TODO(verify)
; not shippable until fixed
Do headings read as a sentence-case table of contents (tasks imperative, concepts noun phrases)?Scanning fails; "-ing" headings hide the actionRewrite headings; add one where each new task starts
Are all sequences numbered steps, one imperative action each, condition first?Readers miss steps or act before checkingConvert paragraphs to steps; move conditions forward
Is every code sample introduced by a colon sentence, with
ALL_CAPS
placeholders explained?
Readers paste literals or don't know what the sample doesAdd intro sentences; fix and explain placeholders
Is the text in second person, active voice, present tense, with no please/simply/just and no anthropomorphism?Instructions read as narrationRewrite sentence by sentence; cut filler
Are links descriptive, cross-refs "see"-based, images alt-texted, tables headed?Screen readers and reflow break the pageFix each; move image-only information into text
Is it timeless — no "currently/new/soon", no pre-announced features?The doc rots the day it shipsRemove time words; describe only shipped behavior
[EN]
Does it follow the word list, serial comma, contractions, and American spelling — or the local guide?
Small inconsistencies erode trustApply the word list; run Vale if configured
问题如果答案为否操作
第一段是否说明了文档面向的受众以及他们阅读后能完成的事情?读者无法判断自己是否在正确的页面添加受众、预期结果和非范围声明
文档类型是否匹配读者的任务(教程·操作指南·概念·参考·README)?概念与步骤混杂;内容难以查找按类型拆分页面;添加页面间链接
每个命令、标志、参数和行为是否已对照代码或用户提供的信息验证?文档教授错误内容验证或标注
TODO(verify)
;修复前不可发布
标题是否可作为句子格式的目录(任务类为祈使句,概念类为名词短语)?无法快速浏览;「-ing」标题隐藏动作重写标题;每次任务切换时添加标题
所有操作序列是否为编号步骤,每个步骤对应一个祈使句动作,条件前置?读者可能遗漏步骤或未检查条件就执行操作将段落转换为步骤;将条件前置
每个代码示例是否以冒号结尾的句子引出,使用
ALL_CAPS
占位符并附带说明?
读者可能会粘贴字面内容或不知道示例用途添加引导句;修复并说明占位符
文本是否使用第二人称、主动语态、现在时态,未使用「请/简单地/只需」,未使用拟人化表述?指令读起来像叙述文逐句重写;删除冗余内容
链接是否具有描述性,交叉引用是否使用「请参见」,图片是否有替代文本,表格是否有表头?屏幕阅读器和页面重排版会破坏内容逐一修复;将仅图片存在的信息转换为文本
文档是否永久有效——无「当前/新/即将」,无提前宣布的功能?文档发布当天就过时删除时间相关词汇;仅描述已发布的功能
[EN]
是否遵循词汇表、牛津逗号、缩写形式和美式拼写——或本地指南?
细微的不一致会削弱信任应用词汇表;若已配置则运行Vale

About the Source

来源说明

Google's Developer Documentation Style Guide is the public house style that Google's technical writers maintain for developers.google.com, Android, and Google Cloud documentation; the companion Technical Writing One and Two courses are Google's internal engineer training, released publicly. This skill adapts both under CC BY 4.0 (per Google's site policies) and adds Keep a Changelog for release notes; it is an independent adaptation, not endorsed by Google.
Google Developer Documentation Style Guide是谷歌技术文档作者为developers.google.com、Android和Google Cloud文档维护的公开官方风格指南;配套的Technical Writing One和Two课程是谷歌内部工程师培训材料,已公开发布。本技能基于上述内容进行改编,遵循CC BY 4.0协议(依据谷歌网站政策),并添加了Keep a Changelog规范用于发布说明;本技能为独立改编内容,未获得谷歌官方认可。

Further Reading

延伸阅读

  • Google Developer Documentation Style Guide — 从要点词汇表开始阅读
  • Technical Writing OneTechnical Writing Two — 谷歌关于词汇、句子、文档、自我编辑和示例代码的课程
  • Keep a Changelog — 本技能用于发布说明的变更日志结构规范
  • 《Docs for Developers: An Engineer's Field Guide to Technical Writing》(《开发者文档:工程师技术写作实用指南》)作者:Jared Bhatti, Zachary Sarah Corleissen, Jen Lambourne, David Nunez, Heidi Waterhouse
  • 《Every Page Is Page One: Topic-Based Writing for Technical Communication and the Web》(《每页都是首页:技术传播与Web的基于主题写作》)作者:Mark Baker