Borrowing it
Nothing to install: this file belongs to swarm-ai-research/swarm. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/swarm-ai-research/swarm/main/.claude/commands/add_domain.mdgit clone --depth 1 https://github.com/swarm-ai-research/swarmWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/swarm-ai-research/swarm/add_domain)<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/add_domain"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/add_domain/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/add_domain"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/add_domain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00803 |
| Opus 5 | $0.00000 | $0.00402 |
| Sonnet 5 | $0.00000 | $0.00161 |
| Haiku 4.5 | $0.00000 | $0.00080 |
Grade A, and why
add_domain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add Domain
Scaffold a new SWARM simulation domain — data models, action types, task handler, agents, metrics, tests, and registry wiring — when adding a fundamentally new task category (e.g. medical triage, code review) whose observables or agent actions don't yet exist in swarm/models/ or swarm/agents/. Use /add_scenario instead for a new parameter config using existing domain infrastructure; use /add_metric instead for a new measurement on existing data.
Pattern Overview
Adding a new domain requires these components:
-
Data Models (
swarm/models/<domain>.py)- Domain-specific dataclasses (e.g., Passage, Citation, Query)
- ActionResult subclass with domain observables
- Serialization methods (to_dict, from_dict)
-
Action Types (
swarm/agents/base.py)- Add new ActionType enum values for domain actions
- Add observation fields to Observation dataclass
-
Handler (
swarm/core/<domain>_handler.py)- Subclass Handler with domain config
- Implement handle_action() dispatch
- Implement build_observation_fields() for agent visibility
- Add epoch hooks (on_epoch_start, on_epoch_end)
-
Agents (
swarm/agents/<domain>_agent.py)- Base agent with shared domain logic
- Role-specific agents (retriever, synthesizer, verifier, etc.)
- Adversarial variants with attack strategies
-
Event Types (
swarm/models/events.py)- Add EventType enum values for domain events
-
Metrics (
swarm/metrics/<domain>_metrics.py)- Domain-specific metric functions
- Summary function returning metric dict
-
Orchestrator Integration (
swarm/core/orchestrator.py)- Add config field to OrchestratorConfig
- Initialize handler in init
- Add action dispatch cases
- Wire observation fields
- Call epoch hooks
-
Scenario Loader (
swarm/scenarios/loader.py)- Import new agent classes
- Add to AGENT_TYPES dict
- Add config parser function
-
Tests (
tests/test_<domain>.py)- Data model tests
- Handler action dispatch tests
- Agent behavior tests
- Metric computation tests
- Integration tests with orchestrator
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 89 lines · 0 tokens per session scan A 2ee5eddef301
add_domain is a command published in the GitHub repository swarm-ai-research/swarm (42 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 803 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
story-long-scan
A command for scanning long-form online fiction rankings on platforms such as Qidian, Fanqie, and Jinjiang, then analyzing the ranking data.
story-short-scan
A tool for scanning and analysing popular short web-fiction rankings on platforms such as Zhihu Yanyan and Fanqie Short Stories.
eval-merge
Use the Read tool to load .skill-compass/{skill-name}/manifest.json. Verify.
speckit.git.validate
Validate current branch follows feature branch naming conventions.
reflect
Curate and compress recent memory. This command reviews the last 7 days of journal entries, extracts durable insights, and updates long-term memory files. Think of it as memory maintenance -- moving important things from short-term to long-term storage.
checklist
Generate a custom checklist for the current feature based on user requirements.