AGENT SKILL

memory-mine

Mine project files or conversations into the MemPalace memory system. Indexes source code and conversation history as searchable palace drawers with semantic embeddings and room assignment.

License 许可
MIT
所属仓库
dimetron/pi-go
最近更新
2026-11-15
Stars
★ 224
Forks
34

01 前言 Front Matter

name
memory-mine
metadata
{ "author": "dimetron", "version": "1.0" }
description
Mine project files or conversations into the MemPalace memory system. Indexes source code and conversation history as searchable palace drawers with semantic embeddings and room assignment.
user_invocable
true

02 资源文件 3

03 SKILL.md 正文

When to use

Use this skill when the user wants to:

  • Index/mine project source files into the palace memory
  • Mine conversation history (JSONL, text) into the palace
  • Rebuild or refresh the palace knowledge base from disk
  • Bootstrap memory for a new project

What it does

Runs pi memory mine to walk a directory and ingest files as palace drawers:

  1. Source mining (default): Walks the directory tree, chunks source files (1500 chars, 200 overlap), assigns rooms via mempalace.yaml patterns or directory structure, generates embeddings, deduplicates (cosine >= 0.9), and stores as drawers.

  2. Conversation mining (--convos): Parses JSONL (pi-go or Claude Code format) and plaintext conversations, pairs user+assistant turns, and stores as drawers with importance=4.

Steps

  1. Check if palace.db exists (run pi memory init . if not)
  2. Check if the embedding model is downloaded (run pi memory model download if not)
  3. Run the mine command:
# Mine source files from current directory
pi memory mine .

# Mine source files with explicit wing name
pi memory mine . --wing my-project

# Mine conversation files
pi memory mine ./conversations --convos
  1. Show the results (processed, added, skipped duplicates, errors)
  2. Optionally run pi memory status to confirm the updated state

Arguments

The user can pass arguments after /memory-mine:

  • A directory path (default: . current directory)
  • --wing <name> to override the wing name
  • --convos to mine conversations instead of source files

Examples:

  • /memory-mine — mine current directory
  • /memory-mine ./src — mine the src directory
  • /memory-mine ./chats --convos — mine conversation files

Prerequisites

  • pi binary must be built and available (go build -o pi ./cmd/pi)
  • Palace DB must be initialized (pi memory init .)
  • For semantic search, embedding model must be downloaded (pi memory model download)

Notes

  • Respects .gitignore patterns
  • Skips hidden dirs, node_modules, vendor, .git, build, target
  • Skips files > 512 KB
  • Uses mempalace.yaml for room assignment if present
  • Duplicates (cosine similarity >= 0.9) are automatically skipped

04 同仓库更多 Skills

dimetron
dimetron/pi-go

verify-session-flow

Formally verify the interactive session flow before or after changing it. Use when editing internal/tui/tui.go's handleKey, handleInterruptKey, handleInputSubmit, ctrlCCount or quitting, internal/tui/agent_loop.go's enqueuePrompt, submit, steerPrompt, cancelAgent or handleAgentDone, or the deferred-init splash — or when a user reports that Ctrl+C quit on the first press, that Esc did not stop a turn or a goal loop, that a queued prompt was lost when they canceled, or that the TUI hung on a spinner nothing could clear.

★ 224
dimetron
dimetron/pi-go

verify-run-pipeline

Formally verify the /run phase machine before or after changing it. Use when editing internal/tui/run.go's phase transitions (handleRunAgentDone, runGates result handling, verifyRunComplete, retryRun, reportGateHang, merge), internal/sop/verdict.go's Passed, or the checklist refresh — or when a run merged work it should not have, retried a hung gate, lost a cycle at the retry budget, or merged on a stale PASS.

★ 224
dimetron
dimetron/pi-go

verify-history-rewrite

Formally verify the session-history rewrite path before or after changing it. Use when editing internal/session/autocompact.go, internal/session/compaction*.go, internal/session/store.go's Compact/ClearEvents/rewriteEvents, internal/agent/agent.go's Run/RunStreaming/runPreTurn, or internal/tui/commands.go's clearConversation/clearSessionContext and the context gauge — or when a turn is canceled mid-flight, a tool call and its result get separated, a session's history disappears while the agent is still working, or the model is sent a tool result whose call was compacted away.

★ 224
dimetron
dimetron/pi-go

verify-goal-loop

Formally verify the /goal automatic loop before or after changing it. Use when editing internal/tui/goal.go, internal/tui/agent_loop.go's handleAgentDone/cancelAgent/steerPrompt, or internal/tools/goal.go's GoalController — or when a goal loop will not stop, stops one cycle early, closes a goal that is not met, or restarts a goal you finished.

★ 224
dimetron
dimetron/pi-go

verify-agent-lifecycle

Formally verify the subagent lifecycle before or after changing it. Use when editing internal/subagent/orchestrator.go's Spawn, trackAgent, forwardAgentEvents, terminalStatus, Cancel, ShutdownWithTimeout or evictCompletedAgentsLocked, or internal/subagent/pool.go — or when a canceled agent is reported as failed, an agent vanishes from the list with no verdict, the orchestrator panics on a pool release, or an agent can be canceled twice.

★ 224
dimetron
dimetron/pi-go

test-new-skill

暂无简介

★ 224