返回技能列表

forage-resources

pjt222
更新于 2 days ago
4 次查看
17
2
17
在 GitHub 上查看
其他ai

关于

This skill applies ant colony optimization and foraging theory to efficiently search large solution spaces by balancing exploration of new options with exploitation of known good ones. It helps deploy scouts, reinforce successful trails, detect diminishing returns, and adapt strategies dynamically. Use it when brute-force search is impractical, you need to allocate resources across uncertain opportunities, or to diagnose premature convergence on local optima.

快速安装

Claude Code

推荐
主要方式
npx skills add pjt222/agent-almanac -a claude-code
插件命令备选方式
/plugin add https://github.com/pjt222/agent-almanac
Git 克隆备选方式
git 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-swarm w/ 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.

  1. 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
  2. Information landscape:
    • How much known about locations before foraging?
    • Scouts share info w/ foragers? (see coordinate-swarm for signal design)
    • Static or changing while foraging?
  3. 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.

  1. Allocate scout % (start 20-30% of available)
  2. 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)
  3. 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.

  1. Forager follows trail + finds good:
    • Reinforce signal (increase strength)
    • Reinforced → more foragers → more reinforcement → exploitation
  2. Forager follows trail + finds nothing:
    • No reinforce (trail decays naturally)
    • Weakening → fewer foragers → fades → exploration resumes
  3. 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.

  1. Track yield/effort each active site:
    • Increasing → healthy, continue
    • Flat → approach saturation, begin scouting alts
    • Decreasing → diminishing, reduce foragers, increase scouts
  2. Marginal value theorem:
    • Compare current yield vs avg across known sites
    • Current drops below avg → time to leave
    • Factor travel cost (switching to new)
  3. 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.

  1. 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)
  2. Monitor strategy-env mismatch:
    • High effort, low yield → too exploitative
    • High discovery, low follow-through → too exploratory
    • Oscillating yield → switching too aggressively
  3. 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 design
  • build-consensus — swarm must collectively agree which patches prioritize
  • scale-colony — scaling operations as landscape/swarm grows
  • assess-form — morphic for system current state, complementary to landscape
  • configure-alerting-rules — alerting applicable to diminishing returns
  • plan-capacity — capacity planning shares explore-exploit framing
  • forage-solutions — AI self-application variant; maps ant colony to single-agent solution exploration w/ scout hypotheses + trail reinforcement

GitHub 仓库

pjt222/agent-almanac
路径: i18n/caveman-ultra/skills/forage-resources
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

相关推荐技能

llamaguard

其他

LlamaGuard是Meta推出的7-8B参数内容审核模型,专门用于过滤LLM的输入和输出内容。它能检测六大安全风险类别(暴力/仇恨、性内容、武器、违禁品、自残、犯罪计划),准确率达94-95%。开发者可通过HuggingFace、vLLM或Sagemaker快速部署,并能与NeMo Guardrails集成实现自动化安全防护。

查看技能

cost-optimization

其他

这个Claude Skill帮助开发者优化云成本,通过资源调整、标记策略和预留实例来降低AWS、Azure和GCP的开支。它适用于减少云支出、分析基础设施成本或实施成本治理策略的场景。关键功能包括提供成本可视化、资源规模调整指导和定价模型优化建议。

查看技能

quantizing-models-bitsandbytes

其他

这个Skill使用bitsandbytes库量化大语言模型,能在GPU内存有限时通过8位或4位量化减少50-75%内存占用,同时保持精度损失最小。它支持INT8、NF4、FP4等多种量化格式,可与HuggingFace Transformers无缝集成,适用于需要部署更大模型或加速推理的场景。还提供QLoRA训练和8位优化器支持,让开发者能轻松实现高效模型压缩。

查看技能

dispatching-parallel-agents

其他

该Skill用于并行处理3个以上无依赖关系的独立故障,可为每个问题域分派专属Claude代理同时执行调查修复。它通过并发处理多个独立问题显著提升故障排查效率,特别适用于测试文件、子系统等无共享状态的场景。

查看技能