create-battle-plan 1.4.2 → 1.4.3
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/bin/cli.js +18 -8
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -71,6 +71,14 @@ function ask(question) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
async function askRequired(question, errorMsg) {
|
|
75
|
+
while (true) {
|
|
76
|
+
const answer = await ask(question);
|
|
77
|
+
if (answer) return answer;
|
|
78
|
+
console.log(`${YELLOW} ${errorMsg}${RESET}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
74
82
|
// ── Interactive folder picker (raw mode) ─────────────────
|
|
75
83
|
|
|
76
84
|
function getDirs(dir) {
|
|
@@ -310,8 +318,10 @@ async function main() {
|
|
|
310
318
|
initReadline();
|
|
311
319
|
|
|
312
320
|
// Question 1: Project description (one sentence — used for context, not the folder name)
|
|
313
|
-
const projectName = await
|
|
314
|
-
|
|
321
|
+
const projectName = await askRequired(
|
|
322
|
+
`${DIM}[1/7]${RESET} ${BOLD}What's your project in one sentence?${RESET}\n> `,
|
|
323
|
+
'A one-sentence description is required — even rough is fine. Try again:'
|
|
324
|
+
);
|
|
315
325
|
console.log('');
|
|
316
326
|
|
|
317
327
|
// Question 2: Short name (the actual folder slug). Default = cwd basename when sensible.
|
|
@@ -339,19 +349,19 @@ async function main() {
|
|
|
339
349
|
console.log('');
|
|
340
350
|
|
|
341
351
|
// Question 4: Metrics
|
|
342
|
-
const metricsRaw = await
|
|
343
|
-
`${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>
|
|
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:'
|
|
344
355
|
);
|
|
345
|
-
if (!metricsRaw) { console.log('At least one metric is required.'); process.exit(1); }
|
|
346
356
|
const metrics = metricsRaw.split(',').map((m) => m.trim()).filter(Boolean);
|
|
347
357
|
console.log('');
|
|
348
358
|
|
|
349
359
|
// Question 5: Domains
|
|
350
360
|
const suggested = suggestDomains(projectName);
|
|
351
|
-
const domainsRaw = await
|
|
352
|
-
`${DIM}[5/7]${RESET} ${BOLD}What domains does your work cover?${RESET} ${DIM}(comma-separated)\nSuggested based on your project: ${suggested}${RESET}\n>
|
|
361
|
+
const domainsRaw = await askRequired(
|
|
362
|
+
`${DIM}[5/7]${RESET} ${BOLD}What domains does your work cover?${RESET} ${DIM}(comma-separated)\nSuggested based on your project: ${suggested}${RESET}\n> `,
|
|
363
|
+
`At least one domain is required — try the suggestions (${suggested}) or any topic area. Try again:`
|
|
353
364
|
);
|
|
354
|
-
if (!domainsRaw) { console.log('At least one domain is required.'); process.exit(1); }
|
|
355
365
|
const domains = domainsRaw.split(',').map((d) => d.trim().toLowerCase()).filter(Boolean);
|
|
356
366
|
console.log('');
|
|
357
367
|
|
package/package.json
CHANGED