一键导入
wrap-up
Wrap up an OpenCode memhub session; run the binary-rendered policy, draft updates, get per-item approval, write, and render.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Wrap up an OpenCode memhub session; run the binary-rendered policy, draft updates, get per-item approval, write, and render.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Read-only health check of the memhub project in this repo — schema version, render freshness, write-log activity
Bootstrap memhub in this repo — initialize the SQLite store, seed starter state and architecture narratives, render PROJECT.md and PROJECT_LEDGER.md
Initialize memhub for a repo in OpenCode; use when the user asks to bootstrap project memory.
Summarize this memhub session, route updates into the database, then re-render PROJECT.md and PROJECT_LEDGER.md
Rebuild + install memhub and bring every memhub instance on this machine (each known repo DB + the machine-global store) to head schema, resync installed agent skill wrappers, with a one-time fix for the ~/.local/bin PATH shadow. Run from the memhub source repo.
Run memhub's read-only CLAUDE.md/AGENTS.md drift-and-bloat audit (`memhub audit md`) and interpret the findings — size, generated-file drift, managed-block version, keystone phrases, opt-in user-global size — recommending concrete fixes without rewriting anything itself. Trigger on: "audit CLAUDE.md", "check for CLAUDE.md drift", "is CLAUDE.md bloated", "run the md audit", "/audit-md".
基于 SOC 职业分类
| name | wrap-up |
| description | Wrap up an OpenCode memhub session; run the binary-rendered policy, draft updates, get per-item approval, write, and render. |
| compatibility | opencode |
Summarize the session, propose durable memory updates, and render after approved writes. Memhub's SQLite database is the source of truth; the rendered markdown files are local output of memhub render, not a parallel narrative — do not invent project history.
This is a thin executor (Q10, issue #99): the full policy — detection, read window, draft assembly, approval gate — is rendered from one canonical source in the binary by memhub wrapup-policy, not duplicated here.
Workflow:
.memhub/ exists and memhub is on PATH (as /check-init does); stop and say so if either is missing. Schema currency is checked by the policy text itself, not here.memhub wrapup-policy --json (CLI only, no MCP equivalent) and parse the wrapped {"wrapup_policy": {"verbosity": ..., "instructions": "..."}} object. Follow instructions for detection, the read window, the draft-assembly items for this repo's configured level, and the approval-gate rule — it supersedes anything remembered from a previous session or a different repo.--summary paraphrase alongside any decision (decision 72 — lifted Recall@3 on jargon-titled decisions 76.5%→100% on memhub's own golden set; facts have no --summary field, don't add one there); a build/test/run/lint command actually executed this session with an observed exit code is a verified command, not a fact (Q11 — go-forward only, do not backfill existing command-shaped facts); a durable spec/design doc authored or materially revised this session is a docs candidate; and — only when the user explicitly frames an item as machine-wide during approval — a fact or decision can be staged for the global store instead of written repo-scoped (never infer this yourself; one bad global write pollutes every repo). These four refinements only apply where the policy actually drafts decisions/facts at all — at minimal it drafts neither (state + task closures only), so none apply there.memhub state set "<body>" --json --actor opencode:wrap-up if changed; (2) memhub review accept <id> --json --actor opencode:wrap-up / memhub review reject <id> --reason "<reason>" --json --actor opencode:wrap-up for pending-write triage, including any global proposal from step 3 once confirmed; (3) repo-scoped decisions via memhub decision add "<title>" --rationale "<rationale>" --summary "<summary>" --source user+agent:opencode --json --actor opencode:wrap-up; (4) tasks via memhub.task_add / memhub.task_done (MCP; CLI fallback memhub task add "<title>" --notes "<notes>" --json --actor opencode:wrap-up / memhub task done <id> --json --actor opencode:wrap-up); (5) repo-scoped facts via memhub fact add "<key>" "<value>" [--kind gotcha|env|preference|command|constraint] --source user+agent:opencode --json --actor opencode:wrap-up; (6) verified commands via memhub.record_command (MCP; CLI fallback memhub command verify <build|test|run|lint|other> "<cmdline>" --exit-code <n>, no --json/--actor on that one); (7) new/revised docs via memhub.doc_add (MCP; CLI fallback memhub doc add "<path>" [--title "<title>"] --json --actor opencode:wrap-up); (8) the session summary via memhub.log_session_note (MCP; CLI fallback memhub note add "<summary>" --json --actor opencode:wrap-up), always unless the user rejected it, length following the resolved verbosity level; (9) architecture via memhub arch set "<body>" --json --actor opencode:wrap-up, only if approved this session; (10) stale-fact re-verifications, one memhub fact verify <id> --json --actor opencode:wrap-up per approved fact, never a bulk pass. For multi-line state/arch bodies use --from-file <path> instead of inlining.--global directly (same rule as /global). Stage with memhub.propose_fact(key=..., value=..., rationale=..., kind=..., global=true) / memhub.propose_decision(title=..., rationale=..., global=true), then accept via step 2 above once confirmed, and only while this repo still has memhub global enabled. propose_decision has no --summary field yet — backfill an approved one after acceptance with memhub decision set-summary <id> "<summary>" --json --actor opencode:wrap-up. Docs have no agent-mediated global path at all (no global on doc_add); tell the user to run memhub doc add <path> --global (or /global) themselves instead.memhub render --actor opencode:wrap-up (or memhub.render over MCP, where client identity supplies attribution). If render fails, stop before sync. When all approved DB writes already succeeded, resume at render after fixing the cause; do not repeat draft assembly or durable writes. If sync is enabled, memhub.sync_check then memhub.sync_snapshot + memhub.sync_commit (MCP; CLI fallback memhub sync check|snapshot|commit) unless the verdict is drive-ahead/diverged, in which case stop and /catch-up first instead of pushing.git commit — that is the user's call, regardless of verbosity level. End with what was recorded, what was skipped, and any pending review items (including newly staged global proposals).