Add plan-queue and run-queue skills
This commit is contained in:
71
.claude/skills/plan-queue/SKILL.md
Normal file
71
.claude/skills/plan-queue/SKILL.md
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
name: plan-queue
|
||||
description: Author detailed, weak-model-executable plan files into the current repo's plans/ queue (plans/queue|active|done|failed + INDEX.md). The strong model does ALL exploration and thinking up front so a cheap executor can later apply the plan with zero codebase discovery. Use when the user says "/plan-queue <task>", "queue a plan for X", "add X to the plan queue", "plan this for the weak model". Companion skill: run-queue executes the queue. Manually-triggered only.
|
||||
---
|
||||
|
||||
# plan-queue
|
||||
|
||||
Turn a task description into a **self-contained plan file** in the repo's
|
||||
`plans/queue/`, detailed enough that a weak/cheap model can execute it without
|
||||
exploring the codebase. Multiple tasks in one invocation → one plan file each.
|
||||
|
||||
## Layout (create on first use in a repo)
|
||||
|
||||
```
|
||||
plans/
|
||||
INDEX.md # ordered table of all plans
|
||||
queue/ # not started
|
||||
active/ # currently executing (max 1)
|
||||
done/
|
||||
failed/
|
||||
```
|
||||
|
||||
`INDEX.md` starts as:
|
||||
|
||||
```markdown
|
||||
# Plan Queue Index
|
||||
|
||||
| Seq | ID | Title | Status | Commit | Notes |
|
||||
|-----|----|-------|--------|--------|-------|
|
||||
```
|
||||
|
||||
## Procedure
|
||||
|
||||
1. **Scaffold**: if `plans/INDEX.md` doesn't exist, create the layout above
|
||||
(`.gitkeep` in the four dirs so git tracks them).
|
||||
2. **Explore deeply** (strong-model work): read every file the change touches,
|
||||
find existing utilities to reuse, note exact paths, line anchors, and
|
||||
signatures. The goal: the executor must need **zero** exploration.
|
||||
3. **Name the plan**: next `NNN` = highest seq across all four dirs + 1
|
||||
(zero-padded 3 digits). `HASH` = first 6 chars of
|
||||
`sha1(title + timestamp)`. Filename: `NNN-<kebab-slug>-<HASH>.md` in
|
||||
`plans/queue/`.
|
||||
4. **Write the plan** following `plan-template.md` in this skill directory.
|
||||
Every section is mandatory. Be near-diff-level specific in Steps for
|
||||
anything non-trivial; paste real code snippets into Context.
|
||||
5. **Index**: append a row to `INDEX.md` (`Status: queued`, Commit blank).
|
||||
6. **Commit** the new plan file(s) + INDEX.md: `plan: add NNN-<slug>`.
|
||||
Do NOT push. Never add AI attribution to the commit.
|
||||
|
||||
## Rules for plan quality (this is the whole point)
|
||||
|
||||
- **Front-load context.** Paste the actual current code of the region being
|
||||
changed into the plan. The executor should never have to grep.
|
||||
- **Steps are mechanical.** "Edit `src/auth.ts:42`: change X to Y" — not
|
||||
"improve the auth flow".
|
||||
- **Guardrails.** Always fill "Out of scope / do NOT touch" — weak models
|
||||
drift without it.
|
||||
- **Verification is copy-pasteable.** Exact commands + expected output.
|
||||
- **Independence.** Each plan must leave the repo working (buildable/tests
|
||||
green) on its own, since it gets its own commit. If a task can't, split it
|
||||
differently or use `depends_on`.
|
||||
- `depends_on:` in frontmatter lists plan IDs (the NNN-slug-hash basename)
|
||||
that must be in `done/` first. Use it so many plans can be queued without
|
||||
conflict.
|
||||
|
||||
## Conflict avoidance when queueing many plans
|
||||
|
||||
When authoring several plans in one batch, keep their file footprints
|
||||
disjoint where possible; where they must overlap, chain them with
|
||||
`depends_on` and write the later plan against the code **as it will be after
|
||||
the earlier plan** (say so explicitly in its Context section).
|
||||
59
.claude/skills/plan-queue/plan-template.md
Normal file
59
.claude/skills/plan-queue/plan-template.md
Normal file
@@ -0,0 +1,59 @@
|
||||
---
|
||||
id: NNN-slug-hash # matches filename (without .md)
|
||||
title: Short imperative title
|
||||
created: YYYY-MM-DD
|
||||
depends_on: [] # e.g. [001-add-user-model-a3f9c2]
|
||||
est_files: 2 # rough count of files the executor will touch
|
||||
---
|
||||
|
||||
# NNN — Title
|
||||
|
||||
## Objective
|
||||
|
||||
One paragraph: what "done" looks like, in behavioral terms.
|
||||
|
||||
## Context the executor must NOT rediscover
|
||||
|
||||
Everything a weak model needs so it never explores:
|
||||
|
||||
- Exact file paths with line anchors (`src/foo.ts:120-145`) and what's there.
|
||||
- Signatures of functions/utilities to REUSE (with their paths).
|
||||
- Pasted snippets of the current code around each edit site.
|
||||
- Any project conventions that apply (naming, error handling, test style).
|
||||
|
||||
```lang
|
||||
// paste the relevant current code here
|
||||
```
|
||||
|
||||
## Steps
|
||||
|
||||
1. Edit `path/to/file.ext` — concrete, mechanical instruction. For tricky
|
||||
edits, show the exact before/after or a unified diff.
|
||||
2. Create `path/to/new-file.ext` with: (full contents or precise spec).
|
||||
3. ...
|
||||
|
||||
## Out of scope / do NOT touch
|
||||
|
||||
- Files/behaviors the executor must leave alone.
|
||||
- Refactors NOT to attempt, even if tempting.
|
||||
|
||||
## Verification
|
||||
|
||||
Run exactly:
|
||||
|
||||
```bash
|
||||
<build/test/lint commands>
|
||||
```
|
||||
|
||||
Expected: <what passing looks like, specific output to check>.
|
||||
|
||||
## Report format (executor: follow exactly)
|
||||
|
||||
Output ONLY the following, no other prose:
|
||||
|
||||
1. `git diff` (unified) of all changes.
|
||||
2. Raw output of the Verification commands.
|
||||
3. `Findings:` — max 10 lines: surprises, deviations from the steps, anything
|
||||
skipped and why.
|
||||
|
||||
Do not commit. Do not push. Do not touch files outside the Steps.
|
||||
17
.claude/skills/plan-queue/sync-to-repos.sh
Executable file
17
.claude/skills/plan-queue/sync-to-repos.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# sync-to-repos.sh — copy the canonical plan-queue + run-queue skills from
|
||||
# ~/.claude/skills/ into .claude/skills/ of every git repo under
|
||||
# ~/development/personal/. Re-run after editing the skills to prevent drift.
|
||||
set -euo pipefail
|
||||
|
||||
SRC="$HOME/.claude/skills"
|
||||
BASE="$HOME/development/personal"
|
||||
|
||||
for gitdir in "$BASE"/*/.git; do
|
||||
repo="$(dirname "$gitdir")"
|
||||
dest="$repo/.claude/skills"
|
||||
mkdir -p "$dest"
|
||||
rm -rf "$dest/plan-queue" "$dest/run-queue"
|
||||
cp -r "$SRC/plan-queue" "$SRC/run-queue" "$dest/"
|
||||
echo "synced: $repo"
|
||||
done
|
||||
Reference in New Issue
Block a user