forage-resources
について
このスキルは、アリコロニー最適化と摂餌理論を応用し、新たな選択肢の探索と既知の良好な選択肢の活用のバランスを取りながら、大規模な解空間を効率的に探索します。偵察員の展開、成功経路の強化、収穫逓減の検出、戦略の動的適応を支援します。総当たり探索が現実的でない場合、不確実な機会にリソースを配分する必要がある場合、局所最適解への早期収束を診断する場合にご利用ください。
クイックインストール
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/forage-resourcesこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします
ドキュメント
Forage Resources
Apply foraging theory + ant colony opt → systematically search, evaluate, exploit distributed resources — balance exploration unknown vs exploitation known yields.
Use When
- Search large solution space, brute-force impractical
- Balance invest between explore new vs deepen known good
- Optimize resource alloc across uncertain opportunities
- Design search strategies distributed teams/automated agents
- Diagnose premature convergence (stuck local optima) or perpetual wandering (never commit)
- Complement
coordinate-swarmw/ specific resource-discovery patterns
In
- Required: Resource being sought (info, compute, talent, solutions, opportunities)
- Required: Search space (size, structure, known features)
- Optional: Current strategy + failure mode
- Optional: N available scouts/searchers
- Optional: Cost exploration vs cost exploitation failure
- Optional: Time horizon (short-term exploitation vs long-term exploration)
Do
Step 1: Map Landscape
Characterize resource env → select strategy.
- Resource type + distribution:
- Concentrated: cluster rich patches (talent in specific communities)
- Distributed: spread evenly (bugs across codebase)
- Ephemeral: appear + disappear (market opportunities)
- Nested: rich patches contain sub-patches diff scales
- Information landscape:
- How much known about locations before foraging?
- Scouts share info w/ foragers? (see
coordinate-swarmfor signal design) - Static or changing while foraging?
- Cost structure:
- Cost per scout deployed (time, compute, money)
- Cost exploiting low-quality (opportunity cost)
- Cost missing high-quality (regret)
→ Characterized landscape w/ distribution, info, cost. Determines foraging model.
If err: completely unknown → max exploration (all scouts, no exploit) for fixed budget → build initial map. Switch to model once character clear.
Step 2: Deploy Scouts w/ Trail Marking
Exploratory agents into search space + instructions mark what find.
- Allocate scout % (start 20-30% of available)
- Scout behavior:
- Move through space randomized/systematic
- Evaluate each location (quick not deep)
- Mark discoveries w/ signal strength proportional to quality:
- High quality → strong trail
- Medium → moderate
- Low → weak or no signal
- Return info to collective (signal deposit, report, broadcast)
- Scout pattern:
- Random walk: unknown, uniform landscapes
- Levy flight: long jumps + local clustering — patchy
- Systematic sweep: grid/spiral — bounded, well-defined
- Biased random: lean toward similar previous finds — clustered
→ Scouts deployed, depositing signals proportional to quality. Initial map emerges from reports.
If err: nothing initial sweep → (a) scout % too low (increase 50%), (b) wrong pattern (random walk → Levy flight for patchy), (c) quality miscalibrated (lower detection threshold).
Step 3: Trail Reinforcement
Positive feedback loops amplify successful paths, let unsuccessful fade.
- Forager follows trail + finds good:
- Reinforce signal (increase strength)
- Reinforced → more foragers → more reinforcement → exploitation
- Forager follows trail + finds nothing:
- No reinforce (trail decays naturally)
- Weakening → fewer foragers → fades → exploration resumes
- Reinforcement params:
- Deposit: proportional to quality
- Decay rate: trails lose X%/time
- Saturation cap: max strength (prevents runaway single path)
Trail Reinforcement Dynamics:
┌─────────────────────────────────────────────────────────────────────┐
│ │
│ Strong trail ──→ More foragers ──→ If good: reinforce ──→ EXPLOIT │
│ ↑ │ │
│ │ If bad: no reinforce │ │
│ │ │ │ │
│ │ ↓ │ │
│ Decay ←── Weak trail ←── Fewer foragers ←── Trail fades │ │
│ │ │ │
│ ↓ │ │
│ No trail ──→ Scouts explore ──→ New discovery ──→ New trail ↗ │
│ │
└─────────────────────────────────────────────────────────────────────┘
→ Self-regulating loop: good attract, poor abandoned. Balance via trail dynamics.
If err: all converge single trail (premature convergence) → decay too slow or cap too high. Increase decay, lower cap, or random exploration mandates (10% ignore trails). Fade too fast → reduce decay.
Step 4: Diminishing Returns
Monitor yields → know when shift exploit back to explore.
- Track yield/effort each active site:
- Increasing → healthy, continue
- Flat → approach saturation, begin scouting alts
- Decreasing → diminishing, reduce foragers, increase scouts
- Marginal value theorem:
- Compare current yield vs avg across known sites
- Current drops below avg → time to leave
- Factor travel cost (switching to new)
- Trigger scouting waves:
- Overall yield across all drops below threshold
- Best-performing exploited longer than expected lifetime
- Env change detected (new signals from unexplored areas)
→ Swarm shifts between exploit (known-good) + exploration (scouts dispersed), driven by monitoring not arbitrary schedules.
If err: stays depleted too long → marginal threshold too low or travel cost too high. Recalibrate via actual rates. Abandons good too early → threshold too sensitive, add smoothing window.
Step 5: Adapt Strategy
Select + switch strategies based on env feedback.
- Match to landscape:
- Rich, clustered: commit heavy discovered patches (high exploit)
- Sparse, scattered: high scout ratio (high explore)
- Volatile, changing: short decay, frequent scouting waves (adaptive)
- Competitive: faster reinforcement, pre-emptive marking (territorial)
- Monitor strategy-env mismatch:
- High effort, low yield → too exploitative
- High discovery, low follow-through → too exploratory
- Oscillating yield → switching too aggressively
- Adaptive switching:
- Rolling avg explore-to-exploit ratio
- Ratio drifts too far from optimal (by landscape type) → nudge back
- Gradual transitions — abrupt cause coordination chaos
→ System adapts balance to env, maintains effectiveness as conditions change.
If err: adaptation unstable (oscillating) → damping: require mismatch persist N time units before shift. No strategy works → reassess Step 1 landscape, distribution may be more complex than assumed.
Check
- Landscape characterized (distribution, info, cost)
- Scout % + pattern defined + deployed
- Trail reinforcement loop functional (deposit, decay, saturation)
- Diminishing returns triggers rebalance exploit → explore
- Strategy-env match monitored + adaptive switching
- System recovers landscape changes (new/depleted)
Traps
- Premature convergence: All pile on first good find, ignore better. Cure: mandatory exploration %, trail saturation caps, decay.
- Perpetual exploration: Scouts find new but swarm never commits. Cure: lower quality threshold for reinforcement, reduce scout %.
- Ignore travel costs: Switching has cost. Constantly jumping similar-quality → waste travel > gain. Factor travel into marginal value.
- Static strategy dynamic landscape: Optimized for yesterday fails tomorrow. Build adaptation into loop not afterthought.
- Conflate scout + forager quality: Good scouts (broad, quick) + good foragers (deep, thorough) require diff skills. Don't force both roles.
→
coordinate-swarm— foundational coordination underpinning signal designbuild-consensus— swarm must collectively agree which patches prioritizescale-colony— scaling operations as landscape/swarm growsassess-form— morphic for system current state, complementary to landscapeconfigure-alerting-rules— alerting applicable to diminishing returnsplan-capacity— capacity planning shares explore-exploit framingforage-solutions— AI self-application variant; maps ant colony to single-agent solution exploration w/ scout hypotheses + trail reinforcement
GitHub リポジトリ
関連スキル
llamaguard
その他LlamaGuardは、暴力やヘイトスピーチなど6つの安全性カテゴリーにおいて、LLMの入力と出力をモデレートするMetaの70-80億パラメータモデルです。94〜95%の精度を提供し、vLLM、Hugging Face、Amazon SageMakerを使用してデプロイ可能です。このスキルを使用して、AIアプリケーションにコンテンツフィルタリングと安全策を簡単に統合できます。
cost-optimization
その他このClaudeスキルは、リソースの適正サイジング、タグ付け戦略、支出分析を通じて、開発者がクラウドコストを最適化することを支援します。AWS、Azure、GCPにわたるクラウド支出の削減とコストガバナンスの実施のためのフレームワークを提供します。インフラコストの分析、リソースの適正サイジング、または予算制約への対応が必要な際にご利用ください。
quantizing-models-bitsandbytes
その他このスキルは、bitsandbytesを使用してLLMを8ビットまたは4ビット精度に量子化し、精度の低下を最小限に抑えつつ50〜75%のメモリ削減を実現します。限られたGPUメモリでより大規模なモデルを実行したり、推論を高速化するのに理想的で、INT8、NF4、FP4などのフォーマットをサポートしています。HuggingFace Transformersと統合され、QLoRAトレーニングや8ビットオプティマイザーを可能にします。
dispatching-parallel-agents
その他このClaudeスキルは、複数のエージェントを配備し、3つ以上の独立した問題を並行して調査・修正します。共有状態や依存関係がなく解決可能な、無関係な障害が発生するシナリオ向けに設計されています。中核となる機能は並列問題解決であり、効率を最大化するために独立した問題領域ごとに1つのエージェントを割り当てます。
