Agent skill

Shadow Agent

by WrongStack in WrongStack/WrongStack

A skill your agent uses when you need a background monitoring agent that watches the fleet, detects anomalies, and can intervene on command.

MITAuto-check passed

Install Shadow Agent

skills CLI
$ npx skills add WrongStack/WrongStack --skill shadow-agent -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install WrongStack/WrongStack shadow-agent --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/WrongStack/WrongStack.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.wrongstack/skills/shadow-agent .claude/skills/shadow-agent && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
shadow-agent
GitHub stars
370
Token cost
~2.3k tokens
SKILL.md length
524 words
Files
1
Skills in repo
38
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when you need a background monitoring agent that watches the fleet, detects anomalies, and can intervene on command.

  • Works in 6 steps: Fleet Monitoring (every 30s by default) → Mailbox Surveillance → Spike Detection → …
  • You need a background monitoring agent that watches the fleet
  • SKILL.md covers Overview, Architecture, Core Responsibilities and Data Structures, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Shadow Agent is an agent skill from WrongStack/WrongStack. Use this skill when you need a background monitoring agent that watches the fleet, detects anomalies, and can intervene on command. Triggers: user says "shadow", "monitoring agent", "fleet watcher", "hoop command", "spike detection".

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: An AI coding agent that reads your code, edits files, runs commands, and reasons through bugs — across a terminal REPL, a full-screen TUI, and a browser UI, while you keep your… The licence is MIT.

When your agent uses it

  • You need a background monitoring agent that watches the fleet
  • Detects anomalies
  • Can intervene on command

Example prompts

  • “shadow”
  • “monitoring agent”
  • “fleet watcher”
  • “/shadow-agent”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Fleet Monitoring (every 30s by default)
  2. Mailbox Surveillance
  3. Spike Detection
  4. Deterministic Scheduling
  5. LLM Analysis
  6. Intervention Commands

What it can do on your machine

Read from SKILL.md and the folder at commit 57f6018. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Shadow Agent loads about 2.3k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 524 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from WrongStack/WrongStack at commit 57f6018, republished under its MIT licence (© WrongStack). 524 words, ~2,255 tokens.

