cfsa-antigravity 2.0.0 → 2.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/README.md +14 -0
  2. package/package.json +1 -1
  3. package/template/.agent/instructions/commands.md +8 -32
  4. package/template/.agent/instructions/example.md +21 -0
  5. package/template/.agent/instructions/patterns.md +3 -3
  6. package/template/.agent/instructions/tech-stack.md +71 -23
  7. package/template/.agent/instructions/workflow.md +12 -1
  8. package/template/.agent/rules/completion-checklist.md +6 -0
  9. package/template/.agent/rules/security-first.md +3 -3
  10. package/template/.agent/rules/vertical-slices.md +1 -1
  11. package/template/.agent/skill-library/MANIFEST.md +6 -0
  12. package/template/.agent/skill-library/stack/devops/git-advanced/SKILL.md +972 -0
  13. package/template/.agent/skill-library/stack/devops/git-workflow/SKILL.md +420 -0
  14. package/template/.agent/skills/api-versioning/SKILL.md +44 -298
  15. package/template/.agent/skills/api-versioning/references/typescript.md +157 -0
  16. package/template/.agent/skills/architecture-mapping/SKILL.md +13 -13
  17. package/template/.agent/skills/bootstrap-agents/SKILL.md +151 -152
  18. package/template/.agent/skills/clean-code/SKILL.md +64 -118
  19. package/template/.agent/skills/clean-code/references/typescript.md +126 -0
  20. package/template/.agent/skills/database-schema-design/SKILL.md +93 -317
  21. package/template/.agent/skills/database-schema-design/references/relational.md +228 -0
  22. package/template/.agent/skills/error-handling-patterns/SKILL.md +62 -557
  23. package/template/.agent/skills/error-handling-patterns/references/go.md +162 -0
  24. package/template/.agent/skills/error-handling-patterns/references/python.md +262 -0
  25. package/template/.agent/skills/error-handling-patterns/references/rust.md +112 -0
  26. package/template/.agent/skills/error-handling-patterns/references/typescript.md +178 -0
  27. package/template/.agent/skills/idea-extraction/SKILL.md +322 -224
  28. package/template/.agent/skills/logging-best-practices/SKILL.md +108 -767
  29. package/template/.agent/skills/logging-best-practices/references/go.md +49 -0
  30. package/template/.agent/skills/logging-best-practices/references/python.md +52 -0
  31. package/template/.agent/skills/logging-best-practices/references/typescript.md +215 -0
  32. package/template/.agent/skills/migration-management/SKILL.md +127 -311
  33. package/template/.agent/skills/migration-management/references/relational.md +214 -0
  34. package/template/.agent/skills/parallel-feature-development/SKILL.md +34 -43
  35. package/template/.agent/skills/pipeline-rubrics/references/be-rubric.md +1 -1
  36. package/template/.agent/skills/pipeline-rubrics/references/ia-rubric.md +2 -2
  37. package/template/.agent/skills/pipeline-rubrics/references/scoring.md +1 -1
  38. package/template/.agent/skills/pipeline-rubrics/references/vision-rubric.md +2 -1
  39. package/template/.agent/skills/prd-templates/SKILL.md +23 -6
  40. package/template/.agent/skills/prd-templates/references/be-spec-template.md +2 -2
  41. package/template/.agent/skills/prd-templates/references/decomposition-templates.md +2 -2
  42. package/template/.agent/skills/prd-templates/references/engineering-standards-template.md +2 -0
  43. package/template/.agent/skills/prd-templates/references/fe-spec-template.md +1 -1
  44. package/template/.agent/skills/prd-templates/references/fractal-cx-template.md +58 -0
  45. package/template/.agent/skills/prd-templates/references/fractal-feature-template.md +93 -0
  46. package/template/.agent/skills/prd-templates/references/fractal-node-index-template.md +55 -0
  47. package/template/.agent/skills/prd-templates/references/ideation-crosscut-template.md +26 -47
  48. package/template/.agent/skills/prd-templates/references/ideation-index-template.md +47 -31
  49. package/template/.agent/skills/prd-templates/references/operational-templates.md +1 -1
  50. package/template/.agent/skills/prd-templates/references/placeholder-workflow-mapping.md +50 -21
  51. package/template/.agent/skills/prd-templates/references/skill-loading-protocol.md +32 -0
  52. package/template/.agent/skills/prd-templates/references/slice-completion-gates.md +29 -0
  53. package/template/.agent/skills/prd-templates/references/spec-coverage-sweep.md +3 -3
  54. package/template/.agent/skills/prd-templates/references/tdd-testing-policy.md +39 -0
  55. package/template/.agent/skills/prd-templates/references/vision-template.md +8 -8
  56. package/template/.agent/skills/regex-patterns/SKILL.md +122 -540
  57. package/template/.agent/skills/regex-patterns/references/go.md +44 -0
  58. package/template/.agent/skills/regex-patterns/references/javascript.md +63 -0
  59. package/template/.agent/skills/regex-patterns/references/python.md +77 -0
  60. package/template/.agent/skills/regex-patterns/references/rust.md +43 -0
  61. package/template/.agent/skills/resolve-ambiguity/SKILL.md +1 -1
  62. package/template/.agent/skills/session-continuity/SKILL.md +11 -9
  63. package/template/.agent/skills/session-continuity/protocols/02-progress-generation.md +2 -2
  64. package/template/.agent/skills/session-continuity/protocols/04-pattern-extraction.md +1 -1
  65. package/template/.agent/skills/session-continuity/protocols/05-session-close.md +1 -1
  66. package/template/.agent/skills/session-continuity/protocols/09-parallel-claim.md +1 -1
  67. package/template/.agent/skills/session-continuity/protocols/10-placeholder-verification-gate.md +57 -78
  68. package/template/.agent/skills/session-continuity/protocols/11-parallel-synthesis.md +1 -1
  69. package/template/.agent/skills/spec-writing/SKILL.md +1 -1
  70. package/template/.agent/skills/tdd-workflow/SKILL.md +94 -317
  71. package/template/.agent/skills/tdd-workflow/references/typescript.md +231 -0
  72. package/template/.agent/skills/testing-strategist/SKILL.md +74 -687
  73. package/template/.agent/skills/testing-strategist/references/typescript.md +328 -0
  74. package/template/.agent/skills/workflow-automation/SKILL.md +62 -154
  75. package/template/.agent/skills/workflow-automation/references/inngest.md +88 -0
  76. package/template/.agent/skills/workflow-automation/references/temporal.md +64 -0
  77. package/template/.agent/workflows/bootstrap-agents-fill.md +85 -143
  78. package/template/.agent/workflows/bootstrap-agents-provision.md +90 -107
  79. package/template/.agent/workflows/create-prd-architecture.md +23 -16
  80. package/template/.agent/workflows/create-prd-compile.md +11 -12
  81. package/template/.agent/workflows/create-prd-design-system.md +1 -1
  82. package/template/.agent/workflows/create-prd-security.md +9 -11
  83. package/template/.agent/workflows/create-prd-stack.md +10 -4
  84. package/template/.agent/workflows/create-prd.md +9 -9
  85. package/template/.agent/workflows/decompose-architecture-structure.md +4 -6
  86. package/template/.agent/workflows/decompose-architecture-validate.md +18 -1
  87. package/template/.agent/workflows/decompose-architecture.md +18 -3
  88. package/template/.agent/workflows/evolve-contract.md +11 -11
  89. package/template/.agent/workflows/evolve-feature-classify.md +14 -6
  90. package/template/.agent/workflows/ideate-discover.md +72 -107
  91. package/template/.agent/workflows/ideate-extract.md +84 -63
  92. package/template/.agent/workflows/ideate-validate.md +26 -22
  93. package/template/.agent/workflows/ideate.md +9 -9
  94. package/template/.agent/workflows/implement-slice-setup.md +25 -23
  95. package/template/.agent/workflows/implement-slice-tdd.md +73 -89
  96. package/template/.agent/workflows/implement-slice.md +4 -4
  97. package/template/.agent/workflows/plan-phase-preflight.md +6 -2
  98. package/template/.agent/workflows/plan-phase-write.md +6 -8
  99. package/template/.agent/workflows/remediate-pipeline-assess.md +2 -1
  100. package/template/.agent/workflows/resolve-ambiguity.md +2 -2
  101. package/template/.agent/workflows/update-architecture-map.md +22 -5
  102. package/template/.agent/workflows/validate-phase-quality.md +155 -0
  103. package/template/.agent/workflows/validate-phase-readiness.md +167 -0
  104. package/template/.agent/workflows/validate-phase.md +19 -157
  105. package/template/.agent/workflows/verify-infrastructure.md +10 -10
  106. package/template/.agent/workflows/write-architecture-spec-design.md +23 -14
  107. package/template/.agent/workflows/write-be-spec-classify.md +25 -21
  108. package/template/.agent/workflows/write-be-spec.md +1 -1
  109. package/template/.agent/workflows/write-fe-spec-classify.md +6 -12
  110. package/template/.agent/workflows/write-fe-spec-write.md +1 -1
  111. package/template/AGENTS.md +6 -2
  112. package/template/GEMINI.md +5 -3
  113. package/template/docs/README.md +10 -10
  114. package/template/docs/kit-architecture.md +126 -33
  115. package/template/docs/plans/ideation/README.md +8 -3
  116. package/template/.agent/skills/prd-templates/references/ideation-domain-template.md +0 -55
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: idea-extraction
3
- description: "Exhaustive idea extraction through recursive breadth-before-depth exploration with Deep Think protocol. Use during /ideate to transform raw ideas — whether richly documented, lightly sketched, or entirely in the user's head — into comprehensive, structured ideation output. Writes directly to the ideation/ folder structureone domain file per domain, no monolithic intermediary."
3
+ description: "Exhaustive idea extraction through recursive breadth-before-depth exploration with Deep Think protocol and fractal structure. Use during /ideate to transform raw ideas into comprehensive, structured ideation output. Writes to a fractal folder hierarchyevery node has an index, CX file, and children."
4
4
  ---
