azclaude-copilot 0.3.6 → 0.3.8

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/README.md CHANGED
@@ -29,39 +29,58 @@ Zero dependencies. One install. Works on any stack.
29
29
 
30
30
  ## Install
31
31
 
32
+ **Step 1 — core install** (26 commands, memory, reflexes, evolution):
33
+
34
+ ```bash
35
+ npx azclaude-copilot
36
+ ```
37
+
38
+ **Step 2 — full install** (adds Level 5+: debate, pipeline, ELO — optional):
39
+
32
40
  ```bash
33
- npx azclaude-copilot setup
41
+ npx azclaude-copilot --full
42
+ ```
43
+
44
+ **Step 3 — configure your project** (open Claude Code, then run):
45
+
46
+ ```
47
+ /setup
34
48
  ```
35
49
 
36
- That's it. Your project now has the full AZCLAUDE environment in `.claude/`.
50
+ That's it. Your project now has AZCLAUDE in `.claude/`.
37
51
 
38
52
  ---
39
53
 
40
54
  ## Three Ways to Use It
41
55
 
42
- ### `/dream` — Start from an idea
56
+ ### 1. `/setup` — Configure an existing project
57
+
58
+ Open Claude Code in your project, then run:
43
59
 
44
60
  ```
45
- /dream
46
- > "Build a compliance SaaS with trilingual support"
61
+ /setup
47
62
  ```
48
- Scaffolds the full project: CLAUDE.md, skills, agents, memory, milestones. You build from there.
49
63
 
50
- ### `/setup` Configure an existing project
64
+ Analyzes your project's stack, domain, and scale. Fills CLAUDE.md. Generates project-specific skills and agents. Creates memory structure.
65
+
66
+ ### 2. `/dream` — Start from an idea
51
67
 
52
68
  ```
53
- /setup
69
+ /dream
70
+ > "Build a compliance SaaS with trilingual support"
54
71
  ```
55
- Analyzes your project's stack, domain, and scale. Fills CLAUDE.md. Generates project-specific skills and agents. Creates memory structure.
56
72
 
57
- ### `/copilot` Full autonomous mode
73
+ Scaffolds the full project: CLAUDE.md, skills, agents, memory, milestones. You build from there.
74
+
75
+ ### 3. `/copilot` — Full autonomous mode
58
76
 
59
77
  ```bash
60
78
  npx azclaude-copilot . "Build a compliance SaaS with trilingual support"
61
79
  ```
80
+
62
81
  Walk away. AZCLAUDE plans, builds, tests, commits, evolves, and deploys. Come back to a working product with full git history.
63
82
 
64
- ### Day-to-day commands
83
+ ### Day-to-day commands (in Claude Code terminal)
65
84
 
66
85
  ```bash
67
86
  /add [feature] # add a feature with TDD
@@ -76,7 +95,8 @@ Walk away. AZCLAUDE plans, builds, tests, commits, evolves, and deploys. Come ba
76
95
  ### CLI commands
77
96
 
78
97
  ```bash
79
- npx azclaude-copilot setup # install AZCLAUDE
98
+ npx azclaude-copilot # core install (26 commands, memory, reflexes)
99
+ npx azclaude-copilot --full # full install (adds debate, pipeline, ELO)
80
100
  npx azclaude-copilot doctor # 32-check health audit
81
101
  npx azclaude-copilot . "intent" 30 # copilot with 30 session limit
82
102
  npx azclaude-copilot . # resume existing copilot run
@@ -390,8 +410,8 @@ AZCLAUDE_HOOK_PROFILE=strict claude # all features + extra validation
390
410
  ### Doctor Audit
391
411
 
392
412
  ```bash
393
- npx azclaude doctor # 32 checks: hooks, settings, commands, memory
394
- npx azclaude doctor --audit # efficiency + security score
413
+ npx azclaude-copilot doctor # 32 checks: hooks, settings, commands, memory
414
+ npx azclaude-copilot doctor --audit # efficiency + security score
395
415
  ```
