shipwright-cli 1.7.1 → 1.10.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 +45 -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} +118 -22
- package/scripts/sw-adversarial.sh +274 -0
- package/scripts/sw-architecture-enforcer.sh +330 -0
- package/scripts/sw-checkpoint.sh +468 -0
- package/scripts/sw-cleanup.sh +359 -0
- package/scripts/sw-connect.sh +619 -0
- package/scripts/{cct-cost.sh → sw-cost.sh} +368 -34
- package/scripts/sw-daemon.sh +5574 -0
- 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/sw-loop.sh +2217 -0
- package/scripts/{cct-memory.sh → sw-memory.sh} +514 -36
- package/scripts/sw-patrol-meta.sh +417 -0
- package/scripts/sw-pipeline-composer.sh +455 -0
- package/scripts/sw-pipeline-vitals.sh +1096 -0
- package/scripts/sw-pipeline.sh +7593 -0
- 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} +9 -6
- package/scripts/{cct-reaper.sh → sw-reaper.sh} +10 -6
- package/scripts/sw-remote.sh +687 -0
- package/scripts/sw-self-optimize.sh +1048 -0
- package/scripts/sw-session.sh +541 -0
- package/scripts/sw-setup.sh +234 -0
- package/scripts/sw-status.sh +796 -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 +35 -6
- 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 +28 -2
- package/templates/pipelines/hotfix.json +19 -0
- package/templates/pipelines/standard.json +31 -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-cleanup.sh +0 -172
- package/scripts/cct-daemon.sh +0 -3189
- package/scripts/cct-doctor.sh +0 -414
- package/scripts/cct-loop.sh +0 -1332
- package/scripts/cct-pipeline.sh +0 -3844
- package/scripts/cct-session.sh +0 -284
- package/scripts/cct-status.sh +0 -169
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Hook: PostToolUse — Error capture after Bash tool failures
|
|
3
|
+
|
|
4
|
+
# Read tool input from stdin (JSON)
|
|
5
|
+
input=$(cat)
|
|
6
|
+
|
|
7
|
+
tool_name=$(echo "$input" | jq -r '.tool_name // empty' 2>/dev/null)
|
|
8
|
+
exit_code=$(echo "$input" | jq -r '.tool_result.exit_code // 0' 2>/dev/null)
|
|
9
|
+
|
|
10
|
+
# Only capture Bash tool failures
|
|
11
|
+
if [[ "$tool_name" == "Bash" ]] && [[ "${exit_code:-0}" != "0" ]]; then
|
|
12
|
+
error_log=".claude/pipeline-artifacts/error-log.jsonl"
|
|
13
|
+
mkdir -p "$(dirname "$error_log")"
|
|
14
|
+
|
|
15
|
+
# Extract error snippet (last 5 lines of stderr/output)
|
|
16
|
+
error_snippet=$(echo "$input" | jq -r '.tool_result.stderr // .tool_result.stdout // ""' 2>/dev/null | tail -5)
|
|
17
|
+
command_run=$(echo "$input" | jq -r '.tool_input.command // ""' 2>/dev/null)
|
|
18
|
+
|
|
19
|
+
# Classify error type
|
|
20
|
+
error_type="unknown"
|
|
21
|
+
case "$error_snippet" in
|
|
22
|
+
*"test"*|*"FAIL"*|*"assert"*|*"expect"*) error_type="test" ;;
|
|
23
|
+
*"syntax"*|*"unexpected"*|*"parse error"*) error_type="syntax" ;;
|
|
24
|
+
*"not found"*|*"No such"*|*"ENOENT"*) error_type="missing" ;;
|
|
25
|
+
*"permission"*|*"denied"*|*"EACCES"*) error_type="permission" ;;
|
|
26
|
+
*"timeout"*|*"timed out"*|*"ETIMEDOUT"*) error_type="timeout" ;;
|
|
27
|
+
*"injection"*|*"XSS"*|*"CSRF"*|*"CVE-"*) error_type="security" ;;
|
|
28
|
+
*"TypeError"*|*"ReferenceError"*|*"null"*|*"undefined is not"*) error_type="logic" ;;
|
|
29
|
+
*"ERESOLVE"*|*"peer dep"*|*"version"*|*"incompatible"*) error_type="dependency" ;;
|
|
30
|
+
*"flaky"*|*"intermittent"*|*"race condition"*) error_type="flaky" ;;
|
|
31
|
+
*"config"*|*"env"*|*"missing key"*|*"invalid option"*) error_type="config" ;;
|
|
32
|
+
*"ECONNREFUSED"*|*"503"*|*"502"*|*"rate limit"*) error_type="api" ;;
|
|
33
|
+
*"ENOMEM"*|*"disk full"*|*"quota"*) error_type="resource" ;;
|
|
34
|
+
esac
|
|
35
|
+
|
|
36
|
+
# Append to JSONL log
|
|
37
|
+
jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
38
|
+
--arg cmd "$command_run" \
|
|
39
|
+
--arg err "$error_snippet" \
|
|
40
|
+
--arg type "$error_type" \
|
|
41
|
+
--arg code "$exit_code" \
|
|
42
|
+
'{timestamp:$ts, command:$cmd, error:$err, type:$type, exit_code:$code}' >> "$error_log" 2>/dev/null
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
exit 0
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Hook: PreToolUse — Context injection for .sh file editing
|
|
3
|
+
# Triggered before Write/Edit tools
|
|
4
|
+
|
|
5
|
+
# Read tool input from stdin (JSON)
|
|
6
|
+
input=$(cat)
|
|
7
|
+
|
|
8
|
+
# Extract file path from tool input
|
|
9
|
+
file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty' 2>/dev/null)
|
|
10
|
+
|
|
11
|
+
# Only trigger for shell script files
|
|
12
|
+
if [[ "$file_path" == *.sh ]]; then
|
|
13
|
+
cat << 'REMINDER'
|
|
14
|
+
SHIPWRIGHT SHELL RULES:
|
|
15
|
+
- Bash 3.2 compatible: no declare -A, no readarray, no ${var,,}/${var^^}
|
|
16
|
+
- set -euo pipefail at top
|
|
17
|
+
- grep -c: use || true, then ${var:-0}
|
|
18
|
+
- Atomic writes: tmp + mv, never direct echo > file
|
|
19
|
+
- JSON: jq --arg, never string interpolation
|
|
20
|
+
- cd in functions: use subshells ( cd dir && ... )
|
|
21
|
+
- Check $NO_GITHUB before GitHub API calls
|
|
22
|
+
REMINDER
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
exit 0
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Hook: SessionStarted — Context loading on agent session start
|
|
3
|
+
|
|
4
|
+
# Show pipeline state if exists
|
|
5
|
+
if [[ -f ".claude/pipeline-state.md" ]]; then
|
|
6
|
+
echo "=== Active Pipeline ==="
|
|
7
|
+
head -20 ".claude/pipeline-state.md"
|
|
8
|
+
echo ""
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
# Show recent failures from memory
|
|
12
|
+
if [[ -x "scripts/sw-memory.sh" ]]; then
|
|
13
|
+
recent=$(bash scripts/sw-memory.sh show --recent 3 2>/dev/null) || true
|
|
14
|
+
if [[ -n "$recent" ]]; then
|
|
15
|
+
echo "=== Recent Failures ==="
|
|
16
|
+
echo "$recent" | head -10
|
|
17
|
+
echo ""
|
|
18
|
+
fi
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Show active issue count
|
|
22
|
+
if command -v gh &>/dev/null && [[ -z "${NO_GITHUB:-}" ]]; then
|
|
23
|
+
issue_count=$(gh issue list --label "shipwright" --state open --json number -q 'length' 2>/dev/null) || true
|
|
24
|
+
if [[ -n "$issue_count" ]]; then
|
|
25
|
+
echo "=== Active Issues: ${issue_count:-0} ==="
|
|
26
|
+
fi
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Show budget remaining
|
|
30
|
+
if [[ -x "scripts/sw-cost.sh" ]]; then
|
|
31
|
+
budget=$(bash scripts/sw-cost.sh remaining-budget 2>/dev/null) || true
|
|
32
|
+
if [[ -n "$budget" ]]; then
|
|
33
|
+
echo "=== Budget Remaining: $budget ==="
|
|
34
|
+
fi
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
exit 0
|