popilot 0.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 (136) hide show
  1. package/README.md +372 -0
  2. package/adapters/claude-code/.claude/commands/_domain.md.hbs +32 -0
  3. package/adapters/claude-code/.claude/commands/analytics.md.hbs +55 -0
  4. package/adapters/claude-code/.claude/commands/daily.md.hbs +301 -0
  5. package/adapters/claude-code/.claude/commands/dev.md.hbs +62 -0
  6. package/adapters/claude-code/.claude/commands/handoff.md +258 -0
  7. package/adapters/claude-code/.claude/commands/market.md +120 -0
  8. package/adapters/claude-code/.claude/commands/metrics.md +123 -0
  9. package/adapters/claude-code/.claude/commands/oscar-loop.md +436 -0
  10. package/adapters/claude-code/.claude/commands/party.md +85 -0
  11. package/adapters/claude-code/.claude/commands/plan.md +43 -0
  12. package/adapters/claude-code/.claude/commands/research.md +203 -0
  13. package/adapters/claude-code/.claude/commands/retro.md +68 -0
  14. package/adapters/claude-code/.claude/commands/save.md +440 -0
  15. package/adapters/claude-code/.claude/commands/sessions.md +139 -0
  16. package/adapters/claude-code/.claude/commands/sprint.md +106 -0
  17. package/adapters/claude-code/.claude/commands/start.md +368 -0
  18. package/adapters/claude-code/.claude/commands/strategy.md +41 -0
  19. package/adapters/claude-code/.claude/commands/task.md +220 -0
  20. package/adapters/claude-code/.claude/commands/tracking.md +116 -0
  21. package/adapters/claude-code/.claude/commands/validate.md +58 -0
  22. package/adapters/claude-code/CLAUDE.md.hbs +208 -0
  23. package/adapters/claude-code/manifest.yaml +36 -0
  24. package/bin/cli.mjs +218 -0
  25. package/lib/adapter.mjs +68 -0
  26. package/lib/doctor.mjs +161 -0
  27. package/lib/hydrate.mjs +421 -0
  28. package/lib/prompt.mjs +78 -0
  29. package/lib/scaffold.mjs +155 -0
  30. package/lib/setup-wizard.mjs +331 -0
  31. package/lib/template-engine.mjs +164 -0
  32. package/lib/yaml-lite.mjs +476 -0
  33. package/package.json +30 -0
  34. package/scaffold/.context/.secrets.yaml.example +20 -0
  35. package/scaffold/.context/WORKFLOW.md.hbs +332 -0
  36. package/scaffold/.context/agents/TEMPLATE.md +115 -0
  37. package/scaffold/.context/agents/analyst.md.hbs +362 -0
  38. package/scaffold/.context/agents/developer.md.hbs +390 -0
  39. package/scaffold/.context/agents/handoff-specialist.md.hbs +292 -0
  40. package/scaffold/.context/agents/market-researcher.md.hbs +288 -0
  41. package/scaffold/.context/agents/ollie.md +323 -0
  42. package/scaffold/.context/agents/operations.md.hbs +293 -0
  43. package/scaffold/.context/agents/orchestrator.md.hbs +434 -0
  44. package/scaffold/.context/agents/planner.md.hbs +405 -0
  45. package/scaffold/.context/agents/qa.md.hbs +409 -0
  46. package/scaffold/.context/agents/researcher.md.hbs +330 -0
  47. package/scaffold/.context/agents/sage.md +349 -0
  48. package/scaffold/.context/agents/strategist.md.hbs +339 -0
  49. package/scaffold/.context/agents/tracking-governor.md.hbs +291 -0
  50. package/scaffold/.context/agents/validator.md.hbs +365 -0
  51. package/scaffold/.context/integrations/_registry.yaml +38 -0
  52. package/scaffold/.context/integrations/providers/channel_io.yaml +38 -0
  53. package/scaffold/.context/integrations/providers/corti.yaml +203 -0
  54. package/scaffold/.context/integrations/providers/ga4.yaml +116 -0
  55. package/scaffold/.context/integrations/providers/intercom.yaml +47 -0
  56. package/scaffold/.context/integrations/providers/linear.yaml +46 -0
  57. package/scaffold/.context/integrations/providers/mixpanel.yaml +73 -0
  58. package/scaffold/.context/integrations/providers/notebooklm.yaml +74 -0
  59. package/scaffold/.context/integrations/providers/notion.yaml +129 -0
  60. package/scaffold/.context/integrations/providers/prod_db.yaml +183 -0
  61. package/scaffold/.context/oscar/workflows/multi-agent.md +82 -0
  62. package/scaffold/.context/oscar/workflows/ollie-sage.md +128 -0
  63. package/scaffold/.context/oscar/workflows/session-git.md +71 -0
  64. package/scaffold/.context/oscar/workflows/setup.md +663 -0
  65. package/scaffold/.context/oscar/workflows/tracking.md +118 -0
  66. package/scaffold/.context/project.yaml.example +102 -0
  67. package/scaffold/.context/templates/dev-guide.md +217 -0
  68. package/scaffold/.context/templates/epic-spec.md +225 -0
  69. package/scaffold/.context/templates/guardrail.md +94 -0
  70. package/scaffold/.context/templates/handoff-checklist.md +197 -0
  71. package/scaffold/.context/templates/prd.md +80 -0
  72. package/scaffold/.context/templates/retrospective.md +78 -0
  73. package/scaffold/.context/templates/screen-spec.md +714 -0
  74. package/scaffold/.context/templates/sprint-plan.md +72 -0
  75. package/scaffold/.context/templates/sprint-status.yaml +109 -0
  76. package/scaffold/.context/templates/story-v2.md +228 -0
  77. package/scaffold/.context/templates/validation-report.md +99 -0
  78. package/scaffold/.gitignore.append +7 -0
  79. package/scaffold/spec-site/env.d.ts +7 -0
  80. package/scaffold/spec-site/index.html +14 -0
  81. package/scaffold/spec-site/package.json +20 -0
  82. package/scaffold/spec-site/src/App.vue +27 -0
  83. package/scaffold/spec-site/src/assets/icons/menu/ic_ads.svg +10 -0
  84. package/scaffold/spec-site/src/assets/icons/menu/ic_ads_on.svg +10 -0
  85. package/scaffold/spec-site/src/assets/icons/menu/ic_board.svg +14 -0
  86. package/scaffold/spec-site/src/assets/icons/menu/ic_board_on.svg +14 -0
  87. package/scaffold/spec-site/src/assets/icons/menu/ic_dashboard.svg +21 -0
  88. package/scaffold/spec-site/src/assets/icons/menu/ic_dashboard_on.svg +21 -0
  89. package/scaffold/spec-site/src/assets/icons/menu/ic_pricing.svg +20 -0
  90. package/scaffold/spec-site/src/assets/icons/menu/ic_pricing_on.svg +20 -0
  91. package/scaffold/spec-site/src/assets/icons/menu/ic_store.svg +11 -0
  92. package/scaffold/spec-site/src/assets/icons/menu/ic_store_on.svg +11 -0
  93. package/scaffold/spec-site/src/components/Accordion.vue +108 -0
  94. package/scaffold/spec-site/src/components/AppHeader.vue +304 -0
  95. package/scaffold/spec-site/src/components/Badge.vue +25 -0
  96. package/scaffold/spec-site/src/components/CoachingCard.vue +112 -0
  97. package/scaffold/spec-site/src/components/MemoSidebar.vue +239 -0
  98. package/scaffold/spec-site/src/components/MockupShell.vue +100 -0
  99. package/scaffold/spec-site/src/components/RuleTable.vue +99 -0
  100. package/scaffold/spec-site/src/components/ScenarioSwitcher.vue +103 -0
  101. package/scaffold/spec-site/src/components/SpecNav.vue +26 -0
  102. package/scaffold/spec-site/src/components/SpecSection.vue +59 -0
  103. package/scaffold/spec-site/src/components/SummaryGrid.vue +39 -0
  104. package/scaffold/spec-site/src/components/VersionBadge.vue +38 -0
  105. package/scaffold/spec-site/src/composables/useActiveSection.ts +53 -0
  106. package/scaffold/spec-site/src/composables/useMemo.ts +138 -0
  107. package/scaffold/spec-site/src/composables/useRetro.ts +313 -0
  108. package/scaffold/spec-site/src/composables/useScenario.ts +43 -0
  109. package/scaffold/spec-site/src/composables/useScenarioStore.ts +102 -0
  110. package/scaffold/spec-site/src/composables/useTurso.ts +160 -0
  111. package/scaffold/spec-site/src/composables/useUser.ts +25 -0
  112. package/scaffold/spec-site/src/data/navigation.ts +59 -0
  113. package/scaffold/spec-site/src/data/types.ts +90 -0
  114. package/scaffold/spec-site/src/data/wireframeRegistry.ts +25 -0
  115. package/scaffold/spec-site/src/layouts/SplitPaneLayout.vue +79 -0
  116. package/scaffold/spec-site/src/main.ts +10 -0
  117. package/scaffold/spec-site/src/pages/IndexPage.vue +66 -0
  118. package/scaffold/spec-site/src/pages/PolicyDetail.vue +215 -0
  119. package/scaffold/spec-site/src/pages/PolicyIndex.vue +74 -0
  120. package/scaffold/spec-site/src/pages/retro/RetroActions.vue +191 -0
  121. package/scaffold/spec-site/src/pages/retro/RetroBoard.vue +192 -0
  122. package/scaffold/spec-site/src/pages/retro/RetroCard.vue +131 -0
  123. package/scaffold/spec-site/src/pages/retro/RetroHeader.vue +287 -0
  124. package/scaffold/spec-site/src/pages/retro/RetroPage.vue +178 -0
  125. package/scaffold/spec-site/src/pages/shared/NoContentPlaceholder.vue +34 -0
  126. package/scaffold/spec-site/src/pages/shared/PlaceholderContent.vue +22 -0
  127. package/scaffold/spec-site/src/pages/shared/PlaceholderSpecPanel.vue +16 -0
  128. package/scaffold/spec-site/src/pages/shared/PolicyFallback.vue +145 -0
  129. package/scaffold/spec-site/src/pages/wireframe/WireframeShell.vue +151 -0
  130. package/scaffold/spec-site/src/router.ts +85 -0
  131. package/scaffold/spec-site/src/styles/base.css +21 -0
  132. package/scaffold/spec-site/src/styles/split-pane.css +143 -0
  133. package/scaffold/spec-site/src/styles/variables.css +47 -0
  134. package/scaffold/spec-site/src/utils/markdown.ts +197 -0
  135. package/scaffold/spec-site/tsconfig.json +20 -0
  136. package/scaffold/spec-site/vite.config.ts +18 -0
