diff options
Diffstat (limited to 'skills/executing-plans')
| -rw-r--r-- | skills/executing-plans/SKILL.md | 10 | ||||
| -rwxr-xr-x | skills/executing-plans/scripts/task-done | 7 | ||||
| -rwxr-xr-x | skills/executing-plans/scripts/task-start | 6 |
3 files changed, 16 insertions, 7 deletions
diff --git a/skills/executing-plans/SKILL.md b/skills/executing-plans/SKILL.md index ac77129..ea23196 100644 --- a/skills/executing-plans/SKILL.md +++ b/skills/executing-plans/SKILL.md @@ -123,7 +123,8 @@ The workspace and ledger are shared with superpowers:subagent-driven-development and the new one resumes from the same ledger. - Each plan owns a workspace: at skill start, run - `../subagent-driven-development/scripts/sdd-workspace PLAN_FILE` — it + `../subagent-driven-development/scripts/sdd-workspace PLAN_FILE` by its + absolute path, from the working tree you're executing in — it prints the plan's git-ignored directory (`<repo-root>/.superpowers/sdd/<plan-basename>/`), home to every artifact for THIS plan: ledger, briefs, review packages. Another plan's @@ -169,7 +170,8 @@ in the workspace and read its tail; read a brief, not the whole plan. ### 1. Take the task -- Run this skill's `scripts/task-start PLAN_FILE N`. It prints the brief +- Run this skill's `scripts/task-start PLAN_FILE N` by its absolute path, + from the working tree you're executing in. It prints the brief path and BASE (the commit the task's range is cut from) in one call. Read the brief for every task, including ones you remember from setup: what you remember is a summary, the brief has the exact values, @@ -222,7 +224,7 @@ the claim. If any item is missing, the task is not complete: finish it. ### 4. Complete the task Run this skill's `scripts/task-done PLAN_FILE N BASE -- <test command>` -with the test command the brief names for the whole task. It runs the +by its absolute path, from the working tree you're executing in, with the test command the brief names for the whole task. It runs the tests, keeps the full output in the workspace, prints the tail, and — only if they pass — appends the completion line to the ledger: @@ -234,7 +236,7 @@ mark the todo complete and take the next task. ## Final Review Run `../subagent-driven-development/scripts/review-package PLAN_FILE MERGE_BASE HEAD` -(MERGE_BASE = the commit the branch started from, e.g. +by its absolute path, from the working tree you're executing in (MERGE_BASE = the commit the branch started from, e.g. `git merge-base main HEAD`) and review from the file it prints. **With a subagent tool:** dispatch the reviewer on the most capable diff --git a/skills/executing-plans/scripts/task-done b/skills/executing-plans/scripts/task-done index e5fc6a9..d6400b4 100755 --- a/skills/executing-plans/scripts/task-done +++ b/skills/executing-plans/scripts/task-done @@ -20,7 +20,10 @@ base=$3 shift 4 sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)" -git rev-parse --verify --quiet "$base" >/dev/null || { echo "bad BASE: $base" >&2; exit 2; } +# The repository the workspace and ledger belong to (see sdd-repo); BASE and +# HEAD are read there, not in the bare cwd. +repo=$("${BASH:-bash}" "$sdd/sdd-repo" --with-commit) +git -C "$repo" rev-parse --verify --quiet "$base" >/dev/null || { echo "bad BASE: $base" >&2; exit 2; } dir=$("$sdd/sdd-workspace" "$plan") log="$dir/task-${n}-tests.log" @@ -47,6 +50,6 @@ fi last=$(grep -v '^[[:space:]]*$' "$log" | tail -n 1) || last="(no output)" [ -f "$ledger" ] || printf '# SDD ledger — plan: %s\n' "$plan" > "$ledger" -line="Task $n: complete (commits $(git rev-parse --short=7 "$base")..$(git rev-parse --short=7 HEAD), tests: $cmd → $last)" +line="Task $n: complete (commits $(git -C "$repo" rev-parse --short=7 "$base")..$(git -C "$repo" rev-parse --short=7 HEAD), tests: $cmd → $last)" printf '%s\n' "$line" >> "$ledger" echo "ledger: $line" diff --git a/skills/executing-plans/scripts/task-start b/skills/executing-plans/scripts/task-start index fab75b5..04f1c65 100755 --- a/skills/executing-plans/scripts/task-start +++ b/skills/executing-plans/scripts/task-start @@ -20,9 +20,13 @@ plan=$1 n=$2 sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)" +# BASE comes from the same repository the brief is written into (sdd-repo +# also refuses one with no commit yet), not from the bare cwd. +repo=$("${BASH:-bash}" "$sdd/sdd-repo" --with-commit) out=$("$sdd/task-brief" "$plan" "$n") brief=$(printf '%s\n' "$out" | sed -n 's/^wrote \(.*\): [0-9][0-9]* lines$/\1/p') [ -n "$brief" ] || { echo "task-brief did not report a path: $out" >&2; exit 1; } +base=$(git -C "$repo" rev-parse --verify HEAD) echo "brief: $brief" -echo "base: $(git rev-parse HEAD)" +echo "base: $base" |