5
5
 
6
6
  # Idea Extraction — Exhaustion Engine
@@ -23,27 +23,238 @@ interactions — then present hypotheses to the user for confirmation or rejecti
23
23
 
24
24
  ---
25
25
 
26
- ## Output Structure
26
+ ## Fractal Structure Protocol
27
27
 
28
- This skill writes directly to the `docs/plans/ideation/` folder. No monolithic
29
- intermediary file.
28
+ This skill writes directly to the `docs/plans/ideation/` folder using a **fractal pattern** — every node in the tree (surface, domain, sub-domain) follows the same structure:
30
29
 
31
30
  ```
32
- docs/plans/ideation/
33
- ├── ideation-index.md Pipeline key file domain map + document map
34
- ├── meta/
35
- ├── problem-statement.md
36
- ├── personas.md
37
- │ ├── competitive-landscape.md
38
- │ └── constraints.md
39
- ├── domains/
40
- │ ├── 01-domain-slug.md ← One file per domain
41
- │ └── ...
42
- └── cross-cuts/
43
- └── cross-cut-ledger.md ← Running ledger accumulated at every level
31
+ {node}/
32
+ ├── {node}-index.md what's in this node, child listing, Role Matrix
33
+ ├── {node}-cx.md ← cross-cuts connecting this node's children
34
+ ├── child-01/ ← same pattern repeats (if child is complex)
35
+ └── 01.01.01-feature.md leaf node = .md file, not a folder
44
36
  ```
45
37
 
