plugins/docgen/skills/docgen/SKILL.md
Use when user invokes /docgen to generate or update documentation. Also triggers on "generate docs", "update the README", "write the changelog". Accepts a doc type (readme, api, architecture, changelog) and optional scope. Always outputs to conversation first and asks before writing to disk. Do NOT use for explaining code behavior — use /explain instead.
npx skillsauth add harnessprotocol/harness-kit docgenInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate or update project documentation from the codebase — READMEs, API references, architecture overviews, and changelogs. Designed to produce accurate, non-padded docs that match the project's existing style.
Core principles:
/docgen readme # generate or update project README
/docgen readme src/auth/ # README for a subdirectory or package
/docgen api src/routes/ # API endpoint documentation
/docgen architecture # architecture overview from codebase structure
/docgen changelog v0.2.0..v0.3.0 # changelog from git history for a version range
You MUST follow this order. No skipping steps.
Determine doc type and scope:
| Doc Type | Detection | Scope Default |
|----------|-----------|---------------|
| readme | First arg is "readme" | Project root or specified path |
| api | First arg is "api" | Specified path (required); error if missing |
| architecture | First arg is "architecture" | Project root |
| changelog | First arg is "changelog" | Optional git range (e.g. v0.2.0..v0.3.0); defaults to recent history |
If no argument or unrecognized type: say "Usage: /docgen readme, /docgen api src/routes/, /docgen architecture, /docgen changelog [range]." Then stop.
If api is invoked without a path: say "Please provide a path. Example: /docgen api src/routes/." Then stop.
Context to gather varies by doc type:
readme:
package.json, go.mod, pyproject.toml, or equivalent (for name, version, description, dependencies)api:
router.GET, app.post, @app.route, r.HandleFuncarchitecture:
changelog:
git log --oneline [range] to get commitsgit log $(git describe --tags --abbrev=0)..HEAD --onelineBefore generating, check whether the target doc already exists:
Produce the document in the conversation. Structure by type:
readme:
# <project name>
<1-2 sentence description — what it does and who it's for>
## Install
<install command(s)>
## Usage
<primary usage pattern with example>
## Architecture (omit if trivial)
<brief description of key components>
## Configuration (omit if none)
<key config options>
## License
<license name>
api:
# API Reference
## Endpoints
| Method | Path | Auth | Description |
|--------|------|------|-------------|
| GET | /api/users | JWT | List users |
...
## <Endpoint Group Name>
### GET /api/users/:id
<description>
**Request**
- Path params: `id` (string) — user UUID
**Response**
- 200: `{ id, name, email, createdAt }`
- 404: `{ error: "not found" }`
architecture:
# Architecture
## Overview
<2-3 sentences: what the system does, how it's structured>
## Components
<table or list of top-level packages/modules with one-line descriptions>
## Data Flow
<how data moves through the system — input → processing → output>
## Key Files
<table: file/path → purpose>
changelog:
## <version or date range>
### Added
- <feat: commits>
### Fixed
- <fix: commits>
### Changed
- <refactor:, perf: commits>
### Internal
- <docs:, chore:, test: commits — summarized, not listed verbatim>
Apply style matching: if the existing project uses ## for top-level sections, match that. If it uses sentence case headings, use sentence case.
After outputting the document to the conversation, ask:
Want me to write this to [path]?
If the user says yes: write the file using the Write or Edit tool.
If the user requests changes: make them in the conversation first, then ask again before writing.
| Mistake | Fix |
|---------|-----|
| Writing files without asking | Always confirm with "Want me to write this to [path]?" before writing. |
| Blowing away manual content | Read existing doc first. Identify what to preserve. State preservation plan before generating. |
| Padding empty sections | If there's no configuration, omit the Configuration section. No filler. |
| Dumping git log verbatim into changelog | Group by type. Deduplicate. Filter noise. The changelog should be readable, not a raw log. |
| Using wrong heading style | Match the project's existing doc style — check for # vs ## top-level, title case vs sentence case. |
| Generating api docs without reading routes | Always read the actual route definition files, not just a description. |
development
Use when you've planned a non-trivial change and are about to implement it, finished a complex or multi-file piece of work, just wrote tests, or are stuck on repeated failures — and any time the user says "rubber duck this", "rubber ducky", "get a second opinion", "sanity-check my plan", "poke holes in this", "what am I missing", "critique my approach", "review this before I build it", or "/rubber-ducky". Spawns independent read-only critics on DIFFERENT Claude models than the one driving the session to catch blind spots, design flaws, and substantive bugs while course corrections are still cheap. Skip it only for small, obvious, well-understood changes. Do NOT use for reviewing a finished diff or PR — use /review for that; rubber-ducky pressure-tests your own in-progress thinking before and during implementation.
tools
Use when the user wants to fix, address, clear, or resolve open Dependabot security/vulnerability alerts for a repository, end to end. Fetches open alerts via the gh CLI, fixes them per ecosystem (pnpm/npm overrides + lockfile regen, cargo update, pip/go/bundler), verifies with audit and frozen-lockfile installs, then branches → commits → pushes → opens a PR, and squash-merges once CI is green — escalating only when a fix carries breaking-change risk or can't be resolved. Trigger on "/dependabot-sweep", "address the dependabot alerts", "fix the security vulnerabilities", "clear the dependabot alerts", "handle the dependency vulnerabilities", "sweep dependabot".
tools
Harness Kit documentation — installation, plugin catalog, creating plugins, cross-harness setup, architecture, and FAQ. Use when working with or configuring harness-kit plugins, understanding the plugin/skill system, installing slash commands, setting up AI coding tool configuration, answering questions about the plugin marketplace, writing SKILL.md files, using harness.yaml, or integrating with Copilot, Cursor, or Codex. Do NOT use for general Claude Code questions unrelated to harness-kit.
development
Use when user invokes /stats or asks about Claude Code usage, token consumption, session history, model distribution, or activity patterns. Generates an interactive HTML dashboard with charts and tables, auto-opens in browser. Also triggers on "how much have I used Claude", "show my usage", "token usage", "session stats", "usage report", "usage dashboard". Do NOT use for API billing or cost estimation — token counts are not costs.