Algorithmic decision tree for when to follow plan exactly vs when to report BLOCKED - prevents scope creep and unauthorized deviations
A simple, explicit system to prevent agents from deviating from implementation plans without approval.
Problem: Agents sometimes rationalize "simpler" approaches that were already considered and rejected during design, leading to expensive rework when the divergence is discovered later.
Solution: Algorithmic decision tree + STATUS reporting + gate enforcement + user escalation.
Location: plugin/skills/following-plans/SKILL.md
Purpose: Embedded in agent prompts to define clear boundaries:
Decision tree format: Boolean questions with no room for interpretation.
Key principle: Better to report BLOCKED unnecessarily than deviate without approval.
Required in every agent completion:
STATUS: OK
TASK: {task identifier}
SUMMARY: {what was done}
Or:
STATUS: BLOCKED
REASON: {why plan approach won't work}
TASK: {task identifier}
Location: plugin/scripts/plan-compliance.sh
Runs on: SubagentStop hook
Checks:
Location: plugin/skills/executing-plans/SKILL.md
When agent reports BLOCKED:
No automatic retries. No automatic approvals. User decides.
No setup required! The plan-compliance gate runs automatically on all SubagentStop events, just like the commands gate runs on all UserPromptSubmit events.
If you want to chain additional gates after plan-compliance (like check/test), edit your .claude/gates.json:
{
"gates": {
"check": {
"description": "Run quality checks",
"command": "mise run check",
"on_pass": "test",
"on_fail": "BLOCK"
},
"test": {
"description": "Run tests",
"command": "mise run test",
"on_pass": "CONTINUE",
"on_fail": "BLOCK"
}
},
"hooks": {
"SubagentStop": {
"enabled_agents": ["general-purpose", "cipherpowers:rust-agent", "cipherpowers:code-agent"],
"gates": ["check"]
}
}
}
Flow: plan-compliance (built-in) → check → test
Gate configuration is in ${CLAUDE_PLUGIN_ROOT}hooks/gates.json. See turboshovel documentation for hooks runtime setup.
The executing-plans skill automatically:
Agents following the embedded skill will:
For syntax fixes: Make the change, note in completion
STATUS: OK
TASK: Task 3 - Implement auth
SUMMARY: Implemented auth. Fixed function name from plan (was getUserData, actually getUser).
For approach changes: Report BLOCKED
STATUS: BLOCKED
REASON: Plan specifies JWT but existing service uses OAuth2. JWT would require refactoring entire auth system.
TASK: Task 3 - Implement auth middleware
When agent reports BLOCKED, you get clear options:
✅ Prevents silent deviations - Agents can't rationalize around plan ✅ Early detection - Blockers caught immediately, not discovered later ✅ Explicit approval - User decides on all plan deviations ✅ Simple - No automatic retries, no state tracking, no complexity ✅ Clear boundaries - Algorithmic decision tree (no interpretation) ✅ Audit trail - STATUS in agent output provides record
Plan: "Call getUserData() to fetch user"
Reality: Function is actually getUser()
Agent action: Fix syntax, report STATUS: OK with note
Result: No BLOCKED, continues
Plan: "Implement manual JWT verification" Agent thought: "Library X is simpler" Agent action: Report STATUS: BLOCKED Result: User decides: trust agent, revise plan, or enforce
Plan: Task 3 says PostgreSQL, Task 5 says MongoDB Agent action: Report STATUS: BLOCKED (plan contradiction) Result: User fixes plan, execution continues
Test the gate manually:
# Test with STATUS: OK
echo '{"output": "STATUS: OK\nTask complete"}' | \
HOOK_INPUT='{"output": "STATUS: OK\nTask complete"}' \
${CLAUDE_PLUGIN_ROOT}scripts/plan-compliance.sh
# Test with STATUS: BLOCKED
echo '{"output": "STATUS: BLOCKED\nREASON: Plan approach won't work"}' | \
HOOK_INPUT='{"output": "STATUS: BLOCKED\nREASON: Plan approach won't work"}' \
${CLAUDE_PLUGIN_ROOT}scripts/plan-compliance.sh
# Test with missing STATUS
echo '{"output": "Task complete"}' | \
HOOK_INPUT='{"output": "Task complete"}' \
${CLAUDE_PLUGIN_ROOT}scripts/plan-compliance.sh
Simplicity over automation: No automatic retries. User decides on deviations.
Explicit over implicit: STATUS required. BLOCKED is explicit escalation.
Algorithmic over imperative: Decision tree, not guidelines. No interpretation.
User control: Agent reports, gate enforces, user decides.
npx skills add cipherstash/following-plans下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer