eagle-mem 4.7.0 → 4.8.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,149 @@
1
+ ---
2
+ name: eagle-mem-orchestrate
3
+ description: >
4
+ Coordinate multi-agent work with Eagle Mem's durable orchestrator/worker
5
+ lanes. Use when the user wants an orchestrator model, parallel lanes,
6
+ Claude Code and Codex sharing worker status, worktree coordination,
7
+ handoffs, or long-running implementation split across agents.
8
+ ---
9
+
10
+ # Eagle Mem — Orchestrator/Worker Lanes
11
+
12
+ ## Purpose
13
+
14
+ Use this skill when work is too broad for one agent turn and needs durable
15
+ coordination across Claude Code, Codex, or both.
16
+
17
+ The commands in this skill are for **you, the active agent**, to run from the
18
+ terminal. Do not hand them to the user as setup steps. The user should only see
19
+ brief progress updates or the final handoff when that helps them.
20
+
21
+ Eagle Mem stores each lane in shared SQLite tables and mirrors it into
22
+ `agent_tasks`, so SessionStart can re-inject in-flight lane state after
23
+ compaction or when another agent opens the same project.
24
+
25
+ By default, Eagle Mem routes work to the opposite agent:
26
+ - Codex coordinator -> Claude Code worker (`claude-opus-4-7`, `xhigh`)
27
+ - Claude Code coordinator -> Codex worker (`gpt-5.5`, `xhigh`)
28
+
29
+ Workers run in git worktrees so their edits stay isolated until the coordinator
30
+ reviews and integrates them. The worker wrapper preserves the original Eagle
31
+ Mem project name, so memories and observations recorded inside the worktree
32
+ still attach to the main project.
33
+
34
+ ## When To Use
35
+
36
+ Use orchestration when:
37
+ - The work has separate independent lanes, such as API, database, UI, docs, or
38
+ release validation.
39
+ - Claude Code and Codex may work in the same repo and must not duplicate work.
40
+ - A lane needs its own worktree, validation command, or owner.
41
+ - The user asks for an orchestrator/worker model, agent lanes, subagent lanes,
42
+ or durable handoff.
43
+
44
+ Use `eagle-mem tasks` instead when the work is a simple sequential checklist
45
+ that one agent will execute in order.
46
+
47
+ ## Workflow
48
+
49
+ ### 1. Start The Orchestration Yourself
50
+
51
+ ```bash
52
+ eagle-mem orchestrate init "Ship the release safely"
53
+ ```
54
+
55
+ This records the goal and current git baseline for the project.
56
+
57
+ ### 2. Add Worker Lanes Yourself
58
+
59
+ Create one lane per independent workstream. The description should be
60
+ self-contained enough for a fresh agent context.
61
+
62
+ ```bash
63
+ eagle-mem orchestrate lane add api \
64
+ --agent codex \
65
+ --title "API fixes" \
66
+ --desc "Fix release-boundary checks and add shell-hook regression tests." \
67
+ --validate "npm test"
68
+
69
+ eagle-mem orchestrate lane add docs \
70
+ --agent claude-code \
71
+ --title "Docs and release notes" \
72
+ --desc "Update README and usage docs after implementation is verified."
73
+ ```
74
+
75
+ ### 3. Spawn Worker Lanes Yourself
76
+
77
+ After adding a lane, launch the worker yourself. Do not ask the user to run
78
+ this command.
79
+
80
+ ```bash
81
+ eagle-mem orchestrate spawn api
82
+ ```
83
+
84
+ This creates a git worktree, writes a lane prompt, launches the target CLI, and
85
+ records the worker process/log/exit paths in Eagle Mem. Use `--foreground` when
86
+ you need to watch a short worker run inline, `--no-launch` when you only want
87
+ the worktree and prompt prepared, and `--dry-run` to inspect the planned worker
88
+ without creating a worktree.
89
+
90
+ ### 4. Sync Or Mark Lane State As Work Proceeds
91
+
92
+ ```bash
93
+ eagle-mem orchestrate sync
94
+ eagle-mem orchestrate lane start api
95
+ eagle-mem orchestrate lane block api --notes "Waiting for failing test output."
96
+ eagle-mem orchestrate lane complete api --notes "npm test passed."
97
+ ```
98
+
99
+ Lane state should reflect reality. If a lane is blocked, record the blocker so
100
+ the next agent does not repeat the same attempt.
101
+
102
+ ### 5. Check Status Before Taking Work
103
+
104
+ ```bash
105
+ eagle-mem orchestrate
106
+ eagle-mem tasks
107
+ ```
108
+
109
+ Use the lane owner and status to decide what you should work on. Do not take a
110
+ lane that another agent already owns unless the user explicitly redirects it.
111
+
112
+ ### 6. Create A Durable Handoff
113
+
114
+ ```bash
115
+ eagle-mem orchestrate handoff --write docs/handoff-context.md
116
+ ```
117
+
118
+ Use this before compaction, before handing work to another agent, or before
119
+ ending a broad session.
120
+
121
+ ## Rules For Agents
122
+
123
+ - Main agent acts as coordinator: define lanes, avoid duplicate work, integrate
124
+ results, and run final validation.
125
+ - The agent runs orchestration commands, including `spawn` and `sync`. Do not
126
+ tell the user to run them.
127
+ - Workers own their lane only. They should not rewrite unrelated lanes or
128
+ revert other agents' changes.
129
+ - Every lane should have a validation command when one is obvious.
130
+ - If a lane is blocked, update the lane with a concrete note rather than
131
+ silently stopping.
132
+ - After completing a lane, emit an `<eagle-summary>` so Eagle Mem captures the
133
+ decision and files touched.
134
+
135
+ ## Reference
136
+
137
+ ```bash
138
+ eagle-mem orchestrate # status
139
+ eagle-mem orchestrate --json # lane JSON
140
+ eagle-mem orchestrate init "Goal"
141
+ eagle-mem orchestrate lane add <key> --agent codex --desc "Scope"
142
+ eagle-mem orchestrate spawn <key> # worktree + worker process
143
+ eagle-mem orchestrate sync [key] # reconcile worker state
144
+ eagle-mem orchestrate lane start <key>
145
+ eagle-mem orchestrate lane block <key> --notes "Blocker"
146
+ eagle-mem orchestrate lane complete <key> --notes "Validation passed"
147
+ eagle-mem orchestrate complete
148
+ eagle-mem orchestrate handoff --write docs/handoff-context.md
149
+ ```
@@ -10,9 +10,9 @@ description: >
10
10
 
