返回技能列表

forage-solutions

pjt222
更新于 Yesterday
5 次查看
17
2
17
在 GitHub 上查看
测试aidesign

关于

This skill helps developers explore multiple solution paths simultaneously using an ant colony optimization metaphor. It's designed for complex problems with no clear best approach, such as ambiguous debugging or when initial solutions stall. The skill systematically tests hypotheses, reinforces promising ones, and intelligently decides when to abandon unproductive strategies.

快速安装

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

Explore a solution space using ant colony optimization principles — deploying independent hypotheses as scouts, reinforcing promising approaches through evidence, detecting diminishing returns, and knowing when to abandon a strategy and explore elsewhere.

适用场景

  • Facing a problem with multiple plausible approaches and no clear winner
  • When the first approach tried is not working but alternatives are unclear
  • Debugging with no obvious root cause — multiple hypotheses need parallel investigation
  • Searching a codebase for the source of a behavior when the location is unknown
  • When previous solution attempts have converged prematurely on a suboptimal approach
  • Complementing build-coherence when the solution space must be explored before a decision is made

输入

  • 必需: Problem description or goal (what are we foraging for?)
  • 必需: Current state of knowledge (what is already known?)
  • 可选: Previous approaches tried and their outcomes
  • 可选: Constraints on exploration (time budget, tool availability)
  • 可选: Urgency level (affects exploration-exploitation balance)

步骤

第 1 步:Map the Solution Landscape

Before deploying scouts, characterize the shape of the 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   │
└────────────────────┴──────────────────────────────────────────────────┘

Classify the current problem. The distribution type determines how many scouts to deploy and how quickly to switch from exploration to exploitation.

预期结果: A clear characterization of the solution landscape that informs scouting strategy. The classification should feel accurate to the problem, not forced.

失败处理: If the landscape is completely unknown, that itself is the classification — treat it as potentially distributed and deploy broad scouts. The first round of scouting will reveal the landscape character.

第 2 步:Deploy Scout Hypotheses

Generate independent hypotheses as scouts. Each scout probes the solution space in a different direction.

  1. Generate 3-5 independent hypotheses about the problem or its solution
  2. For each hypothesis, define one cheap test — a single file read, one grep, one specific check
  3. Rate initial promise based on available evidence (not gut feeling)
  4. Deploy scouts independently: do not let the assessment of hypothesis A influence the test of hypothesis B
Scout Deployment Template:
┌───────┬──────────────────────┬──────────────────────┬──────────┐
│ Scout │ Hypothesis           │ Test (one action)    │ Promise  │
├───────┼──────────────────────┼──────────────────────┼──────────┤
│ 1     │                      │                      │ High/Med/│
│ 2     │                      │                      │ Low      │
│ 3     │                      │                      │          │
│ 4     │                      │                      │          │
│ 5     │                      │                      │          │
└───────┴──────────────────────┴──────────────────────┴──────────┘

Key principle: scouts assess, they do not exploit. The goal is a quick signal on each hypothesis, not a deep investigation of the first one that looks promising.

预期结果: 3-5 independent hypotheses with cheap tests defined. No hypothesis has been deeply explored yet — this is a breadth-first pass.

失败处理: If fewer than 3 hypotheses can be generated, the problem is either very constrained (concentrated type — good, scout aggressively) or understanding is too shallow (read more context before hypothesizing). If hypotheses are not independent (they are all variations of the same idea), the exploration is too narrow — force at least one hypothesis that contradicts the others.

第 3 步:Trail Reinforcement — Follow the Evidence

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

  1. Review scout results: which hypotheses found supporting evidence?
  2. Strong evidence found → reinforce the trail: invest more investigation effort here
  3. No evidence found → let the trail decay: do not investigate further without new signals
  4. Contradicting evidence found → mark as inhibition signal: actively avoid this path
  5. Monitor for premature convergence: if all effort flows to the first trail reinforced, force one scout into unexplored territory
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                 │
└───────────────────────────┴──────────────────────────────────────┘

预期结果: A clear prioritization of trails based on evidence, not preference. The strongest trail gets the most attention, but at least one alternative stays alive.

失败处理: If all scouts return empty, the hypotheses were wrong — not the approach. Reframe the question: "What assumptions am I making that could be wrong?" Generate new hypotheses from a different angle. If all scouts return strong signals, the problem may be distributed (multiple valid answers) — switch to build-coherence for approach selection.

第 4 步:Marginal Value Theorem — Know When to Leave

Monitor the yield of the current approach. When the information gained per unit of effort drops below the average across all approaches, it is 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               │
└────────────────────────┴──────────────────────────────────────────┘

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

预期结果: A deliberate decision to continue or switch based on yield assessment, not habit or frustration. Switches are evidence-based, not impulse-driven.

失败处理: If switching happens too frequently (oscillation between hypotheses), the switching cost is being undervalued. Commit to the current trail for N more actions before reassessing. If switching never happens (stuck on one trail despite declining yield), set a hard cap: after N unproductive actions, switch regardless of sunk cost.

第 5 步:Adapt Strategy to Results

Based on the foraging results, select the appropriate next phase.

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

预期结果: A strategic decision about the next phase that follows logically from the foraging results. The decision should feel like a conclusion, not a guess.

失败处理: If no strategy feels right, the foraging has revealed genuine uncertainty — and that is a valid outcome. Communicate the uncertainty to the user: "I explored N approaches and found X. The most promising is Y because Z. Shall I pursue it, or do you have additional context?"

验证清单

  • Solution landscape was characterized before scouting began
  • At least 3 independent hypotheses were generated and tested
  • Scout tests were cheap (one action each) and independent
  • Trail reinforcement was based on evidence, not preference
  • Marginal value was assessed before committing to deep investigation
  • The strategy adapted to results rather than following a fixed plan

常见问题

  • Premature exploitation: Diving deep into the first hypothesis that shows any promise without scouting alternatives. This is the most common failure — the first good idea is often not the best idea
  • Perpetual scouting: Generating hypotheses endlessly without ever committing to one. Set a budget: after N scouts, commit to the best trail regardless
  • 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 genuine diversity of approach
  • Ignoring inhibition signals: When evidence contradicts a hypothesis, let it go. Continuing to invest in a contradicted trail because of effort already spent is the foraging equivalent of sunk cost fallacy
  • Scouting without recording: If scout results are not recorded, later scouts will repeat earlier work. Briefly note what each scout found before moving to the next

相关技能

  • forage-resources — the multi-agent foraging model that this skill adapts to single-agent solution search
  • build-coherence — used when foraging reveals multiple valid approaches that need evaluation
  • coordinate-reasoning — manages the information flow between scout hypotheses and exploitation phases
  • awareness — monitors for premature convergence and tunnel vision during foraging

GitHub 仓库

pjt222/agent-almanac
路径: i18n/zh-CN/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或清理等结构化选项。核心价值在于确保代码质量的同时,标准化分支收尾流程。

查看技能