claude-everything-workflow 0.2.13 → 0.2.15

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 (51) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/AGENTS.md +13 -23
  4. package/commands/pr.md +1 -1
  5. package/docs/plugins.md +1 -1
  6. package/evals/routing-scenarios.json +19 -19
  7. package/harness/manifest.json +28 -62
  8. package/package.json +1 -1
  9. package/rules/common/performance.md +3 -1
  10. package/rules/common/testing.md +2 -8
  11. package/scripts/install-antigravity.js +242 -18
  12. package/scripts/retired-skill-files.json +25 -0
  13. package/scripts/upstream-capability-map.json +16 -13
  14. package/scripts/verify/install-rules.test.js +137 -3
  15. package/scripts/verify/skill-invocation.test.js +18 -2
  16. package/scripts/verify/skill-manifest-checks.js +1 -1
  17. package/scripts/verify/skill-manifest-checks.test.js +53 -0
  18. package/scripts/verify/workflow-checks.js +87 -8
  19. package/skills/README.md +2 -6
  20. package/skills/code-review/SKILL.md +1 -1
  21. package/skills/codebase-design/SKILL.md +7 -1
  22. package/skills/feature-acceptance/references/e2e-testing.md +8 -2
  23. package/skills/grilling/SKILL.md +1 -1
  24. package/skills/handoff/SKILL.md +2 -2
  25. package/skills/implement/SKILL.md +3 -2
  26. package/skills/resolving-merge-conflicts/SKILL.md +1 -1
  27. package/skills/spec-gate/SKILL.md +1 -1
  28. package/skills/systematic-debugging/SKILL.md +1 -1
  29. package/skills/systematic-debugging/references/diagnosing-bugs.upstream.md +1 -1
  30. package/skills/test-driven-development/SKILL.md +1 -1
  31. package/skills/to-tickets/SKILL.md +1 -1
  32. package/skills/triage/SKILL.md +2 -2
  33. package/skills/using-superpowers/SKILL.md +5 -5
  34. package/skills/using-superpowers/references/process-outcomes.md +1 -1
  35. package/skills/domain-modeling/SKILL.md +0 -103
  36. package/skills/improve-codebase-architecture/SKILL.md +0 -47
  37. package/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  38. package/skills/prototype/SKILL.md +0 -50
  39. package/skills/prototype/references/logic.md +0 -28
  40. package/skills/prototype/references/ui.md +0 -30
  41. package/skills/visual-companion/SKILL.md +0 -62
  42. package/skills/visual-companion/agents/openai.yaml +0 -4
  43. package/skills/visual-companion/references/guide.md +0 -298
  44. package/skills/visual-companion/scripts/frame-template.html +0 -243
  45. package/skills/visual-companion/scripts/helper.js +0 -167
  46. package/skills/visual-companion/scripts/pages.cjs +0 -28
  47. package/skills/visual-companion/scripts/server-utils.cjs +0 -82
  48. package/skills/visual-companion/scripts/server.cjs +0 -583
  49. package/skills/visual-companion/scripts/start-server.sh +0 -223
  50. package/skills/visual-companion/scripts/stop-server.sh +0 -120
  51. package/skills/visual-companion/scripts/websocket.cjs +0 -86
