agentleFS
jhonsfergjhonsferg/local-swarm-mcp/skills/local-swarm/SKILL.md

local-swarm

Skill1 starsChanged 28 days agoMITView on GitHub

Delegate mechanical, low-judgment work (boilerplate, log or diff summarization, formatting, repetitive transforms, first-draft docs) to local or self-hosted models through the local-swarm-mcp MCP server, to save the main model's tokens. Use when the local-swarm-mcp MCP tools (delegate_task, spawn_task, ...) are available and a task is mechanical enough that a smaller model can do it and the result is cheap to check; also when the user asks to "use the local model", "delegate", "offload", or "save tokens". Do not use for architecture decisions, security-sensitive work, or anything whose correctness can't be verified quickly.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. mazze93/claude-code-skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 5 are distinctive, and 6 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.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If nothing is healthy, fall back to doing the work yourself.

    line 28
  2. Very specific:

    Put the whole task in prompt, self-contained: it sees nothing of your conversation.

    line 60
  3. Very specific:

    Use temperature: 0 for transforms and extraction (it is honored, not dropped).

    line 63
  4. Very specific:

    Ask for one thing per call.

    line 66
  5. Distinctive:

    Treat delegated output like a junior's first draft:

    line 71
  6. Distinctive:

    Read it before using it. Check code compiles or tests pass, JSON parses, numbers and paths match the source.

    line 73
  7. Distinctive:

    If the output is wrong twice, stop delegating that task and do it yourself.

    line 78
  8. Distinctive:

    Don't treat that as data loss.

    line 95
  9. Very specific:

    Never put secrets, tokens, or .env contents in a prompt.

    line 99
  10. Very specific:

    Never call register_downstream_mcp_server (when offered at all) or register_backend_host unless the user asked for that specific server or …

    line 100
  11. Very specific:

    Never point spawn_agent_task at downstream servers with destructive tools unless the user explicitly wants that.

    line 103

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

Delegating to local models with local-swarm-mcp

local-swarm-mcp runs tasks on models the user hosts (Ollama, llama.cpp, vLLM, or any OpenAI-compatible endpoint). Those models are cheaper and weaker than you: delegate work that is mechanical and cheap to verify, and keep judgment for yourself. The server is a cost optimization, never a hard dependency - when it isn't usable, do the work yourself.

Tool names below are the bare MCP names. Each agent shows them with its own prefix for the server (e.g. mcp__local-swarm-mcp__delegate_task in Claude Code); match on the part after the server name.

1. Check availability first

  1. list_backends - the first entry is the default used when you omit backend. Empty list → no model is configured; skip delegation.
  2. health_check (optionally with backend) - confirms the endpoint answers right now. A discovered host that went offline drops out of list_backends on its next poll; list_backend_hosts shows up.
  3. If nothing is healthy, fall back to doing the work yourself. Don't retry in a loop or ask the user to start their GPU box unless they asked you to use the local model specifically.

2. Decide whether to delegate

Delegate when all of these hold:

  • The task is mechanical: transform, summarize, extract, reformat, generate boilerplate from a clear spec.
  • You can check the output faster than you could write it.
  • The input contains no secrets, credentials, or data the user wouldn't send to that backend (it may be a remote host - check base_url).

classify_task_risk is a fast keyword check (destructive git/DB operations, secrets, "architecture", "production", "security"). A risk=high result means do it yourself; risk=low is not a guarantee - still apply the rules above.

3. Pick the right tool

SituationTool
One short request, you need the answer nowdelegate_task
Long-running or several independent piecesspawn_task per piece, then wait_task (or task_status)
Iterative work where later turns need earlier contextcreate_session → send_message … → close_session
A large blob is filling your contextestimate_tokens, then compact_context with preserve_instructions
Stash a big intermediate result outside your contextscratch_set / scratch_get / scratch_list / scratch_delete
The model must call tools itself (e.g. query a code index)spawn_agent_task - see references/tools.md

Prompting a small model well:

  • Put the whole task in prompt, self-contained: it sees nothing of your conversation. Use system_prompt for the output contract ("Reply with only the JSON, no prose").
  • Use temperature: 0 for transforms and extraction (it is honored, not dropped); keep the default 0.2 for prose.
  • Set max_tokens to what the answer needs; the default is 1024.
  • Ask for one thing per call. Split big jobs into several spawn_tasks rather than one giant prompt.

4. Always verify the result

Treat delegated output like a junior's first draft:

  • Read it before using it. Check code compiles or tests pass, JSON parses, numbers and paths match the source.
  • For spawn_agent_task, read the transcript in the final task_status / wait_task result to see which tools it actually called; don't trust a claim the transcript doesn't support.
  • If the output is wrong twice, stop delegating that task and do it yourself.
  • Tell the user when a result came from the local model, if it matters to them.

5. Limits worth knowing

  • wait_task returns an error with a snapshot= of the task when its timeout_seconds (default 120) passes; the task keeps running - wait again or cancel_task it.
  • Finished tasks are dropped after an hour (at most 500 kept): fetch results you need promptly.
  • Sessions keep only their last 40 messages.
  • Requests queue when a backend host already has its maximum in flight (default 4), so many parallel spawn_tasks finish over time, not at once.
  • scratch_* may answer "held by another local-swarm-mcp process" when another session or the daemon owns the store; it retries on every call. Don't treat that as data loss.

Never

  • Never put secrets, tokens, or .env contents in a prompt.
  • Never call register_downstream_mcp_server (when offered at all) or register_backend_host unless the user asked for that specific server or host: both make this server run commands or send data somewhere new.
  • Never point spawn_agent_task at downstream servers with destructive tools unless the user explicitly wants that; restrict it with mcp_servers.

For per-tool parameters, model capability notes, and troubleshooting, see references/tools.md, references/models.md, and references/troubleshooting.md.

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.