shipwright-cli 1.7.1 → 1.9.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 (105) hide show
  1. package/.claude/agents/code-reviewer.md +90 -0
  2. package/.claude/agents/devops-engineer.md +142 -0
  3. package/.claude/agents/pipeline-agent.md +80 -0
  4. package/.claude/agents/shell-script-specialist.md +150 -0
  5. package/.claude/agents/test-specialist.md +196 -0
  6. package/.claude/hooks/post-tool-use.sh +38 -0
  7. package/.claude/hooks/pre-tool-use.sh +25 -0
  8. package/.claude/hooks/session-started.sh +37 -0
  9. package/README.md +212 -814
  10. package/claude-code/CLAUDE.md.shipwright +54 -0
  11. package/claude-code/hooks/notify-idle.sh +2 -2
  12. package/claude-code/hooks/session-start.sh +24 -0
  13. package/claude-code/hooks/task-completed.sh +6 -2
  14. package/claude-code/settings.json.template +12 -0
  15. package/dashboard/public/app.js +4422 -0
  16. package/dashboard/public/index.html +816 -0
  17. package/dashboard/public/styles.css +4755 -0
  18. package/dashboard/server.ts +4315 -0
  19. package/docs/KNOWN-ISSUES.md +18 -10
  20. package/docs/TIPS.md +38 -26
  21. package/docs/patterns/README.md +33 -23
  22. package/package.json +9 -5
  23. package/scripts/adapters/iterm2-adapter.sh +1 -1
  24. package/scripts/adapters/tmux-adapter.sh +52 -23
  25. package/scripts/adapters/wezterm-adapter.sh +26 -14
  26. package/scripts/lib/compat.sh +200 -0
  27. package/scripts/lib/helpers.sh +72 -0
  28. package/scripts/postinstall.mjs +72 -13
  29. package/scripts/{cct → sw} +109 -21
  30. package/scripts/sw-adversarial.sh +274 -0
  31. package/scripts/sw-architecture-enforcer.sh +330 -0
  32. package/scripts/sw-checkpoint.sh +390 -0
  33. package/scripts/{cct-cleanup.sh → sw-cleanup.sh} +3 -1
  34. package/scripts/sw-connect.sh +619 -0
  35. package/scripts/{cct-cost.sh → sw-cost.sh} +368 -34
  36. package/scripts/{cct-daemon.sh → sw-daemon.sh} +2217 -204
  37. package/scripts/sw-dashboard.sh +477 -0
  38. package/scripts/sw-developer-simulation.sh +252 -0
  39. package/scripts/sw-docs.sh +635 -0
  40. package/scripts/sw-doctor.sh +907 -0
  41. package/scripts/{cct-fix.sh → sw-fix.sh} +10 -6
  42. package/scripts/{cct-fleet.sh → sw-fleet.sh} +498 -22
  43. package/scripts/sw-github-checks.sh +521 -0
  44. package/scripts/sw-github-deploy.sh +533 -0
  45. package/scripts/sw-github-graphql.sh +972 -0
  46. package/scripts/sw-heartbeat.sh +293 -0
  47. package/scripts/{cct-init.sh → sw-init.sh} +144 -11
  48. package/scripts/sw-intelligence.sh +1196 -0
  49. package/scripts/sw-jira.sh +643 -0
  50. package/scripts/sw-launchd.sh +364 -0
  51. package/scripts/sw-linear.sh +648 -0
  52. package/scripts/{cct-logs.sh → sw-logs.sh} +72 -2
  53. package/scripts/{cct-loop.sh → sw-loop.sh} +534 -44
  54. package/scripts/{cct-memory.sh → sw-memory.sh} +321 -38
  55. package/scripts/sw-patrol-meta.sh +417 -0
  56. package/scripts/sw-pipeline-composer.sh +455 -0
  57. package/scripts/{cct-pipeline.sh → sw-pipeline.sh} +2319 -178
  58. package/scripts/sw-predictive.sh +820 -0
  59. package/scripts/{cct-prep.sh → sw-prep.sh} +339 -49
  60. package/scripts/{cct-ps.sh → sw-ps.sh} +6 -4
  61. package/scripts/{cct-reaper.sh → sw-reaper.sh} +6 -4
  62. package/scripts/sw-remote.sh +687 -0
  63. package/scripts/sw-self-optimize.sh +947 -0
  64. package/scripts/sw-session.sh +519 -0
  65. package/scripts/sw-setup.sh +234 -0
  66. package/scripts/sw-status.sh +605 -0
  67. package/scripts/{cct-templates.sh → sw-templates.sh} +9 -4
  68. package/scripts/sw-tmux.sh +591 -0
  69. package/scripts/sw-tracker-jira.sh +277 -0
  70. package/scripts/sw-tracker-linear.sh +292 -0
  71. package/scripts/sw-tracker.sh +409 -0
  72. package/scripts/{cct-upgrade.sh → sw-upgrade.sh} +103 -46
  73. package/scripts/{cct-worktree.sh → sw-worktree.sh} +3 -0
  74. package/templates/pipelines/autonomous.json +27 -5
  75. package/templates/pipelines/full.json +12 -0
  76. package/templates/pipelines/standard.json +12 -0
  77. package/tmux/{claude-teams-overlay.conf → shipwright-overlay.conf} +27 -9
  78. package/tmux/templates/accessibility.json +34 -0
  79. package/tmux/templates/api-design.json +35 -0
  80. package/tmux/templates/architecture.json +1 -0
  81. package/tmux/templates/bug-fix.json +9 -0
  82. package/tmux/templates/code-review.json +1 -0
  83. package/tmux/templates/compliance.json +36 -0
  84. package/tmux/templates/data-pipeline.json +36 -0
  85. package/tmux/templates/debt-paydown.json +34 -0
  86. package/tmux/templates/devops.json +1 -0
  87. package/tmux/templates/documentation.json +1 -0
  88. package/tmux/templates/exploration.json +1 -0
  89. package/tmux/templates/feature-dev.json +1 -0
  90. package/tmux/templates/full-stack.json +8 -0
  91. package/tmux/templates/i18n.json +34 -0
  92. package/tmux/templates/incident-response.json +36 -0
  93. package/tmux/templates/migration.json +1 -0
  94. package/tmux/templates/observability.json +35 -0
  95. package/tmux/templates/onboarding.json +33 -0
  96. package/tmux/templates/performance.json +35 -0
  97. package/tmux/templates/refactor.json +1 -0
  98. package/tmux/templates/release.json +35 -0
  99. package/tmux/templates/security-audit.json +8 -0
  100. package/tmux/templates/spike.json +34 -0
  101. package/tmux/templates/testing.json +1 -0
  102. package/tmux/tmux.conf +98 -9
  103. package/scripts/cct-doctor.sh +0 -414
  104. package/scripts/cct-session.sh +0 -284
  105. package/scripts/cct-status.sh +0 -169