46
- Templates for each file type are in `.agent/skills/prd-templates/references/ideation-*.md`.
38
+ **Key rules:**
39
+
40
+ 1. **Always folders.** Every domain, sub-domain, and even single-surface projects use folders — no flat files. One universal pattern, no exceptions.
41
+ 2. **Indexes at every level.** Template: `.agent/skills/prd-templates/references/fractal-node-index-template.md`
42
+ 3. **CX files at every level.** Template: `.agent/skills/prd-templates/references/fractal-cx-template.md`
43
+ 4. **Feature files are leaf nodes.** Template: `.agent/skills/prd-templates/references/fractal-feature-template.md`
44
+ 5. **Depth is reactive.** The structure grows during exploration — never pre-scaffolded beyond what's discovered.
45
+ 6. **Soft limit at 4 levels.** If creating a level 5+ node, pause and ask the user: "This is getting unusually deep — should I promote a parent to reduce nesting, or is this depth justified?"
46
+
47
+ ### Super-Index
48
+
49
+ The top-level `ideation-index.md` uses a different template: `.agent/skills/prd-templates/references/ideation-index-template.md`
50
+ The top-level `ideation-cx.md` uses: `.agent/skills/prd-templates/references/ideation-crosscut-template.md`
51
+
52
+ ### Numbering Convention
53
+
54
+ Numbers are hierarchical and dot-separated within a surface:
55
+
56
+ ```
57
+ {domain}.{sub-domain}.{sub-sub}.{feature}
58
+ 01 . 01 . 02 . 03
59
+ ```
60
+
61
+ - Folders use number prefix: `01.03.02-ai-assistant/`
62
+ - Feature files use full number: `01.03.02.03-parts-recommendation.md`
63
+ - Cross-surface references prefix with surface: `web/02.01.03`, `desktop/01.03.02`
64
+ - Numbers are stable once assigned — never renumber
65
+
66
+ ---
67
+
68
+ ## Structural Classification Protocol
69
+
70
+ > **This classification must happen BEFORE any domain files are written.**
71
+ > It determines the folder layout for the entire ideation phase. The classification
72
+ > is performed in `ideate-extract` (Step 1.3) and recorded in `ideation-index.md`.
73
+
74
+ ### Four Project Shapes
75
+
76
+ | Shape | Signals | Folder Structure |
77
+ |---|---|---|
78
+ | **Single-surface** | One platform, one audience, "make me a website" | Domains are top-level children of `ideation/` (no `surfaces/` folder) |
79
+ | **Multi-surface-shared** | 2+ platforms, same stack, >80% shared logic | Domains at top level with surface annotations in feature files |
80
+ | **Multi-product (hub-and-spoke)** | 2+ platforms, one is clearly the central platform/API. Others consume from it. | `surfaces/` with hub surface owning shared domains. Spokes reference hub via CX. |
81
+ | **Multi-product (peer)** | 2+ platforms, no clear primary. Each is equally independent. | `surfaces/` with `shared/` folder as a peer for truly cross-surface domains. |
82
+
83
+ ### Detection: When to Ask vs When to Detect
84
+
85
+ | Input Mode | How Structure Is Determined |
86
+ |---|---|
87
+ | **Interview** (verbal / no input) | Ask the user directly — see Interview Questions below |
88
+ | **Document** (rich / thin) | Scan for surface signals — see Detection Signals below |
89
+ | **One-liner** | Infer from the description — "make me a website" = single surface, skip the question |
90
+
91
+ ### Interview Questions (asked early, before domain exploration)
92
+
93
+ When the input doesn't make the project shape obvious, ask these questions
94
+ **immediately after the opening problem statement question** — before any domain
95
+ exploration or file creation:
96
+
97
+ 1. **"Who are the distinct user types or audiences?"**
98
+ - Single audience → likely single-surface
99
+ - Multiple distinct audiences → likely multi-product
100
+
101
+ 2. **"What platforms or surfaces does this need to live on?"** (web, mobile, desktop, API, CLI)
102
+ - One platform → single-surface
103
+ - Multiple platforms, same stack → multi-surface-shared
104
+ - Multiple platforms, different stacks or exclusive features → multi-product
105
+
106
+ 3. **"Is there a primary platform that the other surfaces depend on — like a central API or web platform? Or are all surfaces independent peers?"** _(only if multi-product)_
107
+ - Yes, one primary → hub-and-spoke
108
+ - No, all independent → peer
109
+
110
+ ### Detection Signals (for document input)
111
+
112
+ When processing a document, scan for these signals before creating any domain files:
113
+
114
+ | Signal | Example | Classification |
115
+ |---|---|---|
116
+ | Distinct platform names in section headings | "Consumer Web Platform", "Shop Software (Tauri)" | Multi-product |
117
+ | Different tech stacks mentioned per surface | "Astro/React for web", "Rust/Tauri for desktop" | Multi-product |
118
+ | One surface described as "the platform" or "the API" | "Desktop app calls the platform API" | Hub-and-spoke |
119
+ | All surfaces access a central database through one API | "Everything goes through the web platform's proxy" | Hub-and-spoke |
120
+ | Surfaces described as equally independent | "Web and mobile are separate apps with separate backends" | Peer |
121
+ | Single platform implied | "The website will...", "Users visit the app and..." | Single-surface |
122
+
123
+ ### Hub-and-Spoke Implications
124
+
125
+ When hub-and-spoke is identified:
126
+
127
+ - **The hub surface owns shared domains.** Device History, Payments, Certification — these live INSIDE the hub surface's domain tree, not in a separate `shared/` folder.
128
+ - **Spoke surfaces reference hub domains via CX.** Desktop's CX files say "Feature X consumes web/domain/feature via API."
129
+ - **The hub surface tends to be the largest.** This is expected and correct.
130
+
131
+ ### Peer Mode Implications
132
+
133
+ When peer mode is identified:
134
+
135
+ - **Shared domains live in `shared/`.** `shared/` is treated as a peer node with the same fractal pattern.
136
+ - **Each surface owns only its exclusive features.**
137
+ - **Surface CX files reference `shared/` domains.** Both surfaces point to shared, rather than one owning it.
138
+
139
+ ### Classification Persistence
140
+
141
+ The classification is recorded in `ideation-index.md` under `## Structural Classification`.
142
+ All downstream steps read this section to determine where to place new nodes.
143
+
144
+ ---
145
+
146
+ ## Node Classification Gate
147
+
148
+ > **RUN THIS GATE before creating ANY new node** — domain, sub-domain, or feature.
149
+
150
+ ```
151
+ "I discovered [thing]. What is it?"
152
+
153
+
154
+ Does it belong to an EXISTING domain or sub-domain?
155
+
156
+ YES ──► Does it have 2+ distinct capabilities that interact with each other?
157
+ │ │
158
+ │ YES ──► It's a SUB-DOMAIN ──► create folder inside existing parent
159
+ │ │
160
+ │ NO ──► It's a FEATURE ──► create .md file inside existing parent
161
+
162
+ NO ──► Is it surface-exclusive?
163
+
164
+ YES ──► It's a new DOMAIN ──► create domain folder in the correct surface
165
+
166
+ NO ──► Is there a hub surface that owns this kind of logic?
167
+
168
+ YES ──► It lives in the HUB surface ──► create domain in hub + CX from spokes
169
+
170
+ NO ──► It's a shared domain ──► create in shared/
171
+
172
+ **WHEN UNCERTAIN: Ask the user.** Never assume placement.
173
+ ```
174
+
175
+ ### Sub-Domain vs Feature Test
176
+
177
+ The key question: **"Does this thing have its own internal features that interact with each other?"**
178
+
179
+ | Example | Internal Features? | Classification |
180
+ |---------|-------------------|----------------|
181
+ | AI Assistant | Yes: task generation, guided workflow, parts recommendation, test tracking — these interact | **Sub-domain** (folder) |
182
+ | Print Receipt | No: it does one thing | **Feature** (file) |
183
+ | Inventory Manager | Yes: stock tracking, reorder alerts, supplier integration | **Sub-domain** or **Domain** depending on scope |
184
+ | Password Reset | No: single flow with edge cases | **Feature** (file) |
185
+
186
+ ### Anti-Patterns
187
+
188
+ | ❌ Wrong | ✅ Right |
189
+ |----------|---------|
190
+ | Creating "Supplier Integration" as a new domain | Recognizing it's a feature within AI Assistant, cross-cutting to web's Supplier Accounts |
191
+ | Creating a domain for every feature mentioned | Grouping related features under their parent domain/sub-domain |
192
+ | Pre-creating 4 levels of empty folders | Creating depth reactively as complexity is discovered |
193
+ | Putting a shared domain in `shared/` when hub-and-spoke is active | Putting it inside the hub surface, with CX references from spokes |
194
+
195
+ ---
196
+
197
+ ## Reactive Depth Protocol
198
+
199
+ ### Depth Grows from Exploration
200
+
201
+ The structure is NEVER pre-scaffolded. It grows as the agent explores:
202
+
203
+ | Discovery Event | Action |
204
+ |----------------|--------|
205
+ | New surface identified | Create surface folder + surface index + surface CX |
206
+ | New domain identified | Run Classification Gate. Create domain folder + index + CX inside correct parent |
207
+ | New sub-area with 2+ interacting capabilities | Promote to sub-domain: create folder + index + CX |
208
+ | New sub-area with single capability | Create as feature file (.md) inside current parent |
209
+ | Feature explored and found to have internal complexity | Promote: convert .md to folder (see below) |
210
+
211
+ ### Promotion: Feature → Sub-Domain
212
+
213
+ During drilling, a feature might reveal internal complexity that warrants promotion:
214
+
215
+ 1. Agent discovers the feature has 2+ interacting capabilities
216
+ 2. Agent asks: "This feature has enough internal complexity to be its own sub-domain. Should I promote it?"
217
+ 3. If confirmed:
218
+ - Create `{number}-{slug}/` folder
219
+ - Create index and CX files inside
220
+ - Split content from the old feature file into child feature files
221
+ - Update parent index
222
+ 4. Numbering stays the same — the feature number becomes the sub-domain number
223
+
224
+ ### Exhaustion Check (Leaf-Node Model)
225
+
226
+ Exhaustion is checked at the **leaves** — whatever the deepest items are in each branch:
227
+
228
+ - **Old model**: "All domains at DEEP"
229
+ - **New model**: "All LEAF NODES at DEEP or EXHAUSTED"
230
+
231
+ Status propagation rules:
232
+ - All children `[EXHAUSTED]` → node is `[EXHAUSTED]`
233
+ - All children `[DEEP]`+ → node is `[DEEP]`
234
+ - Any child below `[DEEP]` → node stays at its current status
235
+
236
+ ---
237
+
238
+ ## Role Integration
239
+
240
+ ### Global Persona Definitions
241
+
242
+ Personas are defined ONCE in `meta/personas.md`. This file is the single source of truth.
243
+
244
+ ### Where Persona Info Appears
245
+
246
+ | Location | What's There | Template |
247
+ |----------|-------------|----------|
248
+ | `meta/personas.md` | Full persona definitions (6 fields each) | Single source of truth |
249
+ | Index files → Role Matrix | Grid of children × personas with access icons | `fractal-node-index-template.md` |
250
+ | Feature files → Role Lens | Per-feature access level + specific behavior | `fractal-feature-template.md` |
251
+ | CX files → Role scoping | Which roles are affected by each cross-cut | `fractal-cx-template.md` |
252
+
253
+ ### Anti-Duplication Rule
254
+
255
+ - **NEVER** redefine a persona outside `meta/personas.md`
256
+ - **ALWAYS** reference personas by their short name
257
+ - If a new persona is discovered → add to `meta/personas.md` FIRST, then reference
47
258
 
