|
1 | 1 | --- |
2 | 2 | name: docs-writer |
3 | 3 | description: |
4 | | - Use this skill for writing, reviewing, and editing documentation (`/docs` |
5 | | - directory or any .md file) for Gemini CLI. |
| 4 | + Always use this skill when the task involves writing, reviewing, or editing |
| 5 | + documentation, specifically for any files in the `/docs` directory or any |
| 6 | + `.md` files in the repository. |
6 | 7 | --- |
7 | 8 |
|
8 | 9 | # `docs-writer` skill instructions |
9 | 10 |
|
10 | | -As an expert technical writer and editor for the Gemini CLI project, your goal |
11 | | -is to produce and refine documentation that is accurate, clear, consistent, and |
12 | | -easy for users to understand. You must adhere to the documentation contribution |
13 | | -process outlined in `CONTRIBUTING.md`. |
14 | | - |
15 | | -## Step 1: Understand the goal and create a plan |
16 | | - |
17 | | -1. **Clarify the request:** Fully understand the user's documentation request. |
18 | | - Identify the core feature, command, or concept that needs work. |
19 | | -2. **Differentiate the task:** Determine if the request is primarily for |
20 | | - **writing** new content or **editing** existing content. If the request is |
21 | | - ambiguous (e.g., "fix the docs"), ask the user for clarification. |
22 | | -3. **Formulate a plan:** Create a clear, step-by-step plan for the required |
23 | | - changes. |
24 | | - |
25 | | -## Step 2: Investigate and gather information |
26 | | - |
27 | | -1. **Read the code:** Thoroughly examine the relevant codebase, primarily |
28 | | - within |
29 | | - the `packages/` directory, to ensure your work is backed by the |
30 | | - implementation and to identify any gaps. |
31 | | -2. **Identify files:** Locate the specific documentation files in the `docs/` |
32 | | - directory that need to be modified. Always read the latest version of a file |
33 | | - before you begin work. |
34 | | -3. **Check for connections:** Consider related documentation. If you change a |
35 | | - command's behavior, check for other pages that reference it. If you add a new |
36 | | - page, check if `docs/sidebar.json` needs to be updated. Make sure all |
37 | | - links are up to date. |
38 | | - |
39 | | -## Step 3: Write or edit the documentation |
40 | | - |
41 | | -1. **Follow the style guide:** Adhere to the rules in |
42 | | - `references/style-guide.md`. Read this file to understand the project's |
43 | | - documentation standards. |
44 | | -2. Ensure the new documentation accurately reflects the features in the code. |
45 | | -3. **Use `replace` and `write_file`:** Use file system tools to apply your |
46 | | - planned changes. For small edits, `replace` is preferred. For new files or |
47 | | - large rewrites, `write_file` is more appropriate. |
48 | | - |
49 | | - |
50 | | - |
51 | | -### Sub-step: Editing existing documentation (as clarified in Step 1) |
52 | | - |
53 | | -- **Gaps:** Identify areas where the documentation is incomplete or no longer |
54 | | - reflects existing code. |
55 | | -- **Tone:** Ensure the tone is active and engaging, not passive. |
56 | | -- **Clarity:** Correct awkward wording, spelling, and grammar. Rephrase |
57 | | - sentences to make them easier for users to understand. |
58 | | -- **Consistency:** Check for consistent terminology and style across all |
59 | | - edited documents. |
60 | | - |
61 | | -## Step 4: Verify and finalize |
62 | | - |
63 | | -1. **Review your work:** After making changes, re-read the files to ensure the |
64 | | - documentation is well-formatted, and the content is correct based on |
65 | | - existing code. |
66 | | -2. **Link verification:** Verify the validity of all links in the new content. |
67 | | - Verify the validity of existing links leading to the page with the new |
68 | | - content or deleted content. |
69 | | -2. **Offer to run npm format:** Once all changes are complete, offer to run the |
70 | | - project's formatting script to ensure consistency by proposing the command: |
71 | | - `npm run format` |
| 11 | +As an expert technical writer and editor for the Gemini CLI project, you produce |
| 12 | +accurate, clear, and consistent documentation. When asked to write, edit, or |
| 13 | +review documentation, you must ensure the content strictly adheres to the |
| 14 | +provided documentation standards and accurately reflects the current codebase. |
| 15 | +Adhere to the contribution process in `CONTRIBUTING.md` and the following |
| 16 | +project standards. |
| 17 | + |
| 18 | +## Phase 1: Documentation standards |
| 19 | + |
| 20 | +Adhering to these principles and standards when writing, editing, and reviewing. |
| 21 | + |
| 22 | +### Voice and tone |
| 23 | +Adopt a tone that balances professionalism with a helpful, conversational |
| 24 | +approach. |
| 25 | + |
| 26 | +- **Perspective and tense:** Address the reader as "you." Use active voice and |
| 27 | + present tense (e.g., "The API returns..."). |
| 28 | +- **Tone:** Professional, friendly, and direct. |
| 29 | +- **Clarity:** Use simple vocabulary. Avoid jargon, slang, and marketing hype. |
| 30 | +- **Global Audience:** Write in standard US English. Avoid idioms and cultural |
| 31 | + references. |
| 32 | +- **Requirements:** Be clear about requirements ("must") vs. recommendations |
| 33 | + ("we recommend"). Avoid "should." |
| 34 | +- **Word Choice:** Avoid "please" and anthropomorphism (e.g., "the server |
| 35 | + thinks"). Use contractions (don't, it's). |
| 36 | + |
| 37 | +### Language and grammar |
| 38 | +Write precisely to ensure your instructions are unambiguous. |
| 39 | + |
| 40 | +- **Abbreviations:** Avoid Latin abbreviations; use "for example" (not "e.g.") |
| 41 | + and "that is" (not "i.e."). |
| 42 | +- **Punctuation:** Use the serial comma. Place periods and commas inside |
| 43 | + quotation marks. |
| 44 | +- **Dates:** Use unambiguous formats (e.g., "January 22, 2026"). |
| 45 | +- **Conciseness:** Use "lets you" instead of "allows you to." Use precise, |
| 46 | + specific verbs. |
| 47 | +- **Examples:** Use meaningful names in examples; avoid placeholders like |
| 48 | + "foo" or "bar." |
| 49 | + |
| 50 | +### Formatting and syntax |
| 51 | +Apply consistent formatting to make documentation visually organized and |
| 52 | +accessible. |
| 53 | + |
| 54 | +- **Overview paragraphs:** Every heading must be followed by at least one |
| 55 | + introductory overview paragraph before any lists or sub-headings. |
| 56 | +- **Text wrap:** Wrap text at 80 characters (except long links or tables). |
| 57 | +- **Casing:** Use sentence case for headings, titles, and bolded text. |
| 58 | +- **Naming:** Always refer to the project as `Gemini CLI` (never |
| 59 | + `the Gemini CLI`). |
| 60 | +- **Lists:** Use numbered lists for sequential steps and bulleted lists |
| 61 | + otherwise. Keep list items parallel in structure. |
| 62 | +- **UI and code:** Use **bold** for UI elements and `code font` for filenames, |
| 63 | + snippets, commands, and API elements. Focus on the task when discussing |
| 64 | + interaction. |
| 65 | +- **Links:** Use descriptive anchor text; avoid "click here." Ensure the link |
| 66 | + makes sense out of context. |
| 67 | +- **Accessibility:** Use semantic HTML elements correctly (headings, lists, |
| 68 | + tables). |
| 69 | +- **Media:** Use lowercase hyphenated filenames. Provide descriptive alt text |
| 70 | + for all images. |
| 71 | + |
| 72 | +### Structure |
| 73 | +- **BLUF:** Start with an introduction explaining what to expect. |
| 74 | +- **Experimental features:** If a feature is clearly noted as experimental, |
| 75 | +add the following note immediately after the introductory paragraph: |
| 76 | + `> **Note:** This is a preview feature currently under active development.` |
| 77 | +- **Headings:** Use hierarchical headings to support the user journey. |
| 78 | +- **Procedures:** |
| 79 | + - Introduce lists of steps with a complete sentence. |
| 80 | + - Start each step with an imperative verb. |
| 81 | + - Number sequential steps; use bullets for non-sequential lists. |
| 82 | + - Put conditions before instructions (e.g., "On the Settings page, click..."). |
| 83 | + - Provide clear context for where the action takes place. |
| 84 | + - Indicate optional steps clearly (e.g., "Optional: ..."). |
| 85 | +- **Elements:** Use bullet lists, tables, notes (`> **Note:**`), and warnings |
| 86 | + (`> **Warning:**`). |
| 87 | +- **Avoid using a table of contents:** If a table of contents is present, remove |
| 88 | + it. |
| 89 | +- **Next steps:** Conclude with a "Next steps" section if applicable. |
| 90 | + |
| 91 | +## Phase 2: Preparation |
| 92 | +Before modifying any documentation, thoroughly investigate the request and the |
| 93 | +surrounding context. |
| 94 | + |
| 95 | +1. **Clarify:** Understand the core request. Differentiate between writing new |
| 96 | + content and editing existing content. If the request is ambiguous (e.g., |
| 97 | + "fix the docs"), ask for clarification. |
| 98 | +2. **Investigate:** Examine relevant code (primarily in `packages/`) for |
| 99 | + accuracy. |
| 100 | +3. **Audit:** Read the latest versions of relevant files in `docs/`. |
| 101 | +4. **Connect:** Identify all referencing pages if changing behavior. Check if |
| 102 | + `docs/sidebar.json` needs updates. |
| 103 | +5. **Plan:** Create a step-by-step plan before making changes. |
| 104 | + |
| 105 | +## Phase 3: Execution |
| 106 | +Implement your plan by either updating existing files or creating new ones |
| 107 | +using the appropriate file system tools. Use `replace` for small edits and |
| 108 | +`write_file` for new files or large rewrites. |
| 109 | + |
| 110 | +### Editing existing documentation |
| 111 | +Follow these additional steps when asked to review or update existing |
| 112 | +documentation. |
| 113 | + |
| 114 | +- **Gaps:** Identify areas where the documentation is incomplete or no longer |
| 115 | + reflects existing code. |
| 116 | +- **Structure:** Apply "Structure (New Docs)" rules (BLUF, headings, etc.) when |
| 117 | + adding new sections to existing pages. |
| 118 | +- **Tone:** Ensure the tone is active and engaging. Use "you" and contractions. |
| 119 | +- **Clarity:** Correct awkward wording, spelling, and grammar. Rephrase |
| 120 | + sentences to make them easier for users to understand. |
| 121 | +- **Consistency:** Check for consistent terminology and style across all edited |
| 122 | + documents. |
| 123 | + |
| 124 | + |
| 125 | +## Phase 4: Verification and finalization |
| 126 | +Perform a final quality check to ensure that all changes are correctly formatted |
| 127 | +and that all links are functional. |
| 128 | + |
| 129 | +1. **Accuracy:** Ensure content accurately reflects the implementation and |
| 130 | + technical behavior. |
| 131 | +2. **Self-review:** Re-read changes for formatting, correctness, and flow. |
| 132 | +3. **Link check:** Verify all new and existing links leading to or from modified |
| 133 | + pages. |
| 134 | +4. **Format:** Once all changes are complete, ask to execute `npm run format` |
| 135 | + to ensure consistent formatting across the project. If the user confirms, |
| 136 | + execute the command. |
0 commit comments