一键导入
handoff
End a Codex session with Wenlan. Stores durable captures, writes a session log, updates project status, and previews pending captures. Invoked as /handoff.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
End a Codex session with Wenlan. Stores durable captures, writes a session log, updates project status, and previews pending captures. Invoked as /handoff.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Frictionless Wenlan setup for Codex. Detects a missing local runtime, installs or repairs it, and verifies the plugin to MCP to local runtime round-trip. Run when the user says "set up wenlan", "is wenlan working", or "fix wenlan".
Frictionless setup. Detects a missing local runtime, installs or repairs it, configures local memory, and verifies the full plugin -> MCP -> local runtime round-trip. Run after `/plugin install wenlan@7xuanlu-wenlan`, or any time the user says "set up wenlan", "is wenlan working", "fix wenlan".
Show a one-screen Codex reference for the Wenlan plugin. Use when the user asks for Wenlan help, command list, or invokes /help.
Run Wenlan diagnostics or resolve every finding into a ready repair, review item, system action, or blocker.
One-screen quick reference for the Wenlan plugin. Lists the daily verbs, the daily flow, where data lives, and how to view it without a GUI. Use when the user says "help", "what can I do", "list wenlan commands", "how do I use wenlan", or invokes `/help`.
Run Wenlan diagnostics or resolve every finding into a ready repair, review item, system action, or blocker.
| name | handoff |
| description | End a Codex session with Wenlan. Stores durable captures, writes a session log, updates project status, and previews pending captures. Invoked as /handoff. |
| allowed-tools | ["Bash","mcp__wenlan__capture","mcp__wenlan__list_pending"] |
| user-invocable | true |
End-of-session ritual for Codex. Produce three artifacts:
~/.wenlan/sessions/<YYYY-MM-DD-HHmm>-<slug>.md.~/.wenlan/sessions/_status/<project>.md plus a
timestamp JSON file.Run:
repo="$(git -C "$PWD" rev-parse --show-toplevel 2>/dev/null || true)"
if [ -n "$repo" ]; then project="$(basename "$repo")"; else project="$(basename "$PWD")"; fi
status_json="$HOME/.wenlan/sessions/_status/handoff-${project}.json"
python3 - "$status_json" <<'PY'
import json, sys
from datetime import datetime, timedelta, timezone
path = sys.argv[1]
try:
print(json.load(open(path)).get("lastHandoff", ""))
except FileNotFoundError:
print((datetime.now(timezone.utc) - timedelta(hours=12)).strftime("%Y-%m-%dT%H:%M:%SZ"))
PY
Use the printed timestamp as lastHandoff.
Call the Codex resolver once:
resolved="$(plugin-codex/bin/resolve-space.sh --cwd "$PWD" 2>/dev/null)"
space="$(printf '%s\n' "$resolved" | cut -f1)"
source_layer="$(printf '%s\n' "$resolved" | cut -f2)"
If space is non-empty, print Resolved space: <space> (from <source-layer>)
and pass it to every mcp__wenlan__capture call. If it is empty, print
Resolved space: none (unscoped) and omit the space parameter.
Call:
mcp__wenlan__list_pending(limit=50)
Filter rows whose created_at is newer than lastHandoff. If none match, say
nothing. If any match, render:
Pending-captures preview (<N> total, top 3 shown):
1. <source_id> "<content>" (untrusted source: <agent>)
Default: proceed. These captures stay pending. Run /curate captures before
/handoff if you want to walk them.
Do not prompt for per-item actions inside /handoff.
If repo is non-empty, collect:
git -C "$repo" log --oneline --since="$lastHandoff"
git -C "$repo" status --short
git -C "$repo" diff --stat HEAD~5..HEAD 2>/dev/null || true
git -C "$repo" worktree list
Use this together with conversation context. If there is no git repo, use the conversation as the source.
Infer durable items without asking. Store only facts that will matter later.
| Label | memory_type | Use for |
|---|---|---|
| Decisions | decision | choices with rationale |
| Lessons | lesson | root cause, workaround, technical insight |
| Insights | gotcha | surprising behavior or sharp edge |
| Corrections | preference | user correction or style preference |
| Facts | fact | durable project, person, or tool fact |
For each item, call:
mcp__wenlan__capture(
content="<one self-contained sentence with why>",
memory_type="<decision|lesson|gotcha|preference|fact>",
space="<resolved if non-empty>"
)
Keep one memory per item. Skip file paths, commit hashes, and transient task state the user can re-derive.
Create ~/.wenlan/sessions/<YYYY-MM-DD-HHmm>-<slug>.md with:
# Session <YYYY-MM-DD HH:MM> - <slug>
**Project:** <project>
**Range:** <lastHandoff> -> <now>
## Accomplished
- <item>
## Decisions
- <decision and rationale>
## Lessons & Gotchas
- <root cause / workaround>
## Open Threads
- <what remains>
## Captures stored
- <source_id or short phrase>
## Git summary
<git log --oneline output>
Use a 2-4 word kebab-case slug.
Overwrite ~/.wenlan/sessions/_status/<project>.md:
# <Project> - Current Status
## Last session (<date>)
- <accomplished bullet>
## Active
- <fresh next item> (added <YYYY-MM-DD>)
- <blocked item> (added <YYYY-MM-DD>) (gated: <trigger>)
## Backlog
- <older parked item> (added <YYYY-MM-DD>)
Active items are fresh next moves. Backlog items are parked but useful. Preserve existing added dates when carrying items forward.
Also write ~/.wenlan/sessions/_status/handoff-<project>.json:
{
"lastHandoff": "<ISO-8601 now>",
"project": "<project>",
"summary": "<one-line>"
}
~/.wenlanBest effort only:
git -C ~/.wenlan add -A && \
git -C ~/.wenlan -c user.name=Wenlan -c user.email=daemon@wenlan.local \
commit --quiet -m "session: <slug>" 2>/dev/null || \
(sleep 1 && git -C ~/.wenlan add -A && \
git -C ~/.wenlan -c user.name=Wenlan -c user.email=daemon@wenlan.local \
commit --quiet -m "session: <slug>" 2>/dev/null) || true
Do not fail the handoff if this commit fails.
Print:
Handoff stored.
Decisions: <N>
Lessons: <N>
Insights: <N>
Corrections: <N>
Facts: <N>
Session: ~/.wenlan/sessions/<filename>
Status: ~/.wenlan/sessions/_status/<project>.md
Only include non-empty labels.