@plazmodium/odin 0.3.3-beta → 0.3.4-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.
- package/README.md +16 -10
- package/builtin/ODIN.md +1045 -0
- package/builtin/agent-definitions/README.md +170 -0
- package/builtin/agent-definitions/_shared-context.md +377 -0
- package/builtin/agent-definitions/architect.md +627 -0
- package/builtin/agent-definitions/builder.md +716 -0
- package/builtin/agent-definitions/discovery.md +293 -0
- package/builtin/agent-definitions/documenter.md +238 -0
- package/builtin/agent-definitions/guardian.md +1049 -0
- package/builtin/agent-definitions/integrator.md +363 -0
- package/builtin/agent-definitions/planning.md +236 -0
- package/builtin/agent-definitions/product.md +405 -0
- package/builtin/agent-definitions/release.md +430 -0
- package/builtin/agent-definitions/reviewer.md +447 -0
- package/builtin/agent-definitions/watcher.md +402 -0
- package/builtin/skills/api/graphql/SKILL.md +548 -0
- package/builtin/skills/api/grpc/SKILL.md +554 -0
- package/builtin/skills/api/rest-api/SKILL.md +469 -0
- package/builtin/skills/api/trpc/SKILL.md +503 -0
- package/builtin/skills/architecture/clean-architecture/SKILL.md +141 -0
- package/builtin/skills/architecture/domain-driven-design/SKILL.md +129 -0
- package/builtin/skills/architecture/event-driven/SKILL.md +145 -0
- package/builtin/skills/architecture/microservices/SKILL.md +143 -0
- package/builtin/skills/architecture/tla-precheck/SKILL.md +171 -0
- package/builtin/skills/backend/golang-gin/SKILL.md +141 -0
- package/builtin/skills/backend/nodejs-express/SKILL.md +277 -0
- package/builtin/skills/backend/nodejs-fastify/SKILL.md +152 -0
- package/builtin/skills/backend/python-django/SKILL.md +128 -0
- package/builtin/skills/backend/python-fastapi/SKILL.md +140 -0
- package/builtin/skills/database/mongodb/SKILL.md +132 -0
- package/builtin/skills/database/postgresql/SKILL.md +120 -0
- package/builtin/skills/database/prisma-orm/SKILL.md +366 -0
- package/builtin/skills/database/redis/SKILL.md +140 -0
- package/builtin/skills/database/supabase/SKILL.md +416 -0
- package/builtin/skills/devops/aws/SKILL.md +382 -0
- package/builtin/skills/devops/docker/SKILL.md +359 -0
- package/builtin/skills/devops/github-actions/SKILL.md +435 -0
- package/builtin/skills/devops/kubernetes/SKILL.md +459 -0
- package/builtin/skills/devops/terraform/SKILL.md +453 -0
- package/builtin/skills/frontend/alpine-dev/SKILL.md +27 -0
- package/builtin/skills/frontend/angular-dev/SKILL.md +28 -0
- package/builtin/skills/frontend/astro-dev/SKILL.md +28 -0
- package/builtin/skills/frontend/htmx-dev/SKILL.md +28 -0
- package/builtin/skills/frontend/nextjs-dev/SKILL.md +470 -0
- package/builtin/skills/frontend/react-patterns/SKILL.md +166 -0
- package/builtin/skills/frontend/svelte-dev/SKILL.md +28 -0
- package/builtin/skills/frontend/tailwindcss/SKILL.md +131 -0
- package/builtin/skills/frontend/vuejs-dev/SKILL.md +28 -0
- package/builtin/skills/generic-dev/SKILL.md +307 -0
- package/builtin/skills/testing/cypress/SKILL.md +372 -0
- package/builtin/skills/testing/jest/SKILL.md +176 -0
- package/builtin/skills/testing/playwright/SKILL.md +341 -0
- package/builtin/skills/testing/unit-tests-eval-sdd/SKILL.md +73 -0
- package/builtin/skills/testing/unit-tests-sdd/SKILL.md +83 -0
- package/builtin/skills/testing/vitest/SKILL.md +249 -0
- package/dist/adapters/skills/filesystem.d.ts.map +1 -1
- package/dist/adapters/skills/filesystem.js +2 -18
- package/dist/adapters/skills/filesystem.js.map +1 -1
- package/dist/builtin-assets.d.ts +8 -0
- package/dist/builtin-assets.d.ts.map +1 -0
- package/dist/builtin-assets.js +90 -0
- package/dist/builtin-assets.js.map +1 -0
- package/dist/init.js +69 -11
- package/dist/init.js.map +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/prepare-phase-context.d.ts.map +1 -1
- package/dist/tools/prepare-phase-context.js +5 -0
- package/dist/tools/prepare-phase-context.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -3
package/builtin/ODIN.md
ADDED
|
@@ -0,0 +1,1045 @@
|
|
|
1
|
+
# ODIN.md
|
|
2
|
+
|
|
3
|
+
> **Odin** is a Specification-Driven Development (SDD) framework for AI-assisted development.
|
|
4
|
+
> It provides 12 specialized 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**: AI agents autonomously fetch what they need (via MCP) 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 12 specialized 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 | Epic decomposition (L3 only) |
|
|
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 [multi-agent-protocol.md](docs/framework/multi-agent-protocol.md)
|
|
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 12 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
|
+
| [Consultant](agents/definitions/spec-driven-dev-consultant.md) | Any | No | Spec refinement and analysis |
|
|
330
|
+
|
|
331
|
+
All agents inherit shared context from [_shared-context.md](agents/definitions/_shared-context.md).
|
|
332
|
+
|
|
333
|
+
**Watched agents** emit structured claims. The Policy Engine verifies claims deterministically; the Watcher handles semantic verification when escalated.
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Skills System
|
|
338
|
+
|
|
339
|
+
Skills are domain-specific knowledge modules loaded into agents based on tech stack.
|
|
340
|
+
|
|
341
|
+
### Categories
|
|
342
|
+
|
|
343
|
+
- **Frontend**: nextjs-dev, react-patterns, tailwindcss, angular-dev, vuejs-dev, svelte-dev, astro-dev, htmx-dev, alpine-dev
|
|
344
|
+
- **Backend**: nodejs-express, nodejs-fastify, python-fastapi, python-django, golang-gin
|
|
345
|
+
- **Database**: supabase, postgresql, prisma-orm, mongodb, redis
|
|
346
|
+
- **Testing**: jest, vitest, playwright, cypress
|
|
347
|
+
- **DevOps**: docker, kubernetes, terraform, github-actions, aws
|
|
348
|
+
- **API**: rest-api, graphql, trpc, grpc
|
|
349
|
+
- **Architecture**: clean-architecture, domain-driven-design, event-driven, microservices
|
|
350
|
+
|
|
351
|
+
### How Skills Work
|
|
352
|
+
|
|
353
|
+
1. Orchestrator detects tech stack from `package.json`, `pyproject.toml`, etc.
|
|
354
|
+
2. Matching skills are injected into agent prompts
|
|
355
|
+
3. Agents apply skill-specific patterns and best practices
|
|
356
|
+
4. If no match, the `generic-dev` fallback skill is used
|
|
357
|
+
|
|
358
|
+
> **Full Documentation**: See [SKILLS-SYSTEM.md](docs/reference/SKILLS-SYSTEM.md)
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
## Learnings System
|
|
363
|
+
|
|
364
|
+
Odin captures insights during development and propagates them to preserve knowledge.
|
|
365
|
+
|
|
366
|
+
### Confidence Scoring
|
|
367
|
+
|
|
368
|
+
- Range: 0.00 to 1.00
|
|
369
|
+
- Increases with validation (+0.15) and references (+0.10)
|
|
370
|
+
- Propagation threshold: >= 0.80
|
|
371
|
+
|
|
372
|
+
### Evolution Chains
|
|
373
|
+
|
|
374
|
+
Learnings evolve as understanding deepens:
|
|
375
|
+
- L_1 (initial) -> L_2 (refined) -> L_3 (validated)
|
|
376
|
+
- Each evolution links to predecessor via `predecessor_id`
|
|
377
|
+
|
|
378
|
+
### Multi-Target Propagation
|
|
379
|
+
|
|
380
|
+
High-confidence learnings propagate to:
|
|
381
|
+
- **AGENTS.md** (project-specific, not shipped with Odin)
|
|
382
|
+
- **Skills** (technology patterns)
|
|
383
|
+
- **Agent definitions** (workflow improvements)
|
|
384
|
+
|
|
385
|
+
Relevance threshold for propagation: >= 0.60
|
|
386
|
+
|
|
387
|
+
> **Full Documentation**: See [HYBRID-ORCHESTRATION-PATTERN.md](docs/reference/HYBRID-ORCHESTRATION-PATTERN.md)
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## EVALS System
|
|
392
|
+
|
|
393
|
+
EVALS monitors feature and system health.
|
|
394
|
+
|
|
395
|
+
> **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.
|
|
396
|
+
|
|
397
|
+
### Feature Health
|
|
398
|
+
|
|
399
|
+
Computed on feature completion:
|
|
400
|
+
- **Efficiency**: Duration vs complexity expectations
|
|
401
|
+
- **Quality**: Gate approval rate, blocker count, iteration count
|
|
402
|
+
|
|
403
|
+
### System Health
|
|
404
|
+
|
|
405
|
+
Computed over time windows (7/30/90 days):
|
|
406
|
+
- Aggregates feature health scores
|
|
407
|
+
- Tracks trends and generates alerts
|
|
408
|
+
|
|
409
|
+
### Health Thresholds
|
|
410
|
+
|
|
411
|
+
| Status | Score |
|
|
412
|
+
|--------|-------|
|
|
413
|
+
| HEALTHY | >= 70 |
|
|
414
|
+
| CONCERNING | 50-69 |
|
|
415
|
+
| CRITICAL | < 50 |
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## Watcher Verification
|
|
420
|
+
|
|
421
|
+
Builder, Integrator, and Release are **watched agents**. They emit structured claims that are verified to ensure workflow integrity.
|
|
422
|
+
|
|
423
|
+
### Architecture (Hybrid Verification)
|
|
424
|
+
|
|
425
|
+
```
|
|
426
|
+
Builder/Integrator/Release emit claims
|
|
427
|
+
↓
|
|
428
|
+
Odin Runtime (agent_claims table)
|
|
429
|
+
↓
|
|
430
|
+
Policy Engine (deterministic)
|
|
431
|
+
↓
|
|
432
|
+
┌─────┴─────┐
|
|
433
|
+
↓ ↓
|
|
434
|
+
PASS NEEDS_REVIEW
|
|
435
|
+
↓
|
|
436
|
+
LLM Watcher (semantic)
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
The watcher flow runs through Odin's MCP runtime surface:
|
|
440
|
+
|
|
441
|
+
```
|
|
442
|
+
odin.submit_claim({ ... })
|
|
443
|
+
odin.run_policy_checks({ feature_id: "FEAT-001" })
|
|
444
|
+
odin.get_claims_needing_review({ feature_id: "FEAT-001" })
|
|
445
|
+
odin.record_watcher_review({ ... })
|
|
446
|
+
odin.verify_claims({ feature_id: "FEAT-001" })
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
Example:
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
odin.submit_claim({
|
|
453
|
+
feature_id: "FEAT-001",
|
|
454
|
+
phase: "5",
|
|
455
|
+
agent_name: "builder-agent",
|
|
456
|
+
claim_type: "TEST_PASSED",
|
|
457
|
+
description: "Acceptance criteria tests pass",
|
|
458
|
+
evidence_refs: { test_output_hash: "sha256:abc123" },
|
|
459
|
+
risk_level: "LOW"
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
odin.run_policy_checks({ feature_id: "FEAT-001" })
|
|
463
|
+
|
|
464
|
+
odin.get_claims_needing_review({ feature_id: "FEAT-001" })
|
|
465
|
+
|
|
466
|
+
odin.record_watcher_review({
|
|
467
|
+
claim_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
468
|
+
verdict: "PASS",
|
|
469
|
+
reasoning: "Evidence supports the claim.",
|
|
470
|
+
watcher_agent: "watcher-agent",
|
|
471
|
+
confidence: 0.91
|
|
472
|
+
})
|
|
473
|
+
|
|
474
|
+
odin.verify_claims({ feature_id: "FEAT-001" })
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
### Claim Types
|
|
478
|
+
|
|
479
|
+
| Claim Type | Agent | Description |
|
|
480
|
+
|------------|-------|-------------|
|
|
481
|
+
| `CODE_ADDED` | Builder | New file created |
|
|
482
|
+
| `CODE_MODIFIED` | Builder | Existing file changed |
|
|
483
|
+
| `CODE_DELETED` | Builder | File removed |
|
|
484
|
+
| `TEST_PASSED` | Builder | Tests pass |
|
|
485
|
+
| `BUILD_SUCCEEDED` | Builder | Build completes |
|
|
486
|
+
| `INTEGRATION_VERIFIED` | Integrator | Merge + 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. After the human merges the PR, record the merge with `odin.record_merge`
|
|
601
|
+
6. Human reviews and merges (NEVER the agent)
|
|
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 Edge Function deployment.
|
|
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 | 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 — agents use `odin.*` tools, not raw SQL
|
|
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
|
+
|
|
1007
|
+
### Status & Release
|
|
1008
|
+
|
|
1009
|
+
```
|
|
1010
|
+
odin.get_feature_status({ feature_id: "FEAT-001" })
|
|
1011
|
+
|
|
1012
|
+
odin.archive_feature_release({
|
|
1013
|
+
feature_id: "FEAT-001",
|
|
1014
|
+
summary: "JWT auth implementation",
|
|
1015
|
+
archived_by: "release-agent"
|
|
1016
|
+
})
|
|
1017
|
+
|
|
1018
|
+
odin.record_pr({
|
|
1019
|
+
feature_id: "FEAT-001",
|
|
1020
|
+
pr_url: "https://github.com/org/repo/pull/42",
|
|
1021
|
+
pr_number: 42
|
|
1022
|
+
})
|
|
1023
|
+
|
|
1024
|
+
odin.record_merge({
|
|
1025
|
+
feature_id: "FEAT-001",
|
|
1026
|
+
merged_by: "human"
|
|
1027
|
+
})
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
> **Precondition**: Agent invocation coverage must pass before completing a feature.
|
|
1031
|
+
|
|
1032
|
+
---
|
|
1033
|
+
|
|
1034
|
+
## Getting Started
|
|
1035
|
+
|
|
1036
|
+
1. **Read the framework**: [SDD-framework.md](docs/framework/SDD-framework.md)
|
|
1037
|
+
2. **Set up the runtime**: [runtime/README.md](runtime/README.md)
|
|
1038
|
+
3. **Understand agents**: [multi-agent-protocol.md](docs/framework/multi-agent-protocol.md)
|
|
1039
|
+
4. **See an example**: [example-workflow.md](docs/guides/example-workflow.md)
|
|
1040
|
+
5. **Database setup**: [SUPABASE-SETUP.md](docs/guides/SUPABASE-SETUP.md)
|
|
1041
|
+
6. **Explore skills**: [SKILLS-SYSTEM.md](docs/reference/SKILLS-SYSTEM.md)
|
|
1042
|
+
|
|
1043
|
+
---
|
|
1044
|
+
|
|
1045
|
+
**Odin evolves through dogfooding.** This framework follows its own specification-driven process.
|