$curl -o .claude/agents/meta-handover.md https://raw.githubusercontent.com/frankxai/agentic-creator-os/HEAD/.claude/agents/meta-handover.mdWrites a durable session-handover doc to docs/ops/HANDOVER-<date>.md so a different agent or session can pick up cold. Auto-invokes when Frank says "handover", "next session", "switching agents", "another session will continue", or runs /handover. Wraps the /handover command in
| 1 | ## 1. Purpose |
| 2 | |
| 3 | Cross-session continuity. Captures repo state + done/undone bullets + critical context + recommended next actions into one markdown file the next agent reads cold. Used when handing to Claude Coworker, a different CC session, or a teammate. |
| 4 | |
| 5 | Why this slot: today /handover is a command; agents can't dispatch it. This agent makes handover a first-class subagent so the publishing orchestrator (or any pillar's flow) can call `Agent(subagent_type: "meta-handover")` at flow end. |
| 6 | |
| 7 | ## 2. Triggers |
| 8 | |
| 9 | **Verbal cues (auto-invoke):** |
| 10 | - "handover" / "/handover" / "switching agents" / "next session pick up" |
| 11 | - "I'm done for now" (if mid-task — distinguish from /eod) |
| 12 | - "draft a handover for X" |
| 13 | |
| 14 | **Conditional triggers:** |
| 15 | - Session about to end with uncommitted work + at least one open task |
| 16 | - Switching from FrankX → another repo with active state |
| 17 | - Publishing-orchestrator or research-orchestrator flow completes with partial-success |
| 18 | |
| 19 | **Manual dispatch:** |
| 20 | - `Agent(subagent_type: "meta-handover", prompt: "handover for next agent picking up the L99 wrapper sprint")` |
| 21 | - `@meta-handover` inline |
| 22 | |
| 23 | **NOT triggered by:** end-of-day wrap-up where Frank resumes tomorrow (that's `/eod` / `@meta-eod`). |
| 24 | |
| 25 | ## 3. Inputs |
| 26 | |
| 27 | **Read-only:** |
| 28 | - `git log --oneline -10 --decorate` |
| 29 | - `git status --short --branch` |
| 30 | - `git diff --stat origin/main...HEAD` |
| 31 | - `docs/sessions/UNFINISHED-*.md`, `docs/sessions/NEXT-SESSION-*.md` (if any) |
| 32 | - `~/.claude/projects/*/memory/MEMORY.md` (relevant memory entries by keyword) |
| 33 | |
| 34 | **Optional:** |
| 35 | - Current TaskList state — to surface in-flight + blocked items |
| 36 | |
| 37 | **Write-only:** |
| 38 | - `docs/ops/HANDOVER-<YYYY-MM-DD>.md` |
| 39 | |
| 40 | **Must not modify:** never edits agents.ts, never touches src/. Pure capture. |
| 41 | |
| 42 | ## 4. Process |
| 43 | |
| 44 | ``` |
| 45 | 0. Recall prior context (memory layer): |
| 46 | node lib/acos/memory.mjs recall "meta-handover session: <project>" 3 |
| 47 | If prior handover for same project exists, reference it (avoid duplicate context). |
| 48 | |
| 49 | 1. Gather state in parallel: |
| 50 | - git log --oneline -10 --decorate |
| 51 | - git status --short --branch |
| 52 | - git diff --stat origin/main...HEAD 2>/dev/null || echo "no remote" |
| 53 | Capture all three. |
| 54 | |
| 55 | 2. Check for unfinished session docs: |
| 56 | ls docs/sessions/UNFINISHED-*.md docs/sessions/NEXT-SESSION-*.md 2>/dev/null |
| 57 | If found, READ their content (don't just reference — the next agent may not look there). |
| 58 | |
| 59 | 3. Detect project from cwd: |
| 60 | - /c/Users/frank/FrankX → "FrankX" |
| 61 | - /c/Users/frank/gencreator.ai → "GenCreator" |
| 62 | - else basename of pwd |
| 63 | |
| 64 | 4. Compose HANDOVER-<date>.md per the /handover command template: |
| 65 | - ## Situation (one paragraph) |
| 66 | - ## What's Done (specific bullets — file paths, route names) |
| 67 | - ## What's Not Done (each with WHY — blocked/deferred/ran-out) |
| 68 | - ## Critical Context (non-obvious decisions, env vars, broken files) |
| 69 | - ## Recommended Next Actions (1–3, ordered) |
| 70 | - ## Files to Read First (annotated with why) |
| 71 | - ## Repo Map (if multi-repo) |
| 72 | |
| 73 | 5. Atomic write to docs/ops/HANDOVER-<YYYY-MM-DD>.md. |
| 74 | If file exists (multiple handovers same day), suffix with -<HHmm>. |
| 75 | |
| 76 | 6. Persist to memory: |
| 77 | node lib/acos/memory.mjs remember '{ |
| 78 | "agent":"meta-handover", |
| 79 | "intent":"meta-handover session: <project>", |
| 80 | "approach":"handover written to <path>, N done bullets, M not-done", |
| 81 | "score":0.9, |
| 82 | "tags":["handover","continuity","<project>"], |
| 83 | "metadata":{"path":"<file>","done_count":<N>,"undone_count":<M>} |
| 84 | }' |
| 85 | |
| 86 | 7. Print path + summary lines. Do NOT commit (caller decides commit timing). |
| 87 | ``` |
| 88 | |
| 89 | ## 5. Outputs |
| 90 | |
| 91 | **Human-readable:** |
| 92 | |
| 93 | ``` |
| 94 | Handover written: docs/ops/HANDOVER-<date>.md |
| 95 | |
| 96 | Project: <name> |
| 97 | Branch: <branch> (<state>) |
| 98 | Commits ahead of main: <N> |
| 99 | Done bullets: <N> · Not-done: <M> |
| 100 | Critical context items: <K> |
| 101 | Next actions: <listed 1-3> |
| 102 | ``` |
| 103 | |
| 104 | **Structured JSON (last line):** |
| 105 | |
| 106 | ```json |
| 107 | { |
| 108 | "status": "ready", |
| 109 | "agent": "meta-handover", |
| 110 | "outcome": { |
| 111 | "path": "docs/ops/HANDOVER-2026-05-15.md", |
| 112 | "project": "FrankX", |
| 113 | "branch": "feature/acos-l99-meta-pillar", |
| 114 | "branch_state": "ahead-by-9", |
| 115 | "done_count": 9, |
| 116 | "undone_count": 2, |
| 117 | "critical_count": 3, |
| 118 | "next_actions_count": 2 |
| 119 | }, |
| 120 | "memory_ids": ["..."] |
| 121 | } |
| 122 | ``` |
| 123 | |
| 124 | ## 6. Integration |
| 125 | |
| 126 | **Upstream:** `/handover` command, session-end conditional, publishing-orchestrator flow-debrief |
| 127 | **Memory:** reads/writes intent `"meta-handover session: <project>"` |
| 128 | **Downstream:** the next agent reads the file before resuming work |
| 129 | **Luminor Router:** dispatched at handoff-required flow points |
| 130 | |
| 131 | ## 7. Smoke eval |
| 132 | |
| 133 | **Functional** (`tests/fixtures/meta-handover/smoke.mjs`): |
| 134 | - Seed git state with 3 commits ahead |