Htn planner

From kunwl123456/zeroclaw-skills-collection · View interactive version

Htn planner is an AI agent skill from the GitHub repository kunwl123456/zeroclaw-skills-collection. A Hierarchical Task Network (HTN) planner and visualizer. It allows defining domains and problems in JSON, visualizing the plan decomposition tree using Mermaid, and simulating execution.

How to use this skill

Skill file

Skill: HTN Planner

Description

A Hierarchical Task Network (HTN) planner and visualizer. It allows defining domains and problems in JSON, visualizing the plan decomposition tree using Mermaid, and simulating execution.

Usage

# Visualize a plan
node skills/htn-planner/index.js --action visualize --domain domain.json --problem problem.json --output plan.mmd

# Simulate execution
node skills/htn-planner/index.js --action simulate --domain domain.json --problem problem.json

Input Format (JSON)

Domain

{
  "tasks": {
    "root": { "type": "compound", "methods": ["m1", "m2"] },
    "m1": { "type": "method", "subtasks": ["t1", "t2"] },
    "t1": { "type": "primitive", "action": "do_something" }
  }
}

Problem

{
  "state": { "loc": "home" },
  "goal": ["root"]
}
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.