@claudecam/cli 0.1.2 → 0.1.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/dist/commands/init.js +2 -388
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +18 -7
- package/dist/commands/start.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +12 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/scaffold-docs.d.ts +4 -0
- package/dist/utils/scaffold-docs.d.ts.map +1 -0
- package/dist/utils/scaffold-docs.js +389 -0
- package/dist/utils/scaffold-docs.js.map +1 -0
- package/package.json +4 -3
package/dist/commands/init.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import chalk from "chalk";
|
|
3
|
-
import {
|
|
4
|
-
import { basename, join } from "node:path";
|
|
3
|
+
import { basename } from "node:path";
|
|
5
4
|
import { execSync } from "node:child_process";
|
|
6
5
|
import { DEFAULT_SERVER_PORT } from "@claudecam/shared";
|
|
7
6
|
import { logger } from "../utils/logger.js";
|
|
8
7
|
import { claudeSettingsExist, readClaudeSettings, writeClaudeSettings, ensureClaudeDir, readConfig, writeConfig, } from "../utils/config.js";
|
|
9
8
|
import { generateHooksConfig, mergeHooks, HOOK_TYPE_DESCRIPTIONS, isCamHook, } from "../utils/hooks-config.js";
|
|
9
|
+
import { scaffoldDocs } from "../utils/scaffold-docs.js";
|
|
10
10
|
export const initCommand = new Command("init")
|
|
11
11
|
.description("Initialize Claude Agent Monitor hooks in the current project")
|
|
12
12
|
.option("--force", "Overwrite existing hooks configuration")
|
|
@@ -187,390 +187,4 @@ function checkCamHookAvailable() {
|
|
|
187
187
|
return false;
|
|
188
188
|
}
|
|
189
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
190
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +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;AAC1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yBAAyB,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;IAChH,MAAM,CAAC,IAAI,CAAC,oBAAoB,KAAK,CAAC,IAAI,CAAC,6CAA6C,CAAC,EAAE,CAAC,CAAC;IAC7F,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC,CACF,CAAC;AAEJ,SAAS,qBAAqB;IAC5B,IAAI,CAAC;QACH,MAAM,GAAG,GACP,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC;QACrE,QAAQ,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBpC,eAAO,MAAM,YAAY,SAqLtB,CAAC"}
|
package/dist/commands/start.js
CHANGED
|
@@ -9,6 +9,7 @@ import { DEFAULT_SERVER_PORT, DEFAULT_DASHBOARD_PORT } from "@claudecam/shared";
|
|
|
9
9
|
import { logger } from "../utils/logger.js";
|
|
10
10
|
import { writeConfig, claudeSettingsExist, readClaudeSettings, writeClaudeSettings, ensureClaudeDir, } from "../utils/config.js";
|
|
11
11
|
import { generateHooksConfig, mergeHooks, isCamHook, } from "../utils/hooks-config.js";
|
|
12
|
+
import { scaffoldDocs } from "../utils/scaffold-docs.js";
|
|
12
13
|
export const startCommand = new Command("start")
|
|
13
14
|
.description("Start the Claude Agent Monitor server and dashboard")
|
|
14
15
|
.option("-p, --port <port>", "Server port", String(DEFAULT_SERVER_PORT))
|
|
@@ -191,25 +192,35 @@ async function waitForServer(port, timeoutMs) {
|
|
|
191
192
|
}
|
|
192
193
|
function autoInitHooks() {
|
|
193
194
|
const camHooks = generateHooksConfig();
|
|
195
|
+
let hooksConfigured = false;
|
|
194
196
|
if (claudeSettingsExist()) {
|
|
195
197
|
// Check if CAM hooks are already configured
|
|
196
198
|
const settings = readClaudeSettings();
|
|
197
199
|
const hooks = (settings.hooks ?? {});
|
|
198
200
|
const hasCamHooks = Object.values(hooks).some((entries) => entries.some((e) => isCamHook(e)));
|
|
199
|
-
if (hasCamHooks) {
|
|
200
|
-
|
|
201
|
+
if (!hasCamHooks) {
|
|
202
|
+
// Merge CAM hooks into existing settings
|
|
203
|
+
const merged = mergeHooks(settings, camHooks);
|
|
204
|
+
writeClaudeSettings(merged);
|
|
205
|
+
logger.success("CAM hooks auto-configured (merged with existing settings)");
|
|
206
|
+
hooksConfigured = true;
|
|
201
207
|
}
|
|
202
|
-
// Merge CAM hooks into existing settings
|
|
203
|
-
const merged = mergeHooks(settings, camHooks);
|
|
204
|
-
writeClaudeSettings(merged);
|
|
205
|
-
logger.success("CAM hooks auto-configured (merged with existing settings)");
|
|
206
|
-
logger.blank();
|
|
207
208
|
}
|
|
208
209
|
else {
|
|
209
210
|
// Create new settings with hooks
|
|
210
211
|
ensureClaudeDir();
|
|
211
212
|
writeClaudeSettings({ hooks: camHooks });
|
|
212
213
|
logger.success("CAM hooks auto-configured (.claude/settings.json created)");
|
|
214
|
+
hooksConfigured = true;
|
|
215
|
+
}
|
|
216
|
+
// Scaffold docs structure (PRD + Sprint templates)
|
|
217
|
+
const docsResult = scaffoldDocs();
|
|
218
|
+
if (docsResult.created.length > 0) {
|
|
219
|
+
for (const path of docsResult.created) {
|
|
220
|
+
logger.success(`Created ${chalk.cyan(path)}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (hooksConfigured || docsResult.created.length > 0) {
|
|
213
224
|
logger.blank();
|
|
214
225
|
}
|
|
215
226
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,SAAS,GAEV,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,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 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,MAAM;kBACH,MAAM,GAAG,IAAI;qBAIV,MAAM,GAAG,IAAI;qBAIb,MAAM,GAAG,IAAI;mBAIf,MAAM,GAAG,IAAI;kBAId,MAAM,GAAG,IAAI;aAIlB,IAAI;cAIH,IAAI;mBAMC,MAAM,GAAG,IAAI;kBAId,MAAM,SAAS,MAAM,GAAG,IAAI;gBAI9B,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI;CAM3D,CAAC"}
|
package/dist/utils/logger.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
function getVersion() {
|
|
4
|
+
try {
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const pkg = require('../../package.json');
|
|
7
|
+
return pkg.version;
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return '0.1.0';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
2
13
|
export const logger = {
|
|
3
14
|
info(message) {
|
|
4
15
|
console.log(chalk.blue(' info'), message);
|
|
@@ -20,7 +31,7 @@ export const logger = {
|
|
|
20
31
|
},
|
|
21
32
|
banner() {
|
|
22
33
|
console.log();
|
|
23
|
-
console.log(chalk.bold.cyan(' Claude Agent Monitor') + chalk.gray(
|
|
34
|
+
console.log(chalk.bold.cyan(' Claude Agent Monitor') + chalk.gray(` v${getVersion()}`));
|
|
24
35
|
console.log();
|
|
25
36
|
},
|
|
26
37
|
section(title) {
|
package/dist/utils/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,SAAS,UAAU;IACjB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAwB,CAAC;QACjE,OAAO,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,CAAC,OAAe;QAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,CAAC,OAAe;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,CAAC,OAAe;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK;QACH,OAAO,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existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
export function scaffoldDocs() {
|
|
4
|
+
const created = [];
|
|
5
|
+
const docsDir = join(process.cwd(), "docs");
|
|
6
|
+
const prdDir = join(docsDir, "PRD");
|
|
7
|
+
const sprintsDir = join(docsDir, "SPRINTS");
|
|
8
|
+
// Create docs/PRD/ directory if it doesn't exist
|
|
9
|
+
if (!existsSync(prdDir)) {
|
|
10
|
+
mkdirSync(prdDir, { recursive: true });
|
|
11
|
+
created.push("docs/PRD/");
|
|
12
|
+
}
|
|
13
|
+
// Write PRD TEMPLATE.md if it doesn't exist
|
|
14
|
+
const prdTemplatePath = join(prdDir, "TEMPLATE.md");
|
|
15
|
+
if (!existsSync(prdTemplatePath)) {
|
|
16
|
+
writeFileSync(prdTemplatePath, PRD_TEMPLATE_CONTENT, "utf-8");
|
|
17
|
+
created.push("docs/PRD/TEMPLATE.md");
|
|
18
|
+
}
|
|
19
|
+
// Write PRD README.md if it doesn't exist
|
|
20
|
+
const prdReadmePath = join(prdDir, "README.md");
|
|
21
|
+
if (!existsSync(prdReadmePath)) {
|
|
22
|
+
writeFileSync(prdReadmePath, PRD_README_CONTENT, "utf-8");
|
|
23
|
+
created.push("docs/PRD/README.md");
|
|
24
|
+
}
|
|
25
|
+
// Create docs/SPRINTS/ directory if it doesn't exist
|
|
26
|
+
if (!existsSync(sprintsDir)) {
|
|
27
|
+
mkdirSync(sprintsDir, { recursive: true });
|
|
28
|
+
created.push("docs/SPRINTS/");
|
|
29
|
+
}
|
|
30
|
+
// Write Sprint TEMPLATE.md if it doesn't exist
|
|
31
|
+
const sprintTemplatePath = join(sprintsDir, "TEMPLATE.md");
|
|
32
|
+
if (!existsSync(sprintTemplatePath)) {
|
|
33
|
+
writeFileSync(sprintTemplatePath, SPRINT_TEMPLATE_CONTENT, "utf-8");
|
|
34
|
+
created.push("docs/SPRINTS/TEMPLATE.md");
|
|
35
|
+
}
|
|
36
|
+
// Write Sprint README.md if it doesn't exist
|
|
37
|
+
const sprintReadmePath = join(sprintsDir, "README.md");
|
|
38
|
+
if (!existsSync(sprintReadmePath)) {
|
|
39
|
+
writeFileSync(sprintReadmePath, SPRINT_README_CONTENT, "utf-8");
|
|
40
|
+
created.push("docs/SPRINTS/README.md");
|
|
41
|
+
}
|
|
42
|
+
return { created };
|
|
43
|
+
}
|
|
44
|
+
const PRD_TEMPLATE_CONTENT = `# [Project Name] - PRD (Product Requirements Document)
|
|
45
|
+
|
|
46
|
+
> [Short phrase describing the project in one line]
|
|
47
|
+
|
|
48
|
+
**Version**: 1.0.0
|
|
49
|
+
**Date**: YYYY-MM-DD
|
|
50
|
+
**Status**: Draft | Active | Completed
|
|
51
|
+
**License**: MIT | Apache-2.0 | ...
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
# PART 1 - PRD (WHAT to build)
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 1. Product Vision
|
|
60
|
+
|
|
61
|
+
### Name
|
|
62
|
+
**[Project Name]**
|
|
63
|
+
|
|
64
|
+
### Value Proposition
|
|
65
|
+
What this product does and why it matters. What problem it solves and for whom.
|
|
66
|
+
Describe the value in 2-3 paragraphs.
|
|
67
|
+
|
|
68
|
+
### Target Audience
|
|
69
|
+
- Persona 1: description and primary need
|
|
70
|
+
- Persona 2: description and primary need
|
|
71
|
+
|
|
72
|
+
### Differentiator
|
|
73
|
+
- What makes this project unique
|
|
74
|
+
- Competitive advantages
|
|
75
|
+
- Why someone would choose this vs alternatives
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 2. Problem
|
|
80
|
+
|
|
81
|
+
### Current Situation
|
|
82
|
+
How things work today without this product.
|
|
83
|
+
|
|
84
|
+
### Pain Points
|
|
85
|
+
| Pain Point | Severity | Frequency |
|
|
86
|
+
|------------|----------|-----------|
|
|
87
|
+
| Pain point description 1 | High/Medium/Low | Frequency |
|
|
88
|
+
| Pain point description 2 | High/Medium/Low | Frequency |
|
|
89
|
+
|
|
90
|
+
### Opportunity
|
|
91
|
+
Why now is the right time. What technology or market shift enables this solution.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
# PART 2 - SPEC (HOW to build)
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 3. Technical Architecture
|
|
100
|
+
|
|
101
|
+
### Overview
|
|
102
|
+
ASCII diagram or description of the high-level architecture.
|
|
103
|
+
|
|
104
|
+
\`\`\`
|
|
105
|
+
[Component A] --> [Component B] --> [Component C]
|
|
106
|
+
\`\`\`
|
|
107
|
+
|
|
108
|
+
### Data Flow
|
|
109
|
+
Describe how data flows between components.
|
|
110
|
+
|
|
111
|
+
### Technology Stack
|
|
112
|
+
| Layer | Technology | Justification |
|
|
113
|
+
|-------|-----------|---------------|
|
|
114
|
+
| Frontend | React / Vue / etc | Reason |
|
|
115
|
+
| Backend | Node.js / Python / etc | Reason |
|
|
116
|
+
| Database | SQLite / Postgres / etc | Reason |
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 4. Data Model
|
|
121
|
+
|
|
122
|
+
Describe the main entities and their relationships.
|
|
123
|
+
|
|
124
|
+
### Main Entity
|
|
125
|
+
| Field | Type | Description |
|
|
126
|
+
|-------|------|-------------|
|
|
127
|
+
| id | TEXT (UUID) | Unique identifier |
|
|
128
|
+
| name | TEXT | Entity name |
|
|
129
|
+
| status | TEXT | Current state |
|
|
130
|
+
| created_at | TEXT (ISO8601) | Creation date |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 5. API / Interfaces
|
|
135
|
+
|
|
136
|
+
### Endpoints (if applicable)
|
|
137
|
+
| Method | Endpoint | Description |
|
|
138
|
+
|--------|----------|-------------|
|
|
139
|
+
| GET | /api/resource | List resources |
|
|
140
|
+
| POST | /api/resource | Create resource |
|
|
141
|
+
|
|
142
|
+
### CLI Commands (if applicable)
|
|
143
|
+
\`\`\`bash
|
|
144
|
+
project init # Initialize the project
|
|
145
|
+
project start # Start the server
|
|
146
|
+
project status # Show status
|
|
147
|
+
\`\`\`
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 6. UI / Components
|
|
152
|
+
|
|
153
|
+
Describe the main visual components, screens, and navigation flows.
|
|
154
|
+
|
|
155
|
+
### Main Screen
|
|
156
|
+
- Layout description
|
|
157
|
+
- Visible components
|
|
158
|
+
- User interactions
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 7. Implementation Details
|
|
163
|
+
|
|
164
|
+
Additional project-specific sections. Examples:
|
|
165
|
+
- Security and authentication
|
|
166
|
+
- Performance and caching
|
|
167
|
+
- External service integration
|
|
168
|
+
- Plugin/extension system
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
# PART 3 - EXECUTION (WHEN to build)
|
|
173
|
+
|
|
174
|
+
> **Note**: Detailed task tracking and context for each sprint lives in the sprint files.
|
|
175
|
+
> Use the sprint files for complete tasks and context.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 8. MVP
|
|
180
|
+
|
|
181
|
+
Description of what constitutes the MVP (Minimum Viable Product).
|
|
182
|
+
|
|
183
|
+
| Sprint | Name | Tasks | Status | Sprint File |
|
|
184
|
+
|--------|------|-------|--------|-------------|
|
|
185
|
+
| 1 | Sprint Name | N | Planned | [sprint-01.md](../SPRINTS/sprint-01.md) |
|
|
186
|
+
| 2 | Sprint Name | N | Planned | [sprint-02.md](../SPRINTS/sprint-02.md) |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 9. Backlog
|
|
191
|
+
|
|
192
|
+
Features planned for after the MVP:
|
|
193
|
+
- Future feature 1
|
|
194
|
+
- Future feature 2
|
|
195
|
+
- Future feature 3
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
# PART 4 - REFERENCE
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 10. File Structure
|
|
204
|
+
|
|
205
|
+
\`\`\`
|
|
206
|
+
project/
|
|
207
|
+
docs/
|
|
208
|
+
PRD/
|
|
209
|
+
PRD.md # This document
|
|
210
|
+
SPRINTS/
|
|
211
|
+
sprint-01.md # Sprint files with tasks
|
|
212
|
+
src/
|
|
213
|
+
... # Source code
|
|
214
|
+
README.md
|
|
215
|
+
package.json
|
|
216
|
+
\`\`\`
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Template Notes
|
|
221
|
+
|
|
222
|
+
This template follows the **4-part structure**:
|
|
223
|
+
|
|
224
|
+
| Part | Content | Question |
|
|
225
|
+
|------|---------|----------|
|
|
226
|
+
| **PART 1 - PRD** | Vision + Problem | WHAT to build and WHY? |
|
|
227
|
+
| **PART 2 - SPEC** | Architecture + Details | HOW to build it? |
|
|
228
|
+
| **PART 3 - EXECUTION** | Sprints + Backlog | WHEN to build it? |
|
|
229
|
+
| **PART 4 - REFERENCE** | File structure + Glossary | WHERE to find things? |
|
|
230
|
+
|
|
231
|
+
**Principles**:
|
|
232
|
+
- The PRD is a VISION document, not a detailed execution tracker
|
|
233
|
+
- Sprint files (\`docs/SPRINTS/sprint-XX.md\`) contain tasks and context per sprint
|
|
234
|
+
- Part 3 is an INDEX to the sprint files, not a duplication of their content
|
|
235
|
+
- Number sections for easy cross-referencing ("see PRD Section 3.2")
|
|
236
|
+
`;
|
|
237
|
+
const PRD_README_CONTENT = `# PRD Documentation
|
|
238
|
+
|
|
239
|
+
This directory contains the Product Requirements Document (PRD) and its template.
|
|
240
|
+
|
|
241
|
+
## Files
|
|
242
|
+
|
|
243
|
+
| File | Description |
|
|
244
|
+
|------|-------------|
|
|
245
|
+
| \`PRD.md\` | The actual PRD for this project |
|
|
246
|
+
| \`TEMPLATE.md\` | Generic PRD template for new projects |
|
|
247
|
+
|
|
248
|
+
## Structure
|
|
249
|
+
|
|
250
|
+
The PRD follows a 4-part structure:
|
|
251
|
+
|
|
252
|
+
| Part | Content | Question it answers |
|
|
253
|
+
|------|---------|-------------------|
|
|
254
|
+
| **PART 1 - PRD** | Vision + Problem | WHAT to build and WHY? |
|
|
255
|
+
| **PART 2 - SPEC** | Architecture + Details | HOW to build it? |
|
|
256
|
+
| **PART 3 - EXECUTION** | Sprints + Backlog | WHEN to build it? |
|
|
257
|
+
| **PART 4 - REFERENCE** | File structure + Glossary | WHERE to find things? |
|
|
258
|
+
|
|
259
|
+
## How to Use
|
|
260
|
+
|
|
261
|
+
### For a new project
|
|
262
|
+
|
|
263
|
+
1. Copy \`TEMPLATE.md\` to \`PRD.md\` in this directory
|
|
264
|
+
2. Fill in each section with your project details
|
|
265
|
+
3. Create sprint files in \`docs/SPRINTS/\` following the sprint template
|
|
266
|
+
4. Reference sprint files from Part 3 instead of duplicating task details
|
|
267
|
+
|
|
268
|
+
### With CAM
|
|
269
|
+
|
|
270
|
+
\`\`\`bash
|
|
271
|
+
cam init --prd docs/PRD/PRD.md
|
|
272
|
+
\`\`\`
|
|
273
|
+
|
|
274
|
+
CAM will parse the PRD and create the project in the database.
|
|
275
|
+
|
|
276
|
+
## Principles
|
|
277
|
+
|
|
278
|
+
- The PRD is a **vision document**, not a task tracker
|
|
279
|
+
- Sprint files (\`docs/SPRINTS/\`) hold the detailed tasks and context per sprint
|
|
280
|
+
- Part 3 is an **index** pointing to sprint files, not a duplication of their content
|
|
281
|
+
- Number sections for easy cross-referencing (e.g., "see PRD Section 3.2")
|
|
282
|
+
`;
|
|
283
|
+
const SPRINT_TEMPLATE_CONTENT = `# Sprint X - Sprint Name
|
|
284
|
+
|
|
285
|
+
Status: planned | active | completed
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Context
|
|
290
|
+
|
|
291
|
+
### Motivation
|
|
292
|
+
Why this sprint exists. What problem was discovered or what need arose.
|
|
293
|
+
What is the high-level objective and how it connects to the product vision.
|
|
294
|
+
|
|
295
|
+
### Current Code State
|
|
296
|
+
Which modules/files are relevant to this sprint. What is the current architecture
|
|
297
|
+
that will be modified. What works and what does not.
|
|
298
|
+
|
|
299
|
+
### Design Decisions
|
|
300
|
+
Decisions already made that affect the implementation. Trade-offs considered.
|
|
301
|
+
Approaches discarded and why.
|
|
302
|
+
|
|
303
|
+
### References
|
|
304
|
+
- PRD Section X.Y - Name of the relevant section
|
|
305
|
+
- Internal docs or related architecture decisions
|
|
306
|
+
- External links (repos, articles, issues)
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Tasks
|
|
311
|
+
|
|
312
|
+
### Section 1 - Section Name
|
|
313
|
+
- [ ] Task title
|
|
314
|
+
Priority: high | medium | low
|
|
315
|
+
Tags: tag1, tag2
|
|
316
|
+
Description: Detailed description with clear acceptance criteria.
|
|
317
|
+
Files: packages/server/src/file.ts, packages/dashboard/src/components/File.tsx
|
|
318
|
+
|
|
319
|
+
- [x] Completed task title
|
|
320
|
+
Priority: medium
|
|
321
|
+
Tags: tag1
|
|
322
|
+
Description: What was done and how.
|
|
323
|
+
|
|
324
|
+
### Section 2 - Section Name
|
|
325
|
+
- [ ] Another task
|
|
326
|
+
Priority: medium
|
|
327
|
+
Tags: tag1
|
|
328
|
+
Description: Detailed description.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Template Notes
|
|
333
|
+
|
|
334
|
+
- Sprint status: \`planned\` (not started), \`active\` (in progress), \`completed\` (finished)
|
|
335
|
+
- Checkbox: \`[x]\` = completed, \`[ ]\` = planned/pending
|
|
336
|
+
- Priority, Tags, Description, Files are optional (indented under the task)
|
|
337
|
+
- Sections (\`### Section N\`) group tasks by area/topic
|
|
338
|
+
- The CONTEXT block is the differentiator: it is a mini-PRD per sprint
|
|
339
|
+
- To import: \`cam sprint import docs/SPRINTS/sprint-XX.md\`
|
|
340
|
+
`;
|
|
341
|
+
const SPRINT_README_CONTENT = `# Sprint Files
|
|
342
|
+
|
|
343
|
+
This directory contains sprint definition files in markdown format.
|
|
344
|
+
Each file represents one sprint with its context and tasks.
|
|
345
|
+
|
|
346
|
+
## Format
|
|
347
|
+
|
|
348
|
+
Each sprint file follows the template structure. See \`TEMPLATE.md\` for the full format.
|
|
349
|
+
|
|
350
|
+
Key elements:
|
|
351
|
+
- **Title**: \`# Sprint X - Name\` (H1 heading)
|
|
352
|
+
- **Status**: \`planned\`, \`active\`, or \`completed\`
|
|
353
|
+
- **Context**: Mini-PRD with motivation, code state, decisions, references
|
|
354
|
+
- **Tasks**: Checkbox list grouped by sections
|
|
355
|
+
|
|
356
|
+
## Usage
|
|
357
|
+
|
|
358
|
+
### Create a new sprint
|
|
359
|
+
Copy \`TEMPLATE.md\` to \`sprint-XX.md\` and fill in the sections.
|
|
360
|
+
|
|
361
|
+
### Import tasks from a sprint file
|
|
362
|
+
\`\`\`bash
|
|
363
|
+
cam sprint import docs/SPRINTS/sprint-01.md
|
|
364
|
+
\`\`\`
|
|
365
|
+
|
|
366
|
+
### List all sprints
|
|
367
|
+
\`\`\`bash
|
|
368
|
+
cam sprint list
|
|
369
|
+
\`\`\`
|
|
370
|
+
|
|
371
|
+
### Check sprint progress
|
|
372
|
+
\`\`\`bash
|
|
373
|
+
cam sprint status
|
|
374
|
+
\`\`\`
|
|
375
|
+
|
|
376
|
+
## Task Format
|
|
377
|
+
|
|
378
|
+
\`\`\`markdown
|
|
379
|
+
- [ ] Task title
|
|
380
|
+
Priority: high | medium | low
|
|
381
|
+
Tags: tag1, tag2
|
|
382
|
+
Description: Detailed description.
|
|
383
|
+
Files: path/to/file1.ts, path/to/file2.ts
|
|
384
|
+
\`\`\`
|
|
385
|
+
|
|
386
|
+
- \`[x]\` = completed, \`[ ]\` = planned/pending
|
|
387
|
+
- All metadata lines (Priority, Tags, Description, Files) are optional
|
|
388
|
+
`;
|
|
389
|
+
//# sourceMappingURL=scaffold-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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C;AAEF,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudecam/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "CLI for Claude Agent Monitor - Mission Control for Claude Code agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
"chalk": "^5.3.0",
|
|
25
25
|
"commander": "^12.1.0",
|
|
26
26
|
"ora": "^8.1.0",
|
|
27
|
-
"@claudecam/
|
|
27
|
+
"@claudecam/server": "0.1.0",
|
|
28
|
+
"@claudecam/dashboard": "0.1.0",
|
|
28
29
|
"@claudecam/hook": "0.1.0",
|
|
29
|
-
"@claudecam/
|
|
30
|
+
"@claudecam/shared": "0.1.0"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@types/node": "^22.0.0",
|