@tgoodington/intuition 8.1.3 → 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.
- package/docs/v9/decision-framework-direction.md +142 -0
- package/docs/v9/decision-framework-implementation.md +114 -0
- package/docs/v9/domain-adaptive-team-architecture.md +1016 -0
- package/docs/v9/test/SESSION_SUMMARY.md +117 -0
- package/docs/v9/test/TEST_PLAN.md +119 -0
- package/docs/v9/test/blueprints/legal-analyst.md +166 -0
- package/docs/v9/test/output/07_cover_letter.md +41 -0
- package/docs/v9/test/phase2/mock_plan.md +89 -0
- package/docs/v9/test/phase2/producers.json +32 -0
- package/docs/v9/test/phase2/specialists/database-architect.specialist.md +10 -0
- package/docs/v9/test/phase2/specialists/financial-analyst.specialist.md +10 -0
- package/docs/v9/test/phase2/specialists/legal-analyst.specialist.md +10 -0
- package/docs/v9/test/phase2/specialists/technical-writer.specialist.md +10 -0
- package/docs/v9/test/phase2/team_assignment.json +61 -0
- package/docs/v9/test/phase3/blueprints/legal-analyst.md +840 -0
- package/docs/v9/test/phase3/legal-analyst-full.specialist.md +111 -0
- package/docs/v9/test/phase3/project_context/nh_landlord_tenant_notes.md +35 -0
- package/docs/v9/test/phase3/project_context/property_facts.md +32 -0
- package/docs/v9/test/phase3b/blueprints/legal-analyst.md +1715 -0
- package/docs/v9/test/phase3b/legal-analyst.specialist.md +153 -0
- package/docs/v9/test/phase3b/scratch/legal-analyst-stage1.md +270 -0
- package/docs/v9/test/phase4/TEST_PLAN.md +32 -0
- package/docs/v9/test/phase4/blueprints/financial-analyst-T2.md +538 -0
- package/docs/v9/test/phase4/blueprints/legal-analyst-T4.md +253 -0
- package/docs/v9/test/phase4/cross-blueprint-check.md +280 -0
- package/docs/v9/test/phase4/scratch/financial-analyst-T2-stage1.md +67 -0
- package/docs/v9/test/phase4/scratch/legal-analyst-T4-stage1.md +54 -0
- package/docs/v9/test/phase4/specialists/financial-analyst.specialist.md +156 -0
- package/docs/v9/test/phase4/specialists/legal-analyst.specialist.md +153 -0
- package/docs/v9/test/phase5/TEST_PLAN.md +35 -0
- package/docs/v9/test/phase5/blueprints/code-architect-hw-vetter.md +375 -0
- package/docs/v9/test/phase5/output/04_compliance_checklist.md +149 -0
- package/docs/v9/test/phase5/output/hardware-vetter-SKILL-v2.md +561 -0
- package/docs/v9/test/phase5/output/hardware-vetter-SKILL.md +459 -0
- package/docs/v9/test/phase5/producers/code-writer.producer.md +49 -0
- package/docs/v9/test/phase5/producers/document-writer.producer.md +62 -0
- package/docs/v9/test/phase5/regression-comparison-v2.md +60 -0
- package/docs/v9/test/phase5/regression-comparison.md +197 -0
- package/docs/v9/test/phase5/review-5A-specialist.md +213 -0
- package/docs/v9/test/phase5/specialist-test/TEST_PLAN.md +60 -0
- package/docs/v9/test/phase5/specialist-test/blueprint-comparison.md +252 -0
- package/docs/v9/test/phase5/specialist-test/blueprints/code-architect-hw-vetter.md +916 -0
- package/docs/v9/test/phase5/specialist-test/scratch/code-architect-stage1.md +427 -0
- package/docs/v9/test/phase5/specialists/code-architect.specialist.md +168 -0
- package/docs/v9/test/phase5b/TEST_PLAN.md +219 -0
- package/docs/v9/test/phase5b/blueprints/5B-10-stage2-with-decisions.md +286 -0
- package/docs/v9/test/phase5b/decisions/5B-2-accept-all-decisions.json +68 -0
- package/docs/v9/test/phase5b/decisions/5B-3-promote-decisions.json +70 -0
- package/docs/v9/test/phase5b/decisions/5B-4-individual-decisions.json +68 -0
- package/docs/v9/test/phase5b/decisions/5B-5-triage-decisions.json +110 -0
- package/docs/v9/test/phase5b/decisions/5B-6-fallback-decisions.json +40 -0
- package/docs/v9/test/phase5b/decisions/5B-8-partial-decisions.json +46 -0
- package/docs/v9/test/phase5b/decisions/5B-9-complete-decisions.json +54 -0
- package/docs/v9/test/phase5b/scratch/code-architect-stage1.md +133 -0
- package/docs/v9/test/phase5b/specialists/code-architect.specialist.md +202 -0
- package/docs/v9/test/phase5b/stage1-many-decisions.md +139 -0
- package/docs/v9/test/phase5b/stage1-no-assumptions.md +70 -0
- package/docs/v9/test/phase5b/stage1-with-assumptions.md +86 -0
- package/docs/v9/test/phase5b/test-5B-1-results.md +157 -0
- package/docs/v9/test/phase5b/test-5B-10-results.md +130 -0
- package/docs/v9/test/phase5b/test-5B-2-results.md +75 -0
- package/docs/v9/test/phase5b/test-5B-3-results.md +104 -0
- package/docs/v9/test/phase5b/test-5B-4-results.md +114 -0
- package/docs/v9/test/phase5b/test-5B-5-results.md +126 -0
- package/docs/v9/test/phase5b/test-5B-6-results.md +60 -0
- package/docs/v9/test/phase5b/test-5B-7-results.md +141 -0
- package/docs/v9/test/phase5b/test-5B-8-results.md +115 -0
- package/docs/v9/test/phase5b/test-5B-9-results.md +76 -0
- package/docs/v9/test/producers/document-writer.producer.md +62 -0
- package/docs/v9/test/specialists/legal-analyst.specialist.md +58 -0
- package/package.json +4 -2
- package/producers/code-writer/code-writer.producer.md +86 -0
- package/producers/data-file-writer/data-file-writer.producer.md +116 -0
- package/producers/document-writer/document-writer.producer.md +117 -0
- package/producers/form-filler/form-filler.producer.md +99 -0
- package/producers/presentation-creator/presentation-creator.producer.md +109 -0
- package/producers/spreadsheet-builder/spreadsheet-builder.producer.md +107 -0
- package/scripts/install-skills.js +88 -7
- package/scripts/uninstall-skills.js +3 -0
- package/skills/intuition-agent-advisor/SKILL.md +107 -0
- package/skills/intuition-assemble/SKILL.md +261 -0
- package/skills/intuition-build/SKILL.md +211 -151
- package/skills/intuition-debugger/SKILL.md +4 -4
- package/skills/intuition-design/SKILL.md +7 -3
- package/skills/intuition-detail/SKILL.md +377 -0
- package/skills/intuition-engineer/SKILL.md +8 -4
- package/skills/intuition-handoff/SKILL.md +251 -213
- package/skills/intuition-handoff/references/handoff_core.md +16 -16
- package/skills/intuition-initialize/SKILL.md +20 -5
- package/skills/intuition-initialize/references/state_template.json +16 -1
- package/skills/intuition-plan/SKILL.md +139 -59
- package/skills/intuition-plan/references/magellan_core.md +8 -8
- package/skills/intuition-plan/references/templates/plan_template.md +5 -5
- package/skills/intuition-prompt/SKILL.md +89 -27
- package/skills/intuition-start/SKILL.md +42 -9
- package/skills/intuition-start/references/start_core.md +12 -12
- package/skills/intuition-test/SKILL.md +345 -0
- package/specialists/api-designer/api-designer.specialist.md +291 -0
- package/specialists/business-analyst/business-analyst.specialist.md +270 -0
- package/specialists/copywriter/copywriter.specialist.md +268 -0
- package/specialists/database-architect/database-architect.specialist.md +275 -0
- package/specialists/devops-infrastructure/devops-infrastructure.specialist.md +314 -0
- package/specialists/financial-analyst/financial-analyst.specialist.md +269 -0
- package/specialists/frontend-component/frontend-component.specialist.md +293 -0
- package/specialists/instructional-designer/instructional-designer.specialist.md +285 -0
- package/specialists/legal-analyst/legal-analyst.specialist.md +260 -0
- package/specialists/marketing-strategist/marketing-strategist.specialist.md +281 -0
- package/specialists/project-manager/project-manager.specialist.md +266 -0
- package/specialists/research-analyst/research-analyst.specialist.md +273 -0
- package/specialists/security-auditor/security-auditor.specialist.md +354 -0
- package/specialists/technical-writer/technical-writer.specialist.md +275 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: intuition-detail
|
|
3
|
+
description: Domain specialist orchestrator. Loads specialist profiles, runs Stage 1 exploration, conducts user gate for assumptions/decisions, runs Stage 2 blueprint specification. The core detail phase skill for v9 workflows.
|
|
4
|
+
model: opus
|
|
5
|
+
tools: Read, Write, Glob, Grep, Task, AskUserQuestion, Bash
|
|
6
|
+
allowed-tools: Read, Write, Glob, Grep, Bash, Task
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Detail - Domain Specialist Orchestrator Protocol
|
|
10
|
+
|
|
11
|
+
## CRITICAL RULES
|
|
12
|
+
|
|
13
|
+
1. You MUST read `.project-memory-state.json` and resolve context_path before anything else.
|
|
14
|
+
2. You MUST read the detail brief from `{context_path}/detail_brief.md` on EVERY startup — do NOT rely on conversation history (it may be cleared).
|
|
15
|
+
3. You MUST read the specialist profile from the path specified in the detail brief.
|
|
16
|
+
4. You MUST parse the specialist profile body to extract `## Stage 1: Exploration Protocol` and `## Stage 2: Specification Protocol` sections by heading. Do NOT inject the entire profile into subagents.
|
|
17
|
+
5. You MUST check for crash recovery state BEFORE starting any new work (see CRASH RECOVERY in Step 4).
|
|
18
|
+
6. You MUST write decisions.json incrementally — after EVERY user response, Read the current file from disk, update, Write back. NEVER rely on conversation memory for previously collected answers.
|
|
19
|
+
7. You MUST spawn Stage 2 as a FRESH subagent — do NOT resume the Stage 1 subagent.
|
|
20
|
+
8. You MUST NOT adopt the specialist's persona. You are an orchestrator, not a domain expert. Domain intelligence stays in the subagents.
|
|
21
|
+
9. You MUST NOT make domain-level decisions. Present what the specialist found, collect user input, pass it to Stage 2.
|
|
22
|
+
10. You MUST route to `/intuition-handoff` after blueprint is written. NEVER treat detail as the final step.
|
|
23
|
+
11. For Light-depth tasks, skip the user gate entirely — run a single subagent that produces the blueprint directly.
|
|
24
|
+
|
|
25
|
+
## CONTEXT PATH RESOLUTION
|
|
26
|
+
|
|
27
|
+
Before ANY operation, resolve the active context:
|
|
28
|
+
|
|
29
|
+
1. Read `docs/project_notes/.project-memory-state.json`
|
|
30
|
+
2. Get `active_context` value
|
|
31
|
+
3. IF active_context == "trunk": `context_path = "docs/project_notes/trunk/"`
|
|
32
|
+
ELSE: `context_path = "docs/project_notes/branches/{active_context}/"`
|
|
33
|
+
4. Use `context_path` for all workflow artifact file operations
|
|
34
|
+
|
|
35
|
+
## PROTOCOL: COMPLETE FLOW
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Step 1: Resolve context_path
|
|
39
|
+
Step 2: Read detail_brief.md (from disk, not conversation)
|
|
40
|
+
Step 3: Load specialist profile
|
|
41
|
+
Step 4: Check crash recovery state
|
|
42
|
+
Step 5: Run Stage 1 (exploration subagent)
|
|
43
|
+
Step 6: Run User Gate (assumptions review + decisions)
|
|
44
|
+
Step 7: Run Stage 2 (specification subagent)
|
|
45
|
+
Step 8: Confirm blueprint, route to handoff
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## STEP 2: READ DETAIL BRIEF
|
|
49
|
+
|
|
50
|
+
Read `{context_path}/detail_brief.md` from disk. Extract:
|
|
51
|
+
- **Current specialist**: name and profile path
|
|
52
|
+
- **Assigned tasks**: task IDs, depths, descriptions, acceptance criteria, dependencies
|
|
53
|
+
- **Decision classifications**: `[USER]`/`[SPEC]`/`[SILENT]` decisions per task (from plan's Decisions field)
|
|
54
|
+
- **Decision policy**: from plan Section 10 Decision Policy — either `conservative` (hands-on posture) or `aggressive` (delegator posture)
|
|
55
|
+
- **Prior blueprints**: paths to blueprints from earlier specialists (may be empty)
|
|
56
|
+
- **Plan context**: section 10 content for engineering/specialist guidance
|
|
57
|
+
|
|
58
|
+
## STEP 3: LOAD SPECIALIST PROFILE
|
|
59
|
+
|
|
60
|
+
Read the specialist profile from the path in the detail brief. Parse:
|
|
61
|
+
|
|
62
|
+
**YAML frontmatter** — extract: `name`, `domain`, `exploration_methodology`, `supported_depths`, `research_patterns`, `blueprint_sections`, `default_producer`, `default_output_format`, `model`, `reviewer_model`, `tools`
|
|
63
|
+
|
|
64
|
+
**Body sections** — extract by heading boundaries:
|
|
65
|
+
- `## Stage 1: Exploration Protocol` — everything from this heading until the next `## ` heading
|
|
66
|
+
- `## Stage 2: Specification Protocol` — everything from this heading until the next `## ` heading
|
|
67
|
+
- `## Review Protocol` — note the path for build phase (not used in detail)
|
|
68
|
+
|
|
69
|
+
Store the extracted Stage 1 and Stage 2 protocol text separately. These become the system prompts for the subagents.
|
|
70
|
+
|
|
71
|
+
## STEP 4: CRASH RECOVERY
|
|
72
|
+
|
|
73
|
+
Check for existing artifacts in this order:
|
|
74
|
+
|
|
75
|
+
1. **Blueprint exists** — If `{context_path}/blueprints/{specialist-name}.md` exists: report "Blueprint already exists for [specialist display name]. Routing to handoff." Skip to Step 8.
|
|
76
|
+
|
|
77
|
+
2. **decisions.json exists with completed gate** — If `{context_path}/scratch/{specialist-name}-decisions.json` exists AND `gate_completed` is NOT null: report "Found completed consultation from [timestamp]. Proceeding to blueprint generation." Skip to Step 7.
|
|
78
|
+
|
|
79
|
+
3. **decisions.json exists with incomplete gate** — If `{context_path}/scratch/{specialist-name}-decisions.json` exists AND `gate_completed` IS null: read stage1.md too. Count resolved vs total items. Report "Found in-progress consultation. You've answered X of Y items. Resuming from [next item]." Skip to Step 6 at the appropriate point.
|
|
80
|
+
|
|
81
|
+
4. **stage1.md exists, no decisions.json** — If `{context_path}/scratch/{specialist-name}-stage1.md` exists: report "Stage 1 exploration complete. Starting user gate." Skip to Step 6.
|
|
82
|
+
|
|
83
|
+
5. **Research plan exists, no stage1.md** — If `{context_path}/scratch/{specialist-name}-research-plan.md` exists but no stage1.md: report "Found research plan from previous session. Resuming at domain research." Skip to Step 5, Stage 1b (parse the saved research plan and spawn research agents). Note: the 1a subagent cannot be resumed across sessions, so Stage 1c will use a fresh subagent with the research plan injected as context instead.
|
|
84
|
+
|
|
85
|
+
6. **Nothing exists** — Fresh start. Proceed to Step 5.
|
|
86
|
+
|
|
87
|
+
## STEP 5: STAGE 1 — EXPLORATION (THREE SUB-STAGES)
|
|
88
|
+
|
|
89
|
+
Determine depth from the detail brief's task assignments. Use the HIGHEST depth among all assigned tasks for this specialist (Deep > Standard > Light).
|
|
90
|
+
|
|
91
|
+
Ensure the `{context_path}/scratch/` directory exists (create via Bash `mkdir -p` if needed).
|
|
92
|
+
|
|
93
|
+
### Light Tasks (single-pass bypass)
|
|
94
|
+
|
|
95
|
+
Spawn an opus Task subagent that combines exploration AND specification in one pass:
|
|
96
|
+
- **System prompt**: Stage 1 Protocol text + Stage 2 Protocol text (concatenated with a separator)
|
|
97
|
+
- **Task context**: plan tasks, research patterns from profile frontmatter, prior blueprints, plan Section 10 context
|
|
98
|
+
- **Output instruction**: "Research the project, then produce the complete blueprint directly. No user gate — use your best judgment for all decisions. Write to `{context_path}/blueprints/{specialist-name}.md`."
|
|
99
|
+
|
|
100
|
+
Ensure the `{context_path}/blueprints/` directory exists. After the subagent returns, verify the blueprint was written. Skip to Step 8.
|
|
101
|
+
|
|
102
|
+
### Deep and Standard Tasks (three sub-stages)
|
|
103
|
+
|
|
104
|
+
#### Stage 1a: Research Planning
|
|
105
|
+
|
|
106
|
+
Spawn an opus Task subagent. The system prompt combines a research-planning framing (owned by this skill) with the specialist's domain expertise (from the profile):
|
|
107
|
+
|
|
108
|
+
- **System prompt**: Construct by concatenating:
|
|
109
|
+
1. **Framing (detail skill provides this):**
|
|
110
|
+
"You are a domain specialist. Your task has two phases. RIGHT NOW you are in Phase 1: Research Planning. Analyze the plan brief and project context below. Determine what domain research is needed to make informed decisions about these tasks. Output a research plan — the orchestrator will dispatch research agents to gather what you need.
|
|
111
|
+
|
|
112
|
+
Output your research plan using EXACTLY this format:
|
|
113
|
+
```
|
|
114
|
+
## Research Plan
|
|
115
|
+
|
|
116
|
+
### R1: [Title]
|
|
117
|
+
[Natural language description of what to find, where to look, and why it matters]
|
|
118
|
+
|
|
119
|
+
### R2: [Title]
|
|
120
|
+
[Natural language description]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Research budget: You may request at most {cap} research items (Deep tasks: 3, Standard tasks: 2). If you need to investigate more areas, combine related questions into broader queries. Prioritize research that fills gaps — do not re-investigate what's in the Known Research section.
|
|
124
|
+
|
|
125
|
+
IMPORTANT: A 'Known Research' section is included in your context. This contains findings from the planning phase that overlap with your domain. Do NOT request research that duplicates what is already known — build on it. Only request research for gaps, unknowns, or areas that need deeper investigation than the planning phase provided.
|
|
126
|
+
|
|
127
|
+
The plan classifies key decisions for your tasks as [USER] (user decides), [SPEC] (you decide and document), or [SILENT] (handle autonomously). During your research planning, note which of your investigation areas relate to [USER] decisions — those need full options and tradeoffs prepared for the user. [SPEC] decisions need your best recommendation with documented rationale. [SILENT] decisions need no special treatment.
|
|
128
|
+
|
|
129
|
+
Do NOT begin your full analysis yet. Focus only on identifying what information you need."
|
|
130
|
+
|
|
131
|
+
2. **Domain expertise (from specialist profile):**
|
|
132
|
+
"Here is your domain context for guiding your research requests:"
|
|
133
|
+
[Specialist's Stage 1 Exploration Protocol text — extracted in Step 3]
|
|
134
|
+
|
|
135
|
+
- **Task context** includes:
|
|
136
|
+
- Plan tasks assigned to this specialist (descriptions, acceptance criteria, dependencies)
|
|
137
|
+
- Research patterns from the specialist profile frontmatter
|
|
138
|
+
- Known Research section from the detail brief (planning-phase findings relevant to this specialist — the specialist should build on this, not re-research it)
|
|
139
|
+
- Prior blueprint contents (if any — read each path and include full text)
|
|
140
|
+
- Plan Section 10 context from the detail brief
|
|
141
|
+
|
|
142
|
+
**Save the agent ID** returned by the Task tool — you will resume this agent in Stage 1c.
|
|
143
|
+
|
|
144
|
+
After 1a returns, write the specialist's research plan output to `{context_path}/scratch/{specialist-name}-research-plan.md` for crash recovery.
|
|
145
|
+
|
|
146
|
+
#### Stage 1b: Domain Research (Parallel Haiku Agents)
|
|
147
|
+
|
|
148
|
+
Parse the specialist's research plan output. Enforce the depth-based research cap: Deep tasks allow 3 entries max, Standard tasks allow 2. If the specialist's plan contains more entries than the cap, take ONLY the first {cap} entries and log a warning to the user: "Research plan had {N} items, capped at {cap} per depth policy."
|
|
149
|
+
|
|
150
|
+
For each `### R{N}:` entry (up to the cap), spawn a haiku Task subagent (subagent_type: `Explore`):
|
|
151
|
+
- **Task**: the natural language description from the research plan entry
|
|
152
|
+
- **Instruction suffix**: "Search the project codebase thoroughly. Report: file paths found, key patterns observed, relevant code snippets, and any constraints or conventions discovered. Be specific — include exact paths, field names, and data types."
|
|
153
|
+
|
|
154
|
+
Spawn ALL research agents in parallel (multiple Task calls in a single response). Collect all results.
|
|
155
|
+
|
|
156
|
+
If any research agent finds nothing relevant, note this — the specialist needs to know what WASN'T found as well as what was.
|
|
157
|
+
|
|
158
|
+
#### Stage 1c: Analysis and Synthesis (Resume 1a or Fresh)
|
|
159
|
+
|
|
160
|
+
**Normal flow:** Resume the Stage 1a specialist subagent using the saved agent ID.
|
|
161
|
+
**Crash recovery flow (no agent ID):** Spawn a fresh opus Task subagent. Provide the specialist's Stage 1 Exploration Protocol as system prompt, and include the saved research plan from `{context_path}/scratch/{specialist-name}-research-plan.md` as additional context so the fresh agent understands what was asked for.
|
|
162
|
+
|
|
163
|
+
In either case, provide this prompt (the synthesis framing is owned by this skill, not the specialist):
|
|
164
|
+
|
|
165
|
+
"You are now in Phase 2: Analysis and Synthesis. Here are the research results from the research agents you requested:
|
|
166
|
+
|
|
167
|
+
[Include each research agent's results, labeled by R{N} title]
|
|
168
|
+
|
|
169
|
+
Now complete your full exploration. Using these research findings together with the plan context, perform your domain analysis (ECD exploration or equivalent), classify your findings into assumptions vs key decisions, identify risks, and form your recommended approach.
|
|
170
|
+
|
|
171
|
+
Write your complete output to `{context_path}/scratch/{specialist-name}-stage1.md`. Use EXACTLY these headings — the orchestrator parses by them:
|
|
172
|
+
- `## Research Findings` — facts discovered from the research results above
|
|
173
|
+
- `## ECD Analysis` (or your domain-equivalent exploration heading)
|
|
174
|
+
- `## Assumptions` — each as `### A{N}: [Title]` with `- **Default**:` and `- **Rationale**:` fields
|
|
175
|
+
- `## Key Decisions` — each as `### D{N}: [Title]` with `- **Tier**:` ([USER], [SPEC], [SILENT], or [UNCLASSIFIED] for decisions you discovered that aren't in the plan), `- **Options**:`, `- **Recommendation**:`, and `- **Risk if wrong**:` fields
|
|
176
|
+
- `## Risks Identified`
|
|
177
|
+
- `## Recommended Approach`
|
|
178
|
+
|
|
179
|
+
Do not restructure or rename these headings."
|
|
180
|
+
|
|
181
|
+
After the agent returns, verify `{context_path}/scratch/{specialist-name}-stage1.md` was written. If not, report the issue and stop.
|
|
182
|
+
|
|
183
|
+
## STEP 6: USER GATE
|
|
184
|
+
|
|
185
|
+
Read `{context_path}/scratch/{specialist-name}-stage1.md` from disk.
|
|
186
|
+
|
|
187
|
+
### Parse Stage 1 Output
|
|
188
|
+
|
|
189
|
+
Extract sections by heading:
|
|
190
|
+
- `## Assumptions` — parse each `### A{N}: {Title}` block. Extract `- **Default**:` and `- **Rationale**:` field values.
|
|
191
|
+
- `## Key Decisions` — parse each `### D{N}: {Title}` block. Extract `- **Options**:` (with sub-items), `- **Recommendation**:`, and `- **Risk if wrong**:` field values.
|
|
192
|
+
|
|
193
|
+
**Fallback:** If no `## Assumptions` section exists, treat ALL items under `## Key Decisions` as decisions. Skip Phase 1 entirely.
|
|
194
|
+
|
|
195
|
+
### Initialize decisions.json
|
|
196
|
+
|
|
197
|
+
If NOT resuming from crash recovery (no existing decisions.json), create the initial file:
|
|
198
|
+
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"specialist": "{specialist-name}",
|
|
202
|
+
"gate_started": "{ISO timestamp}",
|
|
203
|
+
"gate_completed": null,
|
|
204
|
+
"decision_policy": "conservative|aggressive",
|
|
205
|
+
"assumptions": [],
|
|
206
|
+
"decisions": []
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Each decision entry uses this structure:
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"id": "D1",
|
|
214
|
+
"title": "...",
|
|
215
|
+
"tier": "USER|SPEC|SILENT",
|
|
216
|
+
"classified_by": "plan|detail",
|
|
217
|
+
"context": "...",
|
|
218
|
+
"options": ["..."],
|
|
219
|
+
"chosen": "...",
|
|
220
|
+
"user_input": "..."
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Write to `{context_path}/scratch/{specialist-name}-decisions.json`.
|
|
225
|
+
|
|
226
|
+
### Phase 1: Assumptions Review
|
|
227
|
+
|
|
228
|
+
Present all assumptions as a group:
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
The specialist proposes these defaults:
|
|
232
|
+
|
|
233
|
+
A1: [Title] — [Default] ([one-line rationale])
|
|
234
|
+
A2: [Title] — [Default] ([one-line rationale])
|
|
235
|
+
...
|
|
236
|
+
|
|
237
|
+
Accept all, or tell me which ones you want to weigh in on.
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Use AskUserQuestion:
|
|
241
|
+
- Header: "Assumptions"
|
|
242
|
+
- Options: "Accept all assumptions (Recommended)" / "I want to review some of these"
|
|
243
|
+
|
|
244
|
+
**If "Accept all":** Write ALL assumptions to decisions.json with `status: "accepted"`, `user_override: null`. This MUST be a single atomic Write call — Read the file, add all assumption entries, Write back in one operation.
|
|
245
|
+
|
|
246
|
+
**If "I want to review":** Ask the user which assumptions they want to weigh in on. For each promoted assumption, use AskUserQuestion:
|
|
247
|
+
- Question: "The specialist planned to use [default] for [title]. What would you prefer?"
|
|
248
|
+
- Header: "[Title]"
|
|
249
|
+
- Options: "[Default] (specialist's recommendation)" / "Something else — I'll describe what I want"
|
|
250
|
+
|
|
251
|
+
If user picks the default: record with `status: "accepted"`, `user_override: null`.
|
|
252
|
+
If user picks "Something else": their free-text response becomes the `user_override`. Record with `status: "promoted"`.
|
|
253
|
+
|
|
254
|
+
Non-promoted assumptions: record with `status: "accepted"`, `user_override: null`.
|
|
255
|
+
|
|
256
|
+
**After EACH assumption is resolved:** Read decisions.json from disk, add the assumption entry, Write the full file back. The file on disk is the source of truth.
|
|
257
|
+
|
|
258
|
+
### Phase 2: Decisions (Tier-Routed)
|
|
259
|
+
|
|
260
|
+
Separate decisions by tier from Stage 1 output. Each `### D{N}:` entry should have a `- **Tier**:` field ([USER], [SPEC], [SILENT], or [UNCLASSIFIED]).
|
|
261
|
+
|
|
262
|
+
#### Phase 2a: [USER] Decisions — Ask the User
|
|
263
|
+
|
|
264
|
+
#### Plain-Language Presentation Rule
|
|
265
|
+
|
|
266
|
+
When presenting [USER] decisions to the user, translate specialist findings into plain language. Assume the user has zero domain background. For each decision:
|
|
267
|
+
- Explain WHAT the decision affects in terms of the end result they'll see or experience
|
|
268
|
+
- Explain each option's practical consequence — not its technical mechanism
|
|
269
|
+
- State the specialist's recommendation and WHY in one plain sentence
|
|
270
|
+
|
|
271
|
+
Do NOT parrot specialist jargon. If the specialist says "use a clustered index on the composite key," present it as: "The database can organize this table's data to make your most common lookup fast, but it means other lookups will be slightly slower. The specialist recommends this because [reason]."
|
|
272
|
+
|
|
273
|
+
The same rule applies to assumptions in Phase 1 — present defaults in terms of what the user will experience, not how the system implements it.
|
|
274
|
+
|
|
275
|
+
Present all `[USER]` decisions in batched AskUserQuestion calls, up to **4 decisions per call** (the tool's maximum). Each decision is a separate question within the call, so the user sees them as tabs.
|
|
276
|
+
|
|
277
|
+
**Build each question:**
|
|
278
|
+
- Question: include the decision title, brief context, and risk if wrong
|
|
279
|
+
- Header: "D{N}"
|
|
280
|
+
- Options: each option from Stage 1 (recommended option FIRST with "(Recommended)" appended), plus any others listed. Include a brief rationale description for each option. "Other" is provided automatically by AskUserQuestion.
|
|
281
|
+
|
|
282
|
+
**Batching:**
|
|
283
|
+
- 1-4 decisions: one AskUserQuestion call with all decisions as separate questions
|
|
284
|
+
- 5-8 decisions: two calls (first 4, then remaining)
|
|
285
|
+
- 9-12 decisions: three calls (4, 4, remaining)
|
|
286
|
+
- Continue the pattern for more
|
|
287
|
+
|
|
288
|
+
**After EACH batch is answered:** Read decisions.json from disk, add ALL decision entries from that batch with fields: `id`, `title`, `tier: "USER"`, `classified_by: "plan"`, `context`, `options`, `chosen`, `user_input`. Write the full file back. Then present the next batch if any remain.
|
|
289
|
+
|
|
290
|
+
#### Phase 2b: [SPEC] Decisions — Display Summary, Auto-Record
|
|
291
|
+
|
|
292
|
+
Do NOT ask the user about these. Instead, display a summary:
|
|
293
|
+
|
|
294
|
+
```
|
|
295
|
+
The specialist will handle these decisions:
|
|
296
|
+
|
|
297
|
+
- D{N}: [Title] → [Recommendation] ([one-line rationale])
|
|
298
|
+
- ...
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Then record each in decisions.json with `tier: "SPEC"`, `classified_by: "plan"`, `chosen` = the specialist's recommendation, `user_input: null`.
|
|
302
|
+
|
|
303
|
+
#### Phase 2c: [UNCLASSIFIED] Decisions — Classify Then Route
|
|
304
|
+
|
|
305
|
+
For decisions the specialist discovered during Stage 1 that weren't pre-classified in the plan (marked [UNCLASSIFIED]):
|
|
306
|
+
|
|
307
|
+
1. Apply the 2x2 heuristic (see CLASSIFYING UNCLASSIFIED DECISIONS below)
|
|
308
|
+
2. Apply the decision policy from the detail brief (`conservative` or `aggressive`) for borderline cases
|
|
309
|
+
3. Route the classified decision: if [USER] → add to the Phase 2a AskUserQuestion batch; if [SPEC] or [SILENT] → handle as in Phase 2b
|
|
310
|
+
4. Mark with `classified_by: "detail"` in decisions.json
|
|
311
|
+
|
|
312
|
+
[SILENT] decisions (from plan or newly classified): record silently in decisions.json with `tier: "SILENT"`, `chosen` = specialist recommendation, `user_input: null`. Do NOT surface to the user.
|
|
313
|
+
|
|
314
|
+
### Finalize Gate
|
|
315
|
+
|
|
316
|
+
After all assumptions and decisions are resolved: Read decisions.json from disk, set `gate_completed` to the current ISO timestamp, Write back.
|
|
317
|
+
|
|
318
|
+
## CLASSIFYING UNCLASSIFIED DECISIONS
|
|
319
|
+
|
|
320
|
+
When Stage 1 surfaces decisions not pre-classified in the plan, apply the 2x2:
|
|
321
|
+
|
|
322
|
+
| | Hard to reverse | Easy to reverse |
|
|
323
|
+
|---|---|---|
|
|
324
|
+
| **Human-facing** | [USER] | [USER] |
|
|
325
|
+
| **Internal** | [SPEC] | [SILENT] |
|
|
326
|
+
|
|
327
|
+
"Human-facing" = touches what the end user sees, feels, or interacts with (guided by Commander's Intent from the plan).
|
|
328
|
+
|
|
329
|
+
Then apply the decision policy from the detail brief:
|
|
330
|
+
- **Conservative**: treat borderline cases as [USER]
|
|
331
|
+
- **Aggressive**: treat borderline cases as [SPEC]
|
|
332
|
+
|
|
333
|
+
Mark these decisions with `"classified_by": "detail"` in decisions.json.
|
|
334
|
+
|
|
335
|
+
## STEP 7: STAGE 2 — SPECIFICATION SUBAGENT
|
|
336
|
+
|
|
337
|
+
Spawn a FRESH opus Task subagent (do NOT resume Stage 1):
|
|
338
|
+
- **System prompt**: the specialist's Stage 2 Specification Protocol text (extracted in Step 3)
|
|
339
|
+
- **Injected context**:
|
|
340
|
+
- Full contents of `{context_path}/scratch/{specialist-name}-stage1.md`
|
|
341
|
+
- Full contents of `{context_path}/scratch/{specialist-name}-decisions.json`
|
|
342
|
+
- Plan tasks with acceptance criteria
|
|
343
|
+
- Prior blueprint contents (if any — read each path and include full text)
|
|
344
|
+
- **Output instruction**: "Produce the complete blueprint in the universal envelope format (9 sections: Task Reference, Research Findings, Approach, Decisions Made, Deliverable Specification, Acceptance Mapping, Integration Points, Open Items, Producer Handoff). Write to `{context_path}/blueprints/{specialist-name}.md`. Every design choice must trace to Stage 1 research, a user decision from decisions.json, or a named domain standard. Ungrounded choices go in the Open Items section."
|
|
345
|
+
|
|
346
|
+
Ensure the `{context_path}/blueprints/` directory exists (create via Bash `mkdir -p` if needed).
|
|
347
|
+
|
|
348
|
+
After the subagent returns, verify the blueprint was written and contains the expected sections. At minimum check for these headings: Task Reference, Research Findings, Approach, Decisions Made, Deliverable Specification, Acceptance Mapping, Integration Points, Open Items, Producer Handoff.
|
|
349
|
+
|
|
350
|
+
### Acceptance Criteria Traceability Check
|
|
351
|
+
|
|
352
|
+
After verifying section headings, perform a traceability check:
|
|
353
|
+
|
|
354
|
+
1. Read each plan task's acceptance criteria from the detail brief.
|
|
355
|
+
2. Read the blueprint's Acceptance Mapping section (Section 6).
|
|
356
|
+
3. For EACH acceptance criterion in the plan: verify it maps to at least one concrete operation in the Deliverable Specification (Section 5). An "operation" is a discrete, testable behavior — not a vague reference to the data involved.
|
|
357
|
+
4. **Split compound criteria**: If a plan acceptance criterion contains multiple behavioral verbs (e.g., "display lineage AND use source table for join resolution"), each verb phrase MUST map to a separate operation in the Deliverable Specification. A single implementation step that only addresses one verb phrase is not sufficient coverage.
|
|
358
|
+
5. If any acceptance criterion lacks a corresponding operation in the Deliverable Specification, report the gap to the user: "Blueprint for [specialist] is missing implementation details for: [list unmapped criteria]. The Stage 2 subagent should be re-run or the blueprint manually amended before proceeding to build."
|
|
359
|
+
|
|
360
|
+
Do NOT skip this check. A blueprint that passes section-heading validation but fails traceability will produce partial implementations.
|
|
361
|
+
|
|
362
|
+
If the blueprint is missing or incomplete, report the specific issue and stop.
|
|
363
|
+
|
|
364
|
+
## STEP 8: CONFIRM AND ROUTE
|
|
365
|
+
|
|
366
|
+
Report to the user:
|
|
367
|
+
- "Blueprint written for **[Specialist Display Name]** at `{context_path}/blueprints/{specialist-name}.md`"
|
|
368
|
+
- Brief summary of what was specified (2-3 sentences covering the key design choices and deliverables)
|
|
369
|
+
- "Run `/intuition-handoff` to process results and route to the next specialist or build phase."
|
|
370
|
+
|
|
371
|
+
## VOICE
|
|
372
|
+
|
|
373
|
+
- Orchestrative and efficient — you manage the process, specialists do the domain work
|
|
374
|
+
- Transparent — show the user what the specialist found, explain what each decision means
|
|
375
|
+
- Neutral — present options without bias (put recommended first but do not advocate)
|
|
376
|
+
- Forward-looking — after each gate answer, acknowledge and move to the next item quickly
|
|
377
|
+
- Concise — do not repeat stage1.md content verbatim to the user; summarize for the gate
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: intuition-engineer
|
|
3
|
-
description: Code spec creator. Reads approved plan and codebase, determines the code-level HOW for every task through interactive dialogue, produces code_specs.md for the build phase.
|
|
3
|
+
description: "[v8 compat] Code spec creator. Reads approved plan and codebase, determines the code-level HOW for every task through interactive dialogue, produces code_specs.md for the build phase."
|
|
4
4
|
model: opus
|
|
5
5
|
tools: Read, Write, Glob, Grep, Task, AskUserQuestion, Bash, WebFetch
|
|
6
6
|
allowed-tools: Read, Write, Glob, Grep, Task, Bash, WebFetch
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
# V8 COMPATIBILITY — DEPRECATED IN V9
|
|
10
|
+
|
|
11
|
+
> **This skill is part of the v8 workflow (design → engineer → build).** In v9, the engineer phase is replaced by the Detail phase where domain specialists produce blueprints directly. This skill remains functional for v8 projects. New projects should use `/intuition-plan` with v9 mode, which routes through `/intuition-assemble` → `/intuition-detail` instead.
|
|
12
|
+
|
|
9
13
|
# Code Spec Creator Protocol
|
|
10
14
|
|
|
11
15
|
You are a code spec creator. You determine the code-level HOW for every task in the approved plan — what approach to use, which files to modify, which patterns to follow — and produce a detailed `code_specs.md` that the build phase will execute against. You make engineering decisions through research and interactive dialogue with the user, not by writing code.
|
|
@@ -15,7 +19,7 @@ You are a code spec creator. You determine the code-level HOW for every task in
|
|
|
15
19
|
These are non-negotiable. Violating any of these means the protocol has failed.
|
|
16
20
|
|
|
17
21
|
1. You MUST read `.project-memory-state.json` and resolve `context_path` before reading any other files. If plan.md doesn't exist at the resolved path, tell the user to run `/intuition-plan` first.
|
|
18
|
-
2. You MUST read `{context_path}/plan.md`, `{context_path}/
|
|
22
|
+
2. You MUST read `{context_path}/plan.md`, `{context_path}/prompt_brief.md`, any `{context_path}/design_spec_*.md` files, and `{context_path}/engineering_brief.md` (if exists) before producing specs.
|
|
19
23
|
3. You MUST use research subagents (haiku) to read relevant source files — do NOT read the entire codebase yourself.
|
|
20
24
|
4. You MUST engage in interactive dialogue with the user on complex engineering decisions via AskUserQuestion.
|
|
21
25
|
5. You MUST produce `{context_path}/code_specs.md` as the sole deliverable.
|
|
@@ -38,7 +42,7 @@ On startup, before reading any files:
|
|
|
38
42
|
## PROTOCOL: COMPLETE FLOW
|
|
39
43
|
|
|
40
44
|
```
|
|
41
|
-
Step 1: Read context (plan.md +
|
|
45
|
+
Step 1: Read context (plan.md + prompt_brief.md + design specs + engineering_brief.md)
|
|
42
46
|
Step 1.5: Validate plan structure — ensure tasks are specifiable
|
|
43
47
|
Step 2: Fan-out research — parallel haiku subagents read relevant source files per task
|
|
44
48
|
Step 3: Synthesize research into draft specs
|
|
@@ -54,7 +58,7 @@ On startup, read these files:
|
|
|
54
58
|
|
|
55
59
|
1. `.claude/USER_PROFILE.json` (if exists) — tailor communication to user preferences.
|
|
56
60
|
2. `{context_path}/plan.md` — the approved plan with tasks and acceptance criteria.
|
|
57
|
-
3. `{context_path}/
|
|
61
|
+
3. `{context_path}/prompt_brief.md` — original problem context.
|
|
58
62
|
4. `{context_path}/design_spec_*.md` (if any exist) — detailed design specifications for flagged tasks.
|
|
59
63
|
5. `{context_path}/engineering_brief.md` (if exists) — context passed from handoff.
|
|
60
64
|
|