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.
@@ -18,22 +18,9 @@
18
18
  FTM_STATE="$HOME/.claude/ftm-state"
19
19
  CONTEXT_JSON="$FTM_STATE/blackboard/context.json"
20
20
 
21
- # Check if an ftm session is active by reading context.json
22
- FTM_ACTIVE=$(python3 -c "
23
- import json, sys
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 for Claude to see
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. Please log this to the ftm daily log."
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
 
@@ -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: SessionEnd
3
+ # Hook: Deactivate ftm session tracking and ensure daily log exists when conversation ends
4
+ # Trigger: Stop
5
5
  #
6
- # IMPORTANT: Must be listed AFTER ftm-session-snapshot.sh in settings.json
7
- # (in a separate matcher entry). The snapshot hook reads context.json status
8
- # to gate itself this hook marks the session completed.
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
- # Check if an active session exists
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('$CONTEXT_JSON') as f:
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']['status'] = 'completed'
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('$CONTEXT_JSON', 'w') as f:
38
+ with open(ctx_path, 'w') as f:
46
39
  json.dump(d, f, indent=2)
47
- except Exception as e:
48
- sys.stderr.write(f'ftm-session-end: failed to update context.json: {e}\n')
49
- sys.exit(1)
40
+ except Exception:
41
+ pass
50
42
  " 2>/dev/null
51
43
 
52
- echo "ftm session tracking deactivated (session ended)"
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.8",
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",