Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/martybonacci/specswarm/initgit clone --depth 1 https://github.com/MartyBonacci/specswarmWhat 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 | $0.00012 | $0.27587 |
| Opus 5 | $0.00006 | $0.13794 |
| Sonnet 5 | $0.00002 | $0.05517 |
| Haiku 4.5 | $0.00001 | $0.02759 |
Grade B, and why
init scanned grade B with 1 finding 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 2d 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.
Reads MCP configurationmediumAgent snooping
mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.
EXISTING_MCP=$(cat "$REPO_ROOT/.mcp.json") How it starts
The opening of the file, as written. The whole thing — 2,371 lines — stays where its author put it; the contents beside it link to each section on GitHub.
User Input
$ARGUMENTS
Goal
Establish or refresh the SpecSwarm guides under .specswarm/:
constitution.md- Project governance and coding principlestech-stack.md- Approved technologies and prohibited patternsquality-standards.md- Quality gates and performance budgetsreferences.md- External authoritative sources (spec corpus, reference codebases, memory dirs)conventions.md- Detected code style and patterns
/ss:init is designed to run at two points in a project's life:
- At project / sprint kickoff — to create the guides from scratch by detecting the tech stack, discovering external references, and proposing principles from memory.
- Mid-development, any time — to reconcile the guides against project reality. On re-run, the command reads both (a) the existing guide files and (b) current project state (package.json, CI, memory dirs, …), surfaces drift between the two, and only updates a guide after the developer accepts the proposed delta. Developer-authored content inside
<!-- ss:user-additions -->blocks is always preserved verbatim. A full backup of all.specswarm/*.mdis taken on every run as a safety net.
Pass --reset if you want to discard existing guides and regenerate from scratch (the backup is still taken; nothing is permanently lost).
Execution Steps
Step 1: Snapshot existing guides (unconditional)
Always back up every .specswarm/*.md file present at the start of the run. This is cheap, always safe, and protects the developer against any reconciliation bug downstream. No "Update / Backup / Cancel" prompt — re-running /ss:init is meant to be safe.
echo "🔍 Snapshotting existing SpecSwarm guides..."
echo ""
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
BACKUP_TS="$(date +%Y%m%d-%H%M%S)"
BACKUP_DIR="$REPO_ROOT/.specswarm/.backup/$BACKUP_TS"
EXISTING_FILES=()
if [ -d "$REPO_ROOT/.specswarm" ]; then
shopt -s nullglob
for f in "$REPO_ROOT/.specswarm"/*.md; do
EXISTING_FILES+=("$(basename "$f")")
done
shopt -u nullglob
fi
# Detect --reset flag from $ARGUMENTS
RESET_MODE=false
if echo "$ARGUMENTS" | grep -q -- '--reset'; then
RESET_MODE=true
fi
# v7.0.0: Detect --full-scan and --include-user-memory flags
FULL_SCAN_FLAG=false
if echo "$ARGUMENTS" | grep -q -- '--full-scan'; then
FULL_SCAN_FLAG=true
fi
INCLUDE_USER_MEMORY_FLAG=false
if echo "$ARGUMENTS" | grep -q -- '--include-user-memory'; then
INCLUDE_USER_MEMORY_FLAG=true
fi
# Detect --minimal flag (referenced by v7.0.0 Steps 3.0 / 4.0 / 4.1 / 4.2 for short-circuit)
MINIMAL_MODE=false
if echo "$ARGUMENTS" | grep -q -- '--minimal'; then
MINIMAL_MODE=true
fi
if [ ${#EXISTING_FILES[@]} -gt 0 ]; then
mkdir -p "$BACKUP_DIR"
for file in "${EXISTING_FILES[@]}"; do
cp "$REPO_ROOT/.specswarm/$file" "$BACKUP_DIR/$file"
done
echo "📦 Backed up ${#EXISTING_FILES[@]} existing guide(s) to:"
echo " .specswarm/.backup/$BACKUP_TS/"
for file in "${EXISTING_FILES[@]}"; do
echo " - $file"
done
echo ""
if [ "$RESET_MODE" = true ]; then
echo "⚠️ --reset flag detected — existing guides will be discarded."
echo " Backup above is your recovery path if you change your mind."
echo ""
else
echo "♻️ Reconciliation mode — existing guides will be merged with current project state."
echo " Developer-authored content in <!-- ss:user-additions --> blocks is preserved verbatim."
echo " You will be prompted to resolve any drift between declared and detected values."
echo ""
fi
fi
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.
- 2d ago First seen · 2,371 lines · 12 tokens per session scan B 7e36a7591f5f
init is a command published in the GitHub repository MartyBonacci/specswarm (65 stars, last pushed 1mo ago), licensed MIT. It adds 12 tokens to every session and 27,587 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads mcp configuration). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.