claude-power-setup 1.0.2 → 1.1.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.
Binary file
@@ -0,0 +1,259 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 720" width="1280" height="720" fill="none">
2
+ <defs>
3
+ <!-- Background gradient -->
4
+ <linearGradient id="bg" x1="0" y1="0" x2="1280" y2="720" gradientUnits="userSpaceOnUse">
5
+ <stop offset="0%" stop-color="#0a0a1a"/>
6
+ <stop offset="60%" stop-color="#0d0d22"/>
7
+ <stop offset="100%" stop-color="#111133"/>
8
+ </linearGradient>
9
+
10
+ <!-- Title gradient: purple → cyan -->
11
+ <linearGradient id="titleGrad" x1="400" y1="260" x2="900" y2="380" gradientUnits="userSpaceOnUse">
12
+ <stop offset="0%" stop-color="#7c6aff"/>
13
+ <stop offset="100%" stop-color="#06b6d4"/>
14
+ </linearGradient>
15
+
16
+ <!-- Badge background -->
17
+ <linearGradient id="badgeBg" x1="390" y1="500" x2="890" y2="560" gradientUnits="userSpaceOnUse">
18
+ <stop offset="0%" stop-color="#7c6aff" stop-opacity="0.18"/>
19
+ <stop offset="100%" stop-color="#06b6d4" stop-opacity="0.12"/>
20
+ </linearGradient>
21
+
22
+ <!-- Orb glows -->
23
+ <radialGradient id="orbPurple" cx="50%" cy="50%" r="50%">
24
+ <stop offset="0%" stop-color="#7c6aff" stop-opacity="0.35"/>
25
+ <stop offset="100%" stop-color="#7c6aff" stop-opacity="0"/>
26
+ </radialGradient>
27
+ <radialGradient id="orbCyan" cx="50%" cy="50%" r="50%">
28
+ <stop offset="0%" stop-color="#06b6d4" stop-opacity="0.25"/>
29
+ <stop offset="100%" stop-color="#06b6d4" stop-opacity="0"/>
30
+ </radialGradient>
31
+ <radialGradient id="orbPink" cx="50%" cy="50%" r="50%">
32
+ <stop offset="0%" stop-color="#ec4899" stop-opacity="0.22"/>
33
+ <stop offset="100%" stop-color="#ec4899" stop-opacity="0"/>
34
+ </radialGradient>
35
+ <radialGradient id="orbGreen" cx="50%" cy="50%" r="50%">
36
+ <stop offset="0%" stop-color="#22c55e" stop-opacity="0.20"/>
37
+ <stop offset="100%" stop-color="#22c55e" stop-opacity="0"/>
38
+ </radialGradient>
39
+
40
+ <!-- Card border glow for agent nodes -->
41
+ <filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
42
+ <feGaussianBlur stdDeviation="6" result="blur"/>
43
+ <feComposite in="SourceGraphic" in2="blur" operator="over"/>
44
+ </filter>
45
+ <filter id="softGlow" x="-30%" y="-30%" width="160%" height="160%">
46
+ <feGaussianBlur stdDeviation="3" result="blur"/>
47
+ <feComposite in="SourceGraphic" in2="blur" operator="over"/>
48
+ </filter>
49
+ <filter id="textGlow" x="-10%" y="-30%" width="120%" height="180%">
50
+ <feGaussianBlur stdDeviation="8" result="blur"/>
51
+ <feColorMatrix in="blur" type="matrix" values="0 0 0 0 0.49 0 0 0 0 0.42 0 0 0 0 1 0 0 0 0.6 0" result="colorBlur"/>
52
+ <feComposite in="SourceGraphic" in2="colorBlur" operator="over"/>
53
+ </filter>
54
+ </defs>
55
+
56
+ <!-- ── Base ── -->
57
+ <rect width="1280" height="720" fill="url(#bg)"/>
58
+
59
+ <!-- ── Grid overlay ── -->
60
+ <rect width="1280" height="720" fill="none"
61
+ style="stroke: none;"
62
+ rx="0"/>
63
+ <!-- Grid lines are drawn manually for SVG compatibility -->
64
+ <!-- Vertical lines every 60px -->
65
+ <g stroke="rgba(124,106,255,0.04)" stroke-width="1">
66
+ <line x1="60" y1="0" x2="60" y2="720"/>
67
+ <line x1="120" y1="0" x2="120" y2="720"/>
68
+ <line x1="180" y1="0" x2="180" y2="720"/>
69
+ <line x1="240" y1="0" x2="240" y2="720"/>
70
+ <line x1="300" y1="0" x2="300" y2="720"/>
71
+ <line x1="360" y1="0" x2="360" y2="720"/>
72
+ <line x1="420" y1="0" x2="420" y2="720"/>
73
+ <line x1="480" y1="0" x2="480" y2="720"/>
74
+ <line x1="540" y1="0" x2="540" y2="720"/>
75
+ <line x1="600" y1="0" x2="600" y2="720"/>
76
+ <line x1="660" y1="0" x2="660" y2="720"/>
77
+ <line x1="720" y1="0" x2="720" y2="720"/>
78
+ <line x1="780" y1="0" x2="780" y2="720"/>
79
+ <line x1="840" y1="0" x2="840" y2="720"/>
80
+ <line x1="900" y1="0" x2="900" y2="720"/>
81
+ <line x1="960" y1="0" x2="960" y2="720"/>
82
+ <line x1="1020" y1="0" x2="1020" y2="720"/>
83
+ <line x1="1080" y1="0" x2="1080" y2="720"/>
84
+ <line x1="1140" y1="0" x2="1140" y2="720"/>
85
+ <line x1="1200" y1="0" x2="1200" y2="720"/>
86
+ <!-- Horizontal lines every 60px -->
87
+ <line x1="0" y1="60" x2="1280" y2="60"/>
88
+ <line x1="0" y1="120" x2="1280" y2="120"/>
89
+ <line x1="0" y1="180" x2="1280" y2="180"/>
90
+ <line x1="0" y1="240" x2="1280" y2="240"/>
91
+ <line x1="0" y1="300" x2="1280" y2="300"/>
92
+ <line x1="0" y1="360" x2="1280" y2="360"/>
93
+ <line x1="0" y1="420" x2="1280" y2="420"/>
94
+ <line x1="0" y1="480" x2="1280" y2="480"/>
95
+ <line x1="0" y1="540" x2="1280" y2="540"/>
96
+ <line x1="0" y1="600" x2="1280" y2="600"/>
97
+ <line x1="0" y1="660" x2="1280" y2="660"/>
98
+ </g>
99
+
100
+ <!-- ── Glowing orbs ── -->
101
+ <ellipse cx="180" cy="200" rx="340" ry="280" fill="url(#orbPurple)"/>
102
+ <ellipse cx="1160" cy="560" rx="300" ry="260" fill="url(#orbCyan)"/>
103
+ <ellipse cx="1100" cy="140" rx="200" ry="180" fill="url(#orbPink)"/>
104
+ <ellipse cx="220" cy="620" rx="220" ry="180" fill="url(#orbGreen)"/>
105
+
106
+ <!-- ── Left side: Agent node diagram ── -->
107
+ <!-- Orchestrator node -->
108
+ <rect x="52" y="220" width="164" height="56" rx="10"
109
+ fill="rgba(124,106,255,0.12)" stroke="rgba(124,106,255,0.5)" stroke-width="1.5"/>
110
+ <circle cx="76" cy="248" r="8" fill="#7c6aff" opacity="0.9"/>
111
+ <text x="92" y="244" font-family="system-ui, -apple-system, sans-serif" font-size="13" font-weight="600" fill="#a78bfa">Orchestrator</text>
112
+ <text x="92" y="258" font-family="ui-monospace, monospace" font-size="11" fill="rgba(148,163,184,0.7)">planner agent</text>
113
+
114
+ <!-- Connector lines from orchestrator -->
115
+ <line x1="134" y1="276" x2="134" y2="318" stroke="rgba(124,106,255,0.4)" stroke-width="1.5" stroke-dasharray="4 3"/>
116
+ <line x1="90" y1="276" x2="60" y2="318" stroke="rgba(6,182,212,0.4)" stroke-width="1.5" stroke-dasharray="4 3"/>
117
+ <line x1="178" y1="276" x2="208" y2="318" stroke="rgba(236,72,153,0.4)" stroke-width="1.5" stroke-dasharray="4 3"/>
118
+
119
+ <!-- Worker node 1: code-reviewer -->
120
+ <rect x="52" y="318" width="148" height="52" rx="9"
121
+ fill="rgba(6,182,212,0.10)" stroke="rgba(6,182,212,0.4)" stroke-width="1.5"/>
122
+ <circle cx="73" cy="344" r="6" fill="#06b6d4" opacity="0.85"/>
123
+ <text x="86" y="340" font-family="system-ui, sans-serif" font-size="12" font-weight="600" fill="#67e8f9">code-reviewer</text>
124
+ <text x="86" y="354" font-family="ui-monospace, monospace" font-size="10" fill="rgba(148,163,184,0.65)">quality gate</text>
125
+
126
+ <!-- Worker node 2: security -->
127
+ <rect x="52" y="388" width="148" height="52" rx="9"
128
+ fill="rgba(236,72,153,0.10)" stroke="rgba(236,72,153,0.35)" stroke-width="1.5"/>
129
+ <circle cx="73" cy="414" r="6" fill="#ec4899" opacity="0.85"/>
130
+ <text x="86" y="410" font-family="system-ui, sans-serif" font-size="12" font-weight="600" fill="#f9a8d4">security-reviewer</text>
131
+ <text x="86" y="424" font-family="ui-monospace, monospace" font-size="10" fill="rgba(148,163,184,0.65)">OWASP scan</text>
132
+
133
+ <!-- Worker node 3: tdd-guide -->
134
+ <rect x="52" y="458" width="148" height="52" rx="9"
135
+ fill="rgba(34,197,94,0.09)" stroke="rgba(34,197,94,0.35)" stroke-width="1.5"/>
136
+ <circle cx="73" cy="484" r="6" fill="#22c55e" opacity="0.85"/>
137
+ <text x="86" y="480" font-family="system-ui, sans-serif" font-size="12" font-weight="600" fill="#86efac">tdd-guide</text>
138
+ <text x="86" y="494" font-family="ui-monospace, monospace" font-size="10" fill="rgba(148,163,184,0.65)">test coverage</text>
139
+
140
+ <!-- Vertical connector bar on left -->
141
+ <line x1="42" y1="318" x2="42" y2="510" stroke="rgba(124,106,255,0.25)" stroke-width="2"/>
142
+ <circle cx="42" cy="344" r="3" fill="#7c6aff" opacity="0.6"/>
143
+ <circle cx="42" cy="414" r="3" fill="#ec4899" opacity="0.6"/>
144
+ <circle cx="42" cy="484" r="3" fill="#22c55e" opacity="0.6"/>
145
+
146
+ <!-- ── Right side: output / pipeline ── -->
147
+ <!-- Pipeline step 1 -->
148
+ <rect x="1052" y="200" width="192" height="52" rx="9"
149
+ fill="rgba(124,106,255,0.10)" stroke="rgba(124,106,255,0.35)" stroke-width="1.5"/>
150
+ <text x="1148" y="222" text-anchor="middle" font-family="system-ui, sans-serif" font-size="11" font-weight="700" fill="#a78bfa" letter-spacing="2">PLAN</text>
151
+ <text x="1148" y="240" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="rgba(148,163,184,0.65)">architect + planner</text>
152
+
153
+ <line x1="1148" y1="252" x2="1148" y2="278" stroke="rgba(124,106,255,0.4)" stroke-width="1.5" stroke-dasharray="4 3"/>
154
+
155
+ <!-- Pipeline step 2 -->
156
+ <rect x="1052" y="278" width="192" height="52" rx="9"
157
+ fill="rgba(6,182,212,0.09)" stroke="rgba(6,182,212,0.35)" stroke-width="1.5"/>
158
+ <text x="1148" y="300" text-anchor="middle" font-family="system-ui, sans-serif" font-size="11" font-weight="700" fill="#67e8f9" letter-spacing="2">BUILD</text>
159
+ <text x="1148" y="318" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="rgba(148,163,184,0.65)">tdd-guide + impl</text>
160
+
161
+ <line x1="1148" y1="330" x2="1148" y2="356" stroke="rgba(6,182,212,0.4)" stroke-width="1.5" stroke-dasharray="4 3"/>
162
+
163
+ <!-- Pipeline step 3 -->
164
+ <rect x="1052" y="356" width="192" height="52" rx="9"
165
+ fill="rgba(236,72,153,0.09)" stroke="rgba(236,72,153,0.35)" stroke-width="1.5"/>
166
+ <text x="1148" y="378" text-anchor="middle" font-family="system-ui, sans-serif" font-size="11" font-weight="700" fill="#f9a8d4" letter-spacing="2">REVIEW</text>
167
+ <text x="1148" y="396" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="rgba(148,163,184,0.65)">security + quality</text>
168
+
169
+ <line x1="1148" y1="408" x2="1148" y2="434" stroke="rgba(236,72,153,0.4)" stroke-width="1.5" stroke-dasharray="4 3"/>
170
+
171
+ <!-- Pipeline step 4 -->
172
+ <rect x="1052" y="434" width="192" height="52" rx="9"
173
+ fill="rgba(34,197,94,0.09)" stroke="rgba(34,197,94,0.35)" stroke-width="1.5"/>
174
+ <text x="1148" y="456" text-anchor="middle" font-family="system-ui, sans-serif" font-size="11" font-weight="700" fill="#86efac" letter-spacing="2">SHIP</text>
175
+ <text x="1148" y="474" text-anchor="middle" font-family="ui-monospace, monospace" font-size="10" fill="rgba(148,163,184,0.65)">git + deploy</text>
176
+
177
+ <!-- ── Center: Main content ── -->
178
+ <!-- Label badge top -->
179
+ <rect x="496" y="128" width="288" height="34" rx="17"
180
+ fill="rgba(124,106,255,0.12)" stroke="rgba(124,106,255,0.35)" stroke-width="1"/>
181
+ <circle cx="518" cy="145" r="5" fill="#7c6aff"/>
182
+ <text x="532" y="150" font-family="system-ui, -apple-system, sans-serif" font-size="13" font-weight="600" fill="#a78bfa" letter-spacing="1.5">CLAUDE CODE POWER LAYER</text>
183
+
184
+ <!-- Decorative horizontal rule under badge -->
185
+ <line x1="540" y1="176" x2="740" y2="176" stroke="url(#titleGrad)" stroke-width="1" opacity="0.5"/>
186
+
187
+ <!-- Main title line 1: CLAUDE -->
188
+ <text x="640" y="285"
189
+ text-anchor="middle"
190
+ font-family="system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif"
191
+ font-size="110" font-weight="800"
192
+ letter-spacing="-3px"
193
+ fill="#ffffff"
194
+ filter="url(#textGlow)">CLAUDE</text>
195
+
196
+ <!-- Main title line 2: POWER SETUP — gradient fill -->
197
+ <text x="640" y="390"
198
+ text-anchor="middle"
199
+ font-family="system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif"
200
+ font-size="110" font-weight="800"
201
+ letter-spacing="-3px"
202
+ fill="url(#titleGrad)"
203
+ filter="url(#textGlow)">POWER SETUP</text>
204
+
205
+ <!-- Subtitle -->
206
+ <text x="640" y="445"
207
+ text-anchor="middle"
208
+ font-family="system-ui, -apple-system, sans-serif"
209
+ font-size="22" font-weight="400"
210
+ fill="rgba(148,163,184,0.85)"
211
+ letter-spacing="0.5px">Multi-agent orchestration · automation pipelines · self-improvement</text>
212
+
213
+ <!-- Install badge -->
214
+ <rect x="380" y="480" width="520" height="58" rx="12"
215
+ fill="url(#badgeBg)" stroke="rgba(124,106,255,0.4)" stroke-width="1.5"/>
216
+ <!-- Prompt dollar sign -->
217
+ <text x="410" y="517"
218
+ font-family="'Courier New', 'SF Mono', ui-monospace, monospace"
219
+ font-size="22" font-weight="700"
220
+ fill="#7c6aff">$</text>
221
+ <text x="432" y="517"
222
+ font-family="'Courier New', 'SF Mono', ui-monospace, monospace"
223
+ font-size="22" font-weight="400"
224
+ fill="#a78bfa"
225
+ letter-spacing="0.5px">npx claude-power-setup</text>
226
+ <!-- Blinking cursor simulation -->
227
+ <rect x="866" y="498" width="12" height="22" rx="2" fill="#a78bfa" opacity="0.7"/>
228
+
229
+ <!-- Stats row -->
230
+ <g font-family="system-ui, -apple-system, sans-serif" font-size="14" fill="rgba(148,163,184,0.6)">
231
+ <text x="640" y="572" text-anchor="middle">
232
+ <tspan fill="#7c6aff" font-weight="700">10+</tspan>
233
+ <tspan dx="4">specialized agents </tspan>
234
+ <tspan fill="rgba(124,106,255,0.4)">·</tspan>
235
+ <tspan dx="4" fill="#06b6d4" font-weight="700">parallel</tspan>
236
+ <tspan dx="4">execution </tspan>
237
+ <tspan fill="rgba(124,106,255,0.4)">·</tspan>
238
+ <tspan dx="4" fill="#22c55e" font-weight="700">npm</tspan>
239
+ <tspan dx="4">installable</tspan>
240
+ </text>
241
+ </g>
242
+
243
+ <!-- Bottom: subtle npm badge -->
244
+ <rect x="556" y="600" width="168" height="34" rx="8"
245
+ fill="rgba(255,255,255,0.04)" stroke="rgba(255,255,255,0.08)" stroke-width="1"/>
246
+ <text x="640" y="622" text-anchor="middle"
247
+ font-family="ui-monospace, monospace" font-size="13" fill="rgba(148,163,184,0.5)"
248
+ letter-spacing="1px">claude-power-setup</text>
249
+
250
+ <!-- Edge fade vignette -->
251
+ <rect width="1280" height="720"
252
+ fill="url(#vignette)" opacity="0.4"/>
253
+ <defs>
254
+ <radialGradient id="vignette" cx="50%" cy="50%" r="70%">
255
+ <stop offset="0%" stop-color="transparent"/>
256
+ <stop offset="100%" stop-color="#000000"/>
257
+ </radialGradient>
258
+ </defs>
259
+ </svg>
@@ -3,12 +3,23 @@
3
3
  # Source this in your .bashrc or .bash_profile:
