一键导入
nau-au-kuter-2003-shop2
SHOP2 hierarchical task network planner for automated planning through recursive task decomposition
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
SHOP2 hierarchical task network planner for automated planning through recursive task decomposition
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Instruction manual for agents driving Port Daddy multi-agent coordination. Use when an agent will edit a repo, recover work, coordinate with other sessions, inspect FleetBar/Fleet Control Center truth, package skill/docs surfaces, or leave a durable handoff. NOT for generic coding that does not need Port Daddy state.
Contributor manual for agents working ON the Port Daddy codebase itself — the daemon, MCP server, FleetBar / Fleet Control Center, website, CLI surface, distribution mirrors, internal recovery ledger, and the named internal actors (Coxswain / Navigator / Cartographer / Lookout / Quartermaster + Shipwright). Use when editing the port-daddy repo. NOT for agents using Port Daddy on other projects (use port-daddy-agent-skill for that), and NOT distributed to public skill catalogs — this skill is private to the port-daddy repo.
Decide which single operator surface — Scout, FleetBar, or pd-console — owns each capability by its distance-from-work (intake/ambient/deep), and audit that placement for authority spread, unenforceable controls, evidence overflow into FleetBar, and hot/cool bus-subscription mismatches. Use when placing a new capability on one of Agent Harbor's three operator surfaces, reconciling a mockup that duplicates a capability across two surfaces, or auditing an existing operator-surface spec before implementation locks it in. NOT for choosing SDK/CLI/MCP/GUI surfaces for API-consuming developers (developer-surface-strategist), designing the concrete interaction flow within one already-assigned surface (agentic-coding-ux-designer), or the hot-bus/cool-bus transport mechanics themselves (swarm-invocation-designer).
Audit what PRs this session produced. Ask: "What work did I do this session that isn't in a PR yet, or isn't merged?" Forces the agent to account for all code changes before declaring done. Use at any point — especially at session end, after a manager wave, or when asked "what's left?"
After each execution wave completes, inspect the DAG's commitment landscape and premortem risk score. If any surviving nodes carry `commitment_level: TENTATIVE`, or if the premortem `recommendation` is `ACCEPT_WITH_MONITORING` or `ESCALATE_TO_HUMAN`, pause execution and run a structured parley: re-evaluate TENTATIVE nodes against the evidence produced by the just-completed wave, update risk severity where warranted, and either promote nodes to COMMITTED, demote them to EXPLORATORY, or prune them before launching the next wave. Parley is a scheduled operation triggered by wave completion — not an ad-hoc intervention — making wave boundaries the natural formation-break point where plans meet reality.
Build and extend pd-console — Port Daddy's GPU-native macOS operator console (GPUI 0.2.x, Zed's Rust UI). Covers the render-agnostic Block/Pane(Surface) contract, the two-thread reqwest↔smol refresh pipeline, Taffy flexbox layout, uniform_list virtual scroll, focus + keyboard nav, the OKLCH theme and ICS maritime flag badges, GPUI's missing text-input, and the real feature-gated cargo/CI gate. Use when adding panes, visual polish, or debugging GPUI rendering/layout/focus in core/pd-console. NOT for the TypeScript daemon, generic Rust toolchain/borrow-checker help (use rust-with-claude-code), or non-pd GPUI apps with a different theme/architecture.
| license | Apache-2.0 |
| name | nau-au-kuter-2003-shop2 |
| description | SHOP2 hierarchical task network planner for automated planning through recursive task decomposition |
| metadata | {"category":"Research & Academic","tags":["htn-planning","shop2","task-decomposition","automated-planning","hierarchical"],"io-contract":{"kind":"deliverable","produces":[{"kind":"design-doc","description":"HTN domain specification with task hierarchy, methods, preconditions, and decomposition strategy for a given planning problem","format":"markdown"},{"kind":"refactor-plan","description":"Analysis of planning failures with diagnosis (domain bugs, specification gaps, search explosion) and concrete fixes to method definitions or state management","format":"markdown"},{"kind":"code","description":"SHOP2-compatible PDDL domain and problem files, or method library encoding expert procedures for task decomposition","language":"lisp","format":"text"},{"kind":"critique","description":"Evaluation of a proposed planning architecture against HTN principles (ordered decomposition, method specificity, abstraction levels, specification-execution alignment)","format":"markdown"}]}} |
| allowed-tools | Read,Write,Edit,Glob,Grep |
Plan tasks in execution order to transform exponential state-space reasoning into linear complexity. With known current state, you can trivially call external functions and make decisions based on actual conditions, not possibility spaces.
Represent domain knowledge as methods that capture how experts solve problems. A method says "to accomplish X in situation Y, do subtasks A, B, C in that order"—transforming search problems into procedure selection.
Work at the highest abstraction level possible. Planning "transport-person" is tractable; planning 200 atomic movements from first principles is not. Decompose only when necessary for current execution.
IF domain has established expert procedures
→ Encode as HTN methods with preconditions
→ Use sort-by heuristics for method selection
ELSE IF domain requires learning/discovery
→ Start with learned policies
→ Migrate successful patterns to methods over time
ELSE IF procedures vary significantly by context
→ Use conditional methods with situation-specific preconditions
→ Maintain method libraries organized by context types
IF execution order determinable at planning time
→ Use ordered decomposition for simple state reasoning
→ Maintain definite current state, not possibility sets
ELSE IF tasks genuinely independent and parallelizable
→ Use partial-order planning
→ Accept cost of tracking state uncertainty
ELSE IF complex reasoning needed (temporal, probabilistic)
→ First try state augmentation (add timestamps, probabilities)
→ Only build specialized reasoning engines if augmentation insufficient
IF domain description differs from execution environment
→ Maintain automated translation layer
→ Validate translation with small test cases
ELSE IF execution failures occur frequently
→ Check specification-vs-execution gap first
→ Verify operator effects match actual execution results
ELSE IF performance inadequate
→ Add domain-specific methods to baseline capabilities
→ Profile for exponential search patterns
IF domain experts exist and procedures are established
→ Hand-code methods encoding expert knowledge
→ Accept "cheating" vs pure learning for 2x performance gain
ELSE IF domain exploratory or procedures unknown
→ Use automated learning with PDDL operators
→ Plan to migrate learned patterns to explicit methods
ELSE IF mixed domain (some known procedures, some discovery)
→ Hybrid: methods for known procedures, learning for novel situations
→ Automated promotion of successful learned patterns to methods
Detection Rule: Planner generates syntactically valid plans that fail during execution Symptom: Plans look correct, execute incorrectly, consistent failure pattern across similar problems Diagnosis: Hand-written HTN methods contain logical errors—wrong preconditions, incorrect effect specifications, missing edge cases Fix: Systematic testing of methods on small instances; automated validation tools; pair programming for method development
Detection Rule: Mysterious planning failures on problems that should be solvable Symptom: PDDL operators work in other planners but SHOP2 translation produces poor performance or invalid plans Diagnosis: Gap between what operators specify and how tasks are actually accomplished; missing procedural knowledge Fix: Manual enhancement of auto-translated domains; encode expert procedures as methods; validate translation with domain experts
Detection Rule: Planning time grows exponentially with problem size; solver times out on medium instances Symptom: Planner explores vast numbers of decompositions; thrashes between similar partial plans; memory usage grows uncontrollably Diagnosis: Missing domain-specific methods cause fall-back to inefficient search; no heuristic guidance for method selection Fix: Add methods that encode standard procedures; implement sort-by heuristics; profile search patterns to identify missing knowledge
Detection Rule: Planner backtracks excessively between competing valid decompositions Symptom: Multiple methods applicable to same task; solver oscillates between options; search depth grows without progress Diagnosis: Methods lack sufficient specificity in preconditions; competing heuristics without clear priority ordering Fix: Refine method preconditions for better context sensitivity; implement preference ordering; add meta-methods for method selection
Detection Rule: Complex optimization produces worse results than simple heuristic approaches Symptom: Sophisticated search algorithms underperform greedy method selection; optimal planning fails on problems simple heuristics solve Diagnosis: Over-investment in search sophistication without adequate domain knowledge; treating domain expertise as "cheating" Fix: Encode domain heuristics first; start with simple greedy search; add sophistication only when domain knowledge insufficient
Scenario: Design coordination system for multi-agent document generation (research, outline, draft, review, edit).
Novice Approach: Create agents for each subtask, use message passing for coordination, track all possible states.
Expert HTN Analysis:
Method: generate-document
Preconditions: topic assigned, no existing document
Decomposition: research-topic, create-outline, draft-sections, review-draft, finalize-document
Key Decision: Use ordered decomposition with known handoff points rather than tracking all possible agent interaction states. Reduces complexity from O(n!) to O(n).
Trade-off Navigated: Accept constraint of sequential high-level phases (can't start drafting before research) to gain tractable coordination. Allow parallelism within phases via state augmentation.
Scenario: Plan multi-day conference setup with limited staff, equipment conflicts, vendor dependencies.
Novice Approach: Model as constraint satisfaction problem with all resources, times, dependencies as variables.
Expert HTN Analysis:
Method: setup-conference-day
Preconditions: venue confirmed, staff assigned, equipment list finalized
Decomposition: setup-venue, test-av-systems, prepare-catering, brief-staff
Sort-by: critical-path-first (AV failures block everything)
Key Decision: Encode conference management expertise as methods rather than discovering optimal schedules through search. Expert procedures handle 95% of situations; search only needed for novel constraints.
Alternative Considered: Pure optimization approach would find "optimal" schedules but miss critical dependencies that conference experts know (e.g., catering setup must happen after final headcount, not at optimal resource utilization time).
diagrams/01_flowchart_htn_planning_decision_framewor.md — Decision tree for HTN planning challenges (execution order, decomposition, concurrency, search explosion). Read when choosing between ordered decomposition, partial-order planning, or specialized reasoning.
diagrams/02_mindmap_htn_planning_core_mental_model.md — Mental models for ordered decomposition, method encoding, hierarchical abstraction with application patterns and pitfalls. Read when designing task decomposition strategy or debugging planning failures.
diagrams/03_stateDiagram-v2_agent_task_decomposition_state.md — State machine for goal decomposition, method selection, subtask execution, and backtracking. Read when implementing agent control flow or understanding decomposition lifecycle.
references/ordered-decomposition-eliminates-uncertainty.md — How execution-order planning transforms exponential state reasoning into linear complexity by maintaining definite current state. Read when justifying ordered decomposition vs. classical planning approaches.
references/htn-methods-as-expert-procedures.md — HTN methods encode standard operating procedures; comparison with classical planning and learning-based approaches. Read when deciding whether to hand-code methods or learn from data.
references/sort-by-and-search-control.md — Heuristic guidance for method selection via sort-by without hard commitments; handling nondeterministic choice points. Read when optimizing search performance or implementing method ranking.
references/gap-between-specification-and-execution.md — Translation problem between PDDL specifications and SHOP2 execution; why automated translation requires validation. Read when debugging specification-vs-execution mismatches or building translators.
references/failure-modes-in-complex-planning.md — AIPS-2000 failure case: incorrect domain descriptions causing invalid plans; lessons on domain validation. Read when diagnosing planning failures or establishing domain verification procedures.
references/hand-tailorable-vs-automated-tradeoff.md — Competition results comparing hand-tailorable (SHOP2, TLPlan) vs. fully-automated planners; performance and knowledge engineering tradeoffs. Read when evaluating whether to invest in domain-specific knowledge encoding.
references/multi-timeline-temporal-reasoning.md — State augmentation for handling concurrency without explicit temporal reasoning; preprocessing approach for durative actions. Read when extending SHOP2 to temporal/concurrent domains.
Task Planning Completeness:
Domain Knowledge Coverage:
Performance and Scalability:
Correctness and Robustness:
Don't Use HTN Planning For:
Delegate Instead:
HTN Is For: Complex tasks with established procedures, where expert knowledge exists about how to accomplish goals, and where the challenge is selecting and orchestrating appropriate methods rather than discovering optimal solutions from first principles.