@open-product-primer/cli 0.9.0 → 0.10.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.
@@ -328,6 +328,8 @@ description: Create a new Product Decision Record in oprim/decisions/ with auto-
328
328
 
329
329
  Create a new Product Decision Record (PDR) in \`oprim/decisions/\`.
330
330
 
331
+ **Interactive prompts:** Use the **AskUserQuestion tool** for every question in this skill — do not write questions as plain text.
332
+
331
333
  ## Steps
332
334
 
333
335
  ### 1. Get the decision title
@@ -388,6 +390,8 @@ description: Create a new bet directory and bet-decision artifact in oprim/bets/
388
390
 
389
391
  Create a new bet in \`oprim/bets/\` and register it on the sequencing board.
390
392
 
393
+ **Interactive prompts:** Use the **AskUserQuestion tool** for every question in this skill — do not write questions as plain text.
394
+
391
395
  ## Steps
392
396
 
393
397
  ### 1. Get the bet title
@@ -407,7 +411,10 @@ After receiving the title, validate: if fewer than 4 words OR fewer than 25 char
407
411
  - If "y": proceed with the original title
408
412
 
409
413
  ### 2. Assign the next BET ID
410
- Scan \`oprim/bets/\` for directories matching \`BET-(\\d+)\`. Extract all integers. Assign max+1, zero-padded to 3 digits. Default \`001\` if none.
414
+ Scan both \`oprim/bets/\` and \`oprim/bets/archived/\` for directories whose names match \`BET-(\\d+)(-[^/]*)?\` (handles both \`BET-NNN/\` and \`BET-NNN-<slug>/\`). Extract the numeric part from each match. Assign max+1, zero-padded to 3 digits. Default \`001\` if none found in either location.
415
+
416
+ ### 2b. Derive the slug
417
+ From the bet title: lowercase all characters, replace any character that is not a letter or digit with a hyphen, collapse consecutive hyphens to one, strip leading/trailing hyphens, truncate to 40 characters at the last hyphen boundary. This becomes \`<slug>\`. Example: "Add title slugs to bet directories for scannability" → \`add-title-slugs-to-bet-dirs-for\`.
411
418
 
412
419
  ### 3. Check sequence.yaml exists
413
420
  If \`oprim/sequence.yaml\` not found: report and stop — advise \`oprim init\`.
@@ -415,7 +422,7 @@ If \`oprim/sequence.yaml\` not found: report and stop — advise \`oprim init\`.
415
422
  ### 4. Gather content
416
423
  Ask: Decision (Build now / Defer / Kill, default Build now), Owner, Review date (YYYY-MM-DD), Why now, Alternatives considered, Expected outcomes (metric: baseline → target in timeframe), Kill criteria / rollback trigger, PDR links (optional).
417
424
 
418
- ### 5. Write oprim/bets/BET-NNN/bet-decision.md
425
+ ### 5. Write oprim/bets/BET-NNN-<slug>/bet-decision.md
419
426
  \`\`\`
420
427
  # Decision: BET-NNN <title>
421
428
  <!-- Naming tip: verb + object [for context] — e.g. "Improve bet naming for scannability" not "Naming" -->
@@ -455,7 +462,7 @@ Read → parse YAML → append → write back (2-space indentation):
455
462
 
456
463
  ### 7. Prompt for optional discovery scaffolding
457
464
  Ask: "Do you want to scaffold a discovery.md now? (y/N)"
458
- - If "y": write \`oprim/bets/BET-NNN/discovery.md\` from the discovery template (same structure as \`oprim/templates/discovery.md\`).
465
+ - If "y": write \`oprim/bets/BET-NNN-<slug>/discovery.md\` from the discovery template (same structure as \`oprim/templates/discovery.md\`).
459
466
  - If "n" or Enter: skip silently.
460
467
 
461
468
  ### 8. Report what was created
@@ -469,6 +476,8 @@ description: Create or append to a criteria.yaml contract for a bet, with struct
469
476
 
470
477
  Create or append to \`oprim/bets/BET-NNN/criteria.yaml\`.
471
478
 
479
+ **Interactive prompts:** Use the **AskUserQuestion tool** for every question in this skill — do not write questions as plain text.
480
+
472
481
  ## Steps
473
482
 
474
483
  ### 1. Identify the bet
@@ -517,11 +526,13 @@ If not: create with \`metrics:\` list.
517
526
  function archiveSkill() {
518
527
  return `---
519
528
  name: oprim-archive
520
- description: Archive a completed bet — moves it to oprim/bets/archived/BET-NNN/ and removes its sequence.yaml entry
529
+ description: Archive a completed bet — moves it to oprim/bets/archived/ and removes its sequence.yaml entry
521
530
  ---
522
531
 
