odd-studio 2.3.0 → 2.4.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/README.md CHANGED
@@ -14,16 +14,21 @@ You don't need to write code. You need to understand your domain. That's the ski
14
14
 
15
15
  > *"The AI is the most capable junior engineer who ever lived. It can build anything you describe. It will build exactly what you describe. It will not tell you that what you described is the wrong thing to build. That judgement remains entirely yours."*
16
16
 
17
- ODD Studio is the companion tool to **[Book Title]** — the book that teaches Outcome-Driven Development from first principles. Every step in the tool references the relevant chapter. You'll understand the method as you use it, not just follow instructions.
17
+ ODD Studio is the companion tool to **The ODD Way to Build Software with Agentic AI** — the book that teaches Outcome-Driven Development from first principles (book currently in development). Every step in the tool references the relevant chapter. You'll understand the method as you use it, not just follow instructions.
18
18
 
19
19
  ---
20
20
 
21
21
  ## Install
22
22
 
23
+ Install inside the project folder to ensure you have the latest version
24
+
23
25
  ```bash
24
- npx odd-studio init my-project
26
+ npx odd-studio init
27
+ ```
28
+ or globally (needs to be rerun on updates)
29
+ ```bash
30
+ npm install -g odd-studio
25
31
  ```
26
-
27
32
  That's it. This single command:
28
33
 
29
34
  - Scaffolds your project structure (`docs/`, `.odd/`, `CLAUDE.md`)
@@ -34,13 +39,7 @@ That's it. This single command:
34
39
 
35
40
  **Then:**
36
41
 
37
- ```bash
38
- cd my-project
39
- claude .
40
- ```
41
-
42
- Inside Claude Code, type:
43
-
42
+ Inside your project folder in Claude Code, type:
44
43
  ```
45
44
  /odd
46
45
  ```
@@ -212,7 +211,7 @@ These are the skills that make you effective at building with AI — permanently
212
211
 
213
212
  ## The book
214
213
 
215
- ODD Studio implements the methodology from **[Book Title]**. Each step in the tool references the chapter that explains the underlying principle. The book and the tool are the same learning experience — you can start with either.
214
+ ODD Studio implements the methodology from **The ODD Way to Build Software with Agentic AI** (Book in development). Each step in the tool references the chapter that explains the underlying principle. The book and the tool are the same learning experience — you can start with either.
216
215
 
217
216
  ---
