Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
6.3 KiB
name, description, argument-hint, allowed-tools, requires
| name | description | argument-hint | allowed-tools | requires | ||||
|---|---|---|---|---|---|---|---|---|
| msd:mempalace-capture | File a phase artifact into MemPalace; mirror decision facts into its temporal KG | [CONTEXT.md|PLAN.md|SUMMARY.md] |
|
|
STOP -- DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by the command system. Using the Read tool on this file wastes tokens. Begin executing Step 0 immediately.
Step 0 -- Banner
Before ANY tool calls, display this banner:
MSD > MEMPALACE CAPTURE
Then proceed to Step 1.
Step 1 -- Config Gate
Check whether the MemPalace capability is enabled by reading .planning/config.json directly with the Read tool.
- Read
.planning/config.jsonwith the Read tool. - If the file does not exist, or
config.mempalaceis absent, orconfig.mempalace.enabled !== true, orconfig.mempalace.capture_artifacts === false: display the disabled message and STOP. - Otherwise proceed to Step 2.
Disabled message:
MSD > MEMPALACE CAPTURE
MemPalace capture is disabled (mempalace.enabled / mempalace.capture_artifacts).
Nothing was filed; the loop proceeds normally.
This step is onError: skip at discuss:post / plan:post / verify:post -- capture never fails a phase.
Step 2 -- Resolve target
- Artifact. Take the artifact from
$ARGUMENTS. If absent, infer from the loop point:discuss:post→CONTEXT.md,plan:post→PLAN.md,verify:post→SUMMARY.md. - Room. Map artifact → room:
CONTEXT.md→decisionsPLAN.md→planningSUMMARY.md→milestones(Confirmed problem→fix pairs go toproblems— see thecapture-problemsfragment used atexecute:wave:post.)
- Wing.
config.mempalace.wingif non-empty, elseconfig.project_code, else the repo directory name. - Mode / transport. Read
config.mempalace.memory_mode. Prefer MCP (mempalace_*) when your MemPalace MCP server is registered and your runtime permits those tools; otherwise use themempalaceCLI (covered by this skill'sBashallow-tool), as inmempalace-recall.
Step 3 -- File verbatim (idempotent)
On any error or timeout, stop and let the phase continue -- capture is best-effort.
-
Dedup first. Interactive:
mempalace_check_duplicateon the artifact's deterministic drawer id. Headless: rely onmempalace mine's content-hash idempotency. -
Add the drawer (verbatim). File the exact artifact text into
room: <room>ofwing: <wing>with provenance (source_file, phase id). Interactive:mempalace_add_drawer. Headless: see below.mempalace minehas no--roomflag — onlysearchaccepts--room(CLI reference: https://mempalaceofficial.com/reference/cli.html). Room assignment is driven bydetect_room()matching folder-path segments against therooms:list inmempalace.yaml(mining guide: https://mempalaceofficial.com/guide/mining.html — "Rooms are auto-detected from your folder structure"; config reference: https://mempalaceofficial.com/guide/configuration.html). Stage the artifact under a room-named folder sodetect_room()assigns it correctly:STAGE=".planning/.mempalace-stage" # One-time: declare the MSD room taxonomy so detect_room() recognizes these folders mkdir -p "$STAGE" [ -f "$STAGE/mempalace.yaml" ] || cat > "$STAGE/mempalace.yaml" <<'YAML' # Each entry MUST be a dict with a `name` key (the miner's detect_room() # indexes room["name"] — a bare-string list crashes _mine_impl with # TypeError: string indices must be integers, not 'str'). Optional fields: # `description`, `keywords` (matched against folder-path segments). rooms: - name: decisions - name: planning - name: milestones - name: problems - name: general YAML # Suppress MemPalace cache artifacts written into the scanned tree [ -f "$STAGE/.gitignore" ] || echo "mempalace_embedder.json" > "$STAGE/.gitignore" # Stage under <room>/<phase-id>/<basename> — stable path so mine's content-hash # idempotency (file_already_mined keys on absolute source_file + mtime) deduplicates # instead of creating duplicate drawers on re-runs. ROOM_DIR="$STAGE/<room>/<phase-id>" mkdir -p "$ROOM_DIR" cp "<artifact-path>" "$ROOM_DIR/<basename>" # Mine with --wing only — no --room flag; detect_room() assigns from the folder path. # --daemon --background (#4700): MemPalace wraps every mine in a per-palace # lock; a concurrent writer would make a foreground mine exit 1 # (MineAlreadyRunning) and this onError: skip step would silently drop the # capture. The background queue defers the job until the lock frees. mempalace mine "$STAGE" --wing <wing> --daemon --background -
Mirror KG facts unless
config.mempalace.mirror_kg === false(registry default is true — an absent key means enabled): extract decision/delivery facts andmempalace_kg_addthem withvalid_from= the phase date (e.g.(<project>, decided, <decision>)from CONTEXT;(<phase>, delivered, <capability>)from SUMMARY). Underaugmentthese are an additive mirror of MSD's native.planning/graphs/. Underkg_backend/replacethe palace KG is the authoritative fact store — MSD still produces.planning/graphs/through its normal graphify, so an unreachable palace never loses a fact. -
Re-running a phase MUST NOT create duplicate drawers (deterministic ids +
check_duplicate).
Step 4 -- Report
Print a one-line summary: Filed <artifact> → <wing>/<room> (<n> KG facts), Capture queued — palace busy; MemPalace will file it when the lock frees (the background mine was deferred behind another writer), or MemPalace capture skipped — <reason> (#4700: a skipped capture is never silent).
Anti-Patterns
- DO NOT let any MemPalace error fail the step -- capture is
onError: skip. - DO NOT write lossy summaries -- store the verbatim artifact text (AAAK compression is a separate, optional index).
- DO NOT prune or delete drawers here -- pruning (
sync --apply) is the curator agent's job atship:post, wing-scoped only. - DO NOT skip the config gate or the dedup check.