framework/web_development/.qoder/skills/documentation/SKILL.md
Generate clear documentation for each task including technical descriptions, architecture diagrams, and usage guides. Use when documenting completed features, creating README files, writing API documentation, generating architecture diagrams, or maintaining project documentation. Ensures knowledge is preserved and accessible.
npx skillsauth add b4san/ac-framework documentationInstall 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.
Automated generation and maintenance of technical documentation, architecture diagrams, and usage guides.
Use this skill when:
Identify the audience:
Determine document type:
Check existing docs:
Structure for project README:
# Project Name
Brief description of what this project does.
## Features
- Feature 1: Brief description
- Feature 2: Brief description
- Feature 3: Brief description
## Installation
\`\`\`bash
# Clone the repository
git clone https://github.com/user/repo.git
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Run database migrations
npm run migrate
\`\`\`
## Usage
### Quick Start
\`\`\`bash
# Start development server
npm run dev
# Build for production
npm run build
# Run tests
npm test
\`\`\`
### Configuration
Describe configuration options here.
## API Documentation
See [API.md](docs/API.md) for detailed API documentation.
## Architecture
See [ARCHITECTURE.md](docs/ARCHITECTURE.md) for system design details.
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## License
[MIT](LICENSE)
Document each endpoint:
## Endpoint: POST /api/users
Create a new user account.
### Request
\`\`\`http
POST /api/users
Content-Type: application/json
{
"name": "John Doe",
"email": "[email protected]",
"password": "securePassword123"
}
\`\`\`
### Response
**Success (201 Created)**:
\`\`\`json
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "John Doe",
"email": "[email protected]",
"createdAt": "2024-01-15T10:30:00Z"
}
\`\`\`
**Error (400 Bad Request)**:
\`\`\`json
{
"error": "Validation failed",
"details": [
{ "field": "email", "message": "Invalid email format" }
]
}
\`\`\`
### Authentication
Requires Bearer token in Authorization header.
### Notes
- Email must be unique
- Password minimum 8 characters
- Rate limited to 10 requests per minute
Use Mermaid for diagrams:
System Architecture:
\`\`\`mermaid
graph TB
Client[Client Browser] -->|HTTP| LB[Load Balancer]
LB -->|Route| API[API Gateway]
API -->|Auth| Auth[Auth Service]
API -->|Request| App[Application Server]
App -->|Query| DB[(Database)]
App -->|Cache| Redis[(Redis)]
App -->|Queue| MQ[Message Queue]
MQ -->|Process| Worker[Background Worker]
\`\`\`
Data Flow:
\`\`\`mermaid
sequenceDiagram
participant User
participant API
participant Service
participant DB
User->>API: POST /orders
API->>Service: createOrder(data)
Service->>DB: INSERT INTO orders
DB-->>Service: order_id
Service-->>API: Order created
API-->>User: 201 Created
\`\`\`
Component Diagram:
\`\`\`mermaid
classDiagram
class User {
+String id
+String name
+String email
+login()
+logout()
}
class Order {
+String id
+String userId
+Date createdAt
+calculateTotal()
}
User "1" --> "*" Order : places
\`\`\`
Document modules/components:
## Module: Authentication
### Purpose
Handles user authentication and session management.
### Components
#### AuthService
**Location**: `src/services/auth.js`
**Methods**:
- `login(email, password)`: Authenticate user
- `logout()`: End user session
- `validateToken(token)`: Verify JWT token
- `refreshToken(token)`: Get new access token
**Usage**:
\`\`\`javascript
import { AuthService } from './services/auth';
const auth = new AuthService();
const user = await auth.login('[email protected]', 'password');
\`\`\`
### Configuration
\`\`\`javascript
{
jwtSecret: process.env.JWT_SECRET,
expiresIn: '24h',
refreshExpiresIn: '7d'
}
\`\`\`
### Dependencies
- jsonwebtoken: JWT handling
- bcrypt: Password hashing
- User model: Database operations
Step-by-step guides for common tasks:
## How to Add a New Feature
### 1. Create a Change
\`\`\`bash
acfm spec new my-feature
\`\`\`
### 2. Write Proposal
Edit `.acfm/changes/my-feature/proposal.md`
### 3. Design Specifications
Create files in `.acfm/changes/my-feature/specs/`
### 4. Implement
Run the apply command:
\`\`\`bash
acfm spec apply my-feature
\`\`\`
### 5. Verify
\`\`\`bash
acfm spec verify my-feature
\`\`\`
### 6. Archive
\`\`\`bash
acfm spec archive my-feature
\`\`\`
Architecture Decision Records:
# ADR 001: Use PostgreSQL as Primary Database
## Status
Accepted
## Context
We needed a relational database for structured data with complex queries.
## Decision
Use PostgreSQL as our primary database.
## Consequences
**Positive**:
- ACID compliance
- Rich query capabilities
- JSON support for flexible schemas
- Strong community
**Negative**:
- Requires database migrations
- Vertical scaling limitations
- Operational complexity
## Alternatives Considered
- **MySQL**: Good, but less feature-rich
- **MongoDB**: Better for unstructured data, but we need relations
- **DynamoDB**: Good for simple queries, complex joins are difficult
## References
- [PostgreSQL Documentation](https://www.postgresql.org/docs/)
Check completeness:
Check accuracy:
Check links:
Check formatting:
Reference OpenSpec changes in documentation:
## Recent Changes
- [User Authentication](.acfm/changes/user-auth/) - Implemented JWT-based auth
- [API Rate Limiting](.acfm/changes/rate-limit/) - Added rate limiting middleware
- [Database Migration](.acfm/changes/db-migration/) - Migrated to PostgreSQL 15
After documentation is complete:
## Documentation Summary
**Files Created**:
- README.md (updated)
- docs/API.md (new)
- docs/ARCHITECTURE.md (new)
- docs/GUIDE.md (new)
- docs/adr/001-postgresql.md (new)
**Diagrams Generated**:
- System architecture (Mermaid)
- Data flow sequence (Mermaid)
- Component diagram (Mermaid)
**Skills Referenced**:
- openspec-new-change
- openspec-continue-change
- vercel-react-best-practices
sync-index - Keep docs in sync with codechangelog-generator - Generate release notesopenspec-archive-change - Document archived changesskill-writer - Document new skillsdevelopment
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
Automate the generation and maintenance of unit, integration, and end-to-end tests, as well as test data generation and debugging. Use when writing tests for new features, maintaining existing tests after API/UI changes, generating synthetic test data, or debugging test failures. Essential for ensuring code quality and preventing regressions.
testing
Generate comprehensive test suites ensuring requirements are met. Strategies for Unit, Integration, and E2E testing.
development
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes