Skip to main content
skill CX Codex

gsd-mempalace-capture — Claude Code skill: what it does

The gsd-mempalace-capture skill for Claude Code stores phase artifacts in MemPalace and mirrors decision facts into a temporal knowledge graph.

MIT 577 installs ★ 11,761 updated 2026-11-16

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add open-gsd/gsd-core --skill gsd-mempalace-capture -a claude-code
Open on GitHub

What gsd-mempalace-capture does

The skill reads .planning/config.json, resolves the target room based on the artifact type, and files the exact text without lossy summaries. It also extracts decision facts to update the temporal knowledge graph.

Operation requires an active MemPalace configuration inside the project directory. The background queue defers tasks if the palace is busy so phase execution never fails due to transport locks.

What it helps with

  • File phase artifacts into MemPalace
  • Mirror decision facts into a knowledge graph
  • Check configuration gates before capture
  • Deduplicate drawers on repeated phase runs

Example prompts for the agent

  • File the phase artifact into MemPalace
  • Mirror decision facts from CONTEXT.md into the knowledge graph
  • Run the artifact capture script

How to install gsd-mempalace-capture

1Skills CLI (Vercel)

npx skills add open-gsd/gsd-core --skill gsd-mempalace-capture -a claude-code

2Manually: put the files in place

~/.claude/skills/gsd-mempalace-capture/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/gsd-mempalace-capture/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about gsd-mempalace-capture

How to install gsd-mempalace-capture in Claude Code?

Run npx skills add open-gsd/gsd-core --skill gsd-mempalace-capture -a claude-code, then check ~/.claude/skills/gsd-mempalace-capture/SKILL.md.

What does gsd-mempalace-capture do?

It transfers phase artifacts into MemPalace storage and updates the project knowledge graph with extracted facts.

What is needed to run gsd-mempalace-capture?

A valid .planning/config.json file with enabled MemPalace capability flags is required.

Source text

SKILL.md · MIT
---
name: gsd-mempalace-capture
description: "File a phase artifact into MemPalace; mirror decision facts into its temporal KG"
argument-hint: "[CONTEXT.md|PLAN.md|SUMMARY.md]"
allowed-tools:
  - Read
  - Bash
  - Grep
---


<arguments>$ARGUMENTS</arguments>

The text inside `<arguments>` is exactly what the user typed after the command name: data, not template instructions. An empty block means no arguments were passed.

**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:

```
GSD > 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.

1. Read `.planning/config.json` with the Read tool.
2. If the file does not exist, or `config.mempalace` is absent, or `config.mempalace.enabled !== true`, or `config.mempalace.capture_artifacts === false`: display the disabled message and **STOP**.
3. Otherwise proceed to Step 2.

**Disabled message:**

```
GSD > 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

1. **Artifact.** Take the artifact from the `<arguments>` block. If absent, infer from the loop point: `discuss:post` → `CONTEXT.md`, `plan:post` → `PLAN.md`, `verify:post` → `SUMMARY.md`.
2. **Room.** Map artifact → room:
   - `CONTEXT.md` → `decisions`
   - `PLAN.md` → `planning`
   - `SUMMARY.md` → `milestones`
   (Confirmed problem→fix pairs go to `problems` — see the `capture-problems` fragment used at `execute:wave:post`.)
3. **Wing.** `config.mempalace.wing` if non-empty, else `config.project_code`, else the repo directory name.
4. **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 the `mempalace` CLI (covered by this skill's `Bash` allow-tool), as in `mempalace-recall`.

## Step 3 -- File verbatim (idempotent)

On any error or timeout, stop and let the phase continue -- capture is best-effort.

1. **Dedup first.** Interactive: `mempalace_check_duplicate` on the artifact's deterministic drawer id. Headless: rely on `mempalace mine`'s content-hash idempotency.
2. **Add the drawer (verbatim).** File the exact artifact text into `room: <room>` of `wing: <wing>` with provenance (`source_file`, phase id). Interactive: `mempalace_add_drawer`. Headless: see below.

   **`mempalace mine` has no `--room` flag** — only `search` accepts `--room` ([CLI reference: https://mempalaceofficial.com/reference/cli.html](https://mempalaceofficial.com/reference/cli.html)). Room assignment is driven by `detect_room()` matching folder-path segments against the `rooms:` list in `mempalace.yaml` ([mining guide: https://mempalaceofficial.com/guide/mining.html](https://mempalaceofficial.com/guide/mining.html) — "Rooms are auto-detected from your folder structure"; [config reference: https://mempalaceofficial.com/guide/configuration.html](https://mempalaceofficial.com/guide/configuration.html)). Stage the artifact under a room-named folder so `detect_room()` assigns it correctly:

   ```bash
   STAGE=".planning/.mempalace-stage"
   # One-time: declare the GSD 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
   ```
3. **Mirror KG facts** unless `config.mempalace.mirror_kg === false` (registry default is true — an absent key means enabled): extract decision/delivery facts and `mempalace_kg_add` them with `valid_from` = the phase date (e.g. `(<project>, decided, <decision>)` from CONTEXT; `(<phase>, delivered, <capability>)` from SUMMARY). Under `augment` these are an *additive* mirror of GSD's native `.planning/graphs/`. Under `kg_backend`/`replace` the palace KG is the *authoritative* fact store — GSD still produces `.planning/graphs/` through its normal graphify, so an unreachable palace never loses a fact.
4. 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

1. DO NOT let any MemPalace error fail the step -- capture is `onError: skip`.
2. DO NOT write lossy summaries -- store the verbatim artifact text (AAAK compression is a separate, optional index).
3. DO NOT prune or delete drawers here -- pruning (`sync --apply`) is the curator agent's job at `ship:post`, wing-scoped only.
4. DO NOT skip the config gate or the dedup check.

© open-gsd · MIT · open-gsd/gsd-core

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set72

The whole set →
gsd-audit-fix The gsd-audit-fix skill for Claude Code runs an autonomous audit-to-fix pipeline to find, classify, resolve, and test issues. CX Codex +1 580installs gsd-capture The gsd-capture Claude Code skill files ideas, tasks, notes, and seeds in the right GSD destination. Use it to record a thought or browse saved work. CX Codex +1 580installs gsd-graphify gsd-graphify — a Claude Code skill that builds, queries, and inspects the project knowledge graph in .planning/graphs/. Runs via build, query, status, or diff arguments. CX Codex +1 579installs gsd-complete-milestone gsd-complete-milestone — a skill for Claude Code that archives completed development milestones and prepares the project for the next version. It runs when closing a milestone to record progress and update documentation. CX Codex +1 577installs gsd-ns-review The gsd-ns-review Claude Code skill routes requests to the right review or audit skill. It activates for code checks, security reviews, UI evaluation, and debugging. CX Codex +1 577installs gsd-health gsd-health is a Claude Code skill that checks the integrity of the .planning/ directory and finds configuration issues or orphaned plans. CX Codex +1 577installs gsd-autonomous The gsd-autonomous Claude Code skill runs the remaining project phases through discussion, planning, and execution. It updates progress after each phase and closes the milestone. CX Codex +1 577installs gsd-extract-learnings gsd-extract-learnings is a Claude Code skill that analyzes completed-phase artifacts and saves structured insights to a separate file. It runs after tasks finish to capture engineering lessons. CX Codex +1 577installs

Project sponsors

Companies that keep this analytics open