azclaude-copilot 0.5.7 → 0.5.9

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.
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "azclaude",
11
11
  "description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 39 commands, 10 auto-invoked skills, 15 specialized agents, 4 hooks, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 111-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
12
- "version": "0.5.7",
12
+ "version": "0.5.9",
13
13
  "source": {
14
14
  "source": "github",
15
15
  "repo": "haytamAroui/AZ-CLAUDE-COPILOT",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azclaude",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 39 commands, 10 auto-invoked skills, 15 specialized agents, 4 hooks, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 111-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
5
5
  "author": {
6
6
  "name": "haytamAroui",
package/README.md CHANGED
@@ -94,7 +94,6 @@ AZCLAUDE sits as a mandatory middleware firewall between your input and Claude.
94
94
  ┌──────────────────────────────────────────────────────────────┐
95
95
  │ 5. OUTBOUND SECURITY & MEMORY TRACKING │
96
96
  │ ├─► pre-tool-use.js: blocks curl|bash, secrets, traversal │
97
- │ ├─► Native execution: Claude runs the approved command │
98
97
  │ └─► post-tool-use.js: writes breadcrumb to goals.md │
99
98
  └──────────────────────────────────────────────────────────────┘
100
99
  ```
@@ -118,6 +117,7 @@ One command, no flags. Auto-detects whether this is a fresh install or an upgrad
118
117
  ```bash
119
118
  npx azclaude-copilot@latest doctor # 32 checks — verify everything is wired correctly
120
119
  ```
120
+ │ ├─► Native execution: Claude runs the approved command │
121
121
 
122
122
  ---
123
123
 
@@ -624,11 +624,11 @@ AZCLAUDE is a lazy-loaded environment of 48 capability modules. It only loads wh
624
624
 
625
625
  ## Verified
626
626
 
627
- 1794 tests. Every template, command, capability, agent, hook, and CLI feature verified.
627
+ 1810 tests. Every template, command, capability, agent, hook, and CLI feature verified.
628
628
 
629
629
  ```bash
630
630
  bash tests/test-features.sh
631
- # Results: 1794 passed, 0 failed, 1794 total
631
+ # Results: 1810 passed, 0 failed, 1810 total
632
632
  ```
633
633
 
634
634
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azclaude-copilot",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "description": "AI coding environment — 39 commands, 10 skills, 15 agents, memory, reflexes, evolution. Install: npx azclaude-copilot@latest, then open Claude Code.",
5
5
  "bin": {
6
6
  "azclaude": "bin/cli.js",
@@ -36,6 +36,25 @@ If CLAUDE.md unfilled → run `/setup` with intent from copilot-intent.md first.
36
36
 
37
37
  ---
38
38
 
39
+ ### Step 1b: Resume Interrupted Parallel Wave
40
+
41
+ ```bash
42
+ cat .claude/parallel-wave-state.md 2>/dev/null
43
+ ```
44
+
45
+ If the file exists with `status: in-flight` → a previous session was interrupted mid-parallel-dispatch.
46
+
47
+ **Do NOT skip this. Do NOT start a new wave until the interrupted wave is resolved.**
48
+
49
+ Follow the Resume Protocol from `capabilities/shared/parallel-coordination.md`:
50
+ 1. Read the wave state file — it lists every milestone, branch, and last-known status
51
+ 2. For each `running` milestone: check if `parallel/{slug}` branch exists and has commits
52
+ 3. Branches with commits → mark `done`, proceed to merge
53
+ 4. Branches without commits or missing → re-dispatch those milestones
54
+ 5. After all milestones resolved → merge → delete `.claude/parallel-wave-state.md` → continue
55
+
56
+ ---
57
+
39
58
  ### Step 2: Select Next Milestone Wave
40
59
 
41
60
  **If plan.md has `Wave:` fields** (blueprint wrote them — read directly):
@@ -166,6 +166,144 @@ These rules are injected by orchestrator into every parallel milestone-builder p
166
166
 
167
167
  ---
168
168
 
169
+ ## Proven Patterns — 3-Layer Conflict Prevention
170
+
171
+ These patterns come from a real production run: 16 agents, 360 tests, zero merge conflicts.
172
+
173
+ ### Layer 1: Wave 0 — Bottleneck Files First (Sequential)
174
+
175
+ Identify files that multiple milestones need to modify (shared models, core config, base schemas).
176
+ **Do NOT parallelize these.** Instead, create a Wave 0 that runs sequentially before any parallel agents:
177
+
178
+ ```
179
+ Wave 0 (sequential, orchestrator or single agent):
180
+ models.py → ALL new fields added at once
181
+ versioning.py → version bump
182
+ shared_config → all schema changes
183
+
184
+ Result: every subsequent agent finds shared dependencies already in place.
185
+ ```
186
+
187
+ **Rule: SHARED DEPENDENCY → Wave 0 (sequential, do it first)**
188
+
189
+ ### Layer 2: Directory-Level File Isolation
190
+
191
+ Design each parallel wave so agents own completely disjoint files:
192
+
193
+ ```
194
+ Wave 1 (3 agents, zero file overlap):
195
+ Agent A: annex_1_rules.py, rules.py, conformity_path.py, test_annex_1.py
196
+ Agent B: gpai_rules.py, test_gpai_copyright.py
197
+ Agent C: test_fria_trigger.py, test_national_law_router.py (NEW files only)
198
+ ```
199
+
200
+ **Test-only agents are always safe in parallel** — they create new test files and read (never write) engine code.
201
+
202
+ **Rule: TEST-ONLY agents → always safe in any wave**
203
+
204
+ ### Layer 3: Same File, Different Sections
205
+
206
+ When two agents must touch the same file, allow it **only if edits are 100+ lines apart**:
207
+
208
+ ```
209
+ ┌───────┬────────────────────────────────┬────────────┐
210
+ │ Agent │ Section in rules.py │ Line range │
211
+ ├───────┼────────────────────────────────┼────────────┤
212
+ │ M2A │ After result construction │ ~line 392 │
213
+ │ M2C │ STEP 13 deadline unpacking │ ~line 273 │
214
+ └───────┴────────────────────────────────┴────────────┘
215
+ ```
216
+
217
+ Git merges these cleanly because they don't touch overlapping context (3-line hunk window).
218
+
219
+ **Rule: SAME FILE, DIFFERENT SECTIONS (100+ lines apart) → allowed in parallel**
220
+ **Rule: SAME FILE, SAME SECTION → serialize into different waves**
221
+
222
+ ### Decision Table
223
+
224
+ | Conflict type | Resolution |
225
+ |---------------|-----------|
226
+ | Multiple milestones need same model/schema file | Wave 0: one agent fixes it sequentially before all others |
227
+ | Agents write different files entirely | Safe for parallel — standard worktree isolation |
228
+ | Agents write same file, edits 100+ lines apart | Allowed in parallel — git auto-merges cleanly |
229
+ | Agents write same file, edits < 100 lines apart | Serialize into different waves |
230
+ | Agent only creates new test files | Always safe in any wave — no write conflicts possible |
231
+ | Agent changes a function's return type | Must also fix all callers in the same agent's scope |
232
+
233
+ ---
234
+
235
+ ## Wave State File — Context Loss Protection
236
+
237
+ During parallel execution, the orchestrator writes `.claude/parallel-wave-state.md` **before dispatching any agents**. This file survives context compaction and enables session resume.
238
+
239
+ ### Format
240
+
241
+ ```markdown
242
+ ---
243
+ wave: {N}
244
+ started: {ISO timestamp}
245
+ status: in-flight
246
+ milestones: [M3, M4, M5]
247
+ ---
248
+
249
+ | Milestone | Branch | Status | Commit | Notes |
250
+ |-----------|--------|--------|--------|-------|
251
+ | M3 — Auth endpoints | parallel/m3-auth | running | — | P1 slot |
252
+ | M4 — User profile | parallel/m4-profile | done | a1b2c3d | merged to worktree |
253
+ | M5 — Email service | parallel/m5-email | failed | — | timeout on test suite |
254
+ ```
255
+
256
+ ### Lifecycle
257
+
258
+ 1. **Created** — by `/parallel` Step 4 or orchestrator Step 4, before agent dispatch
259
+ 2. **Updated** — as each agent reports completion (status → `done`/`failed`, commit hash filled)
260
+ 3. **Deleted** — by orchestrator Step 8 or `/parallel` Step 8, after all branches merged and cleanup done
261
+
262
+ ### Rules
263
+
264
+ - The file MUST exist whenever parallel agents are in-flight
265
+ - If this file exists at session start → a previous wave was interrupted → trigger Resume Protocol
266
+ - Only the orchestrator or `/parallel` command writes this file — builders never touch it
267
+
268
+ ---
269
+
270
+ ## Resume Protocol — Recovering Interrupted Waves
271
+
272
+ When the orchestrator or `/parallel` finds `.claude/parallel-wave-state.md` at session start:
273
+
274
+ ### Step 1: Read Wave State
275
+ ```bash
276
+ cat .claude/parallel-wave-state.md
277
+ ```
278
+
279
+ ### Step 2: Check Each Branch
280
+ For every milestone with `status: running` (was in-flight when session died):
281
+ ```bash
282
+ # Does the branch exist?
283
+ git branch --list "parallel/{slug}"
284
+
285
+ # Does it have commits beyond the fork point?
286
+ git log main..parallel/{slug} --oneline 2>/dev/null | head -5
287
+ ```
288
+
289
+ ### Step 3: Classify Each Milestone
290
+
291
+ | Branch exists? | Has commits? | Action |
292
+ |---------------|-------------|--------|
293
+ | Yes | Yes | Mark `done` in wave state — ready to merge |
294
+ | Yes | No | Agent never started — re-dispatch |
295
+ | No | — | Branch was cleaned up or never created — re-dispatch |
296
+
297
+ ### Step 4: Resume
298
+ - Milestones marked `done` or with commits → proceed to Merge Protocol
299
+ - Milestones needing re-dispatch → spawn new agents (same parameters as original dispatch)
300
+ - Update `.claude/parallel-wave-state.md` with new statuses before re-dispatching
301
+
302
+ ### Step 5: Continue Normal Flow
303
+ After resume completes, continue with Merge Protocol → Plan Update → Cleanup as usual.
304
+
305
+ ---
306
+
169
307
  ## Ownership Map Cleanup
170
308
 
171
309
  After wave merge is complete:
@@ -173,4 +311,7 @@ After wave merge is complete:
173
311
  # Remove ownership.md entries for the completed wave
174
312
  # (or replace the table with a merge record)
175
313
  echo "## Wave {N} merged — {timestamp}" >> .claude/ownership.md
314
+
315
+ # CRITICAL: Delete wave state file — prevents false resume on next session
316
+ rm -f .claude/parallel-wave-state.md
176
317
  ```
@@ -21,6 +21,18 @@ Load: `capabilities/shared/parallel-coordination.md`
21
21
 
22
22
  ---
23
23
 
24
+ ## Step 0: Check for Interrupted Wave
25
+
26
+ ```bash
27
+ cat .claude/parallel-wave-state.md 2>/dev/null
28
+ ```
29
+
30
+ If the file exists with `status: in-flight` → a previous parallel session was interrupted.
31
+ Follow the **Resume Protocol** from `parallel-coordination.md` before starting a new wave.
32
+ Only proceed to Step 1 after the interrupted wave is fully resolved (merged or re-dispatched).
33
+
34
+ ---
35
+
24
36
  ## Step 1: Parse Targets
25
37
 
26
38
  ```bash
@@ -68,9 +80,9 @@ If any milestone returns `Parallel Safe: NO` → exclude from parallel wave, run
68
80
 
69
81
  ---
70
82
 
71
- ## Step 4: Write Ownership Map
83
+ ## Step 4: Write Ownership Map + Wave State
72
84
 
73
- Create or update `.claude/ownership.md`:
85
+ **4a. Ownership map** — create or update `.claude/ownership.md`:
74
86
 
75
87
  ```
76
88
  ## Active Parallel Session — {ISO timestamp}
@@ -83,6 +95,24 @@ Initiated by: /parallel command
83
95
  | P2 | M{N} — {title} | parallel/m{n}-{slug} | {dirs from spec} | pending |
84
96
  ```
85
97
 
98
+ **4b. Wave state file** — write `.claude/parallel-wave-state.md` BEFORE dispatching agents:
99
+
100
+ ```markdown
101
+ ---
102
+ wave: {N}
103
+ started: {ISO timestamp}
104
+ status: in-flight
105
+ milestones: [{list}]
106
+ ---
107
+
108
+ | Milestone | Branch | Status | Commit | Notes |
109
+ |-----------|--------|--------|--------|-------|
110
+ | M{N} — {title} | parallel/m{n}-{slug} | running | — | P1 slot |
111
+ | M{N} — {title} | parallel/m{n}-{slug} | running | — | P2 slot |
112
+ ```
113
+
114
+ This file survives context compaction. If the session dies mid-wave, the next session reads this file to resume.
115
+
86
116
  ---
87
117
 
88
118
  ## Step 5: Dispatch All Agents Simultaneously
@@ -116,6 +146,7 @@ Worktree rules (MANDATORY):
116
146
  After all agents complete:
117
147
  - Collect all completion reports
118
148
  - Mark each as COMPLETE or FAILED in ownership.md
149
+ - **Update `.claude/parallel-wave-state.md`** — set each milestone's Status to `done`/`failed`, fill Commit hash
119
150
 
120
151
  ---
121
152
 
@@ -150,6 +181,7 @@ git branch -d parallel/{slug-1} parallel/{slug-2}
150
181
 
151
182
  Update `.claude/plan.md` — set merged milestones to `status: done`.
152
183
  Update `.claude/ownership.md` — replace active table with merge record.
184
+ **Delete `.claude/parallel-wave-state.md`** — wave is complete, prevent false resume on next session.
153
185
 
154
186
  Show final report:
155
187
  ```
@@ -17,6 +17,14 @@ This is different from `/persist` (end-of-session). Checkpoint = mid-flight snap
17
17
 
18
18
  Read `.claude/memory/goals.md` — scan the "In progress" entries and "Current threads."
19
19
 
20
+ **Step 1b: Detect Active Parallel Wave**
21
+
22
+ ```bash
23
+ cat .claude/parallel-wave-state.md 2>/dev/null
24
+ ```
25
+
26
+ If the file exists → a parallel wave is active. Read it and include wave status in the checkpoint (Step 2).
27
+
20
28
  ---
21
29
 
22
30
  ## Step 2: Write Checkpoint File
@@ -48,6 +56,9 @@ files_in_progress: [{list from goals.md ## In progress}]
48
56
 
49
57
  ## Risk / open question
50
58
  {Anything uncertain that needs resolution — or "None"}
59
+
60
+ ## Active parallel wave (if any)
61
+ {Copy the full contents of .claude/parallel-wave-state.md here, or "No active wave"}
51
62
  ```
52
63
 
53
64
  Create the directory if needed: `.claude/memory/checkpoints/`
@@ -233,13 +233,25 @@ try {
233
233
  if (fs.existsSync(goalsPath)) {
234
234
  const goalsContent = fs.readFileSync(goalsPath, 'utf8');
235
235
  const header = `---\ndate: ${new Date().toISOString()}\nlabel: auto-compaction-guard-${pct}pct\nfiles_in_progress: []\n---\n\n`;
236
- fs.writeFileSync(cpPath, header + '## Auto-saved before compaction\n\n' + goalsContent);
236
+ let cpContent = '## Auto-saved before compaction\n\n' + goalsContent;
237
+
238
+ // Include parallel wave state if an active wave exists
239
+ const waveStatePath = path.join(cfg, 'parallel-wave-state.md');
240
+ if (fs.existsSync(waveStatePath)) {
241
+ const waveContent = fs.readFileSync(waveStatePath, 'utf8');
242
+ cpContent += '\n\n## Active Parallel Wave (saved by compaction guard)\n\n' + waveContent;
243
+ }
244
+
245
+ fs.writeFileSync(cpPath, header + cpContent);
237
246
  fs.writeFileSync(autoSaveMarker, '');
238
247
  }
239
248
 
240
249
  console.log('');
241
250
  console.log(`--- COMPACTION GUARD (${pct}%) ---`);
242
251
  console.log(`Context at ${pct}% — AUTO-SAVED checkpoint to ${path.basename(cpPath)}`);
252
+ if (fs.existsSync(waveStatePath)) {
253
+ console.log('PARALLEL WAVE STATE INCLUDED — interrupted wave will auto-resume on next session.');
254
+ }
243
255
  console.log('Run /snapshot NOW to save your reasoning and decisions (goals.md alone is not enough).');
244
256
  console.log('--- END GUARD ---');
245
257
  }