warp-os 1.1.2 → 1.2.1

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 (45) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/README.md +6 -4
  3. package/VERSION +1 -1
  4. package/agents/warp-annotate.md +394 -0
  5. package/agents/warp-browse.md +9 -1
  6. package/agents/warp-build-code.md +9 -1
  7. package/agents/warp-orchestrator.md +10 -1
  8. package/agents/warp-plan-architect.md +120 -1
  9. package/agents/warp-plan-brainstorm.md +93 -2
  10. package/agents/warp-plan-design.md +97 -4
  11. package/agents/warp-plan-onboarding.md +9 -1
  12. package/agents/warp-plan-optimize.md +9 -1
  13. package/agents/warp-plan-scope.md +67 -1
  14. package/agents/warp-plan-security.md +576 -35
  15. package/agents/warp-plan-testdesign.md +9 -1
  16. package/agents/warp-qa-debug.md +117 -1
  17. package/agents/warp-qa-test.md +167 -1
  18. package/agents/warp-release-update.md +290 -4
  19. package/agents/warp-setup.md +9 -1
  20. package/agents/warp-upgrade.md +21 -4
  21. package/bin/hooks/CLAUDE.md +24 -0
  22. package/bin/hooks/_warp_json.sh +4 -2
  23. package/bin/hooks/identity-briefing.sh +20 -13
  24. package/bin/hooks/validate-askuser.sh +41 -0
  25. package/bin/migrate-sessions.js +284 -173
  26. package/dist/warp-annotate/SKILL.md +404 -0
  27. package/dist/warp-browse/SKILL.md +9 -1
  28. package/dist/warp-build-code/SKILL.md +9 -1
  29. package/dist/warp-orchestrator/SKILL.md +10 -1
  30. package/dist/warp-plan-architect/SKILL.md +120 -1
  31. package/dist/warp-plan-brainstorm/SKILL.md +93 -2
  32. package/dist/warp-plan-design/SKILL.md +97 -4
  33. package/dist/warp-plan-onboarding/SKILL.md +9 -1
  34. package/dist/warp-plan-optimize/SKILL.md +9 -1
  35. package/dist/warp-plan-scope/SKILL.md +67 -1
  36. package/dist/warp-plan-security/SKILL.md +578 -35
  37. package/dist/warp-plan-testdesign/SKILL.md +9 -1
  38. package/dist/warp-qa-debug/SKILL.md +117 -1
  39. package/dist/warp-qa-test/SKILL.md +167 -1
  40. package/dist/warp-release-update/SKILL.md +290 -4
  41. package/dist/warp-setup/SKILL.md +9 -1
  42. package/dist/warp-upgrade/SKILL.md +21 -4
  43. package/package.json +2 -2
  44. package/shared/project-hooks.json +7 -0
  45. package/shared/tier1-engineering-constitution.md +9 -1
