返回技能列表

forage-solutions

pjt222
更新于 2 days ago
3 次查看
17
2
17
在 GitHub 上查看
测试aidesign

关于

This skill applies ant colony optimization to explore multiple solution paths in parallel, ideal for debugging or when no single approach is clearly best. It scouts hypotheses, reinforces promising ones, and intelligently abandons dead ends to avoid suboptimal convergence. Use it for complex problems requiring systematic exploration beyond initial attempts.

快速安装

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-solutions

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

Forage Solutions

Roam a solution space with ant colony optimization ideas — send independent hypotheses as scouts, reinforce hopeful paths through evidence, spot diminishing returns, and know when to abandon a strategy and roam elsewhere.

When Use

  • Face problem with many plausible paths and no clear winner
  • When first path tried not working but alternatives are unclear
  • Debug with no clear root cause — many hypotheses need parallel dig
  • Search codebase for source of behavior when spot is unknown
  • When past solution tries have converged early on suboptimal path
  • Complement build-coherence when solution space must be roamed before pick

Inputs

  • Required: Problem desc or goal (what are we foraging for?)
  • Required: Current state of knowledge (what is already known?)
  • Optional: Past paths tried and their outcomes
  • Optional: Limits on roam (time budget, tool open)
  • Optional: Urgency level (hits roam-exploit balance)

Steps

Step 1: Map the Solution Landscape

Before send scouts, describe shape of solution space.

Solution Distribution Types:
┌────────────────────┬──────────────────────────────────────────────────┐
│ Type               │ Characteristics and Strategy                     │
├────────────────────┼──────────────────────────────────────────────────┤
│ Concentrated       │ One correct answer exists (bug fix, syntax       │
│ (one right fix)    │ error). Deploy many scouts quickly to locate     │
│                    │ it. Exploit immediately when found               │
├────────────────────┼──────────────────────────────────────────────────┤
│ Distributed        │ Multiple valid approaches (architecture choice,  │
│ (many valid paths) │ implementation strategy). Scouts assess quality  │
│                    │ of each. Use `build-coherence` to choose         │
├────────────────────┼──────────────────────────────────────────────────┤
│ Ephemeral          │ Solutions depend on timing or sequence (race     │
│ (time-sensitive)   │ conditions, order-dependent bugs). Fast scouting │
│                    │ with immediate exploitation. Cannot revisit       │
├────────────────────┼──────────────────────────────────────────────────┤
│ Nested             │ Solving the surface problem reveals a deeper one │
│ (layers of cause)  │ (config issue masking an architecture problem).  │
│                    │ Scout at each layer before committing to depth   │
└────────────────────┴──────────────────────────────────────────────────┘

Sort current problem. Distribution type picks how many scouts to send and how fast to switch from roam to exploit.

Got: Clear sort of solution landscape that tells scouting strategy. Sort should feel right to problem, not forced.

If fail: Landscape fully unknown? That itself is sort — treat as possibly distributed and send broad scouts. First round of scouting will show landscape character.

Step 2: Deploy Scout Hypotheses

Make independent hypotheses as scouts. Each scout probes solution space in different direction.

  1. Make 3-5 independent hypotheses about problem or its solution
  2. For each hypothesis, set one cheap test — single file read, one grep, one specific check
  3. Rate first promise by open evidence (not gut feel)
  4. Send scouts independent: do not let check of hypothesis A hit test of hypothesis B
Scout Deployment Template:
┌───────┬──────────────────────┬──────────────────────┬──────────┐
│ Scout │ Hypothesis           │ Test (one action)    │ Promise  │
├───────┼──────────────────────┼──────────────────────┼──────────┤
│ 1     │                      │                      │ High/Med/│
│ 2     │                      │                      │ Low      │
│ 3     │                      │                      │          │
│ 4     │                      │                      │          │
│ 5     │                      │                      │          │
└───────┴──────────────────────┴──────────────────────┴──────────┘

Key rule: scouts check, they do not exploit. Goal is quick signal on each hypothesis, not deep dig of first one that looks hopeful.

Got: 3-5 independent hypotheses with cheap tests set. No hypothesis deep roamed yet — this is breadth-first pass.

If fail: Fewer than 3 hypotheses can be made? Problem is either very tight (concentrated type — good, scout aggressive) or grasp too shallow (read more context before hypothesize). Hypotheses not independent (they are all variations of same idea)? Roam too narrow — force at least one hypothesis that clashes with others.

Step 3: Trail Reinforcement — Follow the Evidence

After scout results return, reinforce hopeful trails and let weak ones decay.

  1. Review scout results: which hypotheses found backing evidence?
  2. Strong evidence found → reinforce trail: invest more dig effort here
  3. No evidence found → let trail decay: do not dig further without new signals
  4. Clashing evidence found → mark as inhibition signal: actively avoid this path
  5. Watch for premature converge: if all effort flows to first trail reinforced, force one scout into unexplored ground
Trail Reinforcement Decision:
┌───────────────────────────┬──────────────────────────────────────┐
│ Scout Result              │ Action                               │
├───────────────────────────┼──────────────────────────────────────┤
│ Strong supporting evidence│ REINFORCE — deepen investigation     │
│ Weak supporting evidence  │ HOLD — one more cheap test before    │
│                           │ committing                           │
│ No evidence               │ DECAY — deprioritize, scout elsewhere│
│ Contradicting evidence    │ INHIBIT — mark as dead end           │
│ Ambiguous result          │ REFINE — hypothesis was too vague,   │
│                           │ sharpen and re-scout                 │
└───────────────────────────┴──────────────────────────────────────┘

