feed-the-machine 1.7.8 → 1.7.9
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-auto-log.sh +15 -18
- package/hooks/ftm-session-end.sh +37 -31
- package/package.json +1 -1
package/hooks/ftm-auto-log.sh
CHANGED
|
@@ -18,22 +18,9 @@
|
|
|
18
18
|
FTM_STATE="$HOME/.claude/ftm-state"
|
|
19
19
|
CONTEXT_JSON="$FTM_STATE/blackboard/context.json"
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
try:
|
|
25
|
-
with open('$CONTEXT_JSON') as f:
|
|
26
|
-
d = json.load(f)
|
|
27
|
-
task = d.get('current_task', {})
|
|
28
|
-
status = task.get('status', '')
|
|
29
|
-
print('1' if status not in ('', 'completed', 'none') else '0')
|
|
30
|
-
except Exception:
|
|
31
|
-
print('0')
|
|
32
|
-
" 2>/dev/null)
|
|
33
|
-
|
|
34
|
-
if [ "$FTM_ACTIVE" != "1" ]; then
|
|
35
|
-
exit 0 # Not in active ftm session, skip
|
|
36
|
-
fi
|
|
21
|
+
# NOTE: Session gate removed in v1.7.9. Daily logging should happen for ALL work,
|
|
22
|
+
# not just formal ftm sessions. Most productive work happens outside /ftm invocations
|
|
23
|
+
# and was going untracked because context.json status was "none" or "completed".
|
|
37
24
|
|
|
38
25
|
# Read payload from stdin (JSON) — extract prompt for action pattern matching
|
|
39
26
|
STDIN_DATA=$(cat)
|
|
@@ -83,10 +70,20 @@ if echo "$USER_MESSAGE" | grep -qE "(I|i) .* (what|should|next|now)\?"; then
|
|
|
83
70
|
SHOULD_LOG=true
|
|
84
71
|
fi
|
|
85
72
|
|
|
86
|
-
# If action detected, output logging reminder
|
|
73
|
+
# If action detected, output logging reminder with exact instructions
|
|
74
|
+
TODAY=$(date +%Y-%m-%d)
|
|
75
|
+
DAILY_DIR="$HOME/.claude/ftm-ops/daily"
|
|
76
|
+
DAILY_FILE="$DAILY_DIR/$TODAY.md"
|
|
77
|
+
|
|
87
78
|
if [ "$SHOULD_LOG" = true ]; then
|
|
88
79
|
echo ""
|
|
89
|
-
echo "[Auto-log] Detected progress update.
|
|
80
|
+
echo "[Auto-log] Detected progress update. Append to daily log NOW:"
|
|
81
|
+
echo " File: $DAILY_FILE"
|
|
82
|
+
if [ ! -f "$DAILY_FILE" ]; then
|
|
83
|
+
echo " File doesn't exist yet — create it with header: # Daily Log — $TODAY"
|
|
84
|
+
fi
|
|
85
|
+
echo " Format: - HH:MM — [what was done] (ticket/PR/system if applicable)"
|
|
86
|
+
echo " Do this silently — don't announce it to the user."
|
|
90
87
|
echo ""
|
|
91
88
|
fi
|
|
92
89
|
|
package/hooks/ftm-session-end.sh
CHANGED
|
@@ -1,52 +1,58 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# ftm-session-end.sh
|
|
3
|
-
# Hook: Deactivate ftm session tracking when conversation ends
|
|
4
|
-
# Trigger:
|
|
3
|
+
# Hook: Deactivate ftm session tracking and ensure daily log exists when conversation ends
|
|
4
|
+
# Trigger: Stop
|
|
5
5
|
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
6
|
+
# Always runs — not gated on ftm session state. Every session that ends should:
|
|
7
|
+
# 1. Mark context.json as completed (if active)
|
|
8
|
+
# 2. Ensure today's daily log file exists (create if missing)
|
|
9
|
+
# 3. Remind Claude to append a session summary before exiting
|
|
9
10
|
|
|
10
11
|
FTM_STATE="$HOME/.claude/ftm-state"
|
|
11
12
|
CONTEXT_JSON="$FTM_STATE/blackboard/context.json"
|
|
13
|
+
TODAY=$(date +%Y-%m-%d)
|
|
14
|
+
DAILY_DIR="$HOME/.claude/ftm-ops/daily"
|
|
15
|
+
DAILY_FILE="$DAILY_DIR/$TODAY.md"
|
|
12
16
|
|
|
13
|
-
#
|
|
14
|
-
IS_ACTIVE=$(python3 -c "
|
|
15
|
-
import json, sys
|
|
16
|
-
try:
|
|
17
|
-
with open('$CONTEXT_JSON') as f:
|
|
18
|
-
d = json.load(f)
|
|
19
|
-
task = d.get('current_task', {})
|
|
20
|
-
status = task.get('status', '')
|
|
21
|
-
print('1' if status not in ('', 'completed', 'none') else '0')
|
|
22
|
-
except Exception:
|
|
23
|
-
print('0')
|
|
24
|
-
" 2>/dev/null)
|
|
25
|
-
|
|
26
|
-
if [ "$IS_ACTIVE" != "1" ]; then
|
|
27
|
-
exit 0
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
# Mark session as completed in context.json
|
|
17
|
+
# Mark session as completed in context.json (if it has an active task)
|
|
31
18
|
python3 -c "
|
|
32
|
-
import json, sys
|
|
19
|
+
import json, sys, os
|
|
33
20
|
from datetime import datetime
|
|
34
21
|
|
|
22
|
+
ctx_path = '$CONTEXT_JSON'
|
|
23
|
+
if not os.path.exists(ctx_path):
|
|
24
|
+
sys.exit(0)
|
|
25
|
+
|
|
35
26
|
try:
|
|
36
|
-
with open(
|
|
27
|
+
with open(ctx_path) as f:
|
|
37
28
|
d = json.load(f)
|
|
38
29
|
|
|
39
30
|
if 'current_task' in d and isinstance(d['current_task'], dict):
|
|
40
|
-
d['current_task']
|
|
31
|
+
status = d['current_task'].get('status', '')
|
|
32
|
+
if status not in ('', 'completed', 'none'):
|
|
33
|
+
d['current_task']['status'] = 'completed'
|
|
41
34
|
|
|
42
35
|
if 'session_metadata' in d and isinstance(d['session_metadata'], dict):
|
|
43
36
|
d['session_metadata']['last_updated'] = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
44
37
|
|
|
45
|
-
with open(
|
|
38
|
+
with open(ctx_path, 'w') as f:
|
|
46
39
|
json.dump(d, f, indent=2)
|
|
47
|
-
except Exception
|
|
48
|
-
|
|
49
|
-
sys.exit(1)
|
|
40
|
+
except Exception:
|
|
41
|
+
pass
|
|
50
42
|
" 2>/dev/null
|
|
51
43
|
|
|
52
|
-
|
|
44
|
+
# Ensure daily log directory and file exist
|
|
45
|
+
mkdir -p "$DAILY_DIR"
|
|
46
|
+
if [ ! -f "$DAILY_FILE" ]; then
|
|
47
|
+
echo "# Daily Log — $TODAY" > "$DAILY_FILE"
|
|
48
|
+
echo "" >> "$DAILY_FILE"
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# Remind Claude to write session summary to daily log
|
|
52
|
+
echo ""
|
|
53
|
+
echo "[Session ending] Before you finish, append a summary of this session to the daily log:"
|
|
54
|
+
echo " File: $DAILY_FILE"
|
|
55
|
+
echo " Format: ## Session — HH:MM"
|
|
56
|
+
echo " Then bullet points of what was accomplished, decisions made, and next steps."
|
|
57
|
+
echo " Do this silently — just write the file."
|
|
58
|
+
echo ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feed-the-machine",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.9",
|
|
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",
|