lain-coordination
Skill9 starsChanged 2 months agoMITView on GitHub
Use when working alongside other agents with Lain — "claim these files", "who else is here", "will we collide", "leave a note for the next agent", "what happened while I was away". Covers the session, social, and notes packages.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- lain-architectureSkill
- lain-comprehensionSkill
- lain-federationSkill
- lain-verifySkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Before editing: detect_overlap on the files/symbols you will touch — if a peer holds them, coordinate first.
- Distinctive: line 58
Keep TTLs short and heartbeats honest.
- Distinctive: line 60
Never claim files "just in case" — claim when you are about to edit.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Lain coordination — work beside other agents
Multiplayer plumbing is hidden from the default surface because
hooks usually drive it — hooks/<agent>/ scripts call
claim_files / heartbeat / release_files directly. Tools are
callable by name even when hidden, but load_package makes them
appear in tools/list; many MCP clients only permit tools their
cached list contains. Load these packages only when you are
managing the coordination yourself.
Load them
load_package("session") for claiming, load_package("social")
for the roster, load_package("notes") for handoffs — or set
LAIN_TOOL_PROFILE=session,social,notes at config time for a
coordinator agent. Reconnect the client if the tools do not appear.
Claim discipline (session)
register_agentonce (name yourself meaningfully).- Before editing:
detect_overlapon the files/symbols you will touch — if a peer holds them, coordinate first. claim_fileswith an intent and a TTL you can honour; refresh withheartbeat;release_filesthe moment you are done.my_claims/list_occupancy/get_world_stateanswer "who holds what" at any moment.
Awareness (social)
list_active_agents (who is here), who_am_i (what the server
thinks you are), list_subagents, get_audit_log (recent
coordination events in this workspace), unregister_agent on exit.
Handoffs (notes)
leave_handoff_note when your work continues elsewhere — say what
you changed and what you did NOT do. get_pending_handoffs when you
start. lain_intent / list_active_intents for the plan board;
add_annotation / list_annotations / resolve_annotation for
notes pinned to code.
Example payloads (copy verbatim, fill in values):
add_annotation → target={"kind":"symbol","symbol":"MyFn","repo_id":"..."},
kind="note", body="..."
leave_handoff_note → body="[scope:auth] did X; Y still open", scope="auth"Rules of thumb
- Claims are advisory coordination, not locks — still re-check before you write.
- Keep TTLs short and heartbeats honest; an expired claim drops (by design) and a stale one is worse than none.
- Never claim files "just in case" — claim when you are about to edit.
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.

