summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAddy Osmani <addyosmani@gmail.com>2026-06-07 15:33:28 -0700
committerAddy Osmani <addyosmani@gmail.com>2026-06-07 15:33:28 -0700
commit57f527479d96b1a9d586913a681fff0cd87a5e99 (patch)
tree032feaf9c453d52400cd2502c53c64fa24bf3ece
parentfaa69c8316f8d9b9eaf5952baeb617dddca2fa4c (diff)
fix(build): establish a clean baseline before /build autobuild-improvements
Per federicobartoli's review on #220: the clean-rollback guarantee depended on "one commit per task" but said nothing about pre-existing uncommitted changes, which could get absorbed into per-task commits. - New step: inspect `git status --porcelain` before autonomous execution; if there are changes outside the expected planning artifacts (SPEC.md, docs/SPEC.md, spec/*, tasks/plan.md, tasks/todo.md), stop and ask the user to commit/stash/confirm. - Commit a generated tasks/plan.md as a single preparatory commit after approval so it doesn't bleed into the first task. - Per task, stage only the files that task touched plus its status update (no blind `git add -A`). No new between-task gate, so the single-checkpoint design is preserved. Mirrored across the Claude and Gemini commands.
-rw-r--r--.claude/commands/build.md11
-rw-r--r--.gemini/commands/build.toml11
2 files changed, 12 insertions, 10 deletions
diff --git a/.claude/commands/build.md b/.claude/commands/build.md
index 94770be..2233d90 100644
--- a/.claude/commands/build.md
+++ b/.claude/commands/build.md
@@ -29,15 +29,16 @@ Pick the next pending task from the plan. Then:
Use this once a spec exists and you want to collapse plan + build into one run. It removes the manual stepping between tasks — **not** the verification. Every task still earns a passing test and its own commit.
1. **Require a spec.** Look only for a spec at a known path: `SPEC.md` at the repo root, `docs/SPEC.md`, or a file under `spec/`. A README or arbitrary doc does **not** count. If none exists, stop and tell the user to run `/spec` first — do not invent requirements.
-2. **Plan if needed.** If there is no `tasks/plan.md`, invoke agent-skills:planning-and-task-breakdown to generate one.
-3. **Single checkpoint.** Present the full plan and wait for an unambiguous affirmative (e.g. "approve", "go", "yes"). Treat hedged responses ("looks reasonable", "I guess") as **not** approved. This is the only human gate — after approval, run autonomously.
-4. **Execute every task in dependency order.** Use each task's declared dependencies; if they aren't explicit, execute in the order the plan lists them. For each task, run the full default loop above (RED → GREEN → regression → build → commit per task → mark complete). One commit per task so any point is a clean rollback.
-5. **Stop and ask the user** (do not push through) when:
+2. **Establish a clean baseline.** Run `git status --porcelain`. If there are uncommitted changes outside the expected planning artifacts (`SPEC.md`, `docs/SPEC.md`, `spec/*`, `tasks/plan.md`, `tasks/todo.md`), stop and ask the user to commit, stash, or confirm how to handle them. Autonomous per-task commits must not absorb unrelated local work, or the clean-rollback guarantee breaks.
+3. **Plan if needed.** If there is no `tasks/plan.md`, invoke agent-skills:planning-and-task-breakdown to generate one.
+4. **Single checkpoint.** Present the full plan and wait for an unambiguous affirmative (e.g. "approve", "go", "yes"). Treat hedged responses ("looks reasonable", "I guess") as **not** approved. This is the only human gate — after approval, run autonomously. If you generated `tasks/plan.md`, commit it as a single preparatory commit now so it doesn't bleed into the first task's commit.
+5. **Execute every task in dependency order.** Use each task's declared dependencies; if they aren't explicit, execute in the order the plan lists them. For each task, run the full default loop above (RED → GREEN → regression → build → commit → mark complete). Stage only the files that task touched plus its task-status update — never `git add -A` blindly — and make one commit per task so any point is a clean rollback.
+6. **Stop and ask the user** (do not push through) when:
- a test can't be made to pass or the build breaks without an obvious fix → follow agent-skills:debugging-and-error-recovery
- the spec is ambiguous, or a task needs a decision the spec doesn't cover
- a task is high-risk or irreversible — auth/permission changes, destructive data migrations, payments, deletions, deploys, anything touching secrets, **or anything you can't undo with `git revert`** → follow agent-skills:doubt-driven-development and get explicit sign-off before continuing
After the user resolves a blocker, they re-invoke `/build auto` — it resumes from the next pending task.
-6. **Summarize at the end:** tasks completed, tests added, commits made, and anything skipped, flagged, or left for the user.
+7. **Summarize at the end:** tasks completed, tests added, commits made, and anything skipped, flagged, or left for the user.
If any step fails, follow the agent-skills:debugging-and-error-recovery skill.
diff --git a/.gemini/commands/build.toml b/.gemini/commands/build.toml
index f3bd8f8..b7a4f7f 100644
--- a/.gemini/commands/build.toml
+++ b/.gemini/commands/build.toml
@@ -28,15 +28,16 @@ Pick the next pending task from the plan. Then:
Use this once a spec exists and you want to collapse plan + build into one run. It removes the manual stepping between tasks — not the verification. Every task still earns a passing test and its own commit.
1. Require a spec. Look only for a spec at a known path: SPEC.md at the repo root, docs/SPEC.md, or a file under spec/. A README or arbitrary doc does NOT count. If none exists, stop and tell the user to run /spec first — do not invent requirements.
-2. Plan if needed. If there is no tasks/plan.md, invoke the planning-and-task-breakdown skill to generate one.
-3. Single checkpoint. Present the full plan and wait for an unambiguous affirmative (e.g. "approve", "go", "yes"). Treat hedged responses ("looks reasonable", "I guess") as NOT approved. This is the only human gate — after approval, run autonomously.
-4. Execute every task in dependency order. Use each task's declared dependencies; if they aren't explicit, execute in the order the plan lists them. For each task, run the full default loop above (RED → GREEN → regression → build → commit per task → mark complete). One commit per task so any point is a clean rollback.
-5. Stop and ask the user (do not push through) when:
+2. Establish a clean baseline. Run `git status --porcelain`. If there are uncommitted changes outside the expected planning artifacts (SPEC.md, docs/SPEC.md, spec/*, tasks/plan.md, tasks/todo.md), stop and ask the user to commit, stash, or confirm how to handle them. Autonomous per-task commits must not absorb unrelated local work, or the clean-rollback guarantee breaks.
+3. Plan if needed. If there is no tasks/plan.md, invoke the planning-and-task-breakdown skill to generate one.
+4. Single checkpoint. Present the full plan and wait for an unambiguous affirmative (e.g. "approve", "go", "yes"). Treat hedged responses ("looks reasonable", "I guess") as NOT approved. This is the only human gate — after approval, run autonomously. If you generated tasks/plan.md, commit it as a single preparatory commit now so it doesn't bleed into the first task's commit.
+5. Execute every task in dependency order. Use each task's declared dependencies; if they aren't explicit, execute in the order the plan lists them. For each task, run the full default loop above (RED → GREEN → regression → build → commit → mark complete). Stage only the files that task touched plus its task-status update — never `git add -A` blindly — and make one commit per task so any point is a clean rollback.
+6. Stop and ask the user (do not push through) when:
- a test can't be made to pass or the build breaks without an obvious fix → follow the debugging-and-error-recovery skill
- the spec is ambiguous, or a task needs a decision the spec doesn't cover
- a task is high-risk or irreversible — auth/permission changes, destructive data migrations, payments, deletions, deploys, anything touching secrets, or anything you can't undo with `git revert` → follow the doubt-driven-development skill and get explicit sign-off before continuing
After the user resolves a blocker, they re-invoke /build auto — it resumes from the next pending task.
-6. Summarize at the end: tasks completed, tests added, commits made, and anything skipped, flagged, or left for the user.
+7. Summarize at the end: tasks completed, tests added, commits made, and anything skipped, flagged, or left for the user.
If any step fails, follow the debugging-and-error-recovery skill.
"""