swarm-ai-research/swarm/run-scenario

Claude Code and agent skill by swarm-ai-research/swarm

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Execute a SWARM simulation scenario and export standardized artifacts

Install

npx vskill@latest install swarm-ai-research/swarm/run-scenario

SKILL.md

The same SKILL.md was published earlier as swarm-ai-research/swarm/run-scenario.

Run Scenario Skill

Execute a single SWARM scenario with a given seed and export all artifacts to a standardized output directory.

Prerequisites

  • swarm-safety package installed (pip install swarm-safety or pip install -e /root/swarm-package/)
  • Scenario YAML file available (typically in /root/scenarios/)

Procedure

1. Resolve the scenario path

Scenario references can be shorthand or full paths:

  • baseline → scenarios/baseline.yaml
  • scenarios/baseline.yaml → use as-is
  • /root/scenarios/baseline.yaml → use as-is
python
import os
def resolve_scenario(ref: str) -> str:
"""Resolve a scenario reference to a full path."""
candidates = [
ref,
f"scenarios/{ref}.yaml",
f"/root/scenarios/{ref}.yaml",
f"scenarios/{ref}",
]
for c in candidates:
if os.path.isfile(c):
return c
raise FileNotFoundError(f"Cannot find scenario: {ref}")
2. Run the simulation

Use the SWARM CLI to execute:

bash
python -m swarm run <scenario_path> --seed <seed> --epochs <N> --steps <M>

Or programmatically:

python
from swarm.core.orchestrator import Orchestrator
from swarm.scenarios.loader import load_scenario
config = load_scenario(scenario_path)
# Override simulation parameters if needed
config["simulation"]["seed"] = seed
config["simulation"]["n_epochs"] = epochs
config["simulation"]["steps_per_epoch"] = steps
orch = Orchestrator(config)
result = orch.run()
3. Export artifacts

After the run completes, export to the output directory:

python
import json
import os
os.makedirs(output_dir, exist_ok=True)
# Export history.json
with open(os.path.join(output_dir, "history.json"), "w") as f:
json.dump(result.to_dict(), f, indent=2)
# Export CSV metrics
csv_dir = os.path.join(output_dir, "csv")
os.makedirs(csv_dir, exist_ok=True)
result.export_csv(csv_dir)
4. Extract key metrics

The final epoch snapshot contains summary metrics:

python
history = result.to_dict()
final = history["epoch_snapshots"][-1]
welfare = final["welfare"]
toxicity = final["toxicity_rate"]
print(f"Final welfare: {welfare:.3f}")
print(f"Final toxicity: {toxicity:.3f}")

Output Structure

<output_dir>/
├── history.json # Full simulation history
└── csv/
├── epoch_metrics.csv # Per-epoch aggregate metrics
└── agent_metrics.csv # Per-agent per-epoch metrics

Common Issues

  • ImportError: Ensure swarm-safety is installed with runtime deps: pip install swarm-safety[runtime]
  • FileNotFoundError for scenario: Check /root/scenarios/ for available YAMLs
  • Reproducibility: Same seed + same scenario YAML = identical results

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/swarm-ai-research/swarm/run-scenario/badge)](https://verified-skill.com/skills/swarm-ai-research/swarm/run-scenario)

Something wrong with this skill or its page? Tell us.