523
532
  Archive a completed bet by moving it to \`oprim/bets/archived/\` and removing it from \`sequence.yaml\`.
524
533
 
534
+ **Interactive prompts:** Use the **AskUserQuestion tool** for every question in this skill — do not write questions as plain text.
535
+
525
536
  ## Steps
526
537
 
527
538
  ### 1. Get the bet ID
@@ -532,11 +543,19 @@ If not provided, ask: "Which bet ID would you like to archive? (e.g., BET-005)"
532
543
 
533
544
  Normalize the input: accept \`bet-005\`, \`005\`, \`5\`, or \`BET-005\` — always treat as \`BET-NNN\` zero-padded to 3 digits.
534
545
 
535
- ### 2. Check the bet directory exists
546
+ ### 2. Resolve the bet directory
536
547
 
537
- Check whether \`oprim/bets/BET-NNN/\` exists.
548
+ Look for the bet directory in \`oprim/bets/\` using two patterns:
549
+ 1. Exact match: \`oprim/bets/BET-NNN/\` (legacy non-slug format)
550
+ 2. Slug variant: any directory starting with \`BET-NNN-\` (e.g., \`BET-NNN-<slug>/\`)
538
551
 
539
- If not found:
552
+ Use whichever pattern matches. Call this the **resolved directory name**.
553
+
554
+ If multiple directories match (e.g., both \`BET-NNN/\` and \`BET-NNN-slug/\` exist):
555
+ - Report: "Ambiguous: found multiple directories for BET-NNN: [list them]. Please archive manually."
556
+ - Stop.
557
+
558
+ If neither pattern matches:
540
559
  - Report: "Bet BET-NNN was not found in oprim/bets/. Nothing was changed."
541
560
  - Stop.
542
561
 
@@ -566,9 +585,9 @@ Create the archive subfolder if it doesn't exist:
566
585
  mkdir -p oprim/bets/archived
567
586
  \`\`\`
568
587
 
569
- Move the directory:
588
+ Move the resolved directory:
570
589
  \`\`\`bash
571
- mv oprim/bets/BET-NNN oprim/bets/archived/BET-NNN
590
+ mv oprim/bets/<resolved-dir> oprim/bets/archived/<resolved-dir>
572
591
  \`\`\`
573
592
 
574
593
  ### 5. Remove the bet entry from sequence.yaml
@@ -581,7 +600,7 @@ Read \`oprim/sequence.yaml\`, parse it, and remove the entry with \`id: BET-NNN\
581
600
  ## Bet Archived
582
601
 
583
602
  **Bet:** BET-NNN
584
- **Archived to:** oprim/bets/archived/BET-NNN/
603
+ **Archived to:** oprim/bets/archived/<resolved-dir>/
585
604
  **Removed from sequence.yaml:** ✓
586
605
 
587
606
  The bet is preserved in full at the archive location.
@@ -626,6 +645,8 @@ description: Validate and update the primer sequencing board — triage mode com
626
645
 
627
646
  Manage the primer sequencing board in \`oprim/sequence.yaml\`.
628
647
 
648
+ **Interactive prompts:** Use the **AskUserQuestion tool** for every question in this skill — do not write questions as plain text.
649
+
629
650
  ## Entry modes
630
651
 
631
652
  **Triage mode** — no intention provided: reads board state, computes health, surfaces specific actionable suggestions.
@@ -718,6 +739,8 @@ description: Create a KPI review artifact for a completed bet, pre-filled from c
718
739
 
719
740
  Create a KPI review in \`oprim/reviews/\`.
720
741
 
742
+ **Interactive prompts:** Use the **AskUserQuestion tool** for every question in this skill — do not write questions as plain text.
743
+
721
744
  ## Steps
722
745
 
723
746
  ### 1. Identify the bet
@@ -826,7 +849,6 @@ nudge_flag=".claude/hooks/.sequence-nudge"
826
849
  # --- Archive co-archival block ---
827
850
  if [ -f "$archive_flag" ]; then
828
851
  change=$(tr -d '[:space:]' < "$archive_flag")
829
- rm -f "$archive_flag"
830
852
 
831
853
  if [ -z "$change" ]; then
832
854
  latest=$(ls openspec/changes/archive/ 2>/dev/null | sort -r | head -1)
@@ -836,6 +858,7 @@ if [ -f "$archive_flag" ]; then
836
858
  if [ -n "$change" ]; then
837
859
  archive_dir=$(ls openspec/changes/archive/ 2>/dev/null | grep -F "$change" | sort -r | head -1)
838
860
  if [ -n "$archive_dir" ]; then
861
+ rm -f "$archive_flag"
839
862
  proposal="openspec/changes/archive/$archive_dir/proposal.md"
840
863
  if [ -f "$proposal" ]; then
841
864
  bet_id=$(grep -oE 'BET-[0-9]+' "$proposal" | head -1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-product-primer/cli",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Open Product Primer CLI — product decisions, sequencing, and KPI tracking for repositories",
5
5
  "keywords": [
6
6
  "product",