@wazir-dev/cli 1.1.0 → 1.3.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 (138) hide show
  1. package/CHANGELOG.md +74 -10
  2. package/README.md +15 -15
  3. package/assets/demo.cast +47 -0
  4. package/assets/demo.gif +0 -0
  5. package/docs/anti-patterns/AP-23-skipping-enabled-workflows.md +28 -0
  6. package/docs/anti-patterns/AP-24-clarifier-deciding-scope.md +34 -0
  7. package/docs/concepts/architecture.md +1 -1
  8. package/docs/concepts/roles-and-workflows.md +2 -0
  9. package/docs/concepts/why-wazir.md +59 -0
  10. package/docs/decisions/2026-03-19-deferred-items.md +564 -0
  11. package/docs/decisions/2026-03-19-enhancement-decisions.md +300 -0
  12. package/docs/readmes/INDEX.md +21 -5
  13. package/docs/readmes/features/expertise/README.md +2 -2
  14. package/docs/readmes/features/exports/README.md +2 -2
  15. package/docs/readmes/features/hooks/pre-compact-summary.md +1 -1
  16. package/docs/readmes/features/schemas/README.md +3 -0
  17. package/docs/readmes/features/skills/README.md +17 -0
  18. package/docs/readmes/features/skills/clarifier.md +5 -0
  19. package/docs/readmes/features/skills/claude-cli.md +5 -0
  20. package/docs/readmes/features/skills/codex-cli.md +5 -0
  21. package/docs/readmes/features/skills/dispatching-parallel-agents.md +5 -0
  22. package/docs/readmes/features/skills/executing-plans.md +5 -0
  23. package/docs/readmes/features/skills/executor.md +5 -0
  24. package/docs/readmes/features/skills/finishing-a-development-branch.md +5 -0
  25. package/docs/readmes/features/skills/gemini-cli.md +5 -0
  26. package/docs/readmes/features/skills/humanize.md +5 -0
  27. package/docs/readmes/features/skills/init-pipeline.md +5 -0
  28. package/docs/readmes/features/skills/receiving-code-review.md +5 -0
  29. package/docs/readmes/features/skills/requesting-code-review.md +5 -0
  30. package/docs/readmes/features/skills/reviewer.md +5 -0
  31. package/docs/readmes/features/skills/subagent-driven-development.md +5 -0
  32. package/docs/readmes/features/skills/using-git-worktrees.md +5 -0
  33. package/docs/readmes/features/skills/wazir.md +5 -0
  34. package/docs/readmes/features/skills/writing-skills.md +5 -0
  35. package/docs/readmes/features/workflows/prepare-next.md +1 -1
  36. package/docs/reference/configuration-reference.md +47 -6
  37. package/docs/reference/hooks.md +1 -0
  38. package/docs/reference/launch-checklist.md +4 -4
  39. package/docs/reference/review-loop-pattern.md +119 -9
  40. package/docs/reference/roles-reference.md +1 -0
  41. package/docs/reference/skill-tiers.md +147 -0
  42. package/docs/reference/tooling-cli.md +3 -1
  43. package/docs/truth-claims.yaml +12 -0
  44. package/expertise/antipatterns/process/ai-coding-antipatterns.md +214 -1
  45. package/exports/hosts/claude/.claude/commands/plan-review.md +3 -1
  46. package/exports/hosts/claude/.claude/commands/verify.md +30 -1
  47. package/exports/hosts/claude/.claude/settings.json +9 -0
  48. package/exports/hosts/claude/CLAUDE.md +1 -1
  49. package/exports/hosts/claude/export.manifest.json +6 -4
  50. package/exports/hosts/claude/host-package.json +3 -1
  51. package/exports/hosts/codex/AGENTS.md +1 -1
  52. package/exports/hosts/codex/export.manifest.json +6 -4
  53. package/exports/hosts/codex/host-package.json +3 -1
  54. package/exports/hosts/cursor/.cursor/hooks.json +4 -0
  55. package/exports/hosts/cursor/.cursor/rules/wazir-core.mdc +1 -1
  56. package/exports/hosts/cursor/export.manifest.json +6 -4
  57. package/exports/hosts/cursor/host-package.json +3 -1
  58. package/exports/hosts/gemini/GEMINI.md +1 -1
  59. package/exports/hosts/gemini/export.manifest.json +6 -4
  60. package/exports/hosts/gemini/host-package.json +3 -1
  61. package/hooks/context-mode-router +191 -0
  62. package/hooks/definitions/context_mode_router.yaml +19 -0
  63. package/hooks/hooks.json +31 -6
  64. package/hooks/protected-path-write-guard +8 -0
  65. package/hooks/routing-matrix.json +45 -0
  66. package/hooks/session-start +62 -1
  67. package/llms-full.txt +937 -134
  68. package/package.json +2 -4
  69. package/schemas/hook.schema.json +2 -1
  70. package/schemas/phase-report.schema.json +89 -0
  71. package/schemas/usage.schema.json +25 -1
  72. package/schemas/wazir-manifest.schema.json +19 -0
  73. package/skills/brainstorming/SKILL.md +32 -157
  74. package/skills/clarifier/SKILL.md +289 -111
  75. package/skills/claude-cli/SKILL.md +320 -0
  76. package/skills/codex-cli/SKILL.md +260 -0
  77. package/skills/debugging/SKILL.md +13 -0
  78. package/skills/design/SKILL.md +13 -0
  79. package/skills/dispatching-parallel-agents/SKILL.md +13 -0
  80. package/skills/executing-plans/SKILL.md +13 -0
  81. package/skills/executor/SKILL.md +139 -19
  82. package/skills/finishing-a-development-branch/SKILL.md +13 -0
  83. package/skills/gemini-cli/SKILL.md +260 -0
  84. package/skills/humanize/SKILL.md +13 -0
  85. package/skills/init-pipeline/SKILL.md +72 -164
  86. package/skills/prepare-next/SKILL.md +81 -10
  87. package/skills/receiving-code-review/SKILL.md +13 -0
  88. package/skills/requesting-code-review/SKILL.md +13 -0
  89. package/skills/reviewer/SKILL.md +369 -24
  90. package/skills/run-audit/SKILL.md +13 -0
  91. package/skills/scan-project/SKILL.md +13 -0
  92. package/skills/self-audit/SKILL.md +217 -16
  93. package/skills/skill-research/SKILL.md +188 -0
  94. package/skills/subagent-driven-development/SKILL.md +13 -0
  95. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +2 -0
  96. package/skills/subagent-driven-development/implementer-prompt.md +8 -0
  97. package/skills/subagent-driven-development/spec-reviewer-prompt.md +7 -0
  98. package/skills/tdd/SKILL.md +13 -0
  99. package/skills/using-git-worktrees/SKILL.md +13 -0
  100. package/skills/using-skills/SKILL.md +13 -0
  101. package/skills/verification/SKILL.md +54 -3
  102. package/skills/wazir/SKILL.md +464 -381
  103. package/skills/writing-plans/SKILL.md +14 -1
  104. package/skills/writing-skills/SKILL.md +13 -0
  105. package/templates/artifacts/implementation-plan.md +3 -0
  106. package/templates/artifacts/tasks-template.md +133 -0
  107. package/templates/examples/phase-report.example.json +48 -0
  108. package/tooling/src/adapters/composition-engine.js +256 -0
  109. package/tooling/src/adapters/model-router.js +84 -0
  110. package/tooling/src/capture/command.js +41 -2
  111. package/tooling/src/capture/run-config.js +3 -1
  112. package/tooling/src/capture/store.js +56 -0
  113. package/tooling/src/capture/usage.js +106 -0
  114. package/tooling/src/capture/user-input.js +66 -0
  115. package/tooling/src/checks/ac-matrix.js +256 -0
  116. package/tooling/src/checks/command-registry.js +12 -0
  117. package/tooling/src/checks/docs-truth.js +1 -1
  118. package/tooling/src/checks/security-sensitivity.js +69 -0
  119. package/tooling/src/checks/skills.js +111 -0
  120. package/tooling/src/cli.js +31 -20
  121. package/tooling/src/commands/stats.js +161 -0
  122. package/tooling/src/commands/validate.js +5 -1
  123. package/tooling/src/export/compiler.js +33 -37
  124. package/tooling/src/gating/agent.js +145 -0
  125. package/tooling/src/guards/phase-prerequisite-guard.js +185 -0
  126. package/tooling/src/hooks/routing-logic.js +69 -0
  127. package/tooling/src/init/auto-detect.js +258 -0
  128. package/tooling/src/init/command.js +38 -170
  129. package/tooling/src/input/scanner.js +46 -0
  130. package/tooling/src/reports/command.js +103 -0
  131. package/tooling/src/reports/phase-report.js +323 -0
  132. package/tooling/src/state/command.js +160 -0
  133. package/tooling/src/state/db.js +287 -0
  134. package/tooling/src/status/command.js +58 -1
  135. package/tooling/src/verify/proof-collector.js +299 -0
  136. package/wazir.manifest.yaml +26 -14
  137. package/workflows/plan-review.md +3 -1
  138. package/workflows/verify.md +30 -1
