Activation Contract
Use only for Phase 2 (DESIGN) after ASSESS is approved and its REQ-XX plus the
approved human EXP-XX artifact are available. Return a closed design or block.
When to Use
Use after ASSESS returns strategy: custom. Produce a closed design document
per docs/design-contract.md that resolves EVERYTHING IMPLEMENT will need (module
destination, models, views, security, EXP-XX), then derive the IMPLEMENT task
plan from it. The orchestrator will approve before IMPLEMENT.
Phase Boundary
- DESIGN emits and persists only the closed design: no Python/XML/CSV,
implementation templates, or implementation-file edits.
- On
plan: requiredroutes, IMPLEMENT consumes the approved design as its single
source of truth. A missing, stale, or unresolved decision or seam returns
blocked and reopens PLAN with the exact missing decision; never ask for
confirmation or improvise.
- On
plan: inlineroutes (small-change/bugfix), this formal design contract
does not apply: do not require or create a DESIGN artifact just to start BUILD.
IMPLEMENT follows the persisted route, approved Expectations, and bounded
inline task/QA plan; escalate to formal PLAN only if scope or risk requires it.
Precision Invariants
- Keep the requested change minimal; reuse repository conventions; add no speculative
refactors or features.
- Trace every design task to its REQ-XX and EXP-XX and to exact target file(s).
- Resolve technical ambiguity from repository and target-version source evidence. If
it could change product behavior, return blocked with the exact missing product
decision instead of silently choosing, asking, or guessing.
Source Authority
Use evidence in this order: target repository/source first; approved ODF artifacts
and project conventions next; external references only when needed; model memory
last. Resolve Odoo, OWL, and API behavior from target-version source rather than
hardcoding versions in this skill. Keep the existing odf-toolkit verification
requirements for source-dependent claims.
Hard Rules
| Rule | Requirement |
|------|-------------|
| Read source first | Read the real Odoo module source being extended/inherited BEFORE designing |
| Read EXP-XX | Read the expectations artifact (EXP-XX, from docs/expectations-contract.md and the store) as input |
| Resolve all EXP-XX | Every EXP-XX must have a concrete resolution row; a design missing any is NOT closed |
| No code | Use the contract's TABLES (fields, views, tasks). Do NOT write Python/XML in the design — IMPLEMENT writes the code |
| Reference by ID | Reference EXP-XX/REQ-XX by ID; do not restate the full expectation statement (it lives in expectations.yaml) |
| Fix the module | Decide the exact target module (new vs inherit) in DESIGN — never leave it to IMPLEMENT |
| Traceability | Every task links to a REQ-XX and the EXP-XX it resolves |
| Decisions (ADR-lite) | Record a decision only when ALL three hold: hard to reverse, surprising without context, and the result of a real trade-off (real options existed). Format: decision / options / choice / consequence. Omit decisions failing any condition — no ADR spam. A qualifying decision that outlives the change MAY be promoted to docs/adr/ in the worktree on user request |
| Project context | Use project_context.glossary terms for module/model/field names and honor project_context.principles (from odf-init/{project}); when a design choice conflicts with a principle, resolve it explicitly or return blocked — never silently violate it |
| Security required | Every new model MUST have ir.model.access.csv (per group) + ir.rule if applicable |
| Tests required | Every feature MUST have at least one test task |
| OCA conventions | File structure, naming, manifest follow OCA standards |
| Deep modules | Design interfaces as deep modules — much behaviour behind a small interface (module / interface / depth / seam / adapter). Apply the deletion test: if deleting it merely moves complexity, cut it; if complexity concentrates, keep it. The interface is the test surface — a test that must reach past it signals the wrong shape. When an interface is genuinely in question, sketch 2-3 radically different options (design-it-twice) and compare depth, locality, and seam placement before choosing |
Decision Gates
| Condition | Action |
|-----------|--------|
| Single module | One module, 3 phases: Foundation → Views → Tests |
| Multi-module (2+) | Design per module: Primary first (all phases), then secondary. Prefix task IDs (A1.1, B1.1) |
| Complex architecture | Record qualifying decisions under ### Architecture Decisions per the ADR-lite rule (decision / options / choice / consequence) |
Execution Steps
- Retrieve the assess artifact (REQ-XX) and
expectationsartifact
(EXP-XX) through the selected store.
- Read the module: Read the real Odoo source module being extended/inherited.
- Produce the design document per
docs/design-contract.md(ALL sections):
Context (module + manifest_depends), EXP-XX resolution table, data model
(_name/_inherit, fields/types/constraints, computed/onchange), views + UI
(actions + menus + wizard), security, data/migration, IMPLEMENT plan, plus
### Architecture Decisions when a decision meets the ADR-lite three-condition test (§9).
- Fix the module destination exactly (new vs inherit) — do not leave it open.
- Derive the IMPLEMENT plan from the document: each task links to exact
file(s) + the EXP-XX it resolves.
- Verify closure internally using
docs/design-contract.md§8 — do NOT
copy the checklist into the document as a section. If not closed, iterate
before returning; if a decision genuinely cannot be resolved, return blocked
listing the open decisions.
- Persist in the selected store with
artifact_ref,design_path,
design_closed, and design_meta. Derive design_meta from the closed
document per docs/design-contract.md §"design_meta": count models, fields,
views, tasks, EXP-XX rows; module_type from the "Fix the module" decision;
manifest_depends/odoo_version from the context. Include design_meta in
the envelope and as part of the persisted artifact. If it cannot be derived
(empty document / no data), return design_meta: null with reason — never
invent values.
Completion Criteria
The design is DONE (closed) only when ALL hold:
- Every EXP-XX is resolved by exact file/line references; none is restated in full (reference by ID).
- The contract tables (fields, views, tasks) are complete and contain NO Python/XML code blocks.
- Every task in the breakdown maps to at least one EXP-XX, and no task depends on an open decision.
- Every qualifying decision (hard to reverse, surprising, real trade-off) is recorded under
### Architecture Decisions; no qualifying decision is left implicit. - Every view XML ID, model, and
_inheritin the design was VERIFIED in the local source viaodf-toolkit lookup(defining file:line recorded); nothing is invented from memory. design_closedis reported as a booleantrue(never the string"true").- The closed-design checklist passes internally and is NOT copied into the document.
Output Contract
Return the complete shared ODF Result envelope, including every required common field (especially strategy and skill_resolution), with executive_summary ("N modules, M
models, V views, K tasks in M phases — design closed"), design_closed (true|false),
design_path (path of the persisted design.md), design_meta (structured summary
for estimation — see docs/design-contract.md). If
design_closed: false, do NOT return ok — iterate or return blocked.
References
../_shared/result-contract.md— ODF Result envelope../_shared/persistence-contract.md— selected store and artifact references../_shared/odoo-sources.md— Local source pathsdocs/design-contract.md— The design document contract + closed-design checklistdocs/expectations-contract.md— EXP-XX format and immutability