48
259
  ---
49
260
 
@@ -53,72 +264,45 @@ Before starting, classify what the user has provided and select the right mode.
53
264
 
54
265
  ### Extraction Mode — Rich Input
55
266
 
56
- **Trigger:** User provides substantial existing material (>5KB, detailed docs, chat logs,
57
- design conversations, competitor analysis, previous specs, old ideation.md files).
267
+ **Trigger:** User provides substantial existing material (>5KB, detailed docs, chat logs).
58
268
 
59
- **The job:** Don't lose information. The user has already done deep thinking — your job is
60
- to organize it, validate it, and fill gaps.
269
+ **The job:** Don't lose information. Organize, validate, and fill gaps.
61
270
 
62
271
  **Process:**
63
272
  1. Read/ingest every document provided
64
- 2. Identify natural domain boundaries in the content
65
- 3. Create the `ideation/` folder structure: one domain file per identified domain
66
- 4. Seed each domain file with the relevant content from the source
67
- 5. Present the organized inventory: "Here's what I extracted, organized by domain: [list]. Is anything missing?"
68
- 6. Identify gaps domains or sub-topics not covered by the existing material
69
- 7. For each gap, switch to Interview Mode for that topic
70
- 8. Run Deep Think: "Based on the content you provided, I would also expect to see [X] and [Y]. Are those relevant?"
71
- 9. Validate completeness against the domain map in `ideation-index.md`
72
-
73
- **Anti-patterns:**
74
- - ❌ Summarizing 738KB into 70 lines (lossy compression)
75
- - ❌ Ignoring details because they don't fit the template
76
- - ❌ Re-asking questions the material already answers
77
- - ❌ Writing everything to one file then reorganizing later
78
- - ✅ Preserving depth, writing to domain files as you go, filling gaps
273
+ 2. **Run Structural Classification** determine project shape before creating any files
274
+ 3. Identify natural domain boundaries in the content
275
+ 4. Create fractal folder structure run the **Node Classification Gate** for each domain
276
+ 5. Seed each domain folder (index + CX + feature files) with content from the source
277
+ 6. Present the organized inventory: "Here's what I extracted, organized by domain"
278
+ 7. Identify gaps domains/sub-topics not covered
279
+ 8. For each gap, switch to Interview Mode
280
+ 9. Run Deep Think: "Based on your content, I would also expect [X] and [Y]. Are those relevant?"
79
281
 
