@tgoodington/intuition 8.1.2 → 9.2.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 (116) hide show
  1. package/docs/v9/decision-framework-direction.md +142 -0
  2. package/docs/v9/decision-framework-implementation.md +114 -0
  3. package/docs/v9/domain-adaptive-team-architecture.md +1016 -0
  4. package/docs/v9/test/SESSION_SUMMARY.md +117 -0
  5. package/docs/v9/test/TEST_PLAN.md +119 -0
  6. package/docs/v9/test/blueprints/legal-analyst.md +166 -0
  7. package/docs/v9/test/output/07_cover_letter.md +41 -0
  8. package/docs/v9/test/phase2/mock_plan.md +89 -0
  9. package/docs/v9/test/phase2/producers.json +32 -0
  10. package/docs/v9/test/phase2/specialists/database-architect.specialist.md +10 -0
  11. package/docs/v9/test/phase2/specialists/financial-analyst.specialist.md +10 -0
  12. package/docs/v9/test/phase2/specialists/legal-analyst.specialist.md +10 -0
  13. package/docs/v9/test/phase2/specialists/technical-writer.specialist.md +10 -0
  14. package/docs/v9/test/phase2/team_assignment.json +61 -0
  15. package/docs/v9/test/phase3/blueprints/legal-analyst.md +840 -0
  16. package/docs/v9/test/phase3/legal-analyst-full.specialist.md +111 -0
  17. package/docs/v9/test/phase3/project_context/nh_landlord_tenant_notes.md +35 -0
  18. package/docs/v9/test/phase3/project_context/property_facts.md +32 -0
  19. package/docs/v9/test/phase3b/blueprints/legal-analyst.md +1715 -0
  20. package/docs/v9/test/phase3b/legal-analyst.specialist.md +153 -0
  21. package/docs/v9/test/phase3b/scratch/legal-analyst-stage1.md +270 -0
  22. package/docs/v9/test/phase4/TEST_PLAN.md +32 -0
  23. package/docs/v9/test/phase4/blueprints/financial-analyst-T2.md +538 -0
  24. package/docs/v9/test/phase4/blueprints/legal-analyst-T4.md +253 -0
  25. package/docs/v9/test/phase4/cross-blueprint-check.md +280 -0
  26. package/docs/v9/test/phase4/scratch/financial-analyst-T2-stage1.md +67 -0
  27. package/docs/v9/test/phase4/scratch/legal-analyst-T4-stage1.md +54 -0
  28. package/docs/v9/test/phase4/specialists/financial-analyst.specialist.md +156 -0
  29. package/docs/v9/test/phase4/specialists/legal-analyst.specialist.md +153 -0
  30. package/docs/v9/test/phase5/TEST_PLAN.md +35 -0
  31. package/docs/v9/test/phase5/blueprints/code-architect-hw-vetter.md +375 -0
  32. package/docs/v9/test/phase5/output/04_compliance_checklist.md +149 -0
  33. package/docs/v9/test/phase5/output/hardware-vetter-SKILL-v2.md +561 -0
  34. package/docs/v9/test/phase5/output/hardware-vetter-SKILL.md +459 -0
  35. package/docs/v9/test/phase5/producers/code-writer.producer.md +49 -0
  36. package/docs/v9/test/phase5/producers/document-writer.producer.md +62 -0
  37. package/docs/v9/test/phase5/regression-comparison-v2.md +60 -0
  38. package/docs/v9/test/phase5/regression-comparison.md +197 -0
  39. package/docs/v9/test/phase5/review-5A-specialist.md +213 -0
  40. package/docs/v9/test/phase5/specialist-test/TEST_PLAN.md +60 -0
  41. package/docs/v9/test/phase5/specialist-test/blueprint-comparison.md +252 -0
  42. package/docs/v9/test/phase5/specialist-test/blueprints/code-architect-hw-vetter.md +916 -0
  43. package/docs/v9/test/phase5/specialist-test/scratch/code-architect-stage1.md +427 -0
  44. package/docs/v9/test/phase5/specialists/code-architect.specialist.md +168 -0
  45. package/docs/v9/test/phase5b/TEST_PLAN.md +219 -0
  46. package/docs/v9/test/phase5b/blueprints/5B-10-stage2-with-decisions.md +286 -0
  47. package/docs/v9/test/phase5b/decisions/5B-2-accept-all-decisions.json +68 -0
  48. package/docs/v9/test/phase5b/decisions/5B-3-promote-decisions.json +70 -0
  49. package/docs/v9/test/phase5b/decisions/5B-4-individual-decisions.json +68 -0
  50. package/docs/v9/test/phase5b/decisions/5B-5-triage-decisions.json +110 -0
  51. package/docs/v9/test/phase5b/decisions/5B-6-fallback-decisions.json +40 -0
  52. package/docs/v9/test/phase5b/decisions/5B-8-partial-decisions.json +46 -0
  53. package/docs/v9/test/phase5b/decisions/5B-9-complete-decisions.json +54 -0
  54. package/docs/v9/test/phase5b/scratch/code-architect-stage1.md +133 -0
  55. package/docs/v9/test/phase5b/specialists/code-architect.specialist.md +202 -0
  56. package/docs/v9/test/phase5b/stage1-many-decisions.md +139 -0
  57. package/docs/v9/test/phase5b/stage1-no-assumptions.md +70 -0
  58. package/docs/v9/test/phase5b/stage1-with-assumptions.md +86 -0
  59. package/docs/v9/test/phase5b/test-5B-1-results.md +157 -0
  60. package/docs/v9/test/phase5b/test-5B-10-results.md +130 -0
  61. package/docs/v9/test/phase5b/test-5B-2-results.md +75 -0
  62. package/docs/v9/test/phase5b/test-5B-3-results.md +104 -0
  63. package/docs/v9/test/phase5b/test-5B-4-results.md +114 -0
  64. package/docs/v9/test/phase5b/test-5B-5-results.md +126 -0
  65. package/docs/v9/test/phase5b/test-5B-6-results.md +60 -0
  66. package/docs/v9/test/phase5b/test-5B-7-results.md +141 -0
  67. package/docs/v9/test/phase5b/test-5B-8-results.md +115 -0
  68. package/docs/v9/test/phase5b/test-5B-9-results.md +76 -0
  69. package/docs/v9/test/producers/document-writer.producer.md +62 -0
  70. package/docs/v9/test/specialists/legal-analyst.specialist.md +58 -0
  71. package/package.json +4 -2
  72. package/producers/code-writer/code-writer.producer.md +86 -0
  73. package/producers/data-file-writer/data-file-writer.producer.md +116 -0
  74. package/producers/document-writer/document-writer.producer.md +117 -0
  75. package/producers/form-filler/form-filler.producer.md +99 -0
  76. package/producers/presentation-creator/presentation-creator.producer.md +109 -0
  77. package/producers/spreadsheet-builder/spreadsheet-builder.producer.md +107 -0
  78. package/scripts/install-skills.js +88 -7
  79. package/scripts/uninstall-skills.js +3 -0
  80. package/skills/intuition-agent-advisor/SKILL.md +107 -0
  81. package/skills/intuition-assemble/SKILL.md +261 -0
  82. package/skills/intuition-build/SKILL.md +211 -151
  83. package/skills/intuition-debugger/SKILL.md +4 -4
  84. package/skills/intuition-design/SKILL.md +7 -3
  85. package/skills/intuition-detail/SKILL.md +377 -0
  86. package/skills/intuition-engineer/SKILL.md +8 -4
  87. package/skills/intuition-handoff/SKILL.md +251 -213
  88. package/skills/intuition-handoff/references/handoff_core.md +16 -16
  89. package/skills/intuition-initialize/SKILL.md +20 -5
  90. package/skills/intuition-initialize/references/state_template.json +16 -1
  91. package/skills/intuition-plan/SKILL.md +139 -59
  92. package/skills/intuition-plan/references/magellan_core.md +8 -8
  93. package/skills/intuition-plan/references/templates/plan_template.md +5 -5
  94. package/skills/intuition-prompt/SKILL.md +89 -27
  95. package/skills/intuition-start/SKILL.md +42 -9
  96. package/skills/intuition-start/references/start_core.md +12 -12
  97. package/skills/intuition-test/SKILL.md +345 -0
  98. package/specialists/api-designer/api-designer.specialist.md +291 -0
  99. package/specialists/business-analyst/business-analyst.specialist.md +270 -0
  100. package/specialists/copywriter/copywriter.specialist.md +268 -0
  101. package/specialists/database-architect/database-architect.specialist.md +275 -0
  102. package/specialists/devops-infrastructure/devops-infrastructure.specialist.md +314 -0
  103. package/specialists/financial-analyst/financial-analyst.specialist.md +269 -0
  104. package/specialists/frontend-component/frontend-component.specialist.md +293 -0
  105. package/specialists/instructional-designer/instructional-designer.specialist.md +285 -0
  106. package/specialists/legal-analyst/legal-analyst.specialist.md +260 -0
  107. package/specialists/marketing-strategist/marketing-strategist.specialist.md +281 -0
  108. package/specialists/project-manager/project-manager.specialist.md +266 -0
  109. package/specialists/research-analyst/research-analyst.specialist.md +273 -0
  110. package/specialists/security-auditor/security-auditor.specialist.md +354 -0
  111. package/specialists/technical-writer/technical-writer.specialist.md +275 -0
  112. package/skills/intuition-initialize/references/design_brief_template.md +0 -64
  113. package/skills/intuition-initialize/references/discovery_output_template.json +0 -19
  114. package/skills/intuition-initialize/references/execution_brief_template.md +0 -160
  115. package/skills/intuition-initialize/references/planning_brief_template.md +0 -101
  116. package/skills/intuition-initialize/references/project_plan_template.md +0 -151
