AgentSkillsCN

simple-memory

用于在不同会话间存储与检索用户偏好、发现内容及上下文的持久化内存系统。当用户请求管理记忆或在会话启动时使用。

SKILL.md
--- frontmatter
name: simple-memory
description: Persistent memory system for storing and retrieving user preferences, discoveries, and context across sessions. Use when user asks to manage memories or at session start.
version: 1.0.0
user-invocable: true
disable-model-invocation: false
model: haiku
allowed-tools:
  - Bash
argument-hint: "[list|search <keyword>|latest|retrieve]"

Simple Memory Skill

Persistent memory system for storing and retrieving user preferences, discoveries, and context across sessions.

Dependencies

This skill requires:

  • curl - for NTFY API requests
  • jq - for JSON parsing
  • bash 4.0+ - for script execution

Trigger

Use when user explicitly asks to manage memories: "show my memories", "search memories", "what do you remember", "/memory"

Commands

List all memories

bash
~/.claude/skills/simple-memory/scripts/memory.sh list

Search memories

bash
~/.claude/skills/simple-memory/scripts/memory.sh search "<keyword>"

Get recent memories

bash
~/.claude/skills/simple-memory/scripts/memory.sh latest

Retrieve with filters

bash
# By category
~/.claude/skills/simple-memory/scripts/memory.sh retrieve --tags user-preference

# By project
~/.claude/skills/simple-memory/scripts/memory.sh retrieve --project my-app

# By branch (feature-specific learnings)
~/.claude/skills/simple-memory/scripts/memory.sh retrieve --branch feature/auth

# By context type
~/.claude/skills/simple-memory/scripts/memory.sh retrieve --context bug-fix

# By tech stack
~/.claude/skills/simple-memory/scripts/memory.sh retrieve --stack python,fastapi

# Combined filters
~/.claude/skills/simple-memory/scripts/memory.sh retrieve --project my-app --branch feature/auth --context bug-fix

Search by project

bash
~/.claude/skills/simple-memory/scripts/memory.sh search "pytest" my-app

Store manually (rarely needed - auto-store handles most cases)

bash
~/.claude/skills/simple-memory/scripts/memory.sh store <category> "<content>" [options]

Options:

  • --title <summary> (quick description, auto-generated from content if not provided)
  • --source (user-said|learned|inferred)
  • --confidence (verified|assumption)
  • --priority (1-5, default: 3)
  • --project <name> (auto-detected from git repo/directory)
  • --branch <name> (auto-detected from git)
  • --context (bug-fix|feature|refactor|deployment|config|debug)
  • --stack <langs> (e.g., "python,fastapi,postgres")
  • --custom-tags <tags> (e.g., "oauth,jwt,security")

Categories: user-preference, user-alignment, tech, project, solution

Examples:

bash
# Simple store with auto-detection (title auto-generated)
store user-preference "I prefer dark mode"

# Store with custom title for quick identification
store tech "FastAPI requires explicit CORS headers for public routes" \
  --title "FastAPI: CORS headers required" \
  --context bug-fix --stack python,fastapi

# Store with custom tags
store solution "JWT refresh token pattern works well" \
  --title "Auth: JWT refresh pattern" \
  --custom-tags "auth,jwt,security" --priority 4

Configuration

Edit ~/.claude/skills/simple-memory/memory.conf:

bash
MEMORY_ENDPOINT=https://your-ntfy-endpoint/topic_name
NTFY_AUTH_TOKEN=your_token_here  # Optional

Additional Resources