80
282
  ### Expansion Mode — Thin Input
81
283
 
82
- **Trigger:** User provides brief notes, a rough sketch, a short PRD (<5KB, structured but shallow).
83
-
84
- **The job:** Take what's there and systematically deepen it. Every bullet point in their
85
- input should spawn 3-5 follow-up questions that drive toward implementation depth.
284
+ **Trigger:** Brief notes, rough sketch, short PRD (<5KB, structured but shallow).
86
285
 
87
286
  **Process:**
88
- 1. Read the input and identify domain boundaries
89
- 2. Create domain files for each identified area
90
- 3. For each domain, identify the depth level (surface → detailed → implementation-ready)
91
- 4. Start with the shallowest domains first
92
- 5. For each shallow domain, ask targeted deepening questions
93
- 6. Run Deep Think at each level to identify gaps
94
- 7. Update domain files and index as you go
95
-
96
- **Deepening questions by section type:**
97
- - **Feature mentioned without detail:** "You listed [feature]. Help me understand: What does the user see? What happens when they interact with it? What happens when it fails? What data does it need?"
98
- - **User type without specifics:** "You mentioned [user type]. What's their primary workflow? What frustrates them about existing solutions? What would make them switch?"
99
- - **Constraint without numbers:** "You noted [constraint]. Can we put a number on that? For latency — what's the threshold? For budget — what's the monthly ceiling?"
287
+ 1. Read input and identify domain boundaries
288
+ 2. Create fractal folder structure per Classification Gate
289
+ 3. For each domain, identify the depth level
290
+ 4. Start with shallowest domains, ask targeted deepening questions
291
+ 5. Run Deep Think at each level to identify gaps
292
+ 6. Update domain indexes and feature files as you go
100
293
 
101
294
  ### Interview Mode — No Input / One-Liner
102
295
 
103
- **Trigger:** User has no file input. They describe the idea verbally or provide a
104
- one-liner like "I want to build a repair shop management platform."
105
-
106
- **The job:** Be the relentless interviewer. Extract everything from the user's head through
107
- persistent, deep questioning.
296
+ **Trigger:** No file input. User describes idea verbally.
108
297
 
109
298
  **Process:**
110
299
  1. Start: "In one sentence, what problem does this solve and for whom?"
111
- 2. From that sentence, identify key nouns these become initial domains
112
- 3. Create domain files for each identified domain
113
- 4. Run the Recursive Domain Exhaustion Protocol (below)
114
- 5. Use the decision classification rule to route questions appropriately
115
- 6. Don't stop until the deep think protocol generates zero new hypotheses
116
-
117
- **Interview techniques:**
118
- - **Challenge weak answers:** "You mentioned risk management — what happens when a user hits their position limit? What's the escalation path?"
119
- - **Generate new thinking:** "You've described [A] and [B] — what happens when they interact? If A triggers while B is active, what should the system do?"
120
- - **Make them think about failures:** "What's the worst thing a user could do with [feature]?"
121
- - **Help them decide:** When the user says "I'm not sure," present 2-3 options with trade-offs.
300
+ 2. **Run Structural Classification** ask the 2-3 interview questions immediately
301
+ 3. From the problem statement, identify key nouns → initial domains
302
+ 4. Create fractal folder structure per Classification Gate
303
+ 5. Run the Recursive Domain Exhaustion Protocol
304
+ 6. Use decision classification rule to route questions
305
+ 7. Don't stop until Deep Think generates zero new hypotheses
122
306
 
123
307
  ---
124
308
 
@@ -133,211 +317,139 @@ At **every step** — domain discovery, breadth mapping, vertical drilling — p
133
317
  ask yourself these four questions before moving on:
134
318
 
135
319
  1. **What have I captured so far in this domain/sub-area?**
136
- Quick inventory of what's been discussed.
137
-
138
320
  2. **What would a domain expert expect to see here that hasn't been surfaced?**
139
- Based on the product type, industry, and user personas — what's standard in this
140
- space that we haven't discussed? What would a competitor's feature list include?
141
-
142
321
  3. **What should exist here because of interactions with other domains?**
143
- Based on cross-domain knowledge already captured — does this domain need something
144
- because of how it connects to other domains?
145
-
146
322
  4. **What common failure modes or edge cases are missing?**
