Skip to content
Back to skills

Legion

ASecurity

Select optimal subagent topology (hierarchical, mesh, ring, star) based on task structure; adds Ruflo-style swarm intelligence to Superpowers

  • 68 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
ai-agentsdebuggingsecurity

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add GadaaLabs/claude-code-on-steroids --skill legion --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Legion?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Legion
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gadaalabs-legion/badge)](https://www.skillsdirectory.com/skills/gadaalabs-legion)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: legion
description: Select optimal subagent topology (hierarchical, mesh, ring, star) based on task structure; adds Ruflo-style swarm intelligence to Superpowers
type: process
---

# Swarm Coordination

## Overview

**LEGION** — *A legion is a large, coordinated force organized into precise, independent units.*
When invoked: selects the optimal agent topology for the task — parallel (independent tasks), pipeline (sequential stages), hierarchical (orchestrator + specialists), or mesh (peer review) — and coordinates execution across all agents.

**Core principle:** Match agent topology to task structure — the right coordination pattern prevents chaos and maximizes parallelism.

**Announce at start:** "Running LEGION to select agent topology and coordinate."

## Topology Selection

Independent tasks, no coordination needed → **STAR** (see `patterns/star.md`)
Sequential stages, each transforms previous output → **RING** (see `patterns/ring.md`)
Exploration, multiple hypotheses, no clear structure → **MESH** (see `patterns/mesh.md`)
Plan execution, coordinator + specialists → **HIERARCHICAL** (see `patterns/hierarchical.md`)

Load the matching pattern file for full prompt templates and examples.

## Quick Reference

| Topology | Parallelism | Best For |
|----------|-------------|----------|
| Hierarchical | Moderate | Plan execution, structured tasks |
| Mesh | High | Exploration, research, bug investigation |
| Ring | Low (sequential) | Data pipelines, multi-stage transforms |
| Star | Very High | Independent parallel work, batch processing |

## Swarm Size Guidelines

| Task Complexity | Swarm Size | Topology |
|-----------------|------------|----------|
| Single file edit | 1 agent | N/A (no swarm) |
| 2-5 files | 2-3 agents | Hierarchical |
| 5-10 files | 3-5 agents | Hierarchical or Star |
| Multi-module | 5-7 agents | Hierarchical-Mesh |
| System-wide | 7-15 agents | Adaptive with phases |

>10 agents: coordination overhead exceeds parallelism benefit. >15 agents: decompose into separate projects.

## Hybrid: Hierarchical-Mesh (Adaptive)

Complex projects with both exploration and execution:

```
PHASE 1: Exploration (Mesh) — explore angles, synthesize requirements
PHASE 2: Planning (Hierarchical) — coordinator writes plan, decomposes tasks
PHASE 3: Execution (Hierarchical) — workers execute, coordinator reviews
PHASE 4: Integration (Mesh) — collective debugging and integration
```

## Consensus for Disagreement Resolution

**Majority:** 3 agents agree A, 2 agree B → proceed with A, document dissent.
**Weighted:** Security decision → security-architect vote 3x weight.
**Byzantine:** f < n/3 faulty agents. With 4 agents: tolerate 1 faulty opinion. If no majority → escalate to human.

## Swarm Auto-Triggering

Auto-trigger when ALL of:
1. Task touches 3+ independent files
2. No sequential dependency between changes
3. Total estimated work > 20 minutes single-threaded

**Auto-trigger announcement:**
```
DETECTING: This task touches N independent files with no cross-dependencies.
AUTO-TRIGGERING: <topology> swarm (N spokes/workers)
Topology rationale: [reason]
```

Do NOT auto-trigger for: bug fixes (investigate first), tasks < 3 files, shared state changes.

## Integration with Existing Skills

| Skill | Integration |
|-------|-------------|
| `phantom` | Hierarchical topology by default |
| `architect` | Mesh topology for exploration phase |
| `hunter` | Mesh topology for multi-angle investigation |
| `blueprint` | Plan should specify recommended topology |
| `tribunal` | Star topology for parallel file review |

## Red Flags

**Never:**
- Use Ring when tasks are independent (waste of parallelism)
- Use Mesh for implementation (no coordination = chaos)
- Use Hierarchical for exploration (coordinator bottlenecks creativity)
- Use Star when subtasks have dependencies (integration fails)
- Deploy >10 agents without clear coordination plan

## Final Rule

```
Topology determines success — match structure to task
Hierarchical for execution | Mesh for exploration
Ring for pipelines | Star for parallel work
```

Files in this skill

  • SKILL.md4 KB
  • patterns/hierarchical.md1.5 KB
  • patterns/mesh.md1.4 KB
  • patterns/ring.md1.6 KB
  • patterns/star.md1.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.