agentleFS
dimastrianndimastriann/odoo-erp-mcp/.agents/skills/mutation-lifecycle/SKILL.md

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.

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
  1. Very specific:

    Use RiskEvaluator from src/risk.rs.

    line 15
  2. Very specific:

    Use preview_create, preview_update, or preview_delete from src/lifecycle/preview.rs.

    line 21
  3. Distinctive:

    Never weaken approval requirements to make a test pass.

    line 35
  4. Very specific:

    Use IdempotencyKey, IdempotencyRecord, and the storage contract in src/lifecycle/idempotency.rs.

    line 39
  5. Distinctive:

    Treat in-flight duplicates as conflicts, not retries.

    line 43
  6. Very specific:

    Use verify_create, verify_update, and verify_delete from src/lifecycle/verification.rs.

    line 56
  7. Distinctive:

    Keep execution status and verification status separate, including partial coverage, mismatch, and unknown outcomes.

    line 58
  8. Distinctive:

    Add mocked-server tests for:

    line 67
  9. Distinctive:

    Run the full quality gate from AGENTS.md before committing.

    line 77

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 Operation with the correct OperationKind, OperationClass, and normalized OperationPayload from src/lifecycle/operation.rs.
  • Use RiskEvaluator from src/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, or preview_delete from src/lifecycle/preview.rs.
  • odoo-preview must 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 in src/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 in src/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 AppError categories; never string-match Odoo failures.

6. Verify and audit

  • Use verify_create, verify_update, and verify_delete from src/lifecycle/verification.rs.
  • Keep execution status and verification status separate, including partial coverage, mismatch, and unknown outcomes.
  • Record AuditEvent entries 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.