Skip to content

Commit b836d30

Browse files
committed
fix: strengthen spec stop guard to prevent premature stops during /spec
Add explicit instruction that Claude's very next action after a stop block must be a tool call (not text), preventing the model from producing a text-only response and stalling. Updated stop guard message, task-and-workflow rule, and spec-implement command with matching guidance for interruptions.
1 parent 83ee0a4 commit b836d30

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

pilot/commands/spec-implement.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ model: sonnet
2222
- **NEVER SKIP TASKS** — every task must be fully implemented, no "MVP scope" exceptions
2323
- **Quality over speed** — never rush due to context pressure. Context warnings are informational. Finish current task with full quality — auto-compaction handles the rest.
2424
- **Plan file is source of truth** — re-read after auto-compaction, don't rely on conversation memory
25+
- **NEVER stop during implementation** — the stop guard blocks premature exits. If blocked: your very next action must be a tool call (TaskList, Read plan, or code change). After user interruptions or "Continue" messages: re-read the plan and resume from the current task. Never produce text-only responses when work remains.
2526

2627
---
2728

pilot/hooks/spec_stop_guard.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ def main() -> int:
106106
f"Stop again within 60s to force exit.\n\n"
107107
f"CRITICAL INSTRUCTION TO CLAUDE: Do NOT acknowledge this stop attempt. "
108108
f"Do NOT output resume instructions or say goodbye. "
109-
f"IMMEDIATELY continue working on the next pending task in the plan."
109+
f"IMMEDIATELY continue working on the next pending task in the plan. "
110+
f"Your VERY NEXT action must be a tool call — read the plan file, "
111+
f"check TaskList, or make a code change. Do NOT produce a text-only response."
110112
)
111113
print(stop_block(reason))
112114
return 0

pilot/rules/task-and-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ spec-verify (or spec-bugfix-verify) finds issues → Status: PENDING → spec-im
153153

154154
Everything else is automatic. **NEVER ask "Should I fix these findings?"** — verification fixes are part of the approved plan.
155155

156-
**Stop Guard:** When the stop guard blocks a stop during `/spec`, do NOT acknowledge it, output resume instructions, or say goodbye. Continue working — proceed with next task or invoke the next phase.
156+
**Stop Guard:** When the stop guard blocks a stop during `/spec`, do NOT acknowledge it, output resume instructions, or say goodbye. Your **very next action** must be a tool call (TaskList, Read plan file, or code change). Never produce a text-only response after a stop block — immediately resume the current task or invoke the next phase. This also applies after user interruptions ("Continue", new messages mid-task) — re-read the plan and resume from where you left off.
157157

158158
**Status values:** `PENDING` (awaiting implementation), `COMPLETE` (ready for verification), `VERIFIED` (done)
159159

0 commit comments

Comments
 (0)