tlc-claude-code 0.6.4 → 0.7.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/docs.md ADDED
@@ -0,0 +1,494 @@
1
+ # /tlc:docs - Team Documentation
2
+
3
+ Generate and maintain project documentation for your team.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /tlc:docs [command]
9
+ ```
10
+
11
+ Commands:
12
+ - `generate` - Generate docs from code and plans
13
+ - `api` - Generate API documentation
14
+ - `setup` - Create team onboarding guide
15
+ - `changelog` - Generate changelog from commits
16
+ - `decisions` - Document architectural decisions
17
+
18
+ ## Generate Documentation
19
+
20
+ ```
21
+ > /tlc:docs generate
22
+
23
+ Analyzing project...
24
+
25
+ Found:
26
+ - 45 source files
27
+ - 12 API endpoints
28
+ - 8 phases planned
29
+ - 23 completed tasks
30
+
31
+ Generating documentation...
32
+
33
+ Created:
34
+ docs/
35
+ README.md Project overview
36
+ ARCHITECTURE.md System design
37
+ API.md API reference
38
+ CONTRIBUTING.md How to contribute
39
+ ONBOARDING.md New team member guide
40
+ CHANGELOG.md Version history
41
+
42
+ Open docs/README.md? (Y/n)
43
+ ```
44
+
45
+ ## API Documentation
46
+
47
+ ### From Code
48
+
49
+ ```
50
+ > /tlc:docs api
51
+
52
+ Scanning for API routes...
53
+
54
+ Found 12 endpoints:
55
+ POST /api/auth/login
56
+ POST /api/auth/register
57
+ GET /api/users
58
+ GET /api/users/:id
59
+ PUT /api/users/:id
60
+ DELETE /api/users/:id
61
+ ...
62
+
63
+ Generating docs/API.md...
64
+
65
+ Options:
66
+ 1) OpenAPI/Swagger format
67
+ 2) Markdown format
68
+ 3) Both
69
+
70
+ Choice: 3
71
+
72
+ Created:
73
+ docs/API.md Markdown documentation
74
+ docs/openapi.yaml OpenAPI 3.0 spec
75
+ ```
76
+
77
+ ### Generated API.md
78
+
79
+ ```markdown
80
+ # API Reference
81
+
82
+ Base URL: `http://localhost:3000/api`
83
+
84
+ ## Authentication
85
+
86
+ ### POST /auth/login
87
+
88
+ Login with email and password.
89
+
90
+ **Request:**
91
+ ```json
92
+ {
93
+ "email": "user@example.com",
94
+ "password": "secret123"
95
+ }
96
+ ```
97
+
98
+ **Response:**
99
+ ```json
100
+ {
101
+ "token": "eyJ...",
102
+ "user": {
103
+ "id": "123",
104
+ "email": "user@example.com"
105
+ }
106
+ }
107
+ ```
108
+
109
+ **Errors:**
110
+ | Code | Description |
111
+ |------|-------------|
112
+ | 401 | Invalid credentials |
113
+ | 400 | Missing email or password |
114
+
115
+ ---
116
+
117
+ ### POST /auth/register
118
+ ...
119
+ ```
120
+
121
+ ## Team Onboarding
122
+
123
+ ```
124
+ > /tlc:docs setup
125
+
126
+ Creating team onboarding documentation...
127
+
128
+ Questions:
129
+ 1. Project name: My Project
130
+ 2. Tech stack: Node.js, React, PostgreSQL
131
+ 3. Dev environment: Docker? (Y/n) y
132
+ 4. Testing: mocha (detected)
133
+ 5. CI/CD: GitHub Actions (detected)
134
+
135
+ Created docs/ONBOARDING.md
136
+
137
+ Preview:
138
+ ---
139
+ # Onboarding Guide
140
+
141
+ Welcome to My Project!
142
+
143
+ ## Quick Start
144
+
145
+ 1. Clone the repo
146
+ 2. Run `docker-compose up`
147
+ 3. Visit http://localhost:3000
148
+
149
+ ## Development
150
+
151
+ ### Prerequisites
152
+ - Node.js 20+
153
+ - Docker Desktop
154
+ - VS Code (recommended)
155
+
156
+ ### Setup
157
+ ```bash
158
+ git clone git@github.com:acme/myproject.git
159
+ cd myproject
160
+ npm install
161
+ docker-compose up -d db
162
+ npm run dev
163
+ ```
164
+
165
+ ### Testing
166
+ ```bash
167
+ npm test # Run all tests
168
+ npm run test:watch # Watch mode
169
+ ```
170
+
171
+ ### Common Tasks
172
+ - `/tlc` - See what to work on next
173
+ - `/tlc:claim N` - Claim a task
174
+ - `/tlc:build` - Build with tests
175
+
176
+ ## Architecture
177
+
178
+ See [ARCHITECTURE.md](ARCHITECTURE.md)
179
+
180
+ ## API
181
+
182
+ See [API.md](API.md)
183
+ ---
184
+ ```
185
+
186
+ ## Architecture Documentation
187
+
188
+ ```
189
+ > /tlc:docs architecture
190
+
191
+ Analyzing codebase structure...
192
+
193
+ Detected patterns:
194
+ - MVC architecture
195
+ - REST API
196
+ - Repository pattern for data access
197
+ - Service layer for business logic
198
+
199
+ Creating docs/ARCHITECTURE.md...
200
+
201
+ Preview:
202
+ ---
203
+ # Architecture
204
+
205
+ ## Overview
206
+
207
+ ```
208
+ ┌──────────────────────────────────────────────────┐
209
+ │ Frontend │
210
+ │ (React SPA) │
211
+ └──────────────────────┬───────────────────────────┘
212
+ │ HTTP/REST
213
+ ┌──────────────────────┴───────────────────────────┐
214
+ │ API Layer │
215
+ │ (Express Controllers) │
216
+ ├──────────────────────────────────────────────────┤
217
+ │ Service Layer │
218
+ │ (Business Logic) │
219
+ ├──────────────────────────────────────────────────┤
220
+ │ Repository Layer │
221
+ │ (Data Access) │
222
+ └──────────────────────┬───────────────────────────┘
223
+
224
+ ┌──────────────────────┴───────────────────────────┐
225
+ │ PostgreSQL │
226
+ └──────────────────────────────────────────────────┘
227
+ ```
228
+
229
+ ## Directory Structure
230
+
231
+ ```
232
+ src/
233
+ ├── controllers/ API route handlers
234
+ ├── services/ Business logic
235
+ ├── repositories/ Database queries
236
+ ├── models/ Data models
237
+ ├── middleware/ Express middleware
238
+ └── utils/ Shared utilities
239
+ ```
240
+
241
+ ## Key Components
242
+
243
+ ### AuthService
244
+ Handles authentication and session management.
245
+ Location: `src/services/auth.js`
246
+
247
+ ### UserRepository
248
+ User database operations.
249
+ Location: `src/repositories/user.js`
250
+ ---
251
+ ```
252
+
253
+ ## Changelog Generation
254
+
255
+ ```
256
+ > /tlc:docs changelog
257
+
258
+ Analyzing git history since last release (v1.0.0)...
259
+
260
+ Commits: 47
261
+ Features: 12
262
+ Fixes: 23
263
+ Refactors: 8
264
+ Docs: 4
265
+
266
+ Generated CHANGELOG.md:
267
+
268
+ ---
269
+ # Changelog
270
+
271
+ ## [Unreleased]
272
+
273
+ ### Added
274
+ - User authentication with JWT (#45)
275
+ - Password reset flow (#52)
276
+ - Email verification (#58)
277
+ - Rate limiting on auth endpoints (#61)
278
+
279
+ ### Fixed
280
+ - Login button not working on mobile (#67)
281
+ - Session timeout not refreshing (#71)
282
+ - Email validation regex (#73)
283
+
284
+ ### Changed
285
+ - Moved auth logic to dedicated service
286
+ - Updated dependencies to latest versions
287
+
288
+ ---
289
+
290
+ Update version? (Y/n)
291
+ Current: 1.0.0
292
+ New version: 1.1.0
293
+ ```
294
+
295
+ ## Architectural Decision Records
296
+
297
+ ```
298
+ > /tlc:docs decisions
299
+
300
+ Architectural Decision Records (ADRs) document important choices.
301
+
302
+ Commands:
303
+ /tlc:docs decisions new Create new ADR
304
+ /tlc:docs decisions list List all ADRs
305
+ /tlc:docs decisions search Search ADRs
306
+
307
+ > /tlc:docs decisions new
308
+
309
+ Title: Choose authentication strategy
310
+
311
+ Context:
312
+ Need to implement user authentication for the API.
313
+ Options considered:
314
+ 1. JWT tokens (stateless)
315
+ 2. Session cookies (stateful)
316
+ 3. OAuth only (delegate to provider)
317
+
318
+ Decision: JWT tokens
319
+
320
+ Rationale:
321
+ - Stateless: scales horizontally
322
+ - Works well with mobile apps
323
+ - Can include user claims in token
324
+
325
+ Consequences:
326
+ - Need token refresh mechanism
327
+ - Can't immediately revoke tokens
328
+ - Must secure token storage on client
329
+
330
+ Created: docs/decisions/001-auth-strategy.md
331
+ ```
332
+
333
+ ### ADR Template
334
+
335
+ ```markdown
336
+ # ADR-001: Choose authentication strategy
337
+
338
+ **Status:** Accepted
339
+ **Date:** 2024-01-15
340
+ **Deciders:** Alice, Bob
341
+
342
+ ## Context
343
+
344
+ Need to implement user authentication for the API.
345
+
346
+ ## Decision
347
+
348
+ Use JWT tokens for authentication.
349
+
350
+ ## Options Considered
351
+
352
+ 1. **JWT tokens** - Stateless, scalable
353
+ 2. **Session cookies** - Simple, server-managed
354
+ 3. **OAuth only** - Delegate to providers
355
+
356
+ ## Rationale
357
+
358
+ JWT chosen because:
359
+ - Horizontal scaling (no session store needed)
360
+ - Works with mobile and web clients
361
+ - Can embed user claims
362
+
363
+ ## Consequences
364
+
365
+ ### Positive
366
+ - No session storage required
367
+ - Easy to scale API servers
368
+
369
+ ### Negative
370
+ - Token revocation requires additional infrastructure
371
+ - Must handle token refresh
372
+
373
+ ## Related
374
+
375
+ - ADR-002: Token refresh strategy
376
+ ```
377
+
378
+ ## Contributing Guide
379
+
380
+ ```
381
+ > /tlc:docs contributing
382
+
383
+ Created docs/CONTRIBUTING.md:
384
+
385
+ ---
386
+ # Contributing to My Project
387
+
388
+ ## Quick Start
389
+
390
+ 1. Fork the repository
391
+ 2. Create a feature branch
392
+ 3. Write tests first (TLC style)
393
+ 4. Implement the feature
394
+ 5. Submit a pull request
395
+
396
+ ## Development Process
397
+
398
+ This project uses **TLC (Test-Led Coding)**:
399
+
400
+ 1. Write tests that describe the feature
401
+ 2. Run tests (they should fail)
402
+ 3. Implement until tests pass
403
+ 4. Refactor if needed
404
+ 5. Submit PR
405
+
406
+ ## Commit Messages
407
+
408
+ Format: `type: description`
409
+
410
+ Types:
411
+ - `feat:` New feature
412
+ - `fix:` Bug fix
413
+ - `docs:` Documentation
414
+ - `test:` Adding tests
415
+ - `refactor:` Code restructuring
416
+
417
+ Example:
418
+ ```
419
+ feat: add password reset flow
420
+
421
+ - Add /auth/reset-password endpoint
422
+ - Send reset email with token
423
+ - Validate token expiry
424
+
425
+ Closes #52
426
+ ```
427
+
428
+ ## Pull Request Process
429
+
430
+ 1. Update tests for new functionality
431
+ 2. Ensure all tests pass
432
+ 3. Update documentation if needed
433
+ 4. Request review from maintainers
434
+
435
+ ## Code Style
436
+
437
+ - ESLint configuration in `.eslintrc`
438
+ - Prettier for formatting
439
+ - Run `npm run lint` before committing
440
+
441
+ ## Questions?
442
+
443
+ Open an issue or ask in #dev-help Slack channel.
444
+ ---
445
+ ```
446
+
447
+ ## Configuration
448
+
449
+ In `.tlc.json`:
450
+
451
+ ```json
452
+ {
453
+ "docs": {
454
+ "outputDir": "docs",
455
+ "api": {
456
+ "format": ["markdown", "openapi"],
457
+ "baseUrl": "http://localhost:3000/api"
458
+ },
459
+ "changelog": {
460
+ "types": {
461
+ "feat": "Added",
462
+ "fix": "Fixed",
463
+ "refactor": "Changed",
464
+ "docs": "Documentation"
465
+ }
466
+ }
467
+ }
468
+ }
469
+ ```
470
+
471
+ ## Auto-Update
472
+
473
+ Keep docs in sync with code:
474
+
475
+ ```json
476
+ {
477
+ "docs": {
478
+ "autoUpdate": true,
479
+ "updateOn": ["build", "release"]
480
+ }
481
+ }
482
+ ```
483
+
484
+ This regenerates docs when:
485
+ - `/tlc:build` completes a phase
486
+ - `/tlc:complete` tags a release
487
+
488
+ ## Notes
489
+
490
+ - Documentation lives in `docs/` by default
491
+ - API docs extracted from code comments and types
492
+ - Changelog follows Keep a Changelog format
493
+ - ADRs numbered sequentially (001, 002, etc.)
494
+ - All docs are Markdown for easy editing