create-battle-plan 1.4.3 → 1.4.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.
Files changed (2) hide show
  1. package/bin/cli.js +38 -26
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -348,12 +348,13 @@ async function main() {
348
348
  );
349
349
  console.log('');
350
350
 
351
- // Question 4: Metrics
352
- const metricsRaw = await askRequired(
353
- `${DIM}[4/7]${RESET} ${BOLD}What are the 3-5 key metrics you want to track?${RESET} ${DIM}(comma-separated, e.g., "outreach sent, calls booked, LOIs signed")${RESET}\n> `,
354
- 'At least one metric is required — pick anything quantifiable you care about. You can rename or add more later in metrics.yml. Try again:'
351
+ // Question 4: Metrics (optional — leave blank for journal-style projects)
352
+ const metricsRaw = await ask(
353
+ `${DIM}[4/7]${RESET} ${BOLD}Any metrics to track?${RESET} ${DIM}(comma-separated, e.g., "outreach sent, calls booked, LOIs signed" — or press enter to skip)${RESET}\n> `
355
354
  );
356
- const metrics = metricsRaw.split(',').map((m) => m.trim()).filter(Boolean);
355
+ const metrics = metricsRaw
356
+ ? metricsRaw.split(',').map((m) => m.trim()).filter(Boolean)
357
+ : [];
357
358
  console.log('');
358
359
 
359
360
  // Question 5: Domains
@@ -454,7 +455,11 @@ _Start adding content here._
454
455
 
455
456
  console.log(`${DIM} + docs/ (${domains.length} domain${domains.length > 1 ? 's' : ''})${RESET}`);
456
457
 
457
- // Create metrics.yml
458
+ // Create metrics.yml — file always exists so scripts have a target, even if no
459
+ // metrics were declared (journal-style projects). The LLM can add metrics later.
460
+ const metricsBody = metrics.length
461
+ ? metrics.map((m) => `${metricKey(m)}: 0`).join('\n') + '\n'
462
+ : '# No metrics declared yet. Add them as `key: value` below when ready.\n';
458
463
  const metricsContent = [
459
464
  `# metrics.yml — project-wide metrics registry for ${projectName}`,
460
465
  '# The LLM updates this file FIRST in any cascade, before touching docs.',
@@ -462,16 +467,33 @@ _Start adding content here._
462
467
  '',
463
468
  `last_updated: ${today}`,
464
469
  '',
465
- ...metrics.map((m) => `${metricKey(m)}: 0`),
466
- '',
470
+ metricsBody,
467
471
  ].join('\n');
468
472
  fs.writeFileSync(path.join(targetDir, 'metrics.yml'), metricsContent);
469
- console.log(`${DIM} + metrics.yml (${metrics.length} metric${metrics.length > 1 ? 's' : ''})${RESET}`);
473
+ console.log(
474
+ `${DIM} + metrics.yml (${metrics.length === 0 ? 'no metrics yet' : `${metrics.length} metric${metrics.length > 1 ? 's' : ''}`})${RESET}`
475
+ );
476
+
477
+ // Create battle plan — conditionally include Key Metrics section
478
+ const metricsSection = metrics.length
479
+ ? `## Key Metrics
480
+
481
+ | Metric | Target | Current |
482
+ |--------|--------|---------|
483
+ ${metrics.map((m) => `| ${m} | _set target_ | **0** (→ metrics.yml#${metricKey(m)}) |`).join('\n')}
484
+
485
+ ---
470
486
 
471
- // Create battle plan
472
- const metricsTable = metrics
473
- .map((m) => `| ${m} | _set target_ | **0** (→ metrics.yml#${metricKey(m)}) |`)
474
- .join('\n');
487
+ `
488
+ : '';
489
+
490
+ const tldr = metrics.length
491
+ ? `${projectName} — just initialized. Time horizon: ${horizon || 'not set'}. All metrics at 0. First priority: fill in the battle plan with real tasks and targets.`
492
+ : `${projectName} — just initialized. Time horizon: ${horizon || 'not set'}. No metrics tracked yet (journal-style project). First priority: fill in the battle plan with real tasks.`;
493
+
494
+ const firstPriority = metrics.length
495
+ ? '- [ ] Set targets for each metric\n- [ ] Fill in this week\'s tasks\n- [ ] Record any existing conversations in external-insights.md'
496
+ : '- [ ] Fill in this week\'s tasks\n- [ ] Record any existing conversations in external-insights.md';
475
497
 
476
498
  fs.writeFileSync(
477
499
  path.join(targetDir, 'docs', 'battle-plan.md'),
@@ -482,7 +504,7 @@ _Start adding content here._
482
504
  **Role:** source-of-truth
483
505
  **Compression:** chronological
484
506
 
485
- **TL;DR:** ${projectName} — just initialized. Time horizon: ${horizon || 'not set'}. All metrics at 0. First priority: fill in the battle plan with real tasks and targets.
507
+ **TL;DR:** ${tldr}
486
508
 
487
509
  ---
488
510
 
@@ -495,19 +517,9 @@ _Start adding content here._
495
517
 
496
518
  ---
497
519
 
498
- ## Key Metrics
499
-
500
- | Metric | Target | Current |
501
- |--------|--------|---------|
502
- ${metricsTable}
503
-
504
- ---
505
-
506
- ## Today's Priorities
520
+ ${metricsSection}## Today's Priorities
507
521
 
508
- - [ ] Set targets for each metric
509
- - [ ] Fill in this week's tasks
510
- - [ ] Record any existing conversations in external-insights.md
522
+ ${firstPriority}
511
523
 
512
524
  ---
513
525
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-battle-plan",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "Scaffold a Battle Plan project — a markdown-based context system for LLM-powered project management",
5
5
  "bin": {
6
6
  "create-battle-plan": "./bin/cli.js"