11
11
  ## Purpose
12
12
 
13
- **For the user:** Multi-step work doesn't get lost when Claude Code compacts. A 6-task implementation plan survives intact across compactions — no re-explaining what was decided, no drift from the original direction.
13
+ **For the user:** Multi-step work doesn't get lost when Claude Code or Codex compacts. A 6-task implementation plan survives intact across compactions — no re-explaining what was decided, no drift from the original direction.
14
14
 
15
- **For you (Claude Code):** Each task description is a message to a future context window with ZERO memory of what happened before. After compaction, SessionStart re-injects pending/in-progress tasks from Eagle Mem's `claude_tasks` table. That re-injected text is all the next context window gets. If the description says "implement auth middleware," the next window has nothing to work with. If it says "implement auth middleware — JWT with RS256, sessions in Redis, errors use RFC 7807 format (decided in task 1)," the next window can execute immediately.
15
+ **For you:** Each task description is a message to a future context window with ZERO memory of what happened before. After compaction, SessionStart re-injects pending/in-progress tasks from Eagle Mem's `agent_tasks` table. That re-injected text is all the next context window gets. If the description says "implement auth middleware," the next window has nothing to work with. If it says "implement auth middleware — JWT with RS256, sessions in Redis, errors use RFC 7807 format (decided in task 1)," the next window can execute immediately.
16
16
 
17
17
  ## Judgment
18
18
 
@@ -26,6 +26,8 @@ description: >
26
26
  - The work fits in one context window — just do it directly
27
27
  - It's a single-file fix or a quick question
28
28
  - The user is exploring, not building (use search/overview instead)
29
+ - The work needs parallel agent lanes or ownership across Claude Code and Codex
30
+ (use `eagle-mem-orchestrate` instead)
29
31
 
30
32
  ## Steps
31
33
 
@@ -42,12 +44,12 @@ Break the request into tasks that are each completable in one context window. Th
42
44
 
43
45
  ### 2. Create — write self-contained descriptions
44
46
 
45
- Use `TaskCreate` for each task. The description is the most important field — it must carry forward every decision from the planning conversation.
47
+ Use the agent-native task mechanism when available. In Claude Code, use `TaskCreate`. In Codex, use `update_plan` for the live UI and `eagle-mem tasks add --agent codex` for durable cross-session task records. The description is the most important field — it must carry forward every decision from the planning conversation.
46
48
 
47
49
  **Context transfer pattern:** For each task, ask: "If I read only this description with zero prior context, can I execute it?" If not, add what's missing.
48
50
 
