| name | documentation-sync |
| description | Use when code changes require documentation updates. Ensures documentation stays synchronized with code, API, and feature changes. Detects doc drift and maintains consistency. |
| trigger | user mentions "update docs", "documentation", "README", or after significant code changes |
Documentation Sync Skill
Purpose
Ensure documentation stays synchronized with code changes. Detect and fix documentation drift, maintain API documentation, and keep README, CHANGELOG, and other docs up-to-date.
When to Use
- After implementing new features
- When API interfaces change
- After refactoring that affects user-facing behavior
- Before releases to verify documentation completeness
- When documentation is out of sync with code
Documentation Types
| Type | Location | Purpose | Update Frequency |
|---|
| README.md | Root | Project overview, quick start | With new features |
| CHANGELOG.md | Root | Version history | Every release |
| API Docs | docs/api/ | API reference | With API changes |
| Architecture | docs/architecture/ | System design | With architectural changes |
| AGENTS.md | Root | AI agent rules | With workflow changes |
| Code Comments | Inline | Implementation details | With code changes |
| Type Definitions | .d.ts, JSDoc | Type information | With interface changes |
Documentation Drift Detection
Automated Checks
grep -r "v[0-9]\+\.[0-9]\+\.[0-9]\+" docs/ README.md
grep -r "TODO\|FIXME" docs/
npx markdown-link-check README.md
npx ts-docs-check
npx eslint --rule 'require-jsdoc: error' src/
Manual Checklist
Update Workflows
Feature Implementation → Documentation
## After implementing a new feature:
1. **Update README.md**
- Add to features list
- Update examples if relevant
- Add to quick start if it changes initial setup
2. **Create/Update API docs**
- Document new functions/classes
- Add usage examples
- Document parameters and return types
3. **Update CHANGELOG.md**
- Add to [Unreleased] section
- Categorize as Added/Changed/Fixed
4. **Add inline documentation**
- JSDoc/TSDoc for public APIs
- Comments for complex logic
5. **Update AGENTS.md** (if AI workflow affected)
- Add new commands
- Update agent responsibilities
API Changes → Documentation
/**
* @api {get} /users/:id Get user by ID
* @apiParam {String} id User's unique ID
* @apiSuccess {Object} user User object
* @apiSuccess {String} user.name User's name
* @apiSuccess {String} user.email User's email
*/
app.get('/users/:id', (req, res) => { ... });
# 2. Generate API docs
npx api-docs -i src/ -o docs/api/
# 3. Update docs/api/README.md with new endpoint
Configuration Changes → Documentation
## When adding new configuration options:
1. **Update config schema**
- Add to config type definitions
- Update JSON Schema if applicable
2. **Document in README**
- Add to configuration section
- Provide example values
3. **Update presets**
- Add to default.yaml
- Document in overlay guides
Documentation Templates
README.md Structure
# Project Name
Brief description of what the project does.
## Features
- Feature 1: Description
- Feature 2: Description
## Quick Start
\`\`\`bash
# Installation
npm install package-name
# Usage
npx package-name init
\`\`\`
## Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `option1` | string | `"default"` | Description of option |
## API Reference
See [API Documentation](docs/api/README.md).
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md).
## License
MIT
API Documentation Template
# Module: ModuleName
## Overview
Brief description of the module's purpose.
## Installation
\`\`\`bash
npm install @scope/module-name
\`\`\`
## Usage
\`\`\`typescript
import { FunctionName } from '@scope/module-name';
const result = FunctionName(options);
\`\`\`
## API
### `FunctionName(options)`
Description of what the function does.
#### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `param1` | `string` | Yes | Description |
| `param2` | `number` | No | Description (default: 0) |
#### Returns
`Promise<Result>` - Description of return value.
#### Example
\`\`\`typescript
const result = await FunctionName({
param1: 'value',
param2: 42
});
\`\`\`
### `ClassName`
Description of the class.
#### Constructor
\`\`\`typescript
new ClassName(options: ClassOptions)
\`\`\`
#### Methods
##### `methodName(param: Type): ReturnType`
Description of the method.
## Types
### `Options`
\`\`\`typescript
interface Options {
param1: string;
param2?: number;
}
\`\`\`
## Errors
| Error | Cause | Solution |
|-------|-------|----------|
| `ErrorType` | Invalid input | Provide valid input |
## See Also
- [Related Module](./related-module.md)
CHANGELOG Entry Template
## [X.Y.Z] - YYYY-MM-DD
### Added
- New feature description (#PR)
### Changed
- Change description (#PR)
### Deprecated
- Feature marked for removal in next major version
### Removed
- Feature removed (previously deprecated)
### Fixed
- Bug fix description (#PR)
### Security
- Security fix description
Automated Documentation Generation
JSDoc → Markdown
npm install -D typedoc
npx typedoc src/ --out docs/api
{
"entryPoints": ["src/index.ts"],
"out": "docs/api",
"plugin": ["typedoc-plugin-markdown"]
}
OpenAPI → Documentation
npx @redocly/cli build-docs openapi.yaml -o docs/api.html
Code → README
npx readme-md-generator
Documentation Validation
Link Checking
npm install -g markdown-link-check
find . -name "*.md" -exec markdown-link-check {} \;
markdown-link-check README.md
Spell Checking
npm install -D cspell
npx cspell "docs/**/*.md" README.md
{
"version": "0.2",
"words": ["opencode", "superpowers", "amazingteam"]
}
Markdown Linting
npm install -D markdownlint-cli
npx markdownlint "**/*.md"
npx markdownlint "**/*.md" --fix
Sync Strategies
Proactive (Recommended)
1. Write documentation alongside code
2. Include doc updates in PR checklist
3. Generate docs from code (JSDoc, TypeDoc)
4. CI checks for doc coverage
Reactive
1. Schedule regular doc reviews
2. Automated drift detection
3. Create doc update issues when drift found
4. Fix in dedicated doc update sessions
AmazingTeam Documentation Sync
Files to Keep in Sync
| When Code Changes | Update These Docs |
|---|
| New CLI command | README.md, docs/cli/, AGENTS.md |
| New agent role | AGENTS.md, .opencode/agents/, amazing-team.config.yaml |
| New skill | .opencode/skills/, .opencode/SUPERPOWERS.md |
| Config schema change | README.md, presets/, docs/configuration.md |
| Workflow change | AGENTS.md, .github/workflows/, docs/workflows/ |
| Release | VERSION, package.json, CHANGELOG.md, presets/default.yaml |
Documentation Update Checklist for PRs
## Documentation Checklist
- [ ] README.md updated if user-facing change
- [ ] CHANGELOG.md entry added to [Unreleased]
- [ ] API docs updated if public API changed
- [ ] JSDoc/TSDoc added for new public functions
- [ ] AGENTS.md updated if AI workflow affected
- [ ] Examples updated/added
- [ ] Configuration docs updated if new options
- [ ] Migration guide added for breaking changes
Best Practices
DO
- ✅ Update docs in the same PR as code changes
- ✅ Use consistent terminology throughout docs
- ✅ Include code examples that actually work
- ✅ Document "why", not just "what"
- ✅ Keep docs close to code (co-locate)
- ✅ Use automated tools for API docs
DON'T
- ❌ Let docs get stale
- ❌ Duplicate documentation in multiple places
- ❌ Use outdated screenshots or examples
- ❌ Skip documentation for "obvious" features
- ❌ Wait until release to update docs
Tools Integration
VS Code Extensions
- Markdown All in One
- markdownlint
- Code Spell Checker
CI Integration
name: Documentation
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Check markdown links
run: npx markdown-link-check README.md
- name: Lint markdown
run: npx markdownlint "**/*.md"
- name: Check spelling
run: npx cspell "docs/**/*.md" README.md
Examples
Complete Feature Documentation Update
git checkout -b feature/user-dashboard
echo "### Added\n- User dashboard feature (#123)" >> CHANGELOG.md
npx typedoc src/dashboard/ --out docs/api/dashboard
git add -A
git commit -m "feat: Add user dashboard with docs"