4
4
  # source ~/.claude/bin/claude-aliases.sh
5
5
 
6
+ # ── Helper: launch Claude with a context profile ─────────
7
+ _claude_with_context() {
8
+ local ctx="$HOME/.claude/contexts/$1"
9
+ if [ ! -f "$ctx" ]; then
10
+ echo "[!] Context profile not found: $ctx" >&2
11
+ echo " Run claude-power-setup to reinstall." >&2
12
+ return 1
13
+ fi
14
+ claude --system-prompt "$(cat "$ctx")"
15
+ }
16
+
6
17
  # ── Mode-Switched Claude Sessions ──────────────────────────
7
18
  alias c='claude'
8
- alias cdev='claude --system-prompt "$(cat ~/.claude/contexts/dev.md)"'
9
- alias corchestrate='claude --system-prompt "$(cat ~/.claude/contexts/orchestrate.md)"'
10
- alias creview='claude --system-prompt "$(cat ~/.claude/contexts/review.md)"'
11
- alias cresearch='claude --system-prompt "$(cat ~/.claude/contexts/research.md)"'
19
+ alias cdev='_claude_with_context dev.md'
20
+ alias corchestrate='_claude_with_context orchestrate.md'
21
+ alias creview='_claude_with_context review.md'
22
+ alias cresearch='_claude_with_context research.md'
12
23
 