@@ -1,223 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Start the brainstorm server and output connection info
3
- # Usage: start-server.sh [--project-dir <path>] [--host <bind-host>]
4
- # [--url-host <display-host>] [--foreground] [--background]
5
- #
6
- # Starts server on a random high port, outputs JSON with URL.
7
- # Each session gets its own directory to avoid conflicts.
8
- #
9
- # Options:
10
- # --project-dir <path> Store session files under <path>/.superpowers/brainstorm/
11
- # instead of /tmp. Files persist after server stops.
12
- # --host <bind-host> Host/interface to bind (default: 127.0.0.1).
13
- # Use 0.0.0.0 in remote/containerized environments.
14
- # --url-host <host> Hostname shown in returned URL JSON.
15
- # --idle-timeout-minutes <n> Shut down after n minutes idle (default 240 = 4h).
16
- # --open Auto-open the browser on the first screen (use only
17
- # after the user approves the visual companion).
18
- # --foreground Run server in the current terminal (no backgrounding).
19
- # --background Force background mode (overrides Codex auto-foreground).
20
-
21
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
22
-
23
- # Parse arguments
24
- PROJECT_DIR=""
25
- FOREGROUND="false"
26
- FORCE_BACKGROUND="false"
27
- BIND_HOST="127.0.0.1"
28
- URL_HOST=""
29
- IDLE_TIMEOUT_MINUTES=""
30
- while [[ $# -gt 0 ]]; do
31
- case "$1" in
32
- --project-dir)
33
- PROJECT_DIR="$2"
34
- shift 2
35
- ;;
36
- --host)
37
- BIND_HOST="$2"
38
- shift 2
39
- ;;
40
- --url-host)
41
- URL_HOST="$2"
42
- shift 2
43
- ;;
44
- --idle-timeout-minutes)
45
- IDLE_TIMEOUT_MINUTES="$2"
46
- shift 2
47
- ;;
48
- --open)
49
- export BRAINSTORM_OPEN=1
50
- shift
51
- ;;
52
- --foreground|--no-daemon)
53
- FOREGROUND="true"
54
- shift
55
- ;;
56
- --background|--daemon)
57
- FORCE_BACKGROUND="true"
58
- shift
59
- ;;
60
- *)
61
- echo "{\"error\": \"Unknown argument: $1\"}"
62
- exit 1
63
- ;;
64
- esac
65
- done
66
-
67
- if [[ -z "$URL_HOST" ]]; then
68
- if [[ "$BIND_HOST" == "127.0.0.1" || "$BIND_HOST" == "localhost" ]]; then
69
- URL_HOST="localhost"
70
- else
71
- URL_HOST="$BIND_HOST"
72
- fi
73
- fi
74
-
75
- if [[ -n "$IDLE_TIMEOUT_MINUTES" ]]; then
76
- if ! [[ "$IDLE_TIMEOUT_MINUTES" =~ ^[0-9]+$ ]] || [[ "$IDLE_TIMEOUT_MINUTES" -lt 1 ]]; then
77
- echo "{\"error\": \"--idle-timeout-minutes must be a positive integer\"}"
78
- exit 1
79
- fi
80
- export BRAINSTORM_IDLE_TIMEOUT_MS=$(( IDLE_TIMEOUT_MINUTES * 60 * 1000 ))
81
- fi
82
-
83
- is_windows_like_shell() {
84
- case "${OSTYPE:-}" in
85
- msys*|cygwin*|mingw*) return 0 ;;
86
- esac
87
- if [[ -n "${MSYSTEM:-}" ]]; then
88
- return 0
89
- fi
90
- local uname_s
91
- uname_s="$(uname -s 2>/dev/null || true)"
92
- case "$uname_s" in
93
- MSYS*|MINGW*|CYGWIN*) return 0 ;;
94
- esac
95
- return 1
96
- }
97
-
98
- # Some environments reap detached/background processes. Auto-foreground when detected.
99
- if [[ -n "${CODEX_CI:-}" && "$FOREGROUND" != "true" && "$FORCE_BACKGROUND" != "true" ]]; then
100
- FOREGROUND="true"
101
- fi
102
-
103
- # Windows/Git Bash reaps nohup background processes. Auto-foreground when detected.
104
- if [[ "$FOREGROUND" != "true" && "$FORCE_BACKGROUND" != "true" ]]; then
105
- if is_windows_like_shell; then
106
- FOREGROUND="true"
107
- fi
108
- fi
109
-
110
- # Session files (server.log, server-info, .last-token) embed the session key —
111
- # keep everything this script and the server create owner-only.
112
- umask 077
113
-
114
- # Generate unique session directory
115
- SESSION_ID="$$-$(date +%s)"
116
-
117
- if [[ -n "$PROJECT_DIR" ]]; then
118
- SESSION_DIR="${PROJECT_DIR}/.superpowers/brainstorm/${SESSION_ID}"
119
- # Persist the bound port and key per project so a restart reuses them and an
120
- # already-open browser tab reconnects to the same URL with a valid cookie.
121
- export BRAINSTORM_PORT_FILE="${PROJECT_DIR}/.superpowers/brainstorm/.last-port"
122
- export BRAINSTORM_TOKEN_FILE="${PROJECT_DIR}/.superpowers/brainstorm/.last-token"
123
- else
124
- SESSION_DIR="/tmp/brainstorm-${SESSION_ID}"
125
- fi
126
-
127
- STATE_DIR="${SESSION_DIR}/state"
128
- PID_FILE="${STATE_DIR}/server.pid"
129
- LOG_FILE="${STATE_DIR}/server.log"
130
- SERVER_ID_FILE="${STATE_DIR}/server-instance-id"
131
-
132
- # Create fresh session directory with content and state peers
133
- mkdir -p "${SESSION_DIR}/content" "$STATE_DIR"
134
-
135
- SERVER_ID=""
136
- if [[ -r /dev/urandom ]]; then
137
- SERVER_ID="$(od -An -N24 -tx1 /dev/urandom 2>/dev/null | tr -d ' \n' || true)"
138
- fi
139
- if ! [[ "$SERVER_ID" =~ ^[A-Za-z0-9_-]{32,64}$ ]]; then
140
- SERVER_ID="$(printf '%08x%08x%08x%08x' "$$" "$(date +%s)" "${RANDOM:-0}" "${RANDOM:-0}")"
141
- fi
142
- printf '%s\n' "$SERVER_ID" > "$SERVER_ID_FILE"
143
- chmod 600 "$SERVER_ID_FILE" 2>/dev/null || true
144
-
145
- # Kill any existing server
146
- if [[ -f "$PID_FILE" ]]; then
147
- old_pid=$(cat "$PID_FILE")
148
- kill "$old_pid" 2>/dev/null
149
- rm -f "$PID_FILE"
150
- fi
151
-
152
- cd "$SCRIPT_DIR" || exit 1
153
-
154
- # Resolve the harness PID (grandparent of this script).
155
- # $PPID is the ephemeral shell the harness spawned to run us — it dies
156
- # when this script exits. The harness itself is $PPID's parent.
157
- OWNER_PID="$(ps -o ppid= -p "$PPID" 2>/dev/null | tr -d ' ')"
158
- if [[ -z "$OWNER_PID" || "$OWNER_PID" == "1" ]]; then
159
- OWNER_PID="$PPID"
160
- fi
161
-
162
- # Windows/MSYS2: Node.js cannot see POSIX PIDs from the MSYS2 namespace.
163
- # Passing a PID node cannot verify causes server to log owner-pid-invalid
164
- # and self-terminate at the 60-second lifecycle check. Clear it so the
165
- # watchdog is disabled and the idle timeout becomes the only shutdown trigger.
166
- if is_windows_like_shell; then
167
- OWNER_PID=""
168
- fi
169
-
170
- # Foreground mode for environments that reap detached/background processes.
171
- if [[ "$FOREGROUND" == "true" ]]; then
172
- env \
173
- BRAINSTORM_DIR="$SESSION_DIR" \
174
- BRAINSTORM_HOST="$BIND_HOST" \
175
- BRAINSTORM_URL_HOST="$URL_HOST" \
176
- BRAINSTORM_OWNER_PID="$OWNER_PID" \
177
- node server.cjs "--brainstorm-server-id=$SERVER_ID" &
178
- SERVER_PID=$!
179
- echo "$SERVER_PID" > "$PID_FILE"
180
- wait "$SERVER_PID"
181
- exit $?
182
- fi
183
-
184
- # Start server, capturing output to log file
185
- # Use nohup to survive shell exit; disown to remove from job table
186
- nohup env \
187
- BRAINSTORM_DIR="$SESSION_DIR" \
188
- BRAINSTORM_HOST="$BIND_HOST" \
189
- BRAINSTORM_URL_HOST="$URL_HOST" \
190
- BRAINSTORM_OWNER_PID="$OWNER_PID" \
191
- node server.cjs "--brainstorm-server-id=$SERVER_ID" > "$LOG_FILE" 2>&1 &
192
- SERVER_PID=$!
193
- disown "$SERVER_PID" 2>/dev/null
194
- echo "$SERVER_PID" > "$PID_FILE"
195
-
196
- # Wait for server-started message (check log file)
197
- for _ in {1..50}; do
198
- if grep -q "server-started" "$LOG_FILE" 2>/dev/null; then
199
- # Verify server is still alive after a short window (catches process reapers)
200
- alive="true"
201
- for _ in {1..20}; do
202
- if ! kill -0 "$SERVER_PID" 2>/dev/null; then
203
- alive="false"
204
- break
205
- fi
206
- sleep 0.1
207
- done
208
- if [[ "$alive" != "true" ]]; then
209
- persistent_command="$SCRIPT_DIR/start-server.sh"
210
- persistent_command+="${PROJECT_DIR:+ --project-dir $PROJECT_DIR}"
211
- persistent_command+=" --host $BIND_HOST --url-host $URL_HOST --foreground"
212
- echo "{\"error\": \"Server started but was killed. Retry in a persistent terminal with: $persistent_command\"}"
213
- exit 1
214
- fi
215
- grep "server-started" "$LOG_FILE" | head -1
216
- exit 0
217
- fi
218
- sleep 0.1
219
- done
220
-
221
- # Timeout - server didn't start
222
- echo '{"error": "Server failed to start within 5 seconds"}'
223
- exit 1
@@ -1,120 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Stop the brainstorm server and clean up
3
- # Usage: stop-server.sh <session_dir>
4
- #
5
- # Kills the server process. Only deletes session directory if it's
6
- # under /tmp (ephemeral). Persistent directories (.superpowers/) are
7
- # kept so mockups can be reviewed later.
8
-
9
- SESSION_DIR="$1"
10
-
11
- if [[ -z "$SESSION_DIR" ]]; then
12
- echo '{"error": "Usage: stop-server.sh <session_dir>"}'
13
- exit 1
14
- fi
15
-
16
- STATE_DIR="${SESSION_DIR}/state"
17
- PID_FILE="${STATE_DIR}/server.pid"
18
- SERVER_ID_FILE="${STATE_DIR}/server-instance-id"
19
-
20
- mark_stopped() {
21
- local reason="$1"
22
- rm -f "${STATE_DIR}/server-info"
23
- printf '{"reason":"%s","timestamp":%s}\n' "$reason" "$(date +%s)" > "${STATE_DIR}/server-stopped"
24
- }
25
-
26
- read_expected_server_id() {
27
- [[ -f "$SERVER_ID_FILE" ]] || return 1
28
- local id
29
- id="$(tr -d '\r\n' < "$SERVER_ID_FILE" 2>/dev/null || true)"
30
- [[ "$id" =~ ^[A-Za-z0-9_-]{32,64}$ ]] || return 1
31
- printf '%s\n' "$id"
32
- }
33
-
34
- command_line_for_pid() {
35
- local pid="$1"
36
- if [[ -r "/proc/$pid/cmdline" ]]; then
37
- tr '\0' '\n' < "/proc/$pid/cmdline" 2>/dev/null || true
38
- return 0
39
- fi
40
- ps -ww -p "$pid" -o command= 2>/dev/null || ps -f -p "$pid" 2>/dev/null | sed '1d' || true
41
- }
42
-
43
- command_has_server_id() {
44
- local pid="$1"
45
- local expected="$2"
46
- local expected_arg="--brainstorm-server-id=$expected"
47
- if [[ -r "/proc/$pid/cmdline" ]]; then
48
- local arg
49
- while IFS= read -r -d '' arg || [[ -n "$arg" ]]; do
50
- [[ "$arg" == "$expected_arg" ]] && return 0
51
- done < "/proc/$pid/cmdline"
52
- return 1
53
- fi
54
- local command_line
55
- command_line="$(command_line_for_pid "$pid")"
56
- [[ -n "$command_line" ]] || return 1
57
- case " $command_line " in
58
- *" $expected_arg "*) return 0 ;;
59
- *) return 1 ;;
60
- esac
61
- }
62
-
63
- # Confirm a PID has this session's per-start instance id, not just a familiar
64
- # process name. Ambiguous or legacy metadata fails closed as stale_pid.
65
- is_brainstorm_server() {
66
- kill -0 "$1" 2>/dev/null || return 1
67
- local expected_id
68
- expected_id="$(read_expected_server_id)" || return 1
69
- command_has_server_id "$1" "$expected_id" || return 1
70
- return 0
71
- }
72
-
73
- if [[ -f "$PID_FILE" ]]; then
74
- pid=$(cat "$PID_FILE")
75
-
76
- # Refuse to signal a PID we can't prove is our server. A stale pid file may
77
- # point at an unrelated process after a reboot/PID wraparound.
78
- if ! is_brainstorm_server "$pid"; then
79
- rm -f "$PID_FILE" "$SERVER_ID_FILE"
80
- mark_stopped "stale_pid"
81
- echo '{"status": "stale_pid"}'
82
- exit 0
83
- fi
84
-
85
- # Try to stop gracefully, fallback to force if still alive
86
- kill "$pid" 2>/dev/null || true
87
-
88
- # Wait for graceful shutdown (up to ~2s)
89
- for _ in {1..20}; do
90
- if ! kill -0 "$pid" 2>/dev/null; then
91
- break
92
- fi
93
- sleep 0.1
94
- done
95
-
96
- # If still running, escalate to SIGKILL
97
- if kill -0 "$pid" 2>/dev/null; then
98
- kill -9 "$pid" 2>/dev/null || true
99
-
100
- # Give SIGKILL a moment to take effect
101
- sleep 0.1
102
- fi
103
-
104
- if kill -0 "$pid" 2>/dev/null; then
105
- echo '{"status": "failed", "error": "process still running"}'
106
- exit 1
107
- fi
108
-
109
- rm -f "$PID_FILE" "$SERVER_ID_FILE" "${STATE_DIR}/server.log"
110
- mark_stopped "stop-server.sh"
111
-
112
- # Only delete ephemeral /tmp directories
113
- if [[ "$SESSION_DIR" == /tmp/* ]]; then
114
- rm -rf "$SESSION_DIR"
115
- fi
116
-
117
- echo '{"status": "stopped"}'
118
- else
119
- echo '{"status": "not_running"}'
120
- fi
@@ -1,86 +0,0 @@
1
- 'use strict';
2
-
3
- const crypto = require('crypto');
4
-
5
- const OPCODES = { TEXT: 0x01, CLOSE: 0x08, PING: 0x09, PONG: 0x0A };
6
- const WS_MAGIC = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';
7
- const MAX_FRAME_PAYLOAD_BYTES = 10 * 1024 * 1024;
8
-
9
- function computeAcceptKey(clientKey) {
10
- return crypto.createHash('sha1').update(clientKey + WS_MAGIC).digest('base64');
11
- }
12
-
13
- function encodeFrame(opcode, payload) {
14
- const fin = 0x80;
15
- const len = payload.length;
16
- let header;
17
-
18
- if (len < 126) {
19
- header = Buffer.alloc(2);
20
- header[0] = fin | opcode;
21
- header[1] = len;
22
- } else if (len < 65536) {
23
- header = Buffer.alloc(4);
24
- header[0] = fin | opcode;
25
- header[1] = 126;
26
- header.writeUInt16BE(len, 2);
27
- } else {
28
- header = Buffer.alloc(10);
29
- header[0] = fin | opcode;
30
- header[1] = 127;
31
- header.writeBigUInt64BE(BigInt(len), 2);
32
- }
33
-
34
- return Buffer.concat([header, payload]);
35
- }
36
-
37
- function decodeFrame(buffer) {
38
- if (buffer.length < 2) return null;
39
-
40
- const secondByte = buffer[1];
41
- const opcode = buffer[0] & 0x0F;
42
- const masked = (secondByte & 0x80) !== 0;
43
- let payloadLen = secondByte & 0x7F;
44
- let offset = 2;
45
-
46
- if (!masked) throw new Error('Client frames must be masked');
47
-
48
- if (payloadLen === 126) {
49
- if (buffer.length < 4) return null;
50
- payloadLen = buffer.readUInt16BE(2);
51
- offset = 4;
52
- } else if (payloadLen === 127) {
53
- if (buffer.length < 10) return null;
54
- const extendedLen = buffer.readBigUInt64BE(2);
55
- if (extendedLen > BigInt(MAX_FRAME_PAYLOAD_BYTES)) {
56
- throw new Error('WebSocket frame payload exceeds maximum allowed size');
57
- }
58
- payloadLen = Number(extendedLen);
59
- offset = 10;
60
- }
61
-
62
- if (payloadLen > MAX_FRAME_PAYLOAD_BYTES) {
63
- throw new Error('WebSocket frame payload exceeds maximum allowed size');
64
- }
65
-
66
- const maskOffset = offset;
67
- const dataOffset = offset + 4;
68
- const totalLen = dataOffset + payloadLen;
69
- if (buffer.length < totalLen) return null;
70
-
71
- const mask = buffer.slice(maskOffset, dataOffset);
72
- const data = Buffer.alloc(payloadLen);
73
- for (let index = 0; index < payloadLen; index += 1) {
74
- data[index] = buffer[dataOffset + index] ^ mask[index % 4];
75
- }
76
-
77
- return { opcode, payload: data, bytesConsumed: totalLen };
78
- }
79
-
80
- module.exports = {
81
- computeAcceptKey,
82
- encodeFrame,
83
- decodeFrame,
84
- OPCODES,
85
- MAX_FRAME_PAYLOAD_BYTES,
86
- };