shipwright-cli 1.9.0 → 2.0.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 (117) hide show
  1. package/.claude/hooks/post-tool-use.sh +12 -5
  2. package/README.md +114 -36
  3. package/completions/_shipwright +212 -32
  4. package/completions/shipwright.bash +97 -25
  5. package/docs/strategy/01-market-research.md +619 -0
  6. package/docs/strategy/02-mission-and-brand.md +587 -0
  7. package/docs/strategy/03-gtm-and-roadmap.md +759 -0
  8. package/docs/strategy/QUICK-START.txt +289 -0
  9. package/docs/strategy/README.md +172 -0
  10. package/package.json +4 -2
  11. package/scripts/sw +217 -2
  12. package/scripts/sw-activity.sh +500 -0
  13. package/scripts/sw-adaptive.sh +925 -0
  14. package/scripts/sw-adversarial.sh +1 -1
  15. package/scripts/sw-architecture-enforcer.sh +1 -1
  16. package/scripts/sw-auth.sh +613 -0
  17. package/scripts/sw-autonomous.sh +664 -0
  18. package/scripts/sw-changelog.sh +704 -0
  19. package/scripts/sw-checkpoint.sh +79 -1
  20. package/scripts/sw-ci.sh +602 -0
  21. package/scripts/sw-cleanup.sh +192 -7
  22. package/scripts/sw-code-review.sh +637 -0
  23. package/scripts/sw-connect.sh +1 -1
  24. package/scripts/sw-context.sh +605 -0
  25. package/scripts/sw-cost.sh +1 -1
  26. package/scripts/sw-daemon.sh +812 -138
  27. package/scripts/sw-dashboard.sh +1 -1
  28. package/scripts/sw-db.sh +540 -0
  29. package/scripts/sw-decompose.sh +539 -0
  30. package/scripts/sw-deps.sh +551 -0
  31. package/scripts/sw-developer-simulation.sh +1 -1
  32. package/scripts/sw-discovery.sh +412 -0
  33. package/scripts/sw-docs-agent.sh +539 -0
  34. package/scripts/sw-docs.sh +1 -1
  35. package/scripts/sw-doctor.sh +59 -1
  36. package/scripts/sw-dora.sh +615 -0
  37. package/scripts/sw-durable.sh +710 -0
  38. package/scripts/sw-e2e-orchestrator.sh +535 -0
  39. package/scripts/sw-eventbus.sh +393 -0
  40. package/scripts/sw-feedback.sh +471 -0
  41. package/scripts/sw-fix.sh +1 -1
  42. package/scripts/sw-fleet-discover.sh +567 -0
  43. package/scripts/sw-fleet-viz.sh +404 -0
  44. package/scripts/sw-fleet.sh +8 -1
  45. package/scripts/sw-github-app.sh +596 -0
  46. package/scripts/sw-github-checks.sh +1 -1
  47. package/scripts/sw-github-deploy.sh +1 -1
  48. package/scripts/sw-github-graphql.sh +1 -1
  49. package/scripts/sw-guild.sh +569 -0
  50. package/scripts/sw-heartbeat.sh +1 -1
  51. package/scripts/sw-hygiene.sh +559 -0
  52. package/scripts/sw-incident.sh +617 -0
  53. package/scripts/sw-init.sh +88 -1
  54. package/scripts/sw-instrument.sh +699 -0
  55. package/scripts/sw-intelligence.sh +1 -1
  56. package/scripts/sw-jira.sh +1 -1
  57. package/scripts/sw-launchd.sh +366 -31
  58. package/scripts/sw-linear.sh +1 -1
  59. package/scripts/sw-logs.sh +1 -1
  60. package/scripts/sw-loop.sh +507 -51
  61. package/scripts/sw-memory.sh +198 -3
  62. package/scripts/sw-mission-control.sh +487 -0
  63. package/scripts/sw-model-router.sh +545 -0
  64. package/scripts/sw-otel.sh +596 -0
  65. package/scripts/sw-oversight.sh +689 -0
  66. package/scripts/sw-pipeline-composer.sh +8 -8
  67. package/scripts/sw-pipeline-vitals.sh +1096 -0
  68. package/scripts/sw-pipeline.sh +2451 -180
  69. package/scripts/sw-pm.sh +693 -0
  70. package/scripts/sw-pr-lifecycle.sh +522 -0
  71. package/scripts/sw-predictive.sh +1 -1
  72. package/scripts/sw-prep.sh +1 -1
  73. package/scripts/sw-ps.sh +4 -3
  74. package/scripts/sw-public-dashboard.sh +798 -0
  75. package/scripts/sw-quality.sh +595 -0
  76. package/scripts/sw-reaper.sh +5 -3
  77. package/scripts/sw-recruit.sh +573 -0
  78. package/scripts/sw-regression.sh +642 -0
  79. package/scripts/sw-release-manager.sh +736 -0
  80. package/scripts/sw-release.sh +706 -0
  81. package/scripts/sw-remote.sh +1 -1
  82. package/scripts/sw-replay.sh +520 -0
  83. package/scripts/sw-retro.sh +691 -0
  84. package/scripts/sw-scale.sh +444 -0
  85. package/scripts/sw-security-audit.sh +505 -0
  86. package/scripts/sw-self-optimize.sh +109 -8
  87. package/scripts/sw-session.sh +31 -9
  88. package/scripts/sw-setup.sh +1 -1
  89. package/scripts/sw-standup.sh +712 -0
  90. package/scripts/sw-status.sh +192 -1
  91. package/scripts/sw-strategic.sh +658 -0
  92. package/scripts/sw-stream.sh +450 -0
  93. package/scripts/sw-swarm.sh +583 -0
  94. package/scripts/sw-team-stages.sh +511 -0
  95. package/scripts/sw-templates.sh +1 -1
  96. package/scripts/sw-testgen.sh +515 -0
  97. package/scripts/sw-tmux-pipeline.sh +554 -0
  98. package/scripts/sw-tmux.sh +1 -1
  99. package/scripts/sw-trace.sh +485 -0
  100. package/scripts/sw-tracker-github.sh +188 -0
  101. package/scripts/sw-tracker-jira.sh +172 -0
  102. package/scripts/sw-tracker-linear.sh +251 -0
  103. package/scripts/sw-tracker.sh +117 -2
  104. package/scripts/sw-triage.sh +603 -0
  105. package/scripts/sw-upgrade.sh +1 -1
  106. package/scripts/sw-ux.sh +677 -0
  107. package/scripts/sw-webhook.sh +627 -0
  108. package/scripts/sw-widgets.sh +530 -0
  109. package/scripts/sw-worktree.sh +1 -1
  110. package/templates/pipelines/autonomous.json +8 -1
  111. package/templates/pipelines/cost-aware.json +21 -0
  112. package/templates/pipelines/deployed.json +40 -6
  113. package/templates/pipelines/enterprise.json +16 -2
  114. package/templates/pipelines/fast.json +19 -0
  115. package/templates/pipelines/full.json +16 -2
  116. package/templates/pipelines/hotfix.json +19 -0
  117. package/templates/pipelines/standard.json +19 -0
