azclaude-copilot 0.4.1 → 0.4.2

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
@@ -469,7 +469,7 @@ azclaude-copilot/
469
469
  ├── DOCS.md <- full user guide
470
470
  ├── SECURITY.md <- security policy + architecture
471
471
  ├── tests/
472
- │ └── test-features.sh ← 1107 tests
472
+ │ └── test-features.sh ← 1135 tests
473
473
  ```
474
474
 
475
475
  ---
@@ -495,11 +495,11 @@ The runner is stateless. These files ARE the state.
495
495
 
496
496
  ## Verified
497
497
 
498
- 1107 tests. Every template, command, capability, agent, and CLI feature verified.
498
+ 1135 tests. Every template, command, capability, agent, and CLI feature verified.
499
499
 
500
500
  ```bash
501
501
  bash tests/test-features.sh
502
- # Results: 1107 passed, 0 failed, 1107 total
502
+ # Results: 1135 passed, 0 failed, 1135 total
503
503
  ```
504
504
 
505
505
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azclaude-copilot",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "AI coding environment — 26 commands, 8 skills, 10 agents, memory, reflexes, evolution. Install once, works on any stack.",
5
5
  "bin": {
6
6
  "azclaude": "./bin/cli.js",
@@ -25,6 +25,7 @@ Load only the files that match the current task. Never load the full list.
25
25
  | shared/context-artifacts.md | Project has DB schemas, API specs, infra configs, or knowledge/ dir — discover and use non-code knowledge before implementing | ~200 |
26
26
  | shared/semantic-boundary-check.md | /evolve Cycle 3 or boundary validator warns — detect deeper behavioral duplication across extension types that grep misses | ~300 |
27
27
  | shared/domain-advisor-generator.md | Non-tech domain detected (compliance, marketing, finance, medical, legal, research) — generates domain-specific advisor skill | ~400 |
28
+ | shared/intelligent-dispatch.md | About to build, fix, refactor, audit, or ship — non-trivial scope (3+ files or structural) — pre-flight analysis via problem-architect | ~300 |
28
29
 
29
30
  ## Level Builders — load ONE at a time
30
31
  | File | When to load | Tokens |
@@ -0,0 +1,79 @@
1
+ # Intelligent Dispatch — Pre-Flight Protocol
2
+
3
+ Load before any non-trivial build, fix, refactor, audit, or plan task.
4
+ Invokes problem-architect for structured analysis BEFORE touching code.
5
+
6
+ ---
7
+
8
+ ## When to Run Problem-Architect
9
+
10
+ Run pre-analysis if ANY of these is true:
11
+ - Task will touch 3+ files
12
+ - Task involves a structural change (schema, API contract, auth, architecture)
13
+ - Task crosses directory boundaries (multiple modules or layers)
14
+ - First time working in this part of the codebase this session
15
+
16
+ Skip if:
17
+ - Only 1-2 files, clearly scoped
18
+ - Pure config/docs change with no code impact
19
+ - Already in copilot mode with annotated plan.md (milestones already have Team Spec)
20
+
21
+ ---
22
+
23
+ ## How to Invoke
24
+
25
+ ```bash
26
+ ls .claude/agents/problem-architect.md 2>/dev/null && echo "ARCHITECT_AVAILABLE" || echo "NOT_INSTALLED"
27
+ ```
28
+
29
+ If ARCHITECT_AVAILABLE — spawn problem-architect with:
30
+ ```
31
+ Task: {command name} — {what you're doing}
32
+ Current state: {what files/dirs exist relevant to this task}
33
+ Available agents: {output of: ls .claude/agents/ 2>/dev/null}
34
+ Available skills: {output of: ls .claude/skills/ 2>/dev/null}
35
+ ```
36
+
37
+ ---
38
+
39
+ ## What to Do with the Returned Team Spec
40
+
41
+ | Field | Action |
42
+ |-------|--------|
43
+ | Skills to Load | Load each skill before implementing |
44
+ | Pre-Read Files | Read every file listed, in order: schema → source → tests → patterns → antipatterns |
45
+ | Pre-Conditions | Verify each; STOP if any unmet |
46
+ | Files Written | Note for parallel safety — no concurrent work on same files |
47
+ | Structural Decision: YES | Run /debate before proceeding; log result to `.claude/memory/decisions.md` |
48
+ | Risks | Read mitigation; apply to implementation approach |
49
+
50
+ ---
51
+
52
+ ## Implementation Protocol (milestone-builder)
53
+
54
+ For any implementation task (3+ files or MEDIUM/COMPLEX):
55
+
56
+ 1. **Pre-read** all files from Team Spec — no exceptions
57
+ 2. **Implement** following patterns.md exactly — never invent patterns
58
+ 3. **Verify** — run full test suite, show actual output (never summarize)
59
+ 4. **Self-correct** — re-read error + check antipatterns.md → ONE alternative approach
60
+ 5. **Budget** — 2 fix attempts for SIMPLE/MEDIUM, 3 for COMPLEX
61
+ - Budget exhausted → report exact error + what was tried → do not guess again
62
+
63
+ ---
64
+
65
+ ## When to Escalate to Orchestrator
66
+
67
+ If `.claude/agents/orchestrator.md` exists:
68
+ - Task spans 2+ milestones in plan.md → delegate to orchestrator
69
+ - Multiple independent workstreams → orchestrator manages parallel dispatch
70
+ - Structural decision needed → orchestrator triggers /debate
71
+
72
+ ---
73
+
74
+ ## Rules
75
+
76
+ - NEVER skip pre-read. Context-blind implementation is the most common failure mode.
77
+ - NEVER invent patterns. patterns.md says use X → use X.
78
+ - NEVER exceed fix attempt budget. Stop and report when exhausted.
79
+ - ALWAYS show test output. Never say "tests should pass."
@@ -18,6 +18,19 @@ Load: shared/tdd.md + shared/completion-rule.md
18
18
 
19
19
  ---
20
20
 
21
+ ## Pre-Flight Analysis (intelligent-dispatch)
22
+
23
+ Load `shared/intelligent-dispatch.md`.
24
+
25
+ If task will touch 3+ files OR crosses module boundaries:
26
+ → Spawn problem-architect (see intelligent-dispatch protocol)
27
+ → Use returned Team Spec: load skills, pre-read files, check pre-conditions, note risks
28
+ → If Structural Decision: YES → run /debate before Phase 4
29
+
30
+ If problem-architect not installed: proceed with Phase 1 as normal (manual scan in Phase 2).
31
+
32
+ ---
33
+
21
34
  ## Copilot Mode Detection
22
35
 
23
36
  ```bash
@@ -48,6 +48,27 @@ If `COPILOT_MODE`:
48
48
 
49
49
  ---
50
50
 
51
+ ## Step 1b: Structural Context (intelligent-dispatch)
52
+
53
+ Load `shared/intelligent-dispatch.md`.
54
+
55
+ If problem-architect available — spawn it before reviewing:
56
+ ```
57
+ Task: audit — structural context for spec compliance review
58
+ Current state: {what's changed, what the diff covers}
59
+ Available agents: {list}
60
+ Available skills: {list}
61
+ ```
62
+ Use returned Team Spec to inject:
63
+ - `decisions.md` rulings to check against (architectural commitments)
64
+ - `patterns.md` conventions the code should follow
65
+ - `antipatterns.md` known failure patterns to scan for
66
+ - Risks flagged by architect → include in audit checklist
67
+
68
+ If problem-architect not installed: proceed with manual review using available memory files.
69
+
70
+ ---
71
+
51
72
  ## Step 2: Spec Compliance (REQUIRED FIRST)
52
73
 
53
74
  **Assume the implementation may be incomplete or optimistic. Verify independently.**
@@ -57,6 +57,23 @@ Read `.claude/capabilities/manifest.md` if it exists.
57
57
 
58
58
  Detect current level (0–7) from what's present.
59
59
 
60
+ **Existing project deep scan (intelligent-dispatch):**
61
+
62
+ If `.claude` directory exists and project has code files — load `shared/intelligent-dispatch.md` and spawn problem-architect:
63
+ ```
64
+ Task: dream — analyze existing codebase before generating vision
65
+ Current state: {what files, agents, skills already exist}
66
+ Available agents: {list}
67
+ Available skills: {list}
68
+ ```
69
+ Use returned Team Spec to understand:
70
+ - What agents/skills already cover (don't regenerate what exists)
71
+ - Co-change clusters (candidate future agents)
72
+ - Established patterns (vision must not conflict with them)
73
+ - Structural decisions already made (decisions.md)
74
+
75
+ If clean slate (no .claude dir): skip problem-architect, proceed to Phase 3.
76
+
60
77
  **ExitPlanMode** — ready to build.
61
78
 
62
79
  ---
@@ -14,6 +14,20 @@ Load: shared/tdd.md + shared/completion-rule.md before starting.
14
14
 
15
15
  ---
16
16
 
17
+ ## Pre-Flight Analysis (intelligent-dispatch)
18
+
19
+ Load `shared/intelligent-dispatch.md`.
20
+
21
+ After reproducing the error — before investigating — spawn problem-architect if available:
22
+ → Task: "fix — {error description}"
23
+ → Current state: {files involved in the failure}
24
+ → Use returned Team Spec: pre-read the affected files, load patterns/antipatterns for this area
25
+ → Pre-conditions check prevents fixing a symptom instead of the root cause
26
+
27
+ If problem-architect not installed: proceed with Phase 2 manual investigation as normal.
28
+
29
+ ---
30
+
17
31
  ## Phase 1: REPRODUCE
18
32
 
19
33
  **First: check IDE diagnostics (instant, no build needed)**
@@ -18,6 +18,27 @@ Load: shared/completion-rule.md
18
18
 
19
19
  ---
20
20
 
21
+ ## Pre-Flight Analysis (intelligent-dispatch)
22
+
23
+ Load `shared/intelligent-dispatch.md`.
24
+
25
+ Spawn problem-architect before any scan:
26
+ ```
27
+ Task: refactor — {what's being refactored}
28
+ Current state: {target file/function + surrounding directory}
29
+ Available agents: {list}
30
+ Available skills: {list}
31
+ ```
32
+ Use returned Team Spec:
33
+ - Pre-Read Files → read these BEFORE grepping for references (architect already knows the dependency graph)
34
+ - Risks → structural risks the refactor may trigger (e.g., type exports used downstream)
35
+ - Files Written → exhaustive list of files the refactor will touch
36
+ - If Structural Decision: YES → run /debate (refactors sometimes expose architectural choices)
37
+
38
+ If problem-architect not installed: proceed with Phase 1 manual scan.
39
+
40
+ ---
41
+
21
42
  ## Phase 1: Understand Current State
22
43
 
23
44
  If $ARGUMENTS is blank, use **AskUserQuestion**:
@@ -15,6 +15,26 @@ $ARGUMENTS
15
15
 
16
16
  ---
17
17
 
18
+ ## Step 0: Risk Scan (intelligent-dispatch)
19
+
20
+ Load `shared/intelligent-dispatch.md`.
21
+
22
+ If problem-architect available — spawn it for a pre-ship risk scan:
23
+ ```
24
+ Task: ship — pre-ship risk assessment
25
+ Current state: {output of: git diff --stat HEAD}
26
+ Available agents: {list}
27
+ Available skills: {list}
28
+ ```
29
+ Use returned Team Spec:
30
+ - Risks → must address before shipping (not suggestions)
31
+ - Structural Decision: YES → a decision was made without /debate → log it to decisions.md now
32
+ - Pre-Conditions → any unmet condition blocks ship (e.g., migration not run, env var not set)
33
+
34
+ If problem-architect not installed OR git diff is only docs/config: skip and proceed to Pre-Ship Gate.
35
+
36
+ ---
37
+
18
38
  ## Pre-Ship Gate (runs before any commit)
19
39
 
20
40
  **1. IDE diagnostics** — use `mcp__ide__getDiagnostics` if available.