@@ -1,208 +1,116 @@
1
1
  ---
2
2
  name: wz:init-pipeline
3
- description: Initialize the Wazir pipeline with interactive setup. Creates project directories, selects mode, and configures the pipeline.
3
+ description: Initialize the Wazir pipeline zero-config by default, auto-detects host and project stack. No mandatory questions.
4
4
  ---
5
5
 
6
6
  # Initialize Pipeline
7
7
 
8
- Set up the Wazir pipeline for this project.
8
+ Set up the Wazir pipeline for this project. **Zero-config by default** — everything is auto-detected and sensibly defaulted. No questions unless the user explicitly asks for interactive mode.
9
9
 
10
- ## Step 0: Check Wazir CLI
10
+ ## Command Routing
11
+ Follow the Canonical Command Matrix in `hooks/routing-matrix.json`.
12
+ - Large commands (test runners, builds, diffs, dependency trees, linting) → context-mode tools
13
+ - Small commands (git status, ls, pwd, wazir CLI) → native Bash
14
+ - If context-mode unavailable, fall back to native Bash with warning
11
15
 
12
- Run `which wazir` to check if the CLI is installed.
16
+ ## Codebase Exploration
17
+ 1. Query `wazir index search-symbols <query>` first
18
+ 2. Use `wazir recall file <path> --tier L1` for targeted reads
19
+ 3. Fall back to direct file reads ONLY for files identified by index queries
20
+ 4. Maximum 10 direct file reads without a justifying index query
21
+ 5. If no index exists: `wazir index build && wazir index summarize --tier all`
22
+
23
+ ## Zero-Config Flow (Default)
24
+
25
+ ### Step 1: Check Wazir CLI
13
26
 
