Pddl tpp planning

From XuShuwenn/RedAct · View interactive version

Pddl tpp planning is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Solve travelling purchase problem (TPP) tasks using PDDL planning, generating valid plans from domain and problem files.

How to use this skill

Skill file

PDDL Planning for TPP Tasks

When to Use

Execution Protocol

Input Format

problem.json entries:

{
  "id": "problem_id",
  "domain": ".../xxx.pddl",
  "problem": ".../yyy.pddl",
  "plan_output": "xxx/problem_id.txt"
}

Manifest discipline

Workflow

  1. Read the task instructions for execution constraints before acting; confirm available tools, the exact required tool-call/action schema, whether one-action-per-turn or observation waits are required, and any exact completion signal

1a. Explicitly note the required tool/action schema and exact final completion text before making any tool call.

1b. If using an external planner/validator/library interface, run a minimal inspection first to confirm import path, callable names, return shape, and how success is reported before writing larger scripts.

  1. Load the full PDDL domain file and inspect complete action schemas
  2. Load the full PDDL problem file and inspect complete initial facts and goals
  3. If any file/tool output is truncated, cut off, or ends mid-line/mid-token, fetch the missing content before reasoning further

4a. Treat truncated or incomplete domain/problem output as a hard stop for planning: do not guess missing :action, :init, :goal, objects, predicates, parameter meanings, or goals from examples, memory, prior TPP patterns, or planner-output snippets.

4b. A domain is not ready for planning until the full schemas of every action you may use are visible, and a problem is not ready until the complete relevant initial facts and full :goal section have been explicitly inspected.

4c. Do not generate, write, validate, or describe a plan until the complete action schemas you rely on and the complete relevant problem :init and :goal sections have been directly observed.

  1. Verify action names, parameter order, preconditions/effects, predicate meanings, and any level-transition arguments from the actual domain before instantiating actions

5a. Never assume standard TPP actions such as drive, buy, load, or unload exist or use familiar parameter orders until you have directly observed their schemas in the current domain file.

5b. For every action you plan to use, extract its full schema from the domain and map each concrete argument position back to that schema exactly; do not reuse level/count arguments from examples or prior tasks.

5c. Cross-check your intended plan against literals actually observed in the full problem file; if any planned step conflicts with the visible initial state, depends on unseen facts, or a claimed goal/fact was not directly seen, stop and inspect further before proceeding.

  1. Generate plan using planner, or manually derive one only after complete inspection of the full domain and problem

6a. If using a planner/skill, confirm the call actually ran and inspect its returned result or generated files before proceeding.

6b. If planner output is only banners/setup text, warnings, missing, or truncated, do not treat that as a found or validated plan; capture more reliable output or debug the invocation/result.

6c. If expected plan files are missing, do not assume silent success.

6d. Switch to manual derivation only if planner use is unavailable or failing, and then keep the same semantic-validation standard.

  1. Check each planned action is applicable from the current accumulated state and update the state step by step

7a. Keep a small state trace while planning: after each action, update truck location, where each good is, possession, and any before/after symbolic level values touched by buy/load/unload so later steps use the post-state from earlier actions.

7b. Compare the planned steps against the observed initial state before writing: if a fact such as a good already being loaded, available, or otherwise satisfied is already true, do not add redundant setup actions unless the full domain and goal show they are still required.

7c. Check the final accumulated state against the explicit problem goal literals before writing or claiming success.

7d. If a generated plan file already exists, inspect it completely first and overwrite it only after confirming a specific defect, incompleteness, or mismatch with the validated plan.

  1. Write plan to output path

8a. After writing, obtain direct confirmation by reading back the saved file or otherwise observing the write result; do not declare success based only on an attempted write command.

  1. Read back and verify each written plan file completely before concluding success; if any read/output is truncated, ambiguous, or cut off, re-read with targeted per-file reads, line counts, or final-line inspection until completeness is explicit.

9a. If any saved plan file is truncated, malformed, empty, or ends mid-line/mid-token, treat the task as unresolved: regenerate or repair the plan, then reread the corrected file before continuing.

9b. If planner/validator output, your notes, and the saved file contents disagree on action count, final actions, or completion, treat the task as unresolved and debug/regenerate from the saved artifact instead of narrating unobserved actions.

  1. Confirm outputs were produced only for tasks listed in problem.json and that each expected plan_output exists, is non-empty, and ends with a complete action line.

10a. For each task in problem.json, gather direct evidence for that specific output file; do not infer batch success from partial run logs, startup banners, warnings, or the mere presence of multiple files.

10b. Verify each saved plan contains the actual final goal-achieving step(s) required by the problem; never infer a missing final unload/delivery or other goal step from planner intent.

10c. If any expected file is missing, malformed, truncated, or lacks a required goal step, treat the run as incomplete and regenerate/debug instead of reporting success.

  1. Distinguish planner produced a plan from plan was validated; only use validation language if you actually observed a successful validator/planner check or another explicit validity check.
  2. Before the final response, re-check the runtime instructions so the last message matches any required completion token or final-response schema exactly.

Plan Format

One action per line:

drive(truck1, depot1, market1)
buy(truck1, goods1, market1, level0, level1, level0, level1)
load(goods1, truck1, market1, level0, level1, level0, level1)
drive(truck1, market1, depot1)
unload(goods1, truck1, depot1, level0, level1, level0, level1)

Malformed example to reject:

buy(truck1, goods2, market1, level0, level1, level0, leve

Never accept a plan file that ends with a partial action line.

Requirements

Verification Checklist

Verification Checklist

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.