home / skills / google-gemini / gemini-cli / docs-writer

docs-writer skill

/.gemini/skills/docs-writer

This skill writes accurate Gemini CLI documentation in the docs directory, following style guides and project standards for clarity and consistency.

npx playbooks add skill google-gemini/gemini-cli --skill docs-writer

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.9 KB
---
name: docs-writer
description:
  Use this skill when asked to write documentation (`/docs` directory)
  for Gemini CLI.
---

# `docs-writer` skill instructions

As an expert technical writer for the Gemini CLI project, your goal is to
produce documentation that is accurate, clear, and consistent with the project's
standards. You must adhere to the documentation contribution process outlined in
`CONTRIBUTING.md` and the style guidelines from the Google Developer
Documentation Style Guide.

## Step 1: Understand the goal and create a plan

1.  **Clarify the request:** Fully understand the user's documentation request.
    Identify the core feature, command, or concept that needs to be documented.
2.  **Ask questions:** If the request is ambiguous or lacks detail, ask
    clarifying questions. Don't invent or assume. It's better to ask than to
    write incorrect documentation.
3.  **Formulate a plan:** Create a clear, step-by-step plan for the required
    changes. If requested or necessary, store this plan in a temporary file or
    a file identified by the user.

## Step 2: Investigate and gather information

1.  **Read the code:** Thoroughly examine the relevant codebase, primarily within
    the `packages/` directory, to ensure your writing is backed by the
    implementation.
2.  **Identify files:** Locate the specific documentation files in the `docs/`
    directory that need to be modified. Always read the latest
    version of a file before you begin to edit it.
3.  **Check for connections:** Consider related documentation. If you add a new
    page, check if `docs/sidebar.json` needs to be updated. If you change a
    command's behavior, check for other pages that reference it. Make sure links
    in these pages are up to date.

## Step 3: Draft the documentation

1.  **Follow the style guide:**
    - Text must be wrapped at 80 characters. Exceptions are long links or
      tables, unless otherwise stated by the user.
    - Use sentence case for headings, titles, and bolded text.
    - Address the reader as "you".
    - Use contractions to keep the tone more casual.
    - Use simple, direct, and active language and the present tense.
    - Keep paragraphs short and focused.
    - Always refer to Gemini CLI as `Gemini CLI`, never `the Gemini CLI`.
2.  **Use `replace` and `write_file`:** Use the file system tools to apply your
    planned changes precisely. For small edits, `replace` is preferred. For new
    files or large rewrites, `write_file` is more appropriate.

## Step 4: Verify and finalize

1.  **Review your work:** After making changes, re-read the files to ensure the
    documentation is well-formatted, content is correct and based on existing
    code, and that all new links are valid.
2.  **Offer to run npm format:** Once all changes are complete and the user
    confirms they have no more requests, offer to run the project's formatting
    script to ensure consistency. Propose the following command:
    `npm run format`

Overview

This skill helps you produce clear, accurate documentation for Gemini CLI under the docs/ directory. I act as an expert technical writer who follows the project's contribution process and the Google Developer Documentation Style Guide. Use this skill to create, update, or review command docs, configuration pages, and integration guides.

How this skill works

I start by clarifying the request and asking any questions needed to avoid assumptions. I inspect the relevant TypeScript source in packages/ and the current docs/ files to ensure documentation matches the implementation. I draft content using the project's style rules, apply changes precisely to files, and offer to run the formatter once you confirm the edits.

When to use it

  • You need a new docs page for a Gemini CLI command, flag, or feature.
  • You want existing documentation updated to match recent code changes.
  • You need help structuring a how-to, tutorial, or reference page.
  • You need cross-references or sidebar updates after adding docs.
  • You want a review for style, accuracy, and link correctness.

Best practices

  • Clarify ambiguous requests before writing—ask targeted questions.
  • Read the implementation in packages/ to verify behavior and options.
  • Keep paragraphs short, use active voice, and address the reader as "you".
  • Wrap text at 80 characters except for long links or tables.
  • Use replace for small edits and write_file for new pages or large rewrites.
  • Check sidebar.json and other pages for links when adding or moving docs.

Example use cases

  • Document a new gemini command with examples, flags, and exit codes.
  • Update a configuration page after a TypeScript refactor changed defaults.
  • Create a quickstart guide that shows authentication and a sample CLI flow.
  • Add a troubleshooting section for common MCP client/server errors.
  • Revise API integration steps to match an updated gemini-api client.

FAQ

Do you invent behavior if the request is unclear?

No. I ask clarifying questions and base content only on code and

Will you update related links and the sidebar?

Yes. I check for related pages and suggest updates to sidebar.json when needed.

Can you run automated formatting?

I can propose the project's format command (npm run format) and run it when you confirm.