odf-implement
Implement Odoo tasks from design artifact. Write code following spec + design. Trigger: Phase 3 (IMPLEMENT) of /odf-new after DESIGN approved.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implement Odoo tasks from design artifact. Write code following spec + design. Trigger: Phase 3 (IMPLEMENT) of /odf-new after DESIGN approved.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Detect + persist Odoo project context: version, modules, test runner, lint tools, conventions. Trigger: /odf-init, first time in a project.
Quality gate for ODF: evidence-based risk tiers (0/1/4 lenses), spec compliance matrix, single-attempt correction budget. Trigger: Phase 4 (VERIFY) of /odf-new.
Create an ODF change proposal with business context, scope, and approach. Trigger: Phase 0 (PROPOSE) of /odf-new.
Strict TDD mode for ODF: tests before code. Two-source kill switch (global + local), any off wins, fail-closed. Trigger: /odf-tdd on, effective TDD mode active, or when strict TDD enforcement is needed.
Deep investigation of Odoo codebase to understand patterns before proposing solutions. Trigger: /odf-explore, 'how does Odoo handle X', research, investigation.
Assess Odoo requirement: determine standard vs custom strategy, analyze functional feasibility, produce functional spec. Trigger: Phase 1 (ASSESS) of /odf-new.
| name | odf-implement |
| description | Implement Odoo tasks from design artifact. Write code following spec + design. Trigger: Phase 3 (IMPLEMENT) of /odf-new after DESIGN approved. |
| license | MIT |
| metadata | {"author":"adruban","version":"2.0"} |
Use after DESIGN returns approved task breakdown. Implement assigned tasks in batches. Follow functional spec and design strictly — do NOT freelance different approaches.
| Rule | Requirement |
|---|---|
| Specs are acceptance criteria | Read REQ-XX from assess before implementing each task |
| Follow design decisions | If design is wrong, NOTE IT — don't silently deviate |
| Tests with code | Tests belong in the same commit as the behavior they verify |
| Smoke tests per batch | Run pre-commit + pylint-odoo on changed files after each batch |
| Stop-validation evidence | After each batch, run the tier's stop-validation commands and write <worktree>/.odf/validation-evidence-{change}.json — a batch WITHOUT verified evidence does NOT close |
| Mark tasks as you go | Update task status immediately, not at the end |
| Condition | Action |
|---|---|
| Task blocked by unexpected issue | Stop batch, report status: blocked to orchestrator |
| Pre-commit or pylint errors | Fix immediately before proceeding |
Stop-validation evidence not verified (validation.status !== "verified") | Do NOT close the batch — fix, re-run the commands, rewrite the evidence file |
| All tasks in batch complete | Persist progress, return for next batch or VERIFY |
<worktree>/.odf/validation-evidence-{change}.json. The Policy Gate decision injected in your prompt carries the authoritative risk_tier and frozen_diff_ref — use them. Minimum commands per tier (use the project's real commands from odf-init/{project}; no fabricated exit codes):
git diff --check (+ AST parse of changed .py, or xmllint --noout when only views changed)--files or pylint-odoo) + module tests (test_command)pre-commit run -a + automated security scan (grep for env.cr.execute with interpolation, eval(, subprocess with shell=True)testing.test_command from odf-init/{project} and substitute {module} only. The persisted Docker template is docker compose run --rm odoo odoo -d {test_db} -i {module} --test-enable --stop-after-init; the local template is odoo-bin -d {test_db} -i {module} --test-enable --stop-after-init. A command without explicit -d {test_db} is invalid for Odoo DB tests. If no disposable test database name/config is detected, block and ask the user rather than guessing. Never run or document dropdb, DROP DATABASE, TRUNCATE, or destructive re-initialization as automatic setup.{
"change": "my-change", "phase": "IMPLEMENT", "batch": 1,
"risk_tier": "MEDIUM", "frozen_diff_ref": "<same ref as the policy gate>",
"resolved_at": "<ISO-8601>",
"commands": [
{ "name": "git-diff-check", "command": "git diff --check", "exit_code": 0, "output_tail": "..." },
{ "name": "odoo-tests", "command": "docker compose run --rm odoo odoo -d {test_db} -i {module} --test-enable --stop-after-init", "database": "{test_db}", "exit_code": 0, "output_tail": "... 0 failed ..." }
]
}
mem_save(title: "odf/{change}/implement-progress", ...). Update design with [x] marks.Return ODF Result envelope with: status (ok|warning|blocked), executive_summary ("N/M tasks done. Smoke: pass/warn."), batch_summary (completed tasks, files changed, deviations from design, smoke test results), artifacts_saved, next_recommended (["implement"] or ["verify"]), risks, modules_affected, validation_evidence (path to the evidence file + command/exit_code summary — REQUIRED for IMPLEMENT batches).
/home/adruban/.config/opencode/skills/_shared/result-contract.md — ODF Result envelope/home/adruban/.config/opencode/skills/_shared/odoo-sources.md — Local source paths