@@ -1,10 +1,12 @@
1
1
  #!/usr/bin/env bash
2
2
  # ╔═══════════════════════════════════════════════════════════════════════════╗
3
- # ║ cct-logs.sh — View and search agent pane logs ║
3
+ # ║ sw-logs.sh — View and search agent pane logs ║
4
4
  # ║ ║
5
5
  # ║ Captures tmux pane scrollback and provides log browsing/search. ║
6
6
  # ╚═══════════════════════════════════════════════════════════════════════════╝
7
+ VERSION="1.9.0"
7
8
  set -euo pipefail
9
+ trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
10
 
9
11
  # ─── Colors ──────────────────────────────────────────────────────────────────
10
12
  CYAN='\033[38;2;0;212;255m'
@@ -23,7 +25,59 @@ success() { echo -e "${GREEN}${BOLD}✓${RESET} $*"; }
23
25
  warn() { echo -e "${YELLOW}${BOLD}⚠${RESET} $*"; }
24
26
  error() { echo -e "${RED}${BOLD}✗${RESET} $*" >&2; }
25
27
 
26
- LOGS_DIR="$HOME/.claude-teams/logs"
28
+ LOGS_DIR="$HOME/.shipwright/logs"
29
+
30
+ # ─── Intelligence Check ──────────────────────────────────────────────────
31
+ intelligence_available() {
32
+ command -v claude &>/dev/null || return 1
33
+ local config
34
+ for config in "$(git rev-parse --show-toplevel 2>/dev/null)/.claude/daemon-config.json" \
35
+ "${HOME}/.shipwright/config.json"; do
36
+ if [[ -f "$config" ]]; then
37
+ local enabled
38
+ enabled=$(jq -r '.intelligence.enabled // false' "$config" 2>/dev/null || echo "false")
39
+ [[ "$enabled" == "true" ]] && return 0
40
+ fi
41
+ done
42
+ return 1
43
+ }
44
+
45
+ # ─── Semantic Log Ranking ────────────────────────────────────────────────
46
+ # After grep results are collected, use Claude to rank by relevance,
47
+ # group by error type/stage, and highlight actionable entries.
48
+ semantic_rank_results() {
49
+ local query="$1"
50
+ local raw_results="$2"
51
+
52
+ [[ -z "$raw_results" ]] && return 0
53
+
54
+ # Truncate if too long to avoid overflowing Claude context
55
+ local truncated
56
+ truncated=$(echo "$raw_results" | head -200)
57
+
58
+ local analysis
59
+ analysis=$(claude --print "You are analyzing agent log search results. The user searched for: \"${query}\"
60
+
61
+ Here are the grep results:
62
+ ${truncated}
63
+
64
+ Respond with:
65
+ 1. MOST ACTIONABLE entries first (errors that need attention, failures with clear root causes)
66
+ 2. Group by error type or pipeline stage
67
+ 3. For each group, provide a one-line summary
68
+
69
+ Format your response as plain text suitable for terminal display. Use --- to separate groups. Be concise." 2>/dev/null || true)
70
+
71
+ if [[ -n "$analysis" ]]; then
72
+ echo ""
73
+ echo -e " ${PURPLE}${BOLD}Semantic Analysis${RESET} ${DIM}(intelligence-enhanced)${RESET}"
74
+ echo -e "${DIM} ──────────────────────────────────────────${RESET}"
75
+ echo "$analysis" | while IFS= read -r line; do
76
+ echo -e " $line"
77
+ done
78
+ echo ""
79
+ fi
80
+ }
27
81
 
28
82
  show_usage() {
29
83
  echo -e "${CYAN}${BOLD}shipwright logs${RESET} — View agent pane logs"
@@ -187,6 +241,7 @@ show_team_logs() {
187
241
  info "Searching for '${grep_pattern}' in ${#log_files[@]} log file(s)..."
188
242
  echo ""
189
243
  local found=false
244
+ local all_raw_matches=""
190
245
  for f in "${log_files[@]}"; do
191
246
  local matches
192
247
  matches="$(grep -n --color=always "$grep_pattern" "$f" 2>/dev/null || true)"
@@ -197,11 +252,26 @@ show_team_logs() {
197
252
  echo -e " ${line}"
198
253
  done
199
254
  echo ""
255
+ # Collect plain matches for semantic analysis
256
+ local plain_matches
257
+ plain_matches="$(grep -n "$grep_pattern" "$f" 2>/dev/null || true)"
258
+ if [[ -n "$plain_matches" ]]; then
259
+ all_raw_matches+="=== $(basename "$f") ===
260
+ ${plain_matches}
261
+
262
+ "
263
+ fi
200
264
  fi
201
265
  done
202
266
  if ! $found; then
203
267
  warn "No matches for '${grep_pattern}'"
204
268
  fi
269
+
270
+ # Semantic enhancement (intelligence-gated)
271
+ if $found && intelligence_available; then
272
+ semantic_rank_results "$grep_pattern" "$all_raw_matches"
273
+ fi
274
+
205
275
  return
206
276
  fi
207
277