@@ -0,0 +1,663 @@
1
+ # Oscar Setup Workflow
2
+
3
+ The Setup workflow that Oscar runs on first project launch.
4
+
5
+ ## Trigger Condition
6
+
7
+ When `/start` is executed and the `.context/project.yaml` file does not exist, the Setup Wizard begins.
8
+
9
+ ---
10
+
11
+ ## Phase 0: Project Type Detection
12
+
13
+ ```
14
+ 🎩 Oscar: Analyzing the project...
15
+ ```
16
+
17
+ ### Detection Logic
18
+
19
+ Check for the existence of the following files/folders in the project root:
20
+
21
+ | File/Folder | Meaning |
22
+ |-------------|---------|
23
+ | `package.json` | Node.js project |
24
+ | `requirements.txt` / `pyproject.toml` | Python project |
25
+ | `go.mod` | Go project |
26
+ | `Cargo.toml` | Rust project |
27
+ | `src/` / `app/` / `lib/` | Source code exists |
28
+ | `README.md` | Project documentation |
29
+
30
+ ### Branching
31
+
32
+ ```
33
+ ├── Code/config files exist → Brownfield mode (Phase 0.5)
34
+ └── Nothing found → Greenfield mode (proceed to Phase 1)
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Phase 0.5: Brownfield Full Scan (When code exists)
40
+
41
+ ```
42
+ 🎩 Oscar: I see existing code. Let me analyze it first.
43
+ ```
44
+
45
+ ### Scan Targets
46
+
47
+ **Included:**
48
+ - Source folders: `src/`, `app/`, `lib/`, `components/`, `pages/`
49
+ - Config files: `package.json`, `requirements.txt`, `*.config.js`, `*.yaml`
50
+ - Documentation: `README.md`, `docs/`
51
+ - Environment variable examples: `.env.example`, `.env.sample`
52
+ - Schemas: `prisma/schema.prisma`, `*.sql`
53
+
54
+ **Excluded:**
55
+ - `node_modules/`, `venv/`, `.venv/`, `__pycache__/`
56
+ - `dist/`, `build/`, `.next/`, `out/`
57
+ - `.git/`
58
+ - `*.lock`, `package-lock.json`, `yarn.lock`
59
+ - Binary files, images, etc.
60
+
61
+ ### Analysis Items
62
+
63
+ 1. **Tech Stack**
64
+ - Framework (Next.js, Django, etc.)
65
+ - Language version
66
+ - Key dependencies
67
+
68
+ 2. **Project Structure**
69
+ - Folder structure mapping
70
+ - Architecture pattern inference
71
+
72
+ 3. **README Parsing**
73
+ - Project description
74
+ - Installation method
75
+ - Feature list
76
+
77
+ 4. **Environment Variables**
78
+ - Infer required external integrations
79
+
80
+ ### Results Presentation
81
+
82
+ ```markdown
83
+ 🎩 Oscar: I've analyzed the code and here's what I found.
84
+
85
+ ## Tech Stack
86
+ - Frontend: {detected stack}
87
+ - Backend: {detected stack}
88
+ - Infra: {detected infrastructure}
89
+
90
+ ## Project Structure
91
+ {folder structure}
92
+
93
+ ## Content from README
94
+ {key content}
95
+
96
+ ───────────────────────────────────────
97
+ Does this analysis look correct? Let me know if anything needs to be modified or added.
98
+ ```
99
+
100
+ ### After User Confirmation
101
+
102
+ - Apply modifications
103
+ - Move to Phase 2 (supplementary interview)
104
+
105
+ ---
106
+
107
+ ## Phase 1: User Interview (🎩 Oscar)
108
+
109
+ ```
110
+ 🎩 Oscar: Hello! I'm Oscar. Nice to meet you.
111
+ We'll be working together, so may I ask you a few questions first?
112
+ ```
113
+
114
+ ### Question List
115
+
116
+ 1. **How to Address You**
117
+ ```
118
+ "What should I call you?"
119
+ ```
120
+
121
+ 2. **Communication Style**
122
+ ```
123
+ "Do you have a preferred communication style?"
124
+ e.g., Concise answers / Detailed explanations / Presenting options, etc.
125
+ ```
126
+
127
+ 3. **Work Style**
128
+ ```
129
+ "What work style do you prefer?"
130
+ e.g., Step-by-step confirmation / Autonomous execution / Fast execution, etc.
131
+ ```
132
+
133
+ ### Result
134
+
135
+ → Create `.context/user-context.yaml`
136
+
137
+ ```yaml
138
+ identity:
139
+ name: "{input value}"
140
+ preferred_name: "{input value}"
141
+
142
+ communication:
143
+ - "{identified style}"
144
+
145
+ work_style:
146
+ - "{identified approach}"
147
+
148
+ _meta:
149
+ created_at: "{current timestamp}"
150
+ updated_at: "{current timestamp}"
151
+ sources: ["setup"]
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Phase 2: In-depth Project Interview (🎯 Simon deployed)
157
+
158
+ ```
159
+ 🎩 Oscar: I'm deploying Simon for a deeper understanding of the project.
160
+
161
+ 🎯 Simon: Hello, {name}. Let's have an in-depth conversation about the project.
162
+ Take your time. It should take about 15-20 minutes.
163
+ ```
164
+
165
+ ### Interview Structure
166
+
167
+ #### 1. Problem & Market
168
+
169
+ ```
170
+ "What is the core problem this project aims to solve?"
171
+ "Who are the people experiencing this problem?"
172
+ "How are they currently solving this problem?"
173
+ "Why do you think this problem needs to be solved now?"
174
+ ```
175
+
176
+ **If unsure:**
177
+ ```
178
+ 🎯 Simon: "Let me look into the relevant market..."
179
+ → Use WebSearch tool for market research
180
+ → Share results and discuss together
181
+ ```
182
+
183
+ #### 2. Solution & Differentiation
184
+
185
+ ```
186
+ "How do you plan to solve this problem?"
187
+ "What is the key differentiator compared to existing alternatives?"
188
+ "What changes will customers experience when using this service?"
189
+ "How would you describe this service in one sentence?"
190
+ ```
191
+
192
+ **If competitors are unclear:**
193
+ ```
194
+ 🎯 Simon: "Let me find and compare similar services..."
195
+ → Competitive analysis via WebSearch
196
+ → Derive differentiators together
197
+ ```
198
+
199
+ #### 3. Current State & Uncertainty
200
+
201
+ ```
202
+ "How far have you progressed so far?"
203
+ → Idea / Prototype / MVP / Launched / PMF / Growth
204
+ "What is the biggest uncertainty right now?"
205
+ "What do you want to validate next?"
206
+ "What is the nearest milestone?"
207
+ ```
208
+
209
+ #### 3.5. Work Domains - Optional
210
+
211
+ ```
212
+ "Are your main work areas divided into domains?"
213
+ e.g., Marketing, CS, Payments / Frontend, Backend, Infra / None (single domain)
214
+ ```
215
+
216
+ **If yes:**
217
+ ```
218
+ "Can you briefly describe each domain?"
219
+ ```
220
+
221
+ → Reflect in the `operations.domains` section of `project.yaml`
222
+
223
+ **If no:**
224
+ → Skip domains section (can be added later when needed)
225
+
226
+ #### 4. Validation & Learning
227
+
228
+ ```
229
+ "What has been confirmed so far and what is still unknown?"
230
+ "Have you talked with customers? What was the most memorable feedback?"
231
+ "Have you experienced any failures or pivots?"
232
+ "What part of this project are you most confident about?"
233
+ ```
234
+
235
+ ### Summary & Confirmation
236
+
237
+ ```
238
+ 🎯 Simon: Let me summarize what I've understood.
239
+
240
+ ## Project Summary
241
+ - **Core Problem**: ...
242
+ - **Target Customer**: ...
243
+ - **Solution**: ...
244
+ - **Differentiation**: ...
245
+ - **Current Stage**: ...
246
+ - **Key Uncertainty**: ...
247
+
248
+ Does this summary look correct? Let me know if anything needs to be modified or added.
249
+ ```
250
+
251
+ ### Result
252
+
253
+ → Create `.context/project.yaml`
254
+
255
+ ---
256
+
257
+ ## Phase 3: Integration Setup (Based on Integration Registry)
258
+
259
+ ```
260
+ 🎩 Oscar: Let me set up external tool integrations. Please select only what you need.
261
+ ```
262
+
263
+ ### Integration Options Overview (Dynamically generated from Registry)
264
+
265
+ Dynamically reads categories and provider lists from the Integration Registry (`.context/integrations/`) and displays them.
266
+
267
+ ```
268
+ 🎩 Oscar: You can integrate the following tools.
269
+ ```
270
+
271
+ **Category-based provider display logic:**
272
+
273
+ ```
274
+ 1. Read category list from _registry.yaml
275
+ 2. Collect providers belonging to each category from *.yaml files in providers/ folder
276
+ 3. Group by category and present to the user
277
+ ```
278
+
279
+ Example output:
280
+ ```
281
+ [Analytics]
282
+ □ GA4 (Google Analytics 4) — Event-based user behavior analysis
283
+ □ Mixpanel — Product analytics, funnels, retention
284
+ â–¡ None
285
+
286
+ [Project Management]
287
+ □ Notion — Task management, document management, roadmap
288
+ □ Linear — Issue tracking, project management, roadmap
289
+ â–¡ None
290
+
291
+ [Customer Feedback]
292
+ □ Channel.io — CS chat data, VOC collection/analysis
293
+ □ Intercom — Customer support, messaging, VOC analysis
294
+ â–¡ None
295
+
296
+ [Database]
297
+ □ Production Database — Direct queries on production/snapshot DB
298
+ â–¡ None
299
+
300
+ [AI Research]
301
+ □ NotebookLM — AI-powered customer/user insight exploration
302
+ â–¡ None
303
+
304
+ Which of these are you currently using?
305
+ ```
306
+
307
+ ### Additional Questions Per Selected Provider
308
+
309
+ When a user selects a provider, ask the `setup_questions` from that provider's YAML in order.
310
+
311
+ ```
312
+ e.g., When GA4 is selected:
313
+ 🎩 Oscar: You're using GA4.
314
+ 1. "Please provide your GA4 Property ID." (e.g., 462897329)
315
+
316
+ e.g., When DB is selected:
317
+ 🎩 Oscar: You're using a DB. Let me ask a few more questions.
318
+ 1. "What is the production DB MCP server name?" (e.g., prod_service_db)
319
+ 2. "What is the snapshot DB MCP server name?" (optional, e.g., snapshot_service_db)
320
+ 3. "What is the port forwarding tunnel script path?" (optional)
321
+ 4. "What is the heavy table warning list?" (optional)
322
+ 5. "What are the DB usage rules summary?" (optional)
323
+ ```
324
+
325
+ ### Integration Setup Result
326
+
327
+ → Reflected in the `operations.integrations` section of `project.yaml`
328
+
329
+ ```yaml
330
+ # Format stored in project.yaml (maintaining existing schema)
331
+ operations:
332
+ integrations:
333
+ ga4:
334
+ enabled: true
335
+ property_id: "462897329"
336
+ notion:
337
+ enabled: true
338
+ workspace: "My Workspace"
339
+ daily_page_id: "abc123..."
340
+ # ... response values from each provider's setup_questions
341
+ ```
342
+
343
+ ### Sensitive Information Notice
344
+
345
+ ```
346
+ 🎩 Oscar: Please configure sensitive information needed for external integrations in .secrets.yaml.
347
+ Would you like me to generate a template?
348
+ ```
349
+
350
+ → Create `.context/.secrets.yaml` template (optional)
351
+
352
+ ### Dev Scope Setup (When a development dashboard exists)
353
+
354
+ ```
355
+ 🎩 Oscar: Do you have a separate development repository?
356
+ If so, Derek (Development) and Quinn (QA) will work in that repo.
357
+ ```
358
+
359
+ → Reflected in the `dev_scope` section of `project.yaml`
360
+
361
+ ---
362
+
363
+ ## Phase 4: Template Hydration (Integration Registry Integrated)
364
+
365
+ ```
366
+ 🎩 Oscar: Adjusting agents and commands to fit the project based on the configuration.
367
+ ```
368
+
369
+ ### Hydration Procedure
370
+
371
+ #### Step 1: Integration Marker Substitution (New)
372
+
373
+ 1. **Collect list of enabled provider IDs from project.yaml**
374
+ ```
375
+ e.g., [ga4, prod_db, notion, channel_io, notebooklm]
376
+ ```
377
+
378
+ 2. **Read each provider YAML** (`integrations/providers/{id}.yaml`)
379
+
380
+ 3. **Build capabilities map**
381
+ ```yaml
382
+ capabilities:
383
+ analytics: true # ga4 is analytics category
384
+ database: true # prod_db is database category
385
+ pm_tool: true # notion is pm_tool category
386
+ customer_feedback: true # channel_io is customer_feedback category
387
+ ai_research: true # notebooklm is ai_research category
388
+ ```
389
+
390
+ 4. **Agent-level marker substitution**
391
+
392
+ For each agent .hbs file:
393
+
394
+ a. Check which categories map to the agent in `_registry.yaml`
395
+ b. Collect `agent_prompts.{agent_name}` from enabled providers in those categories
396
+ c. Replace `{{config.KEY}}` in prompts → with project.yaml config values
397
+ d. Expand `{{#each config.KEY}}` in prompts → array expansion
398
+ e. Combine collected prompts
399
+ f. Replace `{{INTEGRATION_PROMPTS}}` marker → with combined prompts
400
+ g. Replace `{{INTEGRATION_TOOLS_FOOTER}}` → with combined `footer_tool_line`
401
+ h. Replace `{{INTEGRATION_CAUTION_LIST}}` → with database provider's `caution_list`
402
+
403
+ 5. **Command-level marker substitution**
404
+
405
+ For each command .hbs file:
406
+
407
+ a. Check which categories map to the command in `_registry.yaml`
408
+ b. Collect `command_prompts.{command_name}` from enabled providers in those categories
409
+ c. Substitute config then combine
410
+ d. Replace `{{INTEGRATION_PROMPTS}}` marker → with combined prompts
411
+
412
+ 6. **System file marker substitution**
413
+
414
+ For CLAUDE.md.hbs, WORKFLOW.md.hbs:
415
+
416
+ a. Check categories where `system_files` includes the file in `_registry.yaml`
417
+ b. Collect `safety_rules` / `workflow_rules` from enabled providers in those categories
418
+ c. Substitute config then combine
419
+ d. Replace `{{INTEGRATION_SAFETY_RULES}}` marker → with combined `safety_rules` (for CLAUDE.md)
420
+ e. Replace `{{INTEGRATION_WORKFLOW_RULES}}` marker → with combined `workflow_rules` (for WORKFLOW.md)
421
+
422
+ #### Step 2: Standard Handlebars Rendering
423
+
424
+ 1. **Collect `.hbs` file list**
425
+ ```
426
+ .context/agents/*.md.hbs
427
+ .context/WORKFLOW.md.hbs
428
+ .claude/commands/*.md.hbs
429
+ CLAUDE.md.hbs
430
+ ```
431
+
432
+ 2. **Build variable context**
433
+ - Extract project, integrations, domains, dev_scope, spec_site from `project.yaml`
434
+ - **Add capabilities map** (generated in Step 1)
435
+ - Convert to flat namespace
436
+
437
+ 3. **Render each `.hbs` → `.md`**
438
+ - `{{var}}` → value substitution
439
+ - `{{#if path}}...{{/if}}` → conditional include/exclude
440
+ - `{{#if capabilities.pm_tool}}...{{/if}}` → capability-based conditional
441
+ - `{{#each path}}...{{/each}}` → iteration generation
442
+
443
+ 4. **Delete `.hbs` originals**
444
+
445
+ 5. **Auto-generate domain commands**
446
+ - Render `_domain.md.hbs` template for each domain
447
+ - Result: `.claude/commands/{domain_id}.md` (e.g., ads.md, marketing.md)
448
+ - Delete `_domain.md.hbs` original
449
+
450
+ ### Hydration Verification
451
+
452
+ ```
453
+ 🎩 Oscar: Hydration is complete.
454
+
455
+ [Integration Registry]
456
+ • Active providers: {active list}
457
+ • Capabilities: {capability list}
458
+
459
+ [Transformed files]
460
+ • agents/orchestrator.md ✅
461
+ • agents/strategist.md ✅
462
+ • agents/planner.md ✅
463
+ • agents/validator.md ✅
464
+ • agents/analyst.md ✅
465
+ • agents/researcher.md ✅
466
+ • agents/developer.md ✅
467
+ • agents/qa.md ✅
468
+ • WORKFLOW.md ✅
469
+ • CLAUDE.md ✅
470
+ • commands/analytics.md ✅
471
+ • commands/daily.md ✅
472
+
473
+ [Generated domain commands]
474
+ • commands/{each domain id}.md
475
+
476
+ [Remaining .hbs files]
477
+ None ✅
478
+ ```
479
+
480
+ ### How to Add a New Provider
481
+
482
+ 1. Drop `integrations/providers/{new_provider}.yaml` file
483
+ 2. Add configuration at `operations.integrations.{id}` in `project.yaml`
484
+ 3. Re-run `/start` → Setup Wizard automatically reflects it in hydration
485
+
486
+ > **Important**: No modification of agent .hbs files needed! Just add the Provider YAML.
487
+
488
+ ---
489
+
490
+ ## Phase 5: spec-site Initialization (NEW)
491
+
492
+ ```
493
+ 🎩 Oscar: Initializing spec-site.
494
+ ```
495
+
496
+ ### Initialization Steps
497
+
498
+ 1. **Set index.html title**
499
+ ```html
500
+ <title>{project.name} Spec</title>
501
+ ```
502
+
503
+ 2. **Create first sprint folder**
504
+ ```
505
+ .context/sprints/s1/
506
+ └── context.md (empty template)
507
+ ```
508
+
509
+ 3. **Deployment setup (optional)**
510
+ ```
511
+ 🎩 Oscar: Where would you like to deploy spec-site?
512
+
513
+ □ Vercel — Auto-deploy with GitHub integration
514
+ □ AWS Amplify — AWS-based deployment
515
+ â–¡ Later
516
+ ```
517
+
518
+ 4. **Reflect spec_site info in `project.yaml`**
519
+ ```yaml
520
+ spec_site:
521
+ title: "{project.name} Spec"
522
+ deploy_url: "" # Set after deployment
523
+ ```
524
+
525
+ ---
526
+
527
+ ## Phase 6: Domain Structure Creation (NEW)
528
+
529
+ Executed when domains are defined in Phase 2.
530
+
531
+ ```
532
+ 🎩 Oscar: Creating domain folders.
533
+ ```
534
+
535
+ ### Creation Procedure
536
+
537
+ For each domain:
538
+
539
+ 1. **Create domain folder**
540
+ ```
541
+ .context/domains/{domain_id}/
542
+ └── index.md (basic structure)
543
+ ```
544
+
545
+ 2. **Initialize domain index file**
546
+ ```markdown
547
+ # {domain_name} Domain
548
+
549
+ ## Overview
550
+ {domain description - collected during Setup interview}
551
+
552
+ ## Key Context
553
+ - (to be added as work progresses)
554
+
555
+ ## Related Files
556
+ - `global/product/{domain_id}.md` — Product analysis
557
+ ```
558
+
559
+ 3. **Create additional default folders**
560
+ ```
561
+ .context/global/product/ (empty — filled during analysis)
562
+ .context/global/database/ (empty — filled when needed)
563
+ .context/global/tracking/ (empty — when event definitions are made)
564
+ .context/metrics/ (empty)
565
+ .context/daily/ (empty)
566
+ .context/sessions/
567
+ ├── index.yaml (empty session index)
568
+ ├── active/ (empty)
569
+ └── archive/ (empty)
570
+ ```
571
+
572
+ ---
573
+
574
+ ## Setup Complete
575
+
576
+ ```
577
+ 🎩 Oscar: {name}, Oscar system setup is complete!
578
+
579
+ ## Created Files
580
+ - .context/user-context.yaml (gitignore)
581
+ - .context/project.yaml
582
+ - .context/.secrets.yaml (gitignore) - optional
583
+ - CLAUDE.md (hydration complete)
584
+ - 10 agents (hydration complete)
585
+ - WORKFLOW.md (hydration complete)
586
+
587
+ ## Project Summary
588
+ {summary of project.yaml key content}
589
+
590
+ ## Integration Status
591
+ {list of enabled integrations}
592
+
593
+ ## Domains
594
+ {list of created domains}
595
+
596
+ ───────────────────────────────────────
597
+ What would you like to start working on?
598
+ ```
599
+
600
+ ---
601
+
602
+ ## Brownfield vs Greenfield Comparison
603
+
604
+ | Item | Brownfield | Greenfield |
605
+ |------|------------|------------|
606
+ | Phase 0 | Code scan | Skip |
607
+ | Phase 0.5 | Analysis results confirmation | None |
608
+ | Phase 1 | Same (User interview) | Same |
609
+ | Phase 2 | Supplementary questions only (10-15 min) | Full interview (15-20 min) |
610
+ | Phase 3 | Same (Integration setup) | Same |
611
+ | Phase 4 | Same (Hydration) | Same |
612
+ | Phase 5 | Same (spec-site) | Same |
613
+ | Phase 6 | Same (Domain structure) | Same |
614
+ | **Total Time** | **20-25 min** | **25-30 min** |
615
+
616
+ ---
617
+
618
+ ## Setup Re-initialization for Project Expansion
619
+
620
+ When adding a new product line or independent service, you can re-initialize Setup with a separate Oscar context.
621
+
622
+ ### Files to Re-initialize
623
+
624
+ ```bash
625
+ # Delete when initializing context for a new product
626
+ rm .context/project.yaml # Project config (newly created during Setup)
627
+ rm -f .context/user-context.yaml # User config (newly created during Setup)
628
+ rm -f .context/.secrets.yaml # Sensitive info (newly created during Setup)
629
+
630
+ # Clean existing data (when needed)
631
+ rm -rf .context/sprints/ # Sprint data
632
+ rm -rf .context/domains/ # Domain data
633
+ rm -rf .context/sessions/ # Session records
634
+ rm -rf .context/metrics/ # Metrics data
635
+ rm -rf .context/global/ # Strategy/product documents
636
+ ```
637
+
638
+ ### Retained Files (Oscar Core)
639
+
640
+ | File/Folder | Description |
641
+ |-------------|-------------|
642
+ | `oscar/` | Oscar workflows |
643
+ | `agents/` | Agent personas (re-hydratable if .hbs files exist) |
644
+ | `templates/` | Document templates |
645
+ | `WORKFLOW.md` | Workflow guide |
646
+ | `.claude/commands/` | Slash commands |
647
+ | `CLAUDE.md` | Oscar system description |
648
+
649
+ ### After Re-initialization
650
+
651
+ ```bash
652
+ # When /start is run and project.yaml doesn't exist, Setup Wizard auto-starts
653
+ /start
654
+ ```
655
+
656
+ ---
657
+
658
+ ## Related Files
659
+
660
+ - `/start` command: `.claude/commands/start.md`
661
+ - user-context structure: `.context/user-context.yaml`
662
+ - project structure: `.context/project.yaml.example`
663
+ - Agent persona: `.context/agents/strategist.md` (Simon)