14
- **If installed** — run `wazir init` and let it handle the interactive setup (arrow-key selection). If the pipeline was already initialized, use `wazir init --force` to reinitialize. Once it completes, skip to Step 9 (Confirm).
27
+ Run `which wazir` to check if the CLI is installed.
15
28
 
16
29
  **If not installed**, present:
17
30
 
18
- > **The Wazir CLI is not installed. It's required for event capture, validation, and indexing.**
19
- >
20
- > **How would you like to install it?**
31
+ > **The Wazir CLI is not installed. Install with:**
21
32
  >
22
33
  > 1. **npm** (Recommended) — `npm install -g @wazir-dev/cli`
23
34
  > 2. **Local link** — `npm link` from the Wazir project root
24
- > 3. **Skip** — Continue without the CLI (some features will be unavailable)
25
-
26
- Wait for the user to answer before continuing.
27
35
 
28
- If the user picks 1, run `npm install -g @wazir-dev/cli` and verify with `wazir --version`.
29
- If the user picks 2, run `npm link` from the project root and verify.
30
- If the user picks 3, warn that `wazir capture`, `wazir validate`, and `wazir index` commands will not work, then continue to the manual steps below.
36
+ ### Step 2: Auto-Initialize
31
37
 
32
- After installing, run `wazir init` and let it handle the rest. Skip to Step 9.
38
+ Run `wazir init` (default: auto mode). This automatically:
33
39
 
