agentleFS
d-o-hubd-o-hub/do-harness/.agents/skills/htn-planner/SKILL.md

htn-planner

Skill1 starsChanged 30 days agoMITView on GitHub

Decompose software objectives into deterministic Hierarchical Task Networks (HTN) with methods, subtasks, and precondition guards. Use when planning a compound coding task, breaking a feature into ordered subtasks, choosing between a vertical event slice and a de-risking spike, or persisting task state to plans/tasks.json or libSQL.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check method preconditions before selecting a method.

    line 42
  2. Very specific:

    When decomposition is justified and applied, persist current method state and subtask index into plans/tasks.json or libSQL.

    line 45
  3. Distinctive:

    Never advance subtask pointer until the corresponding sensor passes with exit code 0.

    line 46
  4. Very specific:

    When a decomposed subtask carries high uncertainty, delegate to .agents/skills/spike-runner before advancing.

    line 47
  5. Very specific:

    Do not decompose a task that lacks a specified domain requirement — the precondition of Vertical Event Slice is unmet.

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

HTN Planner Skill

Purpose

Decompose incoming software objectives into deterministic Hierarchical Task Networks (HTN) using methods, subtasks, and precondition guards.

Method Catalog

Method: Vertical Event Slice

  • Preconditions: Domain requirement specified, target entities known.
  • Subtasks:
    1. define-event-schema: Write Command, Event, and State types.
    2. write-acceptance-test: Create Red ATDD test fixtures.
    3. implement-slice: Write domain logic and event handler.
    4. verify-sensors: Run cargo check, cargo test, and cargo clippy.
    5. distill-learning: Record heuristics in libSQL.

Method: Spike & Resolve

  • Preconditions: High API uncertainty, third-party crate ambiguity, or performance unknown.
  • Subtasks:
    1. create-spike: Generate isolated test scratchpad in tests/spikes/.
    2. execute-spike: Run computational verification against minimal prototype.
    3. record-findings: Store outcome in .do-harness/agent_state.db.
    4. clean-spike: Remove ephemeral files.
    5. transition-to-slice: Invoke Vertical Event Slice method.

Execution Rules

  • Before repository-dependent decomposition or persisting a plan, run the harness freshness step (bash .agents/skills/harness/scripts/latest-main.sh [--read-only]). Read-only planning observes remote state via --read-only without writing Git, DB, or working-tree state, and reports advertised SHA and local HEAD separately. Clean main can fast-forward only; dirty/diverged/in-progress branches are never reset, auto-stashed, or automatically rebased. Fetch or network failure blocks claims of freshness; do not substitute stale source as latest.
  • Check method preconditions before selecting a method; if they are unmet, pick the matching alternative or defer.
  • Scope the method to the work: apply HTN decomposition only to genuinely multi-step or dependent requests. Trivial or isolated changes (a typo, a rename, a one-file fix) take the ordinary scoped route without plan artifacts.
  • Completing a slice does not compel a skill update: review the outcome for reusable learning, and distill only when a repeated or consequential failure supplies distilled evidence (see .agents/skills/skill-distiller).
  • When decomposition is justified and applied, persist current method state and subtask index into plans/tasks.json or libSQL.
  • Never advance subtask pointer until the corresponding sensor passes with exit code 0.
  • When a decomposed subtask carries high uncertainty, delegate to .agents/skills/spike-runner before advancing.

Gotchas

  • Do not decompose a task that lacks a specified domain requirement — the precondition of Vertical Event Slice is unmet.
  • A spike decision is made at planning time, not discovered mid-implementation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.