@@ -0,0 +1,1016 @@
1
+ # Domain-Adaptive Team Architecture — v9.0 Design Proposal
2
+
3
+ > **Status:** Proposal
4
+ > **Date:** 2026-02-27
5
+ > **Supersedes:** v8.0 Engineer/Build split
6
+ > **Core idea:** Replace fixed design/engineer phases with dynamic domain-specialist teams and format-specific producers
7
+
8
+ ---
9
+
10
+ ## 1. Executive Summary
11
+
12
+ The current Intuition workflow (v8.0/8.1) uses a fixed five-phase pipeline: Prompt → Plan → Design → Engineer → Build. The design and engineer phases are code-centric — design uses ECD for architectural exploration, engineer produces `code_specs.md`, and build delegates to Code Writer subagents.
13
+
14
+ This proposal generalizes the workflow to handle any domain (legal, marketing, financial, creative, technical) by replacing the fixed design/engineer phases with a **dynamic specialist team** assembled after planning, and replacing Code Writer with **format-specific producers** during build.
15
+
16
+ ### The Lawyer/Paralegal Model
17
+
18
+ - **Domain specialists** (Detail phase) act as expert consultants — they know the domain deeply, ask the right questions, extract what's needed from the user, and produce a detailed blueprint
19
+ - **Format producers** (Build phase) act as skilled creators — they take blueprints and produce deliverables in the right output format (Word docs, Excel sheets, slide decks, code files, etc.)
20
+
21
+ ### Phase Flow
22
+
23
+ ```
24
+ Prompt → Handoff → Plan → Handoff (team assembly) → Detail (specialist loop) → Handoff (conflict check + completeness gate) → Build → Handoff → Complete
25
+ ```
26
+
27
+ ---
28
+
29
+ ## 2. Two-Registry Architecture
30
+
31
+ ### 2.1 Domain Specialist Registry (Detail Phase)
32
+
33
+ Domain experts who consult with the user and produce blueprints. They ALWAYS produce a specification/blueprint, never the final deliverable.
34
+
35
+ **Registry tiers (resolution order):**
36
+ 1. **Project-level:** `.claude/specialists/` — team-shared, version-controlled
37
+ 2. **User-level:** `~/.claude/specialists/` — personal library, persists across projects
38
+ 3. **Framework-shipped:** installed by npm package — curated defaults
39
+
40
+ **Profile format:** `{name}.specialist.md` — YAML frontmatter + markdown body
41
+
42
+ ### 2.2 Format Producer Registry (Build Phase)
43
+
44
+ Format-specific creators who produce deliverables from blueprints. They execute what the specialist specified — no domain interpretation.
45
+
46
+ **Registry tiers (same resolution order):**
47
+ 1. **Project-level:** `.claude/producers/`
48
+ 2. **User-level:** `~/.claude/producers/`
49
+ 3. **Framework-shipped:** installed by npm package
50
+
51
+ **Profile format:** `{name}.producer.md` — YAML frontmatter + markdown body
52
+
53
+ ### 2.3 Dynamic Fallback
54
+
55
+ When team assembly encounters tasks that don't match any registered specialist:
56
+ 1. Opus generates a temporary specialist profile
57
+ 2. Profile is stored in `{context_path}/generated-specialists/` (session-only)
58
+ 3. Opus may return null if an existing specialist actually fits (haiku misjudged)
59
+ 4. After build completes, handoff offers to save the generated specialist to the user pool
60
+ 5. At most ONE dynamic specialist per handoff invocation — multiple unmatched tasks require user intervention
61
+
62
+ ---
63
+
64
+ ## 3. Specialist Profile Schema
65
+
66
+ ```yaml
67
+ # {name}.specialist.md
68
+ ---
69
+ name: legal-analyst
70
+ display_name: Legal Analyst
71
+ domain: legal
72
+ description: >
73
+ Analyzes legal requirements, regulatory compliance, contract structures,
74
+ and application procedures. Produces blueprints for legal documents,
75
+ filings, and compliance artifacts.
76
+
77
+ # Detail configuration
78
+ exploration_methodology: ECD # default; can declare custom with justification
79
+ supported_depths: [Deep, Standard, Light]
80
+ default_depth: Deep
81
+
82
+ # Research configuration
83
+ research_patterns:
84
+ - "Find all legal/regulatory reference documents"
85
+ - "Locate existing contracts or legal templates"
86
+ - "Identify compliance requirements in project briefs"
87
+ - "Map jurisdictional constraints"
88
+
89
+ # Blueprint output
90
+ blueprint_sections:
91
+ - "Legal Framework"
92
+ - "Requirements Analysis"
93
+ - "Document Structure"
94
+ - "Clause Library"
95
+ - "Risk Assessment"
96
+
97
+ # Build configuration — what producer to use
98
+ default_producer: document-writer
99
+ default_output_format: docx
100
+
101
+ # Review configuration
102
+ review_criteria:
103
+ - "All regulatory requirements addressed"
104
+ - "Clause language matches jurisdiction requirements"
105
+ - "Cross-references are internally consistent"
106
+ - "Risk factors documented with mitigation strategies"
107
+ mandatory_reviewers: [] # cross-cutting reviewers that always run for this domain
108
+
109
+ # Model configuration
110
+ model: opus # for the specialist itself (detail phase)
111
+ reviewer_model: sonnet # for review during build
112
+ tools: [Read, Write, Glob, Grep, Task, AskUserQuestion]
113
+ ---
114
+
115
+ # Legal Analyst
116
+
117
+ ## Stage 1: Exploration Protocol
118
+
119
+ You are a legal analyst conducting exploration for a legal document task.
120
+
121
+ First, spawn haiku research subagents to read project context files matching your research patterns. Then conduct ECD exploration:
122
+
123
+ ### Elements (E)
124
+ - What legal instruments are required?
125
+ - What parties, obligations, and conditions exist?
126
+ - What regulatory standards apply?
127
+ - What defined terms are needed?
128
+
129
+ ### Connections (C)
130
+ - How do clauses cross-reference each other?
131
+ - What dependency chains exist between obligations?
132
+ - How does this integrate with existing legal framework?
133
+
134
+ ### Dynamics (D)
135
+ - What triggers each obligation?
136
+ - What are the breach/cure/remedy flows?
137
+ - How are amendments and termination handled?
138
+
139
+ Write your findings to the specified stage1.md path. Structure the output as:
140
+ 1. Research Findings (facts discovered from project context)
141
+ 2. ECD Analysis (dimensional exploration results)
142
+ 3. Assumptions (defaults you will use unless the user intervenes — each with a one-line rationale)
143
+ 4. Key Decisions (options with recommended choice, rationale per option, risk if wrong)
144
+ 5. Risks Identified (with severity and mitigation suggestions)
145
+ 6. Recommended Approach (your overall recommendation)
146
+
147
+ **Assumptions vs Decisions:** An assumption has a clear best practice where deviation would be unusual (e.g., file naming convention matching existing patterns, standard model selection). A decision has multiple valid approaches where the user's preference matters (e.g., scope boundaries, architecture choices, depth of error handling). When uncertain, classify as a decision — the user can always accept the recommendation quickly, but they can't intervene on an assumption they never saw.
148
+
149
+ **Format compliance:** Use EXACTLY the heading levels and field labels specified above (`## Assumptions`, `### A1:`, `- **Default**:`, `- **Rationale**:`, `## Key Decisions`, `### D1:`, `- **Options**:`, `- **Recommendation**:`, `- **Risk if wrong**:`). The foreground skill parses by these headings — do not restructure, rename, or nest differently.
150
+
151
+ For Standard depth: abbreviate to Research Findings + Proposed Approach + Assumptions + 1-2 Key Decisions.
152
+
153
+ ## Stage 2: Specification Protocol
154
+
155
+ You are a legal analyst producing a detailed blueprint from approved exploration findings.
156
+
157
+ You will receive: your Stage 1 findings, the user's decisions on each key question, and the confirmed assumptions (including any the user promoted to decisions and resolved).
158
+
159
+ **Research grounding rule:** Every design choice in the blueprint must be traceable to either (a) a finding from your Stage 1 research, (b) a user decision from decisions.json, or (c) a domain standard you can name. Do not invent formulas, thresholds, data structures, or workflows from first principles when your Stage 1 research already established them. When you must make a design choice not covered by Stage 1 or user decisions, note it explicitly in the blueprint's Open Items section.
160
+
161
+ Produce the full blueprint in the universal envelope format (9 sections). The Deliverable Specification (Section 5) must contain actual clause language detailed enough that a document-writer producer can assemble the complete legal document without making any legal decisions. Include:
162
+ - Exact clause text with section numbering
163
+ - Fill-in blanks for execution-time values (dates, names, amounts)
164
+ - All required statutory disclosures with correct citations
165
+ - [VERIFY] flags for items requiring attorney confirmation
166
+
167
+ ## Review Protocol
168
+
169
+ You are reviewing a legal document produced from a blueprint you authored. Find problems.
170
+ Check each review criterion. Flag invented content, omitted content, and blurred legal distinctions.
171
+ Return: PASS or FAIL with specific findings.
172
+ ```
173
+
174
+ ---
175
+
176
+ ## 4. Producer Profile Schema
177
+
178
+ ```yaml
179
+ # {name}.producer.md
180
+ ---
181
+ name: document-writer
182
+ type: producer
183
+ display_name: Document Writer
184
+ description: >
185
+ Produces formatted long-form documents from specialist blueprints.
186
+
187
+ output_formats:
188
+ - markdown # zero-dependency default
189
+ - docx # opt-in, requires tooling
190
+
191
+ tooling:
192
+ markdown:
193
+ required: []
194
+ docx:
195
+ required:
196
+ - python>=3.8
197
+ - python-docx>=0.8.11
198
+ optional:
199
+ - pandoc
200
+
201
+ model: sonnet
202
+ tools: [Read, Write, Edit, Glob, Grep, Bash]
203
+ ---
204
+
205
+ # Document Writer
206
+
207
+ You produce formatted documents from specialist blueprints. You do NOT interpret or expand the content — the blueprint is authoritative. Your job is structure, formatting, and faithful rendering of the blueprint's content.
208
+
209
+ ## Input Protocol
210
+ Read the blueprint at the path provided. Extract:
211
+ - Document type and section structure from the "Producer Handoff" section
212
+ - Required content blocks (in order)
213
+ - Formatting requirements
214
+ - Target output format
215
+
216
+ ## Output Protocol
217
+ - For `markdown`: write directly to `{output_directory}/{output_filename}.md`
218
+ - For `docx`: write a Python script to `{context_path}/scripts/produce_document.py` that uses python-docx, then execute it. Output to `{output_directory}/{output_filename}.docx`
219
+ - NEVER invent content not in the blueprint
220
+ - NEVER reinterpret specialist decisions
221
+ - NEVER make domain-level judgment calls
222
+
223
+ ## Quality Self-Check
224
+ After production: verify section count matches blueprint, all required content blocks present, output file exists and is non-empty.
225
+ ```
226
+
227
+ ---
228
+
229
+ ## 5. Blueprint Format (Universal Envelope)
230
+
231
+ Every specialist produces blueprints following this structure. Sections 1-4, 6-8 are universal and mandatory. Section 5 is the domain-specific payload.
232
+
233
+ ```markdown
234
+ ---
235
+ specialist: {name}
236
+ domain: {domain}
237
+ plan_tasks: [N, M]
238
+ depth: Deep|Standard|Light
239
+ status: draft|approved
240
+ ---
241
+
242
+ # Blueprint: {Title}
243
+
244
+ ## 1. Task Reference
245
+ [Plan task numbers, acceptance criteria copied from plan, dependencies]
246
+
247
+ ## 2. Research Findings
248
+ [What the specialist learned from project context — grounding in facts, not assumptions]
249
+
250
+ ## 3. Approach
251
+ [Chosen strategy with rationale. For Deep tasks: alternatives considered, tradeoffs, why this was selected]
252
+
253
+ ## 4. Decisions Made
254
+ [Explicit list of judgment calls resolved during specialist dialogue. Each includes: the decision, alternatives considered, rationale, and user confirmation status]
255
+
256
+ ## 5. Deliverable Specification
257
+ [The domain-specific payload — this is where the specialist's expertise lives. Structure varies by domain but must be detailed enough that the producer makes zero domain-level decisions]
258
+
259
+ ## 6. Acceptance Mapping
260
+ [How each plan acceptance criterion is addressed by this blueprint. Direct traceability.]
261
+
262
+ ## 7. Integration Points
263
+ [How this blueprint connects to other blueprints, existing project artifacts, or external systems. Enables conflict detection.]
264
+
265
+ ## 8. Open Items
266
+ [Anything unresolved. MUST be empty before completeness gate passes. Non-empty = blueprint incomplete = build will not proceed.]
267
+
268
+ ## 9. Producer Handoff
269
+ [Declares target producer, output format, filename, directory, and any format-specific directives]
270
+
271
+ output_format: docx
272
+ producer: document-writer
273
+ output_filename: zoning-variance-application.docx
274
+ output_directory: {context_path}/output/
275
+
276
+ ### Formatting Requirements
277
+ [Page size, font, section numbering, styling directives — format-specific]
278
+
279
+ ### Content Blocks (in order)
280
+ [Ordered list of content sections with the actual content the producer should render. This is the "95% solved" material that the producer formats and assembles.]
281
+ ```
282
+
283
+ ---
284
+
285
+ ## 6. Review Chain
286
+
287
+ Build executes a three-layer review for every deliverable:
288
+
289
+ ### 6.1 Review Order
290
+
291
+ ```
292
+ Producer creates deliverable
293
+
294
+ 1. Domain Specialist Review (specialist profile as reviewer)
295
+ "Does this deliverable accurately capture what the blueprint specified?
296
+ Are the domain-specific requirements met?"
297
+ → Catches: domain errors, misinterpreted specialist intent, missing nuance
298
+ ↓ (only if specialist passes)
299
+ 2. Builder Verification (build manager)
300
+ "Do the plan's acceptance criteria pass?
301
+ Is the deliverable complete against the blueprint's acceptance mapping?"
302
+ → Catches: structural gaps, unaddressed acceptance criteria, missing sections
303
+ ↓ (only if builder passes)
304
+ 3. Mandatory Cross-Cutting Reviewers (if configured in specialist profile)
305
+ Domain-specific safety nets (e.g., security-auditor for code, legal compliance for marketing)
306
+ → Catches: cross-cutting concerns the specialist and builder aren't looking for
307
+ ```
308
+
309
+ ### 6.2 Review Failure Handling
310
+
311
+ - Specialist rejects → back to producer with specialist feedback. No builder review yet.
312
+ - Specialist passes, builder rejects → back to producer with builder feedback.
313
+ - Cross-cutting reviewer rejects → back to producer with reviewer findings.
314
+ - After 2 failed cycles on the same issue → escalate to user via build report.
315
+
316
+ ### 6.3 Review Prompting
317
+
318
+ All reviews use adversarial prompting: "Find problems with this deliverable" not "Review this deliverable." Build frames every review as "Your job is to reject insufficient work."
319
+
320
+ ### 6.4 Model Tiers
321
+
322
+ - Producer: declared in producer profile (typically sonnet)
323
+ - Specialist reviewer: declared in specialist profile (`reviewer_model`, typically sonnet)
324
+ - Builder verification: build manager itself (sonnet)
325
+ - Cross-cutting reviewers: declared in their own specialist profiles
326
+ - Rule: reviewer tier >= producer tier
327
+
328
+ ---
329
+
330
+ ## 7. Plan Phase Changes
331
+
332
+ ### 7.1 Section 6 — Task Sequence (Updated)
333
+
334
+ Each task gains two new fields:
335
+
336
+ ```markdown
337
+ ### Task [N]: [Title]
338
+ - **Domain**: [free-text domain descriptor — e.g., "legal/regulatory", "marketing/copy", "code/backend"]
339
+ - **Depth**: Deep | Standard | Light
340
+ - **Component**: [which architectural component or project area]
341
+ - **Description**: [WHAT to do]
342
+ - **Acceptance Criteria**: [outcome-based, verifiable]
343
+ - **Dependencies**: [Task numbers] or "None"
344
+ - **Files**: [Specific paths] or "TBD"
345
+ ```
346
+
347
+ **Domain** is a free-text descriptor. Plan does NOT reference specialist names. Team assembly matches domains to specialists.
348
+
349
+ **Depth** controls specialist invocation mode:
350
+ - **Deep** — full exploration → user confirmation gate → specification. For novel territory, multiple valid approaches, or high-stakes decisions.
351
+ - **Standard** — research → 1-2 confirmation questions → blueprint. For clear paths with a few key decisions.
352
+ - **Light** — research → blueprint produced autonomously. For straightforward, pattern-following tasks.
353
+
354
+ ### 7.2 Section 6.5 — Detail Assessment (Replaces Design Recommendations)
355
+
356
+ ```markdown
357
+ ### 6.5 Detail Assessment
358
+
359
+ | Task(s) | Domain | Depth | Rationale |
360
+ |---------|--------|-------|-----------|
361
+ | Task 3, 4 | legal/regulatory | Deep — design exploration required | Novel regulatory territory, multiple valid approaches |
362
+ | Task 7 | code/api | Standard — confirmation needed | Follows existing patterns, one key decision |
363
+ | Task 1, 2 | code/frontend | Light — autonomous | Straightforward pattern application |
364
+ ```
365
+
366
+ ### 7.3 Section 10 — Planning Context for Detail Phase (Replaces Planning Context for Engineer)
367
+
368
+ ```markdown
369
+ ### 10. Planning Context for Detail Phase
370
+ - **Domain-Specific Considerations**: [per-domain notes — legal constraints, brand guidelines, data quality issues, performance targets]
371
+ - **Cross-Domain Dependencies**: [where specialist outputs must coordinate]
372
+ - **Sequencing Considerations**: [what depends on what across domains]
373
+ - **Open Questions**: [questions the detail phase must resolve, tagged by domain]
374
+ - **Constraints**: [hard boundaries per domain]
375
+ ```
376
+
377
+ ### 7.4 What Doesn't Change in Plan
378
+
379
+ - ARCH framework (Actors, Reach, Choices, Homestretch) — already domain-agnostic
380
+ - Sections 1-5, 7-9 of plan.md
381
+ - Plan stays registry-ignorant — never references specialist names or profiles
382
+ - Acceptance criteria remain outcome-based, not implementation-prescriptive
383
+
384
+ ---
385
+
386
+ ## 8. Team Assembly (Handoff Transition)
387
+
388
+ ### 8.1 When It Runs
389
+
390
+ During the plan→detail handoff transition (replacing current transitions 2/2B).
391
+
392
+ ### 8.2 Mechanism
393
+
394
+ Constrained haiku LLM pass:
395
+
396
+ ```
397
+ Input:
398
+ - Plan task list with Domain and Depth fields
399
+ - Available specialist names + domain_tags (from registry scan)
400
+ - Available producer names + output_formats (from registry scan)
401
+
402
+ Output (team_assignment.json):
403
+ {
404
+ "specialist_assignments": [
405
+ {
406
+ "specialist": "legal-analyst",
407
+ "tasks": [
408
+ {"task_id": "T1", "depth": "Deep"},
409
+ {"task_id": "T4", "depth": "Light"}
410
+ ],
411
+ "rationale": "Tasks involve regulatory compliance and legal document drafting"
412
+ }
413
+ ],
414
+ "producer_assignments": [
415
+ {
416
+ "specialist": "legal-analyst",
417
+ "producer": "document-writer",
418
+ "output_format": "docx",
419
+ "tasks_output_files": ["deliverables/01_lease_agreement.md"]
420
+ }
421
+ ],
422
+ "execution_order": [
423
+ {"phase": 1, "specialists": ["legal-analyst", "financial-analyst"], "rationale": "No dependencies, run in parallel"},
424
+ {"phase": 2, "specialists": ["marketing-strategist"], "rationale": "Depends on financial-analyst pricing"}
425
+ ],
426
+ "dependencies": [
427
+ {"specialist": "marketing-strategist", "reads_blueprint_from": "financial-analyst", "reason": "Listing copy needs pricing from rental analysis"}
428
+ ],
429
+ "unmatched_tasks": [
430
+ {"task_id": "T3", "title": "Create Listing Copy", "domain": "marketing/copy", "reason": "No specialist with marketing domain_tags"}
431
+ ],
432
+ "prerequisite_check": {
433
+ "document-writer/docx": "PASS — python-docx 0.8.11 found",
434
+ "code-writer": "PASS — no prerequisites"
435
+ }
436
+ }
437
+
438
+ Notes on schema:
439
+ - `specialist_assignments[].tasks` is per-task with individual depth, replacing the flat `task_ids` + single `depth` field
440
+ - `dependencies` is for CROSS-SPECIALIST dependencies only. Same-specialist task sequencing (e.g., T2 before T5, both financial-analyst) is handled via `execution_order` phases
441
+ - `execution_order` includes rationale for each phase
442
+ ```
443
+
444
+ ### 8.3 Prerequisite Checking
445
+
446
+ Runs at assembly time for all selected producers. Checks tooling requirements via Bash. If a required tool is missing, assembly halts with install instructions — user finds out before starting specialist dialogue, not after.
447
+
448
+ ### 8.4 User Confirmation
449
+
450
+ Assembly presents the proposed team and asks user to confirm before proceeding. User can override producer selections, adjust specialist assignments, or add/remove specialists.
451
+
452
+ ---
453
+
454
+ ## 9. Detail Phase (Specialist Loop)
455
+
456
+ ### 9.1 Architecture: Foreground Skill + Two Fresh Subagents
457
+
458
+ The `intuition-detail` skill runs as a **foreground opus skill** that orchestrates specialist subagents. It does NOT try to be the specialist itself — it handles user interaction and disk I/O while specialist subagents handle domain work.
459
+
460
+ **Why this pattern:** Task subagents cannot sustain multi-turn AskUserQuestion conversations. The foreground skill handles the one thing subagents can't (interactive user dialogue) while specialist subagents handle domain expertise (exploration and specification).
461
+
462
+ ```
463
+ intuition-detail skill (foreground, opus)
464
+
465
+ ├── Reads specialist profile from disk
466
+ ├── Parses Stage 1 protocol + Stage 2 protocol sections
467
+
468
+ ├── STAGE 1: Spawns exploration subagent (opus)
469
+ │ → System prompt = specialist's Stage 1 protocol
470
+ │ → Context = plan tasks + research patterns + prior blueprints
471
+ │ → Writes {context_path}/scratch/{specialist-name}-stage1.md
472
+ │ → Returns summary
473
+
474
+ ├── USER GATE: Skill reads stage1.md
475
+ │ → Phase 1: Present assumptions as group, user accepts or promotes any to decisions
476
+ │ → Phase 2: Present each decision with 2-3 options (recommended first, rationale, Other)
477
+ │ → Adaptive presentation based on decision count (see 9.8)
478
+ │ → Writes decisions to {context_path}/scratch/{specialist-name}-decisions.json
479
+ │ → (Deep: full assumptions review + all decisions)
480
+ │ → (Standard: assumptions + decisions, streamlined presentation)
481
+ │ → (Light: skip gate entirely)
482
+
483
+ ├── STAGE 2: Spawns specification subagent (opus, FRESH — not resumed)
484
+ │ → System prompt = specialist's Stage 2 protocol
485
+ │ → Injected context = stage1.md contents + decisions.json
486
+ │ → Writes {context_path}/blueprints/{specialist-name}.md
487
+
488
+ └── Confirms blueprint written, routes to next specialist or handoff
489
+ ```
490
+
491
+ **Key design decisions:**
492
+ - Stage 2 is a **fresh subagent**, not a resumed one. Resume is unreliable for this purpose — context may degrade. Stage 2 gets Stage 1 findings as injected content, not conversation history.
493
+ - **Disk as handoff**: `stage1.md` and `decisions.json` persist between stages, survive `/clear` or crashes. If the gate is interrupted, the skill reads `decisions.json` on restart and resumes from the last unanswered decision.
494
+ - **No "chameleon" behavior**: The skill does not adopt the specialist's persona. It reads the profile, extracts the right protocol section, and injects it as the subagent's system prompt. Domain intelligence stays in the subagents.
495
+ - **User controls engagement depth**: The gate presents assumptions separately from decisions. The user chooses how much to engage — accept all assumptions and blow through decisions quickly, or promote assumptions and deliberate on each one.
496
+
497
+ ### 9.2 Specialist Profile Structure (Two-Protocol Format)
498
+
499
+ Specialist profiles MUST contain two named sections in their body that the `intuition-detail` skill parses and injects into the appropriate subagent:
500
+
501
+ ```markdown
502
+ ## Stage 1: Exploration Protocol
503
+ [What the exploration subagent does]
504
+ - Research patterns and what to look for
505
+ - Exploration methodology (ECD dimensions or custom)
506
+ - What decisions to surface for user
507
+ - How to structure the stage1.md output file
508
+ - Risks and considerations to flag
509
+
510
+ ## Stage 2: Specification Protocol
511
+ [What the specification subagent does]
512
+ - Blueprint sections to produce
513
+ - How to incorporate user decisions from Stage 1
514
+ - Deliverable specification format
515
+ - Completeness requirements
516
+ - Producer handoff format
517
+ ```
518
+
519
+ The foreground skill extracts sections by heading — trivial parsing, no complex logic.
520
+
521
+ ### 9.3 Depth-Controlled Execution
522
+
523
+ Depth controls the **floor** of the gate protocol, not the ceiling. A Standard task can still surface many decisions if the research warrants it — depth determines how much infrastructure the gate provides, not how many questions the specialist can ask.
524
+
525
+ **Deep tasks (two-stage with full gate):**
526
+ 1. **Stage 1 subagent** runs full exploration protocol (ECD or custom methodology). Writes structured findings to `{context_path}/scratch/{specialist-name}-stage1.md` including: dimensional analysis, assumptions with rationale, decisions with options and recommendations, risks, and areas needing user input.
527
+ 2. **User gate** (foreground skill): Full gate protocol (see 9.8). Phase 1: present assumptions, user accepts or promotes. Phase 2: present decisions individually with options (recommended first, rationale per option, Other available). Writes resolved state to `{context_path}/scratch/{specialist-name}-decisions.json`.
528
+ 3. **Stage 2 subagent** receives stage1.md + decisions.json. Produces the full blueprint in the universal envelope format.
529
+
530
+ **Standard tasks (confirmatory):**
531
+ 1. **Stage 1 subagent** runs abbreviated exploration — research + proposed approach + assumptions + 1-2 key decisions. Writes concise findings to stage1.md.
532
+ 2. **User gate** (foreground skill): Streamlined gate. Presents assumptions and decisions together in a single summary, asks for confirmation or overrides. Same structure as Deep but more compact presentation.
533
+ 3. **Stage 2 subagent** produces blueprint with confirmed approach.
534
+
535
+ **Light tasks (autonomous — no user gate):**
536
+ 1. **Single subagent** runs both exploration and specification in one pass. Writes blueprint directly to `{context_path}/blueprints/{specialist-name}.md`. No stage1.md, no user interaction. All items treated as assumptions — the specialist uses its best judgment.
537
+ 2. User reviews the completed blueprint (via the completeness gate, not during production).
538
+
539
+ ### 9.4 ECD as Default Exploration Methodology
540
+
541
+ Every specialist MUST declare an exploration methodology in their Stage 1 protocol. If none is declared, ECD (Elements, Connections, Dynamics) is applied automatically. Specialists may replace ECD with a domain-native methodology as long as it satisfies: **tracked dimensional exploration with explicit coverage gates before moving to specification.**
542
+
543
+ ### 9.5 Research-Before-Dialogue
544
+
545
+ Every specialist's Stage 1 protocol begins with research subagents (haiku) reading relevant project context. Research targets are domain-appropriate (defined in the specialist's `research_patterns` field). The Stage 1 subagent spawns its own haiku research subagents before performing exploration. External research is NOT attempted — if the specialist needs external references, the user must place them in the project.
546
+
547
+ ### 9.6 Specialist Re-Routing
548
+
549
+ If a Stage 1 subagent discovers mid-exploration that the task belongs to a different domain, it flags this in its stage1.md output. The foreground skill presents the re-route recommendation to the user and can reassign to a different specialist without losing the exploration context (stage1.md is already on disk).
550
+
551
+ ### 9.7 Scratch File Lifecycle
552
+
553
+ Stage 1 scratch files (`{context_path}/scratch/{specialist-name}-stage1.md`) are intermediate artifacts:
554
+ - Created by Stage 1 subagent
555
+ - Read by the foreground skill for user presentation
556
+ - Injected into Stage 2 subagent as context
557
+ - Retained for auditability after blueprint is complete
558
+ - Not consumed by build phase (build reads blueprints only)
559
+
560
+ Decision files (`{context_path}/scratch/{specialist-name}-decisions.json`) are gate output artifacts:
561
+ - Created incrementally by the foreground skill during the user gate
562
+ - Each decision/assumption is written as it's resolved (crash recovery)
563
+ - Injected into Stage 2 subagent alongside stage1.md
564
+ - Retained for auditability
565
+
566
+ ### 9.8 User Gate Protocol
567
+
568
+ The user gate is the foreground skill's core responsibility. It translates Stage 1's domain-expert output into a human-friendly consultation, collects the user's input, and produces structured decisions for Stage 2.
569
+
570
+ #### 9.8.1 Stage 1 Output Format
571
+
572
+ Stage 1 writes stage1.md with these sections (in order):
573
+
574
+ ```markdown
575
+ ## Research Findings
576
+ [Facts from codebase research — file paths, schemas, patterns, constraints]
577
+
578
+ ## ECD Analysis (or domain-equivalent exploration)
579
+ [Dimensional exploration results]
580
+
581
+ ## Assumptions
582
+ ### A1: [Title]
583
+ - **Default**: [what the specialist will do]
584
+ - **Rationale**: [why this is the obvious choice]
585
+
586
+ ### A2: [Title]
587
+ ...
588
+
589
+ ## Key Decisions
590
+ ### D1: [Title]
591
+ - **Options**:
592
+ - A) [option — recommended]: [rationale]
593
+ - B) [option]: [rationale]
594
+ - C) [option]: [rationale]
595
+ - **Recommendation**: A, because [reason]
596
+ - **Risk if wrong**: [what happens if this decision is made poorly]
597
+
598
+ ### D2: [Title]
599
+ ...
600
+
601
+ ## Risks Identified
602
+ [Each risk with severity and mitigation]
603
+
604
+ ## Recommended Approach
605
+ [Overall recommendation summarizing the proposed direction]
606
+ ```
607
+
608
+ The assumptions/decisions split is the specialist's best judgment. The user gate allows reclassification.
609
+
610
+ **Format compliance:** Stage 1 MUST use exactly the heading levels and field labels specified above. Do not restructure, rename, or nest differently. The foreground skill parses stage1.md by these exact headings — creative reformatting will break the gate.
611
+
612
+ #### 9.8.2 Gate Phase 1: Assumptions Review
613
+
614
+ **Fallback:** If stage1.md contains no `## Assumptions` section, treat all items under `## Key Decisions` as decisions and skip Phase 1 entirely. This handles specialist profiles that omit the assumptions/decisions guidance or older profiles that haven't been updated.
615
+
616
+ The skill presents all assumptions as a group:
617
+
618
+ ```
619
+ The specialist proposes these defaults:
620
+
621
+ A1: [Title] — [Default] ([one-line rationale])
622
+ A2: [Title] — [Default] ([one-line rationale])
623
+ A3: [Title] — [Default] ([one-line rationale])
624
+ ...
625
+
626
+ Accept all, or tell me which ones you want to weigh in on.
627
+ ```
628
+
629
+ Use AskUserQuestion with options:
630
+ - "Accept all assumptions" (recommended)
631
+ - "I want to review some of these"
632
+
633
+ If the user wants to review: ask which assumptions to promote. For each promoted assumption, present a simple AskUserQuestion:
634
+
635
+ ```
636
+ The specialist planned to use [default] for [title]. What would you prefer?
637
+ ```
638
+
639
+ Options:
640
+ - "[Default] (specialist's recommendation)"
641
+ - "Something else — I'll describe what I want"
642
+
643
+ The skill does NOT construct domain-specific alternatives — that would require domain reasoning the orchestrator shouldn't do. The user provides the alternative directly, and it gets recorded as a promoted assumption with their override text. Stage 2 interprets it in domain context.
644
+
645
+ #### 9.8.3 Gate Phase 2: Decisions
646
+
647
+ Present each decision using AskUserQuestion with 2-3 options. The recommended option appears first with "(Recommended)" appended. Each option includes a brief rationale. "Other" is always available (AskUserQuestion provides this automatically).
648
+
649
+ **Adaptive presentation based on decision count:**
650
+
651
+ - **1-7 decisions**: Present each individually via AskUserQuestion. One question per decision. Full rationale per option. This is the common case — most tasks surface fewer than 8 decisions.
652
+ - **8+ decisions**: Present a summary table first showing all decisions with the specialist's recommendations. Use AskUserQuestion with `multiSelect: true` to ask: "Which of these do you want to discuss? The rest will go with the specialist's recommendation." Then present only the selected decisions individually.
653
+
654
+ For "Other" responses: the skill accepts the user's alternative without validation. The specialist in Stage 2 will work with whatever the user decided. If the choice causes downstream problems, they'll surface in the blueprint's Open Items or in the review chain during build.
655
+
656
+ #### 9.8.4 Decisions File Format
657
+
658
+ The gate writes decisions incrementally to `{context_path}/scratch/{specialist-name}-decisions.json`:
659
+
660
+ ```json
661
+ {
662
+ "specialist": "legal-analyst",
663
+ "gate_started": "2026-02-27T14:30:00Z",
664
+ "gate_completed": null,
665
+ "assumptions": [
666
+ {
667
+ "id": "A1",
668
+ "title": "File naming convention",
669
+ "default": "hardware_eval_YYYY-MM-DD_[slug].md",
670
+ "status": "accepted",
671
+ "user_override": null
672
+ },
673
+ {
674
+ "id": "A2",
675
+ "title": "Model selection",
676
+ "default": "sonnet",
677
+ "status": "promoted",
678
+ "user_override": "opus",
679
+ "rationale": "User wants deeper reasoning for analysis"
680
+ }
681
+ ],
682
+ "decisions": [
683
+ {
684
+ "id": "D1",
685
+ "title": "Blueprint scope",
686
+ "context": "Task 2 deliverable already exists as a 708-line skill. Options range from patching to full rewrite.",
687
+ "options": ["A: Full rewrite (recommended)", "B: Patch existing", "C: Review only"],
688
+ "chosen": "A",
689
+ "user_input": null
690
+ },
691
+ {
692
+ "id": "D2",
693
+ "title": "Error handling depth",
694
+ "context": "Stage 1 identified 12 possible error cases. The existing implementation handles 7.",
695
+ "options": ["A: Comprehensive (recommended)", "B: Minimal"],
696
+ "chosen": "other",
697
+ "user_input": "Match the 7 cases from the existing implementation, don't add new ones"
698
+ }
699
+ ]
700
+ }
701
+ ```
702
+
703
+ The `context` field gives Stage 2 enough background to act on each decision (especially "Other" choices) without re-reading stage1.md to find the relevant section. The foreground skill populates it from the decision's surrounding context in stage1.md.
704
+
705
+ **Read-before-write rule:** After each user response, the skill MUST Read the current decisions.json from disk, update it with the new answer, and Write the full file back. Do not rely on conversation memory for previously collected answers — auto-compaction may discard earlier state. The file on disk is the source of truth.
706
+
707
+ `gate_completed` is set to a timestamp when all items are resolved.
708
+
709
+ #### 9.8.5 Crash Recovery
710
+
711
+ On startup, the detail skill MUST re-read the detail brief from disk to determine which specialist and task it's working on. Do not rely on conversation history for this context — `/clear` erases it.
712
+
713
+ If the detail skill starts and finds an existing `decisions.json` with `gate_completed: null`:
714
+ 1. Re-read stage1.md to restore the full assumptions and decisions list
715
+ 2. Read decisions.json to determine what's been answered
716
+ 3. Present a summary: "Found an in-progress consultation. You've answered X of Y items. Resuming from [next item]."
717
+ 4. Continue the gate from the first unresolved item
718
+ 5. Do NOT re-ask resolved items
719
+
720
+ If the skill starts and finds `decisions.json` with `gate_completed` set (and no blueprint exists yet):
721
+ 1. The gate is done — skip directly to Stage 2
722
+ 2. Present a summary: "Found completed consultation from [timestamp]. Proceeding to blueprint generation."
723
+
724
+ ---
725
+
726
+ ## 10. Conflict Detection and Completeness Gate
727
+
728
+ ### 10.1 Post-Blueprint Conflict Detection
729
+
730
+ After ALL specialists complete their blueprints, a haiku subagent runs a conflict scan:
731
+
732
+ - Reads all blueprints in `{context_path}/blueprints/`
733
+ - Flags: contradictory decisions, overlapping file modifications, inconsistent interface assumptions, duplicated work
734
+ - Writes `{context_path}/blueprint-conflicts.md`
735
+ - If conflicts found → presented to user for resolution before proceeding
736
+ - If clean → proceeds to completeness gate
737
+
738
+ ### 10.2 Completeness Gate
739
+
740
+ For each blueprint:
741
+ - Section 8 "Open Items" must be empty
742
+ - All mandatory blueprint sections must be present and non-empty
743
+ - Acceptance mapping must address every plan acceptance criterion
744
+ - Producer handoff section must reference a valid producer from the registry
745
+
746
+ If any blueprint fails the gate → escalated to user, build does not start.
747
+
748
+ ---
749
+
750
+ ## 11. Build Phase Changes
751
+
752
+ ### 11.1 Build's Role (Unchanged Principle)
753
+
754
+ Build is a **domain-agnostic process engine**. It delegates, orchestrates, and verifies. It makes NO domain decisions. All domain intelligence lives in specialist profiles, producer profiles, and blueprints.
755
+
756
+ ### 11.2 Delegation
757
+
758
+ For each task:
759
+ 1. Read the blueprint's Producer Handoff section
760
+ 2. Load the declared producer's profile from the registry
761
+ 3. Construct the delegation prompt using the producer profile's template
762
+ 4. Spawn the producer as a Task subagent
763
+
764
+ ### 11.3 Review Chain
765
+
766
+ Three-layer review per deliverable (see Section 6):
767
+ 1. Domain specialist review (catches domain errors)
768
+ 2. Builder verification (catches acceptance criteria gaps)
769
+ 3. Mandatory cross-cutting reviewers (catches cross-domain concerns)
770
+
771
+ ### 11.4 Build Report (Extended)
772
+
773
+ ```markdown
774
+ # Build Report
775
+
776
+ ## Task Results
777
+
778
+ ### Task N: [Title]
779
+ - **Domain**: legal/regulatory
780
+ - **Specialist**: legal-analyst
781
+ - **Producer**: document-writer (docx)
782
+ - **Output**: {context_path}/output/zoning-variance-application.docx
783
+ - **Status**: PASS | FAIL | PARTIAL
784
+
785
+ #### Review Chain
786
+ 1. **Specialist Review** (legal-analyst): PASS — "All regulatory requirements addressed, clause language appropriate for jurisdiction"
787
+ 2. **Builder Verification**: PASS — "All 4 acceptance criteria met"
788
+ 3. **Cross-Cutting Review**: N/A — no mandatory reviewers configured
789
+
790
+ #### Deviations from Blueprint
791
+ [Any deviations and rationale]
792
+
793
+ #### External Dependencies
794
+ [Anything requiring human action — e.g., "Requires review by licensed attorney before filing"]
795
+ ```
796
+
797
+ ---
798
+
799
+ ## 12. Handoff Transitions (Updated)
800
+
801
+ | # | Transition | Description |
802
+ |---|-----------|-------------|
803
+ | 0 | Branch creation | No change |
804
+ | 1 | Prompt → Plan | No change |
805
+ | 2 | Plan → Detail | **Runs team assembly.** Scans registries, runs constrained haiku matching, prerequisite checks, writes `team_assignment.json`, generates first specialist brief. |
806
+ | 3 | Specialist → Specialist | **Replaces design→design loop.** Tracks completed blueprints, routes to next specialist per dependency order, passes prior blueprints as context. |
807
+ | 4 | Detail → Build | **New: conflict check + completeness gate.** Runs haiku conflict detection, validates all blueprints, generates build brief. |
808
+ | 5 | Build → Complete | **Extended.** Reads build report, includes domain field, review chain results, external dependency flags. Offers git commit/push. Routes to `/intuition-start`. v9 with code-writer routes through test phase first (Transition 6.5v9 → 7). |
809
+
810
+ ### State Schema (v7.0)
811
+
812
+ ```json
813
+ {
814
+ "detail": {
815
+ "started": false,
816
+ "completed": false,
817
+ "team_assignment": null,
818
+ "specialists": [
819
+ {
820
+ "name": "legal-analyst",
821
+ "tasks": [
822
+ {"task_id": "T1", "depth": "Deep"},
823
+ {"task_id": "T3", "depth": "Light"}
824
+ ],
825
+ "status": "pending|in_progress|completed",
826
+ "stage": "stage1|user_gate|stage2|done",
827
+ "stage1_path": null,
828
+ "decisions_path": null,
829
+ "blueprint_path": null
830
+ }
831
+ ],
832
+ "current_specialist": null,
833
+ "execution_phase": 1,
834
+ "conflict_check": {
835
+ "ran": false,
836
+ "passed": false,
837
+ "issues": []
838
+ },
839
+ "completeness_gate": {
840
+ "ran": false,
841
+ "passed": false,
842
+ "failures": []
843
+ }
844
+ }
845
+ }
846
+ ```
847
+
848
+ Replaces the current `design` and `engineering` state objects.
849
+
850
+ ---
851
+
852
+ ## 13. Shipped Rosters
853
+
854
+ ### 13.1 Domain Specialists (14)
855
+
856
+ **Code/Technical (5):**
857
+ | Name | Domain | Default Depth |
858
+ |------|--------|---------------|
859
+ | database-architect | database | Standard |
860
+ | api-designer | api | Standard |
861
+ | frontend-component | frontend/ui | Standard |
862
+ | security-auditor | security | Deep |
863
+ | devops-infrastructure | devops/infra | Standard |
864
+
865
+ **Professional/Business (5):**
866
+ | Name | Domain | Default Depth |
867
+ |------|--------|---------------|
868
+ | legal-analyst | legal/regulatory | Deep |
869
+ | financial-analyst | financial | Deep |
870
+ | marketing-strategist | marketing | Deep |
871
+ | project-manager | project-management | Standard |
872
+ | business-analyst | business/requirements | Deep |
873
+
874
+ **Content/Creative (4):**
875
+ | Name | Domain | Default Depth |
876
+ |------|--------|---------------|
877
+ | technical-writer | documentation | Standard |
878
+ | copywriter | marketing/copy | Standard |
879
+ | research-analyst | research/analysis | Deep |
880
+ | instructional-designer | education/training | Deep |
881
+
882
+ ### 13.2 Format Producers (6)
883
+
884
+ | Name | Formats | Default | Tooling (opt-in) |
885
+ |------|---------|---------|------------------|
886
+ | code-writer | source files | N/A | N/A |
887
+ | document-writer | markdown, docx | markdown | python-docx |
888
+ | spreadsheet-builder | CSV, xlsx | CSV | openpyxl |
889
+ | presentation-creator | markdown, pptx | markdown | python-pptx |
890
+ | form-filler | markdown, pdf | markdown | reportlab / fpdf2 |
891
+ | data-file-writer | JSON, YAML, XML | JSON | N/A |
892
+
893
+ Each producer operates in two modes:
894
+ - **Markdown/text mode** (zero dependencies) — ships as default
895
+ - **Native format mode** (opt-in) — requires tooling, checked at team assembly
896
+
897
+ ---
898
+
899
+ ## 14. Decisions Log
900
+
901
+ Key architectural decisions made during roundtable and rationale:
902
+
903
+ | # | Decision | Rationale |
904
+ |---|----------|-----------|
905
+ | D1 | Two separate registries (specialists + producers) | Different lookup patterns, different schemas, cleaner separation |
906
+ | D2 | Plan stays registry-ignorant | Prevents coupling, avoids plan overreach, domain descriptors are sufficient |
907
+ | D3 | ECD as default exploration methodology with opt-out | Prevents "empty methodology" failure while allowing domain-native alternatives |
908
+ | D4 | Depth-controlled specialist invocation (Deep/Standard/Light) | Preserves divergent exploration for complex tasks without overhead on simple ones |
909
+ | D5 | Two-stage specialist invocation for Deep tasks | Protects the divergent/convergent split that design/engineer currently enforce |
910
+ | D6 | Specialists always produce specs, never final deliverables | Lawyer/paralegal model — expert consults, creator produces |
911
+ | D7 | Three-layer review: specialist + builder + cross-cutting | Domain accuracy, acceptance criteria, and cross-domain concerns each get a dedicated check |
912
+ | D8 | Build stays domain-agnostic, one management strategy | Domain intelligence in registry + blueprints, not in build logic |
913
+ | D9 | Team assembly in handoff via constrained haiku LLM pass | Prevents hallucinated specialists, keeps assembly cheap and fast |
914
+ | D10 | Dependency ordering + conflict detection (no lead specialist) | More reliable than a designated lead, avoids single point of failure |
915
+ | D11 | Prerequisite checking at team assembly time | User discovers missing tools before investing time in specialist dialogue |
916
+ | D12 | Specialist declares producer in blueprint, user overrides at assembly | Authority chain: specialist recommends, user decides, build executes |
917
+ | D13 | Dynamic fallback with temp storage + opt-in save | Handles long-tail domains without polluting the curated registry |
918
+ | D14 | Markdown producers as zero-dep default, native formats opt-in | Broad accessibility, no forced dependencies |
919
+ | D15 | Both specialist and builder review producer output | Domain correctness (specialist) + acceptance criteria (builder) = comprehensive coverage |
920
+ | D16 | Foreground skill + two fresh subagents for Deep mode | Subagents can't sustain multi-turn AskUserQuestion; skill handles user gate, subagents handle domain work; resume is unreliable — use fresh Stage 2 with Stage 1 findings injected |
921
+ | D17 | Specialist profiles split into Stage 1 + Stage 2 protocols | Foreground skill parses by heading, injects right section into each subagent; keeps single file per specialist |
922
+ | D18 | Disk as handoff between stages (stage1.md) | Persists between stages, survives /clear or breaks, auditable |
923
+ | D19 | Assumptions/decisions separation in Stage 1 output | User controls engagement depth — accept defaults quickly or promote assumptions to decisions. Prevents both decision fatigue (too many questions) and surprise (specialist made choices user didn't know about) |
924
+ | D20 | Adaptive gate presentation based on decision count | 1-7 individual, 8+ triage table with multiSelect. Clustering (4-7 range) dropped — unreliable semantic grouping by the orchestrator, and 7 individual questions isn't overwhelming |
925
+ | D21 | Incremental decisions.json for crash recovery | Each resolved item written immediately. Gate resumes from last unanswered item on restart. No lost work from crashes or /clear |
926
+ | D22 | No validation loop — user's "Other" choices accepted directly | Simplicity over safety nets. Stage 2 can flag risks in the blueprint. Review chain catches problems during build. Avoids over-engineering the gate with speculative pushback |
927
+ | D23 | Greenfield-first design — Stage 2 invents grounded designs, not transcriptions | Projects are typically greenfield (no existing artifact to reproduce). Stage 2's job is grounded invention: design choices traceable to Stage 1 research, user decisions, or named domain standards. "Faithfulness" means research-grounded, not reference-matching. No Reference Behavior input, no deviation flags, no faithfulness checks against prior implementations |
928
+
929
+ ---
930
+
931
+ ## 15. Risk Mitigation
932
+
933
+ | Risk | Mitigation |
934
+ |------|-----------|
935
+ | Coherence loss from multiple specialists | Dependency ordering at assembly + post-blueprint haiku conflict detection |
936
+ | Shallow blueprints that build can't execute | Completeness gate (Section 8 empty, all sections present, acceptance mapping complete) |
937
+ | Dynamic fallback producing low-quality specialists | Opus can return null, temp storage only, max 1 per invocation, explicit save opt-in |
938
+ | Wrong specialist assigned to task | Re-routing supported mid-exploration; user confirms team at assembly |
939
+ | Haiku model insufficient for some producers | Model tier declared in producer profile, reviewer tier >= producer tier |
940
+ | Prerequisites missing at build time | Checked at team assembly, halts with install instructions before specialist dialogue |
941
+ | Prompt drift on dynamic specialists | Registry-first matching; dynamic is explicitly flagged fallback |
942
+ | User overwhelm from team complexity | Light-depth tasks run autonomously; user only interacts on Deep tasks. Assumptions/decisions split lets user fast-track when they trust the specialist |
943
+ | Gate interrupted by crash or /clear | decisions.json written incrementally; gate resumes from last unanswered item |
944
+
945
+ ---
946
+
947
+ ## 16. Critical Path (Build Order)
948
+
949
+ ### Phase 1: Blueprint + Build Prototype
950
+ - One specialist profile (database-architect) with full schema
951
+ - One blueprint produced manually following the universal format
952
+ - Build skill modified to read a blueprint instead of code_specs.md
953
+ - One producer profile (code-writer) adapted from existing Code Writer
954
+ - **Validate:** Build can delegate and verify from a blueprint
955
+
956
+ ### Phase 2: Team Assembly Prototype
957
+ - Haiku LLM pass that reads plan annotations + registry, returns JSON
958
+ - Prerequisite checking logic
959
+ - **Validate:** Assignments are sensible, prerequisites caught, runs in <5 seconds
960
+
961
+ ### Phase 3: Single Specialist Deep Mode
962
+ - Detail skill that loads a specialist profile and runs explore/specify flow
963
+ - Test with database-architect on a Deep-tier task
964
+ - **Validate:** ECD exploration works, user gate functions, blueprint matches format
965
+
966
+ ### Phase 4: Multi-Specialist Coordination
967
+ - Specialist loop in handoff
968
+ - Conflict detection pass
969
+ - **Validate:** Later specialists receive earlier blueprints, conflicts detected
970
+
971
+ ### Phase 5: Producer Diversity
972
+ - All 6 producer profiles
973
+ - Native format mode for document-writer (python-docx)
974
+ - **Validate:** Non-code deliverables produced correctly
975
+
976
+ ### Phase 6: Full Roster + Registry
977
+ - All 14 specialist profiles (test-strategist absorbed into test skill)
978
+ - Directory scanning resolution
979
+ - Dynamic fallback generation
980
+ - Save-to-user-pool flow
981
+
982
+ ### Phase 7: Integration + Migration
983
+ - State schema v7.0 (v6.0 added detail, v7.0 added test)
984
+ - All handoff transitions updated (including test transitions 6.5v9 and 7)
985
+ - Plan skill updated with Domain/Depth fields
986
+ - Design + Engineer skills deprecated
987
+ - Full end-to-end test
988
+
989
+ ---
990
+
991
+ ## 17. Migration Notes
992
+
993
+ ### What Gets Deprecated
994
+ - `intuition-design` skill (absorbed into Detail phase specialist loop)
995
+ - `intuition-engineer` skill (absorbed into Detail phase specialist loop)
996
+ - `code_specs.md` artifact (replaced by `blueprints/{specialist}.md`)
997
+ - `design_spec_*.md` artifacts (replaced by blueprints)
998
+
999
+ ### What Gets Added
1000
+ - `intuition-detail` skill (new — orchestrates specialist loop)
1001
+ - `.specialist.md` file type + registry
1002
+ - `.producer.md` file type + registry
1003
+ - `team_assignment.json` artifact
1004
+ - `blueprints/` directory in context path
1005
+ - `blueprint-conflicts.md` artifact
1006
+
1007
+ ### What Gets Modified
1008
+ - `intuition-plan` — Sections 6, 6.5, 10 updated
1009
+ - `intuition-handoff` — New transitions 2, 3, 4 replacing current design/engineer transitions
1010
+ - `intuition-build` — Blueprint-based input, producer delegation, three-layer review chain
1011
+ - State schema — v5.0 → v7.0 (detail + test objects added, design + engineering deprecated)
1012
+
1013
+ ### Backward Compatibility
1014
+ - Existing v8.x projects continue working until explicitly migrated
1015
+ - New projects use v9.0 by default
1016
+ - No breaking changes to prompt, start, debugger, or advisory skills