@plazmodium/odin 0.3.3-beta → 0.3.5-beta

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 (133) hide show
  1. package/README.md +25 -10
  2. package/builtin/ODIN.md +1067 -0
  3. package/builtin/agent-definitions/README.md +170 -0
  4. package/builtin/agent-definitions/_shared-context.md +377 -0
  5. package/builtin/agent-definitions/architect.md +627 -0
  6. package/builtin/agent-definitions/builder.md +713 -0
  7. package/builtin/agent-definitions/discovery.md +293 -0
  8. package/builtin/agent-definitions/documenter.md +238 -0
  9. package/builtin/agent-definitions/guardian.md +1049 -0
  10. package/builtin/agent-definitions/integrator.md +189 -0
  11. package/builtin/agent-definitions/planning.md +236 -0
  12. package/builtin/agent-definitions/product.md +405 -0
  13. package/builtin/agent-definitions/release.md +205 -0
  14. package/builtin/agent-definitions/reviewer.md +447 -0
  15. package/builtin/agent-definitions/watcher.md +402 -0
  16. package/builtin/skills/api/graphql/SKILL.md +548 -0
  17. package/builtin/skills/api/grpc/SKILL.md +554 -0
  18. package/builtin/skills/api/rest-api/SKILL.md +469 -0
  19. package/builtin/skills/api/trpc/SKILL.md +503 -0
  20. package/builtin/skills/architecture/clean-architecture/SKILL.md +141 -0
  21. package/builtin/skills/architecture/domain-driven-design/SKILL.md +129 -0
  22. package/builtin/skills/architecture/event-driven/SKILL.md +145 -0
  23. package/builtin/skills/architecture/microservices/SKILL.md +143 -0
  24. package/builtin/skills/architecture/tla-precheck/SKILL.md +171 -0
  25. package/builtin/skills/backend/golang-gin/SKILL.md +141 -0
  26. package/builtin/skills/backend/nodejs-express/SKILL.md +277 -0
  27. package/builtin/skills/backend/nodejs-fastify/SKILL.md +152 -0
  28. package/builtin/skills/backend/python-django/SKILL.md +128 -0
  29. package/builtin/skills/backend/python-fastapi/SKILL.md +140 -0
  30. package/builtin/skills/database/mongodb/SKILL.md +132 -0
  31. package/builtin/skills/database/postgresql/SKILL.md +120 -0
  32. package/builtin/skills/database/prisma-orm/SKILL.md +366 -0
  33. package/builtin/skills/database/redis/SKILL.md +140 -0
  34. package/builtin/skills/database/supabase/SKILL.md +416 -0
  35. package/builtin/skills/devops/aws/SKILL.md +382 -0
  36. package/builtin/skills/devops/docker/SKILL.md +359 -0
  37. package/builtin/skills/devops/github-actions/SKILL.md +435 -0
  38. package/builtin/skills/devops/kubernetes/SKILL.md +459 -0
  39. package/builtin/skills/devops/terraform/SKILL.md +453 -0
  40. package/builtin/skills/frontend/alpine-dev/SKILL.md +27 -0
  41. package/builtin/skills/frontend/angular-dev/SKILL.md +28 -0
  42. package/builtin/skills/frontend/astro-dev/SKILL.md +28 -0
  43. package/builtin/skills/frontend/htmx-dev/SKILL.md +28 -0
  44. package/builtin/skills/frontend/nextjs-dev/SKILL.md +470 -0
  45. package/builtin/skills/frontend/react-patterns/SKILL.md +166 -0
  46. package/builtin/skills/frontend/svelte-dev/SKILL.md +28 -0
  47. package/builtin/skills/frontend/tailwindcss/SKILL.md +131 -0
  48. package/builtin/skills/frontend/vuejs-dev/SKILL.md +28 -0
  49. package/builtin/skills/generic-dev/SKILL.md +307 -0
  50. package/builtin/skills/testing/cypress/SKILL.md +372 -0
  51. package/builtin/skills/testing/jest/SKILL.md +176 -0
  52. package/builtin/skills/testing/playwright/SKILL.md +341 -0
  53. package/builtin/skills/testing/unit-tests-eval-sdd/SKILL.md +73 -0
  54. package/builtin/skills/testing/unit-tests-sdd/SKILL.md +83 -0
  55. package/builtin/skills/testing/vitest/SKILL.md +249 -0
  56. package/dist/adapters/skills/filesystem.d.ts +1 -0
  57. package/dist/adapters/skills/filesystem.d.ts.map +1 -1
  58. package/dist/adapters/skills/filesystem.js +6 -18
  59. package/dist/adapters/skills/filesystem.js.map +1 -1
  60. package/dist/adapters/skills/types.d.ts +1 -0
  61. package/dist/adapters/skills/types.d.ts.map +1 -1
  62. package/dist/adapters/workflow-state/in-memory.d.ts +10 -2
  63. package/dist/adapters/workflow-state/in-memory.d.ts.map +1 -1
  64. package/dist/adapters/workflow-state/in-memory.js +98 -5
  65. package/dist/adapters/workflow-state/in-memory.js.map +1 -1
  66. package/dist/adapters/workflow-state/supabase.d.ts +8 -2
  67. package/dist/adapters/workflow-state/supabase.d.ts.map +1 -1
  68. package/dist/adapters/workflow-state/supabase.js +204 -0
  69. package/dist/adapters/workflow-state/supabase.js.map +1 -1
  70. package/dist/adapters/workflow-state/types.d.ts +15 -1
  71. package/dist/adapters/workflow-state/types.d.ts.map +1 -1
  72. package/dist/builtin-assets.d.ts +8 -0
  73. package/dist/builtin-assets.d.ts.map +1 -0
  74. package/dist/builtin-assets.js +90 -0
  75. package/dist/builtin-assets.js.map +1 -0
  76. package/dist/domain/skill-draft-validation.d.ts +18 -0
  77. package/dist/domain/skill-draft-validation.d.ts.map +1 -0
  78. package/dist/domain/skill-draft-validation.js +100 -0
  79. package/dist/domain/skill-draft-validation.js.map +1 -0
  80. package/dist/domain/skill-proposals.d.ts +11 -0
  81. package/dist/domain/skill-proposals.d.ts.map +1 -0
  82. package/dist/domain/skill-proposals.js +103 -0
  83. package/dist/domain/skill-proposals.js.map +1 -0
  84. package/dist/init.js +69 -11
  85. package/dist/init.js.map +1 -1
  86. package/dist/schemas.d.ts +39 -1
  87. package/dist/schemas.d.ts.map +1 -1
  88. package/dist/schemas.js +30 -1
  89. package/dist/schemas.js.map +1 -1
  90. package/dist/server.js +38 -2
  91. package/dist/server.js.map +1 -1
  92. package/dist/tools/apply-migrations.d.ts +10 -0
  93. package/dist/tools/apply-migrations.d.ts.map +1 -1
  94. package/dist/tools/apply-migrations.js +10 -26
  95. package/dist/tools/apply-migrations.js.map +1 -1
  96. package/dist/tools/capture-learning.d.ts.map +1 -1
  97. package/dist/tools/capture-learning.js +14 -1
  98. package/dist/tools/capture-learning.js.map +1 -1
  99. package/dist/tools/get-skill-proposal-queue.d.ts +5 -0
  100. package/dist/tools/get-skill-proposal-queue.d.ts.map +1 -0
  101. package/dist/tools/get-skill-proposal-queue.js +21 -0
  102. package/dist/tools/get-skill-proposal-queue.js.map +1 -0
  103. package/dist/tools/get-skill-proposals.d.ts +4 -0
  104. package/dist/tools/get-skill-proposals.d.ts.map +1 -0
  105. package/dist/tools/get-skill-proposals.js +11 -0
  106. package/dist/tools/get-skill-proposals.js.map +1 -0
  107. package/dist/tools/prepare-phase-context.d.ts.map +1 -1
  108. package/dist/tools/prepare-phase-context.js +5 -0
  109. package/dist/tools/prepare-phase-context.js.map +1 -1
  110. package/dist/tools/publish-skill-proposal.d.ts +5 -0
  111. package/dist/tools/publish-skill-proposal.d.ts.map +1 -0
  112. package/dist/tools/publish-skill-proposal.js +57 -0
  113. package/dist/tools/publish-skill-proposal.js.map +1 -0
  114. package/dist/tools/record-skill-proposal-decision.d.ts +4 -0
  115. package/dist/tools/record-skill-proposal-decision.d.ts.map +1 -0
  116. package/dist/tools/record-skill-proposal-decision.js +22 -0
  117. package/dist/tools/record-skill-proposal-decision.js.map +1 -0
  118. package/dist/tools/record-skill-proposal-draft.d.ts +5 -0
  119. package/dist/tools/record-skill-proposal-draft.d.ts.map +1 -0
  120. package/dist/tools/record-skill-proposal-draft.js +65 -0
  121. package/dist/tools/record-skill-proposal-draft.js.map +1 -0
  122. package/dist/tools/sync-skill-proposal-candidates.d.ts +5 -0
  123. package/dist/tools/sync-skill-proposal-candidates.d.ts.map +1 -0
  124. package/dist/tools/sync-skill-proposal-candidates.js +20 -0
  125. package/dist/tools/sync-skill-proposal-candidates.js.map +1 -0
  126. package/dist/types.d.ts +41 -0
  127. package/dist/types.d.ts.map +1 -1
  128. package/dist/types.js +2 -0
  129. package/dist/types.js.map +1 -1
  130. package/migrations/009_skill_proposal_candidates.sql +124 -0
  131. package/migrations/010_skill_proposals.sql +36 -0
  132. package/migrations/README.md +6 -0
  133. package/package.json +5 -3