13
24
  # ── Quick Non-Interactive Pipelines ────────────────────────
14
25
  alias cfix='claude -p "Run build + lint + tests. Fix any failures. Do not add features."'
@@ -50,11 +61,11 @@ crouted() {
50
61
  # ── Worktree Helpers ──────────────────────────────────────
51
62
  # Usage: cwt feature-auth "Implement JWT authentication"
52
63
  cwt() {
53
- local name="$1"
54
- local task="$2"
64
+ local name="${1:?Usage: cwt <name> [task]}"
65
+ local task="${2:-}"
55
66
  git worktree add -b "feat/${name}" "../${PWD##*/}-${name}" HEAD
56
- echo "Worktree created: ../$(basename $PWD)-${name}"
57
- echo "Run: cd ../$(basename $PWD)-${name} && claude"
67
+ echo "Worktree created: ../$(basename "$PWD")-${name}"
68
+ echo "Run: cd ../$(basename "$PWD")-${name} && claude"
58
69
  if [ -n "$task" ]; then
59
70
  (cd "../${PWD##*/}-${name}" && claude -p "$task")
60
71
  fi
@@ -62,7 +73,7 @@ cwt() {
62
73
 
63
74
  # Clean up worktree after merge
64
75
  cwt-clean() {
65
- local name="$1"
76
+ local name="${1:?Usage: cwt-clean <name>}"
66
77
  git worktree remove "../${PWD##*/}-${name}" 2>/dev/null
67
78
  git branch -d "feat/${name}" 2>/dev/null
68
79
  echo "Cleaned: ${name}"
@@ -14,14 +14,14 @@ shift
14
14
 
15
15
  MAX_RUNS=5
16
16
  MODE="safe"
17
- MODEL=""
17
+ MODEL_ARGS=()
18
18
  NOTES_FILE="SHARED_TASK_NOTES.md"
19
19
 
20
20
  while [[ $# -gt 0 ]]; do
21
21
  case "$1" in
22
22
  --max-runs) MAX_RUNS="$2"; shift 2 ;;
23
23
  --mode) MODE="$2"; shift 2 ;;
24
- --model) MODEL="--model $2"; shift 2 ;;
24
+ --model) MODEL_ARGS=(--model "$2"); shift 2 ;;
25
25
  *) echo "Unknown flag: $1"; exit 1 ;;
26
26
  esac
27
27
  done
@@ -30,7 +30,7 @@ echo "=== Claude Loop ==="
30
30
  echo "Prompt: ${PROMPT}"
31
31
  echo "Max runs: ${MAX_RUNS}"
32
32
  echo "Mode: ${MODE}"
33
- echo "Model: ${MODEL:-default}"
33
+ echo "Model: ${MODEL_ARGS[*]:-default}"
34
34
  echo ""
35
35
 
36
36
  # Initialize shared notes
@@ -52,7 +52,9 @@ if [ "$MODE" = "safe" ]; then
52
52
  QUALITY_GATE='After implementation, run the full build + lint + test suite. Fix any failures before completing.'
53
53
  fi
54
54
 
55
+ COMPLETED=0
55
56
  for i in $(seq 1 "$MAX_RUNS"); do
57
+ COMPLETED=$i
56
58
  echo ""
57
59
  echo "━━━ Iteration ${i}/${MAX_RUNS} ━━━"
58
60
 
@@ -69,16 +71,16 @@ After completing your work:
69
71
  2. If the task is fully complete, include the line: LOOP_COMPLETE
70
72
  3. Commit your changes with a conventional commit message"
71
73
 
72
- claude -p $MODEL "$ITERATION_PROMPT"
74
+ claude -p "${MODEL_ARGS[@]}" "$ITERATION_PROMPT"
73
75
 
74
76
  # Check for completion signal
75
77
  if grep -q "LOOP_COMPLETE" "$NOTES_FILE" 2>/dev/null; then
76
78
  echo ""
77
- echo "=== Loop completed at iteration ${i} (task signaled complete) ==="
79
+ echo "=== Loop completed at iteration ${COMPLETED} (task signaled complete) ==="
78
80
  break
79
81
  fi
80
82
  done
81
83
 
82
84
  echo ""
83
- echo "=== Loop finished after ${i} iterations ==="
84
- echo "Notes: $(cat "$NOTES_FILE" | head -20)"
85
+ echo "=== Loop finished after ${COMPLETED} iterations ==="
86
+ echo "Notes: $(head -20 "$NOTES_FILE")"
package/cli.js CHANGED
@@ -14,7 +14,7 @@ const os = require("os");
14
14
 
15
15
  const SCRIPT_DIR = __dirname;
16
16
  const CLAUDE_HOME = path.join(os.homedir(), ".claude");
17
- const VERSION = "1.0.0";
17
+ const VERSION = require("./package.json").version;
18
18
 
19
19
  const args = process.argv.slice(2);
20
20
 
package/install.ps1 CHANGED
@@ -29,10 +29,17 @@ param(
29
29
  [switch]$Help
30
30
  )
31
31
 
32
- $Version = "1.0.0"
33
32
  $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
34
33
  $ClaudeHome = Join-Path $env:USERPROFILE ".claude"
35
34
 
35
+ # Read version from package.json (single source of truth)
36
+ try {
37
+ $PkgJson = Get-Content (Join-Path $ScriptDir "package.json") -Raw | ConvertFrom-Json
38
+ $Version = $PkgJson.version
39
+ } catch {
40
+ $Version = "0.0.0"
41
+ }
42
+
36
43
  if ($Help) {
37
44
  Get-Help $MyInvocation.MyCommand.Definition -Detailed
38
45
  exit 0
@@ -165,6 +172,63 @@ if (-not $DryRun -and (Test-Path $SettingsFile) -and (Test-Path $EnvFile)) {
165
172
  Write-Host "[i] WOULD MERGE: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS, ECC_HOOK_PROFILE, CLAUDE_CODE_ENABLE_COST_TRACKING" -ForegroundColor Cyan
166
173
  }
167
174
 
175
+ # ── Observer config ──────────────────────────────────────────
176
+ Write-Host "`nConfiguring continuous learning observer..." -ForegroundColor White
177
+ $ObserverSrc = Join-Path $ScriptDir "config\observer-config.json"
178
+ $ObserverUpdated = $false
179
+
180
+ $CLv2Paths = @(
181
+ (Join-Path $ClaudeHome "skills\continuous-learning-v2\config.json")
182
+ )
183
+ # Also check plugin cache paths
184
+ $PluginCachePath = Join-Path $ClaudeHome "plugins\cache\everything-claude-code"
185
+ if (Test-Path $PluginCachePath) {
186
+ Get-ChildItem $PluginCachePath -Directory | ForEach-Object {
187
+ $CandidatePath = Join-Path $_.FullName "latest\skills\continuous-learning-v2\config.json"
188
+ $CLv2Paths += $CandidatePath
189
+ }
190
+ }
191
+
192
+ foreach ($ConfigPath in $CLv2Paths) {
193
+ if (Test-Path $ConfigPath) {
194
+ if ($DryRun) {
195
+ Write-Host "[i] WOULD UPDATE: $ConfigPath (observer.enabled=true)" -ForegroundColor Cyan
196
+ } else {
197
+ try {
198
+ $ObserverConfig = Get-Content $ObserverSrc -Raw | ConvertFrom-Json
199
+ $ExistingConfig = Get-Content $ConfigPath -Raw | ConvertFrom-Json
200
+ # Merge: only set observer.enabled, preserve other keys
201
+ if (-not $ExistingConfig.observer) {
202
+ $ExistingConfig | Add-Member -Type NoteProperty -Name "observer" -Value ([PSCustomObject]@{})
203
+ }
204
+ $ExistingConfig.observer | Add-Member -Type NoteProperty -Name "enabled" -Value $true -Force
205
+ $ExistingConfig | ConvertTo-Json -Depth 10 | Set-Content $ConfigPath -Encoding UTF8
206
+ Write-Host "[+] Observer enabled: $ConfigPath" -ForegroundColor Green
207
+ } catch {
208
+ Write-Host "[!] Could not update observer config: $_" -ForegroundColor Yellow
209
+ }
210
+ }
211
+ $ObserverUpdated = $true
212
+ break
213
+ }
214
+ }
215
+
216
+ if (-not $ObserverUpdated) {
217
+ Write-Host "[!] CLv2 config not found - observer not configured (install ECC first)" -ForegroundColor Yellow
218
+ }
219
+
220
+ # ── Write marker file ────────────────────────────────────────
221
+ if (-not $DryRun) {
222
+ $Marker = @{
223
+ version = $Version
224
+ installed_at = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
225
+ platform = "windows"
226
+ installer = "powershell"
227
+ components = @("contexts", "bin-scripts", "instincts", "env-settings", "observer-config", "reference-doc")
228
+ }
229
+ $Marker | ConvertTo-Json -Depth 5 | Set-Content (Join-Path $ClaudeHome ".claude-power-setup-installed") -Encoding UTF8
230
+ }
231
+
168
232
  # ── Summary ───────────────────────────────────────────────────
169
233
  Write-Host ""
170
234
  Write-Host " Installation Complete" -ForegroundColor Green
package/install.sh CHANGED
@@ -9,11 +9,17 @@
9
9
 
10
10
  set -euo pipefail
11
11
 
12
- VERSION="1.0.1"
13
12
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14
13
  CLAUDE_HOME="${HOME}/.claude"
15
14
  MARKER_FILE="${CLAUDE_HOME}/.claude-power-setup-installed"
16
15
 
16
+ # Read version from package.json (single source of truth)
17
+ if command -v node &>/dev/null; then
18
+ VERSION="$(node -e "console.log(require('${SCRIPT_DIR}/package.json').version)" 2>/dev/null || echo "0.0.0")"
19
+ else
20
+ VERSION="$(grep '"version"' "${SCRIPT_DIR}/package.json" | head -1 | sed 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/')"
21
+ fi
22
+
17
23
  # ── Colors ─────────────────────────────────────────────────────
18
24
  RED='\033[0;31m'
19
25
  GREEN='\033[0;32m'
@@ -350,8 +356,20 @@ for config_path in "${CLV2_CONFIG_PATHS[@]}"; do
350
356
  for resolved in $config_path; do
351
357
  if [ -f "$resolved" ]; then
352
358
  if [ "$DRY_RUN" = false ]; then
353
- cp "${SCRIPT_DIR}/config/observer-config.json" "$resolved"
354
- log "Observer enabled: $(basename "$(dirname "$(dirname "$resolved")")")/config.json"
359
+ # Merge observer.enabled=true without clobbering other keys
360
+ NODE_RESOLVED="$resolved"
361
+ if command -v cygpath &>/dev/null; then
362
+ NODE_RESOLVED="$(cygpath -w "$resolved")"
363
+ fi
364
+ node -e "
365
+ const fs = require('fs');
366
+ const config = JSON.parse(fs.readFileSync(process.argv[1], 'utf8'));
367
+ if (!config.observer) config.observer = {};
368
+ config.observer.enabled = true;
369
+ fs.writeFileSync(process.argv[1], JSON.stringify(config, null, 2) + '\n');
370
+ " "$NODE_RESOLVED" 2>/dev/null && \
371
+ log "Observer enabled: $(basename "$(dirname "$(dirname "$resolved")")")/config.json" || \
372
+ warn "Could not update observer config"
355
373
  OBSERVER_UPDATED=true
356
374
  else
357
375
  info "WOULD UPDATE: $resolved (observer.enabled=true)"
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "claude-power-setup",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Multi-agent orchestration, automation pipelines, and self-improvement for Claude Code",
5
5
  "bin": {
6
6
  "claude-power-setup": "cli.js"
7
7
  },
8
+ "scripts": {
9
+ "test": "node --test test/*.test.js"
10
+ },
8
11
  "keywords": [
9
12
  "claude",
10
13
  "claude-code",
@@ -34,16 +37,5 @@
34
37
  "repository": {
35
38
  "type": "git",
36
39
  "url": "git+https://github.com/shyamsridhar123/claude-power-setup.git"
37
- },
38
- "dependencies": {
39
- "@remotion/cli": "^4.0.445",
40
- "react": "^19.2.4",
41
- "react-dom": "^19.2.4",
42
- "remotion": "^4.0.445"
43
- },
44
- "devDependencies": {
45
- "@types/react": "^19.2.14",
46
- "@types/react-dom": "^19.2.3",
47
- "typescript": "^6.0.2"
48
40
  }
49
41
  }
@@ -72,53 +72,52 @@ caudit # Security scan + harness audit
72
72
  ## Architecture: The Full Stack
73
73
 
74
74
  ```
75
- ┌─────────────────────────────────────────────────────────────┐
76
- YOU (the developer)
77
- ├─────────────────────────────────────────────────────────────┤
78
- │ MODE SELECTION (context profiles) │
79
- │ cdev | corchestrate | creview | cresearch │
80
- ├─────────────────────────────────────────────────────────────┤
81
- ORCHESTRATION LAYER
82
- │ ┌──────────┐ ┌──────────┐ ┌───────────┐ ┌──────────────┐ │
83
- │ │ Agent Swarm Santa Multi-Model │ │
84
- │ │ Teams Mode Loop Workflow │ │
85
- │ │(natives) │ │(TeamTool) (dual rev) (Claude+Codex)│ │
86
- │ └──────────┘ └──────────┘ └───────────┘ └──────────────┘ │
87
- ├─────────────────────────────────────────────────────────────┤
88
- LOOP ENGINE
89
- │ ┌───────────┐ ┌────────────┐ ┌──────────┐ ┌────────────┐ │
90
- │ │Sequential Continuous Infinite Ralphinho │ │
91
- │Pipeline │ PR Loop Agentic RFC DAG │ │
92
- │ │(claude -p) (CI gates) (waves) (merge que) │ │
93
- │ └───────────┘ └────────────┘ └──────────┘ └────────────┘ │
94
- ├─────────────────────────────────────────────────────────────┤
95
- QUALITY LAYER
96
- │ ┌───────────┐ ┌────────┐ ┌──────────┐ ┌────────────────┐ │
97
- │ │ TDD Verify De-Slop Quality Gate │ │
98
- │ │ Guide Loop Pass (PostToolUse) │ │
99
- │ └───────────┘ └────────┘ └──────────┘ └────────────────┘ │
100
- ├─────────────────────────────────────────────────────────────┤
101
- MEMORY & LEARNING
102
- │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
103
- │ │ Session Save Instincts Strategic │ │
104
- │ │ /Resume (v2.1) Compact │ │
105
- │ │ ~/.claude/ observe -> (phase-aware) │ │
106
- │ │ session-data/ score -> │ │
107
- │ │ │ promote -> │ │
108
- │ │ │ evolve │ │
109
- │ └──────────────┘ └──────────────┘ └──────────────────┘ │
110
- ├─────────────────────────────────────────────────────────────┤
111
- SECURITY & HOOKS
112
- │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
113
- │ │ PreToolUse PostToolUse Stop / Session │ │
114
- │ │ - security - quality - session save │ │
115
- │ │ - config prot - cost track - evaluate │ │
116
- │ │ - commit qual - build notif - cost report │ │
117
- │ │ - observe - observe - desktop notify │ │
118
- │ └──────────────┘ └──────────────┘ └──────────────────┘ │
119
- ├─────────────────────────────────────────────────────────────┤
120
- 38 AGENTS 200+ SKILLS 30+ HOOKS 12 LANG RULES
121
- └─────────────────────────────────────────────────────────────┘
75
+ +-----------------------------------------------------------+
76
+ | YOU (the developer) |
77
+ +-----------------------------------------------------------+
78
+ | MODES: cdev | orchestrate | creview | cresearch |
79
+ +-----------------------------------------------------------+
80
+
81
+ ORCHESTRATION LAYER
82
+ +----------+ +----------+ +-----------+ +--------------+
83
+ | Agent | | Swarm | | Santa | | Multi-Model |
84
+ | Teams | | Mode | | Loop | | Workflow |
85
+ | (natives)| |(TeamTool)| |(dual rev) | |(Claude+Codex)|
86
+ +----------+ +----------+ +-----------+ +--------------+
87
+
88
+ LOOP ENGINE
89
+ +-----------+ +------------+ +----------+ +------------+
90
+ | Sequential| | Continuous | | Infinite | | Ralphinho |
91
+ | Pipeline | | PR Loop | | Agentic | | RFC DAG |
92
+ | (claude-p)| | (CI gates) | | (waves) | |(merge que) |
93
+ +-----------+ +------------+ +----------+ +------------+
94
+
95
+ QUALITY LAYER
96
+ +-----------+ +--------+ +----------+ +----------------+
97
+ | TDD | | Verify | | De-Slop | | Quality Gate |
98
+ | Guide | | Loop | | Pass | | (PostToolUse) |
99
+ +-----------+ +--------+ +----------+ +----------------+
100
+
101
+ MEMORY & LEARNING
102
+ +--------------+ +--------------+ +------------------+
103
+ | Session Save | | Instincts | | Strategic |
104
+ | /Resume | | (v2.1) | | Compact |
105
+ | ~/.claude/ | | observe -> | | (phase-aware) |
106
+ | session-data/| | score -> | | |
107
+ | | | promote -> | | |
108
+ | | | evolve | | |
109
+ +--------------+ +--------------+ +------------------+
110
+
111
+ SECURITY & HOOKS
112
+ +--------------+ +--------------+ +------------------+
113
+ | PreToolUse | | PostToolUse | | Stop / Session |
114
+ | - security | | - quality | | - session save |
115
+ | - config prot| | - cost track | | - evaluate |
116
+ | - commit qual| | - build notif| | - cost report |
117
+ | - observe | | - observe | | - desktop notify |
118
+ +--------------+ +--------------+ +------------------+
119
+
120
+ 38 AGENTS | 200+ SKILLS | 30+ HOOKS | 12 LANG RULES
122
121
  ```
123
122
 
124
123
  ## Self-Improvement Loop
@@ -126,98 +125,105 @@ caudit # Security scan + harness audit
126
125
  ### The Full Recursive Learning Pipeline
127
126
 
128
127
  ```
129
- ┌─────────────────────────────────────────────────────────────────┐
130
- RECURSIVE SELF-IMPROVEMENT
131
- │ │
132
- │ LAYER 1: OBSERVATION (automatic, every tool use) │
133
- │ ┌─────────────────────────────────────────────────────────┐ │
134
- │ │ PreToolUse hook ──→ observe.sh ──→ observations.jsonl │ │
135
- │ │ PostToolUse hook ──→ observe.sh ──→ observations.jsonl
136
- │ │ │
137
- │ │ Captures: tool name, input, output, session, project │ │
138
- │ │ Scrubs: secrets, API keys (regex-based redaction) │
139
- │ │ Scoped: per-project (git remote hash) or global │ │
140
- │ │ Auto-purge: files >10MB archived, >30 days deleted │ │
141
- │ └─────────────────────────────────────────────────────────┘ │
142
- │ │ │
143
- │ ▼ │
144
- │ LAYER 2: PATTERN DETECTION (background observer, Haiku) │
145
- │ ┌─────────────────────────────────────────────────────────┐ │
146
- │ │ Observer agent runs every 5 min (now ENABLED) │ │
147
- │ │ Detects: │ │
148
- │ │ - User corrections instinct │ │
149
- │ │ - Error resolutions → instinct │ │
150
- │ │ - Repeated workflows instinct │ │
151
- │ │ - Scope decision: project or global? │ │
152
- │ │ │ │
153
- │ │ Also: /learn (manual) and /learn-eval (self-evaluated) │ │
154
- │ └─────────────────────────────────────────────────────────┘ │
155
- │ │ │
156
- │ ▼ │
157
- │ LAYER 3: INSTINCTS (atomic learned behaviors) │
158
- │ ┌─────────────────────────────────────────────────────────┐ │
159
- │ │ Format: YAML with confidence scoring │ │
160
- │ │ │ │
161
- │ │ id: prefer-functional-style │ │
162
- │ │ trigger: "when writing new functions" │ │
163
- │ │ confidence: 0.7 (0.3=tentative → 0.9=certain) │ │
164
- │ │ domain: code-style │ │
165
- │ │ scope: project │ │
166
- │ │ │
167
- │ │ Storage: │ │
168
- │ │ Per-project: ~/.claude/homunculus/projects/<hash>/ │ │
169
- │ │ Global: ~/.claude/homunculus/instincts/personal/ │ │
170
- │ │ │ │
171
- │ │ Confidence evolves: │ │
172
- │ │ ↑ pattern observed again, user doesn't correct │ │
173
- │ │ ↓ user explicitly corrects, contradicting evidence │ │
174
- │ └─────────────────────────────────────────────────────────┘ │
175
- │ │
176
- │ ▼ │
177
- │ LAYER 4: PROMOTION (project → global) │
178
- │ ┌─────────────────────────────────────────────────────────┐ │
179
- │ │ /promote: Move high-confidence project instincts │ │
180
- │ │ to global scope │ │
181
- │ │ │ │
182
- │ │ Auto-promote criteria: │ │
183
- │ │ - Same instinct in 2+ projects │ │
184
- │ │ - Average confidence >= 0.8 │ │
185
- │ │ │ │
186
- │ │ Scope guide: │ │
187
- │ │ Project: React hooks, Django patterns, file structure │ │
188
- │ │ Global: security practices, git workflow, tool prefs │ │
189
- │ └─────────────────────────────────────────────────────────┘ │
190
- │ │ │
191
- │ ▼ │
192
- │ LAYER 5: EVOLUTION (instincts skills/agents/commands) │
193
- │ ┌─────────────────────────────────────────────────────────┐ │
194
- │ │ /evolve: Cluster 5+ related instincts → generate: │ │
195
- │ │ - SKILL.md (workflow definition) │ │
196
- │ │ - agent.md (specialist subagent) │ │
197
- │ │ - command.md (slash command) │ │
198
- │ │ │ │
199
- │ │ Output: ~/.claude/homunculus/evolved/ │ │
200
- │ │ or projects/<hash>/evolved/ │ │
201
- │ └─────────────────────────────────────────────────────────┘ │
202
- │ │ │
203
- │ ▼ │
204
- │ LAYER 6: V1 LEARNED SKILLS (already accumulated) │
205
- │ ┌─────────────────────────────────────────────────────────┐ │
206
- │ │ 7 skills already learned from previous sessions: │ │
207
- │ │ - azure-copilot-proxy-llm-gateway │ │
208
- │ │ - deerflow-model-thinking-modes │ │
209
- │ │ - deerflow-windows-docker-setup │ │
210
- │ │ - openclaw-gateway-systemd-fix │ │
211
- │ │ - openclaw-pi-security-hardening │ │
212
- │ │ - pamir-device-reference │ │
213
- │ │ - syncthing-obsidian-vault-sync │ │
214
- │ │ │ │
215
- │ │ Location: ~/.claude/skills/learned/ │ │
216
- │ └─────────────────────────────────────────────────────────┘ │
217
- │ │
218
- │ NEXT SESSION: All instincts + learned skills auto-loaded │
219
- │ → Better behavior → more accurate instincts → compounds │
220
- └─────────────────────────────────────────────────────────────────┘
128
+ +-----------------------------------------------------------------+
129
+ | RECURSIVE SELF-IMPROVEMENT |
130
+ +-----------------------------------------------------------------+
131
+
132
+ LAYER 1: OBSERVATION (automatic, every tool use)
133
+ +---------------------------------------------------------+
134
+ | PreToolUse hook -> observe.sh -> observations.jsonl |
135
+ | PostToolUse hook -> observe.sh -> observations.jsonl |
136
+ | |
137
+ | Captures: tool name, input, output, session, project |
138
+ | Scrubs: secrets, API keys (regex-based redaction) |
139
+ | Scoped: per-project (git remote hash) or global |
140
+ | Auto-purge: files >10MB archived, >30 days deleted |
141
+ +---------------------------------------------------------+
142
+ |
143
+ v
144
+
145
+ LAYER 2: PATTERN DETECTION (background observer, Haiku)
146
+ +---------------------------------------------------------+
147
+ | Observer agent runs every 5 min (now ENABLED) |
148
+ | Detects: |
149
+ | - User corrections -> instinct |
150
+ | - Error resolutions -> instinct |
151
+ | - Repeated workflows -> instinct |
152
+ | - Scope decision: project or global? |
153
+ | |
154
+ | Also: /learn (manual) and /learn-eval (self-evaluated) |
155
+ +---------------------------------------------------------+
156
+ |
157
+ v
158
+
159
+ LAYER 3: INSTINCTS (atomic learned behaviors)
160
+ +---------------------------------------------------------+
161
+ | Format: YAML with confidence scoring |
162
+ | |
163
+ | id: prefer-functional-style |
164
+ | trigger: "when writing new functions" |
165
+ | confidence: 0.7 (0.3=tentative -> 0.9=certain) |
166
+ | domain: code-style |
167
+ | scope: project |
168
+ | |
169
+ | Storage: |
170
+ | Per-project: ~/.claude/homunculus/projects/<hash>/ |
171
+ | Global: ~/.claude/homunculus/instincts/personal/ |
172
+ | |
173
+ | Confidence evolves: |
174
+ | + pattern observed again, user does not correct |
175
+ | - user explicitly corrects, contradicting evidence |
176
+ +---------------------------------------------------------+
177
+ |
178
+ v
179
+
180
+ LAYER 4: PROMOTION (project -> global)
181
+ +---------------------------------------------------------+
182
+ | /promote moves high-confidence project instincts |
183
+ | to global scope |
184
+ | |
185
+ | Auto-promote criteria: |
186
+ | - Same instinct in 2+ projects |
187
+ | - Average confidence >= 0.8 |
188
+ | |
189
+ | Scope guide: |
190
+ | Project: React hooks, Django patterns, file structure |
191
+ | Global: security practices, git workflow, tool prefs |
192
+ +---------------------------------------------------------+
193
+ |
194
+ v
195
+
196
+ LAYER 5: EVOLUTION (instincts -> skills/agents/commands)
197
+ +---------------------------------------------------------+
198
+ | /evolve clusters 5+ related instincts into: |
199
+ | - SKILL.md (workflow definition) |
200
+ | - agent.md (specialist subagent) |
201
+ | - command.md (slash command) |
202
+ | |
203
+ | Output: ~/.claude/homunculus/evolved/ |
204
+ | or projects/<hash>/evolved/ |
205
+ +---------------------------------------------------------+
206
+ |
207
+ v
208
+
209
+ LAYER 6: V1 LEARNED SKILLS (already accumulated)
210
+ +---------------------------------------------------------+
211
+ | 7 skills already learned from previous sessions: |
212
+ | - azure-copilot-proxy-llm-gateway |
213
+ | - deerflow-model-thinking-modes |
214
+ | - deerflow-windows-docker-setup |
215
+ | - openclaw-gateway-systemd-fix |
216
+ | - openclaw-pi-security-hardening |
217
+ | - pamir-device-reference |
218
+ | - syncthing-obsidian-vault-sync |
219
+ | |
220
+ | Location: ~/.claude/skills/learned/ |
221
+ +---------------------------------------------------------+
222
+
223
+ +-----------------------------------------------------------------+
224
+ | NEXT SESSION: All instincts + learned skills auto-loaded |
225
+ | Better behavior -> more accurate instincts -> compounds |
226
+ +-----------------------------------------------------------------+
221
227
  ```
222
228
 
223
229
  ### Learning Commands Quick Reference
@@ -268,13 +274,6 @@ Observer: ENABLED (was disabled, now active)
268
274
  /evolve # Generate skills from instinct clusters
269
275
  /skill-health # Dashboard of your skill portfolio
270
276
  /harness-audit # Score your overall setup
271
- ```
272
- │ └─ When seen in 2+ projects, auto-promote candidate
273
-
274
- └─ /evolve: EVOLVE clusters of instincts → full skills/agents
275
- └─ 5+ related instincts → generate SKILL.md or agent.md
276
-
277
- NEXT SESSION: Instincts automatically loaded → better behavior
278
277
  ```
279
278
 
280
279
  ## Decision Matrix: Which Tool When