agentleFS
salmandevsalmandev/everything-gemini/skills/ephemeral-swarm-orchestrator/SKILL.md

ephemeral-swarm-orchestrator

Skill2 starsChanged 29 days agoApache-2.0View on GitHub

Dynamically synthesizes, deploys, and reclaims ephemeral multi-agent swarms for cross-repository parallel refactoring and consensus aggregation.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When multiple micro-agents generate speculative patches or architectural proposals, the swarm coordinator invokes a multi-agent voting …

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Ephemeral Swarm Orchestrator (Swarm Intelligence)

Implements dynamic on-demand synthesis, parallel task decomposition, distributed cross-repository execution, consensus aggregation, and lifecycle reclamation of ephemeral micro-agent swarms for Google Gemini and Antigravity.


1. Architecture: Dynamic Ephemeral Micro-Agent Swarm

┌─────────────────────────────────────────────────────────────────────────────┐
│                   EPHEMERAL SWARM ORCHESTRATION PIPELINE                    │
│                                                                             │
│   ┌─────────────────────────────────────────────────────────────────────┐   │
│   │ 1. Swarm Coordinator & Planner Decomposition                        │   │
│   │    • Complex multi-repo goal or massive refactor prompt              │   │
│   │    • Decomposed into DAG of atomic micro-tasks with input contracts  │   │
│   └──────────────────────────────────┬──────────────────────────────────┘   │
│                                      │                                      │
│                                      ▼                                      │
│   ┌─────────────────────────────────────────────────────────────────────┐   │
│   │ 2. Dynamic Ephemeral Specialist Synthesis                           │   │
│   │    • Synthesizes targeted micro-agent definitions in memory          │   │
│   │    • E.g. `spanner-deadlock-tuner`, `grpc-schema-validator`          │   │
│   │    • Mounts minimal progressive skills & scoped tool permissions    │   │
│   └──────────────────────────────────┬──────────────────────────────────┘   │
│                                      │                                      │
│                                      ▼                                      │
│   ┌─────────────────────────────────────────────────────────────────────┐   │
│   │ 3. Parallel Worker Swarm Execution (Pub/Sub & Cloud Run Jobs)       │   │
│   │    ┌──────────────────┐  ┌──────────────────┐  ┌──────────────────┐ │   │
│   │    │ Worker #1 (RepoA)│  │ Worker #2 (RepoB)│  │ Worker #3 (Infra)│ │   │
│   │    └────────┬─────────┘  └────────┬─────────┘  └────────┬─────────┘ │   │
│   └─────────────┼─────────────────────┼─────────────────────┼───────────┘   │
│                 └─────────────────────┼─────────────────────┘               │
│                                       ▼                                     │
│   ┌─────────────────────────────────────────────────────────────────────┐   │
│   │ 4. Majority Consensus & Multi-Agent Voting                          │   │
│   │    • Aggregates diff proposals across parallel micro-agents         │   │
│   │    • Conflict resolution via Byzantine/majority agreement matrix   │   │
│   └──────────────────────────────────┬──────────────────────────────────┘   │
│                                      │                                      │
│                                      ▼                                      │
│   ┌─────────────────────────────────────────────────────────────────────┐   │
│   │ 5. Ephemeral Harness Teardown & Lifecycle Reclamation               │   │
│   │    • Verifies property-based unit & integration tests               │   │
│   │    • Distills learned instincts into persistent memory              │   │
│   │    • Decommissions worker contexts and purges memory state          │   │
│   └─────────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────────┘

2. Core Operational Pillars

A. Dynamic Specialist Synthesis

Traditional multi-agent frameworks rely on rigid, static subagent registries. The Ephemeral Swarm Orchestrator dynamically constructs targeted agent personalities and tool contracts based on task requirements:

{
  "swarm_id": "swarm-20261022-spanner-sync",
  "coordinator": "swarm-coordinator",
  "topology": "hierarchical",
  "workers": [
    {
      "id": "worker-schema-evaluator",
      "specialization": "spanner-ddl-auditor",
      "scoped_skills": ["spanner-change-streams", "security-audit"],
      "permitted_tools": ["view_file", "grep_search", "run_command"],
      "token_budget": 8000
    },
    {
      "id": "worker-migration-author",
      "specialization": "liquibase-migration-writer",
      "scoped_skills": ["database-migrator", "tdd-workflow"],
      "permitted_tools": ["write_to_file", "replace_file_content", "run_command"],
      "token_budget": 12000
    }
  ]
}

B. Consensus & Voting Protocol

When multiple micro-agents generate speculative patches or architectural proposals, the swarm coordinator invokes a multi-agent voting round:

  1. P2P Cross-Verification: Worker 1 reviews Worker 2's AST patch.
  2. Deterministic Test Execution: Candidate diffs are executed against property-based tests in isolated ephemeral directories.
  3. Quorum Verification: A change requires $\ge 67%$ consensus agreement before promotion into the primary branch.

C. Resource Reclamation & Zero Leaks

Upon completion or failure, the swarm executor executes cleanup routines:

  • Terminates background worker processes and subprocess handles.
  • Deletes scratch directories and temporary SQLite / DuckDB scratchpads.
  • Commits learned operational invariants into .agents/hooks/learned-instincts/.

3. CLI Commands

# 1. Spawn an ephemeral swarm with 3 parallel workers
everything-gemini swarm spawn "refactor auth middleware to zero-trust mTLS" --workers 3

# 2. Inspect active swarm topology and worker state
everything-gemini swarm status --json

# 3. Force teardown and reclaim all active worker resources
everything-gemini swarm reclaim --dry-run

4. Anti-Patterns & Safety Guardrails

Anti-PatternOperational RiskSwarm Enforced Fix
Unbounded Worker SpawningExponential token burn and process fork bombHard worker ceiling (--max-workers 8) enforced by budget-guard.
Shared State CollisionsMerge conflicts and dirty git tree statesEach worker operates in an isolated temporary worktree with git rollback snapshots.
Zombie SubagentsOrphaned background processes leaking memoryMandatory timeout watchdog (--timeout-sec 300) with auto-reclamation.
Single-Agent BiasHallucinated code passes without reviewTwo-agent peer verification required on all synthesized diffs.

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.