shipwright-cli 3.1.0 → 3.3.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 (283) hide show
  1. package/.claude/agents/code-reviewer.md +2 -0
  2. package/.claude/agents/devops-engineer.md +2 -0
  3. package/.claude/agents/doc-fleet-agent.md +2 -0
  4. package/.claude/agents/pipeline-agent.md +2 -0
  5. package/.claude/agents/shell-script-specialist.md +2 -0
  6. package/.claude/agents/test-specialist.md +2 -0
  7. package/.claude/hooks/agent-crash-capture.sh +32 -0
  8. package/.claude/hooks/post-tool-use.sh +3 -2
  9. package/.claude/hooks/pre-tool-use.sh +35 -3
  10. package/README.md +22 -8
  11. package/claude-code/hooks/config-change.sh +18 -0
  12. package/claude-code/hooks/instructions-reloaded.sh +7 -0
  13. package/claude-code/hooks/worktree-create.sh +25 -0
  14. package/claude-code/hooks/worktree-remove.sh +20 -0
  15. package/config/code-constitution.json +130 -0
  16. package/config/defaults.json +25 -2
  17. package/config/policy.json +1 -1
  18. package/dashboard/middleware/auth.ts +134 -0
  19. package/dashboard/middleware/constants.ts +21 -0
  20. package/dashboard/public/index.html +8 -6
  21. package/dashboard/public/styles.css +176 -97
  22. package/dashboard/routes/auth.ts +38 -0
  23. package/dashboard/server.ts +117 -25
  24. package/dashboard/services/config.ts +26 -0
  25. package/dashboard/services/db.ts +118 -0
  26. package/dashboard/src/canvas/pixel-agent.ts +298 -0
  27. package/dashboard/src/canvas/pixel-sprites.ts +440 -0
  28. package/dashboard/src/canvas/shipyard-effects.ts +367 -0
  29. package/dashboard/src/canvas/shipyard-scene.ts +616 -0
  30. package/dashboard/src/canvas/submarine-layout.ts +267 -0
  31. package/dashboard/src/components/header.ts +8 -7
  32. package/dashboard/src/core/api.ts +5 -0
  33. package/dashboard/src/core/router.ts +1 -0
  34. package/dashboard/src/design/submarine-theme.ts +253 -0
  35. package/dashboard/src/main.ts +2 -0
  36. package/dashboard/src/types/api.ts +12 -1
  37. package/dashboard/src/views/activity.ts +2 -1
  38. package/dashboard/src/views/metrics.ts +69 -1
  39. package/dashboard/src/views/shipyard.ts +39 -0
  40. package/dashboard/types/index.ts +166 -0
  41. package/docs/plans/2026-02-28-compound-audit-and-shipyard-design.md +186 -0
  42. package/docs/plans/2026-02-28-skipper-shipwright-implementation-plan.md +1182 -0
  43. package/docs/plans/2026-02-28-skipper-shipwright-integration-design.md +531 -0
  44. package/docs/plans/2026-03-01-ai-powered-skill-injection-design.md +298 -0
  45. package/docs/plans/2026-03-01-ai-powered-skill-injection-plan.md +1109 -0
  46. package/docs/plans/2026-03-01-capabilities-cleanup-plan.md +658 -0
  47. package/docs/plans/2026-03-01-clean-architecture-plan.md +924 -0
  48. package/docs/plans/2026-03-01-compound-audit-cascade-design.md +191 -0
  49. package/docs/plans/2026-03-01-compound-audit-cascade-plan.md +921 -0
  50. package/docs/plans/2026-03-01-deep-integration-plan.md +851 -0
  51. package/docs/plans/2026-03-01-pipeline-audit-trail-design.md +145 -0
  52. package/docs/plans/2026-03-01-pipeline-audit-trail-plan.md +770 -0
  53. package/docs/plans/2026-03-01-refined-depths-brand-design.md +382 -0
  54. package/docs/plans/2026-03-01-refined-depths-implementation.md +599 -0
  55. package/docs/plans/2026-03-01-skipper-kernel-integration-design.md +203 -0
  56. package/docs/plans/2026-03-01-unified-platform-design.md +272 -0
  57. package/docs/plans/2026-03-07-claude-code-feature-integration-design.md +189 -0
  58. package/docs/plans/2026-03-07-claude-code-feature-integration-plan.md +1165 -0
  59. package/docs/research/BACKLOG_QUICK_REFERENCE.md +352 -0
  60. package/docs/research/CUTTING_EDGE_RESEARCH_2026.md +546 -0
  61. package/docs/research/RESEARCH_INDEX.md +439 -0
  62. package/docs/research/RESEARCH_SOURCES.md +440 -0
  63. package/docs/research/RESEARCH_SUMMARY.txt +275 -0
  64. package/docs/superpowers/specs/2026-03-10-pipeline-quality-revolution-design.md +341 -0
  65. package/package.json +2 -2
  66. package/scripts/lib/adaptive-model.sh +427 -0
  67. package/scripts/lib/adaptive-timeout.sh +316 -0
  68. package/scripts/lib/audit-trail.sh +309 -0
  69. package/scripts/lib/auto-recovery.sh +471 -0
  70. package/scripts/lib/bandit-selector.sh +431 -0
  71. package/scripts/lib/bootstrap.sh +104 -2
  72. package/scripts/lib/causal-graph.sh +455 -0
  73. package/scripts/lib/compat.sh +126 -0
  74. package/scripts/lib/compound-audit.sh +337 -0
  75. package/scripts/lib/constitutional.sh +454 -0
  76. package/scripts/lib/context-budget.sh +359 -0
  77. package/scripts/lib/convergence.sh +594 -0
  78. package/scripts/lib/cost-optimizer.sh +634 -0
  79. package/scripts/lib/daemon-adaptive.sh +14 -2
  80. package/scripts/lib/daemon-dispatch.sh +106 -17
  81. package/scripts/lib/daemon-failure.sh +34 -4
  82. package/scripts/lib/daemon-patrol.sh +25 -4
  83. package/scripts/lib/daemon-poll-github.sh +361 -0
  84. package/scripts/lib/daemon-poll-health.sh +299 -0
  85. package/scripts/lib/daemon-poll.sh +27 -611
  86. package/scripts/lib/daemon-state.sh +119 -66
  87. package/scripts/lib/daemon-triage.sh +10 -0
  88. package/scripts/lib/dod-scorecard.sh +442 -0
  89. package/scripts/lib/error-actionability.sh +300 -0
  90. package/scripts/lib/formal-spec.sh +461 -0
  91. package/scripts/lib/helpers.sh +180 -5
  92. package/scripts/lib/intent-analysis.sh +409 -0
  93. package/scripts/lib/loop-convergence.sh +350 -0
  94. package/scripts/lib/loop-iteration.sh +682 -0
  95. package/scripts/lib/loop-progress.sh +48 -0
  96. package/scripts/lib/loop-restart.sh +185 -0
  97. package/scripts/lib/memory-effectiveness.sh +506 -0
  98. package/scripts/lib/mutation-executor.sh +352 -0
  99. package/scripts/lib/outcome-feedback.sh +521 -0
  100. package/scripts/lib/pipeline-cli.sh +336 -0
  101. package/scripts/lib/pipeline-commands.sh +1216 -0
  102. package/scripts/lib/pipeline-detection.sh +101 -3
  103. package/scripts/lib/pipeline-execution.sh +897 -0
  104. package/scripts/lib/pipeline-github.sh +28 -3
  105. package/scripts/lib/pipeline-intelligence-compound.sh +431 -0
  106. package/scripts/lib/pipeline-intelligence-scoring.sh +407 -0
  107. package/scripts/lib/pipeline-intelligence-skip.sh +181 -0
  108. package/scripts/lib/pipeline-intelligence.sh +104 -1138
  109. package/scripts/lib/pipeline-quality-bash-compat.sh +182 -0
  110. package/scripts/lib/pipeline-quality-checks.sh +17 -711
  111. package/scripts/lib/pipeline-quality-gates.sh +563 -0
  112. package/scripts/lib/pipeline-stages-build.sh +730 -0
  113. package/scripts/lib/pipeline-stages-delivery.sh +965 -0
  114. package/scripts/lib/pipeline-stages-intake.sh +1133 -0
  115. package/scripts/lib/pipeline-stages-monitor.sh +407 -0
  116. package/scripts/lib/pipeline-stages-review.sh +1022 -0
  117. package/scripts/lib/pipeline-stages.sh +161 -2901
  118. package/scripts/lib/pipeline-state.sh +36 -5
  119. package/scripts/lib/pipeline-util.sh +487 -0
  120. package/scripts/lib/policy-learner.sh +438 -0
  121. package/scripts/lib/process-reward.sh +493 -0
  122. package/scripts/lib/project-detect.sh +649 -0
  123. package/scripts/lib/quality-profile.sh +334 -0
  124. package/scripts/lib/recruit-commands.sh +885 -0
  125. package/scripts/lib/recruit-learning.sh +739 -0
  126. package/scripts/lib/recruit-roles.sh +648 -0
  127. package/scripts/lib/reward-aggregator.sh +458 -0
  128. package/scripts/lib/rl-optimizer.sh +362 -0
  129. package/scripts/lib/root-cause.sh +427 -0
  130. package/scripts/lib/scope-enforcement.sh +445 -0
  131. package/scripts/lib/session-restart.sh +493 -0
  132. package/scripts/lib/skill-memory.sh +300 -0
  133. package/scripts/lib/skill-registry.sh +775 -0
  134. package/scripts/lib/spec-driven.sh +476 -0
  135. package/scripts/lib/test-helpers.sh +18 -7
  136. package/scripts/lib/test-holdout.sh +429 -0
  137. package/scripts/lib/test-optimizer.sh +511 -0
  138. package/scripts/shipwright-file-suggest.sh +45 -0
  139. package/scripts/skills/adversarial-quality.md +61 -0
  140. package/scripts/skills/api-design.md +44 -0
  141. package/scripts/skills/architecture-design.md +50 -0
  142. package/scripts/skills/brainstorming.md +43 -0
  143. package/scripts/skills/data-pipeline.md +44 -0
  144. package/scripts/skills/deploy-safety.md +64 -0
  145. package/scripts/skills/documentation.md +38 -0
  146. package/scripts/skills/frontend-design.md +45 -0
  147. package/scripts/skills/generated/.gitkeep +0 -0
  148. package/scripts/skills/generated/_refinements/.gitkeep +0 -0
  149. package/scripts/skills/generated/_refinements/adversarial-quality.patch.md +3 -0
  150. package/scripts/skills/generated/_refinements/architecture-design.patch.md +3 -0
  151. package/scripts/skills/generated/_refinements/brainstorming.patch.md +3 -0
  152. package/scripts/skills/generated/cli-version-management.md +29 -0
  153. package/scripts/skills/generated/collection-system-validation.md +99 -0
  154. package/scripts/skills/generated/large-scale-c-refactoring-coordination.md +97 -0
  155. package/scripts/skills/generated/pattern-matching-similarity-scoring.md +195 -0
  156. package/scripts/skills/generated/test-parallelization-detection.md +65 -0
  157. package/scripts/skills/observability.md +79 -0
  158. package/scripts/skills/performance.md +48 -0
  159. package/scripts/skills/pr-quality.md +49 -0
  160. package/scripts/skills/product-thinking.md +43 -0
  161. package/scripts/skills/security-audit.md +49 -0
  162. package/scripts/skills/systematic-debugging.md +40 -0
  163. package/scripts/skills/testing-strategy.md +47 -0
  164. package/scripts/skills/two-stage-review.md +52 -0
  165. package/scripts/skills/validation-thoroughness.md +55 -0
  166. package/scripts/sw +9 -3
  167. package/scripts/sw-activity.sh +9 -8
  168. package/scripts/sw-adaptive.sh +8 -7
  169. package/scripts/sw-adversarial.sh +2 -1
  170. package/scripts/sw-architecture-enforcer.sh +3 -1
  171. package/scripts/sw-auth.sh +12 -2
  172. package/scripts/sw-autonomous.sh +5 -1
  173. package/scripts/sw-changelog.sh +4 -1
  174. package/scripts/sw-checkpoint.sh +2 -1
  175. package/scripts/sw-ci.sh +15 -6
  176. package/scripts/sw-cleanup.sh +4 -26
  177. package/scripts/sw-code-review.sh +45 -20
  178. package/scripts/sw-connect.sh +2 -1
  179. package/scripts/sw-context.sh +2 -1
  180. package/scripts/sw-cost.sh +107 -5
  181. package/scripts/sw-daemon.sh +71 -11
  182. package/scripts/sw-dashboard.sh +3 -1
  183. package/scripts/sw-db.sh +71 -20
  184. package/scripts/sw-decide.sh +8 -2
  185. package/scripts/sw-decompose.sh +360 -17
  186. package/scripts/sw-deps.sh +4 -1
  187. package/scripts/sw-developer-simulation.sh +4 -1
  188. package/scripts/sw-discovery.sh +378 -5
  189. package/scripts/sw-doc-fleet.sh +4 -1
  190. package/scripts/sw-docs-agent.sh +3 -1
  191. package/scripts/sw-docs.sh +2 -1
  192. package/scripts/sw-doctor.sh +453 -2
  193. package/scripts/sw-dora.sh +4 -1
  194. package/scripts/sw-durable.sh +12 -7
  195. package/scripts/sw-e2e-orchestrator.sh +17 -16
  196. package/scripts/sw-eventbus.sh +13 -4
  197. package/scripts/sw-evidence.sh +364 -12
  198. package/scripts/sw-feedback.sh +550 -9
  199. package/scripts/sw-fix.sh +20 -1
  200. package/scripts/sw-fleet-discover.sh +6 -2
  201. package/scripts/sw-fleet-viz.sh +9 -4
  202. package/scripts/sw-fleet.sh +5 -1
  203. package/scripts/sw-github-app.sh +18 -4
  204. package/scripts/sw-github-checks.sh +3 -2
  205. package/scripts/sw-github-deploy.sh +3 -2
  206. package/scripts/sw-github-graphql.sh +18 -7
  207. package/scripts/sw-guild.sh +5 -1
  208. package/scripts/sw-heartbeat.sh +5 -30
  209. package/scripts/sw-hello.sh +67 -0
  210. package/scripts/sw-hygiene.sh +10 -3
  211. package/scripts/sw-incident.sh +273 -5
  212. package/scripts/sw-init.sh +18 -2
  213. package/scripts/sw-instrument.sh +10 -2
  214. package/scripts/sw-intelligence.sh +44 -7
  215. package/scripts/sw-jira.sh +5 -1
  216. package/scripts/sw-launchd.sh +2 -1
  217. package/scripts/sw-linear.sh +4 -1
  218. package/scripts/sw-logs.sh +4 -1
  219. package/scripts/sw-loop.sh +436 -1076
  220. package/scripts/sw-memory.sh +357 -3
  221. package/scripts/sw-mission-control.sh +6 -1
  222. package/scripts/sw-model-router.sh +483 -27
  223. package/scripts/sw-otel.sh +15 -4
  224. package/scripts/sw-oversight.sh +14 -5
  225. package/scripts/sw-patrol-meta.sh +334 -0
  226. package/scripts/sw-pipeline-composer.sh +7 -1
  227. package/scripts/sw-pipeline-vitals.sh +12 -6
  228. package/scripts/sw-pipeline.sh +54 -2653
  229. package/scripts/sw-pm.sh +16 -8
  230. package/scripts/sw-pr-lifecycle.sh +2 -1
  231. package/scripts/sw-predictive.sh +17 -5
  232. package/scripts/sw-prep.sh +185 -2
  233. package/scripts/sw-ps.sh +5 -25
  234. package/scripts/sw-public-dashboard.sh +17 -4
  235. package/scripts/sw-quality.sh +14 -6
  236. package/scripts/sw-reaper.sh +8 -25
  237. package/scripts/sw-recruit.sh +156 -2303
  238. package/scripts/sw-regression.sh +19 -12
  239. package/scripts/sw-release-manager.sh +3 -1
  240. package/scripts/sw-release.sh +4 -1
  241. package/scripts/sw-remote.sh +3 -1
  242. package/scripts/sw-replay.sh +7 -1
  243. package/scripts/sw-retro.sh +158 -1
  244. package/scripts/sw-review-rerun.sh +3 -1
  245. package/scripts/sw-scale.sh +14 -5
  246. package/scripts/sw-security-audit.sh +6 -1
  247. package/scripts/sw-self-optimize.sh +173 -6
  248. package/scripts/sw-session.sh +9 -3
  249. package/scripts/sw-setup.sh +3 -1
  250. package/scripts/sw-stall-detector.sh +406 -0
  251. package/scripts/sw-standup.sh +15 -7
  252. package/scripts/sw-status.sh +3 -1
  253. package/scripts/sw-strategic.sh +14 -6
  254. package/scripts/sw-stream.sh +13 -4
  255. package/scripts/sw-swarm.sh +20 -7
  256. package/scripts/sw-team-stages.sh +13 -6
  257. package/scripts/sw-templates.sh +7 -31
  258. package/scripts/sw-testgen.sh +17 -6
  259. package/scripts/sw-tmux-pipeline.sh +4 -1
  260. package/scripts/sw-tmux-role-color.sh +2 -0
  261. package/scripts/sw-tmux-status.sh +1 -1
  262. package/scripts/sw-tmux.sh +37 -1
  263. package/scripts/sw-trace.sh +3 -1
  264. package/scripts/sw-tracker-github.sh +3 -0
  265. package/scripts/sw-tracker-jira.sh +3 -0
  266. package/scripts/sw-tracker-linear.sh +3 -0
  267. package/scripts/sw-tracker.sh +3 -1
  268. package/scripts/sw-triage.sh +3 -2
  269. package/scripts/sw-upgrade.sh +3 -1
  270. package/scripts/sw-ux.sh +5 -2
  271. package/scripts/sw-webhook.sh +5 -2
  272. package/scripts/sw-widgets.sh +9 -4
  273. package/scripts/sw-worktree.sh +15 -3
  274. package/scripts/test-skill-injection.sh +1233 -0
  275. package/templates/pipelines/autonomous.json +27 -3
  276. package/templates/pipelines/cost-aware.json +34 -8
  277. package/templates/pipelines/deployed.json +12 -0
  278. package/templates/pipelines/enterprise.json +12 -0
  279. package/templates/pipelines/fast.json +6 -0
  280. package/templates/pipelines/full.json +27 -3
  281. package/templates/pipelines/hotfix.json +6 -0
  282. package/templates/pipelines/standard.json +12 -0
  283. package/templates/pipelines/tdd.json +12 -0
