/memfleet-skills:memfleet-fleet-coordinationfrom memfleet-skills
Orchestrates multi-agent refactors using a leader/follower pattern: leader declares intents with a correlation tag, followers claim and edit leaves, leader aggregates results and handles retries.
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 leader/follower pattern for refactors that touch many symbols. The leader declares the coordinated set of intents with a shared correlation tag; followers subscribe, claim leaves off the propagation set, edit, and report back under the same tag. The leader aggregates results, retries Class B losers, and escalates Class C blockers.
This is the workflow for the cases where memfleet-safe-edit alone is not enough because no single agent is going to do all the work.
Designed for any harness that can hold an MCP session open across multiple tool calls (Claude Code, Codex, Copilot CLI). For one-shot harnesses without persistent sessions, the leader role can be played by fleet-cli invocations and the followers can be regular MCP-speaking agents.
| Situation | Use this skill? |
|---|---|
| Single-agent edit on 1–3 symbols | No — use memfleet-safe-edit |
| Single-agent edit on a large symbol set | Optional — leader-only pattern, no followers |
| Multi-agent refactor with shared scope | Yes — full leader/follower |
| Independent edits by parallel agents on disjoint scopes | No — each agent runs memfleet-safe-edit independently |
| Emergency hotfix coordinated across services | Yes — leader pins the correlation tag, followers gate on it |
1. fleet_status({ window_ms: 1_800_000 })
→ confirm the fleet is idle enough for a coordinated wave
2. For each planned symbol S in the refactor:
publish_intent(repo_id, S, intent_kind, ttl_ms,
correlation_tag = TAG)
3. Announce TAG on the shared channel
(or via a single "kickoff" record_episode with intent_kind = Exploratory
and a touched_nodes list naming every leaf)
4. subscribe(repo_id, { correlation_tag: TAG })
5. Loop on incoming notifications:
- On record_episode with class A → mark leaf done
- On record_episode with class B (won=false) → reissue intent for that leaf
- On record_episode with class C → ABORT the wave, call resolve_conflict
- On TTL expiry without an episode → reassign the leaf
1. subscribe(repo_id, { intent_kinds: [Refactor, FeatureAdd], modules: [<area>] })
2. On notification with correlation_tag == TAG:
- claim by calling publish_intent on the leaf symbol with the same TAG
- if claim succeeds (no active_conflicts) → memfleet-safe-edit on that leaf
- if claim fails → another follower beat you to it; skip
3. record_episode for each leaf with the same TAG
4. On any class C → STOP; let the leader handle the wave abort
Phase-1 has no native correlation_tag field. Encode it inside intent_kind's free-form surface until Phase-2 lands the typed field:
{"FeatureAdd": {"surface": {"NewField": "coord=01HXXXX"}}}
{"Refactor": {"pattern": {"RenameSymbol": "coord=01HXXXX"}}}
Use a fresh ULID per coordinated wave so leaders can disambiguate concurrent waves.
mcp__memfleet__fleet_status({ window_ms: 1_800_000 })
Inspect:
active_intents — if a class B/C storm is ongoing on your target modules, abort and reschedule.conflict_density per module — pick a window where the modules you will touch are below the team's threshold.Success criteria: the affected modules are quiet enough that the wave will not collide with unrelated work.
For each symbol in the planned set, call publish_intent with the correlation tag baked into the intent kind. Save every returned intent_id keyed by symbol — you will need them in Step 5 to match incoming episodes.
Either:
Exploratory episode with touched_nodes naming every leaf and the tag in the surface. Followers see it via subscribe or query_episodes.When a follower sees a notification matching the tag, it claims the leaf with its own publish_intent (under the same tag). If the broker returns active_conflicts, the leaf is already claimed — move on. Otherwise run memfleet-safe-edit on that leaf and record_episode with the tag.
Watch incoming episodes filtered by the tag. Match them back to the planned set; track A/B/C tallies; reassign on TTL expiry. The wave is done when every planned leaf has a class-A or class-B-won episode under the tag.
| Rail | Mechanism |
|---|---|
| Deadline | Attach a ULID-derived TTL to every coordinated intent_id. If the leader dies, followers time out on the TTL. |
| Poison | If any follower returns class C, the leader aborts the whole wave and calls resolve_conflict (Phase-2) rather than letting partial state land. |
| Idempotency | Each follower's record_episode uses the same intent_id it claimed with — replays are no-ops. |
| Leader liveness | Followers stop claiming new leaves if they have not seen a leader heartbeat (an episode with the tag, by the leader's agent_id) within 2 × heartbeat_period. |
subscribe push is stub in Phase-1. In practice today both leader and followers poll query_episodes with a since cursor, filtered by intent surface containing "coord=<tag>". Upgrade to real push subscriptions when Phase-2 lands.
| Mistake | Reality |
|---|---|
Leader skips fleet_status and just publishes the wave | A coordinated wave on top of an existing class-B storm produces an unresolvable mess. |
| Followers claim leaves without the correlation tag | The leader cannot match returned episodes back to the wave. Aggregation breaks. |
| Re-using a correlation tag across waves | Episodes from the prior wave bleed into the new one's aggregate. Always use a fresh ULID. |
Leader records the kickoff as a Refactor instead of Exploratory | Followers' classifier treats it as a real edit and may try to claim it as a leaf. Use Exploratory for kickoffs. |
| Followers continue after a class C | Class C means the wave's structural premise is broken. Stop and let the leader abort. |
| No TTL on coordinated intents | A dead leader leaves intents pinned forever; the broker has no way to know the wave is dead. |
Waiting for subscribe push in Phase-1 | Push is stub. Poll query_episodes with a cursor. |
| Situation | Action |
|---|---|
fleet_status shows the modules are hot | Reschedule or pick a different time window |
Follower's claim returns active_conflicts | Another follower won; skip the leaf, look for the next |
| Leader sees TTL expire without an episode | Reassign the leaf — issue a fresh publish_intent under the tag |
| Class B (won=false) on a coordinated leaf | Reissue the intent at the new target; do not abort the wave |
| Class C on any coordinated leaf | Abort the entire wave; do not let partial state land |
| Wave done, every leaf class A or B-won | Record one final Exploratory episode summarising counts; release any leftover intents |
This is an orchestration skill — it composes memfleet-safe-edit across many agents. Pair with:
memfleet-safe-editmemfleet-conflict-resolutionmemfleet-fleet-statusmemfleet-subscribememfleet-query-episodesWhat SKILL.md sets; muted values are Claude Code's defaults
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-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./memfleet-query-episodesAlways use to search episodes across a repository filtered by node, intent type, conflict class, time range, or agent. Triggered by: 'what changed this morning', 'who last touched the auth module', 'show me the conflict inbox', 'did anyone try X recently', polling for new fleet activity when no subscription is registered, post-incident retrospective. Do not use it for per-symbol activity (get_node_state is cheaper) or for fetching a single known episode (use get_episode). Polling with query_episodes is the FALLBACK when subscribe push is unavailable; in Phase-2, prefer subscribe.Other plugins' skills for the same job