49
51
  ```
50
- TaskCreate:
52
+ TaskCreate / eagle-mem tasks add:
51
53
  subject: "Add JWT auth middleware"
52
54
  description: "Add Express middleware that validates JWT tokens on protected
53
55
  routes. Decisions: RS256 algorithm, public key from env JWT_PUBLIC_KEY,
@@ -60,15 +62,15 @@ TaskCreate:
60
62
 
61
63
  ### 3. Execute — one task at a time
62
64
 
63
- `TaskUpdate(in_progress)` on the current task. Do the work. Stay focused on that task — don't drift into adjacent tasks.
65
+ Mark the current task in progress (`TaskUpdate(in_progress)` in Claude Code, or `eagle-mem tasks start <id> --agent codex` in Codex). Do the work. Stay focused on that task — don't drift into adjacent tasks.
64
66
 
65
67
  ### 4. Complete — record what happened
66
68
 
67
- `TaskUpdate(completed)`. Emit `<eagle-summary>` so Eagle Mem captures what was accomplished.
69
+ Mark the task completed (`TaskUpdate(completed)` in Claude Code, or `eagle-mem tasks complete <id> --agent codex` in Codex). Emit `<eagle-summary>` so Eagle Mem captures what was accomplished.
68
70
 
69
71
  If the task produced decisions that downstream tasks need, update those task descriptions now:
70
72
  ```
71
- TaskUpdate:
73
+ TaskUpdate / update durable task description:
72
74
  taskId: "3"
73
75
  description: "...original description... Note from task 2: the user table
74
76
  uses UUID primary keys, not auto-increment. Auth tokens table FKs to
@@ -90,7 +92,7 @@ After compaction, SessionStart re-injects all pending/in-progress tasks. Pick th
90
92
  **A task fails or produces unexpected results:** Update the task description with what was learned and what went wrong. Don't just retry blindly — the description should carry the failure context so the next attempt (or the next context window) doesn't repeat the same mistake.
91
93
 
92
94
  ```
93
- TaskUpdate:
95
+ TaskUpdate / task record update:
94
96
  taskId: "4"
95
97
  description: "...original description... FAILED ATTEMPT: Prisma migrate
96
98
  errored because the users table already has a conflicting unique
@@ -102,11 +104,11 @@ TaskUpdate:
102
104
 
103
105
  ## The compact cycle — how task state survives
104
106
 
105
- 1. You call `TaskCreate`/`TaskUpdate` (Claude Code's native task tools)
106
- 2. Claude Code writes task JSON to `~/.claude/tasks/$session_id/*.json`
107
- 3. Eagle Mem's PostToolUse hook fires, mirrors the task into the `claude_tasks` FTS5 table
108
- 4. SessionEnd hook does a final sweep to catch any status changes missed by hooks
109
- 5. On compaction (or new session), SessionStart queries `claude_tasks` for pending/in-progress tasks from the last 7 days and injects them into context
107
+ 1. Claude Code path: you call `TaskCreate`/`TaskUpdate`; Claude Code writes task JSON to `~/.claude/tasks/$session_id/*.json`; Eagle Mem mirrors it.
108
+ 2. Codex path: you call `update_plan` for live progress and `eagle-mem tasks add/start/complete --agent codex` for durable records.
109
+ 3. Eagle Mem stores both paths in the shared `agent_tasks` FTS5 table with `origin_agent`.
110
+ 4. SessionEnd does a final Claude Code task sweep where native task files exist.
111
+ 5. On compaction (or new session), SessionStart queries `agent_tasks` for pending/in-progress tasks from the last 7 days and injects them into context.
110
112
 
111
113
  The task descriptions you write ARE the context that survives. Everything else — your reasoning, the conversation, the files you read — gets compacted away.
112
114
 
@@ -126,14 +128,20 @@ The bad version forces the next context window to re-discover every decision. Th
126
128
  ## Reference
127
129
 
128
130
  ```bash
129
- # Viewing tasks (read-only — Eagle Mem mirrors, doesn't manage)
131
+ # Viewing tasks
130
132
  eagle-mem tasks # pending/in-progress for current project
131
133
  eagle-mem tasks list # all tasks (including completed)
132
134
  eagle-mem tasks completed # completed tasks only
133
135
  eagle-mem tasks search <q> # FTS5 search across task history
134
136
  eagle-mem tasks --json # JSON output for scripting
135
137
 
136
- # Claude Code task tools (these are what you actually use)
138
+ # Codex durable task records
139
+ eagle-mem tasks add "Implement auth middleware" --agent codex --desc "Use RS256, Redis sessions, RFC 7807 errors"
140
+ eagle-mem tasks update <id> --agent codex --desc "New context or failure details"
141
+ eagle-mem tasks start <id> --agent codex
142
+ eagle-mem tasks complete <id> --agent codex
143
+
144
+ # Claude Code task tools
137
145
  TaskCreate # create a new task
138
146
  TaskUpdate # update status, description, dependencies
139
147
  ```