forage-resources
Über
Diese Fähigkeit wendet Ameisenalgorithmen und Futtersuchtheorie an, um große Lösungsräume effizient zu durchsuchen, bei denen Brute-Force-Methoden versagen. Sie hilft dabei, die Erkundung neuer Optionen mit der Nutzung bekannter guter Lösungen auszubalancieren, indem sie den Einsatz von Spähern und die Verstärkung von Pheromonpfaden steuert. Nutzen Sie sie zur Optimierung der Ressourcenzuteilung, zur Vermeidung vorzeitiger Konvergenz und zum Management von Exploration-Exploitation-Kompromissen bei verteilten Suchproblemen.
Schnellinstallation
Claude Code
Empfohlennpx 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-resourcesKopieren Sie diesen Befehl und fügen Sie ihn in Claude Code ein, um diese Fähigkeit zu installieren
Dokumentation
Forage Resources
Apply foraging theory and ant colony optimization to system search for, check, and exploit spread resources — balance roam of unknown ground with exploit of known yields.
When Use
- Search large solution space where brute-force count is not practical
- Balance invest between roaming new paths and deepening known good ones
- Tune resource spend across many uncertain chances
- Design search strategies for spread teams or auto agents
- Spot premature converge (stuck on local optima) or endless wander (never commit)
- Complement
coordinate-swarmwith specific resource-find patterns
Inputs
- Required: Desc of resource being sought (info, compute, talent, solutions, chances)
- Required: Desc of search space (size, structure, known features)
- Optional: Current search strategy and its fail mode
- Optional: Count of open scouts/searchers
- Optional: Cost of roam vs cost of exploit fail
- Optional: Time horizon (short-term exploit vs long-term roam)
Steps
Step 1: Map the Foraging Landscape
Describe resource env to pick right forage strategy.
- Spot resource type and its distribution:
- Concentrated: resources cluster in rich patches (e.g., talent in specific communities)
- Distributed: resources spread evenly (e.g., bugs across codebase)
- Ephemeral: resources appear and vanish (e.g., market chances)
- Nested: rich patches hold sub-patches at different scales
- Check info landscape:
- How much known about resource spots before forage starts?
- Can scouts share info with foragers? (see
coordinate-swarmfor signal design) - Is landscape static or shifting while you forage?
- Figure cost structure:
- Cost per scout sent (time, compute, money)
- Cost of exploit low-quality resource (chance cost)
- Cost of missing high-quality resource (regret)
Got: Described forage landscape with resource distribution type, info availability, cost structure. This picks which forage model to apply.
If fail: Landscape fully unknown? Start with max roam (all scouts, no exploit) for fixed time budget to build first map. Switch to right model once landscape character becomes clear.
Step 2: Deploy Scouts with Trail Marking
Send roam agents into search space with orders to mark what they find.
- Set scout percent (start with 20-30% of open agents as scouts)
- Set scout behavior:
- Move through search space with randomized or systematic patterns
- Check each spot met (quick check, not deep analysis)
- Mark finds with signal strength by quality:
- High quality → strong trail signal
- Medium quality → moderate signal
- Low quality → weak signal or no signal
- Return info to collective (signal deposit, report, broadcast)
- Design scout pattern:
- Random walk: good for unknown, uniform landscapes
- Levy flight: long jumps with occasional local clustering — good for patchy resources
- Systematic sweep: grid or spiral — good for bounded, well-defined spaces
- Biased random: lean toward areas like past finds — good for clustered resources
Got: Scouts sent across search space, dropping trail signals by resource quality. First map of landscape starts to emerge from scout reports.
If fail: Scouts find nothing in first sweep? Either scout percent too low (bump to 50%), search pattern wrong (switch from random walk to Levy flight for patchy resources), or quality check miscalibrated (lower detection threshold).
Step 3: Establish Trail Reinforcement
Make positive feedback loops that amplify good paths and let bad ones fade.
- When forager follows trail and finds good resource:
- Reinforce trail signal (bump strength)
- Reinforced signal pulls more foragers → more reinforcement → exploit
- When forager follows trail and finds nothing:
- Do not reinforce (let trail decay natural)
- Weakening signal pulls fewer foragers → trail fades → roam resumes
- Set reinforcement params:
- Deposit amount: by resource quality found
- Decay rate: trails lose X% of strength per time unit
- Saturation cap: max trail strength (blocks runaway exploit of 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 ↗ │
│ │
└─────────────────────────────────────────────────────────────────────┘
Got: Self-regulating feedback loop where good resources pull growing focus and poor resources naturally abandoned. System balances exploit and roam through trail dynamics alone.
If fail: All foragers converge on single trail (premature converge)? Decay rate too slow or saturation cap too high. Bump decay, lower cap, or add random roam rules (e.g., 10% of foragers always ignore trails). Trails fade too fast and nothing gets exploited? Drop decay rate.
Step 4: Detect Diminishing Returns
Watch resource yields to know when to shift from exploit back to roam.
- Track yield per unit effort for each active forage site:
- Yield rising → healthy exploit, keep going
- Yield flat → close to saturation, start scouting alternatives
- Yield dropping → diminishing returns, cut foragers, bump scouts
- Apply marginal value theorem:
- Compare current site yield rate to average yield rate across all known sites
- When current site drops below average, time to leave
- Factor in travel cost (cost of switching to new site)
- Fire scouting waves when:
- Overall yield across all sites drops below threshold
- Best-performing site exploited longer than its expected life
- Env change spotted (new signals from scouts in unexplored areas)
Got: Forage swarm naturally shifts between exploit phases (focused on known-good sites) and roam phases (scouts spread), driven by yield watch rather than fixed schedules.
If fail: Swarm stays on depleted sites too long? Marginal value threshold too low or travel cost estimate too high. Recalibrate by compare real yield rates. Swarm abandons good sites too early? Threshold too sensitive — add smoothing window to yield measure.
Step 5: Adapt Foraging Strategy to Conditions
Pick and switch between forage strategies by env feedback.
- Match strategy to landscape:
- Rich, clustered: commit heavy to found patches (high exploit)
- Sparse, scattered: keep high scout ratio (high roam)
- Volatile, changing: short trail decay, frequent scouting waves (adaptive)
- Competitive: faster reinforcement, pre-emptive trail marking (territorial)
- Watch for strategy-env mismatch:
- High effort, low yield → strategy too exploit for landscape
- High find rate, low follow-through → strategy too roam
- Oscillating yield → strategy switching too aggressive
- Do adaptive switching:
- Track rolling average of roam-to-exploit ratio
- If ratio drifts too far from best (set by landscape type), nudge back
- Allow gradual shifts — abrupt strategy switches cause coord chaos
Got: Forage system that adapts its roam-exploit balance to current env, keeping effect as conditions shift.
If fail: Strategy adapt itself becomes unstable (oscillating between roam and exploit)? Add damping: need mismatch signal to stick for N time units before fire strategy shift. No strategy seems to work? Recheck landscape description from Step 1 — resource distribution may be more complex than first assumed.
Validation
- Forage landscape described (distribution type, info open, cost structure)
- Scout percent and search pattern set and deployed
- Trail reinforcement loop works with deposit, decay, and saturation params
- Diminishing returns detect fires rebalance from exploit to roam
- Strategy-env match watched and adaptive switch configured
- System recovers from landscape shifts (new resources, depleted resources)
Pitfalls
- Premature converge: All foragers pile onto first good find, skip possibly better options. Cure: mandatory roam percent, trail saturation caps, and decay
- Endless roam: Scouts keep finding new options but swarm never commits. Cure: lower quality threshold for trail reinforcement, drop scout percent
- Ignore travel costs: Switch sites has cost. Foragers that jump between same-quality sites waste more on travel than they gain. Factor travel cost into marginal value count
- Static strategy in dynamic landscape: Strategy tuned for yesterday fails tomorrow. Build adapt into forage loop, not as afterthought
- Mix scout quality with forager quality: Good scouts (broad, quick check) and good foragers (deep, full exploit) need different skills. Do not force all agents into both roles
See Also
coordinate-swarm— base coord patterns that back forage signal designbuild-consensus— used when swarm must collectively agree on which resource patches to prioritizescale-colony— scaling forage ops when resource landscape or swarm size growsassess-form— morphic skill for check of current state of system, complement to landscape checkconfigure-alerting-rules— alerting patterns apply to diminishing returns detectplan-capacity— capacity plan shares explore-exploit frame with forage theoryforage-solutions— AI self-apply variant; maps ant colony forage to single-agent solution roam with scout hypotheses and trail reinforcement
GitHub Repository
Verwandte Skills
llamaguard
AndereLlamaGuard ist Metas 7-8B-Parameter-Modell zur Moderation von LLM-Eingaben und -Ausgaben in sechs Sicherheitskategorien wie Gewalt und Hassrede. Es bietet eine Genauigkeit von 94-95 % und kann mit vLLM, Hugging Face oder Amazon SageMaker eingesetzt werden. Nutzen Sie diese Skill, um Inhaltsfilterung und Sicherheitsguardrails einfach in Ihre KI-Anwendungen zu integrieren.
cost-optimization
AndereDiese Claude Skill unterstützt Entwickler bei der Optimierung von Cloud-Kosten durch Ressourcen-Dimensionierung, Tagging-Strategien und Ausgabenanalysen. Sie bietet einen Rahmen zur Senkung von Cloud-Ausgaben und zur Implementierung von Kosten-Governance für AWS, Azure und GCP. Nutzen Sie sie, wenn Sie Infrastrukturkosten analysieren, Ressourcen richtig dimensionieren oder Budgetvorgaben einhalten müssen.
quantizing-models-bitsandbytes
AndereDiese Fähigkeit quantisiert LLMs auf 8-Bit- oder 4-Bit-Präzision mittels bitsandbytes und erreicht dabei eine Speicherreduzierung von 50–75 % bei minimalem Genauigkeitsverlust. Sie ist ideal für den Betrieb größerer Modelle mit begrenztem GPU-Speicher oder zur Beschleunigung von Inferenzvorgängen und unterstützt Formate wie INT8, NF4 und FP4. Die Fähigkeit integriert sich in HuggingFace Transformers und ermöglicht QLoRA-Training sowie 8-Bit-Optimierer.
dispatching-parallel-agents
AndereDiese Claude-Fähigkeit verteilt mehrere Agenten, um drei oder mehr unabhängige Probleme gleichzeitig zu untersuchen und zu beheben. Sie ist für Szenarien konzipiert, die unabhängige Fehler umfassen, die ohne gemeinsamen Zustand oder Abhängigkeiten gelöst werden können. Die Kernfähigkeit ist die parallele Problemlösung, bei der pro unabhängigem Problembereich ein Agent zugewiesen wird, um die Effizienz zu maximieren.