147
- Based on production systems in similar industries — what breaks? What do users
148
- complain about? What do post-mortems reveal?
149
323
 
150
324
  ### Presenting Hypotheses
151
325
 
152
- For each hypothesis generated, present it to the user:
153
-
154
326
  > "Based on [reasoning], I think [X] might be relevant here. For example, in similar
155
327
  > systems, [concrete example]. Is this something your product needs?"
156
328
 
157
329
  **Outcomes:**
158
- - **CONFIRMED** → Add to the domain file. Drill into it.
159
- - **REJECTED** → Note the rejection with reason in the domain file's Deep Think table. Move on.
330
+ - **CONFIRMED** → Add to the domain/feature file. Drill into it.
331
+ - **REJECTED** → Note the rejection with reason in the Deep Think table.
160
332
  - **DEFERRED** → Note as an open question with owner and target stage.
161
333
 
162
334
  ### Tracking
163
335
 
164
- Record all hypotheses in each domain file's Deep Think Annotations table:
165
-
166
- ```
167
- | Hypothesis | Source | Outcome |
168
- |-----------|--------|---------|
169
- | "Purgatory queue needed for diagnostics not yet tied to a ticket" | Industry pattern | ✅ CONFIRMED |
170
- | "Customer loyalty program integration" | Competitor analysis | ❌ REJECTED: out of scope |
171
- ```
336
+ Record all hypotheses in each feature file's Deep Think Annotations table (see `fractal-feature-template.md`).
172
337
 
173
338
  ### Exhaustion Signal
174
339
 
175
- **The ideation process is considered complete for a domain when:**
340
+ The ideation process is complete for a feature when:
176
341
  1. Deep Think generates **zero new hypotheses** after a full pass
177
- 2. The user confirms "nothing else" for that domain
178
- 3. Both conditions must be true simultaneously
179
-
180
- This replaces the old "completed N passes" model. Exhaustion is evidence-based,
181
- not count-based.
342
+ 2. The user confirms "nothing else" for that feature
343
+ 3. Both conditions must be true simultaneously → mark as `[EXHAUSTED]`
182
344
 
183
345
  ---
184
346
 
185
347
  ## Recursive Domain Exhaustion Protocol
186
348
 
187
- > **This protocol replaces the old fixed-pass model.** Exploration is recursive:
188
- > breadth is always mapped before depth, and new discoveries at any level can trigger
189
- > re-exploration of higher levels.
190
-
191
349
  ### Level 0 — Global Domain Map
192
350
 
193
351
  **Goal:** Identify ALL domains before exploring ANY of them.
194
352
 
195
- 1. List all domains from the user's input
196
- 2. **Deep Think:** "Based on this product type and industry, what domains would I expect to see that haven't been mentioned?" Present hypotheses to user.
197
- 3. Create a domain file for each confirmed domain (using the ideation-domain-template)
198
- 4. Update `ideation-index.md` with the complete domain map
199
- 5. Note preliminary cross-cuts: "Domain A might touch Domain B because [reason]" → add to ledger as Level 0 entries
200
- 6. **Gate:** User confirms the domain list before proceeding
353
+ 1. List all domains from user input
354
+ 2. **Deep Think:** "What domains would a domain expert expect?"
355
+ 3. Run **Node Classification Gate** for each domain determine placement
356
+ 4. Create fractal folder for each: `{number}-{slug}/` + index + CX
357
+ 5. Update `ideation-index.md` with the complete structure map
358
+ 6. Note preliminary cross-cuts in global CX + relevant domain CX files
359
+ 7. **Gate:** User confirms domain list before proceeding
201
360
 
202
361
  ### Level 1 — Domain Breadth Sweep
203
362
 
204
- **Goal:** For each domain, map ALL sub-areas before drilling into ANY of them.
363
+ **Goal:** For each domain, map ALL children before drilling ANY.
205
364
 
206
365
  For each domain (dependency order — foundational first):
207
- 1. List all sub-areas/capabilities within the domain
208
- 2. **Deep Think:** "Based on this domain in this industry, what sub-areas would an expert expect?" Present hypotheses.
209
- 3. Write the breadth map to the domain file with `[SURFACE]` markers
210
- 4. Note cross-cuts at sub-area level add to ledger as Level 1 entries
211
- 5. **NEW DOMAINS DISCOVERED?** Loop back to Level 0. Do NOT proceed until domain map is stable.
212
- 6. **Gate:** User confirms the breadth maps before proceeding to drilling
213
- 7. Mark domain status as `[BREADTH]` in the index
366
+ 1. List all sub-areas/capabilities
367
+ 2. **Deep Think:** "What sub-areas would an expert expect in this domain?"
368
+ 3. Run **Node Classification Gate** for each — sub-domain (folder) or feature (file)?
369
+ 4. Create children: sub-domain folders or feature files as classified
370
+ 5. Update domain index (Children table + Role Matrix)
371
+ 6. Note cross-cuts in domain CX file
372
+ 7. **NEW DOMAINS DISCOVERED?** Loop to Level 0
373
+ 8. **Gate:** User confirms breadth maps before drilling
374
+ 9. Mark domain status as `[BREADTH]`
214
375
 
215
376
  ### Level 2+ — Vertical Drilling
216
377
 
217
- **Goal:** Drill each sub-area to implementation depth. Deep Think at every step.
378
+ **Goal:** Drill each child to implementation depth. Deep Think at every step.
218
379
 
