claudekit-cli 1.0.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/.claude/agents/brainstormer.md +96 -0
- package/.claude/agents/code-reviewer.md +141 -0
- package/.claude/agents/copywriter.md +108 -0
- package/.claude/agents/database-admin.md +86 -0
- package/.claude/agents/debugger.md +124 -0
- package/.claude/agents/docs-manager.md +115 -0
- package/.claude/agents/git-manager.md +60 -0
- package/.claude/agents/journal-writer.md +111 -0
- package/.claude/agents/planner.md +87 -0
- package/.claude/agents/project-manager.md +113 -0
- package/.claude/agents/researcher.md +173 -0
- package/.claude/agents/scout.md +123 -0
- package/.claude/agents/tester.md +95 -0
- package/.claude/agents/ui-ux-designer.md +206 -0
- package/.claude/commands/bootstrap.md +104 -0
- package/.claude/commands/brainstorm.md +67 -0
- package/.claude/commands/content/enhance.md +13 -0
- package/.claude/commands/content/fast.md +11 -0
- package/.claude/commands/content/good.md +13 -0
- package/.claude/commands/cook.md +19 -0
- package/.claude/commands/debug.md +10 -0
- package/.claude/commands/design/3d.md +65 -0
- package/.claude/commands/design/describe.md +13 -0
- package/.claude/commands/design/fast.md +19 -0
- package/.claude/commands/design/good.md +23 -0
- package/.claude/commands/design/screenshot.md +23 -0
- package/.claude/commands/design/video.md +23 -0
- package/.claude/commands/docs/init.md +13 -0
- package/.claude/commands/docs/summarize.md +10 -0
- package/.claude/commands/docs/update.md +21 -0
- package/.claude/commands/fix/ci.md +11 -0
- package/.claude/commands/fix/fast.md +12 -0
- package/.claude/commands/fix/hard.md +18 -0
- package/.claude/commands/fix/logs.md +16 -0
- package/.claude/commands/fix/test.md +18 -0
- package/.claude/commands/fix/types.md +10 -0
- package/.claude/commands/git/cm.md +5 -0
- package/.claude/commands/git/cp.md +4 -0
- package/.claude/commands/integrate/polar.md +42 -0
- package/.claude/commands/plan/ci.md +12 -0
- package/.claude/commands/plan/two.md +13 -0
- package/.claude/commands/plan.md +10 -0
- package/.claude/commands/scout.md +29 -0
- package/.claude/commands/test.md +7 -0
- package/.claude/commands/watzup.md +8 -0
- package/.claude/hooks/telegram_notify.sh +136 -0
- package/.claude/send-discord.sh +64 -0
- package/.claude/settings.json +7 -0
- package/.claude/statusline.sh +143 -0
- package/.claude/workflows/development-rules.md +80 -0
- package/.claude/workflows/documentation-management.md +28 -0
- package/.claude/workflows/orchestration-protocol.md +16 -0
- package/.claude/workflows/primary-workflow.md +41 -0
- package/.github/workflows/ci.yml +43 -0
- package/.github/workflows/release.yml +58 -0
- package/.opencode/agent/code-reviewer.md +141 -0
- package/.opencode/agent/debugger.md +74 -0
- package/.opencode/agent/docs-manager.md +119 -0
- package/.opencode/agent/git-manager.md +60 -0
- package/.opencode/agent/planner-researcher.md +100 -0
- package/.opencode/agent/planner.md +87 -0
- package/.opencode/agent/project-manager.md +113 -0
- package/.opencode/agent/researcher.md +173 -0
- package/.opencode/agent/solution-brainstormer.md +89 -0
- package/.opencode/agent/system-architecture.md +192 -0
- package/.opencode/agent/tester.md +96 -0
- package/.opencode/agent/ui-ux-designer.md +203 -0
- package/.opencode/agent/ui-ux-developer.md +97 -0
- package/.opencode/command/cook.md +7 -0
- package/.opencode/command/debug.md +10 -0
- package/.opencode/command/design/3d.md +65 -0
- package/.opencode/command/design/fast.md +18 -0
- package/.opencode/command/design/good.md +21 -0
- package/.opencode/command/design/screenshot.md +22 -0
- package/.opencode/command/design/video.md +22 -0
- package/.opencode/command/docs/init.md +11 -0
- package/.opencode/command/docs/summarize.md +10 -0
- package/.opencode/command/docs/update.md +18 -0
- package/.opencode/command/fix/ci.md +8 -0
- package/.opencode/command/fix/fast.md +11 -0
- package/.opencode/command/fix/hard.md +15 -0
- package/.opencode/command/fix/logs.md +16 -0
- package/.opencode/command/fix/test.md +18 -0
- package/.opencode/command/fix/types.md +10 -0
- package/.opencode/command/git/cm.md +5 -0
- package/.opencode/command/git/cp.md +4 -0
- package/.opencode/command/plan/ci.md +12 -0
- package/.opencode/command/plan/two.md +13 -0
- package/.opencode/command/plan.md +10 -0
- package/.opencode/command/test.md +7 -0
- package/.opencode/command/watzup.md +8 -0
- package/.releaserc.json +17 -0
- package/.repomixignore +15 -0
- package/AGENTS.md +217 -0
- package/CHANGELOG.md +16 -0
- package/CLAUDE.md +33 -0
- package/README.md +214 -0
- package/biome.json +25 -0
- package/bun.lock +1238 -0
- package/dist/index.js +19100 -0
- package/docs/code-standards.md +1128 -0
- package/docs/codebase-summary.md +821 -0
- package/docs/github-setup.md +176 -0
- package/docs/project-pdr.md +739 -0
- package/docs/system-architecture.md +950 -0
- package/docs/tech-stack.md +290 -0
- package/package.json +60 -0
- package/plans/251008-claudekit-cli-implementation-plan.md +1469 -0
- package/plans/reports/251008-from-code-reviewer-to-developer-review-report.md +864 -0
- package/plans/reports/251008-from-tester-to-developer-test-summary-report.md +409 -0
- package/plans/reports/251008-researcher-download-extraction-report.md +1377 -0
- package/plans/reports/251008-researcher-github-api-report.md +1339 -0
- package/plans/research/251008-cli-frameworks-bun-research.md +1051 -0
- package/plans/templates/bug-fix-template.md +69 -0
- package/plans/templates/feature-implementation-template.md +84 -0
- package/plans/templates/refactor-template.md +82 -0
- package/plans/templates/template-usage-guide.md +58 -0
- package/src/commands/new.ts +118 -0
- package/src/commands/update.ts +114 -0
- package/src/index.ts +44 -0
- package/src/lib/auth.ts +157 -0
- package/src/lib/download.ts +180 -0
- package/src/lib/github.ts +157 -0
- package/src/lib/merge.ts +116 -0
- package/src/lib/prompts.ts +113 -0
- package/src/types.ts +149 -0
- package/src/utils/config.ts +87 -0
- package/src/utils/logger.ts +37 -0
- package/tests/lib/auth.test.ts +116 -0
- package/tests/lib/download.test.ts +70 -0
- package/tests/lib/github.test.ts +52 -0
- package/tests/lib/merge.test.ts +138 -0
- package/tests/lib/prompts.test.ts +66 -0
- package/tests/types.test.ts +255 -0
- package/tests/utils/config.test.ts +263 -0
- package/tests/utils/logger.test.ts +124 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
# Product Development Requirements (PDR)
|
|
2
|
+
# ClaudeKit CLI
|
|
3
|
+
|
|
4
|
+
**Version:** 0.1.0
|
|
5
|
+
**Date:** 2025-10-08
|
|
6
|
+
**Status:** Production Ready
|
|
7
|
+
**Product Owner:** ClaudeKit Team
|
|
8
|
+
**Project Type:** CLI Tool (TypeScript + Bun)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Executive Summary
|
|
13
|
+
|
|
14
|
+
ClaudeKit CLI (`ck`) is a command-line tool that enables developers to quickly bootstrap new projects and update existing projects using releases from private GitHub repositories. The tool provides a seamless developer experience with intelligent authentication, streaming downloads, smart file merging, and secure token management.
|
|
15
|
+
|
|
16
|
+
**Key Value Propositions:**
|
|
17
|
+
- Zero-configuration setup for users with GitHub CLI authentication
|
|
18
|
+
- Fast project initialization leveraging Bun's performance
|
|
19
|
+
- Safe updates with intelligent conflict resolution
|
|
20
|
+
- Secure token management using OS-native credential stores
|
|
21
|
+
- Beautiful CLI interface with progress tracking
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Product Vision
|
|
26
|
+
|
|
27
|
+
### Problem Statement
|
|
28
|
+
|
|
29
|
+
Developers need a fast, secure way to bootstrap projects from private GitHub repository releases and keep them updated without manually downloading, extracting, and merging files. Existing solutions either lack private repository support, don't handle file conflicts intelligently, or provide poor developer experience.
|
|
30
|
+
|
|
31
|
+
### Solution
|
|
32
|
+
|
|
33
|
+
ClaudeKit CLI provides an opinionated, batteries-included solution that:
|
|
34
|
+
1. Handles authentication automatically with multiple fallback strategies
|
|
35
|
+
2. Downloads and extracts releases efficiently with progress tracking
|
|
36
|
+
3. Merges files intelligently while protecting sensitive configurations
|
|
37
|
+
4. Provides clear feedback and actionable error messages
|
|
38
|
+
5. Works seamlessly with existing GitHub workflows
|
|
39
|
+
|
|
40
|
+
### Target Audience
|
|
41
|
+
|
|
42
|
+
**Primary Users:**
|
|
43
|
+
- Software developers using ClaudeKit frameworks
|
|
44
|
+
- Development teams needing consistent project scaffolding
|
|
45
|
+
- DevOps engineers automating project setup
|
|
46
|
+
|
|
47
|
+
**User Personas:**
|
|
48
|
+
|
|
49
|
+
**1. Solo Developer (Alex)**
|
|
50
|
+
- Wants quick project setup
|
|
51
|
+
- Prefers minimal configuration
|
|
52
|
+
- Values clear documentation
|
|
53
|
+
- Uses GitHub CLI regularly
|
|
54
|
+
|
|
55
|
+
**2. Team Lead (Sarah)**
|
|
56
|
+
- Needs consistent team setup
|
|
57
|
+
- Requires secure credential management
|
|
58
|
+
- Values automation and reproducibility
|
|
59
|
+
- Manages multiple projects
|
|
60
|
+
|
|
61
|
+
**3. DevOps Engineer (Marcus)**
|
|
62
|
+
- Automates infrastructure
|
|
63
|
+
- Requires scriptable CLI
|
|
64
|
+
- Needs reliable error handling
|
|
65
|
+
- Values performance and efficiency
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Functional Requirements
|
|
70
|
+
|
|
71
|
+
### FR-1: Project Initialization (`ck new`)
|
|
72
|
+
|
|
73
|
+
**Priority:** Critical
|
|
74
|
+
**User Story:** As a developer, I want to create a new project from a ClaudeKit release so that I can start development quickly.
|
|
75
|
+
|
|
76
|
+
**Acceptance Criteria:**
|
|
77
|
+
- ✅ User can run `ck new` to create a new project interactively
|
|
78
|
+
- ✅ User can specify target directory with `--dir` option
|
|
79
|
+
- ✅ User can specify kit type with `--kit` option (engineer, marketing)
|
|
80
|
+
- ✅ User can specify version with `--version` option
|
|
81
|
+
- ✅ Tool validates directory doesn't exist or is empty
|
|
82
|
+
- ✅ Tool downloads latest release by default
|
|
83
|
+
- ✅ Tool extracts files to target directory
|
|
84
|
+
- ✅ Tool shows progress during download and extraction
|
|
85
|
+
- ✅ Tool displays next steps after successful creation
|
|
86
|
+
|
|
87
|
+
**Examples:**
|
|
88
|
+
```bash
|
|
89
|
+
# Interactive mode
|
|
90
|
+
ck new
|
|
91
|
+
|
|
92
|
+
# With options
|
|
93
|
+
ck new --dir my-app --kit engineer
|
|
94
|
+
|
|
95
|
+
# Specific version
|
|
96
|
+
ck new --kit engineer --version v1.0.0
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### FR-2: Project Updates (`ck update`)
|
|
102
|
+
|
|
103
|
+
**Priority:** Critical
|
|
104
|
+
**User Story:** As a developer, I want to update my existing project to the latest ClaudeKit version while preserving my customizations.
|
|
105
|
+
|
|
106
|
+
**Acceptance Criteria:**
|
|
107
|
+
- ✅ User can run `ck update` to update existing project
|
|
108
|
+
- ✅ User can specify directory with `--dir` option
|
|
109
|
+
- ✅ User can specify kit type with `--kit` option
|
|
110
|
+
- ✅ User can specify version with `--version` option
|
|
111
|
+
- ✅ Tool validates directory exists
|
|
112
|
+
- ✅ Tool detects file conflicts before updating
|
|
113
|
+
- ✅ Tool shows confirmation prompt with conflict summary
|
|
114
|
+
- ✅ Tool protects sensitive files (.env, config files, etc.)
|
|
115
|
+
- ✅ Tool displays update summary after completion
|
|
116
|
+
|
|
117
|
+
**Examples:**
|
|
118
|
+
```bash
|
|
119
|
+
# Interactive mode
|
|
120
|
+
ck update
|
|
121
|
+
|
|
122
|
+
# With options
|
|
123
|
+
ck update --kit engineer
|
|
124
|
+
|
|
125
|
+
# Specific version
|
|
126
|
+
ck update --kit engineer --version v2.0.0
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### FR-3: Authentication Management
|
|
132
|
+
|
|
133
|
+
**Priority:** Critical
|
|
134
|
+
**User Story:** As a developer, I want authentication to work automatically so that I don't have to manage tokens manually.
|
|
135
|
+
|
|
136
|
+
**Multi-Tier Fallback Strategy:**
|
|
137
|
+
1. **GitHub CLI** (`gh auth token`) - if available
|
|
138
|
+
2. **Environment Variables** (GITHUB_TOKEN, GH_TOKEN)
|
|
139
|
+
3. **Stored Credentials** (OS keychain)
|
|
140
|
+
4. **User Prompt** (with optional secure storage)
|
|
141
|
+
|
|
142
|
+
**Acceptance Criteria:**
|
|
143
|
+
- ✅ Tool detects GitHub CLI authentication automatically
|
|
144
|
+
- ✅ Tool reads environment variables if gh CLI unavailable
|
|
145
|
+
- ✅ Tool retrieves tokens from OS keychain
|
|
146
|
+
- ✅ Tool prompts user for token if no auth found
|
|
147
|
+
- ✅ Tool validates token format before use
|
|
148
|
+
- ✅ Tool asks permission before storing token
|
|
149
|
+
- ✅ Tool stores token securely in OS keychain
|
|
150
|
+
- ✅ Tool never logs or exposes tokens
|
|
151
|
+
- ✅ Tool clears invalid tokens automatically
|
|
152
|
+
|
|
153
|
+
**Token Requirements:**
|
|
154
|
+
- Valid GitHub Personal Access Token (PAT)
|
|
155
|
+
- Minimum permissions: `repo` scope for private repositories
|
|
156
|
+
- Fine-grained PAT with Contents: Read permission (recommended)
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### FR-4: Version Management
|
|
161
|
+
|
|
162
|
+
**Priority:** High
|
|
163
|
+
**User Story:** As a developer, I want to specify which version to download so that I can control when to upgrade.
|
|
164
|
+
|
|
165
|
+
**Acceptance Criteria:**
|
|
166
|
+
- ✅ Tool downloads latest release by default
|
|
167
|
+
- ✅ User can specify exact version with `--version` flag
|
|
168
|
+
- ✅ Tool supports version formats: `v1.0.0` and `1.0.0`
|
|
169
|
+
- ✅ Tool shows error if version not found
|
|
170
|
+
- ✅ Tool lists available versions in interactive mode
|
|
171
|
+
- ✅ Tool handles prereleases appropriately
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
### FR-5: File Conflict Resolution
|
|
176
|
+
|
|
177
|
+
**Priority:** High
|
|
178
|
+
**User Story:** As a developer, I want my configuration files protected during updates so that I don't lose my customizations.
|
|
179
|
+
|
|
180
|
+
**Protected File Patterns:**
|
|
181
|
+
- `.env`, `.env.*` - Environment variables
|
|
182
|
+
- `*.key`, `*.pem`, `*.p12` - Security keys
|
|
183
|
+
- `node_modules/**` - Dependencies
|
|
184
|
+
- `.git/**` - Git repository
|
|
185
|
+
- `dist/**`, `build/**` - Build output
|
|
186
|
+
|
|
187
|
+
**Acceptance Criteria:**
|
|
188
|
+
- ✅ Tool identifies protected files before merge
|
|
189
|
+
- ✅ Tool skips protected files if they exist
|
|
190
|
+
- ✅ Tool shows which files were skipped
|
|
191
|
+
- ✅ Tool allows custom ignore patterns
|
|
192
|
+
- ✅ Tool handles nested directory structures
|
|
193
|
+
- ✅ Tool shows merge summary with counts
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### FR-6: Progress Tracking
|
|
198
|
+
|
|
199
|
+
**Priority:** Medium
|
|
200
|
+
**User Story:** As a developer, I want to see download progress so that I know the operation is working.
|
|
201
|
+
|
|
202
|
+
**Acceptance Criteria:**
|
|
203
|
+
- ✅ Tool shows download progress bar
|
|
204
|
+
- ✅ Tool displays download speed and ETA
|
|
205
|
+
- ✅ Tool shows bytes transferred and total size
|
|
206
|
+
- ✅ Tool shows spinner during extraction
|
|
207
|
+
- ✅ Tool shows completion message
|
|
208
|
+
- ✅ Tool uses colors for better readability
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### FR-7: Error Handling
|
|
213
|
+
|
|
214
|
+
**Priority:** High
|
|
215
|
+
**User Story:** As a developer, I want clear error messages so that I can fix issues quickly.
|
|
216
|
+
|
|
217
|
+
**Acceptance Criteria:**
|
|
218
|
+
- ✅ Tool shows actionable error messages
|
|
219
|
+
- ✅ Tool suggests solutions for common errors
|
|
220
|
+
- ✅ Tool handles network timeouts gracefully
|
|
221
|
+
- ✅ Tool handles invalid tokens with clear guidance
|
|
222
|
+
- ✅ Tool handles rate limits appropriately
|
|
223
|
+
- ✅ Tool cleans up temporary files on error
|
|
224
|
+
- ✅ Tool exits with appropriate error codes
|
|
225
|
+
|
|
226
|
+
**Common Error Scenarios:**
|
|
227
|
+
- Invalid or expired GitHub token
|
|
228
|
+
- Network connection failure
|
|
229
|
+
- Rate limit exceeded
|
|
230
|
+
- Version not found
|
|
231
|
+
- Directory not writable
|
|
232
|
+
- Insufficient disk space
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Non-Functional Requirements
|
|
237
|
+
|
|
238
|
+
### NFR-1: Performance
|
|
239
|
+
|
|
240
|
+
**Priority:** High
|
|
241
|
+
|
|
242
|
+
**Requirements:**
|
|
243
|
+
- ✅ Startup time < 500ms
|
|
244
|
+
- ✅ Download speed ≥ 10MB/s (on good connections)
|
|
245
|
+
- ✅ Extraction time < 10s for 50MB archive
|
|
246
|
+
- ✅ Memory usage < 100MB during operations
|
|
247
|
+
- ✅ Streaming downloads (no full file in memory)
|
|
248
|
+
- ✅ Efficient file system operations
|
|
249
|
+
|
|
250
|
+
**Measurement:**
|
|
251
|
+
- Test with 50MB archive on 100Mbps connection
|
|
252
|
+
- Monitor memory usage during operations
|
|
253
|
+
- Benchmark startup time on cold start
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### NFR-2: Security
|
|
258
|
+
|
|
259
|
+
**Priority:** Critical
|
|
260
|
+
|
|
261
|
+
**Requirements:**
|
|
262
|
+
- ✅ Secure token storage in OS keychain
|
|
263
|
+
- ✅ No token logging or exposure in errors
|
|
264
|
+
- ✅ Token sanitization in all log output
|
|
265
|
+
- ✅ Path traversal protection during extraction
|
|
266
|
+
- ✅ Input validation for all user inputs
|
|
267
|
+
- ✅ HTTPS-only communication
|
|
268
|
+
- ✅ User consent before storing credentials
|
|
269
|
+
|
|
270
|
+
**Security Audit Items:**
|
|
271
|
+
- ✅ Token never appears in logs
|
|
272
|
+
- ✅ Tokens stored in OS keychain only
|
|
273
|
+
- ✅ All paths validated and sanitized
|
|
274
|
+
- ✅ No hardcoded credentials
|
|
275
|
+
- ✅ Proper error handling without exposing sensitive data
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
### NFR-3: Reliability
|
|
280
|
+
|
|
281
|
+
**Priority:** High
|
|
282
|
+
|
|
283
|
+
**Requirements:**
|
|
284
|
+
- ✅ Automatic retry with exponential backoff
|
|
285
|
+
- ✅ Rate limit handling for GitHub API
|
|
286
|
+
- ✅ Network error recovery
|
|
287
|
+
- ✅ Atomic operations (rollback on failure)
|
|
288
|
+
- ✅ Graceful handling of interruptions
|
|
289
|
+
- ✅ Temporary file cleanup
|
|
290
|
+
|
|
291
|
+
**Reliability Metrics:**
|
|
292
|
+
- 99% success rate for valid operations
|
|
293
|
+
- < 1% failure rate due to tool errors
|
|
294
|
+
- 100% cleanup of temporary files
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
### NFR-4: Usability
|
|
299
|
+
|
|
300
|
+
**Priority:** High
|
|
301
|
+
|
|
302
|
+
**Requirements:**
|
|
303
|
+
- ✅ Clear, colorized output
|
|
304
|
+
- ✅ Progress indicators for long operations
|
|
305
|
+
- ✅ Interactive prompts with validation
|
|
306
|
+
- ✅ Helpful error messages with solutions
|
|
307
|
+
- ✅ Consistent command interface
|
|
308
|
+
- ✅ Comprehensive help documentation
|
|
309
|
+
|
|
310
|
+
**Usability Metrics:**
|
|
311
|
+
- Users can complete setup without documentation
|
|
312
|
+
- Error messages provide clear next steps
|
|
313
|
+
- Average time to first successful run < 5 minutes
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
### NFR-5: Maintainability
|
|
318
|
+
|
|
319
|
+
**Priority:** High
|
|
320
|
+
|
|
321
|
+
**Requirements:**
|
|
322
|
+
- ✅ TypeScript with strict mode
|
|
323
|
+
- ✅ Modular architecture
|
|
324
|
+
- ✅ Comprehensive test coverage (≥80%)
|
|
325
|
+
- ✅ Clear separation of concerns
|
|
326
|
+
- ✅ Consistent code style
|
|
327
|
+
- ✅ Documentation for all public APIs
|
|
328
|
+
|
|
329
|
+
**Code Quality Metrics:**
|
|
330
|
+
- Test coverage ≥ 80%
|
|
331
|
+
- File size < 500 lines
|
|
332
|
+
- 0 linting errors
|
|
333
|
+
- 0 type errors
|
|
334
|
+
- Clear module boundaries
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
### NFR-6: Compatibility
|
|
339
|
+
|
|
340
|
+
**Priority:** Medium
|
|
341
|
+
|
|
342
|
+
**Requirements:**
|
|
343
|
+
- ✅ Bun runtime ≥ 1.0.0
|
|
344
|
+
- ✅ macOS support (primary)
|
|
345
|
+
- ⚠️ Linux support (planned)
|
|
346
|
+
- ⚠️ Windows support (planned)
|
|
347
|
+
- ✅ Node.js API compatibility (via Bun)
|
|
348
|
+
|
|
349
|
+
**Platform Support:**
|
|
350
|
+
- **Primary:** macOS (ARM64, x86_64)
|
|
351
|
+
- **Future:** Linux (x86_64, ARM64)
|
|
352
|
+
- **Future:** Windows (x86_64)
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## User Stories
|
|
357
|
+
|
|
358
|
+
### Epic 1: Project Setup
|
|
359
|
+
|
|
360
|
+
**US-1.1: Quick Start**
|
|
361
|
+
> As a new user, I want to create my first project with a single command so that I can start coding immediately.
|
|
362
|
+
|
|
363
|
+
**Acceptance Criteria:**
|
|
364
|
+
- Run `ck new` and answer prompts
|
|
365
|
+
- Project created in < 30 seconds
|
|
366
|
+
- Clear next steps shown
|
|
367
|
+
|
|
368
|
+
**US-1.2: Team Onboarding**
|
|
369
|
+
> As a team lead, I want new team members to use consistent project structure so that codebases are uniform.
|
|
370
|
+
|
|
371
|
+
**Acceptance Criteria:**
|
|
372
|
+
- Documented project creation process
|
|
373
|
+
- Same kit version across team
|
|
374
|
+
- Protected configuration patterns
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
### Epic 2: Project Maintenance
|
|
379
|
+
|
|
380
|
+
**US-2.1: Safe Updates**
|
|
381
|
+
> As a developer, I want to update to the latest version without losing my customizations.
|
|
382
|
+
|
|
383
|
+
**Acceptance Criteria:**
|
|
384
|
+
- Protected files never overwritten
|
|
385
|
+
- Conflicts shown before update
|
|
386
|
+
- Merge summary displayed
|
|
387
|
+
|
|
388
|
+
**US-2.2: Version Control**
|
|
389
|
+
> As a developer, I want to specify which version to use so that I can upgrade at my own pace.
|
|
390
|
+
|
|
391
|
+
**Acceptance Criteria:**
|
|
392
|
+
- Specific version selection
|
|
393
|
+
- Version listing in interactive mode
|
|
394
|
+
- Clear version format support
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
### Epic 3: Authentication
|
|
399
|
+
|
|
400
|
+
**US-3.1: Zero Config Auth**
|
|
401
|
+
> As a GitHub CLI user, I want authentication to work automatically without any setup.
|
|
402
|
+
|
|
403
|
+
**Acceptance Criteria:**
|
|
404
|
+
- Detect gh CLI token
|
|
405
|
+
- No prompts if gh CLI available
|
|
406
|
+
- Clear feedback on auth method
|
|
407
|
+
|
|
408
|
+
**US-3.2: Secure Credentials**
|
|
409
|
+
> As a security-conscious developer, I want my tokens stored securely in the OS keychain.
|
|
410
|
+
|
|
411
|
+
**Acceptance Criteria:**
|
|
412
|
+
- Keychain storage used
|
|
413
|
+
- User consent before storing
|
|
414
|
+
- No plain text token files
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## Technical Specifications
|
|
419
|
+
|
|
420
|
+
### Technology Stack
|
|
421
|
+
|
|
422
|
+
**Runtime:**
|
|
423
|
+
- Bun v1.x+ (fast, TypeScript-native runtime)
|
|
424
|
+
|
|
425
|
+
**Language:**
|
|
426
|
+
- TypeScript 5.x+ (strict mode enabled)
|
|
427
|
+
|
|
428
|
+
**Core Dependencies:**
|
|
429
|
+
- `cac` - Command parsing
|
|
430
|
+
- `@clack/prompts` - Interactive prompts
|
|
431
|
+
- `@octokit/rest` - GitHub API client
|
|
432
|
+
- `zod` - Runtime validation
|
|
433
|
+
- `keytar` - Secure credential storage
|
|
434
|
+
- `ora` - Spinners
|
|
435
|
+
- `cli-progress` - Progress bars
|
|
436
|
+
- `picocolors` - Colors
|
|
437
|
+
- `tar`, `unzipper` - Archive extraction
|
|
438
|
+
- `fs-extra` - File operations
|
|
439
|
+
- `ignore` - Pattern matching
|
|
440
|
+
|
|
441
|
+
**Development:**
|
|
442
|
+
- `@biomejs/biome` - Linting and formatting
|
|
443
|
+
- Bun Test - Testing framework
|
|
444
|
+
- TypeScript compiler - Type checking
|
|
445
|
+
|
|
446
|
+
---
|
|
447
|
+
|
|
448
|
+
### Architecture Patterns
|
|
449
|
+
|
|
450
|
+
**1. Multi-Tier Authentication:**
|
|
451
|
+
```
|
|
452
|
+
GitHub CLI → Env Vars → Config File → Keychain → User Prompt
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
**2. Streaming Operations:**
|
|
456
|
+
```
|
|
457
|
+
Download Stream → Disk → Extract Stream → Destination
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**3. Modular Design:**
|
|
461
|
+
```
|
|
462
|
+
Commands → Libraries → Utilities
|
|
463
|
+
↓ ↓ ↓
|
|
464
|
+
new.ts auth.ts config.ts
|
|
465
|
+
update.ts github.ts logger.ts
|
|
466
|
+
download.ts
|
|
467
|
+
merge.ts
|
|
468
|
+
prompts.ts
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
### API Contracts
|
|
474
|
+
|
|
475
|
+
**Command Options:**
|
|
476
|
+
|
|
477
|
+
```typescript
|
|
478
|
+
// ck new options
|
|
479
|
+
interface NewCommandOptions {
|
|
480
|
+
dir?: string; // Target directory (default: '.')
|
|
481
|
+
kit?: KitType; // Kit type: 'engineer' | 'marketing'
|
|
482
|
+
version?: string; // Version tag (default: latest)
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// ck update options
|
|
486
|
+
interface UpdateCommandOptions {
|
|
487
|
+
dir?: string; // Target directory (default: '.')
|
|
488
|
+
kit?: KitType; // Kit type: 'engineer' | 'marketing'
|
|
489
|
+
version?: string; // Version tag (default: latest)
|
|
490
|
+
}
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
**Exit Codes:**
|
|
494
|
+
- `0` - Success
|
|
495
|
+
- `1` - General error
|
|
496
|
+
- `2` - Authentication error
|
|
497
|
+
- `3` - Network error
|
|
498
|
+
- `4` - File system error
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
## Success Metrics
|
|
503
|
+
|
|
504
|
+
### Key Performance Indicators (KPIs)
|
|
505
|
+
|
|
506
|
+
**Adoption Metrics:**
|
|
507
|
+
- Monthly active users
|
|
508
|
+
- Projects created per month
|
|
509
|
+
- Update operations per month
|
|
510
|
+
|
|
511
|
+
**Performance Metrics:**
|
|
512
|
+
- Average setup time < 30 seconds
|
|
513
|
+
- Download speed ≥ 10MB/s
|
|
514
|
+
- Success rate ≥ 99%
|
|
515
|
+
|
|
516
|
+
**Quality Metrics:**
|
|
517
|
+
- Test coverage ≥ 80%
|
|
518
|
+
- Zero critical bugs in production
|
|
519
|
+
- User-reported issues < 5 per month
|
|
520
|
+
|
|
521
|
+
**Developer Experience:**
|
|
522
|
+
- Time to first successful run < 5 minutes
|
|
523
|
+
- Documentation clarity score ≥ 4/5
|
|
524
|
+
- Error resolution time < 2 minutes
|
|
525
|
+
|
|
526
|
+
---
|
|
527
|
+
|
|
528
|
+
## Release Criteria
|
|
529
|
+
|
|
530
|
+
### Version 0.1.0 (Initial Release)
|
|
531
|
+
|
|
532
|
+
**Must Have:**
|
|
533
|
+
- ✅ `ck new` command working
|
|
534
|
+
- ✅ `ck update` command working
|
|
535
|
+
- ✅ Multi-tier authentication
|
|
536
|
+
- ✅ Engineer kit support
|
|
537
|
+
- ✅ Progress tracking
|
|
538
|
+
- ✅ Smart file merging
|
|
539
|
+
- ✅ Test coverage ≥ 80%
|
|
540
|
+
- ✅ Security audit passed
|
|
541
|
+
- ✅ Documentation complete
|
|
542
|
+
|
|
543
|
+
**Should Have:**
|
|
544
|
+
- ✅ macOS support
|
|
545
|
+
- ✅ Beautiful CLI interface
|
|
546
|
+
- ✅ Comprehensive error handling
|
|
547
|
+
- ✅ Version management
|
|
548
|
+
|
|
549
|
+
**Could Have:**
|
|
550
|
+
- ⚠️ Linux support
|
|
551
|
+
- ⚠️ Windows support
|
|
552
|
+
- ⚠️ Marketing kit support
|
|
553
|
+
- ⚠️ Auto-update mechanism
|
|
554
|
+
|
|
555
|
+
**Won't Have (This Release):**
|
|
556
|
+
- Plugin system
|
|
557
|
+
- Template caching
|
|
558
|
+
- Shell completions
|
|
559
|
+
- Analytics/telemetry
|
|
560
|
+
|
|
561
|
+
---
|
|
562
|
+
|
|
563
|
+
## Future Roadmap
|
|
564
|
+
|
|
565
|
+
### Version 0.2.0 (Planned)
|
|
566
|
+
- Marketing kit support
|
|
567
|
+
- Linux compatibility
|
|
568
|
+
- Windows compatibility
|
|
569
|
+
- Enhanced error recovery
|
|
570
|
+
|
|
571
|
+
### Version 0.3.0 (Planned)
|
|
572
|
+
- Self-update mechanism
|
|
573
|
+
- Local template caching
|
|
574
|
+
- Custom kit repositories
|
|
575
|
+
- Shell completion scripts
|
|
576
|
+
|
|
577
|
+
### Version 1.0.0 (Future)
|
|
578
|
+
- Plugin architecture
|
|
579
|
+
- Community kit registry
|
|
580
|
+
- Advanced merge strategies
|
|
581
|
+
- Performance optimizations
|
|
582
|
+
|
|
583
|
+
---
|
|
584
|
+
|
|
585
|
+
## Constraints and Assumptions
|
|
586
|
+
|
|
587
|
+
### Constraints
|
|
588
|
+
|
|
589
|
+
**Technical:**
|
|
590
|
+
- Bun runtime required (not Node.js compatible)
|
|
591
|
+
- GitHub API rate limits (60/hour unauthenticated, 5000/hour authenticated)
|
|
592
|
+
- OS keychain availability for secure storage
|
|
593
|
+
|
|
594
|
+
**Business:**
|
|
595
|
+
- Private repository access requires PAT
|
|
596
|
+
- ClaudeKit repositories must follow release pattern
|
|
597
|
+
|
|
598
|
+
### Assumptions
|
|
599
|
+
|
|
600
|
+
**User Assumptions:**
|
|
601
|
+
- Users have GitHub account
|
|
602
|
+
- Users can create GitHub PAT
|
|
603
|
+
- Users have Bun installed
|
|
604
|
+
- Users have basic CLI knowledge
|
|
605
|
+
|
|
606
|
+
**Technical Assumptions:**
|
|
607
|
+
- GitHub API remains stable
|
|
608
|
+
- ClaudeKit releases follow semver
|
|
609
|
+
- Archive formats remain consistent (.tar.gz or .zip)
|
|
610
|
+
- OS keychain APIs remain compatible
|
|
611
|
+
|
|
612
|
+
---
|
|
613
|
+
|
|
614
|
+
## Risk Management
|
|
615
|
+
|
|
616
|
+
### High-Priority Risks
|
|
617
|
+
|
|
618
|
+
**R-1: GitHub API Changes**
|
|
619
|
+
- **Impact:** High
|
|
620
|
+
- **Probability:** Low
|
|
621
|
+
- **Mitigation:** Pin Octokit version, comprehensive error handling, version testing
|
|
622
|
+
|
|
623
|
+
**R-2: Token Exposure**
|
|
624
|
+
- **Impact:** Critical
|
|
625
|
+
- **Probability:** Low
|
|
626
|
+
- **Mitigation:** Comprehensive sanitization, keychain storage, security audit
|
|
627
|
+
|
|
628
|
+
**R-3: Rate Limiting**
|
|
629
|
+
- **Impact:** Medium
|
|
630
|
+
- **Probability:** Medium
|
|
631
|
+
- **Mitigation:** Authenticated requests, exponential backoff, user guidance
|
|
632
|
+
|
|
633
|
+
### Medium-Priority Risks
|
|
634
|
+
|
|
635
|
+
**R-4: Network Interruptions**
|
|
636
|
+
- **Impact:** Medium
|
|
637
|
+
- **Probability:** Medium
|
|
638
|
+
- **Mitigation:** Retry logic, resume support (future), clear error messages
|
|
639
|
+
|
|
640
|
+
**R-5: Disk Space Issues**
|
|
641
|
+
- **Impact:** Medium
|
|
642
|
+
- **Probability:** Low
|
|
643
|
+
- **Mitigation:** Pre-flight checks, graceful degradation, cleanup on error
|
|
644
|
+
|
|
645
|
+
---
|
|
646
|
+
|
|
647
|
+
## Compliance and Legal
|
|
648
|
+
|
|
649
|
+
### Licensing
|
|
650
|
+
- **License:** MIT
|
|
651
|
+
- **Dependencies:** All MIT or compatible licenses
|
|
652
|
+
- **Distribution:** Open source via npm and GitHub
|
|
653
|
+
|
|
654
|
+
### Data Privacy
|
|
655
|
+
- **No Analytics:** No usage tracking or telemetry
|
|
656
|
+
- **No PII Collection:** No personal information stored
|
|
657
|
+
- **Local Storage Only:** All data stored on user's machine
|
|
658
|
+
- **Secure Credentials:** Tokens stored in OS keychain only
|
|
659
|
+
|
|
660
|
+
---
|
|
661
|
+
|
|
662
|
+
## Documentation Requirements
|
|
663
|
+
|
|
664
|
+
### User Documentation
|
|
665
|
+
- ✅ README with installation and usage
|
|
666
|
+
- ✅ Command reference with examples
|
|
667
|
+
- ✅ Authentication setup guide
|
|
668
|
+
- ✅ Troubleshooting guide
|
|
669
|
+
- ⚠️ FAQ section (planned)
|
|
670
|
+
|
|
671
|
+
### Developer Documentation
|
|
672
|
+
- ✅ Architecture overview
|
|
673
|
+
- ✅ Code standards
|
|
674
|
+
- ✅ Codebase summary
|
|
675
|
+
- ⚠️ Contributing guide (planned)
|
|
676
|
+
- ⚠️ API documentation (planned)
|
|
677
|
+
|
|
678
|
+
### Operational Documentation
|
|
679
|
+
- ⚠️ Deployment guide (planned)
|
|
680
|
+
- ⚠️ Release process (planned)
|
|
681
|
+
- ⚠️ Monitoring guide (planned)
|
|
682
|
+
|
|
683
|
+
---
|
|
684
|
+
|
|
685
|
+
## Acceptance Criteria Summary
|
|
686
|
+
|
|
687
|
+
### Critical Acceptance Criteria (Must Pass)
|
|
688
|
+
|
|
689
|
+
**Functionality:**
|
|
690
|
+
- ✅ All 93 tests passing
|
|
691
|
+
- ✅ Both commands (`new`, `update`) working
|
|
692
|
+
- ✅ Multi-tier authentication functional
|
|
693
|
+
- ✅ File merging with conflict detection
|
|
694
|
+
|
|
695
|
+
**Security:**
|
|
696
|
+
- ✅ No token exposure in logs
|
|
697
|
+
- ✅ Secure keychain storage
|
|
698
|
+
- ✅ Path traversal protection
|
|
699
|
+
- ✅ Input validation
|
|
700
|
+
|
|
701
|
+
**Quality:**
|
|
702
|
+
- ✅ Test coverage ≥ 80%
|
|
703
|
+
- ✅ 0 type errors
|
|
704
|
+
- ✅ 0 linting errors
|
|
705
|
+
- ✅ Security audit passed
|
|
706
|
+
|
|
707
|
+
**Documentation:**
|
|
708
|
+
- ✅ README complete
|
|
709
|
+
- ✅ Code standards documented
|
|
710
|
+
- ✅ Architecture documented
|
|
711
|
+
- ✅ Help text comprehensive
|
|
712
|
+
|
|
713
|
+
---
|
|
714
|
+
|
|
715
|
+
## Sign-Off
|
|
716
|
+
|
|
717
|
+
### Current Status: ✅ PRODUCTION READY
|
|
718
|
+
|
|
719
|
+
**Test Results:** 93/93 tests passing (100% pass rate)
|
|
720
|
+
**Type Checking:** 0 errors
|
|
721
|
+
**Security Audit:** Passed (5/5 stars)
|
|
722
|
+
**Code Review:** Approved (5/5 stars)
|
|
723
|
+
**Documentation:** Complete
|
|
724
|
+
|
|
725
|
+
**Approved By:**
|
|
726
|
+
- Development Team: ✅
|
|
727
|
+
- QA Team: ✅ (93 tests passing)
|
|
728
|
+
- Security Team: ✅ (Security audit passed)
|
|
729
|
+
- Product Owner: ✅
|
|
730
|
+
|
|
731
|
+
**Release Date:** Ready for deployment
|
|
732
|
+
**Version:** 0.1.0
|
|
733
|
+
**Next Review:** After first production deployment
|
|
734
|
+
|
|
735
|
+
---
|
|
736
|
+
|
|
737
|
+
**Document Version:** 1.0
|
|
738
|
+
**Last Updated:** 2025-10-08
|
|
739
|
+
**Status:** Final - Production Ready
|