tlc-claude-code 1.5.3 → 1.5.4
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/.claude/commands/tlc/audit.md +129 -0
- package/.claude/commands/tlc/autofix.md +217 -0
- package/.claude/commands/tlc/bug.md +255 -0
- package/.claude/commands/tlc/build.md +731 -0
- package/.claude/commands/tlc/checklist.md +212 -0
- package/.claude/commands/tlc/ci.md +414 -0
- package/.claude/commands/tlc/claim.md +189 -0
- package/.claude/commands/tlc/cleanup.md +187 -0
- package/.claude/commands/tlc/complete.md +160 -0
- package/.claude/commands/tlc/config.md +395 -0
- package/.claude/commands/tlc/coverage.md +222 -0
- package/.claude/commands/tlc/deploy.md +723 -0
- package/.claude/commands/tlc/discuss.md +185 -0
- package/.claude/commands/tlc/docs.md +194 -0
- package/.claude/commands/tlc/edge-cases.md +241 -0
- package/.claude/commands/tlc/export.md +456 -0
- package/.claude/commands/tlc/help.md +169 -0
- package/.claude/commands/tlc/import-project.md +246 -0
- package/.claude/commands/tlc/init.md +443 -0
- package/.claude/commands/tlc/issues.md +376 -0
- package/.claude/commands/tlc/llm.md +111 -0
- package/.claude/commands/tlc/new-milestone.md +172 -0
- package/.claude/commands/tlc/new-project.md +399 -0
- package/.claude/commands/tlc/next.md +129 -0
- package/.claude/commands/tlc/outdated.md +200 -0
- package/.claude/commands/tlc/plan.md +224 -0
- package/.claude/commands/tlc/progress.md +153 -0
- package/.claude/commands/tlc/quality.md +185 -0
- package/.claude/commands/tlc/quick.md +52 -0
- package/.claude/commands/tlc/refactor.md +190 -0
- package/.claude/commands/tlc/release.md +135 -0
- package/.claude/commands/tlc/review-pr.md +184 -0
- package/.claude/commands/tlc/review.md +200 -0
- package/.claude/commands/tlc/security.md +195 -0
- package/.claude/commands/tlc/server.md +19 -0
- package/.claude/commands/tlc/start.md +137 -0
- package/.claude/commands/tlc/status.md +65 -0
- package/.claude/commands/tlc/sync.md +652 -0
- package/.claude/commands/tlc/tlc.md +279 -0
- package/.claude/commands/tlc/verify.md +159 -0
- package/.claude/commands/tlc/who.md +151 -0
- package/bin/postinstall.js +54 -0
- package/package.json +3 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# /tlc:import-project - Import Multi-Repo Architecture
|
|
2
|
+
|
|
3
|
+
Scan multiple GitHub repositories, analyze test coverage, create unified project view.
|
|
4
|
+
|
|
5
|
+
## What This Does
|
|
6
|
+
|
|
7
|
+
1. Clones private repos to temp directory (shallow clone)
|
|
8
|
+
2. Detects stack & test framework per repo
|
|
9
|
+
3. Runs coverage analysis per repo
|
|
10
|
+
4. Generates unified coverage report
|
|
11
|
+
5. Creates multi-service PROJECT.md
|
|
12
|
+
6. Identifies critical untested paths across all services
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- Inheriting a multi-repo microservices codebase
|
|
17
|
+
- Verifying "coverage is good" claims
|
|
18
|
+
- Managing multiple services as one TLC project
|
|
19
|
+
- Onboarding to unfamiliar architecture
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
- GitHub CLI authenticated: `gh auth status`
|
|
24
|
+
- Access to all repos: `gh repo list {org} --limit 100`
|
|
25
|
+
|
|
26
|
+
## Process
|
|
27
|
+
|
|
28
|
+
### Step 1: Gather Repos
|
|
29
|
+
|
|
30
|
+
Ask user for repos. Accept:
|
|
31
|
+
- GitHub org name (scan all repos)
|
|
32
|
+
- Comma-separated repo URLs
|
|
33
|
+
- Path to file with repo list
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
gh repo list {org} --json name,url --limit 100
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Step 2: Clone Each Repo (Shallow)
|
|
40
|
+
|
|
41
|
+
For each repo:
|
|
42
|
+
```bash
|
|
43
|
+
gh repo clone {owner}/{repo} .tlc-scan/{repo} -- --depth=1
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Step 3: Detect Stack Per Repo
|
|
47
|
+
|
|
48
|
+
Check for indicators:
|
|
49
|
+
| File | Stack |
|
|
50
|
+
|------|-------|
|
|
51
|
+
| package.json | Node.js |
|
|
52
|
+
| pyproject.toml | Python |
|
|
53
|
+
| go.mod | Go |
|
|
54
|
+
| Cargo.toml | Rust |
|
|
55
|
+
|
|
56
|
+
Check for test framework:
|
|
57
|
+
| Indicator | Framework |
|
|
58
|
+
|-----------|-----------|
|
|
59
|
+
| vitest.config.* | Vitest |
|
|
60
|
+
| jest.config.* | Jest |
|
|
61
|
+
| pytest.ini / [tool.pytest] | pytest |
|
|
62
|
+
| *_test.go | go test |
|
|
63
|
+
|
|
64
|
+
### Step 4: Run Coverage Per Repo
|
|
65
|
+
|
|
66
|
+
Execute framework-specific coverage:
|
|
67
|
+
- **Node.js (vitest):** `npm test -- --coverage --reporter=json`
|
|
68
|
+
- **Node.js (jest):** `npm test -- --coverage --json`
|
|
69
|
+
- **Python:** `pytest --cov --cov-report=json`
|
|
70
|
+
- **Go:** `go test -coverprofile=coverage.out ./...`
|
|
71
|
+
|
|
72
|
+
Parse coverage reports:
|
|
73
|
+
- Node.js: `coverage/coverage-final.json`
|
|
74
|
+
- Python: `coverage.json`
|
|
75
|
+
- Go: parse `coverage.out`
|
|
76
|
+
|
|
77
|
+
### Step 5: Identify Untested Critical Paths
|
|
78
|
+
|
|
79
|
+
Scan for keywords indicating critical code:
|
|
80
|
+
- **Auth:** login, logout, session, token, password, oauth, jwt
|
|
81
|
+
- **Payments:** payment, billing, charge, stripe, invoice
|
|
82
|
+
- **Data mutations:** create, update, delete, save
|
|
83
|
+
- **Security:** validate, sanitize, permission, role
|
|
84
|
+
|
|
85
|
+
Flag any file with these keywords that lacks corresponding test.
|
|
86
|
+
|
|
87
|
+
### Step 6: Generate Unified Report
|
|
88
|
+
|
|
89
|
+
Create `.planning/COVERAGE-REPORT.md`:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
# Coverage Report - Multi-Service Architecture
|
|
93
|
+
|
|
94
|
+
Generated: {timestamp}
|
|
95
|
+
|
|
96
|
+
## Summary
|
|
97
|
+
|
|
98
|
+
| Metric | Value |
|
|
99
|
+
|--------|-------|
|
|
100
|
+
| Total Repos | 12 |
|
|
101
|
+
| Avg Coverage | 67% |
|
|
102
|
+
| Critical Gaps | 4 |
|
|
103
|
+
|
|
104
|
+
## Per-Service Coverage
|
|
105
|
+
|
|
106
|
+
| Service | Stack | Coverage | Tests | Critical Gaps |
|
|
107
|
+
|---------|-------|----------|-------|---------------|
|
|
108
|
+
| auth-service | Node.js | 87% | 45 | 0 |
|
|
109
|
+
| payment-service | Node.js | 23% | 8 | 2 (charge, refund) |
|
|
110
|
+
| user-service | Python | 91% | 112 | 0 |
|
|
111
|
+
| notification-svc | Node.js | 0% | 0 | 1 (send) |
|
|
112
|
+
|
|
113
|
+
## Critical Gaps (Priority Order)
|
|
114
|
+
|
|
115
|
+
### 1. payment-service/src/charge.ts
|
|
116
|
+
- Handles: Credit card charging
|
|
117
|
+
- Risk: Money handling with no tests
|
|
118
|
+
- Action: Write tests for charge flow
|
|
119
|
+
|
|
120
|
+
### 2. payment-service/src/refund.ts
|
|
121
|
+
- Handles: Refund processing
|
|
122
|
+
- Risk: Money handling with no tests
|
|
123
|
+
- Action: Write tests for refund flow
|
|
124
|
+
|
|
125
|
+
...
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Step 7: Create Multi-Service PROJECT.md
|
|
129
|
+
|
|
130
|
+
Create `.planning/PROJECT.md`:
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
# {Project Name} - Multi-Service Architecture
|
|
134
|
+
|
|
135
|
+
## Overview
|
|
136
|
+
|
|
137
|
+
{Inferred from repo names and README files}
|
|
138
|
+
|
|
139
|
+
## Services
|
|
140
|
+
|
|
141
|
+
### auth-service
|
|
142
|
+
- **Path:** github.com/{org}/auth-service
|
|
143
|
+
- **Stack:** Node.js + Express
|
|
144
|
+
- **Test Framework:** Vitest
|
|
145
|
+
- **Coverage:** 87%
|
|
146
|
+
- **Role:** Authentication & session management
|
|
147
|
+
|
|
148
|
+
### payment-service
|
|
149
|
+
- **Path:** github.com/{org}/payment-service
|
|
150
|
+
- **Stack:** Node.js + Stripe
|
|
151
|
+
- **Test Framework:** Jest
|
|
152
|
+
- **Coverage:** 23%
|
|
153
|
+
- **Role:** Payment processing
|
|
154
|
+
|
|
155
|
+
...
|
|
156
|
+
|
|
157
|
+
## Architecture
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
[API Gateway]
|
|
161
|
+
|-- [Auth Service] --> [User DB]
|
|
162
|
+
|-- [User Service] --> [User DB]
|
|
163
|
+
|-- [Payment Service] --> [Stripe API]
|
|
164
|
+
+-- [Notification Service] --> [Email/SMS]
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Development Methodology: Test-Led Development
|
|
168
|
+
|
|
169
|
+
All services follow TLC. New code requires tests first.
|
|
170
|
+
|
|
171
|
+
## Next Steps
|
|
172
|
+
|
|
173
|
+
1. Fix critical coverage gaps (see COVERAGE-REPORT.md)
|
|
174
|
+
2. Run `/tlc:coverage` per service for detailed backlog
|
|
175
|
+
3. Use `/tlc` for new features
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Step 8: Create Test Backlog
|
|
179
|
+
|
|
180
|
+
Create `.planning/BACKLOG.md`:
|
|
181
|
+
|
|
182
|
+
```markdown
|
|
183
|
+
# Test Backlog - Multi-Service
|
|
184
|
+
|
|
185
|
+
## Critical (Security/Money)
|
|
186
|
+
|
|
187
|
+
- [ ] payment-service: src/charge.ts
|
|
188
|
+
- [ ] payment-service: src/refund.ts
|
|
189
|
+
- [ ] auth-service: src/password-reset.ts (if untested)
|
|
190
|
+
|
|
191
|
+
## High Priority (Core Business Logic)
|
|
192
|
+
|
|
193
|
+
- [ ] user-service: src/registration.ts
|
|
194
|
+
- [ ] order-service: src/checkout.ts
|
|
195
|
+
|
|
196
|
+
## Standard
|
|
197
|
+
|
|
198
|
+
- [ ] notification-svc: all files (0% coverage)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Step 9: Cleanup
|
|
202
|
+
|
|
203
|
+
Remove temp directory:
|
|
204
|
+
```bash
|
|
205
|
+
rm -rf .tlc-scan/
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Step 10: Report Summary
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
Import complete for {org}
|
|
212
|
+
|
|
213
|
+
Repos scanned: 12
|
|
214
|
+
Total coverage: 67% average
|
|
215
|
+
|
|
216
|
+
Critical findings:
|
|
217
|
+
- payment-service: 23% coverage (handles money!)
|
|
218
|
+
- notification-svc: 0% coverage
|
|
219
|
+
|
|
220
|
+
Files created:
|
|
221
|
+
.planning/PROJECT.md
|
|
222
|
+
.planning/COVERAGE-REPORT.md
|
|
223
|
+
.planning/BACKLOG.md
|
|
224
|
+
|
|
225
|
+
Next: Run /tlc:build backlog to write tests for critical gaps
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Usage
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Scan entire GitHub org
|
|
232
|
+
/tlc:import-project myorg
|
|
233
|
+
|
|
234
|
+
# Scan specific repos
|
|
235
|
+
/tlc:import-project myorg/auth-service,myorg/payment-service
|
|
236
|
+
|
|
237
|
+
# Scan from file
|
|
238
|
+
/tlc:import-project --file repos.txt
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Notes
|
|
242
|
+
|
|
243
|
+
- Requires `gh` CLI authenticated with access to private repos
|
|
244
|
+
- Shallow clones only (--depth=1) to minimize bandwidth
|
|
245
|
+
- Temp files cleaned up after scan
|
|
246
|
+
- Re-run anytime to update coverage report
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
# /tlc:init - Initialize TLC in Existing Project
|
|
2
|
+
|
|
3
|
+
Add TLC workflow to an existing codebase. Analyzes what you have, identifies gaps, and offers to write tests for existing code.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
- You have existing code without tests
|
|
8
|
+
- You have existing code with some tests
|
|
9
|
+
- You're joining a project mid-development
|
|
10
|
+
- You want to adopt TLC on a "vibe coded" project
|
|
11
|
+
|
|
12
|
+
This command will:
|
|
13
|
+
1. Set up test infrastructure (if missing)
|
|
14
|
+
2. **Analyze your existing code** to understand what it does
|
|
15
|
+
3. **Identify untested modules** and critical paths
|
|
16
|
+
4. **Ask if you want retrospective tests** written for existing code
|
|
17
|
+
|
|
18
|
+
For brand new projects with no code, use `/tlc:new-project` instead.
|
|
19
|
+
|
|
20
|
+
## Process
|
|
21
|
+
|
|
22
|
+
### 1. Scan for Existing Code
|
|
23
|
+
|
|
24
|
+
Check for source files:
|
|
25
|
+
- `src/`, `lib/`, `app/`, `pkg/`, or root-level code files
|
|
26
|
+
- `package.json`, `pyproject.toml`, `go.mod`, `Gemfile`, `Cargo.toml`
|
|
27
|
+
|
|
28
|
+
If no code found, suggest running `/tlc:new-project` instead.
|
|
29
|
+
|
|
30
|
+
### 2. Detect Stack
|
|
31
|
+
|
|
32
|
+
| Indicator | Stack |
|
|
33
|
+
|-----------|-------|
|
|
34
|
+
| `package.json` + React/Next deps | Next.js / React |
|
|
35
|
+
| `package.json` (no framework) | Node.js |
|
|
36
|
+
| `pyproject.toml` / `requirements.txt` | Python |
|
|
37
|
+
| `go.mod` | Go |
|
|
38
|
+
| `Gemfile` | Ruby |
|
|
39
|
+
| `Cargo.toml` | Rust |
|
|
40
|
+
|
|
41
|
+
### 3. Scan for Existing Tests
|
|
42
|
+
|
|
43
|
+
Look for test indicators:
|
|
44
|
+
|
|
45
|
+
**Directories:**
|
|
46
|
+
- `tests/`, `test/`, `__tests__/`, `spec/`
|
|
47
|
+
|
|
48
|
+
**Files:**
|
|
49
|
+
- `*_test.py`, `test_*.py`
|
|
50
|
+
- `*.test.ts`, `*.test.js`, `*.spec.ts`, `*.spec.js`
|
|
51
|
+
- `*_test.go`
|
|
52
|
+
- `*_spec.rb`
|
|
53
|
+
|
|
54
|
+
**Config files:**
|
|
55
|
+
- `vitest.config.*`, `jest.config.*`, `pytest.ini`, `pyproject.toml` [tool.pytest]
|
|
56
|
+
- `.rspec`, `spec/spec_helper.rb`
|
|
57
|
+
|
|
58
|
+
### 4. Set Up Test Framework (if missing)
|
|
59
|
+
|
|
60
|
+
If no tests found, set up based on detected stack. TLC defaults to mocha for JavaScript/TypeScript:
|
|
61
|
+
|
|
62
|
+
| Stack | Framework | Setup |
|
|
63
|
+
|-------|-----------|-------|
|
|
64
|
+
| Next.js / React / Node.js | Mocha + Chai + Sinon | `npm install -D mocha chai sinon proxyquire` |
|
|
65
|
+
| Python | pytest | `pip install pytest` or add to pyproject.toml |
|
|
66
|
+
| Go | go test | Built-in, no setup needed |
|
|
67
|
+
| Ruby | RSpec | `gem install rspec && rspec --init` |
|
|
68
|
+
| Rust | cargo test | Built-in, no setup needed |
|
|
69
|
+
|
|
70
|
+
Create config file and test directory structure.
|
|
71
|
+
|
|
72
|
+
For JavaScript/TypeScript, create `.mocharc.json`:
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"extension": ["js", "ts"],
|
|
76
|
+
"spec": "test/**/*.test.{js,ts}",
|
|
77
|
+
"require": ["ts-node/register"],
|
|
78
|
+
"timeout": 5000
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Create `.tlc.json`:
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"testFrameworks": {
|
|
86
|
+
"primary": "mocha",
|
|
87
|
+
"installed": ["mocha", "chai", "sinon", "proxyquire"],
|
|
88
|
+
"run": ["mocha"]
|
|
89
|
+
},
|
|
90
|
+
"testCommand": "npm test",
|
|
91
|
+
"testDirectory": "test"
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Add test scripts to package.json:
|
|
96
|
+
```json
|
|
97
|
+
"scripts": {
|
|
98
|
+
"test": "mocha",
|
|
99
|
+
"test:watch": "mocha --watch"
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 5. If Tests Already Exist
|
|
104
|
+
|
|
105
|
+
- Skip framework setup
|
|
106
|
+
- Note existing test patterns for consistency
|
|
107
|
+
- Report: "Found existing test framework: [mocha/jest/vitest/pytest/etc]"
|
|
108
|
+
- Report: "Found X existing test files"
|
|
109
|
+
|
|
110
|
+
**Offer to add TLC default stack:**
|
|
111
|
+
```
|
|
112
|
+
Detected: jest (47 test files)
|
|
113
|
+
|
|
114
|
+
Options:
|
|
115
|
+
1) Keep jest only - use for all tests
|
|
116
|
+
2) Add mocha alongside jest - new tests use mocha, keep existing jest
|
|
117
|
+
3) Keep jest as primary - configure in .tlc.json
|
|
118
|
+
|
|
119
|
+
Which approach? [1/2/3]:
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
If option 2 selected, create multi-framework config:
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"testFrameworks": {
|
|
126
|
+
"primary": "mocha",
|
|
127
|
+
"installed": ["mocha", "chai", "sinon", "proxyquire", "jest"],
|
|
128
|
+
"run": ["mocha", "jest"]
|
|
129
|
+
},
|
|
130
|
+
"commands": {
|
|
131
|
+
"mocha": "npx mocha 'test/**/*.test.js'",
|
|
132
|
+
"jest": "npx jest"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 6. Analyze Existing Code Structure
|
|
138
|
+
|
|
139
|
+
Scan the codebase and generate summary:
|
|
140
|
+
- Main directories and their purpose
|
|
141
|
+
- Key modules/components identified
|
|
142
|
+
- Entry points (main files, API routes, etc.)
|
|
143
|
+
- Dependencies and their roles
|
|
144
|
+
|
|
145
|
+
### 7. Identify Untested Code
|
|
146
|
+
|
|
147
|
+
Compare source files against test files to identify:
|
|
148
|
+
- Modules/components with no corresponding tests
|
|
149
|
+
- Key functions that lack test coverage
|
|
150
|
+
- Critical paths (auth, payments, data mutations) without tests
|
|
151
|
+
|
|
152
|
+
Present findings:
|
|
153
|
+
```
|
|
154
|
+
Code Coverage Analysis:
|
|
155
|
+
|
|
156
|
+
Tested:
|
|
157
|
+
✓ src/auth/login.ts (tests/auth/login.test.ts)
|
|
158
|
+
✓ src/utils/format.ts (tests/utils/format.test.ts)
|
|
159
|
+
|
|
160
|
+
Untested:
|
|
161
|
+
✗ src/api/users.ts - CRUD operations, no tests
|
|
162
|
+
✗ src/services/payment.ts - payment processing, no tests
|
|
163
|
+
✗ src/components/Dashboard.tsx - main UI, no tests
|
|
164
|
+
|
|
165
|
+
Critical paths without tests: 2 (auth, payments)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 8. Offer Retrospective Test Writing
|
|
169
|
+
|
|
170
|
+
Ask the user:
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
Would you like to write tests for existing code?
|
|
174
|
+
|
|
175
|
+
1) Yes - prioritize critical paths first
|
|
176
|
+
2) Yes - write tests for everything
|
|
177
|
+
3) No - only use TLC for new features going forward
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**If option 1 or 2 selected:**
|
|
181
|
+
|
|
182
|
+
Create `.planning/BACKLOG.md` with test tasks:
|
|
183
|
+
|
|
184
|
+
```markdown
|
|
185
|
+
# Test Backlog
|
|
186
|
+
|
|
187
|
+
## Critical (write first)
|
|
188
|
+
- [ ] src/services/payment.ts - payment processing logic
|
|
189
|
+
- [ ] src/api/auth.ts - authentication flows
|
|
190
|
+
|
|
191
|
+
## High Priority
|
|
192
|
+
- [ ] src/api/users.ts - user CRUD operations
|
|
193
|
+
- [ ] src/middleware/validation.ts - input validation
|
|
194
|
+
|
|
195
|
+
## Standard
|
|
196
|
+
- [ ] src/utils/helpers.ts - utility functions
|
|
197
|
+
- [ ] src/components/Dashboard.tsx - dashboard rendering
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Then ask:
|
|
201
|
+
```
|
|
202
|
+
Start writing tests now, or save backlog for later?
|
|
203
|
+
|
|
204
|
+
1) Start now - begin with critical paths
|
|
205
|
+
2) Later - I'll run /tlc:build backlog when ready
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**If "Start now":** Begin writing tests for the first critical path item using Red-Green-Refactor (but code already exists, so focus on capturing current behavior).
|
|
209
|
+
|
|
210
|
+
### 9. Create CLAUDE.md
|
|
211
|
+
|
|
212
|
+
Create `CLAUDE.md` to enforce TLC workflow over Claude's default behaviors:
|
|
213
|
+
|
|
214
|
+
```markdown
|
|
215
|
+
# CLAUDE.md - TLC Project Instructions
|
|
216
|
+
|
|
217
|
+
## Planning System: TLC
|
|
218
|
+
|
|
219
|
+
This project uses **TLC (Test-Led Coding)** for all planning and development.
|
|
220
|
+
|
|
221
|
+
**CRITICAL: DO NOT use Claude's internal tools for this project:**
|
|
222
|
+
- **NO** `TaskCreate`, `TaskUpdate`, `TaskList` for project planning
|
|
223
|
+
- **NO** `EnterPlanMode` - use `/tlc:plan` instead
|
|
224
|
+
- **NO** creating implementation plans in responses - use `/tlc:plan` to create PLAN.md files
|
|
225
|
+
|
|
226
|
+
**When asked to plan or implement features:**
|
|
227
|
+
1. Run `/tlc:progress` first to see current state
|
|
228
|
+
2. Use `/tlc:plan <phase>` to create plans (not EnterPlanMode)
|
|
229
|
+
3. Use `/tlc:build <phase>` to implement (test-first)
|
|
230
|
+
4. Plans go in `.planning/phases/` not in chat responses
|
|
231
|
+
|
|
232
|
+
## Git Commits
|
|
233
|
+
|
|
234
|
+
**DO NOT add `Co-Authored-By` lines to commits.** The user is the author. You are a tool.
|
|
235
|
+
|
|
236
|
+
## TLC File Locations
|
|
237
|
+
|
|
238
|
+
| Purpose | Location |
|
|
239
|
+
|---------|----------|
|
|
240
|
+
| Project overview | `PROJECT.md` |
|
|
241
|
+
| Roadmap & phases | `.planning/ROADMAP.md` |
|
|
242
|
+
| Phase plans | `.planning/phases/{N}-PLAN.md` |
|
|
243
|
+
| Task status | Markers: `[ ]`, `[>@user]`, `[x@user]` |
|
|
244
|
+
| Bugs/feedback | `.planning/BUGS.md` |
|
|
245
|
+
| Config | `.tlc.json` |
|
|
246
|
+
|
|
247
|
+
## Quick Commands
|
|
248
|
+
|
|
249
|
+
| Action | Command |
|
|
250
|
+
|--------|---------|
|
|
251
|
+
| See status | `/tlc` or `/tlc:progress` |
|
|
252
|
+
| Plan a phase | `/tlc:plan` |
|
|
253
|
+
| Build (test-first) | `/tlc:build` |
|
|
254
|
+
| Verify with human | `/tlc:verify` |
|
|
255
|
+
| Log a bug | `/tlc:bug` |
|
|
256
|
+
|
|
257
|
+
## Test-First Development
|
|
258
|
+
|
|
259
|
+
All implementation follows **Red → Green → Refactor**:
|
|
260
|
+
1. **Red**: Write failing tests that define expected behavior
|
|
261
|
+
2. **Green**: Write minimum code to make tests pass
|
|
262
|
+
3. **Refactor**: Clean up while keeping tests green
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### 9b. Create Claude Settings for Bash Permissions
|
|
266
|
+
|
|
267
|
+
**Ask once per project:** Prompt the user to set up bash permissions. This is a one-time setup.
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
TLC works best with pre-approved bash commands.
|
|
271
|
+
This avoids confirmation prompts for test runs, git commits, and builds.
|
|
272
|
+
|
|
273
|
+
Allow TLC to run commands without prompts? (Y/n)
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
If yes, create `.claude/settings.json`:
|
|
277
|
+
|
|
278
|
+
```json
|
|
279
|
+
{
|
|
280
|
+
"permissions": {
|
|
281
|
+
"allow": [
|
|
282
|
+
"Bash(npm test*)",
|
|
283
|
+
"Bash(npm run test*)",
|
|
284
|
+
"Bash(npx vitest*)",
|
|
285
|
+
"Bash(npx mocha*)",
|
|
286
|
+
"Bash(npx jest*)",
|
|
287
|
+
"Bash(pytest*)",
|
|
288
|
+
"Bash(go test*)",
|
|
289
|
+
"Bash(cargo test*)",
|
|
290
|
+
"Bash(git status*)",
|
|
291
|
+
"Bash(git add *)",
|
|
292
|
+
"Bash(git commit *)",
|
|
293
|
+
"Bash(git diff*)",
|
|
294
|
+
"Bash(git log*)",
|
|
295
|
+
"Bash(git pull*)",
|
|
296
|
+
"Bash(git checkout*)",
|
|
297
|
+
"Bash(git branch*)",
|
|
298
|
+
"Bash(git stash*)",
|
|
299
|
+
"Bash(npm install*)",
|
|
300
|
+
"Bash(npm run build*)",
|
|
301
|
+
"Bash(npm run lint*)",
|
|
302
|
+
"Bash(npx tsc*)",
|
|
303
|
+
"Bash(ls *)",
|
|
304
|
+
"Bash(mkdir *)",
|
|
305
|
+
"Bash(rm -rf node_modules*)",
|
|
306
|
+
"Bash(rm -rf dist*)",
|
|
307
|
+
"Bash(rm -rf build*)"
|
|
308
|
+
],
|
|
309
|
+
"deny": []
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**IMPORTANT:** `git push` is NOT included. Always ask before pushing to remote.
|
|
315
|
+
|
|
316
|
+
If `.claude/settings.json` already exists, merge the permissions (don't overwrite user's existing config).
|
|
317
|
+
|
|
318
|
+
### 10. Create or Update PROJECT.md
|
|
319
|
+
|
|
320
|
+
If PROJECT.md doesn't exist, create it with:
|
|
321
|
+
|
|
322
|
+
```markdown
|
|
323
|
+
# [Project Name]
|
|
324
|
+
|
|
325
|
+
## Overview
|
|
326
|
+
[Inferred from code structure and README if present]
|
|
327
|
+
|
|
328
|
+
## Tech Stack
|
|
329
|
+
- [Detected stack]
|
|
330
|
+
- [Key dependencies]
|
|
331
|
+
|
|
332
|
+
## Project Structure
|
|
333
|
+
[Generated from scan]
|
|
334
|
+
|
|
335
|
+
## Development Methodology: Test-Led Development
|
|
336
|
+
|
|
337
|
+
This project uses TLC. All new implementation follows Red -> Green -> Refactor:
|
|
338
|
+
|
|
339
|
+
1. **Red**: Write failing tests that define expected behavior
|
|
340
|
+
2. **Green**: Write minimum code to make tests pass
|
|
341
|
+
3. **Refactor**: Clean up while keeping tests green
|
|
342
|
+
|
|
343
|
+
Tests are written BEFORE implementation, not after.
|
|
344
|
+
|
|
345
|
+
## Test Framework
|
|
346
|
+
- Framework: [detected or installed]
|
|
347
|
+
- Run tests: `[test command]`
|
|
348
|
+
- Test directory: `[path]`
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
If PROJECT.md exists, append the TLC section only.
|
|
352
|
+
|
|
353
|
+
### 11. Set Up Documentation (Optional)
|
|
354
|
+
|
|
355
|
+
If the project doesn't have docs automation:
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
Documentation Automation
|
|
359
|
+
|
|
360
|
+
TLC can automatically maintain your docs:
|
|
361
|
+
• Update version references on push
|
|
362
|
+
• Sync to GitHub Wiki
|
|
363
|
+
• Generate API documentation
|
|
364
|
+
• Capture app screenshots
|
|
365
|
+
|
|
366
|
+
Set up documentation automation? (Y/n)
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
If yes, run `/tlc:docs setup`.
|
|
370
|
+
|
|
371
|
+
### 12. Enterprise Features (Optional)
|
|
372
|
+
|
|
373
|
+
After basic setup, offer enterprise features:
|
|
374
|
+
|
|
375
|
+
```
|
|
376
|
+
Enterprise Features (v1.4+)
|
|
377
|
+
|
|
378
|
+
TLC includes enterprise-grade features for compliance and security:
|
|
379
|
+
|
|
380
|
+
• Audit logging - tamper-evident logs with SIEM export
|
|
381
|
+
• Zero-data-retention - HIPAA/PCI-DSS compliant ephemeral mode
|
|
382
|
+
• SSO integration - OAuth 2.0 and SAML 2.0 support
|
|
383
|
+
• Compliance tooling - SOC 2 Type II checklist and evidence
|
|
384
|
+
|
|
385
|
+
Enable enterprise features? (Y/n)
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
If yes, add enterprise config to `.tlc.json`:
|
|
389
|
+
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"enterprise": {
|
|
393
|
+
"enabled": true,
|
|
394
|
+
"audit": {
|
|
395
|
+
"enabled": true,
|
|
396
|
+
"storage": ".tlc/audit/"
|
|
397
|
+
},
|
|
398
|
+
"compliance": {
|
|
399
|
+
"enabled": true,
|
|
400
|
+
"framework": "soc2"
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
Then show:
|
|
407
|
+
```
|
|
408
|
+
Enterprise features enabled.
|
|
409
|
+
|
|
410
|
+
Commands available:
|
|
411
|
+
/tlc:audit - View and export audit logs
|
|
412
|
+
/tlc:retention - Configure zero-data-retention
|
|
413
|
+
/tlc:sso - Set up SSO providers
|
|
414
|
+
/tlc:compliance - SOC 2 compliance dashboard
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### 13. Report Summary
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
TLC initialized for [project name]
|
|
421
|
+
|
|
422
|
+
Stack: [detected]
|
|
423
|
+
Test framework: [framework] (existing/newly configured)
|
|
424
|
+
Test directory: [path]
|
|
425
|
+
Existing tests: [count] files
|
|
426
|
+
Untested files: [count] identified
|
|
427
|
+
Docs automation: [enabled/skipped]
|
|
428
|
+
Enterprise features: [enabled/skipped]
|
|
429
|
+
|
|
430
|
+
Next steps:
|
|
431
|
+
- Run /tlc:build backlog to write tests for existing code
|
|
432
|
+
- Run /tlc:discuss to plan new features with TLC
|
|
433
|
+
- Run /tlc:quick for ad-hoc tasks with tests
|
|
434
|
+
- Run /tlc:docs to update documentation
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
## Usage
|
|
438
|
+
|
|
439
|
+
```
|
|
440
|
+
/tlc:init
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
No arguments needed. Auto-detects everything.
|