azclaude-copilot 0.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.
Files changed (108) hide show
  1. package/.claude-plugin/marketplace.json +27 -0
  2. package/.claude-plugin/plugin.json +17 -0
  3. package/LICENSE +21 -0
  4. package/README.md +477 -0
  5. package/bin/cli.js +1027 -0
  6. package/bin/copilot.js +228 -0
  7. package/hooks/README.md +3 -0
  8. package/hooks/hooks.json +40 -0
  9. package/package.json +41 -0
  10. package/templates/CLAUDE.md +51 -0
  11. package/templates/agents/cc-cli-integrator.md +104 -0
  12. package/templates/agents/cc-template-author.md +109 -0
  13. package/templates/agents/cc-test-maintainer.md +101 -0
  14. package/templates/agents/code-reviewer.md +136 -0
  15. package/templates/agents/loop-controller.md +118 -0
  16. package/templates/agents/orchestrator-init.md +196 -0
  17. package/templates/agents/test-writer.md +129 -0
  18. package/templates/capabilities/evolution/cycle2-knowledge.md +87 -0
  19. package/templates/capabilities/evolution/cycle3-topology.md +128 -0
  20. package/templates/capabilities/evolution/detect.md +103 -0
  21. package/templates/capabilities/evolution/evaluate.md +90 -0
  22. package/templates/capabilities/evolution/generate.md +123 -0
  23. package/templates/capabilities/evolution/re-derivation.md +77 -0
  24. package/templates/capabilities/intelligence/debate.md +104 -0
  25. package/templates/capabilities/intelligence/elo.md +122 -0
  26. package/templates/capabilities/intelligence/experiment.md +86 -0
  27. package/templates/capabilities/intelligence/opro.md +84 -0
  28. package/templates/capabilities/intelligence/pipeline.md +149 -0
  29. package/templates/capabilities/level-builders/level1-claudemd.md +52 -0
  30. package/templates/capabilities/level-builders/level2-mcp.md +58 -0
  31. package/templates/capabilities/level-builders/level3-skills.md +276 -0
  32. package/templates/capabilities/level-builders/level4-memory.md +72 -0
  33. package/templates/capabilities/level-builders/level5-agents.md +123 -0
  34. package/templates/capabilities/level-builders/level6-hooks.md +119 -0
  35. package/templates/capabilities/level-builders/level7-extmcp.md +60 -0
  36. package/templates/capabilities/level-builders/level8-orchestrated.md +98 -0
  37. package/templates/capabilities/manifest.md +58 -0
  38. package/templates/capabilities/shared/5-layer-agent.md +206 -0
  39. package/templates/capabilities/shared/completion-rule.md +44 -0
  40. package/templates/capabilities/shared/context-artifacts.md +96 -0
  41. package/templates/capabilities/shared/domain-advisor-generator.md +205 -0
  42. package/templates/capabilities/shared/friction-log.md +43 -0
  43. package/templates/capabilities/shared/multi-cli-paths.md +56 -0
  44. package/templates/capabilities/shared/native-tools.md +199 -0
  45. package/templates/capabilities/shared/plan-tracker.md +69 -0
  46. package/templates/capabilities/shared/pressure-test.md +88 -0
  47. package/templates/capabilities/shared/quality-check.md +83 -0
  48. package/templates/capabilities/shared/reflexes.md +159 -0
  49. package/templates/capabilities/shared/review-reception.md +70 -0
  50. package/templates/capabilities/shared/security.md +174 -0
  51. package/templates/capabilities/shared/semantic-boundary-check.md +140 -0
  52. package/templates/capabilities/shared/session-rhythm.md +42 -0
  53. package/templates/capabilities/shared/tdd.md +54 -0
  54. package/templates/capabilities/shared/vocabulary-transform.md +63 -0
  55. package/templates/commands/add.md +152 -0
  56. package/templates/commands/audit.md +123 -0
  57. package/templates/commands/blueprint.md +115 -0
  58. package/templates/commands/copilot.md +157 -0
  59. package/templates/commands/create.md +156 -0
  60. package/templates/commands/debate.md +75 -0
  61. package/templates/commands/deps.md +112 -0
  62. package/templates/commands/doc.md +100 -0
  63. package/templates/commands/dream.md +120 -0
  64. package/templates/commands/evolve.md +170 -0
  65. package/templates/commands/explain.md +25 -0
  66. package/templates/commands/find.md +100 -0
  67. package/templates/commands/fix.md +122 -0
  68. package/templates/commands/hookify.md +100 -0
  69. package/templates/commands/level-up.md +48 -0
  70. package/templates/commands/loop.md +62 -0
  71. package/templates/commands/migrate.md +119 -0
  72. package/templates/commands/persist.md +73 -0
  73. package/templates/commands/pulse.md +87 -0
  74. package/templates/commands/refactor.md +97 -0
  75. package/templates/commands/reflect.md +107 -0
  76. package/templates/commands/reflexes.md +141 -0
  77. package/templates/commands/setup.md +97 -0
  78. package/templates/commands/ship.md +131 -0
  79. package/templates/commands/snapshot.md +70 -0
  80. package/templates/commands/test.md +86 -0
  81. package/templates/hooks/post-tool-use.js +175 -0
  82. package/templates/hooks/stop.js +85 -0
  83. package/templates/hooks/user-prompt.js +96 -0
  84. package/templates/scripts/env-scan.sh +46 -0
  85. package/templates/scripts/import-graph.sh +88 -0
  86. package/templates/scripts/validate-boundaries.sh +180 -0
  87. package/templates/skills/agent-creator/SKILL.md +91 -0
  88. package/templates/skills/agent-creator/examples/sample-agent.md +80 -0
  89. package/templates/skills/agent-creator/references/agent-engineering-guide.md +596 -0
  90. package/templates/skills/agent-creator/references/quality-checklist.md +42 -0
  91. package/templates/skills/agent-creator/scripts/scaffold.sh +144 -0
  92. package/templates/skills/architecture-advisor/SKILL.md +92 -0
  93. package/templates/skills/architecture-advisor/references/database-decisions.md +61 -0
  94. package/templates/skills/architecture-advisor/references/decision-matrices.md +122 -0
  95. package/templates/skills/architecture-advisor/references/rendering-decisions.md +39 -0
  96. package/templates/skills/architecture-advisor/scripts/detect-scale.sh +67 -0
  97. package/templates/skills/debate/SKILL.md +36 -0
  98. package/templates/skills/debate/references/acemad-protocol.md +72 -0
  99. package/templates/skills/env-scanner/SKILL.md +41 -0
  100. package/templates/skills/security/SKILL.md +44 -0
  101. package/templates/skills/security/references/security-details.md +48 -0
  102. package/templates/skills/session-guard/SKILL.md +33 -0
  103. package/templates/skills/skill-creator/SKILL.md +82 -0
  104. package/templates/skills/skill-creator/examples/sample-skill.md +74 -0
  105. package/templates/skills/skill-creator/references/quality-checklist.md +36 -0
  106. package/templates/skills/skill-creator/references/skill-engineering-guide.md +365 -0
  107. package/templates/skills/skill-creator/scripts/scaffold.sh +75 -0
  108. package/templates/skills/test-first/SKILL.md +41 -0
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: create
3
+ description: >
4
+ Build a new command/skill with proper frontmatter, test cases, and evaluation.
5
+ Guided workflow: intent → draft → test → iterate. Creates production-quality commands.
6
+ Triggers on: "create skill", "new command", "build a skill for", "make a command",
7
+ "I want a slash command that", "create a workflow for".
8
+ argument-hint: "[what the skill should do]"
9
+ disable-model-invocation: true
10
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
11
+ ---
12
+
13
+ # /create — Skill Creator
14
+
15
+ $ARGUMENTS
16
+
17
+ ---
18
+
19
+ ## Phase 1: Intent Capture
20
+
21
+ If $ARGUMENTS is blank or vague, use **AskUserQuestion**:
22
+ - What should this skill do? (specific action, not category)
23
+ - When should it trigger? (what phrases or situations)
24
+ - What tools does it need? (Read, Write, Edit, Bash, Glob, Grep, WebSearch, WebFetch)
25
+ - Should it modify files or just report? (read-only vs read-write)
26
+
27
+ ---
28
+
29
+ ## Phase 2: Check for Duplicates
30
+
31
+ Before creating, check if something similar exists:
32
+
33
+ ```bash
34
+ # Check project commands
35
+ grep -li "{keyword}" .claude/commands/*.md 2>/dev/null
36
+
37
+ # Check shared skills
38
+ grep -li "{keyword}" ~/shared-skills/*.md 2>/dev/null
39
+
40
+ # Check capabilities
41
+ grep -i "{keyword}" .claude/capabilities/manifest.md 2>/dev/null
42
+ ```
43
+
44
+ If a match exists: show it. Ask if the user wants to extend it instead of creating new.
45
+
46
+ ---
47
+
48
+ ## Phase 3: Draft the Skill
49
+
50
+ Create `.claude/commands/{name}.md` with this structure:
51
+
52
+ ```markdown
53
+ ---
54
+ name: {name}
55
+ description: >
56
+ {What it does. Include 5+ trigger phrases for reliable invocation.}
57
+ argument-hint: "[{what args it takes}]"
58
+ disable-model-invocation: true
59
+ allowed-tools: {tools list}
60
+ ---
61
+
62
+ # /{name} — {Title}
63
+
64
+ $ARGUMENTS
65
+
66
+ ---
67
+
68
+ ## Step 1: {First action}
69
+ {Clear instructions — what to read, check, or prepare}
70
+
71
+ ---
72
+
73
+ ## Step 2: {Main action}
74
+ {The core work — what to do, how to do it}
75
+
76
+ ---
77
+
78
+ ## Step 3: {Verify}
79
+ {How to confirm it worked — show output, run tests}
80
+
81
+ ---
82
+
83
+ ## Completion Rule
84
+ {What to show as proof — never say "done" without evidence}
85
+ ```
86
+
87
+ **Guidelines:**
88
+ - Description must have 5+ trigger phrases (Claude under-triggers with fewer)
89
+ - Use `disable-model-invocation: true` unless the skill needs free-form reasoning
90
+ - Include a completion rule — every skill must show proof of work
91
+ - Use `$ARGUMENTS` to accept user input
92
+ - Include **AskUserQuestion** fallback for blank arguments
93
+ - Match the style of existing commands in this project
94
+
95
+ ---
96
+
97
+ ## Phase 4: Generate Test Cases
98
+
99
+ Create 2-3 test prompts to verify the skill works:
100
+
101
+ ```bash
102
+ mkdir -p .claude/evals
103
+ ```
104
+
105
+ Write `.claude/evals/{name}-tests.md`:
106
+
107
+ ```markdown
108
+ # Test Cases: /{name}
109
+
110
+ ## Test 1: Basic usage
111
+ Prompt: "/{name} {typical argument}"
112
+ Expected: {what should happen}
113
+
114
+ ## Test 2: No arguments
115
+ Prompt: "/{name}"
116
+ Expected: AskUserQuestion should trigger
117
+
118
+ ## Test 3: Edge case
119
+ Prompt: "/{name} {unusual input}"
120
+ Expected: {graceful handling}
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Phase 5: Validate
126
+
127
+ 1. Read the created skill file — verify frontmatter is correct
128
+ 2. Check it appears in the commands list:
129
+ ```bash
130
+ ls .claude/commands/{name}.md
131
+ ```
132
+ 3. Verify description has 5+ trigger phrases
133
+ 4. Verify completion rule exists
134
+
135
+ ---
136
+
137
+ ## Phase 6: Register (if needed)
138
+
139
+ If this is a command that should ship with azclaude (not just this project):
140
+ - Add to `COMMANDS` array in `bin/cli.js`
141
+ - Add to `templates/commands/`
142
+ - Add tests to `tests/test-features.sh`
143
+ - Add dispatch entry to `templates/CLAUDE.md`
144
+
145
+ For project-only skills: no registration needed — it's already in `.claude/commands/`.
146
+
147
+ ---
148
+
149
+ ## Completion Rule
150
+
151
+ Show:
152
+ 1. The created skill file content
153
+ 2. The test cases
154
+ 3. How to invoke: `/{name} [args]`
155
+
156
+ Do not say "skill created" without showing the file content.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: debate
3
+ description: Adversarial decision protocol for hard architectural choices. Opt-in only — not for routine decisions.
4
+ argument-hint: "[decision or tradeoff to evaluate]"
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # /debate — Adversarial Decision Protocol
9
+
10
+ $ARGUMENTS
11
+
12
+ ---
13
+
14
+ ---
15
+
16
+ ## When to Use This
17
+
18
+ Use when:
19
+ - The decision is genuinely uncertain
20
+ - Multiple criteria are in tension
21
+ - Getting it wrong costs real time to reverse
22
+
23
+ Do NOT use when:
24
+ - The answer is obvious on reflection
25
+ - The decision is reversible and low-cost
26
+ - You just want validation — ask directly instead
27
+
28
+ ---
29
+
30
+ ## Copilot Mode Detection
31
+
32
+ ```bash
33
+ [ -f .claude/copilot-intent.md ] && echo "COPILOT_MODE" || echo "INTERACTIVE_MODE"
34
+ ```
35
+
36
+ If `COPILOT_MODE`:
37
+ - Skip AskUserQuestion — read `.claude/memory/blockers.md` for the blocker context
38
+ - The decision to debate is: how to unblock the stuck milestone
39
+ - Frame options from: the error message, what was tried, and alternative approaches
40
+ - After debate concludes: return the winning approach to /copilot for implementation
41
+ - Record decision in `.claude/memory/decisions.md` as normal
42
+
43
+ If `INTERACTIVE_MODE`: run Frame the Decision as normal.
44
+
45
+ ---
46
+
47
+ ## Frame the Decision
48
+
49
+ If $ARGUMENTS is vague (no clear options stated), use **AskUserQuestion**:
50
+ - What are the options being considered?
51
+ - What constraint matters most? (performance / maintainability / cost / speed)
52
+ - What would make this decision irreversible or costly to reverse?
53
+
54
+ Do not proceed without clear options.
55
+
56
+ ---
57
+
58
+ ## Run the Debate
59
+
60
+ **EnterPlanMode** — the debate protocol is analysis only. No files touched during debate.
61
+
62
+ Read `capabilities/intelligence/debate.md` and execute the full protocol.
63
+
64
+ If the decision involves ranking multiple options (not binary):
65
+ Also read `capabilities/intelligence/elo.md` for pairwise ranking.
66
+
67
+ ---
68
+
69
+ ## Completion Rule
70
+
71
+ **ExitPlanMode** — now record the decision.
72
+
73
+ State the winner, the confidence level, and the one verified claim that decided it.
74
+ Record the decision in `.claude/memory/decisions.md`.
75
+ Do not say "I recommend X" without showing the evidence-weighted reasoning.
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: deps
3
+ description: >
4
+ Audit project dependencies. Find outdated, vulnerable, and unused packages.
5
+ Triggers on: "audit", "dependencies", "outdated packages", "vulnerable",
6
+ "unused imports", "npm audit", "security scan", "check deps", "update packages".
7
+ argument-hint: "[optional: 'outdated', 'security', 'unused', or blank for full audit]"
8
+ disable-model-invocation: true
9
+ allowed-tools: Read, Bash, Glob, Grep
10
+ ---
11
+
12
+ # /deps — Dependency Audit
13
+
14
+ $ARGUMENTS
15
+
16
+ ---
17
+
18
+ ## Step 1: Detect Package Manager
19
+
20
+ ```bash
21
+ ls package.json package-lock.json yarn.lock pnpm-lock.yaml requirements.txt \
22
+ pyproject.toml Cargo.toml go.mod Gemfile 2>/dev/null
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Step 2: Outdated Check
28
+
29
+ ```bash
30
+ # Node.js
31
+ npm outdated 2>&1
32
+
33
+ # Python
34
+ pip list --outdated 2>&1 | head -20
35
+
36
+ # Go
37
+ go list -m -u all 2>&1 | head -20
38
+ ```
39
+
40
+ Classify each outdated package:
41
+ | Type | Risk | Action |
42
+ |------|------|--------|
43
+ | Patch (1.0.0 → 1.0.1) | Low | Update immediately |
44
+ | Minor (1.0.0 → 1.1.0) | Medium | Review changelog, then update |
45
+ | Major (1.0.0 → 2.0.0) | High | Use `/migrate` — breaking changes likely |
46
+
47
+ ---
48
+
49
+ ## Step 3: Security Audit
50
+
51
+ ```bash
52
+ # Node.js
53
+ npm audit 2>&1
54
+
55
+ # Python
56
+ pip audit 2>&1 || safety check 2>&1
57
+
58
+ # Go
59
+ govulncheck ./... 2>&1
60
+ ```
61
+
62
+ For each vulnerability:
63
+ ```
64
+ Package: {name}
65
+ Severity: {critical|high|medium|low}
66
+ CVE: {ID}
67
+ Fix: {version that patches it}
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Step 4: Unused Dependencies (if $ARGUMENTS includes 'unused' or is blank)
73
+
74
+ ```bash
75
+ # Node.js — check package.json deps vs actual imports
76
+ cat package.json | grep -A 100 '"dependencies"' | grep '"' | sed 's/.*"\(.*\)".*/\1/' | while read pkg; do
77
+ grep -r "$pkg" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" \
78
+ -l 2>/dev/null | head -1 | grep -q . || echo "UNUSED: $pkg"
79
+ done
80
+
81
+ # Python — check imports vs requirements
82
+ cat requirements.txt 2>/dev/null | sed 's/[>=<].*//' | while read pkg; do
83
+ grep -r "$pkg" --include="*.py" -l 2>/dev/null | head -1 | grep -q . || echo "UNUSED: $pkg"
84
+ done
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Output Format
90
+
91
+ ```
92
+ ## Dependency Audit — {project name}
93
+
94
+ ### Outdated ({count})
95
+ | Package | Current | Latest | Type | Risk |
96
+ |---------|---------|--------|------|------|
97
+
98
+ ### Vulnerabilities ({count})
99
+ | Package | Severity | CVE | Fix Version |
100
+ |---------|----------|-----|-------------|
101
+
102
+ ### Unused ({count})
103
+ | Package | Last import found |
104
+ |---------|-------------------|
105
+
106
+ ### Recommended Actions
107
+ 1. {highest priority action}
108
+ 2. {next action}
109
+ 3. {next action}
110
+ ```
111
+
112
+ Do not say "audit complete" without showing the tables.
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: doc
3
+ description: >
4
+ Generate or update documentation from code. JSDoc, docstrings, README sections,
5
+ API docs, inline comments. Reads the actual code — never guesses signatures.
6
+ Triggers on: "document", "add docs", "generate docs", "update README",
7
+ "add JSDoc", "add docstrings", "API docs", "explain this code in docs".
8
+ argument-hint: "[file, function, or 'readme' to update]"
9
+ disable-model-invocation: true
10
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
11
+ ---
12
+
13
+ # /doc — Generate Documentation
14
+
15
+ $ARGUMENTS
16
+
17
+ ---
18
+
19
+ ## Phase 1: Detect Scope
20
+
21
+ If $ARGUMENTS is blank, use **AskUserQuestion**:
22
+ - What needs documenting? (specific file, function, or project-level README)
23
+ - What format? (JSDoc, docstring, README section, API reference)
24
+
25
+ Detect documentation style already in the project:
26
+ ```bash
27
+ # Check existing doc patterns
28
+ grep -r "\/\*\*" --include="*.ts" --include="*.js" -l | head -5
29
+ grep -r '"""' --include="*.py" -l | head -5
30
+ grep -r "\/\/\/" --include="*.go" -l | head -5
31
+ ```
32
+
33
+ **Rule: match the existing doc style.** If the project uses JSDoc, write JSDoc. If it uses Google-style docstrings, use that. Never introduce a new doc format.
34
+
35
+ ---
36
+
37
+ ## Phase 2: Read the Code
38
+
39
+ Read every function/class/module you're documenting. Extract:
40
+ - Function signature (params, return type)
41
+ - What it actually does (read the implementation)
42
+ - Edge cases and error conditions
43
+ - Dependencies and side effects
44
+
45
+ **Never document from memory or inference.** Read the code, then write the doc.
46
+
47
+ ```bash
48
+ # For a specific file
49
+ cat {file} | head -100
50
+ # For all exports
51
+ grep -n "export\|module.exports\|def \|func \|public " {file}
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Phase 3: Write Documentation
57
+
58
+ ### For inline docs (JSDoc / docstrings):
59
+ - One doc block per public function/method/class
60
+ - Include: description, @param types, @returns, @throws
61
+ - Skip private/internal functions unless explicitly asked
62
+ - Keep descriptions to 1-2 sentences — what it does, not how
63
+
64
+ ### For README sections:
65
+ - Read existing README first — update, don't duplicate
66
+ - Sections: Installation, Usage, API, Configuration, Examples
67
+ - Include real code examples that actually work
68
+ - Run any example code to verify it works:
69
+ ```bash
70
+ # Verify example works
71
+ node -e "{example code}" 2>&1 | head -10
72
+ ```
73
+
74
+ ### For API reference:
75
+ - Group by module/file
76
+ - Table format: `| Function | Params | Returns | Description |`
77
+ - Include example usage for each endpoint/function
78
+
79
+ ---
80
+
81
+ ## Phase 4: Verify
82
+
83
+ 1. Check docs match the actual code — no stale signatures
84
+ 2. If examples were written: run them to verify
85
+ 3. Lint check if doc linter exists:
86
+ ```bash
87
+ # Check for doc linters
88
+ npx tsc --noEmit 2>&1 | grep "JSDoc" | head -5
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Completion Rule
94
+
95
+ Show:
96
+ 1. List of documented items: `file:line — function/class name`
97
+ 2. Sample of the generated docs (first 2-3 blocks)
98
+ 3. Verification that examples work (if applicable)
99
+
100
+ Do not say "docs updated" without showing what was written.
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: dream
3
+ description: Build a project from an idea — scaffolds rules file, memory, skills, and agents level by level.
4
+ argument-hint: "[project idea and tech stack]"
5
+ disable-model-invocation: true
6
+ context: fork
7
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent
8
+ ---
9
+
10
+ # /dream — Build a Project From an Idea
11
+
12
+ $ARGUMENTS
13
+
14
+ ---
15
+
16
+ ## Copilot Mode Detection
17
+
18
+ ```bash
19
+ [ -f .claude/copilot-intent.md ] && echo "COPILOT_MODE" || echo "INTERACTIVE_MODE"
20
+ ```
21
+
22
+ If `COPILOT_MODE`: skip Phase 1 (AskUserQuestion). Read `.claude/copilot-intent.md` as the
23
+ complete input — it contains the product description, stack, and scope. Extract answers to
24
+ all four questions below from the intent file. If any are missing, infer reasonable defaults
25
+ from the intent rather than asking the user.
26
+
27
+ If `INTERACTIVE_MODE`: run Phase 1 as normal.
28
+
29
+ ---
30
+
31
+ ## Phase 1: Structured Intake
32
+
33
+ **Use AskUserQuestion** to collect all context in one shot. Do not ask in prose.
34
+
35
+ Ask these questions:
36
+ - **What do you want to build?** — the core problem it solves, not just the feature list
37
+ - **Tech stack** — what technologies, or "help me choose"
38
+ - **Who uses this?** — developers / end users / internal team
39
+ - **What is explicitly OUT of scope for v1?** — prevents scope creep from the start
40
+
41
+ If $ARGUMENTS already answers one of these clearly, pre-fill it and only ask what's missing.
42
+
43
+ Do not proceed to Phase 2 until all four answers are collected (or extracted from copilot-intent.md).
44
+
45
+ ---
46
+
47
+ ## Phase 2: Environment Scan
48
+
49
+ Use **EnterPlanMode** — read the environment, do not touch files yet.
50
+
51
+ ```bash
52
+ [ -f CLAUDE.md ] && echo "CLAUDE.md exists" || echo "clean slate"
53
+ [ -d .claude ] && ls .claude/ || echo "no .claude dir"
54
+ ```
55
+
56
+ Read `.claude/capabilities/manifest.md` if it exists.
57
+
58
+ Detect current level (0–7) from what's present.
59
+
60
+ **ExitPlanMode** — ready to build.
61
+
62
+ ---
63
+
64
+ ## Phase 3: Build Level by Level
65
+
66
+ Create **TaskCreate** entries before starting — one per level to build:
67
+ - `L1: CLAUDE.md — rules file`
68
+ - `L2: MCP config`
69
+ - `L3: Skills — project commands`
70
+ - `L4: Memory — goals.md`
71
+ - `L5: Agents`
72
+ - `L6: Hooks`
73
+ - (only create tasks for levels not yet present)
74
+
75
+ For each level:
76
+ 1. **TaskUpdate → in_progress**
77
+ 2. Read the matching `capabilities/level-builders/level{N}.md` — load ONE at a time
78
+ 3. Execute what it says using answers from Phase 1 as input
79
+ 4. Show what was created: file path + one-line purpose
80
+ 5. **TaskUpdate → completed**
81
+
82
+ Spawn `agents/orchestrator-init.md` to fill CLAUDE.md and goals.md with the actual project data.
83
+
84
+ If tech stack is unfamiliar → **WebSearch** "{stack} project structure best practices {year}" before scaffolding.
85
+
86
+ ---
87
+
88
+ ## Phase 3b: Generate Domain Advisor Skill
89
+
90
+ After detecting the project domain in Phase 1/2:
91
+
92
+ 1. Read `capabilities/shared/domain-advisor-generator.md`
93
+ 2. If domain is NOT pure developer (compliance, marketing, finance, medical, research, legal, logistics):
94
+ - Generate `{domain}-advisor/` skill using the domain template
95
+ - Include decision matrices, thresholds, and anti-patterns
96
+ - Run `skill-creator` quality checklist
97
+ 3. If domain IS developer → `architecture-advisor` already covers this (installed by default)
98
+ 4. For multi-domain projects → generate one advisor per domain
99
+
100
+ This gives the copilot evidence-based guidance for domain-specific decisions,
101
+ not just code patterns.
102
+
103
+ ---
104
+
105
+ ## Phase 4: Quality Gate
106
+
107
+ Load `capabilities/shared/quality-check.md` and run all checks.
108
+ All ✓ required before printing "project ready."
109
+
110
+ ---
111
+
112
+ ## Completion Rule
113
+
114
+ Show:
115
+ 1. The created `CLAUDE.md` (full content)
116
+ 2. The created `goals.md` (full content)
117
+ 3. The level checklist (what was built)
118
+ 4. First task to work on
119
+
120
+ Do not say "project ready" without showing these four outputs.