本文へ移動
cccskills
無料GitHub で公開

foundations-ai-planning-search

Applies planning/search theory (A*, CSP, MCTS, PDDL, HTN) to agents. Use when ordering tool calls, enforcing preconditions before side effects, or validating a plan.

インストール方法を見る

含まれるファイル(12)

  • SKILL.md14.1 KB
  • agents/openai.yaml366 B
  • data/plan-fixtures.json336 B
  • data/sources.json13.9 KB
  • learnings.consolidated.md779 B
  • learnings.md580 B
  • references/formal-theory-map.md1.8 KB
  • references/patterns-scenarios-traps.md11.0 KB
  • references/practical-contract.md3.1 KB
  • references/primitives-overview.md18.0 KB
  • scripts/replay_plan.py3.2 KB
  • scripts/test_replay_plan.py3.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

AI Planning And Search Foundations

Quick Reference

Each primitive is expanded in references/primitives-overview.md. Use references/patterns-scenarios-traps.md for scenario recipes and references/formal-theory-map.md when completeness, optimality, or complexity claims matter.

#PrimitiveProblem It SolvesFailure Mode AddressedKey Parameters
1Problem FormulationVague tasks cannot be searched or verifiedAgent cannot know what counts as legal progressState, actions, transition model, goal test, path cost
2Uninformed SearchNeed complete baseline without domain heuristicNo baseline for completeness, optimality, or frontier explosionBranching factor b; depth d; frontier policy
3Heuristic SearchLarge state spaces need directed explorationState space explodes because exploration is undirectedHeuristic h(n); admissibility; consistency
4Local SearchState is large but path is irrelevantPath-tracking wastes memory when only final configuration mattersNeighborhood; objective; restart/schedule
5Constraint SatisfactionNeed assignments satisfying hard constraintsConstraints are mixed into prompts instead of enforced structurallyVariables, domains, constraints, MRV/LCV, arc consistency
6Adversarial SearchOpponent actions affect outcomesOpponent response is ignored or treated as noiseUtility, depth, alpha-beta bounds, rollout policy
7Classical PlanningNeed valid action sequence from symbolic preconditions/effectsPreconditions and effects are implicit, so invalid plans pass reviewSTRIPS/PDDL, progression/regression, plan graph
8Hierarchical PlanningTasks decompose into reusable subplansRepeated task decomposition is ad hoc and inconsistentMethods, subtasks, ordering constraints
9Contingent / Belief-State PlanningPartial observability or nondeterministic actionsPlan assumes full observability or deterministic actionsBelief state, sensing actions, policy vs sequence
10Planner-Agent IntegrationLLM agent needs explicit plan validity and search boundariesLLM tool loop lacks plan validation, replanning, or bounded searchPlanner tool, state abstraction, verifier, replanning trigger

When to Apply

Apply this skill when:

  • The task can be stated as states, actions, transitions, goals, and costs.
  • You need A*, uniform-cost search, beam search, backtracking, alpha-beta, MCTS, STRIPS/PDDL, HTN, or CSP reasoning.
  • An LLM agent is hallucinating action sequences that need explicit validity checks.
  • The workflow needs a planner as a tool, not only prompt decomposition.
  • A search or planning algorithm choice changes runtime, completeness, optimality, or failure behavior.

Skip or route elsewhere when:

  • It is product search, vector retrieval, ranking, or query matching -> use software-search or ai-rag.
  • It is expected utility, value of information, real options, or bandits -> use foundations-decision-theory.
  • It is feedback control, setpoint tracking, or MPC -> use foundations-control-theory.
  • It is strategic incentive design or equilibrium -> use foundations-game-theory.
  • It is cooperative subagent allocation with shared payoff and partitioned information -> use foundations-team-theory.
  • It is general agent architecture, memory, tools, or MCP/A2A orchestration -> use ai-agents after this skill defines the planner boundary.

Anti-Patterns