Download SKILL.mdSave it as .claude/skills/shadow-agent/SKILL.md (or your agent's skills folder).
name
shadow-agent
description
Use this skill when you need a background monitoring agent that watches the fleet, detects anomalies, and can intervene on command. Triggers: user says "shadow", "monitoring agent", "fleet watcher", "hoop command", "spike detection".
version
1.0.0
required-capabilities
coordination.mailbox
required-tools
cron_schedule, mailbox, terminate_subagent
optional-capabilities
fleet.delegate, work.plan

Shadow Agent — Fleet Monitoring & Intervention

Overview

A deterministic background agent that monitors all agents in the fleet via scheduled heartbeat checks. Shadow Agents run silently, observe everything, and intervene only when explicitly commanded or when critical anomalies are detected.

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                     Shadow Agent                                 │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐ │
│  │ Heartbeat    │  │ FleetBus     │  │ Mailbox Monitor      │ │
│  │ Scheduler    │  │ Subscriber   │  │ (read/query/broadcast)│ │
│  │ (cron)       │  │             │  │                      │ │
│  └──────┬───────┘  └──────┬───────┘  └──────────┬───────────┘ │
│         │                  │                     │              │
│         └──────────────────┼─────────────────────┘              │
│                            ▼                                    │
│                   ┌─────────────────┐                          │
│                   │ LLM Analyzer    │ ← model: configured-model  │
│                   │ (pattern detect)│   setmodel to change       │
│                   └────────┬────────┘                          │
│                            │                                   │
│         ┌─────────────────┼─────────────────┐                │
│         ▼                 ▼                 ▼                │
│  ┌────────────┐   ┌──────────────┐   ┌──────────────┐        │
│  │ Intervention│   │ Report       │   │ Spike        │        │
│  │ Handler    │   │ Generator    │   │ Detector     │        │
│  │ (hoop/etc) │   │ (status)    │   │ (burst tasks)│        │
│  └────────────┘   └──────────────┘   └──────────────┘        │
└─────────────────────────────────────────────────────────────────┘
                            │
                            ▼
              ┌─────────────────────────────┐
              │ FleetBus + Mailbox + Cron    │
              │ (cross-terminal visibility) │
              └─────────────────────────────┘

Core Responsibilities

1. Fleet Monitoring (every 30s by default)
  • Subscribe to FleetBus for all subagent lifecycle events
  • Call fleet (action: status) + fleet (action: health) on each heartbeat
  • Track what each agent is currently doing (via task descriptions)
  • Detect stuck agents (>5 min no events), idle agents, crashed agents
2. Mailbox Surveillance
  • Monitor all mailbox messages (broadcast + direct)
  • Track message patterns: who is talking to whom, frequency
  • Detect orphan tasks (assign without result), stale asks
  • Cross-session awareness: see agents from other terminals
3. Spike Detection
  • Track task duration per agent type
  • Detect instant start/stop patterns (spike tasks)
  • Flag agents that spawn and die within seconds
  • Report efficiency anomalies
4. Deterministic Scheduling
  • Uses cron_schedule for fixed-interval heartbeats
  • Configurable interval: shadow_interval_ms (default 30000)
  • No randomness — same state always produces same actions
  • Clean startup/shutdown via cron cancel on teardown
5. LLM Analysis
  • Uses the configured model without a built-in model default
  • setmodel <model-id> changes the analysis model
  • Prompt-engineered for pattern detection
  • Minimal token usage — snapshot analysis only
6. Intervention Commands

Commands received via mailbox or direct invocation:

CommandAction
hoop <subagentId>Immediate terminate via terminate_subagent
hoop allTerminate all running subagents
shadow statusReport current fleet snapshot
shadow mutePause heartbeat monitoring
shadow resumeResume heartbeat monitoring
shadow interval <ms>Change heartbeat interval
shadow intervene <task>Assign a custom intervention task

Data Structures

ShadowState (persisted)
typescript
interface ShadowState {
  enabled: boolean;
  intervalMs: number;
  model: string;
  startTime: string; // ISO8601
  lastHeartbeat: string; // ISO8601
  knownAgents: Map<agentId, AgentSnapshot>;
  spikeHistory: SpikeEvent[];
  anomalyLog: Anomaly[];
}
AgentSnapshot
typescript
interface AgentSnapshot {
  agentId: string;
  sessionId: string;
  name: string;
  role: string;
  status: 'running' | 'idle' | 'stopped' | 'unknown';
  currentTask?: string;
  lastSeen: string;
  eventCount: number;
  startedAt: string;
}
SpikeEvent
typescript
interface SpikeEvent {
  agentId: string;
  spawnedAt: string;
  terminatedAt: string;
  durationMs: number;
  task?: string;
  reason?: string; // 'completed' | 'error' | 'killed' | 'timeout'
}
Anomaly
typescript
interface Anomaly {
  id: string;
  type: 'stuck_agent' | 'spike_task' | 'mailbox_loop' | 'budget_exhausted';
  severity: 'low' | 'medium' | 'high' | 'critical';
  agentId?: string;
  description: string;
  detectedAt: string;
  resolvedAt?: string;
}

Output Format

Status Report
## Shadow Agent Status — <timestamp>

**Fleet**: <N> agents tracked | <M> running | <K> idle | <L> stopped
**Heartbeat**: every <X>s | Last: <timestamp>
**Model**: <model-id>

### Active Agents
| Agent | Session | Role | Status | Task | Last Seen |
|-------|---------|------|--------|------|-----------|
| ... | ... | ... | ... | ... | ... |

### Recent Anomalies
- [HIGH] agent-xyz stuck for 5m — no events detected
- [MED] Spike: agent-abc ran for 3s then died

### Mailbox Summary
- Unread: <N> messages | Broadcasts: <M>
- Pending asks: <K> (oldest: <agent> <age>)
Intervention Log
## Shadow Intervention Log

| Time | Command | Target | Result |
|------|---------|--------|--------|
| 10:23:01 | hoop | subagent-xyz | terminated |
| 10:25:33 | hoop | all | 3 agents terminated |

Workflow

Startup
  1. Read persisted ShadowState (if exists)
  2. Subscribe to FleetBus (onAny handler for all events)
  3. Schedule heartbeat cron job at configured interval
  4. Send broadcast: shadow:started { intervalMs, model, startTime }
Show full SKILL.md (222 more words)Show less
Heartbeat (every intervalMs)
  1. Call fleet (action: status) + fleet (action: health)
  2. Compare against known agents — detect changes
  3. For each new agent: record snapshot, log "agent joined"
  4. For each missing agent: mark unknown, log "agent left"
  5. Analyze for anomalies (stuck, spike, loop)
  6. If anomaly detected AND auto_intervene enabled: act
  7. If anomaly detected AND auto_intervene disabled: report only
  8. Update ShadowState.lastHeartbeat
FleetBus Events
subagent.started  → record agent, log
subagent.stopped   → record termination, check for spike
subagent.error     → log error, flag anomaly
tool.executed      → increment eventCount for agent
task.assigned      → update currentTask for agent
task.completed     → clear currentTask, log duration
Mailbox Monitoring
On incoming message:
  - If type=control and body starts with "hoop": execute intervention
  - If type=ask with subject "shadow status": send full report
  - If type=broadcast: track in mailbox summary
  - If type=assign without result within 5min: flag orphan
Intervention (hoop)
  1. Parse target (single agent, "all", or pattern)
  2. Call terminate_subagent(target) for each
  3. Log intervention with timestamp
  4. Send result to mailbox (to=sender)
  5. If target="all": also cancel all pending cron jobs

Configuration

Config KeyTypeDefaultDescription
shadow_interval_msnumber30000Heartbeat interval in ms
shadow_modelstringsession modelAnalysis model
shadow_auto_intervenebooleanfalseAuto-act on anomalies
shadow_stuck_threshold_msnumber3000005min = stuck agent
shadow_spike_threshold_msnumber50005s = spike task

Skills in scope

  • fleet-management — uses fleet (action: status), fleet (action: health), terminate_subagent
  • mailbox — uses mailbox tools for monitoring and intervention
  • cron — uses cron_schedule for deterministic heartbeats
  • multi-agent — for spawning analysis subagents when needed
  • observability — for structured logging of anomalies

Anti-Patterns

  • No randomness: Deterministic — same input → same output
  • No blocking: Heartbeats are async, never block agent loop
  • No loud logging: Uses DEBUG level unless anomaly
  • No direct tool calls: Uses FleetBus subscription, not polling
  • Minimal footprint: Shadow state is small, persisted efficiently

© WrongStack, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .wrongstack/skills/shadow-agent of WrongStack/WrongStack.

Open the folder on GitHubat commit 57f6018

Compare with similar skills

Shadow Agent next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Shadow Agent compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Shadow Agent this skillWrongStack/WrongStack370—~2.3kAutomated safety check: PassMIT
Python Background Jobswshobson/agents40k—~1.8kAutomated safety check: PassMIT
Backgroundjeremylongshore/tons-of-skills-marketplace2.8k—~2.2kAutomated safety check: PassMIT
Canary Watchaffaan-m/ECC275k1 repos~770Automated safety check: PassMIT
Canary Watchaffaan-m/ECC275k—~405Automated safety check: PassMIT
Canary Watchaffaan-m/ECC275k—~414Automated safety check: PassMIT

Similar skills

  • Python Background Jobs

    wshobson/agents

    Python background job patterns including task queues, workers, and event-driven architecture.

    40k GitHub stars~1.8k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Background

    jeremylongshore/tons-of-skills-marketplace

    A skill your agent uses when the user wants to see, inspect, cancel, or prune background agents fired during prior chain runs.

    2.8k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Canary Watch

    affaan-m/ECC

    A skill your agent uses to monitor and verify a deployed URL after releases — checks HTTP endpoints, SSE streams, static assets, console errors, and performance regressions after deploys, merges, or…

    275k GitHub starsUsed in 1 repo~770 tokens
    DevOps & CloudAuto-check passed
  • Canary Watch

    affaan-m/ECC

    このスキルを使用して、デプロイメント、マージ、または依存関係アップグレード後にデプロイされたURLの回帰を監視します. An agent skill from affaan-m/ECC.

    275k GitHub stars~405 tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Canary Watch

    affaan-m/ECC

    使用此技能在部署、合并或依赖升级后监控已部署的URL是否存在回归问题。

    275k GitHub stars~414 tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Background Watch Hook

    avibe-bot/avibe

    Use vibe watch to run a managed Harness waiter that returns to the same conversation later.

    620 GitHub stars~7.7k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from WrongStack/WrongStack

All 38 skills in this repo
  • Design Craft

    WrongStack/WrongStack

    Design or substantially improve user-facing interfaces with a product-specific visual direction, content hierarchy, and rendered critique.

    370 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Design Critique

    WrongStack/WrongStack

    A skill your agent uses to audit an interface that already exists and say precisely why it looks generated, templated, or unfinished — a scored rubric across composition, typography, color, states…

    370 GitHub stars~3k tokensUpdated yesterday
    Auto-check passed
  • Mailbox Bridge

    WrongStack/WrongStack

    A skill your agent uses when external coding agents (Claude Code, Aider, custom scripts) need to participate in the project's shared WrongStack mailbox, or when a user asks to "expose the mailbox"…

    370 GitHub stars~3.9k tokensUpdated yesterday
    Auto-check passed
  • Multi Agent

    WrongStack/WrongStack

    A skill your agent uses whenever work can be split across multiple AI agents running in parallel, or when orchestrating leader/worker patterns in WrongStack.

    370 GitHub stars~3.6k tokensUpdated yesterday
    Auto-check passed
  • Web Platform Baseline

    WrongStack/WrongStack

    Use this skill before asserting that a CSS, HTML or accessibility capability is available, unavailable, or the right tool — it carries dated, refreshable platform facts and refuses to let stale…

    370 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Wrongstack Mailbox

    WrongStack/WrongStack

    A skill your agent uses when the user wants to communicate with WrongStack's shared project mailbox from outside WrongStack — read messages sent by WrongStack agents, send replies, broadcast to all…

    370 GitHub stars~3.5k tokensUpdated yesterday
    Auto-check passed

Questions about Shadow Agent

What does Shadow Agent do?

A skill your agent uses when you need a background monitoring agent that watches the fleet, detects anomalies, and can intervene on command. Shadow Agent is an agent skill from WrongStack/WrongStack. Use this skill when you need a background monitoring agent that watches the fleet, detects anomalies, and can intervene on command.

When should I use Shadow Agent?

Shadow Agent fits situations like: you need a background monitoring agent that watches the fleet; detects anomalies; can intervene on command.

How do I install Shadow Agent in Claude Code?

Run `npx skills add WrongStack/WrongStack --skill shadow-agent -a claude-code`. Or copy the skill folder (.wrongstack/skills/shadow-agent in WrongStack/WrongStack) into .claude/skills/shadow-agent in your project. Claude Code loads it when a task matches its description.

How do I install Shadow Agent in Codex?

Run `npx skills add WrongStack/WrongStack --skill shadow-agent -a codex`. Or copy the skill folder (.wrongstack/skills/shadow-agent in WrongStack/WrongStack) into .agents/skills/shadow-agent in your project. Codex loads it when a task matches its description.

Can I use Shadow Agent in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add WrongStack/WrongStack --skill shadow-agent -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/shadow-agent, .gemini/skills/shadow-agent, .github/skills/shadow-agent and .opencode/skills/shadow-agent in your project.

What does Shadow Agent need to run?

SKILL.md names no scripts, command-line tools or credentials: Shadow Agent is instructions for the agent only.

Does Shadow Agent access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Shadow Agent safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Shadow Agent use?

Shadow Agent is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Shadow Agent use?

About 2.3k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Shadow Agent?

Skills that share tags, products or a category with Shadow Agent: Python Background Jobs (wshobson/agents, 40k stars), Background (jeremylongshore/tons-of-skills-marketplace, 2.8k stars), Canary Watch (affaan-m/ECC, 275k stars) and Canary Watch (affaan-m/ECC, 275k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Shadow Agent?

WrongStack (a GitHub organization) maintains it in WrongStack/WrongStack, which has 370 GitHub stars. The repository holds 38 skills in this directory. The repository was last updated on October 7, 2026.

Source: WrongStack/WrongStack on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.