/memfleet-skills:memfleet-safe-editfrom memfleet-skills
End-to-end edit workflow for multi-agent sessions: get_node_state → publish_intent → edit → record_episode → branch on conflict class. Prevents silent overwrites when multiple agents modify overlapping symbols.
Ships in memfleet-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The end-to-end protocol that wraps every coordinated edit. Six steps, one MCP tool per step (mostly), with explicit branching on the returned conflict class. Skipping any step turns silent collisions into silent overwrites.
Use this workflow whenever you are about to modify a symbol that other agents could plausibly be touching. For one-shot conflict triage or leader-orchestrated multi-symbol refactors, see the sibling skills under "Skill Priority" below.
Examples below use mcp__memfleet__* tool names. Substitute fleet-cli <subcommand> if your harness has no MCP bridge — the CLI mirrors every tool.
STEP 1 (read) get_node_state(symbol) — who's been here?
STEP 2 (lock) publish_intent(symbol, kind, ttl) — declare + get conflicts
STEP 3 (decide) if active_conflicts ≠ ∅ — branch to conflict-resolution
STEP 4 (edit) make your code changes — your normal edit loop
STEP 5 (report) record_episode(intent_id, ...) — classify + update rollup
STEP 6 (class) branch on returned conflict_class — A done / B replan / C blocked
get_node_statemcp__memfleet__get_node_state({
repo_id: "my-repo",
symbol: "UserRole",
last_n: 5
})
Inspect:
dominant_intent — if it is an in-flight Refactor(RenameSymbol) and your plan is another rename → replan. Do not proceed.recent_episodes[] — if your own Exploratory intent is in the list, you have already probed this symbol; skip the scout.conflict_density — high density means this node is a recurring battleground; consider a shorter ttl_ms on Step 2.Success criteria: you have a defensible reason to either proceed, replan, or wait.
publish_intentmcp__memfleet__publish_intent({
repo_id: "my-repo",
symbol: "UserRole",
intent_kind:{"Refactor": {"pattern": "RenameSymbol"}},
ttl_ms: 300000
})
Save r.intent_id — every subsequent step refers to it.
Inspect:
r.propagation_set — these nodes are implicated by your edit. Other agents on those nodes get a structural signal.r.active_conflicts — non-empty means another agent is already mid-flight on overlapping scope.Success criteria: you have an intent_id and you have looked at both propagation_set and active_conflicts.
r.active_conflicts | Action |
|---|---|
| Empty | Proceed to Step 4 |
| Non-empty | STOP. Branch to memfleet-conflict-resolution. Do not edit. |
Make your code changes through your normal harness loop (Edit / Write / Apply Patch). The protocol does not care how you edit — only that the structural before/after is captured in the next step.
record_episodemcp__memfleet__record_episode({
intent_id: r.intent_id,
diff_summary: {"Refactor": {"pattern": "RenameSymbol"}},
touched_nodes: ["UserRole", "UserRoleRepo.find"],
reference_time: "2026-04-18T09:30:00Z"
})
Required:
touched_nodes — every NodeIdentity your diff actually changed (not your propagation_set, not the planned set).diff_summary — the structural shape of the change as an IntentKind-compatible enum, not prose.reference_time — RFC3339. Used for LWW arbitration on Class B.Success criteria: the broker returns an episode_id and a conflict_class.
e.conflict_classconflict_class | Meaning | Action |
|---|---|---|
| A | Additive — pure new symbols, no removals or signature changes | Done. Auto-accepted. |
| B | Modification — body / type / rename collides with another in-flight edit | Read e.won. If false, you lost LWW; read e.replan_hint and re-edit on the new target. |
| C | Breaking — removes a live symbol or changes a signature with active callers | Blocked. Read e.conflict_report.cause. Branch to memfleet-conflict-resolution. |
| Situation | Action |
|---|---|
dominant_intent is your own from earlier this session | Skip Step 1 scout; proceed straight to Step 2 |
propagation_set is huge (hundreds of nodes) | Consider splitting the intent into multiple narrower ones |
active_conflicts payload mentions a blocker_agent | Coordinate out-of-band before re-attempting |
Class B won: true | The other agent's edit will replan onto your target |
Class B won: false and replan_hint.kind == ApplyToRenamedTarget | Re-edit on the new name; goto Step 5 with a fresh intent |
| Class C | Do not retry blindly. Narrow scope, coordinate, or escalate via resolve_conflict (Phase-2) |
| Mistake | Reality |
|---|---|
| Skipping Step 1 because "the symbol is quiet" | get_node_state is O(1) — the rollup is precomputed by record_episode. There is no cost to checking. |
Writing a prose diff_summary | Prose is what we are replacing. The enum variant IS the coordination signal. |
| Recording multiple episodes for one semantic edit | One episode = one structural change. Multiple records inflate conflict counts. |
Ignoring propagation_set after Step 2 | Those are the nodes other agents will see flagged. Cross-check that they make sense before editing. |
| Retrying on Class C | Class C means active callers will break. Editing forces the breakage. Resolve first. |
Using a Unix timestamp for reference_time | RFC3339 only. The broker arbitrates LWW on this exact field. |
Assuming silence after publish_intent means "no one cares" | The signal goes to NodeState rollups, not push notifications. Other agents see it on their next read. |
git detects textual conflicts after-the-fact at merge time. MemFleet detects structural conflicts at intent time, before the wasted edit happens. Both are needed — the Safe Edit Workflow is the upstream half.
This is a process skill — it runs ONCE per edit, BEFORE the implementation skills you would normally use. Pair with:
memfleet-firstmemfleet-conflict-resolutionmemfleet-fleet-coordinationmemfleet-publish-intent, memfleet-record-episodeWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
multi-agent, conflict-resolution, edit-workflow, coordination
npx claudepluginhub syncable-dev/memfleet-public --plugin memfleet-skills10 skills in this plugin
/memfleet-conflict-resolutionAlways use when publish_intent returned a non-empty active_conflicts list, or when record_episode classified the result as Class B (you may have lost LWW) or Class C (blocked). Triggered by: 'publish_intent returned conflicts', 'I got a Class B and lost', 'Class C blocker_agent', 'who is blocking my edit', deciding whether to retry, replan, or escalate. Do not retry blindly on Class B without reading replan_hint, do not edit through a Class C — it will break active callers — and do not invent a prose 'rationale'; structural conflicts get structural resolutions./memfleet-firstAlways use FIRST in any multi-agent session before reading code, planning a refactor, or making an edit on a repo with a registered MemFleet broker. Triggered by: 'I'm about to edit X', 'rename Y across the fleet', 'plan this refactor', joining a running fleet session, coordinating with other agents, prose hand-offs between agents. Do not write a prose rationale for an edit, do not grep for 'who else might be touching this', and do not skip publish_intent because 'it's just a small change'. Empty fleet_status is not permission to skip the protocol — it just means you're the first agent in this window. Skip ONLY for solo-agent sessions with no broker registered or for pure docs-only edits where coordination has zero value./memfleet-fleet-coordinationUse when orchestrating a multi-step fleet edit: large refactors that span many symbols, leader-driven work split across follower agents, or any plan where one agent declares the shape and others execute leaf changes. Triggered by: 'coordinate the fleet on this refactor', 'split this work', 'I'm the leader, watch the followers', 'spread these renames across agents', leader/follower patterns. Do not start the leader phase without first checking fleet_status; do not let followers free-claim leaves without a correlation tag — you will not be able to aggregate results. Skip this skill for single-agent edits and small (≤ 3 symbol) changes where the safe-edit loop alone is enough./memfleet-fleet-statusAlways use as the once-per-session opener and as the periodic dashboard refresh. Returns active intents, open subscriptions, episode counts, and conflict counts split by class. Triggered by: 'how busy is the fleet', 'are there open conflicts', 'is anyone working on this repo', pre-release coordination check, leader pre-flight before a coordinated wave, periodic ops dashboard. Do not skip this call before launching a multi-symbol refactor — high class-B/C counts mean the wave will collide. Do not use it as a per-symbol query; for that use get_node_state./memfleet-node-stateAlways use to read current coordination state for a symbol — recent episodes, active intents, dominant intent, conflict density, Y-doc thread. Triggered by: 'is anyone working on X', pre-edit reconnaissance, checking fleet activity on a symbol, reading another agent's recent work, debugging why a publish_intent returned a conflict. Do not grep the codebase to figure out 'who edited this last' — the broker has a precomputed O(1) rollup. Do not call get_node_state in a tight loop expecting push semantics; for streaming, use subscribe./memfleet-publish-intentAlways use BEFORE modifying any symbol in a multi-agent session to register structural intent and surface blast radius + active conflicts. Triggered by: about to refactor / rename / delete / modify code, planning an edit, checking if another agent is working on the same area, pre-edit coordination, leader-driven multi-symbol waves. Do not edit first and publish after — the whole point is to surface conflicts BEFORE the wasted edit. Do not pass intent_kind as a flat string; it is a typed enum with a JSON-object shape.Other plugins' skills for the same job