eagle-mem 1.0.0

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.
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: eagle-mem-overview
3
+ description: >
4
+ Generate or update a project overview for Eagle Mem. Use when: 'eagle overview',
5
+ 'project overview', 'summarize this project', 'eagle mem overview', 'what is this project',
6
+ 'update overview'. Creates a persistent one-paragraph project summary injected at session start.
7
+ ---
8
+
9
+ # Eagle Mem — Project Overview
10
+
11
+ Generate a concise project overview that Eagle Mem injects at the start of every session. This gives fresh context windows an instant understanding of what the project is and what's been happening.
12
+
13
+ ## How it works
14
+
15
+ 1. Query recent summaries and observations for the current project
16
+ 2. Synthesize them into a concise overview (2-4 sentences)
17
+ 3. Save to the `overviews` table — one row per project, updated in place
18
+
19
+ The overview is automatically injected by the SessionStart hook.
20
+
21
+ ## Generating an overview
22
+
23
+ ### Step 1: Gather context
24
+
25
+ ```bash
26
+ sqlite3 ~/.eagle-mem/memory.db "
27
+ SELECT request, completed, learned, next_steps, created_at
28
+ FROM summaries
29
+ WHERE project = '<project>'
30
+ ORDER BY created_at DESC
31
+ LIMIT 10;
32
+ "
33
+ ```
34
+
35
+ Also check frequently modified files:
36
+
37
+ ```bash
38
+ sqlite3 ~/.eagle-mem/memory.db "
39
+ PRAGMA trusted_schema=ON;
40
+ SELECT json_each.value as file, COUNT(*) as times
41
+ FROM observations, json_each(observations.files_modified)
42
+ WHERE observations.project = '<project>'
43
+ GROUP BY json_each.value
44
+ ORDER BY times DESC
45
+ LIMIT 10;
46
+ "
47
+ ```
48
+
49
+ ### Step 2: Write the overview
50
+
51
+ Synthesize the data into a concise overview covering:
52
+ - **What** the project is (one sentence)
53
+ - **Current state** — what's been worked on recently
54
+ - **Key patterns** — tech stack, architecture decisions, active conventions
55
+
56
+ Keep it under 500 characters. This gets injected into every session start, so brevity matters.
57
+
58
+ ### Step 3: Save to database
59
+
60
+ ```bash
61
+ sqlite3 ~/.eagle-mem/memory.db "
62
+ PRAGMA trusted_schema=ON;
63
+ INSERT INTO overviews (project, content, updated_at)
64
+ VALUES ('<project>', '<overview text>', strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))
65
+ ON CONFLICT(project) DO UPDATE SET
66
+ content = excluded.content,
67
+ updated_at = excluded.updated_at;
68
+ "
69
+ ```
70
+
71
+ ## Viewing the current overview
72
+
73
+ ```bash
74
+ sqlite3 ~/.eagle-mem/memory.db "
75
+ SELECT project, content, updated_at FROM overviews
76
+ WHERE project = '<project>';
77
+ "
78
+ ```
79
+
80
+ ## Listing all project overviews
81
+
82
+ ```bash
83
+ sqlite3 ~/.eagle-mem/memory.db "
84
+ SELECT project, substr(content, 1, 80) || '...', updated_at
85
+ FROM overviews
86
+ ORDER BY updated_at DESC;
87
+ "
88
+ ```
89
+
90
+ ## Deleting an overview
91
+
92
+ ```bash
93
+ sqlite3 ~/.eagle-mem/memory.db "
94
+ DELETE FROM overviews WHERE project = '<project>';
95
+ "
96
+ ```
97
+
98
+ ## Guidelines
99
+
100
+ - Update the overview when the project direction changes significantly
101
+ - Keep it factual — what IS, not what SHOULD BE
102
+ - Don't include task lists or TODOs — those belong in the tasks table
103
+ - The overview supplements (doesn't replace) recent session summaries
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: eagle-mem-search
3
+ description: >
4
+ Search Eagle Mem's persistent memory database. Use when: 'eagle search', 'search memory',
5
+ 'what did I do', 'eagle mem search', 'find in memory', 'past sessions', 'what happened with',
6
+ 'search my history'. Three-layer search: compact index (fast) → timeline (chronological) →
7
+ full details (complete observations).
8
+ ---
9
+
10
+ # Eagle Mem — Memory Search
11
+
12
+ Search the Eagle Mem database for past session summaries, observations, and task history.
13
+
14
+ ## Three-layer search pattern
15
+
16
+ ### Layer 1: Compact search (default)
17
+
18
+ Fast keyword search across session summaries. Returns ~50-100 tokens per result.
19
+
20
+ ```bash
21
+ sqlite3 ~/.eagle-mem/memory.db "
22
+ PRAGMA trusted_schema=ON;
23
+ SELECT s.id, s.request, s.completed, s.created_at, s.project
24
+ FROM summaries s
25
+ JOIN summaries_fts f ON f.rowid = s.id
26
+ WHERE summaries_fts MATCH '<query>'
27
+ ORDER BY rank
28
+ LIMIT 10;
29
+ "
30
+ ```
31
+
32
+ Use this first. If the user needs more detail, go to Layer 2 or 3.
33
+
34
+ ### Layer 2: Timeline (chronological context)
35
+
36
+ Show recent sessions for a project in time order. Good for "what have I been working on?"
37
+
38
+ ```bash
39
+ sqlite3 ~/.eagle-mem/memory.db "
40
+ SELECT s.request, s.completed, s.learned, s.next_steps, s.created_at
41
+ FROM summaries s
42
+ WHERE s.project = '<project>'
43
+ ORDER BY s.created_at DESC
44
+ LIMIT <N>;
45
+ "
46
+ ```
47
+
48
+ ### Layer 3: Full details (observations)
49
+
50
+ When the user needs to know exactly what files were touched or what tools were used:
51
+
52
+ ```bash
53
+ sqlite3 ~/.eagle-mem/memory.db "
54
+ PRAGMA trusted_schema=ON;
55
+ SELECT o.tool_name, o.tool_input_summary, o.files_read, o.files_modified, o.created_at
56
+ FROM observations o
57
+ WHERE o.session_id = '<session_id>'
58
+ ORDER BY o.created_at ASC;
59
+ "
60
+ ```
61
+
62
+ ## Additional queries
63
+
64
+ ### Cross-project search
65
+
66
+ ```bash
67
+ sqlite3 ~/.eagle-mem/memory.db "
68
+ PRAGMA trusted_schema=ON;
69
+ SELECT s.project, s.request, s.completed, s.created_at
70
+ FROM summaries s
71
+ JOIN summaries_fts f ON f.rowid = s.id
72
+ WHERE summaries_fts MATCH '<query>'
73
+ ORDER BY rank
74
+ LIMIT 10;
75
+ "
76
+ ```
77
+
78
+ ### Files frequently modified
79
+
80
+ ```bash
81
+ sqlite3 ~/.eagle-mem/memory.db "
82
+ PRAGMA trusted_schema=ON;
83
+ SELECT json_each.value as file, COUNT(*) as times
84
+ FROM observations, json_each(observations.files_modified)
85
+ WHERE observations.project = '<project>'
86
+ GROUP BY json_each.value
87
+ ORDER BY times DESC
88
+ LIMIT 20;
89
+ "
90
+ ```
91
+
92
+ ### Task history
93
+
94
+ ```bash
95
+ sqlite3 ~/.eagle-mem/memory.db "
96
+ SELECT id, title, status, completed_at
97
+ FROM tasks
98
+ WHERE project = '<project>'
99
+ ORDER BY ordinal ASC, id ASC;
100
+ "
101
+ ```
102
+
103
+ ### Session count and stats
104
+
105
+ ```bash
106
+ sqlite3 ~/.eagle-mem/memory.db "
107
+ SELECT
108
+ COUNT(DISTINCT s.id) as sessions,
109
+ COUNT(DISTINCT su.id) as summaries,
110
+ COUNT(DISTINCT o.id) as observations,
111
+ COUNT(DISTINCT t.id) as tasks
112
+ FROM sessions s
113
+ LEFT JOIN summaries su ON su.project = s.project
114
+ LEFT JOIN observations o ON o.session_id = s.id
115
+ LEFT JOIN tasks t ON t.project = s.project
116
+ WHERE s.project = '<project>';
117
+ "
118
+ ```
119
+
120
+ ## Usage tips
121
+
122
+ - Start with Layer 1 (compact search) — it's fast and usually sufficient
123
+ - Use FTS5 query syntax: `word1 AND word2`, `"exact phrase"`, `word1 OR word2`, `word1 NOT word2`
124
+ - The `project` column maps to the directory name (basename of cwd)
125
+ - Cross-project search omits the WHERE project clause
126
+ - Observations are high-volume — query by session_id, not full table scans
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: eagle-mem-tasks
3
+ description: >
4
+ TaskAware Compact Loop — break complex work into database-tracked subtasks with compaction
5
+ between each. Use when: 'eagle tasks', 'break this into tasks', 'create task plan',
6
+ 'task loop', 'compact loop', 'eagle mem tasks'. Prevents context bloat and hallucination
7
+ by executing one task at a time with memory re-injection after each /compact.
8
+ ---
9
+
10
+ # Eagle Mem — TaskAware Compact Loop
11
+
12
+ Break complex work into subtasks stored in Eagle Mem's database. Execute one task at a time, compact between each, and let Eagle Mem re-inject context for the next task.
13
+
14
+ ## How it works
15
+
16
+ 1. **Plan**: Break the user's request into ordered subtasks
17
+ 2. **Store**: Write each subtask to the Eagle Mem database
18
+ 3. **Execute**: Work on the current task (marked `[ACTIVE]`)
19
+ 4. **Compact**: When done, tell the user to run `/compact`
20
+ 5. **Resume**: After compact, SessionStart re-injects memory + loads the next task
21
+ 6. **Repeat**: Until all tasks are done
22
+
23
+ ## Commands
24
+
25
+ ### Creating tasks
26
+
27
+ When the user invokes `/eagle-mem-tasks` or asks to break work into tasks:
28
+
29
+ 1. Analyze the request and break it into 3-8 focused subtasks
30
+ 2. Each task should be completable in one context window (~50-100K tokens of work)
31
+ 3. Write tasks to the database using this pattern:
32
+
33
+ ```bash
34
+ ~/.eagle-mem/db/task-ops.sh add "<project>" "<title>" "<instructions>" <ordinal>
35
+ ```
36
+
37
+ If `task-ops.sh` doesn't exist yet, write directly:
38
+
39
+ ```bash
40
+ sqlite3 ~/.eagle-mem/memory.db "
41
+ PRAGMA trusted_schema=ON;
42
+ INSERT INTO tasks (project, title, instructions, ordinal)
43
+ VALUES ('<project>', '<title>', '<instructions>', <ordinal>);
44
+ "
45
+ ```
46
+
47
+ 4. Show the task plan to the user for confirmation
48
+ 5. After confirmation, start working on task #1
49
+
50
+ ### Viewing tasks
51
+
52
+ ```bash
53
+ sqlite3 ~/.eagle-mem/memory.db "
54
+ SELECT id, title, status, ordinal FROM tasks
55
+ WHERE project = '<project>'
56
+ ORDER BY ordinal ASC, id ASC;
57
+ "
58
+ ```
59
+
60
+ ### Completing a task
61
+
62
+ When the current task is done:
63
+
64
+ 1. Mark it complete:
65
+ ```bash
66
+ sqlite3 ~/.eagle-mem/memory.db "
67
+ PRAGMA trusted_schema=ON;
68
+ UPDATE tasks SET status = 'done', completed_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
69
+ WHERE id = <task_id>;
70
+ "
71
+ ```
72
+
73
+ 2. Emit your `<eagle-summary>` block
74
+ 3. Tell the user: **"Task #N complete. Run `/compact` to save progress and load the next task."**
75
+
76
+ ### Skipping/blocking a task
77
+
78
+ ```bash
79
+ sqlite3 ~/.eagle-mem/memory.db "
80
+ UPDATE tasks SET status = 'blocked'
81
+ WHERE id = <task_id>;
82
+ "
83
+ ```
84
+
85
+ ## Task design guidelines
86
+
87
+ - Each task should be **self-contained** — completable without needing context from mid-execution of a previous task
88
+ - Include `instructions` with enough detail that a fresh context window can pick it up
89
+ - Include a `context_snapshot` for tasks that depend on decisions from earlier tasks:
90
+ ```bash
91
+ sqlite3 ~/.eagle-mem/memory.db "
92
+ PRAGMA trusted_schema=ON;
93
+ UPDATE tasks SET context_snapshot = '<key decisions and state>'
94
+ WHERE id = <task_id>;
95
+ "
96
+ ```
97
+ - Order tasks so that foundational work comes first (schema before API, API before UI)
98
+
99
+ ## The compact cycle
100
+
101
+ ```
102
+ User request → Plan tasks → Execute task 1 → /compact
103
+ → Eagle Mem saves summary → Context cleared → Memory re-injected
104
+ → Task 2 loaded as [ACTIVE] → Execute task 2 → /compact
105
+ → ... repeat until all tasks done ...
106
+ → Final summary: "All N tasks complete."
107
+ ```
108
+
109
+ This prevents context window bloat. Each task gets a fresh window with only relevant memory injected.
110
+
111
+ ## Example
112
+
113
+ User: "Build a REST API with auth, CRUD endpoints, and tests"
114
+
115
+ Tasks created:
116
+ 1. Set up project structure and dependencies
117
+ 2. Implement auth middleware (JWT)
118
+ 3. Build CRUD endpoints for users
119
+ 4. Build CRUD endpoints for posts
120
+ 5. Write integration tests
121
+ 6. Add error handling and validation
122
+
123
+ Each task executes in its own compact cycle with full memory of what came before.