hatrack
Backlog lifecycle on the rack CLI (hatrack) — create / ls / context / transition, with field edits and hyp/proposal staying on `ai-hats task`. Use when a session composes the `hatrack-trait` (rack is the selected backlog manager) for any task lifecycle transition, backlog read, document, or link; it replaces `backlog-manager` for that session.
- License 许可
- MIT
- 所属仓库
- muratovv/ai-hats
- 最近更新
- 2026-11-05
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- hatrack
- ai_hats
- { "requires": { "cli": [ { "hint": "pip install ai-hats-rack", "name": "ai-hats-rack", "check": "rack --help" }, { "hint": "pip install ai-hats-tracker", "name": "ai-hats-tracker", "check": "ai-hats-tracker --version" } ], "mcp": [] } }
- license
- MIT
- description
- Backlog lifecycle on the rack CLI (hatrack) — create / ls / context / transition, with field edits and hyp/proposal staying on `ai-hats task`. Use when a session composes the `hatrack-trait` (rack is the selected backlog manager) for any task lifecycle transition, backlog read, document, or link; it replaces `backlog-manager` for that session.
03 SKILL.md 正文
Hatrack
Drive the task lifecycle through the rack CLI (ai-hats-rack), the minimal
backlog kernel — while field edits, hypotheses, and proposals stay on
ai-hats task. Same FSM, same task.yaml on disk, same per-task lock.
When to Use
This is the rack backlog manager — composed via hatrack-trait in place of
backlog-manager (never both: they both own the lifecycle and would conflict).
Select it per session with:
ai-hats config customize <role> --remove-skill backlog-manager --add-trait hatrack-trait --project
# revert: ai-hats config customize <role> --reset
If a session composes the classic backlog-manager instead, use that skill —
rack and ai-hats task share the lock and the same task.yaml, so a mixed
backlog is safe, but one session should drive lifecycle through one manager.
State Machine
Unchanged from the tracker: brainstorm → plan → execute → document → review → done (+ blocked, failed, cancelled). rack transition <ID> <state> walks
one FSM edge under guard; illegal edges are refused with the legal set.
Lifecycle cadence — advance as you go
Move the card as each phase completes — never batch the transitions at the
end. The state is a live signal to the supervisor: finished work left in
execute reads as "still working".
| Transition | When | Gate skill |
|---|---|---|
brainstorm → plan |
requirements clear enough to plan | plan-gate |
plan → execute |
plan approved (rack auto-creates the worktree) | worktree-isolation |
execute → document |
code + tests done and committed | — |
document → review |
work finished — signals "awaiting review"; attach summary.md |
task-summary |
review → done |
supervisor (card reviewer) approved |
task-summary |
Rack specifics:
- When execute work is done, advance through
documenttoreviewto request review, then wait — do not self-advance todone; the reviewer approves first. review → doneauto-merges the worktree via the subscriber (typed consent, HATS-1019 parity) — no separateai-hats wt merge.- Before
plan → execute, re-validate the premise: scan the card for a retracted/superseded driver since the plan was authored; if stale, bounce tobrainstorminstead of building on a dead premise.
Rack CLI — lifecycle, reads, documents, links
Four verbs, each with --json (JSON-first):
rack create "Title" --id PROJ-042 --parent PROJ-014 --depends PROJ-041 --tag dx
rack ls # backlog scan (--grep/--tag/--state/--parent)
rack ls PROJ-042 --deep 1 # graph walk from a card
rack context PROJ-042 # THE read package: card + links + document paths
rack transition PROJ-042 execute # sugar for --state execute
transition is the one mutating verb: an ordered composite of ops run in argv
order under ONE lock with a single persist (any abort rolls the whole sequence
back). Compose ops on one line:
rack transition PROJ-042 --state execute --log "impl started" --link related:PROJ-040
rack transition PROJ-042 --attach /tmp/design.md:design.md # copy a file in as a document
rack transition PROJ-042 --freeze design.md # pin {name,digest}
Command flags: --force (needs --reason) relaxes the FSM arrow only;
--resolution / --final-state stamp terminal metadata; --ack-frozen is the
tiered hatch for --rm / --freeze on a pinned document.
Documents are fs-as-truth: the only way to write one is to put a file into
tasks/<ID>/; rack context live-scans and digests on the fly (no doc put).
Read documents by the path context prints — never inline the body blind.
Coexistence — what stays on ai-hats task
rack has no update verb and no hyp/proposal surface. Until generalization
(HATS-1044) these stay on the tracker CLI (same lock, safe to interleave):
| Edit | Command |
|---|---|
| state · work_log · documents · links · resolution · new card | rack transition / rack create |
| title · description · priority · reviewer · role · tags · re-parent | ai-hats task update <ID> --… |
hypotheses · proposals · close · plan-extract · sync |
ai-hats task … |
ai-hats task hyp --help / ai-hats task proposal --help carry the field
contracts — they are identical to a classic session; only lifecycle moved.
Completion
- Lifecycle transitions, reads, documents, and links for the task went through
rack; fields / hyp / proposal went throughai-hats task; STATE.md and the journal reflect the work. - Validation scenario (RED → GREEN). RED: on a rack-composed session an
agent asked to advance
PROJ-042from plan to execute reaches forai-hats task transition(classic muscle memory), bypassing the rack dispatcher, journal, and worktree effects the pilot exists to exercise. GREEN: with hatrack the agent runsrack transition PROJ-042 execute, and knows to keep--priority/hyp/proposalonai-hats task.
Anti-Patterns
- Driving lifecycle through
ai-hats task transitionin a rack session — the rack dispatcher/journal/worktree path is what's being dogfooded; userack. - Composing both
backlog-managerandhatrack-trait— two lifecycle owners. - Reaching for a
rack update/rack hypverb — they don't exist by design; those edits stay onai-hats task(table above). - Inlining a document's body from
contextoutput — read it by the printed path. - Leaving finished work in
executeand batching every transition at close — advance per phase; enterreviewto signal readiness and wait (HATS-1047).
04 同仓库更多 Skills
tool-evaluation-protocol
Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML/LLM frameworks, testing approaches), or following up on a hype-driven recommendation.
systematic-debugging
4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.
skill-template
Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.
skill-optimization
Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.
silent-fallback-gate
PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.
retro-to-framework
Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.