34
- ---
35
-
36
- **The steps below are the manual fallback — only used when the CLI is not installed and the user chose to skip installation.**
37
-
38
- ## Step 1: Create Project Directories
40
+ 1. **Creates directories:** `.wazir/input/`, `.wazir/state/`, `.wazir/runs/`
41
+ 2. **Detects host:** Claude Code / Codex / Gemini / Cursor from environment variables and file markers
42
+ 3. **Detects project stack:** Language, framework, and stack from package files
43
+ 4. **Detects context-mode MCP:** Checks for core tools (`execute`, `fetch_and_index`, `search`)
44
+ 5. **Writes config** with sensible defaults:
45
+ - `model_mode: "claude-only"` (override: `wazir config set model_mode multi-model`)
46
+ - `default_depth: "standard"` (override per-run: `/wazir deep ...`)
47
+ - `default_intent: "feature"` (inferred per-run from request text)
48
+ 6. **Auto-exports** for the detected host
39
49
 
40
- ```bash
41
- mkdir -p .wazir/input .wazir/state .wazir/runs
42
- ```
50
+ **No questions asked.** The pipeline is ready to use immediately.
43
51
 
44
- ## Step 2: Choose Pipeline Mode
52
+ ### Step 3: Confirm
45
53
 
46
- Present this question:
47
-
48
- > **How should Wazir run in this project?**
54
+ > **Wazir initialized.**
49
55
  >
50
- > 1. **Single model** (Recommended) Everything runs in the current model. Single model, slash commands only.
51
- > 2. **Multi-model** — Still the current model, but routes tasks by complexity (Haiku for micro, Sonnet for standard, Opus for complex).
52
- > 3. **Multi-tool** — Current model + external tools for reviews.
53
-
54
- Wait for the user to answer before continuing.
55
-
56
- ## Step 3: If Multi-Tool, Choose Tools
57
-
58
- Only ask this if the user selected option 3:
59
-
60
- > **Which external tools should Wazir use for reviews?**
56
+ > Host: [detected host] | Stack: [detected language/framework]
61
57
  >
62
- > 1. **Codex** (Recommended) Send reviews to OpenAI Codex
63
- > 2. **Gemini** — Send reviews to Google Gemini
64
- > 3. **Both** — Use Codex and Gemini as secondary reviewers
65
-
66
- Wait for the user to answer before continuing.
67
-
68
- ## Step 3.5: Codex Model (conditional)
69
-
70
- Only ask this if Codex was selected in Step 3:
58
+ > Next: `/wazir <what you want to build>`
71
59
 
72
- > **Which Codex model should Wazir use?**
73
- >
74
- > 1. **gpt-5.3-codex-spark** (Recommended) — Fast, good for review loops and grounder work
75
- > 2. **gpt-5.4** — Slower, deeper analysis for complex reviews
76
- >
77
- > *You can change this later in `.wazir/state/config.json` under `multi_tool.codex.model`.*
60
+ ---
78
61
 
79
- Wait for the user to answer before continuing.
62
+ ## Interactive Flow (Power Users)
80
63
 
81
- ## Step 4: Default Depth
64
+ Triggered by `wazir init --interactive`. For users who want manual control.
82
65
 
83
- > **What default depth should runs use?**
84
- >
85
- > 1. **Quick** — Minimal research, single-pass review, fast execution. Good for small fixes and config changes.
86
- > 2. **Standard** (Recommended) — Balanced research, multi-pass hardening, full review. Good for most features.
87
- > 3. **Deep** — Extended research, thorough hardening, strict review thresholds. Good for complex or security-critical work.
88
- >
89
- > *This sets the project default. Individual runs can override via inline modifiers (e.g. `/wazir quick ...`).*
66
+ ### Pipeline Mode
90
67
 
91
- Wait for the user to answer before continuing.
92
-
93
- ## Step 5: Default Intent
94
-
95
- > **What kind of work does this project mostly involve?**
96
- >
97
- > 1. **Feature** (Recommended) — New functionality or enhancement
98
- > 2. **Bugfix** — Fix broken behavior
99
- > 3. **Refactor** — Restructure without changing behavior
100
- > 4. **Docs** — Documentation only
101
- > 5. **Spike** — Research and exploration, no production code
68
+ > **How should Wazir run in this project?**
102
69
  >
103
- > *This sets the project default. Individual runs can override via inline modifiers or when intent is obvious from the request.*
70
+ > 1. **Single model** (Recommended) slash commands only
71
+ > 2. **Multi-model** — routes sub-tasks to cheapest capable model (Haiku/Sonnet/Opus)
72
+ > 3. **Multi-tool** — current model + external tools for reviews
104
73
 
