@claudecam/cli 0.0.1 → 0.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.
Files changed (70) hide show
  1. package/dist/cam-hook.d.ts +8 -0
  2. package/dist/cam-hook.d.ts.map +1 -0
  3. package/dist/cam-hook.js +8 -0
  4. package/dist/cam-hook.js.map +1 -0
  5. package/dist/commands/doctor.d.ts +3 -0
  6. package/dist/commands/doctor.d.ts.map +1 -0
  7. package/dist/commands/doctor.js +218 -0
  8. package/dist/commands/doctor.js.map +1 -0
  9. package/dist/commands/hooks.d.ts +3 -0
  10. package/dist/commands/hooks.d.ts.map +1 -0
  11. package/dist/commands/hooks.js +106 -0
  12. package/dist/commands/hooks.js.map +1 -0
  13. package/dist/commands/init.d.ts +3 -0
  14. package/dist/commands/init.d.ts.map +1 -0
  15. package/dist/commands/init.js +576 -0
  16. package/dist/commands/init.js.map +1 -0
  17. package/dist/commands/progress.d.ts +3 -0
  18. package/dist/commands/progress.d.ts.map +1 -0
  19. package/dist/commands/progress.js +157 -0
  20. package/dist/commands/progress.js.map +1 -0
  21. package/dist/commands/project.d.ts +3 -0
  22. package/dist/commands/project.d.ts.map +1 -0
  23. package/dist/commands/project.js +203 -0
  24. package/dist/commands/project.js.map +1 -0
  25. package/dist/commands/sessions.d.ts +3 -0
  26. package/dist/commands/sessions.d.ts.map +1 -0
  27. package/dist/commands/sessions.js +105 -0
  28. package/dist/commands/sessions.js.map +1 -0
  29. package/dist/commands/sprint.d.ts +3 -0
  30. package/dist/commands/sprint.d.ts.map +1 -0
  31. package/dist/commands/sprint.js +552 -0
  32. package/dist/commands/sprint.js.map +1 -0
  33. package/dist/commands/start.d.ts +3 -0
  34. package/dist/commands/start.d.ts.map +1 -0
  35. package/dist/commands/start.js +216 -0
  36. package/dist/commands/start.js.map +1 -0
  37. package/dist/commands/status.d.ts +3 -0
  38. package/dist/commands/status.d.ts.map +1 -0
  39. package/dist/commands/status.js +178 -0
  40. package/dist/commands/status.js.map +1 -0
  41. package/dist/commands/tasks.d.ts +3 -0
  42. package/dist/commands/tasks.d.ts.map +1 -0
  43. package/dist/commands/tasks.js +176 -0
  44. package/dist/commands/tasks.js.map +1 -0
  45. package/dist/commands/theme.d.ts +3 -0
  46. package/dist/commands/theme.d.ts.map +1 -0
  47. package/dist/commands/theme.js +63 -0
  48. package/dist/commands/theme.js.map +1 -0
  49. package/dist/index.d.ts +3 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +31 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/utils/config.d.ts +18 -0
  54. package/dist/utils/config.d.ts.map +1 -0
  55. package/dist/utils/config.js +74 -0
  56. package/dist/utils/config.js.map +1 -0
  57. package/dist/utils/hooks-config.d.ts +28 -0
  58. package/dist/utils/hooks-config.d.ts.map +1 -0
  59. package/dist/utils/hooks-config.js +120 -0
  60. package/dist/utils/hooks-config.js.map +1 -0
  61. package/dist/utils/logger.d.ts +16 -0
  62. package/dist/utils/logger.d.ts.map +1 -0
  63. package/dist/utils/logger.js +39 -0
  64. package/dist/utils/logger.js.map +1 -0
  65. package/dist/utils/sprint-parser.d.ts +32 -0
  66. package/dist/utils/sprint-parser.d.ts.map +1 -0
  67. package/dist/utils/sprint-parser.js +115 -0
  68. package/dist/utils/sprint-parser.js.map +1 -0
  69. package/package.json +47 -20
  70. package/index.js +0 -6
