🐙 / 🐉
hydra
Decision trees for LLM-led design interviews.
Synopsis
hydra init [slug] --intent <text|->
hydra use <slug>
hydra trees | status | ready | next | resume | tree
hydra sprout --question <text|-> [--parent <slug>] [--blocked-by <slug,...>] [--slug <slug>]
hydra cut <slug> --answer <text|-> [--rationale <text|->] [--reject '<option>: <why>']...
[--keep-subtree] [--force]
hydra cauterise <slug> --by <slug> [--why <text|->] [--force]
hydra reopen <slug>
hydra reword <slug> --question <text|->
hydra reparent <slug> --parent <slug>
hydra link <slug> --blocked-by <slug> [--force]
hydra unlink <slug> --blocked-by <slug>
hydra show <slug>
Description
Hydra maintains a tree of the questions asked during a design interview, in
which one question is put at a time. An unanswered question is a head.
Answering a head is a cut. A cut may sprout further heads, and reopens the
heads that depend on the one answered.
Heads, answers, and the edges between them are stored as JSON under .hydra/.
Each invocation reads that store and exits; no state is held between
invocations.
Hydra does not read the text of a question and does not select which question is
put next. It refuses any write that would violate an invariant (see
Invariants) and reports which heads have no unanswered dependencies.
Every command writes JSON to stdout, except tree, whose output is formatted
for reading. Rejections and diagnostics are written to stderr. Stdout is
parseable at every exit status.
The options --question, --answer, --intent, --rationale and --why
accept - as a value, in which case the value is read from stdin. Stdin is read
once, so at most one such option may be given per invocation.
A tree carries an intent: prose stating what the interview is for, given at
init and stored alongside the slug. It is the first field written by resume.
Hydra does not read it. A tree written by a version of hydra predating the field
has an empty intent.
Only the first line of an answer appears in the skeleton written by resume.
The remainder is reported by show, and by resume for next and its
ancestors.
Commands
Tree management
| Command | Effect |
|---|
init [slug] | Create a tree and point HEAD at it. Slug defaults to the name of the directory holding .hydra/. --intent is required and is rejected if blank |
use <slug> | Move HEAD to an existing tree |
trees | Every tree in the store with its counts, and which one HEAD names |
status | Counts for the HEAD tree. Exits 4 while open heads remain |
init reuses the nearest .hydra/ at or above the cwd and creates one in the
cwd only if there is none. Discovery walks upward, so a nested .hydra/ shadows
the store above it rather than extending it.
Mutation
| Command | Effect |
|---|
sprout | Open a new head. Omit --parent for a root; --slug defaults to a slug derived from the question |
cut | Answer a head. Reopens its descendants and everything it gates |
cauterise (alias sear) | Answer a head that another head's answer has made unnecessary, setting answer.cauterised_by |
reopen | Discard an answer and reopen the head. Always cascades. The discarded answer is retained as prior |
reword | Replace a head's question, leaving its answer unchanged |
reparent | Move a head under a different parent. --parent '' makes it a root |
link / unlink | Add or remove a blocked_by edge. Idempotent |
cut --keep-subtree suppresses the cascade, leaving descendants and gated heads
as they are. --force is accepted by cut, cauterise and link; it overrides
the invariant that would otherwise reject the write, and is not recorded in the
tree.
Query