105
- Wait for the user to answer before continuing.
74
+ **If multi-model selected:** The model router (`tooling/src/adapters/model-router.js`) assigns automatically:
75
+ - **Haiku** for mechanical tasks (URL fetching, file ops, compression)
76
+ - **Sonnet** for comprehension tasks (implementation, reviews, learning extraction)
77
+ - **Opus** for judgment tasks (orchestration, design, spec hardening, final review)
106
78
 
107
- ## Step 6: Agent Teams (conditional)
79
+ Override via `model_overrides` in config.
108
80
 
109
- Only ask this if ALL of these are true:
110
- - The host is Claude Code (not Codex/Gemini/Cursor)
111
- - Default depth is `standard` or `deep`
112
- - Default intent is `feature` or `refactor` (not bugfix/docs/spike)
81
+ ### External Tools (if multi-tool)
113
82
 
114
- > **Would you like to use Agent Teams for parallel execution?**
115
- >
116
- > 1. **No** (Recommended) — Tasks run sequentially. Predictable, lower cost.
117
- > 2. **Yes** — Spawns parallel teammates for independent tasks. Potentially faster and richer output.
83
+ > **Which external tools for reviews?**
118
84
  >
119
- > *Agent Teams is experimental from Claude's side. Requires Opus model. Higher token consumption.*
120
-
121
- If the conditions above are NOT met, silently default to `team_mode: sequential`.
122
-
123
- If the user selects **Yes**, enable the Agent Teams experimental feature:
124
-
125
- ```bash
126
- claude config set env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS 1
127
- ```
128
-
129
- Then inform the user they need to restart their Claude Code session for it to take effect.
130
-
131
- Wait for the user to answer before continuing.
132
-
133
- ## Step 7: Write Config
85
+ > 1. **Codex** (Recommended)
86
+ > 2. **Gemini**
87
+ > 3. **Both**
134
88
 
135
- Create/update `.wazir/state/config.json`:
136
-
137
- - Set `model_mode` to the selected mode (`claude-only`, `multi-model`, or `multi-tool`)
138
- - If `multi-tool`, set `multi_tool.tools` to the selected tools (e.g. `["codex"]`, `["gemini"]`, or `["codex", "gemini"]`)
139
- - Set `default_depth` to the selected depth (`quick`, `standard`, or `deep`)
140
- - Set `default_intent` to the selected intent (`feature`, `bugfix`, `refactor`, `docs`, or `spike`)
141
- - Set `team_mode` to the selected mode (`sequential` or `parallel`)
142
- - If `team_mode` is `parallel`, set `parallel_backend` to `claude_teams`
143
- - If Codex selected, set `multi_tool.codex.model` to the chosen model
144
-
145
- Example for claude-only with defaults:
146
- ```json
147
- {
148
- "model_mode": "claude-only",
149
- "default_depth": "standard",
150
- "default_intent": "feature",
151
- "team_mode": "sequential",
152
- "parallel_backend": "none"
153
- }
154
- ```
155
-
156
- Example for multi-tool with teams enabled:
157
- ```json
158
- {
159
- "model_mode": "multi-tool",
160
- "multi_tool": {
161
- "tools": ["codex"],
162
- "codex": {
163
- "model": "gpt-5.3-codex-spark"
164
- }
165
- },
166
- "default_depth": "deep",
167
- "default_intent": "feature",
168
- "team_mode": "parallel",
169
- "parallel_backend": "claude_teams"
170
- }
171
- ```
172
-
173
- ## Step 8: Runtime-Specific Setup
174
-
175
- Based on `multi_tool.tools`:
176
-
177
- - If **codex** is selected: Create `AGENTS.md` in project root:
178
- ```
179
- # Wazir Pipeline
180
-
181
- Agent protocols are at `~/.claude/agents/` (global).
182
-
183
- ## Running the Pipeline
184
- 1. Clarifier: read and follow `~/.claude/agents/clarifier.md` — tasks are in `.wazir/input/`
185
- 2. Orchestrator: read and follow `~/.claude/agents/orchestrator.md` — start from task 1
186
- 3. Opus Reviewer: read and follow `~/.claude/agents/opus-reviewer.md` — run all phases
89
+ If Codex selected:
90
+ > **Codex model?**
91
+ >
92
+ > 1. **gpt-5.3-codex-spark** (Recommended) Fast review loops
93
+ > 2. **gpt-5.4** Deeper analysis
187
94
 
188
- ## Review Mode
189
- This project uses Codex as a secondary reviewer. Review artifacts are in `.wazir/reviews/`.
190
- ```
95
+ ---
191
96
 
