feed-the-machine 1.7.6 → 1.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -91,11 +91,21 @@ If the next move will reveal new information, plan to re-enter Observe after the
|
|
|
91
91
|
|
|
92
92
|
Act is clean, decisive execution — but execution of **approved** work only.
|
|
93
93
|
|
|
94
|
-
**Pre-Act checkpoint**: Before executing
|
|
94
|
+
**HARD GATE — Pre-Act checkpoint**: Before executing ANYTHING (Bash, MCP, Write, Edit, API calls of any kind), verify ALL of these:
|
|
95
95
|
|
|
96
|
-
1. If `
|
|
97
|
-
2.
|
|
98
|
-
3.
|
|
96
|
+
1. **Did you present a checkbox plan?** If the task is medium+ (forced escalation signals fired), you MUST have presented a `N. [ ] action → target` plan and received explicit user approval. "I'll do X, Y, Z" in prose is NOT a plan. Listing steps without `[ ]` checkboxes is NOT a plan. If you haven't presented one, STOP and present it now.
|
|
97
|
+
2. **Did the user approve it?** Look for "go", "approve", "yes", "lgtm", or similar. If the user hasn't responded to your plan yet, WAIT. Do not start executing.
|
|
98
|
+
3. **Is the plan marker written?** After approval, write to `~/.claude/ftm-state/.plan-presented` before executing. This signals to hooks that planning happened.
|
|
99
|
+
4. If the task involves external mutations (see Approval Gates), have you presented the specific actions and received approval?
|
|
100
|
+
5. If none of the above apply (micro/small task, no forced escalation), proceed.
|
|
101
|
+
|
|
102
|
+
**The rationalization trap**: You will feel the urge to skip the plan because:
|
|
103
|
+
- "The user said 'do as much as you can' — that's implicit approval" → NO. That's the task description, not plan approval.
|
|
104
|
+
- "I know what needs to happen, presenting a plan is just overhead" → NO. The plan is for the USER, not for you.
|
|
105
|
+
- "I'll just start with one small API call to check something" → NO. One call becomes five becomes a full execution without approval.
|
|
106
|
+
- "The user seems impatient" → NO. A 30-second plan saves 10 minutes of unwanted work.
|
|
107
|
+
|
|
108
|
+
**This applies to ALL execution methods** — Bash commands, MCP calls, Python scripts, curl, direct API calls. The plan-gate hook catches Edit/Write/MCP, but Bash API calls bypass it. This checkpoint is the only thing that catches those. Do not skip it.
|
|
99
109
|
|
|
100
110
|
### 1. Direct action
|
|
101
111
|
|
package/hooks/ftm-plan-gate.sh
CHANGED
|
@@ -1,24 +1,43 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# ftm-plan-gate.sh
|
|
3
|
-
# PreToolUse hook for Edit/Write tools.
|
|
3
|
+
# PreToolUse hook for Edit/Write tools AND mutating MCP calls.
|
|
4
4
|
#
|
|
5
|
-
# Checks if a plan has been presented this session before allowing code edits
|
|
6
|
-
# If no plan marker exists and the
|
|
7
|
-
# telling Claude to stop and present a plan first.
|
|
5
|
+
# Checks if a plan has been presented this session before allowing code edits
|
|
6
|
+
# or external API mutations. If no plan marker exists and the action count is
|
|
7
|
+
# climbing, injects warnings telling Claude to stop and present a plan first.
|
|
8
|
+
#
|
|
9
|
+
# Gates: Edit, Write, and MCP tools that create/update/delete external resources
|
|
10
|
+
# (Freshservice, Okta, Jira, Slack sends, Gmail sends, etc.)
|
|
8
11
|
#
|
|
9
12
|
# The marker file (~/.claude/ftm-state/.plan-presented) is created by Claude
|
|
10
13
|
# when it presents a plan. Any non-empty content counts as "plan presented".
|
|
11
14
|
# The file is cleaned up by the blackboard enforcer at session end.
|
|
12
15
|
#
|
|
13
|
-
# Hook: PreToolUse (matcher: Edit|Write)
|
|
16
|
+
# Hook: PreToolUse (matcher: Edit|Write|mcp__*)
|
|
14
17
|
|
|
15
18
|
set -euo pipefail
|
|
16
19
|
|
|
17
20
|
INPUT=$(cat)
|
|
18
21
|
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // ""')
|
|
19
22
|
|
|
20
|
-
#
|
|
21
|
-
|
|
23
|
+
# Determine if this is a gated tool
|
|
24
|
+
IS_GATED=false
|
|
25
|
+
|
|
26
|
+
# Gate Edit and Write
|
|
27
|
+
if [[ "$TOOL_NAME" == "Edit" || "$TOOL_NAME" == "Write" ]]; then
|
|
28
|
+
IS_GATED=true
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Gate mutating MCP calls (create, update, delete, send, add, remove, apply, transition)
|
|
32
|
+
if [[ "$TOOL_NAME" == mcp__* ]]; then
|
|
33
|
+
case "$TOOL_NAME" in
|
|
34
|
+
*create*|*update*|*delete*|*send*|*add*|*remove*|*apply*|*transition*|*commit*|*push*|*post_message*|*reply*|*modify*|*batch*|*convert*)
|
|
35
|
+
IS_GATED=true
|
|
36
|
+
;;
|
|
37
|
+
esac
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
if [[ "$IS_GATED" != "true" ]]; then
|
|
22
41
|
exit 0
|
|
23
42
|
fi
|
|
24
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feed-the-machine",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.8",
|
|
4
4
|
"description": "A brain upgrade for Claude Code — 26 skills that teach it how to think before acting, remember across conversations, debug like a war room, run plans on autopilot with agent teams, and get second opinions from GPT & Gemini. Plus 15 hooks that automate the boring stuff.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "kkudumu",
|