AGENT SKILL

plan-discipline

Put a plan in its one canonical home, the tracker `plan.md`, never `.claude/plans`. Use on entering plan mode, on any plan draft including ExitPlanMode output, or when a task enters brainstorm→plan.

License 许可
MIT
所属仓库
muratovv/ai-hats
最近更新
2026-11-05
Stars
★ 3
Forks
1

01 前言 Front Matter

name
plan-discipline
ai_hats
{ "type": "skill", "schema_version": 1 }
license
MIT
description
Put a plan in its one canonical home, the tracker `plan.md`, never `.claude/plans`. Use on entering plan mode, on any plan draft including ExitPlanMode output, or when a task enters brainstorm→plan.

03 SKILL.md 正文

Plan Discipline

A plan is always a task, authored into <ai_hats_dir>/tracker/backlog/tasks/<ID>/plan.md. Nowhere else.

When to Use

  • On EnterPlanMode, recall this skill — so you treat the plan-mode draft as scratch and persist it into the tracker the moment you exit (see the two-phase flow below). Plan mode is for designing + approval; the plan of record still becomes a task in the tracker.
  • Also whenever a plan must be persisted — a draft in chat or a plan-mode artifact — even if no task exists yet.
  • This skill is the plan's home and transport (where the file lives, how the draft gets there). For filling each section well, hand off to plan-gate (it routes Requirements / Scope / Steps / Verification to their owners). Don't duplicate that here.
  • Not an enforcement gate: the engine per-section gate blocks rack transition <ID> execute on an empty plan. This skill is the authoring discipline upstream of it; the gate is the backstop.

Procedure

rack CLI commands (reads, transitions, logs) can be run from either the main repo or any linked worktree — root resolution automatically finds the main repo's .agent/ tracker. (Teardown commands like ai-hats wt merge / discard or closing transition done should be run from the main repo so your shell cwd isn't removed underfoot — see skill worktree-isolation).

Preferred — plan directly in the tracker (no plan mode)

When you control the flow, skip Claude Code plan mode and author straight into the tracker — zero round-trip, no .claude/plans file.

  1. Make the task (if none): rack create "<title>" --description "<intent>" [--priority high|medium|low] [--id PROJ-NNN] — starts in brainstorm; clarify scope there if fuzzy.
  2. Scaffold: rack transition <ID> plan → empty <ai_hats_dir>/tracker/backlog/tasks/<ID>/plan.md.
  3. Author into it (Write/Edit), filling the required sections (route each via plan-gate). rack transition <ID> execute stays blocked until they're non-empty.

In Claude Code plan mode — two phases

Plan mode is read-only: it blocks the rack CLI and every write except .claude/plans/<slug>.md, so the tracker flow is impossible until you exit. That's expected — don't fight it, and don't apologise for the draft.

  • Phase 1 — in plan mode: design; draft into .claude/plans/<slug>.md; present via ExitPlanMode. Do not attempt rack create / rack transition / tracker writes — they are blocked. The draft is scratch, not the plan of record.
  • Phase 2 — immediately on approval / exit: your first action, before any other execute work, is to persist into the tracker — rack create (if needed) → rack transition <ID> plan → Read the .claude/plans draft → Write it into <ai_hats_dir>/tracker/backlog/tasks/<ID>/plan.md → fill/confirm sections → rack transition <ID> execute. There is no auto-sync; the .claude/plans file is now inert, leave or delete.

Completion

  • <ai_hats_dir>/tracker/backlog/tasks/<ID>/plan.md holds the real plan; no task-bearing file remains in .claude/plans; rack transition <ID> execute passes the gate.
  • Handoff: plan in tracker → plan-gate (section quality) → engine gate → execute.

Anti-Patterns

  • Treating the plan-mode .claude/plans/<slug>.md as the plan — in plan mode it is Phase-1 scratch; the plan isn't real until transferred to the tracker on exit.
  • Skipping the Phase-2 transfer (or deferring it behind other execute work) — persisting into the tracker is the first post-approval action.
  • Fighting plan mode by trying rack CLI / tracker writes while still in it — they are blocked; draft, exit, then persist.
  • Drafting a plan without a task — if it's a plan, you made a task.
  • Running worktree teardown commands (ai-hats wt merge / wt discard or terminal transition done) from inside the worktree being deleted — this orphans your shell. Return to the main repo first.

04 同仓库更多 Skills

muratovv
muratovv/ai-hats

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.

★ 3
muratovv
muratovv/ai-hats

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.

★ 3
muratovv
muratovv/ai-hats

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与智能体开发
★ 3
muratovv
muratovv/ai-hats

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.

Skill与智能体开发
★ 3
muratovv
muratovv/ai-hats

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.

★ 3
muratovv
muratovv/ai-hats

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.

Skill与智能体开发
★ 3