@@ -0,0 +1,1067 @@
1
+ # ODIN.md
2
+
3
+ > **Odin** is a Specification-Driven Development (SDD) framework for AI-assisted development.
4
+ > It provides 11 specialized workflow/support agents, adaptive complexity levels, a learnings system with
5
+ > confidence scoring, EVALS for health monitoring, and Watcher verification for critical phases.
6
+
7
+ ---
8
+
9
+ ## For Users of Odin
10
+
11
+ > **⚠️ WARNING: Do not modify ODIN.md unless you are developing Odin itself.**
12
+ >
13
+ > This file describes how the Odin workflow works. Modifying it can break agent behavior,
14
+ > phase transitions, and quality gates. If you need to customize Odin, use the configuration
15
+ > options in your project setup instead.
16
+
17
+ ### Where Learnings Go
18
+
19
+ When using Odin in your project, learnings propagate to different targets:
20
+
21
+ | Learning Type | Target Location |
22
+ |---------------|-----------------|
23
+ | **Technology gotchas** (Next.js, Supabase, etc.) | `agents/skills/{category}/{skill}/SKILL.md` |
24
+ | **Project-specific patterns** | Your AI provider's file: `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, etc. |
25
+ | **Workflow improvements** | `agents/definitions/{agent}.md` (for Odin developers only) |
26
+
27
+ **Your AI provider's file** is where project-specific learnings accumulate:
28
+ - **OpenCode**: `AGENTS.md`
29
+ - **Claude Code**: `CLAUDE.md`
30
+ - **Cursor**: `.cursorrules` or `.cursor/rules`
31
+ - **Windsurf**: `.windsurfrules`
32
+ - **Other tools**: Check your tool's documentation for the custom instructions file
33
+
34
+ **ODIN.md is NOT a target for learnings.** It defines the framework mechanics and should remain stable.
35
+
36
+ ---
37
+
38
+ ## What is Odin?
39
+
40
+ ### The Problem
41
+
42
+ When developers use AI coding assistants without proper specifications:
43
+ - AI hallucinates business logic and data structures
44
+ - Code contradicts requirements within the same session
45
+ - Developers spend more time fixing AI mistakes than coding
46
+ - No single source of truth exists between spec and implementation
47
+
48
+ **Odin fixes that** by establishing clear phases, quality gates, and recovery mechanisms.
49
+
50
+ ### Core Philosophy
51
+
52
+ 1. **Spec-First, Always**: Implementation code is never written without an approved specification. The spec is the contract.
53
+
54
+ 2. **Context Pulling > Context Pushing**: The orchestrator session pulls what agents need (via MCP and other tools) instead of developers manually copy-pasting files, schemas, and tickets.
55
+
56
+ 3. **Adaptive Complexity**: Not every task needs a 10-page specification. Match the spec depth to the task complexity.
57
+
58
+ ### Key Innovations
59
+
60
+ - **Adaptive complexity** (L1/L2/L3) - specs scale to match task size
61
+ - **Learnings system** with confidence scoring and multi-target propagation
62
+ - **Development Evals** for pre/post-build behavior verification
63
+ - **EVALS** for health monitoring and performance diagnostics
64
+ - **11-phase workflow** with 11 specialized workflow/support agents
65
+ - **Watcher verification** - Policy Engine + LLM escalation for critical phases
66
+ - **Skills system** with 36+ domain-specific knowledge modules
67
+
68
+ ---
69
+
70
+ ## The 11-Phase Workflow
71
+
72
+ | Phase | Name | Agent | Watched? | Description |
73
+ |-------|------|-------|----------|-------------|
74
+ | 0 | Planning | Planner | No | Planning kickoff; L3 decomposes epics, L1/L2 can stay brief |
75
+ | 1 | Product | Product | No | PRD generation (complexity-gated) |
76
+ | 2 | Discovery | Discovery | No | Requirements gathering |
77
+ | 3 | Architect | Architect | No | Specification drafting |
78
+ | 4 | Guardian | Guardian | No | PRD + Spec review |
79
+ | 5 | Builder | Builder | **YES** | Implementation |
80
+ | 6 | Reviewer | Reviewer | No | SAST/security scan (Semgrep) |
81
+ | 7 | Integrator | Integrator | **YES** | Build verification |
82
+ | 8 | Documenter | Documenter | No | Documentation generation |
83
+ | 9 | Release | Release | **YES** | PR creation and archival |
84
+ | 10 | Complete | - | No | Feature done |
85
+
86
+ ```
87
+ All features: PLANNING -> PRODUCT -> DISCOVERY -> ARCHITECT -> GUARDIAN -> BUILDER -> REVIEWER -> INTEGRATOR -> DOCUMENTER -> RELEASE -> COMPLETE
88
+ ```
89
+
90
+ > **Note**: L1/L2 features still execute all phases — they're just brief.
91
+ > Complexity level affects **depth** within each phase, not which phases run.
92
+
93
+ > **Watched agents** (Builder, Integrator, Release) emit structured claims that are verified by the Policy Engine and optionally the LLM Watcher. See [Watcher Verification](#watcher-verification).
94
+
95
+ > **Detailed Documentation**: See `agents/definitions/` for phase prompts and [runtime/README.md](runtime/README.md) for runtime setup.
96
+
97
+ ### Orchestrator Loop
98
+
99
+ This is the canonical step-by-step workflow the orchestrator follows for every feature:
100
+
101
+ ```
102
+ 1. git checkout -b {initials}/feature/{ID} # Create branch FIRST
103
+ 2. odin.start_feature({ id, name, ... }) # Record in database
104
+ 3. For each phase 0→9:
105
+ a. odin.get_next_phase({ feature_id }) # Confirm next phase
106
+ b. odin.prepare_phase_context({ feature_id, phase, agent_name })
107
+ # Get agent bundle
108
+ c. Read agent definition from agents/definitions/ # Load mandatory checklist
109
+ d. Invoke agent (Task tool or inline) # Agent produces output
110
+ e. odin.record_phase_artifact({ ... }) # Persist artifacts
111
+ f. Phase-specific actions:
112
+ - Phase 3 (Architect): record eval_plan when required
113
+ - Phase 4 (Guardian): verify spec quality rubric scores 2/2
114
+ record eval_readiness via odin.record_quality_gate({ ... })
115
+ - Phase 5 (Builder): update task statuses after each task
116
+ - Phase 6 (Reviewer): odin.run_review_checks({ ... }), record eval_run when required
117
+ - Phase 7 (Integrator): resolve any partial eval_run with runtime evidence
118
+ - Phase 9 (Release): odin.verify_claims({ ... }), check coverage,
119
+ odin.archive_feature_release({ ... }),
120
+ gh pr create
121
+ g. odin.record_phase_result({ ..., outcome: "completed" })
122
+ # Advance to next phase
123
+ 4. STOP after PR creation — wait for human to merge
124
+ ```
125
+
126
+ > **Remember**: Only the main orchestrator session can call `odin.*` tools. Task-spawned sub-agents cannot access MCP — they produce output that the orchestrator persists.
127
+
128
+ ### Feature Is the Unit of Execution
129
+
130
+ Odin executes work at the **feature** level.
131
+
132
+ - One `odin.start_feature` call represents one coherent feature moving through the workflow
133
+ - One feature maps to one feature branch, one phase history, and one PR review boundary
134
+ - The `tasks` artifact tracks progress **within** a feature; it does not define independent concurrent sub-feature workflows
135
+ - Do NOT invent intra-feature swarms, isolated worktree coordination, or parallel Builder subflows unless the Odin runtime explicitly supports them
136
+ - If work should happen in parallel, split it into multiple independent features, each with its own branch and workflow record
137
+
138
+ **Implication for orchestrators and agents**:
139
+ - Use `odin.prepare_phase_context`, `odin.record_phase_artifact`, and `odin.record_phase_result` assuming a single feature-level source of truth
140
+ - Update task status serially through the orchestrator as progress tracking
141
+ - Keep human review at the PR boundary for the feature as a whole
142
+
143
+ In short: Odin orchestrates **features**, not concurrent sub-task swarms inside a feature.
144
+
145
+ ### Task Tracking Protocol
146
+
147
+ The Architect (Phase 3) records a task breakdown. The orchestrator updates task statuses during the Builder phase (Phase 5). This drives the dashboard's task progress display.
148
+
149
+ **Architect phase** — orchestrator records initial tasks:
150
+ ```
151
+ odin.record_phase_artifact({
152
+ feature_id: "FEAT-001",
153
+ phase: "3",
154
+ output_type: "tasks",
155
+ content: [
156
+ { id: "T1", title: "Create component", status: "pending" },
157
+ { id: "T2", title: "Add tests", status: "pending" }
158
+ ],
159
+ created_by: "architect-agent"
160
+ })
161
+ ```
162
+
163
+ **Builder phase** — orchestrator updates task statuses after each task completes:
164
+ ```
165
+ odin.record_phase_artifact({
166
+ feature_id: "FEAT-001",
167
+ phase: "3",
168
+ output_type: "tasks",
169
+ content: [
170
+ { id: "T1", title: "Create component", status: "completed" },
171
+ { id: "T2", title: "Add tests", status: "in_progress" }
172
+ ],
173
+ created_by: "builder-agent"
174
+ })
175
+ ```
176
+
177
+ > **Note**: Task artifacts always target **phase "3"** (where they were defined), even when updated during phase 5. This is an upsert — same feature/phase/output_type replaces the previous record.
178
+
179
+ **Rules**:
180
+ - Every task object MUST include `id`, `title`, and `status` fields
181
+ - Valid statuses: `pending`, `in_progress`, `completed` (also accepts `in-progress` and `done`)
182
+ - The orchestrator MUST call this after each task completion, not just at the end of the Builder phase
183
+ - If Builder completes and some tasks were never updated, Odin auto-completes the remaining task statuses as a safety net for dashboard correctness
184
+
185
+ ---
186
+
187
+ ## Development Evals
188
+
189
+ Development Evals are a workflow track for defining and verifying behavior before and after implementation. They are distinct from the post-hoc **EVALS** health system.
190
+
191
+ ### Core Objects
192
+
193
+ | Object | Owner | Purpose |
194
+ |--------|-------|---------|
195
+ | `eval_plan` | Architect | Pre-build definition of capability/regression coverage |
196
+ | `eval_readiness` | Guardian | Hard gate before Builder when development evals are required |
197
+ | `eval_run` | Reviewer (Integrator may append) | Post-build proof artifact summarizing eval execution |
198
+
199
+ ### Complexity Rules
200
+
201
+ - **L1 bug fix**: at least one reproducing regression case must exist before Builder completes
202
+ - **L1 net-new change**: at least one acceptance/capability case must exist before Builder completes
203
+ - **L2/L3**: `eval_plan` is required before Builder starts
204
+
205
+ ### Recording Convention
206
+
207
+ Architect records `eval_plan` with the dedicated helper:
208
+ ```ts
209
+ odin.record_eval_plan({
210
+ feature_id: "FEAT-001",
211
+ scope: "Export feature metrics safely",
212
+ capability_evals: [{ id: "CAP-1", expected_outcome: "CSV export succeeds" }],
213
+ regression_evals: [{ id: "REG-1", expected_outcome: "Existing dashboard view still renders" }],
214
+ created_by: "architect-agent"
215
+ })
216
+ ```
217
+
218
+ Guardian records `eval_readiness` through a quality gate:
219
+ ```ts
220
+ odin.record_quality_gate({
221
+ feature_id: "FEAT-001",
222
+ gate_name: "eval_readiness",
223
+ status: "APPROVED",
224
+ approver: "guardian-agent",
225
+ notes: "Eval plan is concrete, outcome-based, and does not waive other review steps."
226
+ })
227
+ ```
228
+
229
+ Reviewer records `eval_run` after executing development evals:
230
+ ```ts
231
+ odin.record_eval_run({
232
+ feature_id: "FEAT-001",
233
+ phase: "6",
234
+ status: "passed",
235
+ cases_run: ["CAP-1", "REG-1"],
236
+ important_failures: [],
237
+ manual_review_notes: ["Sampled one passing case for grader sanity."],
238
+ created_by: "reviewer-agent"
239
+ })
240
+ ```
241
+
242
+ ### Non-Interference Rules
243
+
244
+ Development Evals are additive. They MUST NOT replace or weaken:
245
+
246
+ - formal verification via `odin.verify_design` when applicable
247
+ - Builder and Integrator build/test verification
248
+ - Reviewer security review via `odin.run_review_checks`
249
+ - Integrator runtime spot-checks and end-state validation
250
+ - watched-claim verification via Policy Engine and Watcher
251
+
252
+ If Development Evals pass but any of the existing review steps fail, the feature remains blocked.
253
+
254
+ ### Failure Semantics
255
+
256
+ - Failing `eval_readiness` blocks progression from Guardian to Builder
257
+ - Reviewer records `eval_run`; `failed` or `blocked` returns the feature to Builder
258
+ - Integrator must resolve any `partial` eval state before Release
259
+ - Build, security, runtime, and claim-verification failures remain independently blocking even if Development Evals passed earlier
260
+
261
+ ---
262
+
263
+ ## Adaptive Complexity
264
+
265
+ ### Level 1: "The Nut" (Bug Fixes)
266
+ - **Sections**: Context & Goals + Acceptance Criteria only
267
+ - **Use When**: Single-file changes, obvious fixes
268
+ - **Time**: 5-10 minutes
269
+
270
+ ### Level 2: "The Feature" (Standard Features)
271
+ - **Sections**: Context + Behavioral + Acceptance + Technical
272
+ - **Use When**: New features, API endpoints, UI components
273
+ - **Time**: 20-30 minutes
274
+
275
+ ### Level 3: "The Epic" (Architectural Changes)
276
+ - **Sections**: All sections including System Context, Data Models
277
+ - **Use When**: Multi-file refactors, new subsystems
278
+ - **Time**: 1-2 hours
279
+
280
+ ### Complexity Scoring
281
+
282
+ The Architect assesses complexity using 3 dimensions (1-5 each):
283
+
284
+ - **Scope**: How many files/systems affected?
285
+ - **Risk**: What can go wrong?
286
+ - **Integration**: How many touchpoints?
287
+
288
+ | Total Score | Level |
289
+ |-------------|-------|
290
+ | 3-6 | L1 |
291
+ | 7-11 | L2 |
292
+ | 12-15 | L3 |
293
+
294
+ > **Detailed Template**: See [SDD-framework.md](docs/framework/SDD-framework.md)
295
+
296
+ ---
297
+
298
+ ## Spec Quality Rubric
299
+
300
+ Before implementation, score your spec:
301
+
302
+ | Criterion | Blocker (0) | Risky (1) | AI-Ready (2) |
303
+ |-----------|-------------|-----------|--------------|
304
+ | **Ambiguity** | Subjective terms ("fast", "nice") | General terms | Concrete binary ("< 200ms") |
305
+ | **Testability** | Prose paragraphs | Bullet points | Given/When/Then format |
306
+ | **Context** | No files mentioned | Folder names | Specific file paths |
307
+ | **Edge Cases** | Happy path only | Mentions errors | Defines error states |
308
+ | **Data Shape** | "Return user object" | "Return name, email" | TypeScript schema |
309
+
310
+ **Rule**: All criteria must score 2 before Builder phase.
311
+
312
+ ---
313
+
314
+ ## The 11 Agents
315
+
316
+ | Agent | Phases | Watched? | Role |
317
+ |-------|--------|----------|------|
318
+ | [Planner](agents/definitions/planning.md) | 0 | No | Epic decomposition for L3 features |
319
+ | [Product](agents/definitions/product.md) | 1 | No | PRD generation (complexity-gated) |
320
+ | [Discovery](agents/definitions/discovery.md) | 2 | No | Requirements gathering from vague inputs |
321
+ | [Architect](agents/definitions/architect.md) | 3 | No | Specification drafting and task breakdown |
322
+ | [Guardian](agents/definitions/guardian.md) | 4 | No | PRD + Spec review with 3 perspectives |
323
+ | [Builder](agents/definitions/builder.md) | 5 | **YES** | Code implementation per spec |
324
+ | [Reviewer](agents/definitions/reviewer.md) | 6 | No | SAST/security scan (Semgrep) |
325
+ | [Integrator](agents/definitions/integrator.md) | 7 | **YES** | Build and runtime verification |
326
+ | [Documenter](agents/definitions/documenter.md) | 8 | No | Documentation generation |
327
+ | [Release](agents/definitions/release.md) | 9 | **YES** | PR creation and feature archival |
328
+ | [Watcher](agents/definitions/watcher.md) | Any | - | LLM escalation for claim verification |
329
+
330
+ All agents inherit shared context from [_shared-context.md](agents/definitions/_shared-context.md).
331
+
332
+ **Watched agents** emit structured claims. The Policy Engine verifies claims deterministically; the Watcher handles semantic verification when escalated.
333
+
334
+ ---
335
+
336
+ ## Skills System
337
+
338
+ Skills are domain-specific knowledge modules loaded into agents based on tech stack.
339
+
340
+ ### Categories
341
+
342
+ - **Frontend**: nextjs-dev, react-patterns, tailwindcss, angular-dev, vuejs-dev, svelte-dev, astro-dev, htmx-dev, alpine-dev
343
+ - **Backend**: nodejs-express, nodejs-fastify, python-fastapi, python-django, golang-gin
344
+ - **Database**: supabase, postgresql, prisma-orm, mongodb, redis
345
+ - **Testing**: jest, vitest, playwright, cypress
346
+ - **DevOps**: docker, kubernetes, terraform, github-actions, aws
347
+ - **API**: rest-api, graphql, trpc, grpc
348
+ - **Architecture**: clean-architecture, domain-driven-design, event-driven, microservices
349
+
350
+ ### How Skills Work
351
+
352
+ 1. Orchestrator detects tech stack from `package.json`, `pyproject.toml`, etc.
353
+ 2. Matching skills are injected into agent prompts
354
+ 3. Agents apply skill-specific patterns and best practices
355
+ 4. If no match, the `generic-dev` fallback skill is used
356
+
357
+ > **Full Documentation**: See [SKILLS-SYSTEM.md](docs/reference/SKILLS-SYSTEM.md)
358
+
359
+ ---
360
+
361
+ ## Learnings System
362
+
363
+ Odin captures insights during development and propagates them to preserve knowledge.
364
+
365
+ ### Confidence Scoring
366
+
367
+ - Range: 0.00 to 1.00
368
+ - Increases with validation (+0.15) and references (+0.10)
369
+ - Propagation threshold: >= 0.80
370
+
371
+ ### Evolution Chains
372
+
373
+ Learnings evolve as understanding deepens:
374
+ - L_1 (initial) -> L_2 (refined) -> L_3 (validated)
375
+ - Each evolution links to predecessor via `predecessor_id`
376
+
377
+ ### Multi-Target Propagation
378
+
379
+ High-confidence learnings propagate to:
380
+ - **AGENTS.md** (project-specific, not shipped with Odin)
381
+ - **Skills** (technology patterns)
382
+ - **Agent definitions** (workflow improvements)
383
+
384
+ Relevance threshold for propagation: >= 0.60
385
+
386
+ > **Full Documentation**: See [HYBRID-ORCHESTRATION-PATTERN.md](docs/reference/HYBRID-ORCHESTRATION-PATTERN.md)
387
+
388
+ ---
389
+
390
+ ## EVALS System
391
+
392
+ EVALS monitors feature and system health.
393
+
394
+ > **Terminology**: This section describes **operational EVALS** (health scoring after work completes). It is separate from **Development Evals**, which are workflow artifacts/gates used before and during implementation.
395
+
396
+ ### Feature Health
397
+
398
+ Computed on feature completion:
399
+ - **Efficiency**: Duration vs complexity expectations
400
+ - **Quality**: Gate approval rate, blocker count, iteration count
401
+
402
+ ### System Health
403
+
404
+ Computed over time windows (7/30/90 days):
405
+ - Aggregates feature health scores
406
+ - Tracks trends and generates alerts
407
+
408
+ ### Health Thresholds
409
+
410
+ | Status | Score |
411
+ |--------|-------|
412
+ | HEALTHY | >= 70 |
413
+ | CONCERNING | 50-69 |
414
+ | CRITICAL | < 50 |
415
+
416
+ ---
417
+
418
+ ## Watcher Verification
419
+
420
+ Builder, Integrator, and Release are **watched agents**. They emit structured claims that are verified to ensure workflow integrity.
421
+
422
+ ### Architecture (Hybrid Verification)
423
+
424
+ ```
425
+ Builder/Integrator/Release emit claims
426
+
427
+ Odin Runtime (agent_claims table)
428
+
429
+ Policy Engine (deterministic)
430
+
431
+ ┌─────┴─────┐
432
+ ↓ ↓
433
+ PASS NEEDS_REVIEW
434
+
435
+ LLM Watcher (semantic)
436
+ ```
437
+
438
+ The watcher flow runs through Odin's MCP runtime surface:
439
+
440
+ ```
441
+ odin.submit_claim({ ... })
442
+ odin.run_policy_checks({ feature_id: "FEAT-001" })
443
+ odin.get_claims_needing_review({ feature_id: "FEAT-001" })
444
+ odin.record_watcher_review({ ... })
445
+ odin.verify_claims({ feature_id: "FEAT-001" })
446
+ ```
447
+
448
+ Example:
449
+
450
+ ```ts
451
+ odin.submit_claim({
452
+ feature_id: "FEAT-001",
453
+ phase: "5",
454
+ agent_name: "builder-agent",
455
+ claim_type: "TEST_PASSED",
456
+ description: "Acceptance criteria tests pass",
457
+ evidence_refs: { test_output_hash: "sha256:abc123" },
458
+ risk_level: "LOW"
459
+ })
460
+
461
+ odin.run_policy_checks({ feature_id: "FEAT-001" })
462
+
463
+ odin.get_claims_needing_review({ feature_id: "FEAT-001" })
464
+
465
+ odin.record_watcher_review({
466
+ claim_id: "550e8400-e29b-41d4-a716-446655440000",
467
+ verdict: "PASS",
468
+ reasoning: "Evidence supports the claim.",
469
+ watcher_agent: "watcher-agent",
470
+ confidence: 0.91
471
+ })
472
+
473
+ odin.verify_claims({ feature_id: "FEAT-001" })
474
+ ```
475
+
476
+ ### Claim Types
477
+
478
+ | Claim Type | Agent | Description |
479
+ |------------|-------|-------------|
480
+ | `CODE_ADDED` | Builder | New file created |
481
+ | `CODE_MODIFIED` | Builder | Existing file changed |
482
+ | `CODE_DELETED` | Builder | File removed |
483
+ | `TEST_PASSED` | Builder | Tests pass |
484
+ | `BUILD_SUCCEEDED` | Builder | Build completes |
485
+ | `TEST_ADDED` | Builder | Tests added for acceptance/regression coverage |
486
+ | `INTEGRATION_VERIFIED` | Integrator | Feature branch build/tests/runtime verified |
487
+ | `PR_CREATED` | Release | Pull request created |
488
+ | `ARCHIVE_CREATED` | Release | Feature archived |
489
+
490
+ ### Risk Levels
491
+
492
+ | Level | When to Use | Watcher Escalation? |
493
+ |-------|-------------|---------------------|
494
+ | **LOW** | Tests, docs, styling | Only if evidence missing |
495
+ | **MEDIUM** | Business logic, APIs | Only if evidence missing |
496
+ | **HIGH** | Auth, payments, security, PII | **ALWAYS** |
497
+
498
+ ### Escalation Triggers
499
+
500
+ The LLM Watcher is called when ANY of these are true:
501
+ 1. Claim marked `HIGH` risk
502
+ 2. Evidence refs missing or empty
503
+ 3. Policy Engine check inconclusive
504
+
505
+ ### Watcher Verdicts
506
+
507
+ | Verdict | Meaning | Action |
508
+ |---------|---------|--------|
509
+ | `PASS` | Evidence supports claim | Continue workflow |
510
+ | `FAIL` | Evidence contradicts claim | Create blocker |
511
+
512
+ The Watcher is **advisory** — it informs but does not auto-block. The orchestrator decides how to act on verdicts.
513
+
514
+ ---
515
+
516
+ ## Reviewer (SAST/Security)
517
+
518
+ The Reviewer agent (Phase 6) performs static application security testing using Semgrep.
519
+
520
+ ### How It Works
521
+
522
+ The orchestrator calls:
523
+ ```
524
+ odin.run_review_checks({
525
+ feature_id: "FEAT-001",
526
+ initiated_by: "reviewer-agent",
527
+ changed_files: ["src/auth.ts", "src/api/users.ts"]
528
+ })
529
+ ```
530
+
531
+ The runtime handles everything: runs Semgrep, records findings, and reports results. The orchestrator does NOT need to run Semgrep directly or record findings manually.
532
+
533
+ ### Severity Levels
534
+
535
+ | Severity | Action Required |
536
+ |----------|-----------------|
537
+ | CRITICAL | **MUST FIX** - Blocks release |
538
+ | HIGH | **MUST FIX** - Blocks release |
539
+ | MEDIUM | Can defer with justification |
540
+ | LOW | Can defer with justification |
541
+ | INFO | Optional |
542
+
543
+ ---
544
+
545
+ ## Product Agent (PRD Generation)
546
+
547
+ The Product agent (Phase 1) generates PRDs before technical specification.
548
+
549
+ ### Complexity-Gated Output
550
+
551
+ | Complexity | PRD Type | Max Length |
552
+ |------------|----------|------------|
553
+ | L1 | PRD_EXEMPTION | 8 lines |
554
+ | L2 | PRD_LITE | 1 page |
555
+ | L3 | PRD_FULL | Complete |
556
+
557
+ ### PRD_EXEMPTION (L1)
558
+
559
+ ```markdown
560
+ ## PRD Exemption
561
+
562
+ **Problem**: [One sentence]
563
+ **Impact**: [Who is affected]
564
+ **Acceptance Check**: [How to verify]
565
+ **Rollback Note**: [How to revert]
566
+ ```
567
+
568
+ ### Key Rules
569
+
570
+ - Max 1 clarification round with user
571
+ - No technical implementation details (that's Architect's job)
572
+ - If still ambiguous after 1 round → blocker `HUMAN_DECISION_REQUIRED`
573
+
574
+ ---
575
+
576
+ ## Git Branch Management
577
+
578
+ Odin tracks git branches per feature.
579
+
580
+ ### Branch Naming
581
+
582
+ Format: `{dev_initials}/feature/{FEATURE-ID}`
583
+ Example: `jd/feature/AUTH-001`
584
+
585
+ ### Developer Identity
586
+
587
+ The `dev_initials` and `author` parameters in `odin.start_feature` identify the human developer. The orchestrator must **never guess** these values. `author` is required and Odin rejects harness labels such as `opencode`, `codex`, or agent names. To obtain them:
588
+
589
+ 1. **Check git config**: `git config user.name` for author, derive initials from the name
590
+ 2. **Ask the developer** if git config is not available
591
+
592
+ ### Workflow
593
+
594
+ 1. **Orchestrator creates the git branch FIRST**: `git checkout -b {dev_initials}/feature/{FEATURE-ID}` — this must succeed before anything is recorded in the database
595
+ 2. **Only after the branch exists**, call `odin.start_feature` to record the feature
596
+ 3. Transition to Phase 1 (Product) — all work happens on the feature branch
597
+ 4. Each phase: `odin.prepare_phase_context` → agent work → `odin.record_phase_artifact` → `odin.record_phase_result`
598
+ 5. `odin.prepare_phase_context` starts the phase invocation timer; `odin.record_phase_result` completes it
599
+ 6. Release phase creates PR via `gh pr create`, then records it with `odin.record_pr`
600
+ 7. Human reviews and merges the PR (NEVER the agent)
601
+ 8. After the human merges the PR, record the merge with `odin.record_merge`
602
+
603
+ > **CRITICAL**: Create the git branch BEFORE calling `odin.start_feature`. If branch creation fails (e.g., branch already exists, git error), do NOT create the feature — you would have a dead DB record with no branch. The branch is the real artifact; the DB record is tracking.
604
+
605
+ ---
606
+
607
+ ## Feature Archival
608
+
609
+ When a feature completes, the Release phase archives spec files to Supabase Storage.
610
+
611
+ ### What Gets Archived
612
+
613
+ | File | Purpose |
614
+ |------|---------|
615
+ | `requirements.md` | Discovery phase output |
616
+ | `spec.md` | Approved specification |
617
+ | `tasks.md` | Task breakdown |
618
+ | `review.md` | Guardian review |
619
+ | `eval_run.md` | Reviewer/Integrator development eval summary (when present) |
620
+ | `implementation-notes.md` | Builder notes |
621
+
622
+ ### Archive Format
623
+
624
+ **Archived files MUST be formatted markdown, NOT raw JSON.**
625
+
626
+ The archive modal renders files using `react-markdown`. If you upload raw JSON (e.g., the direct output of `get_phase_outputs()`), it will render as unformatted text — unreadable and useless.
627
+
628
+ **Correct**: Format phase output data into proper markdown before archiving:
629
+ ```markdown
630
+ # Requirements — FEAT-001
631
+
632
+ ## Functional Requirements
633
+ - **REQ-1**: User can log in with email/password (Priority: HIGH)
634
+ - **REQ-2**: Session persists across page reloads (Priority: MEDIUM)
635
+
636
+ ## Non-Functional Requirements
637
+ - Response time < 200ms for login endpoint
638
+ ```
639
+
640
+ **Wrong**: Uploading raw JSON output directly:
641
+ ```json
642
+ [{"id":"REQ-1","title":"User can log in","priority":"HIGH","type":"functional"}]
643
+ ```
644
+
645
+ The Release Agent must transform phase output JSON into human-readable markdown before passing files to the archive upload.
646
+
647
+ ### Archive Workflow
648
+
649
+ The orchestrator archives features using:
650
+
651
+ ```
652
+ odin.archive_feature_release({
653
+ feature_id: "AUTH-001",
654
+ summary: "JWT authentication implementation",
655
+ archived_by: "release-agent",
656
+ release_version: "1.0.0", // optional
657
+ release_notes: "Added JWT login flow" // optional
658
+ })
659
+ ```
660
+
661
+ The runtime handles file upload (to Supabase Storage) and database recording automatically. The orchestrator does NOT need to call Edge Functions or insert archive records manually.
662
+
663
+ ### Why Archive?
664
+
665
+ - **Audit trail**: Complete history of what was built and why
666
+ - **Knowledge base**: Reference past specs for similar features
667
+ - **Debugging**: Understand original requirements when bugs arise
668
+
669
+ > **Setup**: See [SUPABASE-SETUP.md](docs/guides/SUPABASE-SETUP.md) for Supabase migrations and private archive bucket setup.
670
+
671
+ ---
672
+
673
+ ## Critical Rules
674
+
675
+ ### NEVER Skip Phases OR Steps
676
+
677
+ **All 11 phases must be executed for every feature.** The runtime enforces this at the database level — `odin.record_phase_result` with a forward transition will raise an error if phases are skipped.
678
+
679
+ **All steps within each phase must also be executed.** Each agent definition contains a **Mandatory Steps Checklist** that must be followed in order. This is enforced at the agent level — the orchestrator must verify each step is completed or explicitly marked N/A with justification.
680
+
681
+ **Two levels of enforcement**:
682
+ - **Phase enforcement**: Database-level. The runtime rejects forward phase skips.
683
+ - **Step enforcement**: Agent-level. Each agent has a mandatory checklist. The orchestrator reads the agent definition before each phase and executes every step.
684
+
685
+ **Complexity level** (L1/L2/L3) affects the **depth** within each phase and each step, not which phases or steps run:
686
+ - L1 phases can be very brief (a few sentences), but they must still happen
687
+ - L1 steps can produce minimal output, but they must still execute
688
+ - Forward transitions must be sequential: 0→1→2→3→4→5→6→7→8→9
689
+ - Backward transitions (rework) can go to any earlier phase
690
+ - Phase 10 (Complete) is set automatically when the release phase completes successfully
691
+
692
+ **Example**: An L1 bug fix still goes through all phases AND all steps:
693
+ - Phase 0 (Planning): "Single bug fix, no epic"
694
+ - Phase 1 (Product): PRD_EXEMPTION (8 lines max)
695
+ - Phase 2 (Discovery): "Bug is X, root cause is Y" (all Discovery steps, briefly)
696
+ - Phase 3 (Architect): "Fix approach: change Z in file W" (all Step A + Step B steps)
697
+ - Phase 4 (Guardian): "Approach is sound, no side effects" (all review steps)
698
+ - Phase 5 (Builder): Implement the fix (all implementation steps, emit claims)
699
+ - Phase 6 (Reviewer): "No security findings" (scan passes)
700
+ - Phase 7 (Integrator): Verify build + runtime (all verification steps, emit claims)
701
+ - Phase 8 (Documenter): Update relevant docs (if any) (all documentation steps)
702
+ - Phase 9 (Release): Create PR (all release steps, emit claims)
703
+
704
+ ### Spec-First
705
+
706
+ Never write implementation code without an approved specification. The spec is the contract.
707
+
708
+ ### Agents NEVER Merge Branches
709
+
710
+ Agents can CREATE pull requests but NEVER merge them. PR merging is ALWAYS a human decision.
711
+
712
+ **What agents CAN do**:
713
+ - `git checkout -b feature/X` - create branch
714
+ - `git push -u origin feature/X` - push branch
715
+ - `gh pr create` - create PR
716
+
717
+ **What agents CANNOT do**:
718
+ - `git merge` / `git rebase` - NEVER
719
+ - `gh pr merge` - NEVER
720
+
721
+ ### Stop After PR Creation
722
+
723
+ When a PR is created, ALL work stops. The agent waits for the developer to review and merge.
724
+
725
+ ### Bug Fixes Create Learnings
726
+
727
+ Before closing any bug fix, ask: *Is this a learning?* If the fix involved a non-obvious cause or pattern, create a learning.
728
+
729
+ ### Integrator Verifies Runtime
730
+
731
+ A passing `npm run build` does NOT guarantee correctness. Integrator must spot-check runtime behavior.
732
+
733
+ ### Agent Invocation Coverage Gate (Release)
734
+
735
+ Before Phase 9 release actions, the orchestrator MUST verify that all phases have recorded agent invocations. Use:
736
+
737
+ ```
738
+ odin.get_feature_status({ feature_id: "FEAT-001" })
739
+ ```
740
+
741
+ Check the returned status for invocation coverage across phases 1-8 (before PR) and 1-9 (before completion).
742
+
743
+ **Expected phase/agent mapping**:
744
+
745
+ | Phase | Agent |
746
+ |-------|-------|
747
+ | 1 | product-agent |
748
+ | 2 | discovery-agent |
749
+ | 3 | architect-agent |
750
+ | 4 | guardian-agent |
751
+ | 5 | builder-agent |
752
+ | 6 | reviewer-agent |
753
+ | 7 | integrator-agent |
754
+ | 8 | documenter-agent |
755
+ | 9 | release-agent |
756
+
757
+ **On missing coverage (mandatory)**:
758
+ 1. Do NOT create PR or complete the feature
759
+ 2. Identify which phases are missing invocations
760
+ 3. Backfill or re-run the missing phases before proceeding
761
+
762
+ ---
763
+
764
+ ## Architecture Notes
765
+
766
+ ### State Management
767
+
768
+ Odin state is managed through the **Odin MCP Runtime** (`odin` server) — a single-install TypeScript MCP server that provides all workflow tools (`odin.start_feature`, `odin.prepare_phase_context`, `odin.record_phase_artifact`, etc.).
769
+
770
+ Current runtime contract:
771
+ - **Persistent workflow state** uses the Supabase workflow-state adapter when `runtime.mode: supabase`
772
+ - **Smoke-test mode** uses `runtime.mode: in_memory` with no external services
773
+ - **Database schema application** happens through `odin.apply_migrations`, which supports either:
774
+ - `DATABASE_URL` for direct PostgreSQL migrations
775
+ - `SUPABASE_URL` + `SUPABASE_ACCESS_TOKEN` for Supabase Management API migrations
776
+
777
+ Database schema is applied via `odin.apply_migrations`, which auto-detects existing schemas and tracks applied migrations. See [runtime/README.md](runtime/README.md) for full configuration.
778
+
779
+ ### MCP Limitation
780
+
781
+ Task-spawned sub-agents cannot access MCP servers. Only the main orchestrator session can make MCP calls.
782
+
783
+ ### Hybrid Orchestration
784
+
785
+ Agents create artifacts; the main session orchestrates MCP calls and file operations.
786
+
787
+ > **Full Documentation**: See [HYBRID-ORCHESTRATION-PATTERN.md](docs/reference/HYBRID-ORCHESTRATION-PATTERN.md)
788
+
789
+ ---
790
+
791
+ ## Recovery Mechanisms
792
+
793
+ ### Drift Check
794
+
795
+ When code and spec diverge:
796
+
797
+ ```
798
+ Compare src/[file] against specs/[spec-file].md.
799
+ List every discrepancy where code does not match spec.
800
+ The spec is the source of truth - update the code.
801
+ ```
802
+
803
+ ### Context Refresh
804
+
805
+ When AI hallucinates structure:
806
+
807
+ ```
808
+ Stop. You are guessing [column names/types/structure].
809
+ Read the actual [database schema/file/API contract] and rewrite your response.
810
+ ```
811
+
812
+ ### De-Bloat
813
+
814
+ When spec is over-engineered:
815
+
816
+ ```
817
+ This spec is over-engineered. Rewrite as Level 1 complexity.
818
+ Keep only Context & Goals and Acceptance Criteria.
819
+ ```
820
+
821
+ ---
822
+
823
+ ## MCP Context Pulling
824
+
825
+ ### Required MCP Servers
826
+
827
+ | Server | Purpose | Required |
828
+ |--------|---------|----------|
829
+ | `odin` | Workflow state, phase context, artifacts, learnings, reviews, migrations | **Yes** |
830
+ | `docker-gateway` | Hosts toolkit servers (see below) | Recommended |
831
+ | `filesystem` | Direct file access | Recommended |
832
+ | `github` | Pull issues, PRs, tickets | Optional |
833
+
834
+ The `odin` server is the Odin MCP Runtime. It provides all `odin.*` tools, manages persistent workflow state through Supabase in `runtime.mode: supabase`, and supports migration-only direct PostgreSQL access through `odin.apply_migrations`. See [runtime/README.md](runtime/README.md) for setup.
835
+
836
+ **Docker Gateway Toolkit:**
837
+
838
+ | Tool | Purpose | When Used |
839
+ |------|---------|-----------|
840
+ | `context7` | Library docs lookup | Orchestrator on behalf of Architect/Builder |
841
+ | `sequentialthinking` | Complex multi-step reasoning | Any complex task |
842
+ | `memory` | Knowledge graph | Optional knowledge backup |
843
+
844
+ ### Trigger Phrases
845
+
846
+ ```
847
+ "Read issue #123 from the repository..." -> github MCP
848
+ "Start feature FEAT-001..." -> odin MCP (odin.start_feature)
849
+ "What phase is next?..." -> odin MCP (odin.get_next_phase)
850
+ "Apply database migrations..." -> odin MCP (odin.apply_migrations)
851
+ "Read src/components/Modal.tsx to understand..." -> filesystem MCP
852
+ "Get Next.js docs for app router..." -> docker-gateway (context7)
853
+ ```
854
+
855
+ ### Security Rules
856
+
857
+ - Odin runtime handles database access - the orchestrator uses `odin.*` tools on behalf of agents, never raw SQL in normal workflow execution
858
+ - Docker Gateway: only invoke tools documented in agent definitions
859
+
860
+ ---
861
+
862
+ ## Project Structure
863
+
864
+ ```
865
+ odin/
866
+ ├── ODIN.md # This file
867
+ ├── README.md # Quick start
868
+ ├── agents/
869
+ │ ├── definitions/ # 12 agent prompts + shared context
870
+ │ └── skills/ # 36+ domain skills
871
+ ├── runtime/ # Odin MCP Runtime (TypeScript)
872
+ │ ├── src/ # Source code
873
+ │ └── migrations/ # Bundled database migrations
874
+ ├── docs/
875
+ │ ├── framework/ # SDD-framework.md, multi-agent-protocol.md
876
+ │ ├── guides/ # example-workflow.md, SUPABASE-SETUP.md
877
+ │ └── reference/ # SKILLS-SYSTEM.md, orchestration patterns
878
+ ├── dashboard/ # Next.js monitoring dashboard
879
+ ├── templates/ # Spec templates (API, UI, Data, Infrastructure)
880
+ └── examples/ # Worked examples (DOC-001, API-001)
881
+ ```
882
+
883
+ ---
884
+
885
+ ## Code Conventions
886
+
887
+ ### TypeScript
888
+
889
+ - ES modules with `.js` extensions in imports
890
+ - Strict mode enabled
891
+ - Zod for runtime validation
892
+
893
+ ### Specifications
894
+
895
+ - File naming: `specs/[ID]-[description].md`
896
+ - Must score 2/2 on all rubric criteria
897
+
898
+ ### Skills
899
+
900
+ - Location: `agents/skills/[category]/[name]/SKILL.md`
901
+ - Include frontmatter with version and dependencies
902
+
903
+ ---
904
+
905
+ ## Quick Reference: Odin Runtime Tools
906
+
907
+ All workflow operations use `odin.*` tools provided by the Odin MCP Runtime.
908
+
909
+ ### Setup & Migrations
910
+
911
+ ```
912
+ odin.apply_migrations({ dry_run: false })
913
+ ```
914
+ Applies pending database migrations. Auto-detects existing schemas on first run. Supports `DATABASE_URL` (direct PostgreSQL) or Supabase Management API.
915
+
916
+ ### Create a Feature
917
+
918
+ ```
919
+ odin.start_feature({
920
+ id: "FEAT-001",
921
+ name: "My Feature",
922
+ complexity_level: 2, // 1, 2, or 3
923
+ severity: "ROUTINE", // ROUTINE, EXPEDITED, CRITICAL
924
+ dev_initials: "jd", // optional
925
+ base_branch: "main", // optional
926
+ author: "John Doe" // required: real human developer name
927
+ })
928
+ ```
929
+
930
+ ### Phase Workflow
931
+
932
+ ```
933
+ odin.get_next_phase({ feature_id: "FEAT-001" })
934
+
935
+ odin.prepare_phase_context({
936
+ feature_id: "FEAT-001",
937
+ phase: "3",
938
+ agent_name: "architect-agent"
939
+ })
940
+
941
+ odin.record_phase_artifact({
942
+ feature_id: "FEAT-001",
943
+ phase: "3",
944
+ output_type: "spec",
945
+ content: { ... },
946
+ created_by: "architect-agent"
947
+ })
948
+
949
+ odin.record_commit({
950
+ feature_id: "FEAT-001",
951
+ commit_hash: "abc123def",
952
+ phase: "5",
953
+ message: "feat(FEAT-001): implement builder task 1",
954
+ files_changed: 4,
955
+ insertions: 120,
956
+ deletions: 18,
957
+ committed_by: "builder-agent"
958
+ })
959
+
960
+ odin.record_phase_result({
961
+ feature_id: "FEAT-001",
962
+ phase: "3",
963
+ outcome: "completed",
964
+ summary: "Spec drafted",
965
+ created_by: "architect-agent"
966
+ })
967
+ ```
968
+
969
+ > `odin.prepare_phase_context` returns an `invocation` object. That invocation stays open while the agent works and is completed automatically when `odin.record_phase_result` is called for the same phase.
970
+
971
+ > When Development Evals are relevant, `odin.prepare_phase_context` also returns `development_evals.expected_artifacts`, `development_evals.expected_gate`, `development_evals.status_summary`, and `development_evals.harness_prompt_block`. Harnesses should append the `harness_prompt_block` lines to the active agent prompt instead of relying on implicit eval behavior.
972
+
973
+ > If the harness wants a focused eval-only read path, use `odin.get_development_eval_status({ feature_id })` instead of parsing the broader `odin.get_feature_status` payload.
974
+
975
+ > Canonical eval-aware harness flow: `odin.prepare_phase_context` -> build prompt from `role_summary`, `constraints`, and `harness_prompt_block` -> `odin.get_development_eval_status` when focused eval state is needed -> `odin.record_eval_plan` / `odin.record_eval_run` / `odin.record_quality_gate` as work completes.
976
+
977
+ ### Review & Verification
978
+
979
+ ```
980
+ odin.run_review_checks({
981
+ feature_id: "FEAT-001",
982
+ initiated_by: "reviewer-agent",
983
+ changed_files: ["src/auth.ts"]
984
+ })
985
+
986
+ odin.verify_claims({ feature_id: "FEAT-001" })
987
+ ```
988
+
989
+ ### Learnings & Knowledge
990
+
991
+ ```
992
+ odin.capture_learning({
993
+ feature_id: "FEAT-001",
994
+ phase: "5",
995
+ title: "Cache invalidation pattern",
996
+ content: "...",
997
+ category: "PATTERN",
998
+ domain_tags: ["nextjs", "caching"],
999
+ created_by: "builder-agent"
1000
+ })
1001
+
1002
+ odin.explore_knowledge({
1003
+ tags: ["nextjs", "caching"]
1004
+ })
1005
+
1006
+ odin.get_skill_proposal_queue({
1007
+ statuses: ["DRAFT_READY", "CANDIDATE"],
1008
+ limit: 10
1009
+ })
1010
+
1011
+ odin.record_skill_proposal_draft({
1012
+ topic_key: "artifactsigning",
1013
+ drafted_by: "skill-creator-agent",
1014
+ draft_markdown: "---\nname: artifact-signing\ndescription: Guidance for deterministic artifact signing.\ncategory: backend\n---\n\n# Artifact Signing\n"
1015
+ })
1016
+
1017
+ odin.record_skill_proposal_decision({
1018
+ topic_key: "artifactsigning",
1019
+ status: "APPROVED",
1020
+ decided_by: "guardian-agent"
1021
+ })
1022
+
1023
+ odin.publish_skill_proposal({
1024
+ topic_key: "artifactsigning",
1025
+ published_by: "release-agent"
1026
+ })
1027
+ ```
1028
+
1029
+ ### Status & Release
1030
+
1031
+ ```
1032
+ odin.get_feature_status({ feature_id: "FEAT-001" })
1033
+
1034
+ odin.archive_feature_release({
1035
+ feature_id: "FEAT-001",
1036
+ summary: "JWT auth implementation",
1037
+ archived_by: "release-agent"
1038
+ })
1039
+
1040
+ odin.record_pr({
1041
+ feature_id: "FEAT-001",
1042
+ pr_url: "https://github.com/org/repo/pull/42",
1043
+ pr_number: 42
1044
+ })
1045
+
1046
+ odin.record_merge({
1047
+ feature_id: "FEAT-001",
1048
+ merged_by: "human"
1049
+ })
1050
+ ```
1051
+
1052
+ > **Precondition**: Agent invocation coverage must pass before completing a feature.
1053
+
1054
+ ---
1055
+
1056
+ ## Getting Started
1057
+
1058
+ 1. **Read the framework**: [SDD-framework.md](docs/framework/SDD-framework.md)
1059
+ 2. **Set up the runtime**: [runtime/README.md](runtime/README.md)
1060
+ 3. **Understand agents**: `agents/definitions/`
1061
+ 4. **See an example**: [example-workflow.md](docs/guides/example-workflow.md)
1062
+ 5. **Database setup**: [SUPABASE-SETUP.md](docs/guides/SUPABASE-SETUP.md)
1063
+ 6. **Explore skills**: [SKILLS-SYSTEM.md](docs/reference/SKILLS-SYSTEM.md)
1064
+
1065
+ ---
1066
+
1067
+ **Odin evolves through dogfooding.** This framework follows its own specification-driven process.