🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Path-Dispatch

by @turinfohlen

Discrete Hamiltonian task dispatch for multi-hop workflows. Maps task dependencies as a graph, precomputes reachability matrices, and solves constrained path...

Versionv1.0.4
πŸ’‘ Examples

0. Know Your Script

You are equipped with dispatch.py, a standalone Python script that implements all core functions.

* Commands: Supports matrix, path , query , and deps . * Performance: Precomputes a distance matrix and caches it (.cache file) to make repeated queries instantaneous. Set PATH_DISPATCH_NO_CACHE=1 to disable caching.

1. Build Graph and Precompute

python dispatch.py tasks.md matrix

Output:

=== Original Nodes ===
  0  auth_service
  1  token_validator
  2  user_db
  3  audit_log
  4  deploy

=== Virtual Nodes (7) === 5 __rel_0__ (auth_service β†’ token_validator) 6 __rel_1__ (auth_service β†’ rate_limiter) ...

=== Adjacency Matrix (A) === 0 1 2 3 4 5 6 ... 0 0 0 0 0 0 1 1 auth_service 1 0 0 1 0 0 0 0 token_validator ...

=== Transitive Closure (R*) === [full reachability matrix]

Nodes: 12 | Convergence depth: 5

2. Find Shortest Path

python dispatch.py tasks.md path auth_service deploy

Output:

Shortest logical path (4 hops):
  auth_service β†’ token_validator β†’ user_db β†’ audit_log β†’ deploy

3. Query Next Valid Hops (Core Dispatch)

python dispatch.py tasks.md query auth_service deploy 4

Output:

next_hops(current=auth_service, target=deploy, logical_budget=4)
  β†’ ['token_validator', 'rate_limiter']

Interpretation:

  • From auth_service, both token_validator and rate_limiter are valid next steps
  • Both can still reach deploy with ≀3 remaining hops
  • Model can dispatch either or both (breadth-first parallel execution)
  • Hyperedge Query

    python dispatch.py tasks.md query design_doc deploy 3
    

    Output:

    next_hops(current=design_doc, target=deploy, logical_budget=3)
      β†’ ['{impl_A, impl_B}']
    

    Interpretation:

  • Next logical step is a parallel set {impl_A, impl_B}
  • Dispatch both simultaneously
  • Reconverge when both complete

  • πŸ”’ Constraints

  • <<{Subject, Predicate, Object}. format (period-dot terminator)
  • Subject/Object can be bare atoms or [list, of, items]
  • Predicate is ignored (only structure matters)
  • One triple per line
  • Safely embedded in markdown

  • View on ClawHub
    TERMINAL
    clawhub install path-dispatch

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’