swarm/SKILL.md
Parallel scraping/API work across multiple Railway workers. Each worker = unique IP. One project, N services, auto-teardown. Use for batch scraping, bulk API calls, or any task that benefits from multiple IPs.
npx skillsauth add snqb/my-skills swarmInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Spin up N parallel workers on Railway, each with a unique IP. One persistent project, services created/destroyed per job.
Local (orchestrator)
├── Creates N services in "swarm-pool" Railway project
├── Each service: same Dockerfile, different WORKER_ID + TASK_SLICE env vars
├── Workers pull their slice, process, write to /app/data/results.jsonl
└── Orchestrator polls workers, collects results, tears down
Worker (Deno on Railway):
1. Reads TASK_DATA env var (base64 gzipped JSONL) or downloads from TASK_URL
2. Imports handler from HANDLER_URL (your custom scrape logic)
3. Processes items with pooledMap(CONCURRENCY)
4. Serves results on GET /results and GET /health
5. Auto-exits when done
# 1. Write your handler (one function that processes one item)
cat > /tmp/my-handler.ts << 'EOF'
export async function handle(item: any): Promise<any> {
const resp = await fetch(`https://example.com/api/${item.id}`);
return { id: item.id, status: "ok", data: await resp.json() };
}
EOF
# 2. Prepare items
echo '{"id":"abc"}' > /tmp/items.jsonl
echo '{"id":"def"}' >> /tmp/items.jsonl
# 3. Run swarm
deno run --allow-all ~/.pi/agent/skills/swarm/swarm.ts \
--handler /tmp/my-handler.ts \
--items /tmp/items.jsonl \
--workers 5 \
--output /tmp/results.jsonl
skills/swarm/
SKILL.md — this file
swarm.ts — orchestrator (creates workers, collects results)
worker/
Dockerfile — generic worker image
worker.ts — task runner (Deno)
| Env / Flag | Default | Description |
|------------|---------|-------------|
| --workers N | 5 | Number of parallel workers |
| --concurrency N | 3 | Concurrency per worker |
| --handler PATH | required | .ts file with export async function handle(item) |
| --items PATH | required | JSONL file with items to process |
| --output PATH | /tmp/swarm-results.jsonl | Output file |
| RAILWAY_TOKEN | from ~/.railway/config.json | Railway API token |
serviceCreate: 1 per 30s. Creating 10 workers takes ~5 min.documentation
Enrich Markdown articles with inline Wikipedia links. First mention of each notable entity gets a hyperlink. Use when asked to add wiki links, enrich, or add references to .md files.
development
Structured visual QA: screenshot → batch issues → fix all → verify. Replaces the 300-cycle screenshot→edit death spiral. Optional bishkek review as exit gate. Use when building/polishing UI with browser testing, or when user asks for N iterations/reviews.
development
Find complex code, analyze intent, recommend battle-tested library replacements. Uses radon/eslint for detection, GitHub quality search for alternatives.
research
Research real-world UI patterns from curated galleries (Collect UI, Component Gallery, Mobbin). Use when exploring what exists: dropdowns, accordions, inputs, navigation, cards, modals, etc.