219
- For each sub-area:
220
- 1. Apply the entity/feature/user/integration questions (see Exhaustion Questions below)
221
- 2. **Deep Think** per sub-area: "Based on this feature in this product, what edge cases, interactions, and failure modes would a production system need?"
222
- 3. Write drill results to the domain file
223
- 4. Cross-cuts with evidence → add to ledger as Level 2+ entries with evidence
224
- 5. **NEW SUB-AREAS DISCOVERED?** → Loop back to Level 1 for this domain. Map the new sub-area's breadth before drilling it.
225
- 6. **NEW DOMAINS DISCOVERED?** → Loop back to Level 0. Stabilize the domain map first.
226
- 7. When Deep Think yields zero new hypotheses AND user confirms → mark sub-area as `[EXHAUSTED]`
227
- 8. When all sub-areas are `[DEEP]` or `[EXHAUSTED]` → mark domain as `[DEEP]` or `[EXHAUSTED]`
228
-
229
- ### Status Markers
230
-
231
- | Marker | Meaning |
232
- |--------|---------|
233
- | `[SURFACE]` | Identified, not yet explored |
234
- | `[BREADTH]` | All sub-areas mapped, none drilled |
235
- | `[DEEP]` | Sub-areas drilled, some may still have open questions |
236
- | `[EXHAUSTED]` | Deep Think yields zero hypotheses, user confirms complete |
380
+ For each feature file / sub-domain:
381
+ 1. Apply the Exhaustion Questions
382
+ 2. **Deep Think** per feature
383
+ 3. Write results to feature files (behavior, edge cases, states, Role Lens)
384
+ 4. Cross-cuts with evidence → add to parent's CX file
385
+ 5. **Feature reveals 2+ interacting capabilities?** → Run Promotion protocol
386
+ 6. **NEW DOMAINS DISCOVERED?** → Loop to Level 0
387
+ 7. When Deep Think yields zero hypotheses AND user confirms → mark `[EXHAUSTED]`
237
388
 
238
389
  ---
239
390
 
240
391
  ## Exhaustion Questions
241
392
 
242
393
  ### For Every Entity
243
-
244
394
  - What are its attributes/fields?
245
395
  - What are its possible states?
246
- - What transitions between states? What triggers each transition?
396
+ - What triggers each state transition?
247
397
  - What's the full lifecycle (creation → active use → archival/deletion)?
248
398
  - Who can create, read, update, delete it?
249
399
  - What happens when it's referenced by other entities and gets deleted?
250
400
 
251
401
  ### For Every Feature
252
-
253
402
  - What does the user see when they first encounter this feature?
254
403
  - What's the happy path interaction flow (step by step)?
255
404
  - What happens when it fails? What error does the user see?
256
- - What happens on partial failure (e.g., network drops mid-operation)?
405
+ - What happens on partial failure?
257
406
  - What permissions are required? What happens without them?
258
407
  - Does it have different states (loading, empty, populated, error)?
259
408
  - How does it interact with other features?
260
- - What edge cases exist? (concurrent edits, duplicate submissions, boundary values)
409
+ - What edge cases exist?
261
410
 
262
411
  ### For Every User Type
263
-
264
- - What's their primary workflow through the product?
265
- - What's the worst thing they could intentionally do? How is it prevented?
266
- - What's the worst thing they could accidentally do? How is it recovered?
412
+ - What's their primary workflow?
413
+ - What's the worst thing they could intentionally do?
414
+ - What's the worst thing they could accidentally do?
267
415
  - What do they see that other user types don't?
268
416
  - What can they do that other user types can't?
269
- - What's their tolerance for complexity? (progressive disclosure implications)
417
+ - What's their tolerance for complexity?
270
418
 
271
419
  ### For Every Integration / External System
272
-
273
- - What happens when it's unavailable? (retry? fallback? degrade gracefully?)
274
- - What's the expected latency? What if it's 10x slower than expected?
275
- - What data format does it use? How does the product transform it?
276
- - What rate limits exist? How does the product handle hitting them?
420
+ - What happens when it's unavailable?
421
+ - What's the expected latency? What if 10x slower?
422
+ - What data format does it use?
423
+ - What rate limits exist?
277
424
  - What happens when the external system changes its API?
278
425
 
279
426
  ---
280
427
 
281
428
  ## Cross-Cut Watch Protocol
282
429
 
283
- Cross-cut detection is **always-on** regardless of mode or level. During all active
284
- exploration, maintain awareness:
430
+ Cross-cut detection is **always-on** regardless of mode or level. During all active exploration:
285
431
 
286
- - After each sub-feature: "Does this behavior depend on or affect any other domain?"
287
- - After each edge case: "Which other parts of the system need to know about this failure mode?"
288
- - After each state transition: "Does this state change trigger anything in another domain?"
432
+ - After each sub-feature: "Does this depend on or affect any other domain?"
433
+ - After each edge case: "Which other parts need to know about this failure mode?"
434
+ - After each state transition: "Does this trigger anything in another domain?"
289
435
 
290
- When a cross-cut is identified, immediately log it to `cross-cuts/cross-cut-ledger.md`
291
- at the appropriate level:
436
+ When a cross-cut is identified, log it to the appropriate CX file:
292
437
 
293
- - **Level 0** (during domain map): surface guesses, low confidence
294
- - **Level 1** (during breadth sweep): sub-domain connections, medium confidence
295
- - **Level 2+** (during drilling): evidence-backed, high confidence
438
+ | Discovery Level | Where to Log | Confidence |
439
+ |----------------|-------------|------------|
440
+ | During domain mapping | Parent node's CX file + global `ideation-cx.md` (if cross-surface) | Low |
441
+ | During breadth sweep | Domain CX file | Medium |
442
+ | During drilling | Sub-domain CX file or feature's cross-cut notes | High |
296
443
 
297
444
  ### Cross-Cut Synthesis Questions
298
445
 
299
- For each confirmed cross-cut pair, ask all five questions:
446
+ For each confirmed cross-cut (CX entry with High confidence), answer all five synthesis questions per the `fractal-cx-template.md`:
300
447
 
