OUMV (Observe, Understand, Mutate, Verify) protocol guide for agents working on a running frontend or backend through tokensafe:oumv or an OUMV JSON-RPC endpoint (/__oumv/rpc). Use when a workspace has an OUMV-supported stack, when asked why a UI state or request fails, before editing with an OCC expectedVersion, when verifying an endpoint or UI action, or when handling an OUMV error code (-32001 to -32012).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Oumv Protocol?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tokensafe-dev-oumv-protocol)
---
name: oumv-protocol
description: "OUMV (Observe, Understand, Mutate, Verify) protocol guide for agents working on a running frontend or backend through tokensafe:oumv or an OUMV JSON-RPC endpoint (/__oumv/rpc). Use when a workspace has an OUMV-supported stack, when asked why a UI state or request fails, before editing with an OCC expectedVersion, when verifying an endpoint or UI action, or when handling an OUMV error code (-32001 to -32012)."
---
# OUMV protocol (wire 1.11.0, spec revision v1.38, release v1.17.17)
One protocol, two profiles: **frontend** (components, surface, signals) and **backend** (endpoints, DTOs, traces). JSON-RPC 2.0; HTTP `POST <base>/__oumv/rpc` is mandatory, SSE/WebSocket are optional and advertised, stdio serves CLI/MCP bridges.
## How agents reach it: `tokensafe:oumv(action=...)`
| Action | Does |
| :--- | :--- |
| `status` | Stacks per package, live runtimes, `oumvSupported` |
| `brief` | Skeleton + call sites + props + module state of a file/symbol |
| `observe` | `level` L0–L4 with `target`, or `path` (a file at L1+ returns its symbols and `file.version`) |
| `understand` | `query` = `impact`, `causality`, `why_state`, `dependencies`, `signals`; `target` |
| `index` | Repo-wide symbol search (`query`, `kinds?`, `limit?`) |
| `graph` | Cross-stack graph (frontend fetch → backend endpoint) |
| `mutate` | OCC edit: `path`, `symbol?`, `replacement`, `expectedVersion` |
| `preview` | Dry-run of mutate (or `batch`): diff + guard verdict, no write |
| `verify` | `target`, `verify_action` (`invoke`/`click`/`submit`), `payload` |
| `build` | Runtime build/test command → diagnostics (`timeout_ms`) |
| `cancel` | Cooperative cancel by `requestId` |
- **Offline is fine.** Without a live runtime the static graph answers observe/understand/index/brief; verify answers a labelled static subset (exists, syntax, OCC, symbol/route presence), never runtime evidence.
- **Live frontend:** `tokensafe dev` starts the app's own Vite server (React, Vue, Solid, Angular via Analog) with the bridge injected; no repo file changes.
- **Plan gating:** observation is free; `mutate`, `preview`, `verify`, `build` need Solo or higher. On guest/free (or `TOKENSAFE_OUMV_READ_ONLY=1`) they return a read-only notice. Treat it as final: do not redo the edit through other tools.
Supported stacks (`adapters/*.json`): React, Vue, Solid, Angular (Vite) via `tokensafe-ui`; Go Gin/Chi/net-http; Python FastAPI, Starlette, Flask, Django (WSGI mount); Node Express, Fastify, Next.js App Router, Elysia on Bun; ASP.NET Core; Spring Boot and Laravel/Symfony (sidecars). Elsewhere use `repo_map`/`smart_read_file`/`scoped_search`.
## Workflow
1. **Observe** progressively: L0 pulse (route/health), L1 surface (elements or endpoints, paged by `limit`/`cursor`), then L2 contract or L3 source only for a named `target` (required there). L4 = traces/events.
2. **Understand** before editing: `impact` for blast radius, `causality`/`why_state` for "why is X disabled / why does this request fail". `observed: false` means no runtime evidence, so no root cause.
3. **Mutate** under OCC: take `version` (`sha256:` of the whole file, even for a slice) from L3/`getSource`/`observe` and send it as `expectedVersion`. Prefer `symbol` or `patch` edits over whole-file `replace`. A scoped edit must name its mode: `symbol`, `hunks` or `renameTo` with `mode` absent or `replace` is `-32602` (`mode_required_with_*`), never a silent whole-file replace.
4. **Verify** behaviour, then read `scope` (what was and was not executed). A rollback happened only when `rollbackStatus: "verified"`.
Wire methods: `oumv/handshake`, `observe`, `understand`, `getSource` `{path, symbol?, startLine?, endLine?, ifVersion?}`, `applyEdit` `{path, mode, replacement?, expectedVersion?, symbol?, hunks?, renameTo?, verify?}` or `{edits: [...]}` (atomic batch), `previewEdit`, `verify` `{target, steps?, sandbox?: {mode: "rollback"}}`, `index`, `query` (read-only SQL), `build`, `graph`, `cancel`, `disconnect`. Modes: `replace`, `create` (no expectedVersion), `symbol`, `patch` (hunks in order, atomic), `delete`, `rename`. `filePath`/`source` are deprecated aliases of `path`/`replacement`.
The handshake negotiates capabilities. A capability that is not advertised is not registered: its methods answer `-32601`. `readOnly: true` means no mutate/preview/verify/build.
## Errors and recovery
| Code | Name | Do |
| :--- | :--- | :--- |
| -32001 | CONFLICT_DETECTED | File changed (or exists, for create/rename): re-observe, merge, retry with the new version |
| -32002 | SYNTAX_ERROR | Fix the replacement using `data`; nothing was written |
| -32003 | SECURITY_VIOLATION | Path left the workspace, sensitive file, or forbidden query |
| -32004 / -32009 | TARGET / RESOURCE_NOT_FOUND | Re-observe L1; patch: use `data.nearest` / `suggestedWindow` |
| -32005 | ACTION_NOT_FOUND | Read valid actions at L2 |
| -32006 | UNSUPPORTED_CAPABILITY | Not implemented or not advertised; do not retry |
| -32007 | PERMISSION_DENIED | Policy (mutate/query disabled) |
| -32008 | RUNTIME_UNAVAILABLE | Runtime/sandbox down or request cancelled; fall back to static |
| -32010 | STALE_RESOURCE_VERSION | Cached `ifVersion` is stale; refetch without it |
| -32011 | VALIDATION_FAILED | See `data.reason`, e.g. `expected_version_required`, `target_not_unique` (narrow the lines) |
| -32012 | RATE_LIMITED | Wait `data.retryAfterMs` |
Sources: `spec/SPEC.md`, `schemas/errors.json`, `compatibility.json`. Adapters certify with `oumv-certify` (`@oumv/conformance`); certification Levels 1–3 are not observe levels L0–L4.