defend-colony
について
このスキルは、免疫応答パターンに着想を得て、分散システムにおける集団的・階層的防御を実装するためのフレームワークを提供します。脅威の検知、アラートの伝播、深刻度に応じて段階的にエスカレートする比例対応を可能にし、過剰反応や過小反応を防ぎます。単一のコンポーネントですべての脅威に対処できない状況において、スケーラブルなインシデント対応と多層防御戦略を設計するためにご活用ください。
クイックインストール
Claude Code
推奨npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/defend-colonyこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします
ドキュメント
Defend Colony
Layered collective defense: alarm signal + role mobilize + proportional response + immune memory. Inspired by social insect + biological immune sys.
Use When
- Defense-in-depth, no single guardian covers all
- Incident response scales w/ severity
- Components can't defend alone
- Defense over-reactive (every alert = full mob) / under-reactive (threats unnoticed)
- Org resilience: teams self-org on incident
- Complement
coordinate-swarmw/ threat-response patterns
In
- Required: Colony desc (sys, org, team)
- Required: Threat cats (attacks, failures, competitors, env)
- Optional: Current defenses + fail modes
- Optional: Defender types + caps
- Optional: Latency per tier
- Optional: Recovery reqs
Do
Step 1: Threat Landscape + Perimeter
ID what to defend, from what, where perimeter.
- Critical assets:
- Protect all cost (core data, prod sys, key ppl)
- Can sustain temp damage (staging, non-crit svcs)
- Expendable under extreme (caches, replicas, non-essential)
- Classify threats:
- Probes: low-level recon (port scans, failed logins)
- Incursions: active boundary violations (unauth access, injection)
- Infestations: persistent inside (compromised nodes, insider)
- Existential: survival threats (corruption, catastrophic fail, DDoS)
- Perimeter:
- Outer: first detection (firewalls, rate limits, monitoring)
- Inner: critical asset boundaries (access ctrl, encryption, isolation)
- Core: last-resort (backups, kill switches, circuit breakers)
Got: Map: assets prioritized + threats classified + perimeters layered.
If err: Overwhelming → top 3 critical assets + top 3 threat types. Coverage of what matters > perfect. Unclear boundaries → default zero-trust + define from actual traffic.
Step 2: Alarm Network
Detection + alert propagation.
- Sentinels per layer:
- Outer: light, high-sens (may false+)
- Inner: heavy, high-spec (fewer false+, slower)
- Core: critical monitors (zero missed tolerance)
- Graduated alarms:
- Yellow: anomaly, increased monitor, no mob
- Orange: confirmed pattern, local defenders mob, scouts investigate
- Red: active breach / severe, full mob, non-essential paused
- Black: existential, all → defense, sacrifice expendable if needed
- Propagation:
- Local: sentinels alert nearby directly
- Regional: clusters aggregate + escalate if threshold met
- Colony-wide: regional escalation → broadcast
- Each step adds confirmation — single sentinel can't trigger colony-wide
- Fatigue prevention:
- Auto-suppress repeated identical (dedup w/ time window)
- Req escalation confirmed by indep sentinels
- Track alarm-to-threat ratio — FP >50% → recalibrate
Alarm Propagation:
┌──────────────────────────────────────────────────────────┐
│ Sentinel detects anomaly ──→ Yellow alert (local) │
│ │ │
│ ↓ (confirmed by 2nd sentinel) │
│ Orange alert ──→ Local defenders mobilize │
│ │ │
│ ↓ (pattern matches known threat + 3rd sentinel) │
│ Red alert ──→ Full defense mobilization │
│ │ │
│ ↓ (critical asset under active attack) │
│ Black alert ──→ All resources to defense, circuit break │
└──────────────────────────────────────────────────────────┘
Got: Graduated alarm, severity → response intensity. Multi-sentinel confirms prevent single FPs. Fatigue managed via dedup + calibration.
If err: Too many FPs → raise thresh / more confirms. Threats slip → add sentinels at breach layer / lower thresh. Too slow → reduce confirm reqs (accept higher FP).
Step 3: Role-Based Defenders
Assign roles + mob protocols proportional to threat.
- Roles:
- Sentinels: detection (always active, low cost)
- Guards: first responders (idle until mob, fast)
- Soldiers: heavy (expensive mob, high cap)
- Healers: repair + recovery (see
repair-damage) - Messengers: coord across regions
- Roles → alerts:
- Yellow: sentinels ↑ monitor freq, guards standby
- Orange: guards mob → threat loc, soldiers standby
- Red: soldiers mob, non-essential → defense
- Black: all → defense, colony activities suspended
- Proportional:
- Never soldiers for probe (waste + reveals caps)
- Never only sentinels vs incursion (insufficient)
- Match tier — escalate if fails, de-escalate when recedes
- Role transitions:
- Workers → guards (temp upskill emergency)
- Guards → soldiers (sustained threat)
- Post-threat → reverse transitions restore normal
Got: Force scales w/ severity. Normal = min defense. Under threat = rapid proportional mob, no over/under.
If err: Mob too slow → pre-position guards near known vectors. Too expensive → reduce permanent guards, rely on worker-to-guard. Role confusion → simplify to 3 (detect/respond/recover).
Step 4: Immune Memory + Adaptation
Learn each encounter.
- Per incident, threat signature:
- Attack pattern (how detected)
- Vector (where entered)
- Effective response (what stopped)
- Failed response (what didn't)
- Store in immune memory:
- Fast-lookup pattern lib for sentinels
- Updated playbooks w/ known-effective
- Flagged FP patterns → reduce future fatigue
- Adaptive immunity:
- New signatures → all sentinels (colony-wide learning)
- Detecting sentinels get priority updates (local)
- Periodic review culls outdated
- Stress test:
- Re-sim past threats → verify defenses still work
- Red team → novel threats test adaptation
- Measure detection: known vs unknown
Got: Defense gets stronger per encounter. Known = faster detect + better response. Novel = graduated alarm, resolution → memory.
If err: Memory too large → prioritize by freq + severity, archive rare/minor. Too specialized, misses novel → keep "general patrol" (anomaly detection, no pattern match).
Step 5: Post-Incident Recovery
Defense → normal w/ repair + resilience.
- Threat elim verify:
- Confirm neutralized (not just suppressed)
- Scan secondaries during primary
- Verify no compromised agents remain
- Damage assess:
- Catalog damaged/degraded/lost
- Priority by criticality (core first)
- Estimate recovery time + resources
- Recovery:
- Healers → damaged (see
repair-damage) - Restore svcs in priority
- Elevated sentinel during recovery (vulnerable period)
- Healers → damaged (see
- De-escalate:
- Step down (Red → Orange → Yellow → Normal)
- Reassigned workers → primary roles
- Stand down soldiers, guards → patrol
- Post-incident review <24h (fresh memory)
Got: Smooth defense → recovery → normal. Elevated monitor catches secondaries. Review feeds memory.
If err: Slow recovery → pre-build playbooks for likely damage. Secondaries during recovery → de-esc too aggressive, keep higher alert longer. Review skipped (time pressure) → schedule non-negotiable.
Check
- Critical assets ID'd + prioritized
- Threats classified (type + severity)
- Perimeter layered + sentinels per layer
- Alarm graduated + multi-sentinel confirm
- Roles defined + mob → alerts
- Proportional prevents over/under
- Memory captures + applies lessons
- Recovery restores safely
Traps
- Maginot Line: Over-invest 1 layer, others unprotected. Layered — any single can breach.
- Alert fatigue: Many alarms, few real → degrades attention. Calibrate ruthless; missed FP cheaper than missed real.
- Symmetric response: Same intensity always → wastes + reveals caps. Match — escalate only when needed.
- No immune memory: Repeated same threat, no learning → expensive + fragile. Every incident → update knowledge.
- Permanent war footing: Sustained high-alert → exhausts + degrades normal. De-esc deliberate when threat passes.
→
coordinate-swarm— foundational coord patterns supporting alarm + mobbuild-consensus— rapid consensus for collective defense under pressurescale-colony— defense scales w/ growthrepair-damage— morphic regenerative recoveryconfigure-alerting-rules— practical alerting implconduct-post-mortem— structured analysis → feeds memory
GitHub リポジトリ
関連スキル
content-collections
メタこのスキルは、Content Collections(Markdown/MDXファイルを型安全なデータコレクションに変換するTypeScriptファーストのツール)の本番環境でテストされた設定を提供します。Zodバリデーションによる型安全性を実現し、ブログ、ドキュメントサイト、コンテンツ重視のVite + Reactアプリケーション構築時にご利用ください。Viteプラグインの設定、MDXコンパイルから、デプロイ最適化、スキーマバリデーションまで、すべてを網羅しています。
polymarket
メタこのスキルは、開発者がPolymarket予測市場プラットフォームを活用したアプリケーション構築を可能にします。API統合による取引や市場データの取得に加え、WebSocketを介したリアルタイムデータストリーミングにより、ライブ取引や市場活動を監視できます。取引戦略の実装や、ライブ市場更新を処理するツールの作成にご利用ください。
creating-opencode-plugins
メタこのスキルは、開発者がコマンド、ファイル、LSP操作など25種類以上のイベントタイプにフックするOpenCodeプラグインを作成することを支援します。JavaScript/TypeScriptモジュール向けに、プラグイン構造、イベントAPI仕様、および実装パターンを提供します。カスタムイベント駆動ロジックでOpenCode AIアシスタントのライフサイクルをインターセプト、監視、または拡張する必要がある場合にご利用ください。
sglang
メタSGLangは、高性能なLLMサービングフレームワークであり、RadixAttentionプレフィックスキャッシュを活用したJSON、正規表現、エージェントワークフロー向けの高速で構造化された生成を特長とします。特にプレフィックスが繰り返されるタスクにおいて、大幅に高速な推論を実現し、複雑な構造化出力やマルチターン対話に最適です。制約付きデコードが必要な場合や、広範なプレフィックス共有を伴うアプリケーションを構築する場合は、vLLMなどの代替案ではなくSGLangを選択してください。
