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.
- package/.claude/hooks/post-tool-use.sh +12 -5
- package/README.md +114 -36
- package/completions/_shipwright +212 -32
- package/completions/shipwright.bash +97 -25
- package/docs/strategy/01-market-research.md +619 -0
- package/docs/strategy/02-mission-and-brand.md +587 -0
- package/docs/strategy/03-gtm-and-roadmap.md +759 -0
- package/docs/strategy/QUICK-START.txt +289 -0
- package/docs/strategy/README.md +172 -0
- package/package.json +4 -2
- package/scripts/sw +217 -2
- package/scripts/sw-activity.sh +500 -0
- package/scripts/sw-adaptive.sh +925 -0
- package/scripts/sw-adversarial.sh +1 -1
- package/scripts/sw-architecture-enforcer.sh +1 -1
- package/scripts/sw-auth.sh +613 -0
- package/scripts/sw-autonomous.sh +664 -0
- package/scripts/sw-changelog.sh +704 -0
- package/scripts/sw-checkpoint.sh +79 -1
- package/scripts/sw-ci.sh +602 -0
- package/scripts/sw-cleanup.sh +192 -7
- package/scripts/sw-code-review.sh +637 -0
- package/scripts/sw-connect.sh +1 -1
- package/scripts/sw-context.sh +605 -0
- package/scripts/sw-cost.sh +1 -1
- package/scripts/sw-daemon.sh +812 -138
- package/scripts/sw-dashboard.sh +1 -1
- package/scripts/sw-db.sh +540 -0
- package/scripts/sw-decompose.sh +539 -0
- package/scripts/sw-deps.sh +551 -0
- package/scripts/sw-developer-simulation.sh +1 -1
- package/scripts/sw-discovery.sh +412 -0
- package/scripts/sw-docs-agent.sh +539 -0
- package/scripts/sw-docs.sh +1 -1
- package/scripts/sw-doctor.sh +59 -1
- package/scripts/sw-dora.sh +615 -0
- package/scripts/sw-durable.sh +710 -0
- package/scripts/sw-e2e-orchestrator.sh +535 -0
- package/scripts/sw-eventbus.sh +393 -0
- package/scripts/sw-feedback.sh +471 -0
- package/scripts/sw-fix.sh +1 -1
- package/scripts/sw-fleet-discover.sh +567 -0
- package/scripts/sw-fleet-viz.sh +404 -0
- package/scripts/sw-fleet.sh +8 -1
- package/scripts/sw-github-app.sh +596 -0
- package/scripts/sw-github-checks.sh +1 -1
- package/scripts/sw-github-deploy.sh +1 -1
- package/scripts/sw-github-graphql.sh +1 -1
- package/scripts/sw-guild.sh +569 -0
- package/scripts/sw-heartbeat.sh +1 -1
- package/scripts/sw-hygiene.sh +559 -0
- package/scripts/sw-incident.sh +617 -0
- package/scripts/sw-init.sh +88 -1
- package/scripts/sw-instrument.sh +699 -0
- package/scripts/sw-intelligence.sh +1 -1
- package/scripts/sw-jira.sh +1 -1
- package/scripts/sw-launchd.sh +366 -31
- package/scripts/sw-linear.sh +1 -1
- package/scripts/sw-logs.sh +1 -1
- package/scripts/sw-loop.sh +507 -51
- package/scripts/sw-memory.sh +198 -3
- package/scripts/sw-mission-control.sh +487 -0
- package/scripts/sw-model-router.sh +545 -0
- package/scripts/sw-otel.sh +596 -0
- package/scripts/sw-oversight.sh +689 -0
- package/scripts/sw-pipeline-composer.sh +8 -8
- package/scripts/sw-pipeline-vitals.sh +1096 -0
- package/scripts/sw-pipeline.sh +2451 -180
- package/scripts/sw-pm.sh +693 -0
- package/scripts/sw-pr-lifecycle.sh +522 -0
- package/scripts/sw-predictive.sh +1 -1
- package/scripts/sw-prep.sh +1 -1
- package/scripts/sw-ps.sh +4 -3
- package/scripts/sw-public-dashboard.sh +798 -0
- package/scripts/sw-quality.sh +595 -0
- package/scripts/sw-reaper.sh +5 -3
- package/scripts/sw-recruit.sh +573 -0
- package/scripts/sw-regression.sh +642 -0
- package/scripts/sw-release-manager.sh +736 -0
- package/scripts/sw-release.sh +706 -0
- package/scripts/sw-remote.sh +1 -1
- package/scripts/sw-replay.sh +520 -0
- package/scripts/sw-retro.sh +691 -0
- package/scripts/sw-scale.sh +444 -0
- package/scripts/sw-security-audit.sh +505 -0
- package/scripts/sw-self-optimize.sh +109 -8
- package/scripts/sw-session.sh +31 -9
- package/scripts/sw-setup.sh +1 -1
- package/scripts/sw-standup.sh +712 -0
- package/scripts/sw-status.sh +192 -1
- package/scripts/sw-strategic.sh +658 -0
- package/scripts/sw-stream.sh +450 -0
- package/scripts/sw-swarm.sh +583 -0
- package/scripts/sw-team-stages.sh +511 -0
- package/scripts/sw-templates.sh +1 -1
- package/scripts/sw-testgen.sh +515 -0
- package/scripts/sw-tmux-pipeline.sh +554 -0
- package/scripts/sw-tmux.sh +1 -1
- package/scripts/sw-trace.sh +485 -0
- package/scripts/sw-tracker-github.sh +188 -0
- package/scripts/sw-tracker-jira.sh +172 -0
- package/scripts/sw-tracker-linear.sh +251 -0
- package/scripts/sw-tracker.sh +117 -2
- package/scripts/sw-triage.sh +603 -0
- package/scripts/sw-upgrade.sh +1 -1
- package/scripts/sw-ux.sh +677 -0
- package/scripts/sw-webhook.sh +627 -0
- package/scripts/sw-widgets.sh +530 -0
- package/scripts/sw-worktree.sh +1 -1
- package/templates/pipelines/autonomous.json +8 -1
- package/templates/pipelines/cost-aware.json +21 -0
- package/templates/pipelines/deployed.json +40 -6
- package/templates/pipelines/enterprise.json +16 -2
- package/templates/pipelines/fast.json +19 -0
- package/templates/pipelines/full.json +16 -2
- package/templates/pipelines/hotfix.json +19 -0
- package/templates/pipelines/standard.json +19 -0
package/scripts/sw-checkpoint.sh
CHANGED
|
@@ -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="
|
|
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}"
|