396
416
 
397
417
  See [SECURITY.md](SECURITY.md) for full details including known limitations and copilot-mode mitigations.
@@ -430,7 +450,7 @@ azclaude-copilot/
430
450
  ├── DOCS.md <- full user guide
431
451
  ├── SECURITY.md <- security policy + architecture
432
452
  ├── tests/
433
- │ └── test-features.sh ← 1058 tests
453
+ │ └── test-features.sh ← 1068 tests
434
454
  ```
435
455
 
436
456
  ---
@@ -456,11 +476,11 @@ The runner is stateless. These files ARE the state.
456
476
 
457
477
  ## Verified
458
478
 
459
- 1058 tests. Every template, command, capability, agent, and CLI feature verified.
479
+ 1068 tests. Every template, command, capability, agent, and CLI feature verified.
460
480
 
461
481
  ```bash
462
482
  bash tests/test-features.sh
463
- # Results: 1058 passed, 0 failed, 1058 total
483
+ # Results: 1068 passed, 0 failed, 1068 total
464
484
  ```
465
485
 
466
486
  ---
package/bin/cli.js CHANGED
@@ -338,7 +338,7 @@ function installCapabilities(projectDir, cfg, full) {
338
338
  copyDir(path.join(src, dir), path.join(dst, dir));
339
339
  }
340
340
  ok(`Capabilities installed (${cfg}/capabilities/) — ${full ? 'full' : 'core'}`);
341
- if (!full) info('Run npx azclaude --full to add intelligence capabilities (debate, pipeline, ELO)');
341
+ if (!full) info('Run npx azclaude-copilot --full to add intelligence capabilities (debate, pipeline, ELO)');
342
342
  info('manifest.md is your capability index — read it to find what to load');
343
343
  }
344
344
 
@@ -671,8 +671,8 @@ function runDemo() {
671
671
  console.log('\n════════════════════════════════════════════════');
672
672
  console.log(' Memory works. Context survives compaction.');
673
673
  console.log(' The hook fires on every file edit — no user action needed.');
674
- console.log('\n Install on your project: npx azclaude');
675
- console.log(' Check health: npx azclaude doctor');
674
+ console.log('\n Install on your project: npx azclaude-copilot');
675
+ console.log(' Check health: npx azclaude-copilot doctor');
676
676
  console.log('════════════════════════════════════════════════\n');
677
677
  }
678
678
 
@@ -872,7 +872,7 @@ function runDoctor() {
872
872
  try {
873
873
  const gs = JSON.parse(fs.readFileSync(globalSettings, 'utf8'));
874
874
  if (gs._azclaude) {
875
- console.log(' ⚠ Global hooks still present — re-run npx azclaude to migrate');
875
+ console.log(' ⚠ Global hooks still present — re-run npx azclaude-copilot to migrate');
876
876
  }
877
877
  } catch {}
878
878
  }
@@ -908,7 +908,7 @@ function runDoctor() {
908
908
  chk('hook integrity hash matches', saved === current);
909
909
  }
910
910
 
911
- info('Tip: re-run npx azclaude to upgrade to project-scoped hooks');
911
+ info('Tip: re-run npx azclaude-copilot to upgrade to project-scoped hooks');
912
912
  } else {
913
913
  console.log(`\n[ Hooks ]`);
914
914
  console.log(` · hooks not supported for ${cli.name} — skipping`);
@@ -1014,7 +1014,7 @@ function runDoctor() {
1014
1014
  const hasGitFail = failures.some(f => /uncommitted/.test(f));
1015
1015
  const hasMemoryFail = failures.some(f => /checkpoints|sessions|codebase-map|goals/.test(f));
1016
1016
  console.log('');
1017
- if (hasCommandFail || hasHookFail) console.log(' Fix: re-run npx azclaude to install missing files');
1017
+ if (hasCommandFail || hasHookFail) console.log(' Fix: re-run npx azclaude-copilot to install missing files');
1018
1018
  if (hasHookFail) console.log(' If hooks still fail: check that Node.js ≥ 16 is in PATH');
1019
1019
  if (hasGitFail) console.log(' Git: commit or stash uncommitted changes');
1020
1020
  if (hasMemoryFail) console.log(' Memory: run /setup or /persist to create missing files');
@@ -1127,9 +1127,12 @@ console.log('\n═════════════════════
1127
1127
  console.log(` Install mode: ${fullInstall ? 'full (all capabilities)' : 'core (shared + level-builders)'}`);
1128
1128
  console.log(' Architecture: lazy-loaded, manifest-driven');
1129
1129
  console.log(' Token cost per task: ~200-600 (vs ~21,000 monolith)');
1130
- console.log(` Next step: run /setup to configure this project`);
1130
+ console.log('');
1131
1131
  if (!fullInstall) {
1132
- console.log('');
1133
- console.log(' When ready for Level 5+: npx azclaude --full');
1132
+ console.log(' Next steps:');
1133
+ console.log(' 1. npx azclaude-copilot --full (Level 5+: debate, pipeline, ELO)');
1134
+ console.log(' 2. Open Claude Code and run /setup');
1135
+ } else {
1136
+ console.log(' Next step: open Claude Code and run /setup');
1134
1137
  }
1135
1138
  console.log('════════════════════════════════════════════════\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azclaude-copilot",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "AI coding environment — 26 commands, 8 skills, 7 agents, memory, reflexes, evolution. Install once, works on any stack.",
5
5
  "bin": {
6
6
  "azclaude": "./bin/cli.js",
@@ -123,6 +123,33 @@ if (!content.includes(HEADING)) {
123
123
 
124
124
  try { fs.writeFileSync(goalsPath, content); } catch (_) {}
125
125
 
126
+ // ── Memory rotation — keep ## In progress bounded at 30 entries ──────────────
127
+ const ROTATE_THRESHOLD = 30;
128
+ const KEEP_NEWEST = 15;
129
+ const rotLines = content.split('\n');
130
+ const rotHIdx = rotLines.findIndex(l => l.trim() === HEADING);
131
+ if (rotHIdx !== -1) {
132
+ const ipEntries = [];
133
+ for (let i = rotHIdx + 1; i < rotLines.length; i++) {
134
+ if (rotLines[i].startsWith('## ')) break;
135
+ if (rotLines[i].startsWith('- ')) ipEntries.push({ line: rotLines[i], idx: i });
136
+ }
137
+ if (ipEntries.length >= ROTATE_THRESHOLD) {
138
+ const toArchive = ipEntries.slice(KEEP_NEWEST);
139
+ const archiveTs = new Date().toISOString().slice(0, 16);
140
+ const archiveDate = new Date().toISOString().slice(0, 10);
141
+ const archivePath = path.join(cfg, 'memory', 'sessions', `${archiveDate}-edits.md`);
142
+ try { fs.mkdirSync(path.join(cfg, 'memory', 'sessions'), { recursive: true }); } catch (_) {}
143
+ const header = `\n<!-- archived: ${archiveTs} source: post-tool-use -->\n`;
144
+ const payload = toArchive.map(e => e.line).join('\n') + '\n';
145
+ try { fs.appendFileSync(archivePath, header + payload); } catch (_) {}
146
+ // Rewrite goals.md keeping only newest 15 entries
147
+ const archivedSet = new Set(toArchive.map(e => e.idx));
148
+ const pruned = rotLines.filter((_, i) => !archivedSet.has(i));
149
+ try { fs.writeFileSync(goalsPath, pruned.join('\n')); } catch (_) {}
150
+ }
151
+ }
152
+
126
153
  } // end isFileTool goals tracking
127
154
 
128
155
  // ── Reflex observation capture (standard/strict only) ───────────────────────
@@ -192,5 +219,5 @@ let editCount = 1;
192
219
  try { editCount = parseInt(fs.readFileSync(counterPath, 'utf8'), 10) + 1; } catch (_) {}
193
220
  try { fs.writeFileSync(counterPath, String(editCount)); } catch (_) {}
194
221
  if (editCount > 0 && editCount % 15 === 0) {
195
- process.stdout.write(`\n⚠ ${editCount} edits this session — run /snapshot before context compaction loses your reasoning\n`);
222
+ process.stderr.write(`\n⚠ ${editCount} edits this session — run /snapshot before context compaction loses your reasoning\n`);
196
223
  }
@@ -10,6 +10,7 @@
10
10
  */
11
11
  const fs = require('fs');
12
12
  const path = require('path');
13
+ const os = require('os');
13
14
 
14
15
  // ── Hook profile gate ───────────────────────────────────────────────────────
15
16
  // AZCLAUDE_HOOK_PROFILE=minimal|standard|strict (default: standard)
@@ -62,8 +63,30 @@ if (content.includes(IN_PROGRESS)) {
62
63
 
63
64
  content = withoutIP.join('\n');
64
65
  } else {
65
- // Empty In progress — just remove the heading
66
- content = content.replace(`\n${IN_PROGRESS}\n`, '\n');
66
+ // Empty In progress — just remove the heading + any trailing blank lines
67
+ content = content.replace(new RegExp('\\n' + IN_PROGRESS + '\\n(\\n)*', 'g'), '\n');
68
+ }
69
+ }
70
+
71
+ // ── Trim "Done this session" to max 20 entries (overflow → archive) ──────────
72
+ const DONE_KEEP = 20;
73
+ const trimLines = content.split('\n');
74
+ const dTrimIdx = trimLines.findIndex(l => l.trim() === DONE);
75
+ if (dTrimIdx !== -1) {
76
+ const doneEntries = [];
77
+ for (let i = dTrimIdx + 1; i < trimLines.length; i++) {
78
+ if (trimLines[i].startsWith('## ')) break;
79
+ if (trimLines[i].startsWith('- ')) doneEntries.push({ line: trimLines[i], idx: i });
80
+ }
81
+ if (doneEntries.length > DONE_KEEP) {
82
+ const toArchive = doneEntries.slice(DONE_KEEP);
83
+ const archivePath = path.join(cfg, 'memory', 'sessions', `${today}-edits.md`);
84
+ try { fs.mkdirSync(path.join(cfg, 'memory', 'sessions'), { recursive: true }); } catch (_) {}
85
+ const header = `\n<!-- archived: ${today} source: stop -->\n`;
86
+ const payload = toArchive.map(e => e.line).join('\n') + '\n';
87
+ try { fs.appendFileSync(archivePath, header + payload); } catch (_) {}
88
+ const archivedSet = new Set(toArchive.map(e => e.idx));
89
+ content = trimLines.filter((_, i) => !archivedSet.has(i)).join('\n');
67
90
  }
68
91
  }
69
92
 
@@ -71,6 +94,10 @@ if (content.includes(IN_PROGRESS)) {
71
94
  content = content.replace(/^Updated: .*/m, `Updated: ${today}`);
72
95
  try { fs.writeFileSync(goalsPath, content); } catch (_) {}
73
96
 
97
+ // ── Reset edit counter so checkpoint reminder starts fresh next session ───────
98
+ const counterPath = path.join(os.tmpdir(), `.azclaude-edit-count-${process.ppid || process.pid}`);
99
+ try { fs.writeFileSync(counterPath, '0'); } catch (_) {}
100
+
74
101
  // ── Warn if /persist was not run (only in AZCLAUDE projects with obs dir) ──
75
102
  const obsDir = path.join('ops', 'observations');
76
103
  if (!fs.existsSync(obsDir)) process.exit(0);