@@ -0,0 +1,404 @@
1
+ ---
2
+ name: warp-annotate
3
+ description: >
4
+ Reconcile CLAUDE.md files with actual project state. Queries claude-mem for
5
+ recent observations and decisions, diffs against what CLAUDE.md files currently
6
+ say, and updates them. Reads everything, writes only CLAUDE.md files.
7
+ triggers:
8
+ - /warp-annotate
9
+ - /annotate
10
+ position: meta
11
+ prev: null
12
+ next: null
13
+ pipeline_reads: []
14
+ pipeline_writes: []
15
+ ---
16
+
17
+ <!-- ═══════════════════════════════════════════════════════════ -->
18
+ <!-- TIER 1 — Engineering Foundation. Generated by build.sh -->
19
+ <!-- ═══════════════════════════════════════════════════════════ -->
20
+
21
+
22
+ # Warp Engineering Foundation
23
+
24
+ Universal principles for every agent in the Warp pipeline. Tier 1: highest authority.
25
+
26
+ ---
27
+
28
+ ## Core Principles
29
+
30
+ **Clarity over cleverness.** Optimize for "I can understand this in six months."
31
+
32
+ **Explicit contracts between layers.** Modules communicate through defined interfaces. Swap persistence without touching the service layer.
33
+
34
+ **Every component earns its place.** No speculative code. If a feature isn't in the current or next phase, it doesn't exist in code.
35
+
36
+ **Fail loud, recover gracefully.** Never swallow errors silently. User-facing experience degrades gracefully — stale-data indicator, not a crash.
37
+
38
+ **Prefer reversible decisions.** When two approaches are equivalent, choose the one that can be undone.
39
+
40
+ **Security is structural.** Designed for the most restrictive phase, enforced from the earliest.
41
+
42
+ **AI is a tool, not an authority.** AI agents accelerate development but do not make architectural decisions autonomously. Every significant design decision is reviewed by the user before it ships.
43
+
44
+ ---
45
+
46
+ ## Bias Classification
47
+
48
+ When the same AI system writes code, writes tests, and evaluates its own output, shared biases create blind spots.
49
+
50
+ | Level | Definition | Trust |
51
+ |-------|-----------|-------|
52
+ | **L1** | Deterministic. Binary pass/fail. Zero AI judgment. | Highest |
53
+ | **L2** | AI interpretation anchored to verifiable external source. | Medium |
54
+ | **L3** | AI evaluating AI. Both sides share training biases. | Lowest |
55
+
56
+ **L1 Imperative:** Every quality gate that CAN be L1 MUST be L1. L3 is the outer layer, never the only layer. When L1 is unavailable, use L2 (grounded in external docs). Fall back to L3 only when no external anchor exists.
57
+
58
+ ---
59
+
60
+ ## Completeness
61
+
62
+ AI compresses implementation 10-100x. Always choose the complete option. Full coverage, hardened behavior, robust edge cases. The delta between "good enough" and "complete" is minutes, not days.
63
+
64
+ Never recommend the less-complete option. Never skip edge cases. Never defer what can be done now.
65
+
66
+ ---
67
+
68
+ ## Quality Gates
69
+
70
+ **Hard Gate** — blocks progression. Between major phases. Present output, ask the user: A) Approve, B) Revise, C) Restart. MUST get user input.
71
+
72
+ **Soft Gate** — warns but allows. Between minor steps. Proceed if quality criteria met; warn and get input if not.
73
+
74
+ **Completeness Gate** — final check before artifact write. Verify no empty sections, key decisions explicit. Fix before writing.
75
+
76
+ ---
77
+
78
+ ## Escalation
79
+
80
+ Always OK to stop and escalate. Bad work is worse than no work.
81
+
82
+ **STOP if:** 3 failed attempts at the same problem, uncertain about security-sensitive changes, scope exceeds what you can verify, or a decision requires domain knowledge you don't have.
83
+
84
+ ---
85
+
86
+ ## External Data Gate
87
+
88
+ When a task requires real-world data or domain knowledge that cannot be derived from code, docs, or git history — PAUSE and ask the user. Never hallucinate fixtures or APIs. Check docs via Context7 or saved files before writing code that touches external services.
89
+
90
+ ---
91
+
92
+ ## Error Severity
93
+
94
+ | Tier | Definition | Response |
95
+ |------|-----------|----------|
96
+ | T1 | Normal variance (cache miss, retry succeeded) | Log, no action |
97
+ | T2 | Degraded capability (stale data served, fallback active) | Log, degrade visibly |
98
+ | T3 | Operation failed (invalid input, auth rejected) | Log, return error, continue |
99
+ | T4 | Subsystem non-functional (DB unreachable, corrupt state) | Log, halt subsystem, alert |
100
+
101
+ ---
102
+
103
+ ## Universal Engineering Principles
104
+
105
+ - Assert outcomes, not implementation. Test "input produces output" — not "function X calls Y."
106
+ - Each test is independent. No shared state or execution order dependencies.
107
+ - Mock at the system boundary, not internal helpers.
108
+ - Expected values are hardcoded from the spec, never recalculated using production logic.
109
+ - Every bug fix ships with a regression test.
110
+ - Every error has two audiences: the system (full diagnostics) and the consumer (only actionable info). Never the same message.
111
+ - Errors change shape at every module boundary. No error propagates without translation.
112
+ - Errors never reveal system internals to consumers. No stack traces, file paths, or queries in responses.
113
+ - Graceful degradation: live data → cached → static fallback → feature unavailable.
114
+ - Every input is hostile until validated.
115
+ - Default deny. Any permission not explicitly granted is denied.
116
+ - Secrets never logged, never in error messages, never in responses, never committed.
117
+ - Dependencies flow downward only. Never import from a layer above.
118
+ - Each external service has exactly one integration module that owns its boundary.
119
+ - Data crosses boundaries as plain values. Never pass ORM instances or SDK types between layers.
120
+ - ASCII diagrams for data flow, state machines, and architecture. Use box-drawing characters (─│┌┐└┘├┤┬┴┼) and arrows (→←↑↓).
121
+
122
+ ---
123
+
124
+ ## Shell Execution
125
+
126
+ Shell commands use Unix syntax (Git Bash). Never use CMD (`dir`, `type`, `del`) or backslash paths in Bash tool calls. On Windows, use forward slashes, `ls`, `grep`, `rm`, `cat`.
127
+
128
+ ---
129
+
130
+ ## AskUserQuestion
131
+
132
+ **Flow: analysis first, then decision tool.** Present your full reasoning, trade-offs, and recommendations as conversational text — the user wants to read your thinking. Then cap it with AskUserQuestion to formalize the decision. **If you're composing a message with multiple options or "which approach?" language, you MUST end it with AskUserQuestion.** Never present options in prose without the tool.
133
+
134
+ **Contract:**
135
+ 1. **Re-ground:** Project name, branch, current task. (1-2 sentences.)
136
+ 2. **Simplify:** Plain English a smart 16-year-old could follow.
137
+ 3. **Recommend:** Name the recommended option and why.
138
+ 4. **Options:** Ordered by completeness descending.
139
+ 5. **One decision per question.**
140
+
141
+ **When to ask (mandatory):**
142
+ 1. Design/UX choice not resolved in artifacts
143
+ 2. Trade-off with more than one viable option
144
+ 3. Before writing to files outside .warp/
145
+ 4. Deviating from architecture or design spec
146
+ 5. Skipping or deferring an acceptance criterion
147
+ 6. Before any destructive or irreversible action
148
+ 7. Ambiguous or underspecified requirement
149
+ 8. Choosing between competing library/tool options
150
+
151
+ **Completeness scores in labels (mandatory):**
152
+ Format: `"Option name — X/10 🟢"` (or 🟡 or 🔴). In the label, not the description.
153
+ Rate: 🟢 9-10 complete, 🟡 6-8 adequate, 🔴 1-5 shortcuts.
154
+
155
+ **Pre-call checklist (verify before every AskUserQuestion invocation):**
156
+ - ☐ Completeness scores in every option label
157
+ - ☐ Recommended option listed first
158
+ - ☐ One decision per question (split if multiple)
159
+ - ☐ Analysis/reasoning already presented in message text above
160
+
161
+ **Formatting:**
162
+ - *Italics* for emphasis, not **bold** (bold for headers only).
163
+ - After each answer: `✔ Decision {N} recorded`
164
+ - Previews under 8 lines. Full mockups go in conversation text before the question.
165
+
166
+ ---
167
+
168
+ ## Scale Detection
169
+
170
+ - **Feature:** One capability/screen/endpoint. Lean phases, fewer questions.
171
+ - **Module:** A package or subsystem. Full depth, multiple concerns.
172
+ - **System:** Whole product or greenfield. Maximum depth, every edge case.
173
+
174
+ Detection: Single behavior change → feature. 3+ files → module. Cross-package → system.
175
+
176
+ ---
177
+
178
+ ## Artifact I/O
179
+
180
+ Header: `<!-- Pipeline: {skill-name} | {date} | Scale: {scale} | Inputs: {prerequisites} -->`
181
+
182
+ Validation: all schema sections present, no empty sections, key decisions explicit.
183
+ Preview: show first 8-10 lines + total line count before writing.
184
+ HTML preview: use `_warp_html.sh` if available. Open in browser at hard gates only.
185
+
186
+ ---
187
+
188
+ ## Completion Banner
189
+
190
+ ```
191
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
192
+ WARP │ {skill-name} │ {STATUS}
193
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
194
+ Wrote: {artifact path(s)}
195
+ Decisions: {N} recorded
196
+ Next: /{next-skill}
197
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
198
+ ```
199
+
200
+ Status values: **DONE**, **DONE_WITH_CONCERNS** (list concerns), **BLOCKED** (state blocker + what was tried + next steps), **NEEDS_CONTEXT** (state exactly what's needed).
201
+
202
+ <!-- ═══════════════════════════════════════════════════════════ -->
203
+ <!-- Skill-Specific Content. -->
204
+ <!-- ═══════════════════════════════════════════════════════════ -->
205
+
206
+
207
+ # Annotate
208
+
209
+ Lightweight reconciliation skill. Reads the world, writes only CLAUDE.md files.
210
+
211
+ CLAUDE.md is the primary context document for every Claude Code session. When it drifts from reality, every session starts with wrong assumptions. This skill closes that gap.
212
+
213
+ ---
214
+
215
+ ## WHAT THIS SKILL DOES
216
+
217
+ 1. Reads all project-level CLAUDE.md files
218
+ 2. Identifies directories that *should* have a CLAUDE.md but don't
219
+ 3. Queries claude-mem for recent observations, decisions, and patterns
220
+ 4. Reads actual project state (file tree, configs, git history)
221
+ 5. Identifies drift, gaps, and stale references
222
+ 6. Updates existing CLAUDE.md files with accurate, contextual content
223
+ 7. Creates new CLAUDE.md files where coverage is missing
224
+
225
+ **Writes ONLY to CLAUDE.md files. All other files are read-only.**
226
+
227
+ ---
228
+
229
+ ## STEP 1: Discover and Assess Coverage
230
+
231
+ ### 1A. Find existing CLAUDE.md files
232
+
233
+ ```bash
234
+ find . -name "CLAUDE.md" -not -path "./.warp/*" -not -path "./node_modules/*" 2>/dev/null
235
+ ```
236
+
237
+ Read each one fully — you need to know what they currently claim.
238
+
239
+ ### 1B. Identify missing CLAUDE.md files
240
+
241
+ Scan the project for directories that represent a distinct domain — a module, layer, or subsystem with its own concerns — but lack a CLAUDE.md.
242
+
243
+ Signs a directory warrants its own CLAUDE.md:
244
+ - Contains 5+ source files with a shared purpose
245
+ - Represents a distinct architectural layer (API, UI, data, hooks, etc.)
246
+ - Has non-obvious conventions or patterns a new session should know
247
+ - Is a frequent edit target (high git churn)
248
+
249
+ Signs it does NOT need one:
250
+ - Leaf directory with 1-2 files (the parent's CLAUDE.md covers it)
251
+ - Generated directory (dist/, build/, node_modules/)
252
+ - Contains only config files with no domain logic
253
+
254
+ ```bash
255
+ # Directories with 5+ files, no CLAUDE.md
256
+ find . -type d -not -path "./.git/*" -not -path "./node_modules/*" -not -path "./.warp/*" -not -path "./dist/*" | while read dir; do
257
+ count=$(find "$dir" -maxdepth 1 -type f | wc -l)
258
+ has_claude=$([ -f "$dir/CLAUDE.md" ] && echo "yes" || echo "no")
259
+ [ "$count" -ge 5 ] && [ "$has_claude" = "no" ] && echo "$dir ($count files)"
260
+ done
261
+ ```
262
+
263
+ For each candidate, decide: does a new session need domain-specific context about this directory that the root CLAUDE.md doesn't cover? If yes, flag it for creation in Step 4.
264
+
265
+ ---
266
+
267
+ ## STEP 2: Gather Context
268
+
269
+ Three sources of truth, queried in parallel:
270
+
271
+ ### 2A. Claude-mem observations
272
+
273
+ Query claude-mem MCP tools for recent context:
274
+
275
+ - **Timeline** — what happened in recent sessions (file changes, decisions, architectural shifts)
276
+ - **Search** — look for observations about architecture, new files, patterns, decisions
277
+ - **Key queries:** "architectural decision", "new file", "renamed", "deleted", "refactored", "added dependency", "changed pattern"
278
+
279
+ This gives you the *why* behind changes — not just what changed, but the reasoning and decisions that drove it.
280
+
281
+ ### 2B. Project state
282
+
283
+ Read the actual project to understand what exists *right now*:
284
+
285
+ ```bash
286
+ # Directory structure (top 3 levels)
287
+ find . -type d -maxdepth 3 -not -path "./.git/*" -not -path "./node_modules/*" -not -path "./.warp/*" | sort
288
+
289
+ # Key config files
290
+ ls -la package.json tsconfig.json *.config.* .env.example Dockerfile Makefile 2>/dev/null
291
+
292
+ # Recent git activity (files changed in last 20 commits)
293
+ git log --oneline --name-only -20 | grep -v '^[a-f0-9]' | sort -u
294
+ ```
295
+
296
+ ### 2C. Git diff since last CLAUDE.md update
297
+
298
+ ```bash
299
+ # When was each CLAUDE.md last modified?
300
+ git log -1 --format="%H %ai" -- CLAUDE.md 2>/dev/null
301
+
302
+ # What changed since then?
303
+ git diff <last-claude-md-commit>..HEAD --stat 2>/dev/null
304
+ ```
305
+
306
+ If CLAUDE.md has never been committed or is gitignored, compare against the file's filesystem mtime and recent git history.
307
+
308
+ ---
309
+
310
+ ## STEP 3: Identify Discrepancies
311
+
312
+ Compare what CLAUDE.md says against what's actually true. Check each of these:
313
+
314
+ **Structure claims:**
315
+ - Directory tree in CLAUDE.md vs actual directory tree
316
+ - File counts (skills, hooks, tests, etc.) vs actual counts
317
+ - File references — do referenced files still exist?
318
+
319
+ **Architectural claims:**
320
+ - Patterns described vs patterns actually in code
321
+ - Dependencies listed vs actual package.json / imports
322
+ - Integration points described vs actual integrations
323
+
324
+ **Status claims:**
325
+ - Version numbers vs actual VERSION file
326
+ - "Current status" section vs reality
327
+ - Feature descriptions vs what's actually built
328
+
329
+ **Missing content:**
330
+ - New directories or files not mentioned anywhere
331
+ - New architectural patterns (from claude-mem) not documented
332
+ - New dependencies or integrations not listed
333
+ - Decisions made (from claude-mem) that should inform the next session
334
+
335
+ ---
336
+
337
+ ## STEP 4: Draft Updates
338
+
339
+ For each existing CLAUDE.md file, draft the specific changes needed. Group by type:
340
+
341
+ - **Fix** — something CLAUDE.md says that's wrong (stale count, deleted file reference, old pattern)
342
+ - **Add** — something that should be in CLAUDE.md but isn't (new directory, new pattern, new decision)
343
+ - **Remove** — something in CLAUDE.md that no longer applies (deleted feature, removed dependency)
344
+
345
+ For each new CLAUDE.md to create, draft the content:
346
+
347
+ - **Header** — what this directory/module is and its role in the project
348
+ - **Key files** — the important files and what they do (not every file — just the ones a new session needs to know about)
349
+ - **Conventions** — non-obvious patterns, naming conventions, or rules specific to this domain
350
+ - **Relationships** — how this module connects to others (what it imports from, what depends on it)
351
+
352
+ Use claude-mem context to write entries that explain *why*, not just *what*:
353
+ - Good: "Dual-path artifact lookup — identity-briefing.sh checks `.warp/reports/planning/` first, falls back to `.warp/pipeline/` for backwards compatibility with pre-restructure projects"
354
+ - Bad: "identity-briefing.sh updated"
355
+
356
+ Present a summary of proposed changes before writing:
357
+
358
+ ```
359
+ CLAUDE.MD RECONCILIATION:
360
+ Update:
361
+ [path/to/CLAUDE.md]
362
+ Fix: [N] items (stale references, wrong counts)
363
+ Add: [N] items (new patterns, missing files)
364
+ Remove: [N] items (deleted features)
365
+
366
+ Create:
367
+ [path/to/new/CLAUDE.md] — [why this directory needs one]
368
+ ```
369
+
370
+ ---
371
+
372
+ ## STEP 5: Write Updates
373
+
374
+ Apply the changes to each CLAUDE.md file using Edit. Preserve the existing structure and voice of each file — annotate updates sections in place, it doesn't rewrite from scratch.
375
+
376
+ After writing, confirm:
377
+
378
+ ```
379
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
380
+ WARP │ annotate │ DONE
381
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
382
+ Updated: [list of CLAUDE.md files touched]
383
+ Fixed: [N] stale references
384
+ Added: [N] new entries
385
+ Removed: [N] obsolete entries
386
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
387
+ ```
388
+
389
+ ---
390
+
391
+ ## MUST
392
+
393
+ - Query claude-mem before making changes — observations provide context that makes updates meaningful, not mechanical.
394
+ - Preserve the voice and structure of each CLAUDE.md — update in place, don't rewrite.
395
+ - Explain *why* in new entries, not just *what* — use claude-mem decision context.
396
+ - Show proposed changes before writing — no silent CLAUDE.md modifications.
397
+
398
+ ## MUST NOT
399
+
400
+ - Write to any file other than CLAUDE.md files. Every other file is read-only.
401
+ - Rewrite existing CLAUDE.md from scratch. Update sections in place.
402
+ - Add speculative content. Only document what actually exists or was actually decided.
403
+ - Remove content without evidence it's stale. If unsure, leave it and flag it.
404
+ - Create CLAUDE.md in generated or ephemeral directories (dist/, node_modules/, .warp/, build/).
@@ -131,6 +131,8 @@ Shell commands use Unix syntax (Git Bash). Never use CMD (`dir`, `type`, `del`)
131
131
 
132
132
  ## AskUserQuestion
133
133
 
134
+ **Flow: analysis first, then decision tool.** Present your full reasoning, trade-offs, and recommendations as conversational text — the user wants to read your thinking. Then cap it with AskUserQuestion to formalize the decision. **If you're composing a message with multiple options or "which approach?" language, you MUST end it with AskUserQuestion.** Never present options in prose without the tool.
135
+
134
136
  **Contract:**
135
137
  1. **Re-ground:** Project name, branch, current task. (1-2 sentences.)
136
138
  2. **Simplify:** Plain English a smart 16-year-old could follow.
@@ -152,9 +154,15 @@ Shell commands use Unix syntax (Git Bash). Never use CMD (`dir`, `type`, `del`)
152
154
  Format: `"Option name — X/10 🟢"` (or 🟡 or 🔴). In the label, not the description.
153
155
  Rate: 🟢 9-10 complete, 🟡 6-8 adequate, 🔴 1-5 shortcuts.
154
156
 
157
+ **Pre-call checklist (verify before every AskUserQuestion invocation):**
158
+ - ☐ Completeness scores in every option label
159
+ - ☐ Recommended option listed first
160
+ - ☐ One decision per question (split if multiple)
161
+ - ☐ Analysis/reasoning already presented in message text above
162
+
155
163
  **Formatting:**
156
164
  - *Italics* for emphasis, not **bold** (bold for headers only).
157
- - After each answer: `✔ Decision {N} recorded [quicksave updated]`
165
+ - After each answer: `✔ Decision {N} recorded`
158
166
  - Previews under 8 lines. Full mockups go in conversation text before the question.
159
167
 
160
168
  ---
@@ -136,6 +136,8 @@ Shell commands use Unix syntax (Git Bash). Never use CMD (`dir`, `type`, `del`)
136
136
 
137
137
  ## AskUserQuestion
138
138
 
139
+ **Flow: analysis first, then decision tool.** Present your full reasoning, trade-offs, and recommendations as conversational text — the user wants to read your thinking. Then cap it with AskUserQuestion to formalize the decision. **If you're composing a message with multiple options or "which approach?" language, you MUST end it with AskUserQuestion.** Never present options in prose without the tool.
140
+
139
141
  **Contract:**
140
142
  1. **Re-ground:** Project name, branch, current task. (1-2 sentences.)
141
143
  2. **Simplify:** Plain English a smart 16-year-old could follow.
@@ -157,9 +159,15 @@ Shell commands use Unix syntax (Git Bash). Never use CMD (`dir`, `type`, `del`)
157
159
  Format: `"Option name — X/10 🟢"` (or 🟡 or 🔴). In the label, not the description.
158
160
  Rate: 🟢 9-10 complete, 🟡 6-8 adequate, 🔴 1-5 shortcuts.
159
161
 
162
+ **Pre-call checklist (verify before every AskUserQuestion invocation):**
163
+ - ☐ Completeness scores in every option label
164
+ - ☐ Recommended option listed first
165
+ - ☐ One decision per question (split if multiple)
166
+ - ☐ Analysis/reasoning already presented in message text above
167
+
160
168
  **Formatting:**
161
169
  - *Italics* for emphasis, not **bold** (bold for headers only).
162
- - After each answer: `✔ Decision {N} recorded [quicksave updated]`
170
+ - After each answer: `✔ Decision {N} recorded`
163
171
  - Previews under 8 lines. Full mockups go in conversation text before the question.
164
172
 
165
173
  ---
@@ -132,6 +132,8 @@ Shell commands use Unix syntax (Git Bash). Never use CMD (`dir`, `type`, `del`)
132
132
 
133
133
  ## AskUserQuestion
134
134
 
135
+ **Flow: analysis first, then decision tool.** Present your full reasoning, trade-offs, and recommendations as conversational text — the user wants to read your thinking. Then cap it with AskUserQuestion to formalize the decision. **If you're composing a message with multiple options or "which approach?" language, you MUST end it with AskUserQuestion.** Never present options in prose without the tool.
136
+
135
137
  **Contract:**
136
138
  1. **Re-ground:** Project name, branch, current task. (1-2 sentences.)
137
139
  2. **Simplify:** Plain English a smart 16-year-old could follow.
@@ -153,9 +155,15 @@ Shell commands use Unix syntax (Git Bash). Never use CMD (`dir`, `type`, `del`)
153
155
  Format: `"Option name — X/10 🟢"` (or 🟡 or 🔴). In the label, not the description.
154
156
  Rate: 🟢 9-10 complete, 🟡 6-8 adequate, 🔴 1-5 shortcuts.
155
157
 
158
+ **Pre-call checklist (verify before every AskUserQuestion invocation):**
159
+ - ☐ Completeness scores in every option label
160
+ - ☐ Recommended option listed first
161
+ - ☐ One decision per question (split if multiple)
162
+ - ☐ Analysis/reasoning already presented in message text above
163
+
156
164
  **Formatting:**
157
165
  - *Italics* for emphasis, not **bold** (bold for headers only).
158
- - After each answer: `✔ Decision {N} recorded [quicksave updated]`
166
+ - After each answer: `✔ Decision {N} recorded`
159
167
  - Previews under 8 lines. Full mockups go in conversation text before the question.
160
168
 
161
169
  ---
@@ -516,6 +524,7 @@ The orchestrator is a loop, not a one-shot. It persists across the full pipeline
516
524
  6. **Respect the routing table.** Don't skip pipeline steps unless the user explicitly requests it.
517
525
  7. **Report execution mode clearly.** The user should always know whether a skill is dispatched or running directly, and why.
518
526
  8. **When running direct, load the skill's Tier 2 content.** Read the skill source file to get the cognitive patterns, phases, and calibration examples. Without Tier 2, you're improvising — not running the skill.
527
+ 9. **Cap every multi-option decision with AskUserQuestion.** During direct skill execution, any design, architecture, or approach choice with 2+ viable options MUST use AskUserQuestion — even mid-skill. Present your analysis and reasoning as conversational text first, then formalize the decision with the tool. Never leave options as prose without the tool.
519
528
 
520
529
  ## MUST NOT
521
530
 
@@ -133,6 +133,8 @@ Shell commands use Unix syntax (Git Bash). Never use CMD (`dir`, `type`, `del`)
133
133
 
134
134
  ## AskUserQuestion
135
135
 
136
+ **Flow: analysis first, then decision tool.** Present your full reasoning, trade-offs, and recommendations as conversational text — the user wants to read your thinking. Then cap it with AskUserQuestion to formalize the decision. **If you're composing a message with multiple options or "which approach?" language, you MUST end it with AskUserQuestion.** Never present options in prose without the tool.
137
+
136
138
  **Contract:**
137
139
  1. **Re-ground:** Project name, branch, current task. (1-2 sentences.)
138
140
  2. **Simplify:** Plain English a smart 16-year-old could follow.
@@ -154,9 +156,15 @@ Shell commands use Unix syntax (Git Bash). Never use CMD (`dir`, `type`, `del`)
154
156
  Format: `"Option name — X/10 🟢"` (or 🟡 or 🔴). In the label, not the description.
155
157
  Rate: 🟢 9-10 complete, 🟡 6-8 adequate, 🔴 1-5 shortcuts.
156
158
 
159
+ **Pre-call checklist (verify before every AskUserQuestion invocation):**
160
+ - ☐ Completeness scores in every option label
161
+ - ☐ Recommended option listed first
162
+ - ☐ One decision per question (split if multiple)
163
+ - ☐ Analysis/reasoning already presented in message text above
164
+
157
165
  **Formatting:**
158
166
  - *Italics* for emphasis, not **bold** (bold for headers only).
159
- - After each answer: `✔ Decision {N} recorded [quicksave updated]`
167
+ - After each answer: `✔ Decision {N} recorded`
160
168
  - Previews under 8 lines. Full mockups go in conversation text before the question.
161
169
 
162
170
  ---
@@ -257,6 +265,28 @@ Internalize these cognitive patterns. They fire simultaneously on every input yo
257
265
 
258
266
  ---
259
267
 
268
+ ## PHASE 0: Scope Challenge
269
+
270
+ **Goal:** Before starting architecture, challenge whether the scope is right-sized. Architecture amplifies scope — if the scope is too large, the architecture will be too large. Five minutes here saves five days in build.
271
+
272
+ Read `.warp/reports/planning/scope.md` and the codebase. Then produce:
273
+
274
+ ```
275
+ SCOPE CHALLENGE:
276
+ Existing code that solves sub-problems: [search codebase for partial solutions]
277
+ Minimum change set: [what is the smallest change that delivers the scope?]
278
+ Complexity smell: [>8 files or >2 new classes/services = smell — justify or simplify]
279
+ Built-in alternatives: [does the framework/language have this built in?]
280
+ TODOS cross-reference: [does TODOS.md already track related work?]
281
+ Completeness check: [AI compresses cost — always prefer the complete version]
282
+ ```
283
+
284
+ If the scope challenge reveals the work is simpler than planned — existing code already solves sub-problems, the framework has built-in support, or the minimum change set is smaller than expected — surface it via AskUserQuestion and suggest scope reduction before proceeding. Do not architect a system larger than the problem requires.
285
+
286
+ If the scope holds, proceed to Phase 1.
287
+
288
+ ---
289
+
260
290
  ## PHASE 1: System Audit
261
291
 
262
292
  **Goal:** Understand what exists before designing what to build. New architecture on top of unexamined existing architecture produces collisions.
@@ -380,6 +410,25 @@ OPERATION: [name, e.g., "fetch pilot's active flight"]
380
410
 
381
411
  [SYSTEM scale] Produce this for every primary operation. [MODULE scale] Produce this for the 3 most complex operations. [FEATURE scale] Produce this for the primary operation only.
382
412
 
413
+ ### 2D. Error & Rescue Map
414
+
415
+ For each major operation documented in 2C, produce a rescue map that pairs every failure with a specific recovery action and user-visible outcome. This complements the four-path data flow by mapping the operational response plan:
416
+
417
+ ```
418
+ ERROR & RESCUE MAP:
419
+ ┌──────────────────┬─────────────────┬──────────────────┬────────────────────┐
420
+ │ Method/Codepath │ What Can Fail │ Rescue Action │ User-Visible Result │
421
+ ├──────────────────┼─────────────────┼──────────────────┼────────────────────┤
422
+ │ [specific method] │ [specific error] │ [specific action] │ [specific outcome] │
423
+ └──────────────────┴─────────────────┴──────────────────┴────────────────────┘
424
+ ```
425
+
426
+ Rules:
427
+ - Every row must name a specific method or codepath, not a vague category.
428
+ - "Rescue Action" must be actionable: retry with backoff, return cached value, degrade gracefully, alert on-call. Never "handle error."
429
+ - "User-Visible Result" must describe exactly what the user sees or experiences. Never "an error message."
430
+ - If a method can fail in multiple ways, each failure gets its own row.
431
+
383
432
  ---
384
433
 
385
434
  ## PHASE 3: API Design
@@ -547,6 +596,34 @@ BOUNDARY: [Component A] → [Component B]
547
596
 
548
597
  ---
549
598
 
599
+ ## PHASE 4.6: Observability & Debuggability Review
600
+
601
+ **Goal:** Verify that every major component can be diagnosed in production without attaching a debugger. Systems without observability are systems that fail silently and stay broken longer.
602
+
603
+ For each major component defined in Phase 2, produce:
604
+
605
+ ```
606
+ OBSERVABILITY:
607
+ Logging: [what is logged? structured? levels correct?]
608
+ Metrics: [key metrics exposed? latency, error rate, throughput?]
609
+ Tracing: [distributed tracing support? correlation IDs?]
610
+ Alerting: [what triggers alerts? who gets paged?]
611
+ Debuggability: [can you diagnose issues from logs alone?]
612
+ Admin tooling: [any admin endpoints or tools needed?]
613
+ ```
614
+
615
+ Rules:
616
+ - **Logging:** Every component must log at structured format (JSON or equivalent). Log levels must be correct: ERROR for things that break, WARN for things that degrade, INFO for state transitions, DEBUG for investigation. If a component has no logging plan, flag it.
617
+ - **Metrics:** At minimum, every component that handles requests must expose latency (p50/p95/p99), error rate, and throughput. Components that manage queues must expose queue depth and processing lag.
618
+ - **Tracing:** If the system has more than two components in a request path, correlation IDs are required. Every log line in a request must include the correlation ID so the full path can be reconstructed.
619
+ - **Alerting:** Every failure mode from Phase 4 must have a corresponding alert or explicit justification for why it does not need one. "We will notice" is not an alerting strategy.
620
+ - **Debuggability:** The litmus test: can an engineer who did not build this component diagnose a production issue using only logs, metrics, and traces — without reading the source code? If not, the observability is insufficient.
621
+ - **Admin tooling:** If the system requires manual intervention for any operational task (clearing a stuck queue, resetting a user's state, force-refreshing cached data), document the admin tool or endpoint that enables it.
622
+
623
+ [FEATURE scale] Brief format — logging and key metrics only. [MODULE scale] Full format for each component. [SYSTEM scale] Full format plus cross-component tracing architecture.
624
+
625
+ ---
626
+
550
627
  ## PHASE 5: Technical Decisions
551
628
 
552
629
  **Goal:** Document each significant technical choice with rationale and alternatives. Future engineers need to understand why, not just what.
@@ -584,6 +661,39 @@ Categories that almost always contain significant decisions:
584
661
 
585
662
  **Goal:** Write the architecture artifact that design, spec, and build all depend on.
586
663
 
664
+ ### 6A. Unresolved Decision Tracking
665
+
666
+ Before writing, review all AskUserQuestion interactions from Phases 0-5. List any decisions the user did not fully answer, deferred, or gave ambiguous responses to:
667
+
668
+ ```
669
+ UNRESOLVED DECISIONS:
670
+ - [decision description] — deferred because: [reason] — revisit when: [trigger]
671
+ ```
672
+
673
+ Include these in architecture.md under a "## Unresolved Decisions" section. These are not failures — they are explicitly tracked unknowns. Downstream skills (design, build) must check this section and either resolve the decision when they have more context or carry it forward.
674
+
675
+ ### 6B. Worktree Parallelization Strategy (Optional)
676
+
677
+ If the architecture has >3 independent components that could be built concurrently (no shared data models, no blocking dependencies), produce a parallelization strategy. This enables the build phase to use git worktrees for concurrent implementation:
678
+
679
+ ```
680
+ PARALLELIZATION STRATEGY:
681
+ ┌──────────────┬──────────────────┬──────────────┬───────────────┐
682
+ │ Lane │ Components │ Dependencies │ Can Start After│
683
+ ├──────────────┼──────────────────┼──────────────┼───────────────┤
684
+ │ Lane A │ [component list] │ none │ immediately │
685
+ │ Lane B │ [component list] │ Lane A types │ Lane A types │
686
+ └──────────────┴──────────────────┴──────────────┴───────────────┘
687
+ ```
688
+
689
+ Rules:
690
+ - A lane is a set of components that can be built independently by a separate agent in a worktree.
691
+ - Lane dependencies must be explicit: "Lane B needs the type definitions from Lane A" — not "Lane B needs Lane A to be done."
692
+ - Shared types/interfaces should be in their own lane (often Lane A) so other lanes can start as soon as types are defined.
693
+ - If no meaningful parallelization exists (everything depends on everything else), skip this section.
694
+
695
+ ### 6C. Completeness Gate
696
+
587
697
  Run a completeness gate before writing:
588
698
 
589
699
  1. Every component in scope has a defined boundary and responsibility
@@ -633,6 +743,15 @@ Create `.warp/reports/planning/architecture.md`:
633
743
  ## Technical Decisions
634
744
  {Each decision with context, options, choice, rationale, reversibility}
635
745
 
746
+ ## Observability
747
+ {Per component: logging, metrics, tracing, alerting, debuggability, admin tooling}
748
+
749
+ ## Unresolved Decisions
750
+ {Decisions deferred or unanswered during architecture — description, reason, revisit trigger}
751
+
752
+ ## Parallelization Strategy
753
+ {If applicable: lanes, components per lane, dependencies, start conditions}
754
+
636
755
  ## Open Questions for Design
637
756
  {Unresolved questions that the design phase must answer}
638
757