mutation-lifecycle
Skill3 starsChanged 8 days agoMITView on GitHub
Use when adding or changing Odoo create, update, copy, delete, batch, or workflow mutations. Enforces preview, risk classification, approval, idempotency, single execution, post-action verification, and audit safeguards.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- atomic-commitSkill
- mcp-tool-extensionSkill
- odoo-compatSkill
- releaseSkill
- security-reviewSkill
- web-uiSkill
- atomic-commitSkill
- mcp-tool-extensionSkill
- mutation-lifecycleSkill
- odoo-compatSkill
- releaseSkill
- security-reviewSkill
- web-uiSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Use RiskEvaluator from src/risk.rs.
- Very specific: line 21
Use preview_create, preview_update, or preview_delete from src/lifecycle/preview.rs.
- Distinctive: line 35
Never weaken approval requirements to make a test pass.
- Very specific: line 39
Use IdempotencyKey, IdempotencyRecord, and the storage contract in src/lifecycle/idempotency.rs.
- Distinctive: line 43
Treat in-flight duplicates as conflicts, not retries.
- Very specific: line 56
Use verify_create, verify_update, and verify_delete from src/lifecycle/verification.rs.
- Distinctive: line 58
Keep execution status and verification status separate, including partial coverage, mismatch, and unknown outcomes.
- Distinctive: line 67
Add mocked-server tests for:
- Distinctive: line 77
Run the full quality gate from AGENTS.md before committing.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mutation Lifecycle
AGENTS.md is the canonical rule set. Every mutating path must preserve the
following order and guarantees.
1. Classify the operation
- Build an
Operationwith the correctOperationKind,OperationClass, and normalizedOperationPayloadfromsrc/lifecycle/operation.rs. - Use
RiskEvaluatorfromsrc/risk.rs; do not invent a risk level. - Protected classes (workflow, financial, admin) have non-downgradable floors.
- Bulk operations escalate by threshold.
2. Preview without writing
- Use
preview_create,preview_update, orpreview_deletefromsrc/lifecycle/preview.rs. odoo-previewmust never call a mutation RPC.- Return affected records, proposed values, bulk summaries, estimates, and warnings; mark computed or defaulted fields as estimates.
3. Require approval when risk demands it
- Use
ApprovalRequest::for_operation,request_approval,consume_approval, and the approval storage insrc/lifecycle/approval.rs. - Bind approvals to actor, instance, operation, and payload hash.
- Enforce expiration, single use, retry-match rules, and state transitions.
- Rejected, expired, mismatched, or already-consumed approvals never execute.
- Never weaken approval requirements to make a test pass.
4. Make execution idempotent
- Use
IdempotencyKey,IdempotencyRecord, and the storage contract insrc/lifecycle/idempotency.rs. - Scope records by actor and instance; bind them to the payload hash.
- Reject key reuse with a different payload.
- Treat in-flight duplicates as conflicts, not retries.
- Record post-send timeouts and ambiguous outcomes as unknown; never retry a mutation blindly.
5. Execute once
- Route through
OperationExecutor::execute; do not call mutation RPCs from the MCP layer. - Retries are allowed only for read-only operations (see
src/odoo/retry.rs). - Preserve
AppErrorcategories; never string-match Odoo failures.
6. Verify and audit
- Use
verify_create,verify_update, andverify_deletefromsrc/lifecycle/verification.rs. - Keep execution status and verification status separate, including partial coverage, mismatch, and unknown outcomes.
- Record
AuditEvententries for execution, verification, approval decisions, and failures without secrets. - Return a truthful
LifecycleOutcome; do not report success on unverified mutations.
7. Tests
Add mocked-server tests for:
- risk floors and bulk escalation;
- preview never writes;
- approval binding, expiration, rejection, single use, and retry matching;
- idempotency replay, payload mismatch, concurrent duplicates, and unknown post-send states;
- verification success, mismatch, partial coverage, and deleted absence;
- audit redaction and hash-chain integrity.
Run the full quality gate from AGENTS.md before committing.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

