feed-the-machine 1.7.6 → 1.7.7
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.
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.7",
|
|
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",
|