@paths.design/caws-cli 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/archive.d.ts +50 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +353 -0
- package/dist/commands/iterate.d.ts.map +1 -1
- package/dist/commands/iterate.js +12 -13
- package/dist/commands/mode.d.ts +24 -0
- package/dist/commands/mode.d.ts.map +1 -0
- package/dist/commands/mode.js +259 -0
- package/dist/commands/plan.d.ts +49 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +448 -0
- package/dist/commands/quality-gates.d.ts +52 -0
- package/dist/commands/quality-gates.d.ts.map +1 -0
- package/dist/commands/quality-gates.js +490 -0
- package/dist/commands/specs.d.ts +71 -0
- package/dist/commands/specs.d.ts.map +1 -0
- package/dist/commands/specs.js +735 -0
- package/dist/commands/status.d.ts +4 -3
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +552 -22
- package/dist/commands/tutorial.d.ts +55 -0
- package/dist/commands/tutorial.d.ts.map +1 -0
- package/dist/commands/tutorial.js +481 -0
- package/dist/commands/validate.d.ts +10 -3
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +137 -54
- package/dist/config/modes.d.ts +225 -0
- package/dist/config/modes.d.ts.map +1 -0
- package/dist/config/modes.js +321 -0
- package/dist/constants/spec-types.d.ts +41 -0
- package/dist/constants/spec-types.d.ts.map +1 -0
- package/dist/constants/spec-types.js +42 -0
- package/dist/index-new.d.ts +5 -0
- package/dist/index-new.d.ts.map +1 -0
- package/dist/index-new.js +317 -0
- package/dist/index.js +225 -10
- package/dist/index.js.backup +4711 -0
- package/dist/scaffold/git-hooks.d.ts.map +1 -1
- package/dist/scaffold/git-hooks.js +32 -44
- package/dist/scaffold/index.d.ts.map +1 -1
- package/dist/scaffold/index.js +19 -0
- package/dist/utils/quality-gates-errors.js +520 -0
- package/dist/utils/quality-gates.d.ts +49 -0
- package/dist/utils/quality-gates.d.ts.map +1 -0
- package/dist/utils/quality-gates.js +361 -0
- package/dist/utils/spec-resolver.d.ts +88 -0
- package/dist/utils/spec-resolver.d.ts.map +1 -0
- package/dist/utils/spec-resolver.js +602 -0
- package/package.json +6 -5
- package/templates/.cursor/hooks/caws-scope-guard.sh +64 -8
- package/templates/.cursor/hooks/validate-spec.sh +22 -12
- package/templates/.cursor/rules/{01-claims-verification.mdc → 00-claims-verification.mdc} +1 -1
- package/templates/.cursor/rules/01-working-style.mdc +50 -0
- package/templates/.cursor/rules/{02-testing-standards.mdc → 02-quality-gates.mdc} +84 -29
- package/templates/.cursor/rules/03-naming-and-refactor.mdc +33 -0
- package/templates/.cursor/rules/04-logging-language-style.mdc +23 -0
- package/templates/.cursor/rules/05-safe-defaults-guards.mdc +23 -0
- package/templates/.cursor/rules/06-typescript-conventions.mdc +36 -0
- package/templates/.cursor/rules/07-process-ops.mdc +20 -0
- package/templates/.cursor/rules/08-solid-and-architecture.mdc +16 -0
- package/templates/.cursor/rules/09-docstrings.mdc +89 -0
- package/templates/.cursor/rules/10-authorship-and-attribution.mdc +15 -0
- package/templates/.cursor/rules/11-documentation-quality-standards.mdc +390 -0
- package/templates/.cursor/rules/12-scope-management-waivers.mdc +385 -0
- package/templates/.cursor/rules/13-implementation-completeness.mdc +516 -0
- package/templates/.cursor/rules/14-language-agnostic-standards.mdc +588 -0
- package/templates/.cursor/rules/15-sophisticated-todo-detection.mdc +425 -0
- package/templates/.cursor/rules/README.md +93 -7
- package/templates/apps/tools/caws/prompt-lint.js.backup +274 -0
- package/templates/apps/tools/caws/provenance.js.backup +73 -0
- package/templates/scripts/quality-gates/check-god-objects.js +146 -0
- package/templates/scripts/quality-gates/run-quality-gates.js +50 -0
- package/templates/scripts/v3/analysis/todo_analyzer.py +1950 -0
- package/templates/.cursor/rules/03-infrastructure-standards.mdc +0 -251
- package/templates/.cursor/rules/04-documentation-integrity.mdc +0 -291
- package/templates/.cursor/rules/05-production-readiness-checklist.mdc +0 -214
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Infrastructure, deployment, and operational standards
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Infrastructure & Deployment Standards
|
|
8
|
-
|
|
9
|
-
## Database Standards
|
|
10
|
-
|
|
11
|
-
### Connection Management
|
|
12
|
-
|
|
13
|
-
- **Connection Pooling**: Always use connection pools, never single connections
|
|
14
|
-
- **Pool Configuration**: Set appropriate min/max connections based on load
|
|
15
|
-
- **Timeout Handling**: Configure connection, query, and idle timeouts
|
|
16
|
-
- **Health Checks**: Implement connection health validation
|
|
17
|
-
- **Graceful Shutdown**: Properly close connections on application shutdown
|
|
18
|
-
|
|
19
|
-
### Schema Management
|
|
20
|
-
|
|
21
|
-
- **Migration Scripts**: Version-controlled, transactional migrations
|
|
22
|
-
- **Downgrade Scripts**: Provide rollback migrations for all changes
|
|
23
|
-
- **Idempotent Operations**: Migrations safe to run multiple times
|
|
24
|
-
- **Testing**: All migrations tested against production-like data
|
|
25
|
-
- **Documentation**: Migration purpose and impact clearly documented
|
|
26
|
-
|
|
27
|
-
### Data Integrity
|
|
28
|
-
|
|
29
|
-
- **Constraints**: Foreign keys, unique constraints, check constraints
|
|
30
|
-
- **Transactions**: All multi-table operations in transactions
|
|
31
|
-
- **Atomicity**: Either all changes succeed or all fail
|
|
32
|
-
- **Consistency**: Database always in valid state
|
|
33
|
-
- **Isolation**: Concurrent operations don't interfere
|
|
34
|
-
|
|
35
|
-
## API Standards
|
|
36
|
-
|
|
37
|
-
### RESTful Design
|
|
38
|
-
|
|
39
|
-
- **Resource Naming**: Plural nouns, consistent casing
|
|
40
|
-
- **HTTP Methods**: GET (read), POST (create), PUT/PATCH (update), DELETE
|
|
41
|
-
- **Status Codes**: Proper HTTP status codes (200, 201, 400, 404, 500, etc.)
|
|
42
|
-
- **Content Types**: JSON for data, appropriate content-type headers
|
|
43
|
-
- **Versioning**: API versioning strategy (URL, headers, or content negotiation)
|
|
44
|
-
|
|
45
|
-
### Error Handling
|
|
46
|
-
|
|
47
|
-
- **Structured Errors**: Consistent error response format
|
|
48
|
-
- **Error Codes**: Machine-readable error codes with human-readable messages
|
|
49
|
-
- **Logging**: All errors logged with appropriate severity
|
|
50
|
-
- **Client Guidance**: Error responses include actionable information
|
|
51
|
-
- **No Information Leakage**: Sensitive information not exposed in errors
|
|
52
|
-
|
|
53
|
-
## Security Standards
|
|
54
|
-
|
|
55
|
-
### Authentication & Authorization
|
|
56
|
-
|
|
57
|
-
- **Token Management**: Secure token storage and validation
|
|
58
|
-
- **Session Handling**: Proper session lifecycle management
|
|
59
|
-
- **Role-Based Access**: Clear role definitions and enforcement
|
|
60
|
-
- **Permission Checking**: Every operation validates permissions
|
|
61
|
-
- **Audit Logging**: All security events logged
|
|
62
|
-
|
|
63
|
-
### Input Validation
|
|
64
|
-
|
|
65
|
-
- **Schema Validation**: All inputs validated against schemas
|
|
66
|
-
- **Sanitization**: User input sanitized before processing
|
|
67
|
-
- **Type Safety**: Runtime type checking for external inputs
|
|
68
|
-
- **Length Limits**: Reasonable limits on input sizes
|
|
69
|
-
- **Content Filtering**: Malicious content detection and blocking
|
|
70
|
-
|
|
71
|
-
## Monitoring & Observability
|
|
72
|
-
|
|
73
|
-
### Logging Standards
|
|
74
|
-
|
|
75
|
-
- **Structured Logging**: JSON format with consistent field names
|
|
76
|
-
- **Log Levels**: ERROR, WARN, INFO, DEBUG appropriately used
|
|
77
|
-
- **Context Information**: Request IDs, user context, operation details
|
|
78
|
-
- **Performance Logging**: Response times, resource usage
|
|
79
|
-
- **Error Correlation**: Related events linked together
|
|
80
|
-
|
|
81
|
-
### Metrics Collection
|
|
82
|
-
|
|
83
|
-
- **Business Metrics**: User registrations, API calls, conversion rates
|
|
84
|
-
- **Performance Metrics**: Response times, throughput, error rates
|
|
85
|
-
- **Resource Metrics**: CPU, memory, disk, network usage
|
|
86
|
-
- **Custom Metrics**: Application-specific KPIs
|
|
87
|
-
- **Alert Thresholds**: Defined thresholds for automated alerts
|
|
88
|
-
|
|
89
|
-
### Health Checks
|
|
90
|
-
|
|
91
|
-
- **Application Health**: Service availability and responsiveness
|
|
92
|
-
- **Dependency Health**: Database, external APIs, message queues
|
|
93
|
-
- **Resource Health**: Disk space, memory, connection pools
|
|
94
|
-
- **Business Health**: Core business operations functional
|
|
95
|
-
- **Automated Recovery**: Self-healing capabilities
|
|
96
|
-
|
|
97
|
-
## Deployment Standards
|
|
98
|
-
|
|
99
|
-
### Environment Configuration
|
|
100
|
-
|
|
101
|
-
- **Environment Variables**: No hardcoded configuration values
|
|
102
|
-
- **Configuration Files**: Version-controlled, environment-specific configs
|
|
103
|
-
- **Secrets Management**: Secure storage and access for secrets
|
|
104
|
-
- **Validation**: Configuration validated at startup
|
|
105
|
-
- **Documentation**: All configuration options documented
|
|
106
|
-
|
|
107
|
-
### Container Standards
|
|
108
|
-
|
|
109
|
-
- **Base Images**: Minimal, secure base images
|
|
110
|
-
- **Layer Optimization**: Efficient layer caching and ordering
|
|
111
|
-
- **Security Scanning**: Container images scanned for vulnerabilities
|
|
112
|
-
- **Resource Limits**: CPU and memory limits set appropriately
|
|
113
|
-
- **Health Checks**: Container health checks implemented
|
|
114
|
-
|
|
115
|
-
### CI/CD Pipeline
|
|
116
|
-
|
|
117
|
-
- **Automated Testing**: Full test suite runs on every commit
|
|
118
|
-
- **Security Scanning**: Automated security scans in pipeline
|
|
119
|
-
- **Performance Testing**: Automated performance regression tests
|
|
120
|
-
- **Deployment Automation**: Zero-touch deployment processes
|
|
121
|
-
- **Rollback Capability**: Automated rollback procedures
|
|
122
|
-
|
|
123
|
-
## Reliability Standards
|
|
124
|
-
|
|
125
|
-
### Circuit Breaker Pattern
|
|
126
|
-
|
|
127
|
-
- **Failure Threshold**: Configurable failure count before opening
|
|
128
|
-
- **Recovery Timeout**: Time before attempting recovery
|
|
129
|
-
- **Success Threshold**: Successes needed to close circuit
|
|
130
|
-
- **Fallback Behavior**: Graceful degradation when circuit open
|
|
131
|
-
- **Monitoring**: Circuit state and failure rates monitored
|
|
132
|
-
|
|
133
|
-
### Retry Logic
|
|
134
|
-
|
|
135
|
-
- **Exponential Backoff**: Increasing delay between retries
|
|
136
|
-
- **Jitter**: Randomization to prevent thundering herd
|
|
137
|
-
- **Maximum Retries**: Configurable retry limits
|
|
138
|
-
- **Retry Conditions**: Only retry appropriate error types
|
|
139
|
-
- **Circuit Integration**: Retry logic respects circuit breaker state
|
|
140
|
-
|
|
141
|
-
### Graceful Degradation
|
|
142
|
-
|
|
143
|
-
- **Feature Flags**: Ability to disable features under load
|
|
144
|
-
- **Fallback Content**: Cached or simplified content when services fail
|
|
145
|
-
- **Progressive Enhancement**: Core functionality works without extras
|
|
146
|
-
- **User Communication**: Clear messaging about degraded functionality
|
|
147
|
-
- **Automatic Recovery**: Services automatically recover when possible
|
|
148
|
-
|
|
149
|
-
## Performance Standards
|
|
150
|
-
|
|
151
|
-
### Response Time SLAs
|
|
152
|
-
|
|
153
|
-
- **API Endpoints**: P95 response times defined and monitored
|
|
154
|
-
- **Page Load Times**: Frontend performance budgets
|
|
155
|
-
- **Database Queries**: Query performance thresholds
|
|
156
|
-
- **Background Jobs**: Job completion time limits
|
|
157
|
-
- **Real-time Operations**: Sub-second response requirements
|
|
158
|
-
|
|
159
|
-
### Resource Management
|
|
160
|
-
|
|
161
|
-
- **Memory Usage**: Monitor and limit memory consumption
|
|
162
|
-
- **CPU Utilization**: Efficient CPU usage patterns
|
|
163
|
-
- **Disk I/O**: Optimize file system operations
|
|
164
|
-
- **Network Usage**: Efficient network communication
|
|
165
|
-
- **Connection Pools**: Proper sizing of database and external connections
|
|
166
|
-
|
|
167
|
-
### Caching Strategy
|
|
168
|
-
|
|
169
|
-
- **Cache Invalidation**: Proper cache invalidation strategies
|
|
170
|
-
- **Cache Penetration**: Protection against cache penetration attacks
|
|
171
|
-
- **Cache Warming**: Proactive cache population for hot data
|
|
172
|
-
- **Distributed Caching**: Scalable caching across multiple instances
|
|
173
|
-
- **Cache Monitoring**: Cache hit rates and performance monitoring
|
|
174
|
-
|
|
175
|
-
## Scalability Standards
|
|
176
|
-
|
|
177
|
-
### Horizontal Scaling
|
|
178
|
-
|
|
179
|
-
- **Stateless Design**: Applications designed for horizontal scaling
|
|
180
|
-
- **Shared Nothing**: Instances don't share local state
|
|
181
|
-
- **Load Balancing**: Proper load distribution across instances
|
|
182
|
-
- **Session Management**: Distributed session storage
|
|
183
|
-
- **Configuration**: Centralized configuration management
|
|
184
|
-
|
|
185
|
-
### Database Scaling
|
|
186
|
-
|
|
187
|
-
- **Read Replicas**: Read operations distributed across replicas
|
|
188
|
-
- **Sharding Strategy**: Data partitioning strategy defined
|
|
189
|
-
- **Connection Pooling**: Efficient connection management
|
|
190
|
-
- **Query Optimization**: Efficient query patterns
|
|
191
|
-
- **Indexing Strategy**: Appropriate indexes for query patterns
|
|
192
|
-
|
|
193
|
-
### Asynchronous Processing
|
|
194
|
-
|
|
195
|
-
- **Message Queues**: Asynchronous task processing
|
|
196
|
-
- **Background Jobs**: Long-running tasks processed asynchronously
|
|
197
|
-
- **Event-Driven Architecture**: Loose coupling through events
|
|
198
|
-
- **Dead Letter Queues**: Handling of failed message processing
|
|
199
|
-
- **Monitoring**: Queue depth and processing rate monitoring
|
|
200
|
-
|
|
201
|
-
## Backup & Recovery
|
|
202
|
-
|
|
203
|
-
### Data Backup
|
|
204
|
-
|
|
205
|
-
- **Regular Backups**: Automated backup schedules
|
|
206
|
-
- **Backup Verification**: Backup integrity validation
|
|
207
|
-
- **Retention Policies**: Backup retention periods defined
|
|
208
|
-
- **Encryption**: Backup data encrypted at rest and in transit
|
|
209
|
-
- **Testing**: Backup restoration regularly tested
|
|
210
|
-
|
|
211
|
-
### Disaster Recovery
|
|
212
|
-
|
|
213
|
-
- **Recovery Time Objective (RTO)**: Maximum acceptable downtime
|
|
214
|
-
- **Recovery Point Objective (RPO)**: Maximum data loss acceptable
|
|
215
|
-
- **Multi-Region Deployment**: Geographic redundancy
|
|
216
|
-
- **Failover Procedures**: Automated and manual failover processes
|
|
217
|
-
- **Recovery Testing**: Regular disaster recovery drills
|
|
218
|
-
|
|
219
|
-
### Business Continuity
|
|
220
|
-
|
|
221
|
-
- **Service Level Agreements**: Defined uptime and performance guarantees
|
|
222
|
-
- **Incident Response**: Defined incident response procedures
|
|
223
|
-
- **Communication Plans**: Stakeholder communication during incidents
|
|
224
|
-
- **Post-Mortem Process**: Incident analysis and improvement process
|
|
225
|
-
- **Continuous Improvement**: Regular review and improvement of processes
|
|
226
|
-
|
|
227
|
-
## Compliance & Governance
|
|
228
|
-
|
|
229
|
-
### Security Compliance
|
|
230
|
-
|
|
231
|
-
- **Data Encryption**: Data encrypted at rest and in transit
|
|
232
|
-
- **Access Controls**: Principle of least privilege enforced
|
|
233
|
-
- **Audit Trails**: Comprehensive audit logging
|
|
234
|
-
- **Vulnerability Management**: Regular security assessments
|
|
235
|
-
- **Incident Response**: Security incident response procedures
|
|
236
|
-
|
|
237
|
-
### Data Privacy
|
|
238
|
-
|
|
239
|
-
- **Data Classification**: Sensitive data properly classified
|
|
240
|
-
- **Retention Policies**: Data retention periods defined
|
|
241
|
-
- **Consent Management**: User consent properly managed
|
|
242
|
-
- **Data Deletion**: Right to deletion implemented
|
|
243
|
-
- **Privacy Impact Assessments**: Privacy risks assessed
|
|
244
|
-
|
|
245
|
-
### Regulatory Compliance
|
|
246
|
-
|
|
247
|
-
- **GDPR Compliance**: EU data protection regulations
|
|
248
|
-
- **CCPA Compliance**: California consumer privacy regulations
|
|
249
|
-
- **Industry Standards**: Relevant industry compliance requirements
|
|
250
|
-
- **Audit Readiness**: Systems designed for regulatory audits
|
|
251
|
-
- **Documentation**: Compliance evidence properly documented
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Documentation must match implementation reality - no claims of unimplemented features
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Documentation Integrity & Reality Alignment
|
|
8
|
-
|
|
9
|
-
## Core Principle
|
|
10
|
-
|
|
11
|
-
**Documentation must accurately reflect implementation reality.** Never claim features exist that don't work, APIs that aren't implemented, or capabilities that are just placeholders.
|
|
12
|
-
|
|
13
|
-
## Documentation Standards
|
|
14
|
-
|
|
15
|
-
### README Accuracy
|
|
16
|
-
|
|
17
|
-
- **Feature Claims**: Only document features that are fully implemented and tested
|
|
18
|
-
- **Installation Instructions**: Must work on a clean environment
|
|
19
|
-
- **Usage Examples**: Code examples must run without errors
|
|
20
|
-
- **API Documentation**: All documented endpoints must exist and work
|
|
21
|
-
- **Prerequisites**: All required dependencies and versions listed
|
|
22
|
-
|
|
23
|
-
### API Documentation
|
|
24
|
-
|
|
25
|
-
- **Endpoint Completeness**: All documented endpoints implemented
|
|
26
|
-
- **Parameter Accuracy**: Request/response schemas match implementation
|
|
27
|
-
- **Error Responses**: Documented error codes match actual errors
|
|
28
|
-
- **Authentication**: Auth requirements match implementation
|
|
29
|
-
- **Examples**: Working code examples for all major endpoints
|
|
30
|
-
|
|
31
|
-
### Architecture Documentation
|
|
32
|
-
|
|
33
|
-
- **Component Diagrams**: Reflect actual code structure
|
|
34
|
-
- **Data Flow**: Match actual data processing paths
|
|
35
|
-
- **Integration Points**: Document real integrations, not planned ones
|
|
36
|
-
- **Deployment Architecture**: Match actual infrastructure
|
|
37
|
-
- **Scaling Strategy**: Based on implemented capabilities
|
|
38
|
-
|
|
39
|
-
## Implementation vs Documentation Verification
|
|
40
|
-
|
|
41
|
-
### Feature Claims Verification
|
|
42
|
-
|
|
43
|
-
Before documenting any feature, verify:
|
|
44
|
-
|
|
45
|
-
- [ ] Feature fully implemented (not placeholder/mock)
|
|
46
|
-
- [ ] Feature tested end-to-end
|
|
47
|
-
- [ ] Feature handles error cases
|
|
48
|
-
- [ ] Feature documented in user-facing docs
|
|
49
|
-
- [ ] Feature matches acceptance criteria
|
|
50
|
-
|
|
51
|
-
### API Documentation Verification
|
|
52
|
-
|
|
53
|
-
For every documented API:
|
|
54
|
-
|
|
55
|
-
- [ ] Endpoint exists and responds
|
|
56
|
-
- [ ] Request/response formats match docs
|
|
57
|
-
- [ ] Authentication works as documented
|
|
58
|
-
- [ ] Error handling matches documentation
|
|
59
|
-
- [ ] Rate limits implemented if documented
|
|
60
|
-
|
|
61
|
-
### Code Documentation Verification
|
|
62
|
-
|
|
63
|
-
For all public APIs:
|
|
64
|
-
|
|
65
|
-
- [ ] JSDoc/TSDoc comments accurate
|
|
66
|
-
- [ ] Parameter types match implementation
|
|
67
|
-
- [ ] Return types correct
|
|
68
|
-
- [ ] Error conditions documented
|
|
69
|
-
- [ ] Usage examples work
|
|
70
|
-
|
|
71
|
-
## Prohibited Documentation Patterns
|
|
72
|
-
|
|
73
|
-
### ❌ Feature Bloat Documentation
|
|
74
|
-
|
|
75
|
-
```markdown
|
|
76
|
-
<!-- DON'T document unimplemented features -->
|
|
77
|
-
|
|
78
|
-
## Features
|
|
79
|
-
|
|
80
|
-
- ✅ User authentication
|
|
81
|
-
- ✅ Real-time notifications
|
|
82
|
-
- ✅ Advanced analytics dashboard <!-- Not implemented yet -->
|
|
83
|
-
- ✅ Machine learning recommendations <!-- Placeholder only -->
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### ❌ Vague Status Claims
|
|
87
|
-
|
|
88
|
-
```markdown
|
|
89
|
-
<!-- DON'T use ambiguous status -->
|
|
90
|
-
|
|
91
|
-
Status: Production Ready (75% complete) <!-- Confusing -->
|
|
92
|
-
Status: In Development (25% complete) <!-- Better -->
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### ❌ Outdated Examples
|
|
96
|
-
|
|
97
|
-
```javascript
|
|
98
|
-
// DON'T: Example that doesn't work
|
|
99
|
-
fetch("/api/users", {
|
|
100
|
-
method: "POST",
|
|
101
|
-
body: JSON.stringify({ name: "John" }), // Missing required email field
|
|
102
|
-
});
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### ❌ Missing Error Documentation
|
|
106
|
-
|
|
107
|
-
```typescript
|
|
108
|
-
// DON'T: Undocumented error conditions
|
|
109
|
-
function processPayment(amount: number): Promise<PaymentResult> {
|
|
110
|
-
// What happens if amount < 0? Not documented
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## Documentation Maintenance Standards
|
|
115
|
-
|
|
116
|
-
### Change Documentation Updates
|
|
117
|
-
|
|
118
|
-
- **Breaking Changes**: Update documentation immediately
|
|
119
|
-
- **New Features**: Document before release
|
|
120
|
-
- **API Changes**: Update API docs in same PR
|
|
121
|
-
- **Deprecations**: Mark deprecated features clearly
|
|
122
|
-
- **Migration Guides**: Provide for breaking changes
|
|
123
|
-
|
|
124
|
-
### Version Consistency
|
|
125
|
-
|
|
126
|
-
- **Changelog**: Accurate for each version
|
|
127
|
-
- **Version Numbers**: Match actual releases
|
|
128
|
-
- **Deprecation Notices**: Clear timelines and alternatives
|
|
129
|
-
- **Compatibility Matrix**: Accurate version compatibility
|
|
130
|
-
|
|
131
|
-
### Documentation Testing
|
|
132
|
-
|
|
133
|
-
- **Link Validation**: All links in docs work
|
|
134
|
-
- **Code Example Testing**: Examples tested in CI
|
|
135
|
-
- **Installation Verification**: Setup instructions tested
|
|
136
|
-
- **Cross-Platform**: Docs work on documented platforms
|
|
137
|
-
|
|
138
|
-
## Reality Alignment Checks
|
|
139
|
-
|
|
140
|
-
### Implementation Inventory
|
|
141
|
-
|
|
142
|
-
Maintain accurate inventory:
|
|
143
|
-
|
|
144
|
-
- [ ] Count actual source files vs documented components
|
|
145
|
-
- [ ] Verify test coverage matches claims
|
|
146
|
-
- [ ] Check database schema matches docs
|
|
147
|
-
- [ ] Validate configuration options exist
|
|
148
|
-
- [ ] Confirm external integrations work
|
|
149
|
-
|
|
150
|
-
### Feature Parity Audit
|
|
151
|
-
|
|
152
|
-
Regular audits to ensure:
|
|
153
|
-
|
|
154
|
-
- [ ] No documented features are missing
|
|
155
|
-
- [ ] No implemented features are undocumented
|
|
156
|
-
- [ ] No placeholder implementations documented as complete
|
|
157
|
-
- [ ] No deprecated features still documented as current
|
|
158
|
-
|
|
159
|
-
### User Experience Verification
|
|
160
|
-
|
|
161
|
-
- [ ] Onboarding works as documented
|
|
162
|
-
- [ ] Common use cases work end-to-end
|
|
163
|
-
- [ ] Error messages helpful and accurate
|
|
164
|
-
- [ ] Performance matches documented SLAs
|
|
165
|
-
|
|
166
|
-
## Correct Documentation Patterns
|
|
167
|
-
|
|
168
|
-
### ✅ Accurate Feature Status
|
|
169
|
-
|
|
170
|
-
```markdown
|
|
171
|
-
## Features
|
|
172
|
-
|
|
173
|
-
### ✅ Implemented
|
|
174
|
-
|
|
175
|
-
- User authentication with JWT tokens
|
|
176
|
-
- Real-time notifications via WebSocket
|
|
177
|
-
- Basic analytics dashboard
|
|
178
|
-
|
|
179
|
-
### 🚧 In Development
|
|
180
|
-
|
|
181
|
-
- Advanced ML recommendations (Q2 2025)
|
|
182
|
-
- Multi-tenant isolation (Q1 2025)
|
|
183
|
-
|
|
184
|
-
### 📋 Planned
|
|
185
|
-
|
|
186
|
-
- AI-powered chat support (Q3 2025)
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### ✅ Working Code Examples
|
|
190
|
-
|
|
191
|
-
```javascript
|
|
192
|
-
// POST /api/users
|
|
193
|
-
const response = await fetch("/api/users", {
|
|
194
|
-
method: "POST",
|
|
195
|
-
headers: {
|
|
196
|
-
"Content-Type": "application/json",
|
|
197
|
-
Authorization: `Bearer ${token}`,
|
|
198
|
-
},
|
|
199
|
-
body: JSON.stringify({
|
|
200
|
-
name: "John Doe",
|
|
201
|
-
email: "john@example.com", // Required field included
|
|
202
|
-
password: "securePassword123",
|
|
203
|
-
}),
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
if (!response.ok) {
|
|
207
|
-
throw new Error(`Failed to create user: ${response.statusText}`);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const user = await response.json();
|
|
211
|
-
console.log("Created user:", user);
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
### ✅ Complete API Documentation
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
/**
|
|
218
|
-
* Creates a new user account
|
|
219
|
-
* @param userData User registration data
|
|
220
|
-
* @returns Promise<User> The created user object
|
|
221
|
-
* @throws ValidationError if email format invalid
|
|
222
|
-
* @throws ConflictError if email already exists
|
|
223
|
-
* @throws RateLimitError if too many requests
|
|
224
|
-
*/
|
|
225
|
-
async function createUser(userData: CreateUserRequest): Promise<User> {
|
|
226
|
-
// Implementation
|
|
227
|
-
}
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### ✅ Realistic Status Claims
|
|
231
|
-
|
|
232
|
-
```markdown
|
|
233
|
-
# Project Status
|
|
234
|
-
|
|
235
|
-
**Current Status**: In Development (Proof of Concept)
|
|
236
|
-
|
|
237
|
-
**Production Readiness**: 25% - Core authentication and basic API working, but missing:
|
|
238
|
-
|
|
239
|
-
- Database persistence (in-memory only)
|
|
240
|
-
- Security hardening
|
|
241
|
-
- Comprehensive testing
|
|
242
|
-
- Production deployment pipeline
|
|
243
|
-
|
|
244
|
-
**Next Milestone**: Alpha release (Q1 2025) with full persistence layer
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
## Documentation Quality Metrics
|
|
248
|
-
|
|
249
|
-
### Completeness Score
|
|
250
|
-
|
|
251
|
-
- **API Coverage**: % of public APIs documented
|
|
252
|
-
- **Feature Documentation**: % of features with user docs
|
|
253
|
-
- **Code Examples**: % of APIs with working examples
|
|
254
|
-
- **Error Documentation**: % of error conditions documented
|
|
255
|
-
|
|
256
|
-
### Accuracy Score
|
|
257
|
-
|
|
258
|
-
- **Working Examples**: % of code examples that run successfully
|
|
259
|
-
- **Link Validity**: % of documentation links that work
|
|
260
|
-
- **Version Accuracy**: % of version references that are current
|
|
261
|
-
- **Implementation Match**: % of documented features that work as described
|
|
262
|
-
|
|
263
|
-
### Maintenance Score
|
|
264
|
-
|
|
265
|
-
- **Update Frequency**: How often docs are updated vs code changes
|
|
266
|
-
- **Review Coverage**: % of doc changes that are reviewed
|
|
267
|
-
- **User Feedback**: Response time to documentation issues
|
|
268
|
-
- **Cross-Platform**: % of supported platforms with verified docs
|
|
269
|
-
|
|
270
|
-
## Enforcement Mechanisms
|
|
271
|
-
|
|
272
|
-
### Automated Checks
|
|
273
|
-
|
|
274
|
-
- **Documentation Tests**: CI runs documentation validation
|
|
275
|
-
- **Link Checking**: Automated link validation in docs
|
|
276
|
-
- **Example Testing**: Code examples executed in CI
|
|
277
|
-
- **API Contract Testing**: Docs vs implementation validation
|
|
278
|
-
|
|
279
|
-
### Review Requirements
|
|
280
|
-
|
|
281
|
-
- **Documentation Reviews**: Require review for doc changes
|
|
282
|
-
- **Implementation Reviews**: Check docs match implementation
|
|
283
|
-
- **User Testing**: Validate docs from user perspective
|
|
284
|
-
- **Cross-Functional Reviews**: Include different roles in reviews
|
|
285
|
-
|
|
286
|
-
### Accountability Measures
|
|
287
|
-
|
|
288
|
-
- **Documentation Debt**: Track unimplemented documented features
|
|
289
|
-
- **Reality Gap Metrics**: Measure docs vs implementation accuracy
|
|
290
|
-
- **User Feedback Integration**: Incorporate user-reported doc issues
|
|
291
|
-
- **Continuous Improvement**: Regular documentation quality reviews
|