192
- - If **gemini** is selected: Create `GEMINI.md` in project root with the same content adapted for Gemini.
97
+ ## Install Paths
193
98
 
194
- - If **both**: Create both files.
99
+ | Path | Command | Who |
100
+ |------|---------|-----|
101
+ | Plugin marketplace | `/plugin install wazir` | Claude Code users |
102
+ | npx (zero install) | `npx @wazir-dev/cli` | Any Node project |
103
+ | Global install | `npm i -g @wazir-dev/cli` | Power users |
104
+ | Clone + link | `git clone && npm link` | Contributors |
195
105
 
196
- ## Step 9: Confirm
106
+ ## Deep When You Need It
197
107
 
198
- List all files created and show the selected mode. Then present:
108
+ - `wazir config set <key> <value>` override any default
109
+ - `wazir doctor` — see what's configured
110
+ - `wazir stats` — see what Wazir saved you
111
+ - `wazir init --interactive` — full manual setup
199
112
 
200
- > **Pipeline initialized. You can now use:**
201
- >
202
- > - `/wazir <your request>` — Run the full pipeline end-to-end
203
- > - `/clarifier` — Run Phase 0 + Phase 1 only (research, clarify, plan)
204
- > - `/executor` — Run Phase 2 only (autonomous execution)
205
- > - `/reviewer` — Run Phase 3 only (final review and scoring)
113
+ **Principle:** Like git — `git init` is one command, `git config` is deep. Instant start, deep when you need it.
206
114
 
207
115
  ## Interaction Rules
208
116
 
@@ -5,16 +5,87 @@ description: Use after a run or execution slice completes to produce a clean nex
5
5
 
6
6
  # Prepare Next
7
7
 
8
- Create a next-run handoff that captures:
8
+ ## Model Annotation
9
+ When multi-model mode is enabled:
10
+ - **Haiku** for file operations (write-handoff, compress-archive)
11
+ - **Sonnet** for learning extraction (extract-learnings)
9
12
 
10
- - current status
11
- - completed work
12
- - unresolved blockers
13
- - required approvals
14
- - explicitly accepted learnings only
13
+ ## Command Routing
14
+ Follow the Canonical Command Matrix in `hooks/routing-matrix.json`.
15
+ - Large commands (test runners, builds, diffs, dependency trees, linting) → context-mode tools
16
+ - Small commands (git status, ls, pwd, wazir CLI) → native Bash
17
+ - If context-mode unavailable, fall back to native Bash with warning
15
18
 
16
- Rules:
19
+ ## Codebase Exploration
20
+ 1. Query `wazir index search-symbols <query>` first
21
+ 2. Use `wazir recall file <path> --tier L1` for targeted reads
22
+ 3. Fall back to direct file reads ONLY for files identified by index queries
23
+ 4. Maximum 10 direct file reads without a justifying index query
24
+ 5. If no index exists: `wazir index build && wazir index summarize --tier all`
17
25
 
