Usage Examples
Real-world scenarios demonstrating effective use of the Docs plugin for maintaining living documentation.
Examples
Post-Implementation Documentation Update
Scenario: You have implemented a new feature and need to update project documentation.
# Implement the feature
> claude "implement user authentication with JWT tokens"
# Update documentation to reflect changes
> /docs:update-docsExpected Flow:
Plugin analyzes changed files and existing documentation
Identifies documentation gaps (missing API docs, outdated README)
Creates or updates relevant documentation
Validates examples and links
Documentation Output:
## Documentation Updates Completed
### Files Updated
- README.md - Added authentication section to Quick Start
- docs/api/authentication.md - New file with JWT flow documentation
- src/auth/README.md - Module README with purpose and exports
### Major Changes
- Added authentication endpoint documentation
- Created troubleshooting section for common auth errors
- Updated environment variables documentationAPI Documentation After Adding Endpoints
Scenario: You have added new REST API endpoints and need to document them.
Expected Flow:
Plugin scans for API-related changes (routes, controllers, schemas)
Checks for existing OpenAPI/Swagger documentation
Updates or generates API reference documentation
Adds request/response examples
API Documentation Generated:
Response (201 Created)
Error Responses
400
Invalid request body
401
Missing or invalid authentication
409
Product with same name already exists
Expected Flow:
Plugin focuses on the specified directory
Analyzes module structure and exports
Updates module README with purpose and usage
Adds JSDoc comments for complex functions
Module README Generated:
See: Payment Integration Guide for detailed setup.
Expected Flow:
Inventories all existing documentation
Checks freshness (files older than 6 months flagged)
Identifies duplications and inconsistencies
Prioritizes high-impact updates
Removes or consolidates outdated content
Audit Output:
JSDoc Update for Complex Logic
Scenario: Business logic functions need documentation for maintainability.
Expected Flow:
Identifies complex functions lacking documentation
Adds JSDoc with parameters, return types, and examples
Skips obvious/simple functions (getters, setters, utilities)
Focuses on business logic and integration points
JSDoc Added:
README Files Only
Scenario: Quick update to README files across the project.
Expected Flow:
Scans all README.md files in the project
Updates root README with current quick start
Creates module READMEs where missing
Ensures consistent structure across READMEs
README Updates:
Integration with Other Plugins
Complete Feature Development Workflow
SDD Workflow Integration
Documentation After Refactoring
API Version Migration Documentation
Common Patterns
When to Run Documentation Updates
After implementing feature
/docs:update-docs
Full assessment
After adding API endpoints
/docs:update-docs api
API documentation
After module changes
/docs:update-docs src/module/
Module-specific
Periodic maintenance
/docs:update-docs
Full audit
Before release
/docs:update-docs
Comprehensive review
Documentation Priority Order
Onboarding blockers - Setup instructions, quick start
API documentation - Endpoint references, authentication
Module READMEs - Navigation and purpose
Troubleshooting - Common errors and solutions
Architecture decisions - When they affect usage
JSDoc comments - Complex business logic
Signs Documentation Needs Updating
Issues contain "how do I...?" questions
Multiple conflicting sources of truth
Setup instructions do not work
API responses do not match documentation
New features have no documentation
Links return 404 errors
Last updated