Anti-PatternPlanning/Search DiagnosisFix
"Ask the LLM to plan" with no state modelNo legal-action or goal-test boundaryDefine state, action schema, preconditions, effects, and cost (#1, #7)
Greedy search used where optimality is promisedHeuristic is not an admissible cost lower boundUse A* with admissible/consistent heuristic or stop promising optimality (#3)
BFS on high branching factor without depth boundFrontier blowupUse UCS/A*, iterative deepening, pruning, or abstraction (#2, #3)
Constraints buried in prompt proseViolations are discovered after executionModel as CSP with propagation and backtracking (#5)
Minimax for real-world negotiationPayoffs and strategies are not a finite game treeRoute incentive/equilibrium design to foundations-game-theory (#6 boundary)
PDDL generated but never validatedPlanner accepts malformed or semantically wrong domainRun domain/problem validation and check plan preconditions/effects (#7)
Replanning on every token/tool callPlanner-agent boundary is too fine-grainedReplan only on state drift, failed precondition, or new observation (#10)
Treating a valid plan as a safe planValidity checks preconditions/effects; it does not check whether the goal or path is one that should be executedAdd a separate safety/permission gate over the action set — validity and safety are independent axes (#7, #10)
Adding tree search to raise accuracy without a verifierSearch amplifies the scoring signal; an unreliable scorer just finds higher-confidence errors fasterEstablish scorer/verifier reliability first, then compare against best-of-N at matched compute, bucketed by difficulty, before adopting tree/beam search (#3, #6)

Misuse Boundaries

MisuseWhy It Is WrongRequired Correction
Calling a prompt outline a planIt has no executable action model or validity checkConvert to state/action/precondition/effect model
Treating local optimum as global optimumLocal search is incomplete without strong assumptionsUse restarts, exact search for small instances, or state the approximation
Using A* with an overestimating heuristic while claiming optimalityA* optimality depends on admissibility/consistencyProve h(n) <= true remaining cost or downgrade claim
Modeling soft preferences as hard CSP constraintsSearch may become infeasible for avoidable reasonsSeparate hard constraints from weighted objectives
Using adversarial search for cooperative teamsCooperative information structure has different primitivesRoute to foundations-team-theory
Treating partial observability as deterministic planningActions may need sensing and contingenciesUse belief-state or contingent planning (#9)
Inferring plan safety from planning competenceMeasured separately, the two do not track each other: a model can be near-perfect at producing executable plans and still route a large fraction of tasks through dangerous actionsGate the action set independently of the planner's success metric (#10)

Before claiming a search guarantee, load the guarantee matrix: finite branching and nonnegative costs alone do not establish UCS/A* completeness in infinite spaces; the standard bound requires step costs bounded below by positive epsilon. A* graph search must reopen improved states with an admissible but inconsistent heuristic, or use consistency when permanently closing nodes. Planner validity requires correct action preconditions/effects. Do not invent benchmark numbers. If a planner or solver is recommended, report assumptions, problem size, and validation cases instead of generic speed claims.

LLM planning benchmark numbers move fast and are rarely comparable across papers: success rate depends on domain, instance size, prompt encoding, number of retries, and whether a verifier was in the loop. Cite the specific setup or state the result qualitatively; do not carry a headline percentage across domains.


Composition Recipes

LLM Agent With Valid Plans

Failure: Agent produces plausible steps that violate tool preconditions.

  • Problem formulation (#1): define typed state and legal action schema.
  • Classical planning (#7): encode preconditions/effects for tools.
  • Planner-agent integration (#10): LLM proposes goals or abstractions; planner validates; executor runs only valid next action.
  • Replanning trigger (#10): replan after failed precondition, external state drift, or new observation.

Configuration Assistant That Respects Constraints

Failure: Recommendations violate compatibility, license, budget, or availability constraints.

  • CSP (#5): model components as variables and compatibility rules as constraints.
  • Local search (#4): if preferences are soft and space is too large for exact search.
  • Decision theory boundary: route scoring tradeoffs to foundations-decision-theory when expected value or risk weighting matters.

Game Or Simulation Agent

Failure: Agent picks locally good moves and misses opponent responses.

  • Adversarial search (#6): minimax or alpha-beta for deterministic games.
  • MCTS (#6): stochastic or high-branching games with rollout evaluation.
  • Heuristic search (#3): evaluate states with domain heuristic.
  • Game theory boundary: route equilibrium, mechanism, or incentive design to foundations-game-theory.

Workflow Planner For Human Operations

Failure: Task decomposition is repeated manually and varies across runs.

  • HTN (#8): encode standard decompositions and method selection.
  • Classical planning (#7): validate preconditions for steps with tool or data dependencies.
  • Grounding boundary: use foundations-grounding-communication for handoff repair and common-ground checks.

"Works In The Demo, Fails In Production"

Failure: A planner or agent loop that passed every walkthrough degrades or breaks under real traffic.

  • Diagnose in order of likelihood before assuming a logic bug: production branching factor vs. demo branching factor, heuristic/verifier fit to the demo distribution, unmodeled nondeterminism, missing or unbounded replanning triggers, a validator that exists in eval but not in the production executor path, and search budget (rollouts/nodes/beam width) silently shrunk by latency or cost limits.
  • Full diagnostic checklist: references/patterns-scenarios-traps.md.

Workflow

  1. Formulate the problem as state, actions, transition model, goal test, and cost.
  2. Classify the dominant structure: path search, assignment/CSP, game tree, symbolic plan, hierarchy, or uncertainty.
  3. Choose the simplest algorithm family that preserves required guarantees: completeness, optimality, bounded memory, or good-enough solution quality.
  4. Write the search/planning assumptions explicitly before implementation.
  5. For LLM agents, decide what the LLM may propose and what the planner/verifier must enforce.
  6. Validate with small hand-checkable cases, impossible cases, and adversarial edge cases.

Before claiming a guarantee, record a one-row guarantee ledger: claim | algorithm | model assumptions | runtime limits | verifier | counterexample test. Completeness or optimality belongs to the modeled problem, not automatically to the real executor. If preconditions, effects, costs, observability, or resource limits differ in production, report the result as a validated heuristic plan rather than inheriting the algorithm's theorem.


Navigation

Related Skills

  • foundations-decision-theory - utility, value of information, regret, and bandits.
  • foundations-control-theory - feedback loops, stability, and MPC.
  • foundations-game-theory - incentives, equilibrium, mechanism design, and strategic actors.
  • foundations-team-theory - cooperative multi-agent allocation with shared payoff.
  • foundations-grounding-communication - handoff repair and common-ground checks for HTN workflow planners.
  • foundations-mathematical-optimization - scheduling, allocation, and CP-SAT for duration/resource/precedence problems without state-dependent preconditions.
  • foundations-formal-methods - LLM-generated formal specifications and sound-tool verification, the same pattern this skill applies to PDDL.

Learnings Loop

When prior decisions or pitfalls are relevant, consult learnings.consolidated.md if present; use learnings.md only for needed history or as the available fallback. Otherwise skip both.

After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Configures Claude Code hooks and Codex hooks.json/notify. Use when adding PreToolUse guards, Stop hooks, managed hooks, format-on-save, preflight, audits, or worktree/budget hooks.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Configures and hardens Claude Code and Codex MCP servers. Use when connecting databases, APIs, SaaS, building servers, or serving a clearance-filtered knowledge base.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Owns instruction files: AGENTS.md, CLAUDE.md, personal and repo rules. Use when writing, pruning, auditing them, sharing rules across Claude and Codex, or fixing ignored rules.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Creates and audits agent skills: SKILL.md, references, scripts, runtime metadata. Use when writing, validating, or security-reviewing a skill, or fixing truncated skill listings.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Adds per-skill learnings loops for dated patterns, mistakes, and domain facts. Use when wiring skill memory, consolidation, or drift audits.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Chooses subagent, team, workflow, or debate and launches it on Claude Code or Codex. Use when delegating, running agent review boards, or installing shared agents.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

vasilyu1983 のスキルをすべて見る

このスキルの問題を報告する