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.
- package/.claude/agents/code-reviewer.md +90 -0
- package/.claude/agents/devops-engineer.md +142 -0
- package/.claude/agents/pipeline-agent.md +80 -0
- package/.claude/agents/shell-script-specialist.md +150 -0
- package/.claude/agents/test-specialist.md +196 -0
- package/.claude/hooks/post-tool-use.sh +38 -0
- package/.claude/hooks/pre-tool-use.sh +25 -0
- package/.claude/hooks/session-started.sh +37 -0
- package/README.md +212 -814
- package/claude-code/CLAUDE.md.shipwright +54 -0
- package/claude-code/hooks/notify-idle.sh +2 -2
- package/claude-code/hooks/session-start.sh +24 -0
- package/claude-code/hooks/task-completed.sh +6 -2
- package/claude-code/settings.json.template +12 -0
- package/dashboard/public/app.js +4422 -0
- package/dashboard/public/index.html +816 -0
- package/dashboard/public/styles.css +4755 -0
- package/dashboard/server.ts +4315 -0
- package/docs/KNOWN-ISSUES.md +18 -10
- package/docs/TIPS.md +38 -26
- package/docs/patterns/README.md +33 -23
- package/package.json +9 -5
- package/scripts/adapters/iterm2-adapter.sh +1 -1
- package/scripts/adapters/tmux-adapter.sh +52 -23
- package/scripts/adapters/wezterm-adapter.sh +26 -14
- package/scripts/lib/compat.sh +200 -0
- package/scripts/lib/helpers.sh +72 -0
- package/scripts/postinstall.mjs +72 -13
- package/scripts/{cct → sw} +109 -21
- package/scripts/sw-adversarial.sh +274 -0
- package/scripts/sw-architecture-enforcer.sh +330 -0
- package/scripts/sw-checkpoint.sh +390 -0
- package/scripts/{cct-cleanup.sh → sw-cleanup.sh} +3 -1
- package/scripts/sw-connect.sh +619 -0
- package/scripts/{cct-cost.sh → sw-cost.sh} +368 -34
- package/scripts/{cct-daemon.sh → sw-daemon.sh} +2217 -204
- package/scripts/sw-dashboard.sh +477 -0
- package/scripts/sw-developer-simulation.sh +252 -0
- package/scripts/sw-docs.sh +635 -0
- package/scripts/sw-doctor.sh +907 -0
- package/scripts/{cct-fix.sh → sw-fix.sh} +10 -6
- package/scripts/{cct-fleet.sh → sw-fleet.sh} +498 -22
- package/scripts/sw-github-checks.sh +521 -0
- package/scripts/sw-github-deploy.sh +533 -0
- package/scripts/sw-github-graphql.sh +972 -0
- package/scripts/sw-heartbeat.sh +293 -0
- package/scripts/{cct-init.sh → sw-init.sh} +144 -11
- package/scripts/sw-intelligence.sh +1196 -0
- package/scripts/sw-jira.sh +643 -0
- package/scripts/sw-launchd.sh +364 -0
- package/scripts/sw-linear.sh +648 -0
- package/scripts/{cct-logs.sh → sw-logs.sh} +72 -2
- package/scripts/{cct-loop.sh → sw-loop.sh} +534 -44
- package/scripts/{cct-memory.sh → sw-memory.sh} +321 -38
- package/scripts/sw-patrol-meta.sh +417 -0
- package/scripts/sw-pipeline-composer.sh +455 -0
- package/scripts/{cct-pipeline.sh → sw-pipeline.sh} +2319 -178
- package/scripts/sw-predictive.sh +820 -0
- package/scripts/{cct-prep.sh → sw-prep.sh} +339 -49
- package/scripts/{cct-ps.sh → sw-ps.sh} +6 -4
- package/scripts/{cct-reaper.sh → sw-reaper.sh} +6 -4
- package/scripts/sw-remote.sh +687 -0
- package/scripts/sw-self-optimize.sh +947 -0
- package/scripts/sw-session.sh +519 -0
- package/scripts/sw-setup.sh +234 -0
- package/scripts/sw-status.sh +605 -0
- package/scripts/{cct-templates.sh → sw-templates.sh} +9 -4
- package/scripts/sw-tmux.sh +591 -0
- package/scripts/sw-tracker-jira.sh +277 -0
- package/scripts/sw-tracker-linear.sh +292 -0
- package/scripts/sw-tracker.sh +409 -0
- package/scripts/{cct-upgrade.sh → sw-upgrade.sh} +103 -46
- package/scripts/{cct-worktree.sh → sw-worktree.sh} +3 -0
- package/templates/pipelines/autonomous.json +27 -5
- package/templates/pipelines/full.json +12 -0
- package/templates/pipelines/standard.json +12 -0
- package/tmux/{claude-teams-overlay.conf → shipwright-overlay.conf} +27 -9
- package/tmux/templates/accessibility.json +34 -0
- package/tmux/templates/api-design.json +35 -0
- package/tmux/templates/architecture.json +1 -0
- package/tmux/templates/bug-fix.json +9 -0
- package/tmux/templates/code-review.json +1 -0
- package/tmux/templates/compliance.json +36 -0
- package/tmux/templates/data-pipeline.json +36 -0
- package/tmux/templates/debt-paydown.json +34 -0
- package/tmux/templates/devops.json +1 -0
- package/tmux/templates/documentation.json +1 -0
- package/tmux/templates/exploration.json +1 -0
- package/tmux/templates/feature-dev.json +1 -0
- package/tmux/templates/full-stack.json +8 -0
- package/tmux/templates/i18n.json +34 -0
- package/tmux/templates/incident-response.json +36 -0
- package/tmux/templates/migration.json +1 -0
- package/tmux/templates/observability.json +35 -0
- package/tmux/templates/onboarding.json +33 -0
- package/tmux/templates/performance.json +35 -0
- package/tmux/templates/refactor.json +1 -0
- package/tmux/templates/release.json +35 -0
- package/tmux/templates/security-audit.json +8 -0
- package/tmux/templates/spike.json +34 -0
- package/tmux/templates/testing.json +1 -0
- package/tmux/tmux.conf +98 -9
- package/scripts/cct-doctor.sh +0 -414
- package/scripts/cct-session.sh +0 -284
- package/scripts/cct-status.sh +0 -169
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ╔═══════════════════════════════════════════════════════════════════════════╗
|
|
3
|
+
# ║ shipwright setup — One-shot setup: check prerequisites, init, doctor ║
|
|
4
|
+
# ║ ║
|
|
5
|
+
# ║ Guides new users from zero to running: checks tools, installs configs, ║
|
|
6
|
+
# ║ injects the tmux overlay, validates everything, and prints a quick ║
|
|
7
|
+
# ║ start guide. ║
|
|
8
|
+
# ╚═══════════════════════════════════════════════════════════════════════════╝
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
11
|
+
|
|
12
|
+
VERSION="1.9.0"
|
|
13
|
+
|
|
14
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
15
|
+
|
|
16
|
+
# ─── Colors ──────────────────────────────────────────────────────────────────
|
|
17
|
+
CYAN='\033[38;2;0;212;255m'
|
|
18
|
+
PURPLE='\033[38;2;124;58;237m'
|
|
19
|
+
GREEN='\033[38;2;74;222;128m'
|
|
20
|
+
YELLOW='\033[38;2;250;204;21m'
|
|
21
|
+
RED='\033[38;2;248;113;113m'
|
|
22
|
+
DIM='\033[2m'
|
|
23
|
+
BOLD='\033[1m'
|
|
24
|
+
RESET='\033[0m'
|
|
25
|
+
|
|
26
|
+
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
|
27
|
+
# shellcheck source=lib/compat.sh
|
|
28
|
+
[[ -f "$SCRIPT_DIR/lib/compat.sh" ]] && source "$SCRIPT_DIR/lib/compat.sh"
|
|
29
|
+
# ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
30
|
+
info() { echo -e "${CYAN}${BOLD}▸${RESET} $*"; }
|
|
31
|
+
success() { echo -e "${GREEN}${BOLD}✓${RESET} $*"; }
|
|
32
|
+
warn() { echo -e "${YELLOW}${BOLD}⚠${RESET} $*"; }
|
|
33
|
+
error() { echo -e "${RED}${BOLD}✗${RESET} $*" >&2; }
|
|
34
|
+
|
|
35
|
+
PASS=0
|
|
36
|
+
WARN=0
|
|
37
|
+
FAIL=0
|
|
38
|
+
|
|
39
|
+
check_pass() { success "$*"; PASS=$((PASS + 1)); }
|
|
40
|
+
check_warn() { warn "$*"; WARN=$((WARN + 1)); }
|
|
41
|
+
check_fail() { error "$*"; FAIL=$((FAIL + 1)); }
|
|
42
|
+
|
|
43
|
+
# ─── Flag parsing ────────────────────────────────────────────────────────────
|
|
44
|
+
for arg in "$@"; do
|
|
45
|
+
case "$arg" in
|
|
46
|
+
--help|-h)
|
|
47
|
+
echo "Usage: shipwright setup"
|
|
48
|
+
echo ""
|
|
49
|
+
echo "One-shot guided setup: checks prerequisites, runs init,"
|
|
50
|
+
echo "injects the tmux overlay, validates with doctor, and prints"
|
|
51
|
+
echo "a quick-start guide."
|
|
52
|
+
exit 0
|
|
53
|
+
;;
|
|
54
|
+
esac
|
|
55
|
+
done
|
|
56
|
+
|
|
57
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
58
|
+
# Welcome Banner
|
|
59
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
60
|
+
echo ""
|
|
61
|
+
echo -e "${CYAN}${BOLD} ╔══════════════════════════════════════╗${RESET}"
|
|
62
|
+
echo -e "${CYAN}${BOLD} ║ Shipwright Setup ║${RESET}"
|
|
63
|
+
echo -e "${CYAN}${BOLD} ║ v${VERSION} ║${RESET}"
|
|
64
|
+
echo -e "${CYAN}${BOLD} ╚══════════════════════════════════════╝${RESET}"
|
|
65
|
+
echo ""
|
|
66
|
+
|
|
67
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
68
|
+
# 1. Check Prerequisites
|
|
69
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
70
|
+
echo -e "${PURPLE}${BOLD} PREREQUISITES${RESET}"
|
|
71
|
+
echo -e "${DIM} ──────────────────────────────────────────${RESET}"
|
|
72
|
+
|
|
73
|
+
# Detect OS for install instructions
|
|
74
|
+
if [[ "$(uname)" == "Darwin" ]]; then
|
|
75
|
+
PKG_MGR="brew install"
|
|
76
|
+
else
|
|
77
|
+
PKG_MGR="sudo apt install"
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
# tmux (>= 3.2)
|
|
81
|
+
if command -v tmux &>/dev/null; then
|
|
82
|
+
TMUX_VERSION="$(tmux -V | grep -oE '[0-9]+\.[0-9a-z]+')"
|
|
83
|
+
TMUX_MAJOR="$(echo "$TMUX_VERSION" | cut -d. -f1)"
|
|
84
|
+
TMUX_MINOR="$(echo "$TMUX_VERSION" | cut -d. -f2 | tr -dc '0-9')"
|
|
85
|
+
if [[ "$TMUX_MAJOR" -ge 4 ]] || [[ "$TMUX_MAJOR" -ge 3 && "$TMUX_MINOR" -ge 2 ]]; then
|
|
86
|
+
check_pass "tmux ${TMUX_VERSION}"
|
|
87
|
+
else
|
|
88
|
+
check_warn "tmux ${TMUX_VERSION} — 3.2+ required for pane-border-format"
|
|
89
|
+
echo -e " ${DIM}${PKG_MGR} tmux${RESET}"
|
|
90
|
+
fi
|
|
91
|
+
else
|
|
92
|
+
check_fail "tmux not installed"
|
|
93
|
+
echo -e " ${DIM}${PKG_MGR} tmux${RESET}"
|
|
94
|
+
fi
|
|
95
|
+
|
|
96
|
+
# jq
|
|
97
|
+
if command -v jq &>/dev/null; then
|
|
98
|
+
check_pass "jq $(jq --version 2>&1 | tr -d 'jq-')"
|
|
99
|
+
else
|
|
100
|
+
check_fail "jq not installed — required for template parsing"
|
|
101
|
+
echo -e " ${DIM}${PKG_MGR} jq${RESET}"
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
# Node.js (>= 20)
|
|
105
|
+
if command -v node &>/dev/null; then
|
|
106
|
+
NODE_VERSION="$(node -v | tr -d 'v')"
|
|
107
|
+
NODE_MAJOR="$(echo "$NODE_VERSION" | cut -d. -f1)"
|
|
108
|
+
if [[ "$NODE_MAJOR" -ge 20 ]]; then
|
|
109
|
+
check_pass "Node.js ${NODE_VERSION}"
|
|
110
|
+
else
|
|
111
|
+
check_warn "Node.js ${NODE_VERSION} — 20+ required"
|
|
112
|
+
echo -e " ${DIM}${PKG_MGR} node${RESET}"
|
|
113
|
+
fi
|
|
114
|
+
else
|
|
115
|
+
check_fail "Node.js not found"
|
|
116
|
+
echo -e " ${DIM}${PKG_MGR} node${RESET}"
|
|
117
|
+
fi
|
|
118
|
+
|
|
119
|
+
# Claude Code CLI
|
|
120
|
+
if command -v claude &>/dev/null; then
|
|
121
|
+
check_pass "Claude Code CLI"
|
|
122
|
+
else
|
|
123
|
+
check_fail "Claude Code CLI not found"
|
|
124
|
+
echo -e " ${DIM}npm install -g @anthropic-ai/claude-code${RESET}"
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
# GitHub CLI + auth
|
|
128
|
+
if command -v gh &>/dev/null; then
|
|
129
|
+
if gh auth status &>/dev/null; then
|
|
130
|
+
GH_USER="$(gh api user -q .login 2>/dev/null || echo "authenticated")"
|
|
131
|
+
check_pass "GitHub CLI: ${GH_USER}"
|
|
132
|
+
else
|
|
133
|
+
check_warn "GitHub CLI installed but not authenticated"
|
|
134
|
+
echo -e " ${DIM}gh auth login${RESET}"
|
|
135
|
+
fi
|
|
136
|
+
else
|
|
137
|
+
check_warn "GitHub CLI (gh) not installed — needed for daemon/pipeline"
|
|
138
|
+
echo -e " ${DIM}${PKG_MGR} gh${RESET}"
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
# Bash (>= 4)
|
|
142
|
+
BASH_MAJOR="${BASH_VERSINFO[0]:-0}"
|
|
143
|
+
if [[ "$BASH_MAJOR" -ge 4 ]]; then
|
|
144
|
+
check_pass "bash ${BASH_VERSION}"
|
|
145
|
+
else
|
|
146
|
+
check_warn "bash ${BASH_VERSION} — 4.0+ required for associative arrays"
|
|
147
|
+
echo -e " ${DIM}brew install bash (macOS ships 3.2)${RESET}"
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
echo ""
|
|
151
|
+
|
|
152
|
+
# Bail early if critical prereqs are missing
|
|
153
|
+
if [[ $FAIL -gt 0 ]]; then
|
|
154
|
+
echo -e " ${GREEN}${BOLD}${PASS}${RESET} passed ${YELLOW}${BOLD}${WARN}${RESET} warnings ${RED}${BOLD}${FAIL}${RESET} failed"
|
|
155
|
+
echo ""
|
|
156
|
+
error "Fix the failed prerequisites above before continuing."
|
|
157
|
+
echo -e " ${DIM}Re-run: shipwright setup${RESET}"
|
|
158
|
+
exit 1
|
|
159
|
+
fi
|
|
160
|
+
|
|
161
|
+
echo -e " ${GREEN}${BOLD}${PASS}${RESET} passed ${YELLOW}${BOLD}${WARN}${RESET} warnings ${RED}${BOLD}${FAIL}${RESET} failed"
|
|
162
|
+
echo ""
|
|
163
|
+
|
|
164
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
165
|
+
# 2. Run init
|
|
166
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
167
|
+
echo -e "${PURPLE}${BOLD} INITIALIZING${RESET}"
|
|
168
|
+
echo -e "${DIM} ──────────────────────────────────────────${RESET}"
|
|
169
|
+
echo ""
|
|
170
|
+
|
|
171
|
+
"$SCRIPT_DIR/sw-init.sh"
|
|
172
|
+
|
|
173
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
174
|
+
# 3. Inject tmux overlay (if not already sourced)
|
|
175
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
176
|
+
echo -e "${PURPLE}${BOLD} TMUX OVERLAY${RESET}"
|
|
177
|
+
echo -e "${DIM} ──────────────────────────────────────────${RESET}"
|
|
178
|
+
|
|
179
|
+
if [[ -f "$HOME/.tmux.conf" ]]; then
|
|
180
|
+
if grep -q "shipwright-overlay" "$HOME/.tmux.conf" 2>/dev/null; then
|
|
181
|
+
success "Overlay already sourced in ~/.tmux.conf"
|
|
182
|
+
else
|
|
183
|
+
echo ""
|
|
184
|
+
echo -e " Your ${BOLD}~/.tmux.conf${RESET} does not source the Shipwright overlay."
|
|
185
|
+
echo -e " This adds: pane borders, color hooks, agent keybindings."
|
|
186
|
+
echo ""
|
|
187
|
+
read -rp "$(echo -e " ${CYAN}${BOLD}▸${RESET} Append overlay source to ~/.tmux.conf? [Y/n] ")" confirm
|
|
188
|
+
if [[ -z "$confirm" || "$(echo "$confirm" | tr '[:upper:]' '[:lower:]')" != "n" ]]; then
|
|
189
|
+
{
|
|
190
|
+
echo ""
|
|
191
|
+
echo "# Shipwright agent overlay"
|
|
192
|
+
echo "source-file -q ~/.tmux/shipwright-overlay.conf"
|
|
193
|
+
} >> "$HOME/.tmux.conf"
|
|
194
|
+
success "Appended overlay source to ~/.tmux.conf"
|
|
195
|
+
else
|
|
196
|
+
info "Skipped. Add manually if you want overlay features:"
|
|
197
|
+
echo -e " ${DIM}source-file -q ~/.tmux/shipwright-overlay.conf${RESET}"
|
|
198
|
+
fi
|
|
199
|
+
fi
|
|
200
|
+
else
|
|
201
|
+
info "No ~/.tmux.conf found — init should have created one"
|
|
202
|
+
fi
|
|
203
|
+
echo ""
|
|
204
|
+
|
|
205
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
206
|
+
# 4. Run doctor
|
|
207
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
208
|
+
echo -e "${PURPLE}${BOLD} VALIDATION${RESET}"
|
|
209
|
+
echo -e "${DIM} ──────────────────────────────────────────${RESET}"
|
|
210
|
+
echo ""
|
|
211
|
+
|
|
212
|
+
"$SCRIPT_DIR/sw-doctor.sh" || true
|
|
213
|
+
|
|
214
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
215
|
+
# 5. Quick-start guide
|
|
216
|
+
# ═════════════════════════════════════════════════════════════════════════════
|
|
217
|
+
echo ""
|
|
218
|
+
echo -e "${CYAN}${BOLD} ╔══════════════════════════════════════════════════════════════╗${RESET}"
|
|
219
|
+
echo -e "${CYAN}${BOLD} ║ Quick Start ║${RESET}"
|
|
220
|
+
echo -e "${CYAN}${BOLD} ╠══════════════════════════════════════════════════════════════╣${RESET}"
|
|
221
|
+
if [[ -z "${TMUX:-}" ]]; then
|
|
222
|
+
echo -e "${CYAN}${BOLD} ║${RESET} 1. Start tmux: ${DIM}tmux new -s work${RESET} ${CYAN}${BOLD}║${RESET}"
|
|
223
|
+
echo -e "${CYAN}${BOLD} ║${RESET} 2. Create team: ${DIM}shipwright session my-feat --template feature-dev${RESET} ${CYAN}${BOLD}║${RESET}"
|
|
224
|
+
echo -e "${CYAN}${BOLD} ║${RESET} 3. Launch Claude: ${DIM}claude${RESET} ${CYAN}${BOLD}║${RESET}"
|
|
225
|
+
echo -e "${CYAN}${BOLD} ║${RESET} 4. Use teams: ${DIM}\"Create a team with 3 agents for this feature\"${RESET} ${CYAN}${BOLD}║${RESET}"
|
|
226
|
+
else
|
|
227
|
+
echo -e "${CYAN}${BOLD} ║${RESET} 1. Create team: ${DIM}shipwright session my-feat --template feature-dev${RESET} ${CYAN}${BOLD}║${RESET}"
|
|
228
|
+
echo -e "${CYAN}${BOLD} ║${RESET} 2. Launch Claude: ${DIM}claude${RESET} ${CYAN}${BOLD}║${RESET}"
|
|
229
|
+
echo -e "${CYAN}${BOLD} ║${RESET} 3. Use teams: ${DIM}\"Create a team with 3 agents for this feature\"${RESET} ${CYAN}${BOLD}║${RESET}"
|
|
230
|
+
fi
|
|
231
|
+
echo -e "${CYAN}${BOLD} ╚══════════════════════════════════════════════════════════════╝${RESET}"
|
|
232
|
+
echo ""
|
|
233
|
+
success "Setup complete! You're ready to go."
|
|
234
|
+
echo ""
|