Loading...
Loading...
Professional technical writing and documentation skill for creating and maintaining comprehensive, accurate, and user-friendly documentation for codebases, APIs, deployment processes, and end-user guides.
npx skill4agent add enuno/claude-command-and-control scribe-role-skill# Understand project structure
tree -L 3 -I 'node_modules|.git|dist|build'
# Identify main entry points
find . -name "index.*" -o -name "main.*" -o -name "app.*" | grep -v node_modules
# Review package manifest
cat package.json || cat requirements.txt || cat pom.xml || cat Cargo.toml
# Check existing documentation
find . -name "*.md" -o -name "*.rst" | grep -v node_modulesDOCUMENTATION_PLAN.md# Documentation Plan: [Project Name]
## Current State Assessment
- Existing docs: [List what exists]
- Documentation gaps: [What's missing]
- Outdated sections: [What needs updating]
## Documentation Structure
## Priority
1. **Critical (Must Have)**:
- README.md
- BUILDING.md
- DEPLOYMENT.md
2. **Important (Should Have)**:
- API.md
- USAGE.md
- TROUBLESHOOTING.md
3. **Nice to Have**:
- ARCHITECTURE.md (if not done by architect)
- CONTRIBUTING.md
- Advanced guides
## Timeline
- Phase 1 (Critical): Immediate
- Phase 2 (Important): Next sprint
- Phase 3 (Nice to Have): Following sprint# [Project Name]
[One-sentence description of what this project does]
## Overview
[2-3 paragraph description covering:
- What problem does this solve?
- Who is it for?
- What are the key features?]
## Quick Start
```bash
# Clone the repository
git clone [repository-url]
cd [project-name]
# Install dependencies
npm install # or pip install -r requirements.txt, etc.
# Run the application
npm start # or python main.py, etc.
#### BUILDING.md Template
```markdown
# Building [Project Name]
This guide covers how to build the application from source.
## Prerequisites
### Required Tools
- [Tool 1]: version X.X+ ([installation link])
- [Tool 2]: version Y.Y+ ([installation link])
- [Tool 3]: version Z.Z+ ([installation link])
### Optional Tools
- [Tool]: For [purpose]
## Environment Setup
### macOS
```bash
# Install dependencies
brew install [package1] [package2]
# Set environment variables
export VAR_NAME=value# Install dependencies
sudo apt-get update
sudo apt-get install [package1] [package2]
# Set environment variables
export VAR_NAME=value# Install dependencies using chocolatey
choco install [package1] [package2]
# Set environment variables
$env:VAR_NAME="value"# Install dependencies
npm install # or equivalent
# Build for development
npm run build:dev
# Output location: ./dist/# Clean previous builds
npm run clean
# Install production dependencies
npm ci --production
# Build optimized version
npm run build:prod
# Output location: ./dist/production/build.config.js.env.buildwebpack.config.js{
mode: 'production', // production | development
optimization: true, // Enable optimizations
minify: true, // Minify output
sourceMaps: false // Generate source maps
}dist/
├── app.[hash].js # Main application bundle
├── vendor.[hash].js # Third-party dependencies
├── styles.[hash].css # Compiled styles
├── assets/ # Static assets
│ ├── images/
│ └── fonts/
└── index.html # Entry point# Solution: Increase Node memory limit
export NODE_OPTIONS="--max-old-space-size=4096"
npm run build# Solution: Clear cache and reinstall
rm -rf node_modules package-lock.json
npm cache clean --force
npm install# Solution: Verify all dependencies installed
npm list --depth=0
npm install [missing-package]maindevelopnpm run build:watchbuild.config.js--parallel
#### DEPLOYMENT.md Template
```markdown
# Deploying [Project Name]
This guide covers deploying the application to various environments.
## Environments
| Environment | Purpose | URL | Access |
|------------|---------|-----|--------|
| Development | Local development | localhost:3000 | All developers |
| QA | Testing | qa.example.com | QA team |
| Staging | Pre-production validation | staging.example.com | Internal users |
| Production | Live application | www.example.com | Public |
## Prerequisites
### Required
- Built application artifacts (see [BUILDING.md](BUILDING.md))
- Access credentials for target environment
- [Cloud provider] CLI tools installed and configured
### Environment Variables
Create `.env.[environment]` file:
```bash
# Application
NODE_ENV=production
PORT=3000
LOG_LEVEL=info
# Database
DATABASE_URL=postgresql://user:pass@host:5432/dbname
DATABASE_POOL_SIZE=10
# API Keys (use secrets manager in production)
API_KEY=your-api-key
SECRET_KEY=your-secret-key
# Feature Flags
FEATURE_X_ENABLED=true# Build production artifacts
npm run build:prod
# Verify build
ls -la dist/# Copy files to server
scp -r dist/* user@server:/var/www/app/
# SSH into server
ssh user@server
# Restart application
sudo systemctl restart app-service# Check service status
sudo systemctl status app-service
# Check logs
sudo tail -f /var/log/app/application.log
# Test endpoint
curl https://your-domain.com/health# Build image
docker build -t app-name:version .
# Tag for registry
docker tag app-name:version registry.example.com/app-name:version
# Push to registry
docker push registry.example.com/app-name:version# Pull latest image
docker pull registry.example.com/app-name:version
# Stop existing container
docker stop app-container || true
docker rm app-container || true
# Run new container
docker run -d \
--name app-container \
--env-file .env.production \
-p 80:3000 \
--restart unless-stopped \
registry.example.com/app-name:version
# Verify
docker logs app-container# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-deployment
spec:
replicas: 3
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: app
image: registry.example.com/app-name:version
ports:
- containerPort: 3000
envFrom:
- configMapRef:
name: app-config
- secretRef:
name: app-secrets# Apply configurations
kubectl apply -f k8s/
# Check deployment status
kubectl rollout status deployment/app-deployment
# Verify pods running
kubectl get pods -l app=myapp
# Check logs
kubectl logs -l app=myapp --tail=100# Initialize EB
eb init -p node.js-16 app-name --region us-west-2
# Create environment
eb create production --instance-type t3.medium
# Deploy
eb deploy
# Check status
eb status# Deploy to App Engine
gcloud app deploy app.yaml --project=project-id
# View logs
gcloud app logs tail -s default
# Open in browser
gcloud app browse# Create resource group
az group create --name myResourceGroup --location eastus
# Create app service plan
az appservice plan create --name myAppServicePlan \
--resource-group myResourceGroup --sku B1 --is-linux
# Create web app
az webapp create --resource-group myResourceGroup \
--plan myAppServicePlan --name myUniqueAppName \
--runtime "NODE|16-lts"
# Deploy
az webapp deployment source config-zip \
--resource-group myResourceGroup \
--name myUniqueAppName \
--src dist.zip# Application health
curl https://your-domain.com/health
# Expected response:
{
"status": "healthy",
"version": "1.2.3",
"uptime": 12345
}
# Database connectivity
curl https://your-domain.com/health/db
# Dependencies status
curl https://your-domain.com/health/dependencies# Test critical endpoints
curl -X POST https://your-domain.com/api/test \
-H "Content-Type: application/json" \
-d '{"test": "data"}'
# Test authentication
curl https://your-domain.com/api/protected \
-H "Authorization: Bearer $TOKEN"# Identify previous version
docker images registry.example.com/app-name
# Deploy previous version
docker stop app-container
docker rm app-container
docker run -d --name app-container \
registry.example.com/app-name:previous-version# View rollout history
kubectl rollout history deployment/app-deployment
# Rollback to previous version
kubectl rollout undo deployment/app-deployment
# Rollback to specific revision
kubectl rollout undo deployment/app-deployment --to-revision=2ls -la dist/
# Verify all necessary files presentprintenv | grep APP_
# Verify all required variables settail -f /var/log/app/error.logsudo systemctl status app-servicesudo netstat -tulpn | grep :3000sudo iptables -L -n | grep 3000
---
### Phase 2: API Documentation
Create comprehensive API reference documentation.
**Step 2.1: Create API.md**
```markdown
# API Documentation
## Base URL
## Authentication
All API requests require authentication using Bearer tokens:
```bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://api.example.com/v1/endpointPOST /auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "password"
}
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600
}GET /users/:idid{
"id": "123",
"email": "user@example.com",
"name": "John Doe",
"created_at": "2025-01-01T00:00:00Z"
}curl -H "Authorization: Bearer TOKEN" \
https://api.example.com/v1/users/123POST /users{
"email": "user@example.com",
"password": "SecurePass123!",
"name": "John Doe"
}201 Created{
"id": "124",
"email": "user@example.com",
"name": "John Doe",
"created_at": "2025-11-10T00:00:00Z"
}400 Bad Request409 Conflict{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable message",
"details": ["Specific error detail"]
}
}UNAUTHORIZEDFORBIDDENNOT_FOUNDVALIDATION_ERRORRATE_LIMIT_EXCEEDEDX-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset
---
## Documentation Standards
### Writing Style
- Use clear, concise language
- Avoid jargon or explain when necessary
- Write for the target audience (developers vs. end-users)
- Use active voice
- Provide examples for everything
- Keep paragraphs short (3-5 sentences)
### Structure
- Start with overview/introduction
- Include table of contents for long documents
- Use clear headings and subheadings
- Provide step-by-step instructions
- Include troubleshooting section
- Add "Next Steps" or "See Also" sections
### Code Examples
- Always test code examples
- Include complete, runnable examples
- Add comments explaining key parts
- Show expected output
- Cover common use cases
### Maintenance
- Date all documentation
- Version documentation with code
- Mark deprecated features clearly
- Keep examples up to date
- Regular review and updates
---
## Collaboration Patterns
### With Architect (or architect-role-skill)
- Review ARCHITECTURE.md for technical accuracy
- Request clarification on design decisions
- Ensure documentation reflects actual architecture
### With Builder (or builder-role-skill)
- Request code walkthroughs for complex features
- Verify API examples match implementation
- Update docs when code changes
### With DevOps (or devops-role-skill)
- Coordinate on deployment documentation
- Verify infrastructure details
- Document monitoring and operations procedures
---
## Examples
### Example 1: New Project Documentation
**Task**: Create complete documentation suite for new Node.js API
```markdown
## Deliverables Created
- README.md (project overview, quick start)
- BUILDING.md (development setup, build process)
- DEPLOYMENT.md (Docker, Kubernetes, cloud platforms)
- API.md (endpoints, authentication, examples)
- CONTRIBUTING.md (contribution guidelines)
**Result**: Complete documentation enabling new developers to get started within 30 minutes## Documentation Added
- Endpoint specifications (request/response schemas)
- Authentication requirements
- Code examples in bash/curl
- Error scenarios and handling
- Rate limiting details
**Result**: API documentation coverage increased from 60% to 95%resources/README_template.mdresources/API_template.mdresources/DEPLOYMENT_template.mdresources/CONTRIBUTING_template.md