@@ -6,7 +6,8 @@
6
6
  set -euo pipefail
7
7
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
8
 
9
- VERSION="3.1.0"
9
+ # shellcheck disable=SC2034
10
+ VERSION="3.3.0"
10
11
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
12
  REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
12
13
 
@@ -28,7 +29,8 @@ fi
28
29
  if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
29
30
  emit_event() {
30
31
  local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
31
- local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
32
+ local payload
33
+ payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
32
34
  while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
33
35
  echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
34
36
  }
@@ -38,6 +40,7 @@ SWARM_DIR="${HOME}/.shipwright/swarm"
38
40
  REGISTRY_FILE="${SWARM_DIR}/registry.json"
39
41
  CONFIG_FILE="${SWARM_DIR}/config.json"
40
42
  METRICS_FILE="${SWARM_DIR}/metrics.jsonl"
43
+ # shellcheck disable=SC2034
41
44
  HEALTH_LOG="${SWARM_DIR}/health.jsonl"
42
45
 
43
46
  # ─── Ensure directories exist ──────────────────────────────────────────────
@@ -50,6 +53,7 @@ init_config() {
50
53
  if [[ ! -f "$CONFIG_FILE" ]]; then
51
54
  local tmp_file
52
55
  tmp_file=$(mktemp)
56
+ # shellcheck disable=SC2064
53
57
  trap "rm -f '$tmp_file'" RETURN
54
58
  cat > "$tmp_file" << 'JSON'
55
59
  {
@@ -76,6 +80,7 @@ init_registry() {
76
80
  if [[ ! -f "$REGISTRY_FILE" ]]; then
77
81
  local tmp_file
78
82
  tmp_file=$(mktemp)
83
+ # shellcheck disable=SC2064
79
84
  trap "rm -f '$tmp_file'" RETURN
80
85
  cat > "$tmp_file" << 'JSON'
81
86
  {
@@ -165,6 +170,7 @@ cmd_spawn() {
165
170
  # Add agent to registry
166
171
  local tmp_file
167
172
  tmp_file=$(mktemp)
173
+ # shellcheck disable=SC2064
168
174
  trap "rm -f '$tmp_file'" RETURN
169
175
 
170
176
  jq --arg agent_id "$agent_id" \
@@ -173,7 +179,7 @@ cmd_spawn() {
173
179
  id: $agent_id,
174
180
  type: $agent_type,
175
181
  status: "active",
176
- spawned_at: "'$(now_iso)'",
182
+ spawned_at: "'"$(now_iso)"'",
177
183
  current_task: null,
178
184
  task_started_at: null,
179
185
  success_count: 0,
@@ -181,8 +187,8 @@ cmd_spawn() {
181
187
  avg_completion_time: 0,
182
188
  quality_score: 100,
183
189
  resource_usage: {cpu: 0, memory: 0},
184
- last_heartbeat: "'$(now_iso)'"
185
- }] | .active_count += 1 | .last_updated = "'$(now_iso)'"' \
190
+ last_heartbeat: "'"$(now_iso)"'"
191
+ }] | .active_count += 1 | .last_updated = "'"$(now_iso)"'"' \
186
192
  "$REGISTRY_FILE" > "$tmp_file" && [[ -s "$tmp_file" ]] && \
187
193
  mv "$tmp_file" "$REGISTRY_FILE" || { rm -f "$tmp_file"; error "Failed to update registry"; return 1; }
188
194
  record_metric "$agent_id" "spawn" "1" "$agent_type"
@@ -247,10 +253,12 @@ cmd_retire() {
247
253
  # Mark as retiring / remove from registry
248
254
  local tmp_file
249
255
  tmp_file=$(mktemp)
256
+ # shellcheck disable=SC2064
250
257
  trap "rm -f '$tmp_file'" RETURN
251
258
 
259
+ # shellcheck disable=SC2046
252
260
  jq --arg aid "$agent_id" \
253
- '.agents |= map(select(.id != $aid)) | .active_count = ([.agents[] | select(.status == "active")] | length) | .last_updated = "'$(now_iso)'"' \
261
+ '.agents |= map(select(.id != $aid)) | .active_count = ([.agents[] | select(.status == "active")] | length) | .last_updated = "'"$(now_iso)"'"' \
254
262
  "$REGISTRY_FILE" > "$tmp_file" && [[ -s "$tmp_file" ]] && \
255
263
  mv "$tmp_file" "$REGISTRY_FILE" || { rm -f "$tmp_file"; error "Failed to update registry"; return 1; }
256
264
  record_metric "$agent_id" "retire" "1" "graceful_shutdown"
@@ -334,9 +342,11 @@ cmd_health() {
334
342
 
335
343
  # ─── Swarm spawn helper (for cmd_scale) ───────────────────────────────────
336
344
  swarm_spawn_agent() {
345
+ # shellcheck disable=SC2034
337
346
  local role="${1:-builder}"
338
347
  local count="${2:-1}"
339
348
  local i
349
+ # shellcheck disable=SC2034
340
350
  for i in $(seq 1 "$count"); do
341
351
  cmd_spawn "standard" 2>/dev/null || true
342
352
  done
@@ -359,7 +369,8 @@ cmd_scale() {
359
369
  fi
360
370
 
361
371
  local current_agents
362
- current_agents=$(tmux list-sessions -F '#{session_name}' 2>/dev/null | grep -cE '^shipwright-sw-agent|^swarm-' || echo "0")
372
+ current_agents=$(tmux list-sessions -F '#{session_name}' 2>/dev/null | grep -cE '^shipwright-sw-agent|^swarm-' || true)
373
+ current_agents="${current_agents:-0}"
363
374
 
364
375
  local target_agents=1
365
376
  if [[ "$queue_depth" -gt 5 ]]; then
@@ -383,6 +394,7 @@ cmd_scale() {
383
394
  local agent_id
384
395
  agent_id=$(jq -r '.agents[0].id // empty' "$REGISTRY_FILE" 2>/dev/null)
385
396
  if [[ -n "$agent_id" ]]; then
397
+ # shellcheck disable=SC2034
386
398
  cmd_retire "$agent_id" 2>/dev/null && retired=1 || true
387
399
  fi
388
400
  fi
@@ -526,6 +538,7 @@ cmd_config() {
526
538
 
527
539
  local tmp_file
528
540
  tmp_file=$(mktemp)
541
+ # shellcheck disable=SC2064
529
542
  trap "rm -f '$tmp_file'" RETURN
530
543
 
531
544
  jq --arg key "$key" --arg value "$value" \
@@ -6,7 +6,7 @@
6
6
  set -euo pipefail
7
7
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
8
 
9
- VERSION="3.1.0"
9
+ VERSION="3.3.0"
10
10
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
11
  REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
12
12
 
@@ -29,12 +29,14 @@ fi
29
29
  if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
30
30
  emit_event() {
31
31
  local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
32
- local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
32
+ local payload
33
+ payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
33
34
  while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
34
35
  echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
35
36
  }
36
37
  fi
37
38
  # ─── Structured Event Log ──────────────────────────────────────────────────
39
+ # shellcheck disable=SC2034
38
40
  EVENTS_FILE="${HOME}/.shipwright/events.jsonl"
39
41
 
40
42
  # ─── Team Configuration ─────────────────────────────────────────────────────
@@ -102,6 +104,7 @@ cmd_compose() {
102
104
  local spec_count
103
105
  spec_count=$(echo "$specialists" | wc -w)
104
106
 
107
+ # shellcheck disable=SC2046
105
108
  team_json=$(jq -n \
106
109
  --arg stage "$stage" \
107
110
  --arg complexity "$complexity" \
@@ -111,7 +114,7 @@ cmd_compose() {
111
114
  '{
112
115
  stage: $stage,
113
116
  complexity: $complexity,
114
- created_at: "'$(now_iso)'",
117
+ created_at: "'"$(now_iso)"'",
115
118
  leader: $leader,
116
119
  specialists: ($specialists | split(" ")),
117
120
  specialist_count: $spec_count,
@@ -139,6 +142,7 @@ cmd_delegate() {
139
142
  # Read hotspots from intelligence cache if available
140
143
  local hotspots=""
141
144
  if [[ -f "$INTELLIGENCE_CACHE" ]]; then
145
+ # shellcheck disable=SC2034
142
146
  hotspots=$(jq -r '.hotspots[]? // empty' "$INTELLIGENCE_CACHE" 2>/dev/null | head -10 || true)
143
147
  fi
144
148
 
@@ -160,6 +164,7 @@ cmd_delegate() {
160
164
  [[ -z "$file" ]] && continue
161
165
  local spec_idx=$((file_count % specialist_count))
162
166
  local task_json
167
+ # shellcheck disable=SC2046
163
168
  task_json=$(jq -n \
164
169
  --arg file "$file" \
165
170
  --arg spec_idx "$spec_idx" \
@@ -168,7 +173,7 @@ cmd_delegate() {
168
173
  file: $file,
169
174
  specialist_idx: ($spec_idx | tonumber),
170
175
  status: $status,
171
- assigned_at: "'$(now_iso)'",
176
+ assigned_at: "'"$(now_iso)"'",
172
177
  result: null
173
178
  }')
174
179
  tasks=$(echo "$tasks" | jq ". += [$task_json]")
@@ -303,6 +308,7 @@ cmd_vote() {
303
308
  fi
304
309
 
305
310
  local result
311
+ # shellcheck disable=SC2046
306
312
  result=$(jq -n \
307
313
  --argjson approve_count "$approve_count" \
308
314
  --argjson reject_count "$reject_count" \
@@ -315,7 +321,7 @@ cmd_vote() {
315
321
  neutral: $neutral_count,
316
322
  total: $total,
317
323
  consensus: $consensus,
318
- decided_at: "'$(now_iso)'"
324
+ decided_at: "'"$(now_iso)"'"
319
325
  }')
320
326
 
321
327
  echo "$result"
@@ -370,6 +376,7 @@ cmd_aggregate() {
370
376
 
371
377
  # Build aggregated output
372
378
  local aggregated
379
+ # shellcheck disable=SC2046
373
380
  aggregated=$(jq -n \
374
381
  --arg stage "$stage" \
375
382
  --argjson results "$results" \
@@ -382,7 +389,7 @@ cmd_aggregate() {
382
389
  failure_count: $failure_count,
383
390
  success_rate: (if ($results | length) > 0 then ($success_count / ($results | length) * 100) | floor else 0 end),
384
391
  results: $results,
385
- aggregated_at: "'$(now_iso)'"
392
+ aggregated_at: "'"$(now_iso)"'"
386
393
  }')
387
394
 
388
395
  echo "$aggregated"
@@ -5,36 +5,12 @@
5
5
  # ║ Templates define reusable agent team configurations (roles, layout, ║
6
6
  # ║ focus areas) that shipwright session --template can use to scaffold teams. ║
7
7
  # ╚═══════════════════════════════════════════════════════════════════════════╝
8
- VERSION="3.1.0"
8
+ # shellcheck disable=SC2034
9
+ VERSION="3.3.0"
9
10
  set -euo pipefail
10
- trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
11
-
12
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
-
14
- # ─── Cross-platform compatibility ──────────────────────────────────────────
15
- # shellcheck source=lib/compat.sh
16
- [[ -f "$SCRIPT_DIR/lib/compat.sh" ]] && source "$SCRIPT_DIR/lib/compat.sh"
17
-
18
- # Canonical helpers (colors, output, events)
19
- # shellcheck source=lib/helpers.sh
20
- [[ -f "$SCRIPT_DIR/lib/helpers.sh" ]] && source "$SCRIPT_DIR/lib/helpers.sh"
21
- # Fallbacks when helpers not loaded (e.g. test env with overridden SCRIPT_DIR)
22
- [[ "$(type -t info 2>/dev/null)" == "function" ]] || info() { echo -e "\033[38;2;0;212;255m\033[1m▸\033[0m $*"; }
23
- [[ "$(type -t success 2>/dev/null)" == "function" ]] || success() { echo -e "\033[38;2;74;222;128m\033[1m✓\033[0m $*"; }
24
- [[ "$(type -t warn 2>/dev/null)" == "function" ]] || warn() { echo -e "\033[38;2;250;204;21m\033[1m⚠\033[0m $*"; }
25
- [[ "$(type -t error 2>/dev/null)" == "function" ]] || error() { echo -e "\033[38;2;248;113;113m\033[1m✗\033[0m $*" >&2; }
26
- if [[ "$(type -t now_iso 2>/dev/null)" != "function" ]]; then
27
- now_iso() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
28
- now_epoch() { date +%s; }
29
- fi
30
- if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
31
- emit_event() {
32
- local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
33
- local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
34
- while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
35
- echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
36
- }
37
- fi
11
+
12
+ # shellcheck source=lib/bootstrap.sh
13
+ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/lib/bootstrap.sh"
38
14
  # ─── Template Discovery ─────────────────────────────────────────────────────
39
15
  REPO_TEMPLATES_DIR="$(cd "$SCRIPT_DIR/../tmux/templates" 2>/dev/null && pwd)" || REPO_TEMPLATES_DIR=""
40
16
  USER_TEMPLATES_DIR="${HOME}/.shipwright/templates"
@@ -82,8 +58,8 @@ json_agent_count() {
82
58
  if command -v jq >/dev/null 2>&1; then
83
59
  jq -r '.agents // [] | length' "$file" 2>/dev/null
84
60
  else
85
- grep -c '"name"' "$file" 2>/dev/null || echo "0"
86
- fi
61
+ grep -c '"name"' "$file" 2>/dev/null || true
62
+ fi | tr -d ' ' | sed 's/^$/0/'
87
63
  }
88
64
 
89
65
  # Print agent details from a template
@@ -6,7 +6,7 @@
6
6
  set -euo pipefail
7
7
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
8
 
9
- VERSION="3.1.0"
9
+ VERSION="3.3.0"
10
10
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
11
 
12
12
  # ─── Handle subcommands ───────────────────────────────────────────────────────
@@ -33,6 +33,7 @@ fi
33
33
  if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
34
34
  emit_event() {
35
35
  local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
36
+ # shellcheck disable=SC2155
36
37
  local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
37
38
  while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
38
39
  echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
@@ -40,11 +41,14 @@ if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
40
41
  fi
41
42
  # ─── Configuration ───────────────────────────────────────────────────────────
42
43
  PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
44
+ # shellcheck disable=SC2034
43
45
  SCRIPTS_DIR="$PROJECT_ROOT/scripts"
44
46
  TEST_SUITES_DIR="$PROJECT_ROOT/scripts"
45
47
  COVERAGE_THRESHOLD=70
46
48
  TESTGEN_DIR="${TESTGEN_DIR:-.claude/testgen}"
49
+ # shellcheck disable=SC2034
47
50
  COVERAGE_DB="$TESTGEN_DIR/coverage.json"
51
+ # shellcheck disable=SC2034
48
52
  QUALITY_DB="$TESTGEN_DIR/quality.json"
49
53
  REGRESSION_DB="$TESTGEN_DIR/regressions.json"
50
54
 
@@ -98,7 +102,8 @@ analyze_coverage() {
98
102
  if [[ -f "$target_script" ]]; then
99
103
  # Parse function definitions
100
104
  function_names=$(grep -E '^[a-zA-Z_][a-zA-Z0-9_]*\(\)' "$target_script" | sed 's/().*//' || echo "")
101
- total_functions=$(echo "$function_names" | grep -c . || echo "0")
105
+ total_functions=$(echo "$function_names" | grep -c . || true)
106
+ total_functions="${total_functions:-0}"
102
107
  fi
103
108
 
104
109
  # Find existing tests that call these functions
@@ -153,6 +158,7 @@ EOF
153
158
 
154
159
  generate_tests() {
155
160
  local target_script="${1:-.}"
161
+ # shellcheck disable=SC2034
156
162
  local threshold="${2:-$COVERAGE_THRESHOLD}"
157
163
 
158
164
  mkdir -p "$TESTGEN_DIR"
@@ -182,7 +188,8 @@ EOF
182
188
  fi
183
189
 
184
190
  local untested_count=0
185
- [[ -n "$untested_functions" ]] && untested_count=$(echo "$untested_functions" | grep -c . || echo "0")
191
+ [[ -n "$untested_functions" ]] && untested_count=$(echo "$untested_functions" | grep -c . || true)
192
+ untested_count="${untested_count:-0}"
186
193
 
187
194
  if [[ $untested_count -eq 0 ]]; then
188
195
  success "All functions have tests"
@@ -231,6 +238,7 @@ EOF
231
238
  func_snippet=$(awk "/^${func}\(\\)/,/^[a-zA-Z_][a-zA-Z0-9_]*\(\)|^$/" "$target_script" 2>/dev/null | head -40 || true)
232
239
  local prompt_file
233
240
  prompt_file=$(mktemp "${TMPDIR:-/tmp}/sw-testgen-prompt.XXXXXX")
241
+ # shellcheck disable=SC2064
234
242
  trap "rm -f '$prompt_file'" RETURN
235
243
  {
236
244
  echo "Generate a bash test function for the following shell function. Use real assertions (assert_equal, assert_contains, or test exit code). Test happy path and at least one edge or error case. Output only the bash function body."
@@ -338,15 +346,18 @@ score_quality() {
338
346
 
339
347
  # Count assertions
340
348
  local assertion_count=0
341
- assertion_count=$(grep -c -E '(assert_|test_|expect_)' "$test_file" || echo "0")
349
+ assertion_count=$(grep -c -E '(assert_|test_|expect_)' "$test_file" || true)
350
+ assertion_count="${assertion_count:-0}"
342
351
 
343
352
  # Count edge case patterns
344
353
  local edge_case_count=0
345
- edge_case_count=$(grep -c -E '(empty|null|nil|missing|invalid|error|fail)' "$test_file" || echo "0")
354
+ edge_case_count=$(grep -c -E '(empty|null|nil|missing|invalid|error|fail)' "$test_file" || true)
355
+ edge_case_count="${edge_case_count:-0}"
346
356
 
347
357
  # Count error path tests
348
358
  local error_path_count=0
349
- error_path_count=$(grep -c -E '(exit|return 1|error|ERROR)' "$test_file" || echo "0")
359
+ error_path_count=$(grep -c -E '(exit|return 1|error|ERROR)' "$test_file" || true)
360
+ error_path_count="${error_path_count:-0}"
350
361
 
351
362
  # Calculate score (0-100)
352
363
  local quality_score=0
@@ -6,7 +6,8 @@
6
6
  set -euo pipefail
7
7
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
8
 
9
- VERSION="3.1.0"
9
+ # shellcheck disable=SC2034
10
+ VERSION="3.3.0"
10
11
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
12
  REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
12
13
 
@@ -100,6 +101,7 @@ cmd_spawn() {
100
101
 
101
102
  local tmp_file
102
103
  tmp_file=$(mktemp)
104
+ # shellcheck disable=SC2064
103
105
  trap "rm -f '$tmp_file'" RETURN
104
106
  cat > "$tmp_file" << EOF
105
107
  {
@@ -293,6 +295,7 @@ cmd_list() {
293
295
  [[ -z "$line" ]] && continue
294
296
 
295
297
  # Parse window line: "0: pipeline-42 (1 panes)"
298
+ # shellcheck disable=SC2034
296
299
  local window_num window_name status
297
300
  window_num=$(echo "$line" | cut -d: -f1)
298
301
  window_name=$(echo "$line" | cut -d' ' -f2)
@@ -34,6 +34,7 @@ fi
34
34
  if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
35
35
  emit_event() {
36
36
  local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
37
+ # shellcheck disable=SC2155
37
38
  local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
38
39
  while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
39
40
  echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
@@ -48,6 +49,7 @@ TITLE_LOWER="$(echo "$PANE_TITLE" | tr '[:upper:]' '[:lower:]')"
48
49
  # Map role keywords to colors
49
50
  COLOR="#00d4ff" # default: cyan
50
51
 
52
+ # shellcheck disable=SC2221,SC2222
51
53
  case "$TITLE_LOWER" in
52
54
  *leader*|*lead*|*pm*|*manager*|*orchestrat*)
53
55
  COLOR="#00d4ff" # cyan — command & control
@@ -26,6 +26,7 @@ fi
26
26
  if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
27
27
  emit_event() {
28
28
  local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
29
+ # shellcheck disable=SC2155
29
30
  local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
30
31
  while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
31
32
  echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
@@ -140,7 +141,6 @@ case "${1:-pipeline}" in
140
141
  agents) agent_widget ;;
141
142
  all)
142
143
  # Combine both widgets
143
- local p a
144
144
  p="$(pipeline_widget)"
145
145
  a="$(agent_widget)"
146
146
  echo "${a}${p}"
@@ -11,7 +11,8 @@
11
11
  # ║ shipwright tmux fix — Auto-fix common issues ║
12
12
  # ║ shipwright tmux reload — Reload tmux config ║
13
13
  # ╚═══════════════════════════════════════════════════════════════════════════╝
14
- VERSION="3.1.0"
14
+ # shellcheck disable=SC2034
15
+ VERSION="3.3.0"
15
16
  set -euo pipefail
16
17
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
17
18
 
@@ -227,6 +228,16 @@ tmux_doctor() {
227
228
  check_warn "pane-border-status: ${border_status} — agent names won't show"
228
229
  fi
229
230
 
231
+ # Check pane-active-border-style for cyan accent
232
+ local border_style
233
+ border_style="$(tmux show-option -gv pane-active-border-style 2>/dev/null || echo "")"
234
+ if [[ "$border_style" == *"#00d4ff"* ]]; then
235
+ check_pass "pane-active-border-style: cyan accent applied"
236
+ else
237
+ check_warn "Pane border format missing cyan accent"
238
+ echo -e " ${DIM}Fix: set -g pane-active-border-style 'fg=#00d4ff,bg=#1a1a2e'${RESET}"
239
+ fi
240
+
230
241
  # Check dark theme hooks
231
242
  if tmux show-hooks -g 2>/dev/null | grep -q "after-split-window"; then
232
243
  check_pass "Dark theme hooks active"
@@ -344,6 +355,7 @@ tmux_install() {
344
355
  cp "$REPO_DIR/tmux/tmux.conf" "$HOME/.tmux.conf"
345
356
  success "Installed ~/.tmux.conf"
346
357
  else
358
+ # shellcheck disable=SC2088
347
359
  info "~/.tmux.conf exists — run 'shipwright init' to update"
348
360
  fi
349
361
  fi
@@ -499,6 +511,30 @@ tmux_fix() {
499
511
  fixed=$((fixed + 1))
500
512
  fi
501
513
 
514
+ # Fix 11: default-terminal
515
+ local term
516
+ term="$(tmux show-option -gv default-terminal 2>/dev/null || echo "unknown")"
517
+ if [[ "$term" != *"256color"* ]]; then
518
+ tmux set -g default-terminal "tmux-256color" 2>/dev/null
519
+ success "Fixed: default-terminal → tmux-256color (was ${term})"
520
+ fixed=$((fixed + 1))
521
+ fi
522
+
523
+ # Fix 12: pane-active-border-style (cyan accent)
524
+ local border_style
525
+ border_style="$(tmux show-option -gv pane-active-border-style 2>/dev/null || echo "")"
526
+ if [[ "$border_style" != *"#00d4ff"* ]]; then
527
+ tmux set -g pane-active-border-style "fg=#00d4ff,bg=#1a1a2e" 2>/dev/null
528
+ success "Fixed: pane-active-border-style → cyan accent (#00d4ff)"
529
+ fixed=$((fixed + 1))
530
+ fi
531
+
532
+ # Source overlay for complete styling (pane-border-format, hooks, etc.)
533
+ if [[ -f "$HOME/.tmux/shipwright-overlay.conf" ]]; then
534
+ tmux source-file "$HOME/.tmux/shipwright-overlay.conf" 2>/dev/null && \
535
+ success "Sourced: shipwright-overlay.conf" || true
536
+ fi
537
+
502
538
  echo ""
503
539
  if [[ $fixed -eq 0 ]]; then
504
540
  success "No fixes needed — tmux is already optimized!"
@@ -6,7 +6,8 @@
6
6
  set -euo pipefail
7
7
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
8
 
9
- VERSION="3.1.0"
9
+ # shellcheck disable=SC2034
10
+ VERSION="3.3.0"
10
11
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
12
  REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
12
13
 
@@ -112,6 +113,7 @@ trace_show() {
112
113
  echo -e "${BOLD}FEATURE BRANCH${RESET}"
113
114
 
114
115
  local feature_branch
116
+ # shellcheck disable=SC2034
115
117
  feature_branch="feat/issue-${issue}"
116
118
 
117
119
  # Check if worktree exists
@@ -23,6 +23,7 @@ fi
23
23
  if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
24
24
  emit_event() {
25
25
  local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
26
+ # shellcheck disable=SC2155
26
27
  local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
27
28
  while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
28
29
  echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
@@ -54,6 +55,7 @@ provider_discover_issues() {
54
55
  fi
55
56
 
56
57
  # Fetch as JSON: number, title, labels, state
58
+ # shellcheck disable=SC2054
57
59
  gh_args+=(--json number,title,labels,state)
58
60
 
59
61
  local response
@@ -198,6 +200,7 @@ provider_create_issue() {
198
200
  provider_notify() {
199
201
  local event="$1"
200
202
  local gh_issue="${2:-}"
203
+ # shellcheck disable=SC2034
201
204
  local detail="${3:-}"
202
205
 
203
206
  # GitHub is the native provider — no external sync needed
@@ -23,6 +23,7 @@ fi
23
23
  if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
24
24
  emit_event() {
25
25
  local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
26
+ # shellcheck disable=SC2155
26
27
  local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
27
28
  while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
28
29
  echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
@@ -95,7 +96,9 @@ provider_discover_statuses() {
95
96
  mkdir -p "$cache_dir"
96
97
  local tmp_cache
97
98
  tmp_cache=$(mktemp)
99
+ # shellcheck disable=SC2064
98
100
  trap "rm -f '$tmp_cache'" RETURN
101
+ # shellcheck disable=SC1010
99
102
  jq -n \
100
103
  --arg ts "$(date +%s)" \
101
104
  --arg in_progress "${discovered_in_progress:-}" \
@@ -23,6 +23,7 @@ fi
23
23
  if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
24
24
  emit_event() {
25
25
  local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
26
+ # shellcheck disable=SC2155
26
27
  local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
27
28
  while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
28
29
  echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
@@ -105,7 +106,9 @@ provider_discover_statuses() {
105
106
  mkdir -p "$cache_dir"
106
107
  local tmp_cache
107
108
  tmp_cache=$(mktemp)
109
+ # shellcheck disable=SC2064
108
110
  trap "rm -f '$tmp_cache'" RETURN
111
+ # shellcheck disable=SC1010
109
112
  jq -n \
110
113
  --arg ts "$(date +%s)" \
111
114
  --arg backlog "${discovered_backlog:-}" \
@@ -6,8 +6,10 @@
6
6
  set -euo pipefail
7
7
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
8
 
9
- VERSION="3.1.0"
9
+ # shellcheck disable=SC2034
10
+ VERSION="3.3.0"
10
11
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ # shellcheck disable=SC2034
11
13
  REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
12
14
 
13
15
  # ─── Cross-platform compatibility ──────────────────────────────────────────
@@ -6,7 +6,8 @@
6
6
  set -euo pipefail
7
7
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
8
 
9
- VERSION="3.1.0"
9
+ # shellcheck disable=SC2034
10
+ VERSION="3.3.0"
10
11
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
12
  REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
12
13
 
@@ -601,7 +602,7 @@ cmd_team() {
601
602
  fi
602
603
  fi
603
604
 
604
- # ── Fallback: hardcoded complexity/risk mapping ──
605
+ # ── Fallback: default complexity/risk mapping ──
605
606
  if [[ -z "$template" ]]; then
606
607
  case "${complexity}-${risk}" in
607
608
  trivial-low|simple-low)
@@ -2,7 +2,8 @@
2
2
  # ╔═══════════════════════════════════════════════════════════════════════════╗
3
3
  # ║ sw upgrade — Detect and apply updates from the repo ║
4
4
  # ╚═══════════════════════════════════════════════════════════════════════════╝
5
- VERSION="3.1.0"
5
+ # shellcheck disable=SC2034
6
+ VERSION="3.3.0"
6
7
  set -euo pipefail
7
8
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
9
 
@@ -217,6 +218,7 @@ read_manifest_checksum() {
217
218
 
218
219
  write_manifest() {
219
220
  mkdir -p "$MANIFEST_DIR"
221
+ # shellcheck disable=SC2155
220
222
  local json='{\n "schema": 1,\n "version": "1.1.0",\n "installed_at": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'",\n "repo_path": "'"$REPO_PATH"'",\n "files": {'
221
223
  local first=true
222
224
 
package/scripts/sw-ux.sh CHANGED
@@ -6,7 +6,8 @@
6
6
  set -euo pipefail
7
7
  trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
8
8
 
9
- VERSION="3.1.0"
9
+ # shellcheck disable=SC2034
10
+ VERSION="3.3.0"
10
11
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
12
 
12
13
  # ─── Cross-platform compatibility ──────────────────────────────────────────
@@ -27,10 +28,12 @@ if [[ "$(type -t now_iso 2>/dev/null)" != "function" ]]; then
27
28
  now_epoch() { date +%s; }
28
29
  fi
29
30
  # ─── Structured Event Log ──────────────────────────────────────────────────
31
+ # shellcheck disable=SC2034
30
32
  EVENTS_FILE="${HOME}/.shipwright/events.jsonl"
31
33
 
32
34
  # ─── UX Configuration ──────────────────────────────────────────────────────
33
35
  UX_CONFIG_GLOBAL="${HOME}/.shipwright/ux-config.json"
36
+ # shellcheck disable=SC2034
34
37
  UX_CONFIG_REPO="./.claude/ux-config.json"
35
38
 
36
39
  # Detect accessibility modes
@@ -324,7 +327,7 @@ table_header() {
324
327
 
325
328
  # Print separator
326
329
  for w in "${widths[@]}"; do
327
- printf '%*s' "$w" | tr ' ' '─'
330
+ printf '%*s' "$w" "" | tr ' ' '─'
328
331
  done
329
332
  echo ""
330
333
  }