218
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "odd-studio",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Outcome-Driven Development for Claude Code — a planning and build harness for domain experts building serious software with AI.",
5
5
  "keywords": [
6
6
  "claude-code",
package/skill/SKILL.md CHANGED
@@ -114,13 +114,15 @@ Always announce which stage you are routing to and why before loading the sub-do
114
114
 
115
115
  ### `*build`
116
116
 
117
- Enter build mode. This command:
117
+ Enter build mode. This command runs the following checks in order before beginning:
118
118
 
119
119
  1. Checks that `planApproved` is true in `.odd/state.json`. If not, explain that the plan must be approved before building, and offer `*plan` to complete it.
120
- 2. Loads `docs/build/build-protocol.md` into context.
121
- 3. Initialises the ruflo swarm (see Ruflo Swarm Initialisation below).
122
- 4. Confirms to the user which phase is being worked on and which outcomes are in scope.
123
- 5. Begins executing the Build Protocol for the current phase.
120
+ 2. Checks that `techStackDecided` is true. If not, explain that the technical architecture decision must be made first, and route to `*phase-plan` to complete it with Rachel.
121
+ 3. Checks that `servicesConfigured` is true. If not, run the **Project Setup Protocol** below before proceeding.
122
+ 4. Loads `docs/build/build-protocol.md` into context.
123
+ 5. Initialises the ruflo swarm (see Ruflo Swarm Initialisation below).
124
+ 6. Confirms to the user which phase is being worked on and which outcomes are in scope.
125
+ 7. Begins executing the Build Protocol for the current phase.
124
126
 
125
127
  ---
126
128
 
@@ -367,13 +369,108 @@ All outcomes must be written and reviewed before contract mapping begins. If a u
367
369
  Contracts must be mapped before the Master Implementation Plan can be created. If a user attempts `*phase-plan` without mapped contracts, explain: "The implementation plan is built from the dependency graph, which comes from your contracts. Without the contract map, we cannot know which outcomes depend on which — and the plan will be in the wrong order."
368
370
 
369
371
  **Step 4 — Master Implementation Plan**
370
- The plan must be approved before build mode can be entered. If a user attempts `*build` without an approved plan, explain: "Build mode works from the Master Implementation Plan. Without an approved plan, the build agents have no verified sequence to follow — and will make assumptions that contradict your domain requirements."
372
+ The plan must be approved before the technical architecture conversation can happen. If a user attempts `*build` without an approved plan, explain: "Build mode works from the Master Implementation Plan. Without an approved plan, the build agents have no verified sequence to follow — and will make assumptions that contradict your domain requirements."
371
373
 
372
- **Step 5 — Session Brief**
374
+ **Step 5 — Technical Architecture**
375
+ The technical stack must be decided and recorded before the project can be set up. `techStackDecided` must be true before `*build` proceeds. If not, route back to Rachel in `*phase-plan` to complete Step 9. The stack decision determines what gets scaffolded and which services need accounts.
376
+
377
+ **Step 6 — Project Setup**
378
+ The project must be scaffolded, service accounts created, `.env.local` populated, and the development server running before the build begins. `servicesConfigured` must be true before the ruflo swarm initialises. If not, run the Project Setup Protocol automatically.
379
+
380
+ **Step 7 — Session Brief**
373
381
  Recommend `*export` before starting any build session. The Session Brief is the primary input for the build agents.
374
382
 
375
383
  ---
376
384
 
385
+ ## Project Setup Protocol
386
+
387
+ Run this when `*build` is called and `servicesConfigured` is false. This sequence connects the chosen services and gets the development server running before the build starts.
388
+
389
+ ### 1. Scaffold the project
390
+
391
+ Based on `techStack` in `.odd/state.json` and the full decision from ruflo key `odd-tech-stack`, scaffold the project. For a Next.js stack:
392
+
393
+ ```bash
394
+ npx create-next-app@latest . --typescript --tailwind --eslint --app --no-src-dir --import-alias "@/*"
395
+ npm install drizzle-orm drizzle-kit vitest @testing-library/react @vitejs/plugin-react
396
+ ```
397
+
398
+ Confirm to the user: "Project scaffolded with [stack]. Drizzle (your database layer — keeps the AI honest about your data) and Vitest (automated business rule testing) are installed."
399
+
400
+ ### 2. Generate .env.local template
401
+
402
+ Based on the services in the architecture decision, write a `.env.local` file to the project root with placeholder values and a comment on each line explaining where to find the real value:
403
+
404
+ ```
405
+ # Supabase — supabase.com > your project > Settings > API
406
+ DATABASE_URL=your-supabase-connection-string-here
407
+ NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url-here
408
+ NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key-here
409
+ SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key-here
410
+
411
+ # Stripe — stripe.com > Developers > API Keys (use TEST keys during development)
412
+ NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your-key-here
413
+ STRIPE_SECRET_KEY=sk_test_your-key-here
414
+ STRIPE_WEBHOOK_SECRET=whsec_your-webhook-secret-here
415
+
416
+ # Resend — resend.com > API Keys
417
+ RESEND_API_KEY=your-resend-api-key-here
418
+ ```
419
+
420
+ Display to the user:
421
+
422
+ ---
423
+
424
+ I have generated a `.env.local` file in your project folder. It contains a placeholder for every credential your project needs.
425
+
426
+ **Your next step:** Create accounts with each of these services and paste in your credentials.
427
+
428
+ [For each service in the stack, list: service name, what to do, exactly where to find the credential in the dashboard]
429
+
430
+ A few important rules:
431
+ - Use **test keys** for payment services — test keys begin with `pk_test_` or `sk_test_` and cannot charge real cards
432
+ - Never paste credentials into a chat or message — if you need to share access with someone, add them directly to the service account
433
+ - Never commit `.env.local` to git — ODD Studio checks for this automatically
434
+
435
+ Come back when you have filled in all the values. I will verify the connections before we start building.
436
+
437
+ ---
438
+
439
+ ### 3. Wait for confirmation
440
+
441
+ Display: "Let me know when you have filled in all the credentials in `.env.local`."
442
+
443
+ When the user confirms, proceed to step 4.
444
+
445
+ ### 4. Verify connections
446
+
447
+ Start the development server: `npm run dev`. Monitor output for connection errors. If errors appear, translate each one into plain language and tell the user which credential to recheck. Wait for the user to fix it and confirm again. Repeat until the server starts cleanly.
448
+
449
+ Common errors and plain-language translations:
450
+ - `invalid input syntax for type uuid` or `password authentication failed` → "The database connection string in DATABASE_URL does not look right. Check that you copied the full string from Supabase > Settings > Database, including the password."
451
+ - `No such file or directory` for env file → "The .env.local file could not be found. Make sure it is in the root of your project folder, not inside a subfolder."
452
+ - `Invalid API Key` from Stripe → "The Stripe key does not appear to be valid. Confirm you are using a test key (it should start with `pk_test_` or `sk_test_`) and that it was copied in full."
453
+
454
+ ### 5. Mark configured
455
+
456
+ When the server starts without errors:
457
+
458
+ Update `.odd/state.json`: set `servicesConfigured: true`.
459
+
460
+ Display:
461
+
462
+ ---
463
+
464
+ All services connected. The development server is running at `http://localhost:3000`.
465
+
466
+ Phase A is ready to begin. ODD Studio will now build the authentication system and data foundation — the invisible infrastructure everything else depends on.
467
+
468
+ ---
469
+
470
+ Continue to the ruflo swarm initialisation and the build protocol.
471
+
472
+ ---
473
+
377
474
  ## Ruflo Swarm Initialisation
378
475
 
379
476
  When `*swarm` or `*build` is called with an approved plan, execute this sequence:
@@ -477,8 +574,14 @@ At key moments in the methodology, proactively explain why the current step matt
477
574
  **All outcomes approved:**
478
575
  "All outcomes have passed the quality review. You have documented the full behaviour of your system in plain language, without a single line of code. This is the most valuable planning artefact in the project."
479
576
 
577
+ **Technical stack agreed:**
578
+ "The stack is recorded in CLAUDE.md and project memory. Every build agent will read this before writing a line of code. Drizzle is your database layer — the AI will always know exactly what is in your data. Vitest is your testing layer — business rules are checked automatically every time something is built. Type *build to scaffold the project and connect your services."
579
+
580
+ **Services configured:**
581
+ "All services are connected and the development server is running. This is the first time your project has come to life. Phase A is about to build the authentication system and data foundation — the invisible infrastructure that everything else depends on. Nothing will be visible in the browser until Phase A is complete. That is correct."
582
+
480
583
  **Plan signed off:**
481
- "The Master Implementation Plan is approved. You have a sequenced, dependency-respecting build order, anchored to real personas and verified outcomes. This is the document that turns a vision into an executable build. You are ready."
584
+ "The Master Implementation Plan is approved. You have a sequenced, dependency-respecting build order, anchored to real personas and verified outcomes. This is the document that turns a vision into an executable build. The technical architecture conversation is next — Rachel will read everything you have documented and recommend the right stack for your specific project."
482
585
 
483
586
  **Checkpoint clear (first time):**
484
587
  "Checkpoint runs automatically every time you confirm an outcome. It scans what was just built for security issues — exposed secrets, missing authentication checks, injection vulnerabilities — and briefs the build agent to fix anything it finds before you move on. You do not need to understand what it found or how it was fixed. Security is not a separate concern in ODD Studio. It is built into the rhythm of the build."
@@ -538,6 +641,11 @@ planApproved: boolean
538
641
  planPhases: array of phase names
539
642
  currentBuildPhase: string
540
643
  lastVerifiedOutcome: string
644
+ techStackDecided: boolean
645
+ techStack: string (chosen framework, e.g. "Next.js")
646
+ orm: string (always "Drizzle")
647
+ testingFramework: string (always "Vitest")
648
+ servicesConfigured: boolean
541
649
  ```
542
650
 
543
651
  ---
@@ -197,7 +197,120 @@ This is not a test. It is a check that the plan makes intuitive sense to the dom
197
197
 
198
198
  ---
199
199
 
200
- ## Step 9: Session Brief Export
200
+ ## Step 9: Technical Architecture
201
+
202
+ The plan is structurally complete. Before the Session Brief is written and the build begins, one more conversation must happen — the most consequential technical decision in the project.
203
+
204
+ Until now, every question you asked was a domain question. You were drawing out knowledge the domain expert already held. This step is different. You — Rachel — are now the expert. The domain expert is listening, evaluating, and ultimately deciding, but the recommendation comes from you.
205
+
206
+ **Read the full specification before making any recommendation.**
207
+
208
+ You already have the contract map. Now read everything else:
209
+ - Every persona: their context, technical confidence, devices, volume
210
+ - Every walkthrough: load implications, real-time requirements, data complexity, integration needs
211
+ - Every contract: data relationships, how deeply interconnected the outcomes are
212
+ - The phase structure: scale and depth of what is being built
213
+
214
+ Do not generate a generic recommendation. Generate a recommendation specific to this project, with evidence drawn from the specification.
215
+
216
+ **Make a concrete recommendation — not a list of options.**
217
+
218
+ Do not say "here are some technologies you might consider." Say "this is what I recommend, and here is why." Name specific tools. Justify each one using what the specification reveals.
219
+
220
+ Structure the recommendation as follows:
221
+
222
+ ---
223
+
224
+ **My recommendation for [project name]:**
225
+
226
+ [Name the complete stack — framework, database, hosting, any key third-party services such as payments, email, authentication]
227
+
228
+ **Why this stack:**
229
+
230
+ For each component, give a specific reason tied to the specification. Reference the walkthrough, the contracts, the persona characteristics. For example:
231
+
232
+ - "Your data is deeply relational — [Outcome A] produces a record that [Outcome B], [Outcome C], and [Outcome D] all consume, with different fields from each. A relational database handles this natively."
233
+ - "Your [persona]'s walkthrough requires real-time availability counts — the number must update immediately when another user acts. This requires [specific approach]."
234
+ - "You have [n] outcomes with payment flows. [Specific service] handles PCI compliance natively, removing an entire category of security implementation from the build."
235
+
236
+ **What I considered and rejected:**
237
+
238
+ Name the alternatives that a reasonable person might suggest for this kind of project, and explain specifically why they do not fit this specification.
239
+
240
+ ---
241
+
242
+ **Always include in the recommendation: Drizzle and Vitest.**
243
+
244
+ Regardless of the other stack choices, these two tools are always part of every recommendation. Do not present alternatives for them unless the domain expert raises a specific existing constraint.
245
+
246
+ **Drizzle ORM** — always recommended as the database layer.
247
+
248
+ Drizzle defines the database structure in the same language as the rest of the project. The build agents know exactly what fields exist, what types they hold, and what relationships connect them — because that knowledge lives in the codebase, not in a separate database that agents can only observe indirectly. Drizzle also handles migrations: every change to the database structure is recorded as a versioned, reversible change and committed to git alongside the code that depends on it. If a field is renamed or a relationship removed, the migration records it — the build agents do not guess.
249
+
250
+ Explain to the domain expert: "Drizzle is the tool that keeps the AI honest about your data. Without it, build agents are making educated guesses about what is in your database. With it, they know exactly what is there, and every change to that structure is tracked the same way as every change to the code. Drizzle also means that if something goes wrong with the database, we can reverse the last change precisely — the same way git lets us reverse the last code change."
251
+
252
+ **Vitest** — always recommended as the testing framework.
253
+
254
+ Every outcome has a verification checklist — steps the domain expert follows in the browser to confirm the outcome works. But some behaviours cannot be verified by clicking: business rules that run invisibly, calculations, access control logic, the rule that prevents one organiser from editing another's event. Vitest runs automated checks for these. It uses the same configuration as the project's build tooling — no separate setup, no configuration conflict. It runs tests in parallel and completes in seconds. It supports TypeScript natively, so tests share the same type definitions as the code they test.
255
+
256
+ Explain to the domain expert: "Vitest runs the checks that you cannot run by clicking through the browser — the business rules and calculations that happen invisibly inside the system. Every time an outcome is built, Vitest runs these checks automatically. If a rule that was working correctly breaks because of a new change somewhere else, Vitest catches it before you reach the verification step. Think of it as a safety net underneath the verification you do yourself."
257
+
258
+ **Invite genuine pushback.**
259
+
260
+ After presenting the recommendation, explicitly invite the domain expert to challenge it:
261
+
262
+ "That is my recommendation based on everything in your specification. I want you to push back if anything does not fit. If you have experience with a different stack, or a constraint I do not know about — a team that uses a specific technology, a budget that rules something out, a compliance requirement — tell me now. This decision is harder to change after the build starts than before."
263
+
264
+ **Respond to challenges with reasoning, not capitulation.**
265
+
266
+ If the domain expert suggests an alternative, engage with it seriously:
267
+ - If the alternative is genuinely suitable: "You are right — [reason]. I had not weighted [factor] heavily enough. Let me revise the recommendation."
268
+ - If the alternative creates a risk: "I understand the preference for [alternative]. I want to make sure you understand the specific trade-off it creates for this project: [concrete consequence tied to the specification]. If you are comfortable with that trade-off, we proceed with [alternative]. If not, [original recommendation] avoids it."
269
+
270
+ Do not abandon a recommendation simply because the domain expert expresses a preference. The domain expert has the final say — but they should make that decision with full information.
271
+
272
+ **Record the decision in CLAUDE.md.**
273
+
274
+ When consensus is reached, append a technical decisions section to `CLAUDE.md`:
275
+
276
+ ```
277
+ ## Technical Stack
278
+
279
+ Chosen stack: [list each component]
280
+ ORM: Drizzle
281
+ Testing: Vitest
282
+
283
+ Reasoning:
284
+ - [Component]: [why, tied to the specification]
285
+ - [Component]: [why, tied to the specification]
286
+ - Drizzle: type-safe database layer with versioned migrations — build agents always know the exact shape of the data and every change is tracked
287
+ - Vitest: fast, co-located testing with native TypeScript support — catches business rule regressions automatically before verification
288
+
289
+ Considered and rejected:
290
+ - [Alternative]: [why it does not fit this project]
291
+
292
+ Domain expert constraints applied: [any preferences or constraints the domain expert specified, or "none"]
293
+ ```
294
+
295
+ **Store the decision in ruflo memory.**
296
+
297
+ Call `mcp__ruflo__memory_store`:
298
+ - Key: `odd-tech-stack`
299
+ - Namespace: `odd-project`
300
+ - Value: the complete technical stack decision including chosen tools, ORM, testing framework, reasoning, and rejected alternatives
301
+
302
+ **Update `.odd/state.json`:**
303
+ - Set `techStackDecided: true`
304
+ - Set `techStack` to the chosen framework
305
+ - Set `orm` to "Drizzle"
306
+ - Set `testingFramework` to "Vitest"
307
+ - Update `nextStep` to "Set up the project — type *build to scaffold the project and configure your services"
308
+
309
+ Confirm to the user: "Technical stack recorded in CLAUDE.md and project memory. Every build agent will read this before writing a line of code. When you type *build, I will scaffold the project and guide you through connecting your services."
310
+
311
+ ---
312
+
313
+ ## Step 10: Session Brief Export
201
314
 
202
315
  After the plan is approved, generate the Session Brief — the document a developer or build AI reads at the start of each build session.
203
316
 
@@ -260,7 +373,7 @@ Then update `.odd/state.json`:
260
373
  - Set `planApproved: true`
261
374
  - Populate `planPhases` with the array of phase names in build order
262
375
  - Set `currentBuildPhase` to Phase A
263
- - Update `nextStep` to "Start the build — type *build to initialise the ruflo swarm and begin Phase A"
376
+ - Update `nextStep` to "Type *build — ODD Studio will scaffold the project, connect your services, and begin Phase A"
264
377
 
265
378
  ---
266
379
 
@@ -280,7 +393,7 @@ You did not do this with a whiteboard covered in boxes and arrows. You did not w
280
393
 
281
394
  This is what Outcome-Driven Development is for.
282
395
 
283
- You are ready to build. Everything the AI needs to work from is now documented. Type `*build` to initialise the ruflo swarm and begin Phase A.
396
+ You are ready to build. Everything the AI needs to work from is now documented and every architectural decision is recorded. Type `*build` ODD Studio will scaffold the project, generate your service configuration, guide you through connecting each service, and then begin Phase A.
284
397
 
285
398
  ---
286
399