From agent-almanac
Explores solution spaces using ant colony optimization: deploys scout hypotheses, reinforces promising approaches, abandons dead-ends. For multi-approach problems, unclear debugging, codebase searches.
npx claudepluginhub pjt222/agent-almanacThis skill uses the workspace's default tool permissions.
---
Applies ant colony optimization and foraging theory to search large solution spaces, balancing exploration of new approaches with exploitation of known good ones.
Enforces scientific method—observation, falsifiable hypotheses, predictions, experiments, conclusions—for debugging unclear causes, intermittent issues, failed attempts, or uncertain architecture decisions.
Provides structured reasoning for stalled debugging or complex problems: frame issues, track hypotheses, gather/evaluate evidence, progress confidence levels to avoid loops.
Share bugs, ideas, or general feedback.
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.
build-coherence when the solution space must be explored before a decision is madeBefore 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.
Expected: A clear characterization of the solution landscape that informs scouting strategy. The classification should feel accurate to the problem, not forced.
On failure: 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.
Generate independent hypotheses as scouts. Each scout probes the solution space in a different direction.
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.
Expected: 3-5 independent hypotheses with cheap tests defined. No hypothesis has been deeply explored yet — this is a breadth-first pass.
On failure: 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.
After scout results return, reinforce promising trails and let weak ones decay.
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 │
└───────────────────────────┴──────────────────────────────────────┘
Expected: A clear prioritization of trails based on evidence, not preference. The strongest trail gets the most attention, but at least one alternative stays alive.
On failure: 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.
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.
Expected: A deliberate decision to continue or switch based on yield assessment, not habit or frustration. Switches are evidence-based, not impulse-driven.
On failure: 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.
Based on the foraging results, select the appropriate next phase.
build-coherence to select among themExpected: A strategic decision about the next phase that follows logically from the foraging results. The decision should feel like a conclusion, not a guess.
On failure: 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?"
forage-resources — the multi-agent foraging model that this skill adapts to single-agent solution searchbuild-coherence — used when foraging reveals multiple valid approaches that need evaluationcoordinate-reasoning — manages the information flow between scout hypotheses and exploitation phasesawareness — monitors for premature convergence and tunnel vision during foraging