18
- - do not mutate `input/`
19
- - do not auto-load proposed or unreviewed learnings into the next run
20
- - write the handoff using the `templates/artifacts/next-run-handoff.md` structure
26
+ Create a next-run handoff that captures the run outcome and sets up the next session.
27
+
28
+ ## When to Run
29
+
30
+ One of:
31
+
32
+ 1. **Full completion** — All 4 phases are done, review is accepted, learnings are proposed. Prepare the next feature's starting point.
33
+ 2. **Partial completion** — The session is ending before the pipeline finishes. Prepare a mid-pipeline handoff so the next session can resume.
34
+ 3. **Slice boundary** — The approved plan is being executed in multiple slices. Prepare the handoff between slices.
35
+
36
+ ## Step 1: Gather Run State
37
+
38
+ Read from the current run directory:
39
+
40
+ - `run-config.yaml` — run identity, intent, depth
41
+ - `reviews/review.md` — final review verdict and score (if complete)
42
+ - `reviews/` — all review pass logs
43
+ - `artifacts/` — task completion evidence
44
+ - `clarified/` — spec, design, plan artifacts
45
+ - Git log since branch creation: `git log --oneline main..HEAD`
46
+
47
+ ## Step 2: Write Handoff
48
+
49
+ Write to `.wazir/runs/<run-id>/handoff.md` using this structure:
50
+
51
+ ```markdown
52
+ # Handoff — <run-id>
53
+
54
+ **Status:** [Completed | Partial | Slice N of M]
55
+ **Branch:** <branch-name>
56
+ **Date:** YYYY-MM-DD
57
+
58
+ ## What Was Done
59
+ [List of completed tasks with commit hashes]
60
+
61
+ ## Commits
62
+ [git log --oneline of all commits in this run]
63
+
64
+ ## Test Results
65
+ [Test count, pass/fail, validator status]
66
+
67
+ ## Review Score
68
+ [Verdict, score, key findings if applicable]
69
+
70
+ ## What's Next
71
+ [Pending items, deferred work, follow-up tasks]
72
+
73
+ ## Open Bugs
74
+ [Any known issues discovered during this run]
75
+
76
+ ## Learnings From This Run
77
+ [Key insights — what worked, what didn't]
78
+ ```
79
+
80
+ ## Step 3: Run Summary
81
+
82
+ ```bash
83
+ wazir capture summary --run <run-id>
84
+ ```
85
+
86
+ ## Rules
87
+
88
+ - Do NOT mutate `input/` — it belongs to the user
89
+ - Do NOT auto-load proposed or unreviewed learnings into the next run
90
+ - Do NOT carry forward stale context — each new run reads fresh state
91
+ - Do NOT compress or delete files the user might need — only archive verbose intermediate logs
@@ -5,6 +5,19 @@ description: Use when receiving code review feedback, before implementing sugges
5
5
 
6
6
  # Code Review Reception
7
7
 
8
+ ## Command Routing
9
+ Follow the Canonical Command Matrix in `hooks/routing-matrix.json`.
10
+ - Large commands (test runners, builds, diffs, dependency trees, linting) → context-mode tools
11
+ - Small commands (git status, ls, pwd, wazir CLI) → native Bash
12
+ - If context-mode unavailable, fall back to native Bash with warning
13
+
14
+ ## Codebase Exploration
15
+ 1. Query `wazir index search-symbols <query>` first
16
+ 2. Use `wazir recall file <path> --tier L1` for targeted reads
17
+ 3. Fall back to direct file reads ONLY for files identified by index queries
18
+ 4. Maximum 10 direct file reads without a justifying index query
19
+ 5. If no index exists: `wazir index build && wazir index summarize --tier all`
20
+
8
21
  ## Overview
9
22
 
10
23
  Code review requires technical evaluation, not emotional performance.
@@ -5,6 +5,19 @@ description: Use when completing tasks, implementing major features, or before m
5
5
 
6
6
  # Requesting Code Review
7
7
 
8
+ ## Command Routing
9
+ Follow the Canonical Command Matrix in `hooks/routing-matrix.json`.
10
+ - Large commands (test runners, builds, diffs, dependency trees, linting) → context-mode tools
11
+ - Small commands (git status, ls, pwd, wazir CLI) → native Bash
12
+ - If context-mode unavailable, fall back to native Bash with warning
13
+
14
+ ## Codebase Exploration
15
+ 1. Query `wazir index search-symbols <query>` first
16
+ 2. Use `wazir recall file <path> --tier L1` for targeted reads
17
+ 3. Fall back to direct file reads ONLY for files identified by index queries
18
+ 4. Maximum 10 direct file reads without a justifying index query
19
+ 5. If no index exists: `wazir index build && wazir index summarize --tier all`
20
+
8
21
  Dispatch wz:code-reviewer subagent to catch issues before they cascade. The reviewer gets precisely crafted context for evaluation — never your session's history. This keeps the reviewer focused on the work product, not your thought process, and preserves your own context for continued work.
9
22
 
10
23
  **Core principle:** Review early, review often. Review follows the loop pattern in `docs/reference/review-loop-pattern.md`. Dispatch the reviewer with explicit `--mode` and depth-aware loop parameters.