@@ -0,0 +1,576 @@
1
+ import { Command } from "commander";
2
+ import chalk from "chalk";
3
+ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
4
+ import { basename, join } from "node:path";
5
+ import { execSync } from "node:child_process";
6
+ import { DEFAULT_SERVER_PORT } from "@claudecam/shared";
7
+ import { logger } from "../utils/logger.js";
8
+ import { claudeSettingsExist, readClaudeSettings, writeClaudeSettings, ensureClaudeDir, readConfig, writeConfig, } from "../utils/config.js";
9
+ import { generateHooksConfig, mergeHooks, HOOK_TYPE_DESCRIPTIONS, isCamHook, } from "../utils/hooks-config.js";
10
+ export const initCommand = new Command("init")
11
+ .description("Initialize Claude Agent Monitor hooks in the current project")
12
+ .option("--force", "Overwrite existing hooks configuration")
13
+ .action(async (options) => {
14
+ logger.blank();
15
+ logger.section("Claude Agent Monitor - Initializing...");
16
+ logger.blank();
17
+ // Check if cam-hook binary is available in PATH
18
+ const camHookAvailable = checkCamHookAvailable();
19
+ if (!camHookAvailable) {
20
+ logger.warning(`${chalk.cyan("cam-hook")} not found in PATH. Hooks may not work.`);
21
+ logger.info(`Install globally: ${chalk.cyan("npm install -g claude-agent-monitor")}`);
22
+ logger.blank();
23
+ }
24
+ const settingsExist = claudeSettingsExist();
25
+ const camHooks = generateHooksConfig();
26
+ const hookCount = Object.keys(HOOK_TYPE_DESCRIPTIONS).length;
27
+ if (settingsExist && !options.force) {
28
+ // Merge mode: preserve existing hooks, add/update CAM hooks
29
+ const existing = readClaudeSettings();
30
+ const existingHooks = (existing.hooks ?? {});
31
+ // Count user hooks that will be preserved
32
+ let preservedCount = 0;
33
+ for (const entries of Object.values(existingHooks)) {
34
+ preservedCount += entries.filter((e) => !isCamHook(e)).length;
35
+ }
36
+ const merged = mergeHooks(existing, camHooks);
37
+ writeClaudeSettings(merged);
38
+ logger.success(`Merged hooks into existing ${chalk.cyan(".claude/settings.json")}`);
39
+ if (preservedCount > 0) {
40
+ logger.info(`Preserved ${chalk.yellow(String(preservedCount))} existing user hook(s)`);
41
+ }
42
+ }
43
+ else {
44
+ // Create mode: create new settings with hooks
45
+ ensureClaudeDir();
46
+ const settings = { hooks: camHooks };
47
+ writeClaudeSettings(settings);
48
+ if (settingsExist && options.force) {
49
+ logger.success(`Overwrote ${chalk.cyan(".claude/settings.json")} (--force)`);
50
+ }
51
+ else {
52
+ logger.success(`Created ${chalk.cyan(".claude/settings.json")}`);
53
+ }
54
+ }
55
+ // Display configured hooks summary
56
+ logger.blank();
57
+ logger.section(`Configured ${hookCount} hooks:`);
58
+ for (const [hookType, description] of Object.entries(HOOK_TYPE_DESCRIPTIONS)) {
59
+ logger.item(`${chalk.white(hookType)} ${chalk.gray(`(${description})`)}`);
60
+ }
61
+ // Scaffold docs structure (PRD + Sprints)
62
+ logger.blank();
63
+ logger.section("Docs Structure");
64
+ const docsResult = scaffoldDocs();
65
+ if (docsResult.created.length > 0) {
66
+ for (const path of docsResult.created) {
67
+ logger.success(`Created ${chalk.cyan(path)}`);
68
+ }
69
+ }
70
+ else {
71
+ logger.info("Docs structure already exists");
72
+ }
73
+ // === Project Registration (Sprint 8: Project-First Architecture) ===
74
+ logger.blank();
75
+ logger.section("Project Registration");
76
+ let projectId = null;
77
+ let serverAvailable = false;
78
+ // Check if server is running
79
+ try {
80
+ const healthRes = await fetch(`http://localhost:${DEFAULT_SERVER_PORT}/api/health`);
81
+ serverAvailable = healthRes.ok;
82
+ }
83
+ catch {
84
+ serverAvailable = false;
85
+ }
86
+ if (!serverAvailable) {
87
+ logger.info(`Server not running. Start with ${chalk.cyan("'cam start'")} then re-run ${chalk.cyan("'cam init'")} to register this project.`);
88
+ }
89
+ else {
90
+ // Check if project already registered for this directory
91
+ try {
92
+ const cwd = process.cwd();
93
+ const lookupRes = await fetch(`http://localhost:${DEFAULT_SERVER_PORT}/api/registry/lookup?dir=${encodeURIComponent(cwd)}`);
94
+ if (lookupRes.ok) {
95
+ const lookupData = (await lookupRes.json());
96
+ if (lookupData.project_id) {
97
+ projectId = lookupData.project_id;
98
+ const name = lookupData.project?.name ?? projectId.slice(0, 8);
99
+ logger.success(`Project already registered: ${chalk.cyan(name)}`);
100
+ }
101
+ }
102
+ }
103
+ catch {
104
+ // Registry lookup failed, will try to create
105
+ }
106
+ // Create project only if not already registered
107
+ if (!projectId) {
108
+ try {
109
+ const projName = basename(process.cwd());
110
+ const response = await fetch(`http://localhost:${DEFAULT_SERVER_PORT}/api/projects`, {
111
+ method: "POST",
112
+ headers: { "Content-Type": "application/json" },
113
+ body: JSON.stringify({ name: projName, prd_content: "" }),
114
+ });
115
+ if (response.ok) {
116
+ const data = (await response.json());
117
+ if (data.project) {
118
+ projectId = data.project.id;
119
+ logger.success(`Project created: ${chalk.cyan(data.project.name)}`);
120
+ }
121
+ }
122
+ }
123
+ catch {
124
+ logger.warning("Failed to create project");
125
+ }
126
+ // Register working directory for new project
127
+ if (projectId) {
128
+ try {
129
+ const regResponse = await fetch(`http://localhost:${DEFAULT_SERVER_PORT}/api/registry`, {
130
+ method: "POST",
131
+ headers: { "Content-Type": "application/json" },
132
+ body: JSON.stringify({
133
+ working_directory: process.cwd(),
134
+ project_id: projectId,
135
+ prd_path: null,
136
+ }),
137
+ });
138
+ if (regResponse.ok) {
139
+ logger.success("Directory registered with CAM");
140
+ }
141
+ }
142
+ catch {
143
+ logger.warning("Failed to register directory");
144
+ }
145
+ }
146
+ }
147
+ // Save activeProjectId to local config (always, whether new or existing)
148
+ if (projectId) {
149
+ try {
150
+ const config = readConfig();
151
+ writeConfig({ ...config, activeProjectId: projectId });
152
+ logger.success("Project ID saved to config");
153
+ }
154
+ catch {
155
+ // Config save failed silently
156
+ }
157
+ }
158
+ }
159
+ // Test server connectivity
160
+ logger.blank();
161
+ try {
162
+ const response = await fetch(`http://localhost:${DEFAULT_SERVER_PORT}/api/sessions`);
163
+ if (response.ok) {
164
+ logger.success(`Server is running at ${chalk.cyan(`http://localhost:${DEFAULT_SERVER_PORT}`)}`);
165
+ }
166
+ }
167
+ catch {
168
+ if (!serverAvailable) {
169
+ logger.info(`Run ${chalk.cyan("'cam start'")} to launch the monitoring server.`);
170
+ }
171
+ }
172
+ // Next steps
173
+ logger.blank();
174
+ logger.section("Next steps");
175
+ logger.info(`Create a PRD: copy ${chalk.cyan("docs/PRD/TEMPLATE.md")} to ${chalk.cyan("PRD.md")} (optional)`);
176
+ logger.info(`Create a sprint: copy ${chalk.cyan("docs/SPRINTS/TEMPLATE.md")} to ${chalk.cyan("sprint-01.md")}`);
177
+ logger.info(`Import tasks: ${chalk.cyan("cam sprint import docs/SPRINTS/sprint-01.md")}`);
178
+ logger.blank();
179
+ });
180
+ function checkCamHookAvailable() {
181
+ try {
182
+ const cmd = process.platform === "win32" ? "where cam-hook" : "which cam-hook";
183
+ execSync(cmd, { stdio: "ignore" });
184
+ return true;
185
+ }
186
+ catch {
187
+ return false;
188
+ }
189
+ }
190
+ const PRD_TEMPLATE_CONTENT = `# [Project Name] - PRD (Product Requirements Document)
191
+
192
+ > [Short phrase describing the project in one line]
193
+
194
+ **Version**: 1.0.0
195
+ **Date**: YYYY-MM-DD
196
+ **Status**: Draft | Active | Completed
197
+ **License**: MIT | Apache-2.0 | ...
198
+
199
+ ---
200
+
201
+ # PART 1 - PRD (WHAT to build)
202
+
203
+ ---
204
+
205
+ ## 1. Product Vision
206
+
207
+ ### Name
208
+ **[Project Name]**
209
+
210
+ ### Value Proposition
211
+ What this product does and why it matters. What problem it solves and for whom.
212
+ Describe the value in 2-3 paragraphs.
213
+
214
+ ### Target Audience
215
+ - Persona 1: description and primary need
216
+ - Persona 2: description and primary need
217
+
218
+ ### Differentiator
219
+ - What makes this project unique
220
+ - Competitive advantages
221
+ - Why someone would choose this vs alternatives
222
+
223
+ ---
224
+
225
+ ## 2. Problem
226
+
227
+ ### Current Situation
228
+ How things work today without this product.
229
+
230
+ ### Pain Points
231
+ | Pain Point | Severity | Frequency |
232
+ |------------|----------|-----------|
233
+ | Pain point description 1 | High/Medium/Low | Frequency |
234
+ | Pain point description 2 | High/Medium/Low | Frequency |
235
+
236
+ ### Opportunity
237
+ Why now is the right time. What technology or market shift enables this solution.
238
+
239
+ ---
240
+
241
+ # PART 2 - SPEC (HOW to build)
242
+
243
+ ---
244
+
245
+ ## 3. Technical Architecture
246
+
247
+ ### Overview
248
+ ASCII diagram or description of the high-level architecture.
249
+
250
+ \`\`\`
251
+ [Component A] --> [Component B] --> [Component C]
252
+ \`\`\`
253
+
254
+ ### Data Flow
255
+ Describe how data flows between components.
256
+
257
+ ### Technology Stack
258
+ | Layer | Technology | Justification |
259
+ |-------|-----------|---------------|
260
+ | Frontend | React / Vue / etc | Reason |
261
+ | Backend | Node.js / Python / etc | Reason |
262
+ | Database | SQLite / Postgres / etc | Reason |
263
+
264
+ ---
265
+
266
+ ## 4. Data Model
267
+
268
+ Describe the main entities and their relationships.
269
+
270
+ ### Main Entity
271
+ | Field | Type | Description |
272
+ |-------|------|-------------|
273
+ | id | TEXT (UUID) | Unique identifier |
274
+ | name | TEXT | Entity name |
275
+ | status | TEXT | Current state |
276
+ | created_at | TEXT (ISO8601) | Creation date |
277
+
278
+ ---
279
+
280
+ ## 5. API / Interfaces
281
+
282
+ ### Endpoints (if applicable)
283
+ | Method | Endpoint | Description |
284
+ |--------|----------|-------------|
285
+ | GET | /api/resource | List resources |
286
+ | POST | /api/resource | Create resource |
287
+
288
+ ### CLI Commands (if applicable)
289
+ \`\`\`bash
290
+ project init # Initialize the project
291
+ project start # Start the server
292
+ project status # Show status
293
+ \`\`\`
294
+
295
+ ---
296
+
297
+ ## 6. UI / Components
298
+
299
+ Describe the main visual components, screens, and navigation flows.
300
+
301
+ ### Main Screen
302
+ - Layout description
303
+ - Visible components
304
+ - User interactions
305
+
306
+ ---
307
+
308
+ ## 7. Implementation Details
309
+
310
+ Additional project-specific sections. Examples:
311
+ - Security and authentication
312
+ - Performance and caching
313
+ - External service integration
314
+ - Plugin/extension system
315
+
316
+ ---
317
+
318
+ # PART 3 - EXECUTION (WHEN to build)
319
+
320
+ > **Note**: Detailed task tracking and context for each sprint lives in the sprint files.
321
+ > Use the sprint files for complete tasks and context.
322
+
323
+ ---
324
+
325
+ ## 8. MVP
326
+
327
+ Description of what constitutes the MVP (Minimum Viable Product).
328
+
329
+ | Sprint | Name | Tasks | Status | Sprint File |
330
+ |--------|------|-------|--------|-------------|
331
+ | 1 | Sprint Name | N | Planned | [sprint-01.md](../SPRINTS/sprint-01.md) |
332
+ | 2 | Sprint Name | N | Planned | [sprint-02.md](../SPRINTS/sprint-02.md) |
333
+
334
+ ---
335
+
336
+ ## 9. Backlog
337
+
338
+ Features planned for after the MVP:
339
+ - Future feature 1
340
+ - Future feature 2
341
+ - Future feature 3
342
+
343
+ ---
344
+
345
+ # PART 4 - REFERENCE
346
+
347
+ ---
348
+
349
+ ## 10. File Structure
350
+
351
+ \`\`\`
352
+ project/
353
+ docs/
354
+ PRD/
355
+ PRD.md # This document
356
+ SPRINTS/
357
+ sprint-01.md # Sprint files with tasks
358
+ src/
359
+ ... # Source code
360
+ README.md
361
+ package.json
362
+ \`\`\`
363
+
364
+ ---
365
+
366
+ ## Template Notes
367
+
368
+ This template follows the **4-part structure**:
369
+
370
+ | Part | Content | Question |
371
+ |------|---------|----------|
372
+ | **PART 1 - PRD** | Vision + Problem | WHAT to build and WHY? |
373
+ | **PART 2 - SPEC** | Architecture + Details | HOW to build it? |
374
+ | **PART 3 - EXECUTION** | Sprints + Backlog | WHEN to build it? |
375
+ | **PART 4 - REFERENCE** | File structure + Glossary | WHERE to find things? |
376
+
377
+ **Principles**:
378
+ - The PRD is a VISION document, not a detailed execution tracker
379
+ - Sprint files (\`docs/SPRINTS/sprint-XX.md\`) contain tasks and context per sprint
380
+ - Part 3 is an INDEX to the sprint files, not a duplication of their content
381
+ - Number sections for easy cross-referencing ("see PRD Section 3.2")
382
+ `;
383
+ const PRD_README_CONTENT = `# PRD Documentation
384
+
385
+ This directory contains the Product Requirements Document (PRD) and its template.
386
+
387
+ ## Files
388
+
389
+ | File | Description |
390
+ |------|-------------|
391
+ | \`PRD.md\` | The actual PRD for this project |
392
+ | \`TEMPLATE.md\` | Generic PRD template for new projects |
393
+
394
+ ## Structure
395
+
396
+ The PRD follows a 4-part structure:
397
+
398
+ | Part | Content | Question it answers |
399
+ |------|---------|-------------------|
400
+ | **PART 1 - PRD** | Vision + Problem | WHAT to build and WHY? |
401
+ | **PART 2 - SPEC** | Architecture + Details | HOW to build it? |
402
+ | **PART 3 - EXECUTION** | Sprints + Backlog | WHEN to build it? |
403
+ | **PART 4 - REFERENCE** | File structure + Glossary | WHERE to find things? |
404
+
405
+ ## How to Use
406
+
407
+ ### For a new project
408
+
409
+ 1. Copy \`TEMPLATE.md\` to \`PRD.md\` in this directory
410
+ 2. Fill in each section with your project details
411
+ 3. Create sprint files in \`docs/SPRINTS/\` following the sprint template
412
+ 4. Reference sprint files from Part 3 instead of duplicating task details
413
+
414
+ ### With CAM
415
+
416
+ \`\`\`bash
417
+ cam init --prd docs/PRD/PRD.md
418
+ \`\`\`
419
+
420
+ CAM will parse the PRD and create the project in the database.
421
+
422
+ ## Principles
423
+
424
+ - The PRD is a **vision document**, not a task tracker
425
+ - Sprint files (\`docs/SPRINTS/\`) hold the detailed tasks and context per sprint
426
+ - Part 3 is an **index** pointing to sprint files, not a duplication of their content
427
+ - Number sections for easy cross-referencing (e.g., "see PRD Section 3.2")
428
+ `;
429
+ const SPRINT_TEMPLATE_CONTENT = `# Sprint X - Sprint Name
430
+
431
+ Status: planned | active | completed
432
+
433
+ ---
434
+
435
+ ## Context
436
+
437
+ ### Motivation
438
+ Why this sprint exists. What problem was discovered or what need arose.
439
+ What is the high-level objective and how it connects to the product vision.
440
+
441
+ ### Current Code State
442
+ Which modules/files are relevant to this sprint. What is the current architecture
443
+ that will be modified. What works and what does not.
444
+
445
+ ### Design Decisions
446
+ Decisions already made that affect the implementation. Trade-offs considered.
447
+ Approaches discarded and why.
448
+
449
+ ### References
450
+ - PRD Section X.Y - Name of the relevant section
451
+ - Internal docs or related architecture decisions
452
+ - External links (repos, articles, issues)
453
+
454
+ ---
455
+
456
+ ## Tasks
457
+
458
+ ### Section 1 - Section Name
459
+ - [ ] Task title
460
+ Priority: high | medium | low
461
+ Tags: tag1, tag2
462
+ Description: Detailed description with clear acceptance criteria.
463
+ Files: packages/server/src/file.ts, packages/dashboard/src/components/File.tsx
464
+
465
+ - [x] Completed task title
466
+ Priority: medium
467
+ Tags: tag1
468
+ Description: What was done and how.
469
+
470
+ ### Section 2 - Section Name
471
+ - [ ] Another task
472
+ Priority: medium
473
+ Tags: tag1
474
+ Description: Detailed description.
475
+
476
+ ---
477
+
478
+ ## Template Notes
479
+
480
+ - Sprint status: \`planned\` (not started), \`active\` (in progress), \`completed\` (finished)
481
+ - Checkbox: \`[x]\` = completed, \`[ ]\` = planned/pending
482
+ - Priority, Tags, Description, Files are optional (indented under the task)
483
+ - Sections (\`### Section N\`) group tasks by area/topic
484
+ - The CONTEXT block is the differentiator: it is a mini-PRD per sprint
485
+ - To import: \`cam sprint import docs/SPRINTS/sprint-XX.md\`
486
+ `;
487
+ const SPRINT_README_CONTENT = `# Sprint Files
488
+
489
+ This directory contains sprint definition files in markdown format.
490
+ Each file represents one sprint with its context and tasks.
491
+
492
+ ## Format
493
+
494
+ Each sprint file follows the template structure. See \`TEMPLATE.md\` for the full format.
495
+
496
+ Key elements:
497
+ - **Title**: \`# Sprint X - Name\` (H1 heading)
498
+ - **Status**: \`planned\`, \`active\`, or \`completed\`
499
+ - **Context**: Mini-PRD with motivation, code state, decisions, references
500
+ - **Tasks**: Checkbox list grouped by sections
501
+
502
+ ## Usage
503
+
504
+ ### Create a new sprint
505
+ Copy \`TEMPLATE.md\` to \`sprint-XX.md\` and fill in the sections.
506
+
507
+ ### Import tasks from a sprint file
508
+ \`\`\`bash
509
+ cam sprint import docs/SPRINTS/sprint-01.md
510
+ \`\`\`
511
+
512
+ ### List all sprints
513
+ \`\`\`bash
514
+ cam sprint list
515
+ \`\`\`
516
+
517
+ ### Check sprint progress
518
+ \`\`\`bash
519
+ cam sprint status
520
+ \`\`\`
521
+
522
+ ## Task Format
523
+
524
+ \`\`\`markdown
525
+ - [ ] Task title
526
+ Priority: high | medium | low
527
+ Tags: tag1, tag2
528
+ Description: Detailed description.
529
+ Files: path/to/file1.ts, path/to/file2.ts
530
+ \`\`\`
531
+
532
+ - \`[x]\` = completed, \`[ ]\` = planned/pending
533
+ - All metadata lines (Priority, Tags, Description, Files) are optional
534
+ `;
535
+ function scaffoldDocs() {
536
+ const created = [];
537
+ const docsDir = join(process.cwd(), "docs");
538
+ const prdDir = join(docsDir, "PRD");
539
+ const sprintsDir = join(docsDir, "SPRINTS");
540
+ // Create docs/PRD/ directory if it doesn't exist
541
+ if (!existsSync(prdDir)) {
542
+ mkdirSync(prdDir, { recursive: true });
543
+ created.push("docs/PRD/");
544
+ }
545
+ // Write PRD TEMPLATE.md if it doesn't exist
546
+ const prdTemplatePath = join(prdDir, "TEMPLATE.md");
547
+ if (!existsSync(prdTemplatePath)) {
548
+ writeFileSync(prdTemplatePath, PRD_TEMPLATE_CONTENT, "utf-8");
549
+ created.push("docs/PRD/TEMPLATE.md");
550
+ }
551
+ // Write PRD README.md if it doesn't exist
552
+ const prdReadmePath = join(prdDir, "README.md");
553
+ if (!existsSync(prdReadmePath)) {
554
+ writeFileSync(prdReadmePath, PRD_README_CONTENT, "utf-8");
555
+ created.push("docs/PRD/README.md");
556
+ }
557
+ // Create docs/SPRINTS/ directory if it doesn't exist
558
+ if (!existsSync(sprintsDir)) {
559
+ mkdirSync(sprintsDir, { recursive: true });
560
+ created.push("docs/SPRINTS/");
561
+ }
562
+ // Write Sprint TEMPLATE.md if it doesn't exist
563
+ const sprintTemplatePath = join(sprintsDir, "TEMPLATE.md");
564
+ if (!existsSync(sprintTemplatePath)) {
565
+ writeFileSync(sprintTemplatePath, SPRINT_TEMPLATE_CONTENT, "utf-8");
566
+ created.push("docs/SPRINTS/TEMPLATE.md");
567
+ }
568
+ // Write Sprint README.md if it doesn't exist
569
+ const sprintReadmePath = join(sprintsDir, "README.md");
570
+ if (!existsSync(sprintReadmePath)) {
571
+ writeFileSync(sprintReadmePath, SPRINT_README_CONTENT, "utf-8");
572
+ created.push("docs/SPRINTS/README.md");
573
+ }
574
+ return { created };
575
+ }
576
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU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IAED,6CAA6C;IAC7C,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IACvD,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAClC,aAAa,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,OAAO,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const progressCommand: Command;
3
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/commands/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwFpC,eAAO,MAAM,eAAe,SAgKxB,CAAC"}