@@ -8,7 +8,7 @@
8
8
  set -euo pipefail
9
9
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
10
10
 
11
- VERSION="1.9.0"
11
+ VERSION="2.0.0"
12
12
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
13
 
14
14
  # ─── Colors (matches Seth's tmux theme) ─────────────────────────────────────
@@ -328,6 +328,78 @@ cmd_clear() {
328
328
  fi
329
329
  }
330
330
 
331
+ # ─── Expire ──────────────────────────────────────────────────────────────────
332
+
333
+ cmd_expire() {
334
+ local max_hours=24
335
+
336
+ while [[ $# -gt 0 ]]; do
337
+ case "$1" in
338
+ --hours)
339
+ max_hours="${2:-24}"
340
+ shift 2
341
+ ;;
342
+ --hours=*)
343
+ max_hours="${1#--hours=}"
344
+ shift
345
+ ;;
346
+ --help|-h)
347
+ show_help
348
+ return 0
349
+ ;;
350
+ *)
351
+ error "Unknown option: $1"
352
+ return 1
353
+ ;;
354
+ esac
355
+ done
356
+
357
+ if [[ ! -d "$CHECKPOINT_DIR" ]]; then
358
+ return 0
359
+ fi
360
+
361
+ local max_secs=$((max_hours * 3600))
362
+ local now_e
363
+ now_e=$(date +%s)
364
+ local expired=0
365
+
366
+ local file
367
+ for file in "${CHECKPOINT_DIR}"/*-checkpoint.json; do
368
+ [[ -f "$file" ]] || continue
369
+
370
+ # Check created_at from checkpoint JSON
371
+ local created_at
372
+ created_at=$(jq -r '.created_at // empty' "$file" 2>/dev/null || true)
373
+
374
+ if [[ -n "$created_at" ]]; then
375
+ # Parse ISO date to epoch
376
+ local file_epoch
377
+ file_epoch=$(TZ=UTC date -j -f "%Y-%m-%dT%H:%M:%SZ" "$created_at" +%s 2>/dev/null \
378
+ || date -d "$created_at" +%s 2>/dev/null \
379
+ || echo "0")
380
+ if [[ "$file_epoch" -gt 0 && $((now_e - file_epoch)) -gt $max_secs ]]; then
381
+ local stage_name
382
+ stage_name=$(jq -r '.stage // "unknown"' "$file" 2>/dev/null || echo "unknown")
383
+ rm -f "$file"
384
+ expired=$((expired + 1))
385
+ info "Expired: ${stage_name} checkpoint (${max_hours}h+ old)"
386
+ fi
387
+ else
388
+ # Fallback: check file mtime
389
+ local mtime
390
+ mtime=$(stat -f '%m' "$file" 2>/dev/null || stat -c '%Y' "$file" 2>/dev/null || echo "0")
391
+ if [[ "$mtime" -gt 0 && $((now_e - mtime)) -gt $max_secs ]]; then
392
+ rm -f "$file"
393
+ expired=$((expired + 1))
394
+ fi
395
+ fi
396
+ done
397
+
398
+ if [[ "$expired" -gt 0 ]]; then
399
+ success "Expired ${expired} checkpoint(s) older than ${max_hours}h"
400
+ fi
401
+ }
402
+
331
403
  # ─── Help ────────────────────────────────────────────────────────────────────
332
404
 
333
405
  show_help() {
@@ -341,6 +413,7 @@ show_help() {
341
413
  echo -e " ${CYAN}restore${RESET} Restore a checkpoint (prints JSON to stdout)"
342
414
  echo -e " ${CYAN}list${RESET} Show all available checkpoints"
343
415
  echo -e " ${CYAN}clear${RESET} Remove checkpoint(s)"
416
+ echo -e " ${CYAN}expire${RESET} Remove checkpoints older than N hours"
344
417
  echo ""
345
418
  echo -e "${BOLD}SAVE OPTIONS${RESET}"
346
419
  echo -e " ${CYAN}--stage${RESET} <name> Stage name (required)"
@@ -357,6 +430,9 @@ show_help() {
357
430
  echo -e " ${CYAN}--stage${RESET} <name> Stage to clear"
358
431
  echo -e " ${CYAN}--all${RESET} Clear all checkpoints"
359
432
  echo ""
433
+ echo -e "${BOLD}EXPIRE OPTIONS${RESET}"
434
+ echo -e " ${CYAN}--hours${RESET} <n> Max age in hours (default: 24)"
435
+ echo ""
360
436
  echo -e "${BOLD}EXAMPLES${RESET}"
361
437
  echo -e " ${DIM}shipwright checkpoint save --stage build --iteration 5${RESET}"
362
438
  echo -e " ${DIM}shipwright checkpoint save --stage build --iteration 3 --tests-passing --files-modified \"src/auth.ts,src/middleware.ts\"${RESET}"
@@ -364,6 +440,7 @@ show_help() {
364
440
  echo -e " ${DIM}shipwright checkpoint list${RESET}"
365
441
  echo -e " ${DIM}shipwright checkpoint clear --stage build${RESET}"
366
442
  echo -e " ${DIM}shipwright checkpoint clear --all${RESET}"
443
+ echo -e " ${DIM}shipwright checkpoint expire --hours 48${RESET}"
367
444
  }
368
445
 
369
446
  # ─── Command Router ─────────────────────────────────────────────────────────
@@ -377,6 +454,7 @@ main() {
377
454
  restore) cmd_restore "$@" ;;
378
455
  list) cmd_list ;;
379
456
  clear) cmd_clear "$@" ;;
457
+ expire) cmd_expire "$@" ;;
380
458
  help|--help|-h) show_help ;;
381
459
  *)
382
460
  error "Unknown command: ${cmd}"