301
- 1. **Shared state conflict**: If both features write to the same entity, who wins? Merge/override strategy? Canonical owner?
302
- 2. **Trigger chain**: Does A automatically trigger B? Rollback semantics if B fails? Sync or async?
303
- 3. **Permission intersection**: Does permission in Domain A affect what's possible in Domain B?
304
- 4. **Notification fan-out**: Does an event in A need to notify actors in B? Who owns the notification contract?
305
- 5. **State transition conflict**: Can A and B be triggered simultaneously? Data consistency if they race?
306
-
307
- Record synthesis outcomes in the cross-cut ledger. Never clear entries — the ledger is the audit trail.
308
-
309
- ---
310
-
311
- ## Domain Coverage Map
312
-
313
- Throughout the conversation, maintain and periodically share a coverage map. The format
314
- uses level-based status with sub-area counts:
315
-
316
- ```
317
- Domain Coverage Map — [Project Name]
318
- ═══════════════════════════════════════
319
-
320
- Domain 01: Consumer Platform [DEEP]
321
- ├── Intake Flow [EXHAUSTED] — 12 sub-topics, 4 hypotheses confirmed
322
- ├── Customer Portal [DEEP] — 8 sub-topics, 2 hypotheses confirmed
323
- └── Payments [BREADTH] — 5 sub-areas mapped, not yet drilled
324
-
325
- Domain 02: Shop Software [BREADTH]
326
- ├── Counter Mode [DEEP] — 8 sub-topics, 3 hypotheses confirmed
327
- ├── Tech Mode [SURFACE] — 2 sub-topics noted
328
- ├── Inventory [EXHAUSTED] — 15 sub-topics, 0 new hypotheses
329
- └── Multi-Location [SURFACE] — 1 sub-topic noted
330
-
331
- Overall: 7 domains | 2 EXHAUSTED, 3 DEEP, 1 BREADTH, 1 SURFACE
332
- Deep Think: 23 hypotheses presented, 18 confirmed, 5 rejected
333
- Cross-cuts: 12 confirmed, 4 pending, 3 rejected
334
- ```
335
-
336
- **Rules:**
337
- - Share the map after every domain or every 3-4 drilling sequences
338
- - Use it to guide: "Domain 02 has 2 sub-areas still at SURFACE. Should we drill those?"
339
- - Write the coverage map to `ideation-index.md` after each update
340
- - Don't compile the vision summary until all domains are at least `[DEEP]`
448
+ 1. **Shared state conflict** Who owns the entity? Merge strategy?
449
+ 2. **Trigger chain** Does A trigger B? Rollback if B fails? Sync/async?
450
+ 3. **Permission intersection** Does permission in A affect B?
451
+ 4. **Notification fan-out** Does an event in A notify actors in B?
452
+ 5. **State transition conflict** Can A and B race? Consistency impact?
341
453
 
342
454
  ---
343
455
 
@@ -349,44 +461,30 @@ Cross-cuts: 12 confirmed, 4 pending, 3 rejected
349
461
  | **Architecture** | Note for `/create-prd`. Don't burden the user. | "Should we use SQL or NoSQL?" |
350
462
  | **Implementation** | Note for later. Don't even mention it. | "How should we name the routes?" |
351
463
 
352
- **Exception:** If the user brings up architecture or implementation, engage with it.
353
- Don't refuse to discuss it — just don't initiate it.
464
+ **Exception:** If the user brings up architecture or implementation, engage. Don't refuse — just don't initiate it.
354
465
 
355
466
  ---
356
467
 
357
468
  ## Breadth Before Depth
358
469
 
359
470
  ### No Premature Drilling
360
-
361
- Complete the breadth map of all sub-areas within a domain **before drilling any
362
- single sub-area**. This ensures no sub-area is missed because you went deep too early.
471
+ Complete the breadth map of all children within a node **before drilling any single child**.
363
472
 
364
473
  ### No Premature Compilation
365
-
366
474
  Don't start writing the vision summary until:
367
- - All domains are at least `[DEEP]`
368
- - Every Must Have feature explored to ≥Level 2 (sub-features and failure modes)
475
+ - All leaf nodes are at least `[DEEP]`
476
+ - Every Must Have feature explored to ≥Level 2
369
477
  - Deep Think yields zero new hypotheses across ALL domains
370
- - User has confirmed the domain coverage map
478
+ - User has confirmed the coverage map
371
479
 
372
480
  ### Challenge Weak Answers
373
-
374
- When the user gives a one-sentence answer to a complex question, don't accept it. Probe:
375
-
376
- - **Weak:** "Yeah, we need notifications."
377
- - **Probe:** "What kinds of notifications? Just in-app, or also email and push? What events trigger them? Can users configure which ones they receive? What happens with notification overload?"
481
+ When the user gives a one-sentence answer to a complex question, don't accept it. Probe.
378
482
 
379
483
  ### Summarize and Validate
380
-
381
- After every 5-6 questions, pause and summarize:
382
- - "Here's what I've captured about [topic] so far: [summary]. Does this cover everything?"
383
- - This prevents drift, catches misunderstandings, and creates natural checkpoints.
484
+ After every 5-6 questions, pause and summarize to prevent drift.
384
485
 
385
486
  ### Progress Transparency
386
-
387
- Be transparent about where you are:
388
- - "We've explored [N] of [M] domains to DEEP level. [Domain X] is still at BREADTH."
389
- - "Deep Think is still generating hypotheses for this domain — we're not done yet."
487
+ Be transparent: "We've explored [N] of [M] domains to DEEP level. [Domain X] is still at BREADTH."
390
488
 
391
489
  ---
392
490
 
@@ -394,7 +492,7 @@ Be transparent about where you are:
394
492
 
395
493
  - **Does not make product decisions** — It extracts them from the user
396
494
  - **Does not explore architecture** — That's `/create-prd`'s job
397
- - **Does not replace brainstorming** — Brainstorming is a lightweight modifier for quick decisions; this is a heavyweight extraction engine
398
- - **Does not produce the vision document** — The ideate-validate workflow compiles the summary; this skill drives the conversation that fills the domain files
495
+ - **Does not replace brainstorming** — Brainstorming is lightweight; this is heavyweight extraction
496
+ - **Does not produce the vision document** — `ideate-validate` compiles the summary
399
497
  - **Does not rush** — The entire downstream pipeline depends on the depth produced here
400
- - **Does not write to a monolithic file** — Each domain gets its own file from the moment it's discovered
498
+ - **Does not prescribe shard boundaries** — That's `/decompose-architecture`'s job