odd-studio 3.5.1 → 3.7.1
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/.claude-plugin/plugin.json +5 -1
- package/README.md +28 -1
- package/bin/commands/status.js +8 -0
- package/bin/commands/upgrade.js +10 -0
- package/bin/odd-studio.js +1 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/codex-plugin/hooks.json +16 -0
- package/hooks/odd-studio.sh +143 -2
- package/package.json +1 -1
- package/plugins/plugin-gates.js +34 -3
- package/plugins/plugin-quality-checks.js +20 -0
- package/scripts/command-definitions.js +5 -0
- package/scripts/scaffold-project.js +3 -2
- package/scripts/setup-hooks.js +6 -0
- package/scripts/state-schema.js +48 -0
- package/skill/SKILL.md +95 -11
- package/skill/docs/build/build-protocol.md +34 -0
- package/skill/docs/build/code-excellence.md +37 -1
- package/skill/docs/build/debug-protocol.md +141 -0
- package/skill/docs/chapters/chapter-10.md +4 -4
- package/skill/docs/planning/build-planner.md +32 -9
- package/skill/odd-debug/SKILL.md +166 -0
- package/templates/.odd/state.json +11 -1
- package/templates/AGENTS.md +16 -1
- package/templates/CLAUDE.md +27 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "odd-debug"
|
|
3
|
+
version: "2.0.0"
|
|
4
|
+
description: "ODD Studio debug command. Activates a lightweight debug session (no full swarm init required), selects the correct debug strategy, and routes back to verification instead of drifting outside the ODD flow."
|
|
5
|
+
metadata:
|
|
6
|
+
priority: 9
|
|
7
|
+
pathPatterns:
|
|
8
|
+
- '.odd/state.json'
|
|
9
|
+
- 'docs/plan.md'
|
|
10
|
+
- 'docs/outcomes/**'
|
|
11
|
+
- 'docs/session-brief*.md'
|
|
12
|
+
promptSignals:
|
|
13
|
+
phrases:
|
|
14
|
+
- "odd debug"
|
|
15
|
+
- "start odd debug"
|
|
16
|
+
- "continue odd debug"
|
|
17
|
+
- "resume odd debug"
|
|
18
|
+
- "debug this in odd"
|
|
19
|
+
allOf:
|
|
20
|
+
- [odd, debug]
|
|
21
|
+
anyOf:
|
|
22
|
+
- "debug"
|
|
23
|
+
- "fix"
|
|
24
|
+
- "broken"
|
|
25
|
+
- "verification failed"
|
|
26
|
+
- "regression"
|
|
27
|
+
noneOf: []
|
|
28
|
+
minScore: 5
|
|
29
|
+
retrieval:
|
|
30
|
+
aliases:
|
|
31
|
+
- odd debug
|
|
32
|
+
- debug with odd
|
|
33
|
+
intents:
|
|
34
|
+
- start odd debug
|
|
35
|
+
- continue odd debug
|
|
36
|
+
entities:
|
|
37
|
+
- debug strategy
|
|
38
|
+
- failing outcome
|
|
39
|
+
- verification failure
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
# /odd-debug
|
|
43
|
+
|
|
44
|
+
You are executing the ODD Studio `*debug` command.
|
|
45
|
+
|
|
46
|
+
## What this command does
|
|
47
|
+
|
|
48
|
+
`*debug` activates a lightweight build session optimised for debugging, hotfixes, and security remediation work. It bypasses the full 9-step swarm init that `*build` requires — there is no agent dispatch, no task creation, no swarm spawn. The orchestrator writes code directly.
|
|
49
|
+
|
|
50
|
+
This is not a shortcut around ODD. The brief-gate, verify-gate, commit-gate, and outcome verification protocol are all still enforced. What is relaxed is the agent-token requirement in `swarm-write` — the requirement that forces every source write through a background Task agent. That requirement exists to enable parallel multi-agent outcome builds. For a single targeted fix it is pure ceremony.
|
|
51
|
+
|
|
52
|
+
**When to use `*debug` instead of `*build`:**
|
|
53
|
+
- Fixing a failing test suite
|
|
54
|
+
- Applying a security patch
|
|
55
|
+
- Investigating and resolving a verification failure
|
|
56
|
+
- Any single-file or few-file change that does not require parallel agent execution
|
|
57
|
+
|
|
58
|
+
**When to use `*build` instead:**
|
|
59
|
+
- Building a new outcome from scratch
|
|
60
|
+
- Work that benefits from parallel backend + UI + QA agents
|
|
61
|
+
- Phase transitions
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Session Activation
|
|
66
|
+
|
|
67
|
+
Execute these steps before any investigation or fix work. Do them in order.
|
|
68
|
+
|
|
69
|
+
### Step 1 — State check
|
|
70
|
+
|
|
71
|
+
Read `.odd/state.json`. Confirm:
|
|
72
|
+
- `currentPhase` is `"build"` — if not, explain that `*debug` requires an active build phase
|
|
73
|
+
- `planApproved` is `true` — if not, route to `*plan`
|
|
74
|
+
|
|
75
|
+
If either check fails, stop here and explain what is needed.
|
|
76
|
+
|
|
77
|
+
### Step 2 — Activate the debug session marker
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
touch .odd/.odd-flow-swarm-active
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This creates or refreshes the 24-hour build session marker. The `swarm-write` gate will now allow direct orchestrator writes (because `debugSession: true` bypasses Gate 2).
|
|
84
|
+
|
|
85
|
+
### Step 3 — Set debug session state
|
|
86
|
+
|
|
87
|
+
Update `.odd/state.json`:
|
|
88
|
+
- `debugSession: true`
|
|
89
|
+
- `buildMode: "debug"`
|
|
90
|
+
- `verificationConfirmed: false`
|
|
91
|
+
- `debugStartedAt: <current ISO timestamp>`
|
|
92
|
+
- `debugSummary: <one-sentence description of the issue — or "unknown" if not yet classified>`
|
|
93
|
+
|
|
94
|
+
### Step 4 — Store state to odd-flow
|
|
95
|
+
|
|
96
|
+
Call `mcp__odd-flow__memory_store`:
|
|
97
|
+
- Key: `odd-project-state`
|
|
98
|
+
- Namespace: `odd-project`
|
|
99
|
+
- Value: full contents of `.odd/state.json`
|
|
100
|
+
- upsert: true
|
|
101
|
+
|
|
102
|
+
This single store call satisfies the `commit-gate` requirement (via `store-validate` hook) for subsequent commits in this session.
|
|
103
|
+
|
|
104
|
+
### Step 5 — Confirm to user
|
|
105
|
+
|
|
106
|
+
Display:
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
Debug session active.
|
|
111
|
+
|
|
112
|
+
Source writes are unlocked. No agent dispatch required.
|
|
113
|
+
Brief gate, verify gate, and commit gate remain enforced.
|
|
114
|
+
|
|
115
|
+
State stored to odd-flow. Ready to investigate.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
Then proceed immediately to Strategy Selection below.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Strategy Selection
|
|
124
|
+
|
|
125
|
+
Read `.odd/state.json` to identify the active outcome and the latest failure. If the failure was described in the user's message, use that. If not yet clear, ask for a one-sentence description.
|
|
126
|
+
|
|
127
|
+
Choose exactly one debug strategy before inspecting code. State the chosen strategy and the reason.
|
|
128
|
+
|
|
129
|
+
- Choose `ui-behaviour` when the problem is visible in the interface and you do not yet have evidence of a backend or data fault
|
|
130
|
+
- Choose `full-stack` when the failure crosses a user action, server boundary, and persisted state
|
|
131
|
+
- Choose `auth-security` when access, identity, trust, or validation boundaries might be wrong
|
|
132
|
+
- Choose `integration-contract` when one part of the system expects data or sequencing another part does not produce
|
|
133
|
+
- Choose `background-process` when the failure depends on async handoff, jobs, retries, or event delivery
|
|
134
|
+
- Choose `performance-state` when the issue depends on timing, staleness, cache invalidation, or repeated actions
|
|
135
|
+
|
|
136
|
+
If more than one strategy seems plausible, do not fix anything yet. Gather one more piece of evidence, then choose the narrowest strategy that still explains the failure.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Fix Protocol
|
|
141
|
+
|
|
142
|
+
After choosing the strategy, load `docs/build/debug-protocol.md` for the detailed investigation procedure for that strategy.
|
|
143
|
+
|
|
144
|
+
When the fix is complete:
|
|
145
|
+
|
|
146
|
+
1. Run the relevant automated checks (tests, lint)
|
|
147
|
+
2. Update `.odd/state.json`:
|
|
148
|
+
- `debugSession: false`
|
|
149
|
+
- `buildMode: "verify"`
|
|
150
|
+
- `debugStrategy: <chosen strategy>`
|
|
151
|
+
- `debugTarget: <affected file or surface>`
|
|
152
|
+
- `debugSummary: <resolved — one sentence>`
|
|
153
|
+
3. Call `mcp__odd-flow__memory_store` with key `odd-project-state` to store final state
|
|
154
|
+
4. Return to the verification walkthrough from step one
|
|
155
|
+
|
|
156
|
+
Setting `debugSession: false` re-enables Gate 2 for subsequent work, returning to full swarm protocol.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Non-negotiable rules
|
|
161
|
+
|
|
162
|
+
- Never mark an outcome verified during a debug session
|
|
163
|
+
- Never change multiple layers at once before reproducing the fault
|
|
164
|
+
- Never skip the reproduction step
|
|
165
|
+
- Never broaden the strategy after starting unless new evidence proves the original classification wrong
|
|
166
|
+
- Always clear `debugSession: false` when the fix is complete
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.1.0",
|
|
3
3
|
"projectName": "{{PROJECT_NAME}}",
|
|
4
4
|
"initialisedAt": null,
|
|
5
5
|
"lastSaved": null,
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"planApproved": false,
|
|
15
15
|
"techStackDecided": false,
|
|
16
16
|
"designApproachDecided": false,
|
|
17
|
+
"architectureDocGenerated": false,
|
|
17
18
|
"servicesConfigured": false,
|
|
18
19
|
"sessionBriefExported": false,
|
|
19
20
|
"sessionBriefCount": 0,
|
|
@@ -22,5 +23,14 @@
|
|
|
22
23
|
"swarmActive": false,
|
|
23
24
|
"buildPhase": null,
|
|
24
25
|
"currentBuildPhase": null,
|
|
26
|
+
"buildMode": "idle",
|
|
27
|
+
"debugStrategy": null,
|
|
28
|
+
"debugTarget": null,
|
|
29
|
+
"debugSummary": null,
|
|
30
|
+
"debugStartedAt": null,
|
|
31
|
+
"checkpointStatus": "unknown",
|
|
32
|
+
"lastCheckpointAt": null,
|
|
33
|
+
"checkpointFindings": 0,
|
|
34
|
+
"securityBaselineVersion": "2026-04-12",
|
|
25
35
|
"notes": ""
|
|
26
36
|
}
|
package/templates/AGENTS.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
This project uses ODD Studio for planning and building. To activate the ODD coach:
|
|
7
7
|
|
|
8
8
|
**In Codex:** Type `use ODD`, `start ODD`, or `begin ODD` to start.
|
|
9
|
-
Use `ODD status` to check the current state before resuming,
|
|
9
|
+
Use `ODD status` to check the current state before resuming, `ODD build` to continue the build flow, or `ODD debug` to investigate a failing outcome without leaving ODD.
|
|
10
10
|
|
|
11
11
|
**In OpenCode:** Type `/odd` to start.
|
|
12
12
|
|
|
@@ -124,6 +124,21 @@ export function canAccess(user: User): boolean {
|
|
|
124
124
|
### Security Baseline
|
|
125
125
|
- No hardcoded secrets, API keys, or credentials — use environment variables
|
|
126
126
|
- Validate user input at system boundaries
|
|
127
|
+
- Authenticate and authorise every protected route, action, webhook, and admin surface
|
|
128
|
+
- Verify webhooks, uploads, and third-party callbacks before trusting payloads
|
|
129
|
+
- Use secure session defaults — no localStorage auth/session tokens, no JWT-by-default shortcuts
|
|
130
|
+
- Rate-limit auth, admin, upload, payment, and public write surfaces
|
|
131
|
+
- Record audit trails for admin and security-sensitive actions
|
|
132
|
+
- Never disable TLS, CSRF, origin, or certificate verification in production code
|
|
133
|
+
- Treat any security scan finding as release-blocking until fixed
|
|
134
|
+
|
|
135
|
+
## Debugging Inside ODD
|
|
136
|
+
- Use `ODD debug` or `*debug` when verification fails or a build breaks
|
|
137
|
+
- Debugging stays inside the current outcome — it is not a free-form detour
|
|
138
|
+
- Choose an explicit debug strategy before touching code: `ui-behaviour`, `full-stack`, `auth-security`, `integration-contract`, `background-process`, or `performance-state`
|
|
139
|
+
- Reproduce first, identify the failing boundary second, fix third
|
|
140
|
+
- Never apply a “quick fix” without naming the failing boundary
|
|
141
|
+
- After a fix, return to the verification walkthrough from step one
|
|
127
142
|
|
|
128
143
|
## UI Standards (Every UI Outcome)
|
|
129
144
|
- Use shadcn/ui components as the default component library
|
package/templates/CLAUDE.md
CHANGED
|
@@ -24,6 +24,8 @@ Before starting any build session, read:
|
|
|
24
24
|
### Build Sequence
|
|
25
25
|
- NEVER build an outcome whose dependencies are not yet verified
|
|
26
26
|
- ALWAYS build shared infrastructure before individual outcomes
|
|
27
|
+
- ALWAYS run `npm test` after building and before verification — failing tests block verification
|
|
28
|
+
- ALWAYS write tests for pure-logic modules (business rules, calculations, parsing, safety-critical logic)
|
|
27
29
|
- ALWAYS run the full verification walkthrough before marking an outcome complete
|
|
28
30
|
- ALWAYS commit after each verified outcome with message: "Outcome [N] [name] — verified"
|
|
29
31
|
|
|
@@ -110,6 +112,21 @@ export function canAccess(user: User): boolean {
|
|
|
110
112
|
### Security Baseline
|
|
111
113
|
- No hardcoded secrets, API keys, or credentials — use environment variables
|
|
112
114
|
- Validate user input at system boundaries
|
|
115
|
+
- Authenticate and authorise every protected route, action, webhook, and admin surface
|
|
116
|
+
- Verify webhooks, uploads, and third-party callbacks before trusting payloads
|
|
117
|
+
- Use secure session defaults — no localStorage auth/session tokens, no JWT-by-default shortcuts
|
|
118
|
+
- Rate-limit auth, admin, upload, payment, and public write surfaces
|
|
119
|
+
- Record audit trails for admin and security-sensitive actions
|
|
120
|
+
- Never disable TLS, CSRF, origin, or certificate verification in production code
|
|
121
|
+
- Treat any security scan finding as release-blocking until fixed
|
|
122
|
+
|
|
123
|
+
## Debugging Inside ODD
|
|
124
|
+
- Use `*debug` when verification fails or a build breaks
|
|
125
|
+
- Debugging stays inside the current outcome — it is not a free-form detour
|
|
126
|
+
- Choose an explicit debug strategy before touching code: `ui-behaviour`, `full-stack`, `auth-security`, `integration-contract`, `background-process`, or `performance-state`
|
|
127
|
+
- Reproduce first, identify the failing boundary second, fix third
|
|
128
|
+
- Never apply a “quick fix” without naming the failing boundary
|
|
129
|
+
- After a fix, return to the verification walkthrough from step one
|
|
113
130
|
|
|
114
131
|
## UI Standards (Every UI Outcome)
|
|
115
132
|
- Use shadcn/ui components as the default component library
|
|
@@ -127,9 +144,19 @@ _Until then, the ODD defaults apply:_
|
|
|
127
144
|
- Styling: Tailwind CSS v4 + shadcn/ui
|
|
128
145
|
- Database: PostgreSQL via Drizzle ORM
|
|
129
146
|
- Auth: NextAuth.js
|
|
147
|
+
- Testing: Vitest (default — chosen during Step 9)
|
|
130
148
|
- Email: Resend
|
|
131
149
|
- Deployment: Vercel
|
|
132
150
|
|
|
151
|
+
## Build & Test
|
|
152
|
+
```bash
|
|
153
|
+
npm run dev # Development server
|
|
154
|
+
npm run build # Production build
|
|
155
|
+
npm test # Run test suite (must pass before verification)
|
|
156
|
+
npm run test:watch # Watch mode during development
|
|
157
|
+
npm run lint # Lint
|
|
158
|
+
```
|
|
159
|
+
|
|
133
160
|
## Design Approach (see docs/ui/design-system.md for full detail)
|
|
134
161
|
_This section is populated by Rachel during Step 9b of the planning phase._
|
|
135
162
|
|