Got: Clear priority of trails by evidence, not preference. Strongest trail gets most focus, but at least one alternative stays alive.

If fail: All scouts return empty? Hypotheses were wrong — not the path. Reframe question: "What assumptions am I making that could be wrong?" Make new hypotheses from different angle. All scouts return strong signals? Problem may be distributed (many valid answers) — switch to build-coherence for path pick.

Step 4: Marginal Value Theorem — Know When to Leave

Watch yield of current path. When info gained per unit effort drops below average across all paths, time to switch.

Marginal Value Assessment:
┌────────────────────────┬──────────────────────────────────────────┐
│ Signal                 │ Action                                   │
├────────────────────────┼──────────────────────────────────────────┤
│ New information per    │ CONTINUE — this trail is productive      │
│ action is high         │                                          │
├────────────────────────┼──────────────────────────────────────────┤
│ New information per    │ PREPARE TO SWITCH — squeeze remaining    │
│ action is declining    │ value, begin scouting alternatives       │
├────────────────────────┼──────────────────────────────────────────┤
│ Last 2-3 actions       │ SWITCH — the trail is depleted. The cost │
│ yielded nothing new    │ of staying exceeds the cost of switching │
├────────────────────────┼──────────────────────────────────────────┤
│ Information contradicts│ SWITCH IMMEDIATELY — not just depleted   │
│ earlier findings       │ but misleading. Cut losses               │
└────────────────────────┴──────────────────────────────────────────┘

Key: factor in switch cost. Moving to new hypothesis means loading new context, which has cost. Do not switch for marginal gains — switch when current trail clearly depleted.

Got: Deliberate pick to continue or switch by yield check, not habit or frustration. Switches are evidence-based, not impulse-driven.

If fail: Switch happens too often (oscillation between hypotheses)? Switch cost being under-valued. Commit to current trail for N more actions before recheck. Switch never happens (stuck on one trail despite dropping yield)? Set hard cap: after N unproductive actions, switch no matter sunk cost.

Step 5: Adapt Strategy to Results

By forage results, pick right next phase.

  1. Most scouts empty, one trail weak → problem likely misframed. Step back and reframe: what question should we be asking?
  2. One strong trail, others empty → concentrated problem. Exploit strong trail with full focus
  3. Many competing trails → distributed problem. Apply build-coherence to pick among them
  4. Clear winner emerging → move from roam to exploit. Drop scouting budget to 10-20% (keep one scout active for alternatives), commit main effort to winning path
  5. All trails exhausted → solution may not exist in current search space. Expand: different tools, different assumptions, ask user

Got: Strategic pick about next phase that follows logically from forage results. Pick should feel like conclusion, not guess.

If fail: No strategy feels right? Forage has shown real uncertainty — and that is valid outcome. Say uncertainty to user: "I roamed N paths and found X. Most hopeful is Y because Z. Shall I pursue it, or do you have extra context?"

Validation

  • Solution landscape sorted before scouting started
  • At least 3 independent hypotheses made and tested
  • Scout tests cheap (one action each) and independent
  • Trail reinforcement based on evidence, not preference
  • Marginal value checked before commit to deep dig
  • Strategy adapted to results rather than follow fixed plan

Pitfalls

  • Premature exploit: Dive deep into first hypothesis that shows any promise without scouting alternatives. This is most common fail — first good idea is often not best idea
  • Endless scouting: Make hypotheses endless without ever commit to one. Set budget: after N scouts, commit to best trail no matter what
  • Non-independent hypotheses: "Maybe it's in file A" and "maybe it's in file B, which is imported by file A" are not independent — they share assumptions. Force real diversity of path
  • Ignore inhibition signals: When evidence clashes with hypothesis, let it go. Keep invest in contradicted trail because of effort already spent is forage equivalent of sunk cost fallacy
  • Scout without record: If scout results not logged, later scouts will repeat earlier work. Brief note what each scout found before move to next

See Also

  • forage-resources — multi-agent forage model that this skill adapts to single-agent solution search
  • build-coherence — used when forage shows many valid paths that need check
  • coordinate-reasoning — manages info flow between scout hypotheses and exploit phases
  • awareness — watches for premature converge and tunnel vision during forage

GitHub 仓库

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

相关推荐技能

evaluating-llms-harness

测试

该Skill通过60+个学术基准测试(如MMLU、GSM8K等)评估大语言模型质量,适用于模型对比、学术研究及训练进度追踪。它支持HuggingFace、vLLM和API接口,被EleutherAI等行业领先机构广泛采用。开发者可通过简单命令行快速对模型进行多任务批量评估。

查看技能

cloudflare-cron-triggers

测试

这个Claude Skill提供了关于Cloudflare Cron Triggers的完整知识库,用于通过cron表达式定时执行Workers。它支持配置周期性任务、维护作业和自动化工作流,并能处理常见的cron触发错误。开发者可以用它来设置定时任务、测试cron处理器,并集成Workflows和Green Compute功能。

查看技能

webapp-testing

测试

该Skill为开发者提供了基于Playwright的本地Web应用测试工具集,支持自动化测试前端功能、调试UI行为、捕获屏幕截图和查看浏览器日志。它包含管理服务器生命周期的辅助脚本,可直接作为黑盒工具运行而无需阅读源码。适用于需要快速验证本地Web应用界面和交互功能的开发场景。

查看技能

finishing-a-development-branch

测试

这个Skill用于开发分支完成后的集成决策,当代码实现完成且测试通过时,它会引导开发者选择合适的工作流。它首先验证测试状态,然后提供合并、创建PR或清理等结构化选项。核心价值在于确保代码质量的同时,标准化分支收尾流程。

查看技能