---
name: raid
version: 2.0.0
description: "Use when facing any task with 3+ concerns, cross-domain complexity, or ambiguous scope — orchestrates the full R.A.I.D intelligence stack across all sub-skills with a Mission Brief before acting."
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch, Task, Skill
license: Proprietary
compatibility: [Claude Code, Copilot CLI, Gemini CLI, OpenCode, RAID Daemon]
metadata: {"author": "EmcodeTech", "category": "core", "tier": "bundled", "registry": "emcode-marketplace", "tags": ["orchestrator", "multi-agent", "mission-brief"]}
---

# R.A.I.D 🤖

> Orchestrate. Brief. Execute. Evolve.

**REQUIRED SUB-SKILLS:** `memory-wiki` (session start/end) · `self-evolution` (adaptive checkpoint)

Runtime-specific overlays live in `skills/raid/overlays/` for OpenClaw, Hermes, Claude Code, and Copilot.

---

## When to Orchestrate

```dot
digraph orchestrate {
    "Task received" [shape=doublecircle];
    "Single concern?" [shape=diamond];
    "Unknown domain?" [shape=diamond];
    "High-stakes?" [shape=diamond];
    "Use sub-skill directly" [shape=box];
    "Full orchestration" [shape=box];
    "web-intelligence first" [shape=box];
    "council-of-minds first" [shape=box];

    "Task received" -> "Single concern?";
    "Single concern?" -> "Use sub-skill directly" [label="yes"];
    "Single concern?" -> "Unknown domain?" [label="no"];
    "Unknown domain?" -> "web-intelligence first" [label="yes"];
    "Unknown domain?" -> "High-stakes?" [label="no"];
    "High-stakes?" -> "council-of-minds first" [label="yes"];
    "High-stakes?" -> "Full orchestration" [label="no"];
    "web-intelligence first" -> "Full orchestration";
    "council-of-minds first" -> "Full orchestration";
}
```

---

## Execution Phases

### 0. Restore Context (always)
```
Skill("memory-wiki") → session start protocol
```

### 1. Intelligence Gathering (parallel)
```
Task agents (all parallel):
  knowledge-nexus  → rag-cli query knowledge_base + shared_memory
  code-oracle      → Sourcegraph context (if code involved)
  web-intelligence → OSINT (if external knowledge needed)
```

### 2. Mission Brief (before any action)

```markdown
## Mission Brief
**Objective**: [what we're achieving]
**Intel**: [key findings from step 1]
**Approach**: [strategy + sub-skills to invoke]
**Risks**: [what could go wrong]
**Council needed**: [yes/no — why]
```

### 3. Execute
Invoke sub-skills in sequence or parallel per the brief.

### 4. Security & Code Review Gate (mandatory for code tasks)

**This phase is NON-NEGOTIABLE for any task that produces code changes.**

```
IF task produced code changes:
  4a. Dispatch Code Reviewer agent (background)
      → Task("code-review") with git diff context
  4b. IF security-sensitive files changed:
      → Dispatch Security Engineer agent (background)
  4c. Wait for both to complete
  4d. Apply Critical + Important findings BEFORE commit
  4e. Pre-commit checklist:
      □ Code review complete — findings addressed
      □ Security review complete (if applicable) — findings addressed
      □ No secrets/credentials in diff (grep for API keys, tokens, passwords)
      □ Tests pass (if test suite exists)
      □ Dependencies clean — CVE check via: npm audit | pip-audit | govulncheck | trivy fs .
  4f. ONLY THEN → git commit
```

**Security-sensitive = any file matching patterns defined in `using-raid` skill** (auth, secrets, API, containers, CI/CD, IaC, dependencies, migrations — see full canonical list there)

### 5. Self-Evolution Gate (mandatory when due)
```
IF self-evolution trigger is due (on-demand, high-impact/long work, or 12h heartbeat):
  Skill("self-evolution")
  Ensure cycle report lists Phase 1-8 statuses and always includes Phase 6
```

---

## Sub-Skill Routing

| Task Type | Skills |
|-----------|--------|
| Session start | memory-wiki, proactive-agent |
| Research/OSINT | web-intelligence → knowledge-nexus |
| Code work | code-oracle → knowledge-nexus |
| Architecture | council-of-minds → code-oracle |
| Security | web-intelligence → council-of-minds |
| Learning/memory | hermes-loop |
| Complex multi-agent | swarm-orchestration |
| Branch completion / PR | finishing-a-development-branch |
| Code review dispatch | requesting-code-review |
| Review feedback received | receiving-code-review |
| Feature isolation | using-git-worktrees |
| Skill authoring / editing | writing-skills |
| **New feature / product idea** | **brainstorming — ALWAYS before building anything** |
| **Have requirements, need plan** | **writing-plans — TDD plan before touching code** |
| **Execute plan (same session)** | **subagent-driven-development — fresh subagent per task + 2-stage review** |
| **Execute plan (parallel session)** | **executing-plans — batch execution with checkpoints** |
| UI / design / visual work | impeccable |
| Individual TDD task | test-driven-development |
| **Code task completed** | **requesting-code-review + Security Engineer (MANDATORY)** |
| **Pre-commit** | **code-review verified + security verified + tests pass** |
| Task checkpoint | self-evolution (when trigger is due: on-demand, high-impact/long, or 12h heartbeat) |

---

## Swarm Orchestration

For tasks requiring 3+ agents or multi-phase execution, R.A.I.D activates `swarm-orchestration`:

```
Topology selection:
  • 1 domain                  → hierarchical
  • 3+ domains / complex      → hierarchical-mesh  (default)
  • Irreversible decision      → council-of-minds first

MoE Router: auto-routes subtasks to domain specialists
SONA loop: beginTask → recordStep per phase → completeTask
Background workers: audit, map, optimize run between phases
```

**How to trigger:**
```
Skill("swarm-orchestration") → define workflow → execute
```

For single-domain tasks, swarm overhead is skipped — direct agent routing via agency-arm.

---

## Communication Style

- `🔍` research findings · `⚙️` actions · `🧠` insights · `✅` completions
- Lead with Mission Brief for complex tasks
- Synthesize across sources — never single-source
- When self-evolution runs, include a phase-status summary (Phase 1-8 with explicit Phase 6 status)

---

## Red Flags

| Pattern | Problem |
|---------|---------|
| No Mission Brief on complex task | Operating without a plan |
| Answering from memory alone | knowledge-nexus exists |
| Skipping self-evolution when trigger is due | Breaks improvement cycle |
| Unilateral architecture decision | council-of-minds required |
| Code without code-oracle | Missing company context |
| **Committing without code review** | **Breaks quality gate — NEVER skip** |
| **Committing security-sensitive code without security review** | **Breaks security gate — NEVER skip** |
| **"Small change, no review needed"** | **Every change gets reviewed. No exceptions.** |
| **Self-reviewing own code** | **Self-review is NOT review. Dispatch an agent.** |
