Agent skill
document
Creates and maintains project documentation including README files, API docs, changelogs, and architecture docs. Use when user asks to "write a README", "document this project", "update the docs", "create a changelog", "add API documentation", or "generate architecture docs".
Install this agent skill to your Project
npx add-skill https://github.com/jiyeol-lee/dotfiles/tree/main/.opencode/skills/document
SKILL.md
Workflow
- Discover existing docs — Glob for
README*,CHANGELOG*,docs/,*.mdto understand what exists - Analyze the project — Read package.json, pyproject.toml, or equivalent to extract project name, description, dependencies, and scripts
- Draft documentation — Propose content in Draft Mode (default) for user approval
- Apply on approval — Only write files when user explicitly approves or requests Apply Mode
Modes
- Draft Mode (default) — Analyze and propose documentation changes. Return draft content for user review. NEVER write files in this mode.
- Apply Mode — Write documentation files after user approval. Only enter this mode when user explicitly says "apply", "write it", "looks good", or similar confirmation.
Key Patterns
Project-Specific Discovery
Before writing any documentation, extract real project data:
1. Read package.json / pyproject.toml / Cargo.toml for: name, description, scripts, dependencies
2. Read existing README for: current structure, badges, links to preserve
3. Check for: .env.example (document env vars), docker-compose.yml (document containers), Makefile (document targets)
4. Scan src/ entry points for: exported APIs, CLI commands, main modules
This grounding step prevents generic documentation — every section should reference actual project artifacts.
Changelog Entries
Follow Keep a Changelog format. Group changes under: Added, Changed, Deprecated, Removed, Fixed, Security. Read git log to extract changes since last version tag.
Architecture Docs
Use ASCII diagrams (not images) for component relationships — they live in version control and render everywhere.
Example
User request: "Document this project"
Draft Mode output:
## Proposed README.md
Based on package.json analysis:
- Project: `my-api-service`
- Description: REST API for order management
- Scripts: `dev`, `build`, `test`, `lint`
- Key deps: express, prisma, zod
### Proposed structure:
# my-api-service
> REST API for order management
## Quick Start
\`\`\`bash
npm install
cp .env.example .env # Configure DATABASE_URL
npm run dev
\`\`\`
## Available Scripts
| Script | Description |
|--------|-------------|
| `npm run dev` | Start development server with hot reload |
| `npm run build` | Build for production |
| `npm run test` | Run test suite |
| `npm run lint` | Lint and format check |
## Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `DATABASE_URL` | Yes | PostgreSQL connection string |
| `PORT` | No | Server port (default: 3000) |
---
**Shall I apply this? I can also add API endpoint documentation if you'd like.**
Constraints
- NEVER apply changes without user approval in Draft Mode
- NEVER include secrets, API keys, or credentials in documentation
- NEVER use
sed/perl/awk/trfor multi-file replacements — use grep + edit - NEVER invent features or endpoints — only document what exists in the codebase
- ALWAYS preserve existing badges, links, and custom sections when updating a README
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
pull-request
Analyzes branch diffs, drafts PR titles and bodies following Conventional Commits, and creates or updates pull requests via GitHub CLI. Use when user asks to "create a PR", "open a pull request", "update PR description", "draft a PR", or "submit changes for review".
commit
Analyzes repository state, proposes commit messages following Conventional Commits, and applies commits after user approval. Use when asked to "commit", "commit changes", "save my work", "create a commit", or "stage and commit".
review
Performs code review analysis across Quality, Regression, Documentation, and Performance focus areas with severity-classified findings. Use when user asks to "review code", "review this PR", "check code quality", "review changes", or "do a code review".
check
Verifies code quality through linting, type-checking, formatting, and testing. Use when asked to "run checks", "validate code", "lint this", "check for errors", "run tests", or "verify code quality" before or after changes.
task-breakdown
Decomposes complex goals into atomic, dependency-aware work items with execution plans. Use when asked to "break down this task", "create a task plan", "decompose this goal", "split this work", "plan the implementation", "what are the steps", or "create an execution plan".
code
Implements features, fixes bugs, refactors code, and writes unit and integration tests. Use when asked to "implement", "fix a bug", "refactor", "add a feature", "write tests", "add test coverage", or "update code".
Didn't find tool you were looking for?