From rafayels-engineering
Persistent cross-session case-based memory for rafayels-engineering. Records successful patterns, failed attempts, user corrections, and review outcomes as cases in a local sqlite-vec database. Inject relevant past cases into workflows at runtime. Use when the user asks to remember something, recall prior context, review the case bank, or runs workflows that benefit from learned patterns.
npx claudepluginhub rafayelgardishyan/rafayels-engineeringThis skill is limited to using the following tools:
Persistent cross-session memory for rafayels-engineering, implemented as
references/case-format.mdreferences/injection-guide.mdreferences/schema.mdreferences/signals.mdscripts/audit.pyscripts/capture.pyscripts/db.pyscripts/embed_daemon.pyscripts/embedder.pyscripts/memory.pyscripts/migrations/001_initial.sqlscripts/requirements-dev.txtscripts/requirements.txtscripts/retrieve.pyscripts/tests/__init__.pyscripts/tests/conftest.pyscripts/tests/test_audit.pyscripts/tests/test_capture.pyscripts/tests/test_concurrency.pyscripts/tests/test_db.pySearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Reviews Flutter/Dart code with library-agnostic checklist for widget best practices, state management patterns, Dart idioms, performance, accessibility, security, and clean architecture.
Persistent cross-session memory for rafayels-engineering, implemented as Case-Based Reasoning (CBR) with local vector retrieval. Inspired by Memento — agents stay frozen, improvement comes through retrieval of past cases, not by editing prompts.
# One-time setup
python3 ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/memory.py init
# Verify everything works
python3 ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/memory.py doctor
# Write a case
python3 ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/memory.py write \
--phase plan \
--query "How to structure marketplace sync" \
--plan "Use rsync -a --delete for mirroring" \
--outcome "Clean one-way sync, idempotent" \
--tags '["marketplace","sync"]'
# Retrieve relevant past cases for a phase
python3 ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/memory.py query \
"setting up marketplace sync" --phase plan --k 3
# Add a signal (success, failure, review outcome, etc.)
python3 ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/memory.py signal \
42 merge 1.0 --source "pr:#123"
This skill is model-invocable. It should auto-activate when:
/workflows:brainstorm, /workflows:plan, /workflows:work,
/workflows:review, /workflows:compound — these have explicit retrieve
and capture hooks/re:memory-review for audit┌─────────────────────────────────┐
│ memory CLI (one-shot) │
│ 18 subcommands, --json on all │
└─────────────────────────────────┘
│
├─(vector ops)─> embedder.py ─> embed_daemon.py (Unix socket)
│ fallback: in-process fastembed
│
└─(storage)──> db.py ─> sqlite-vec @ ~/.claude/plugins/
rafayels-engineering/memory.db
memory-proposer skill with human review required.reward * exp(-age_days/60) at retrieval time.| Command | Description |
|---|---|
memory init | Create DB and schema |
memory write --phase P --query Q ... | Write a new case (starts quarantined) |
memory seed --source docs/solutions/ | Bootstrap from existing solution docs |
memory import FILE | Import cases from JSONL export |
| Command | Description |
|---|---|
memory query "text" --phase P --k 3 | Semantic retrieve with MMR |
memory read <case_id> | Fetch a single case by ID |
memory list [--phase] [--status] [--limit] | Filter cases by metadata |
memory report --stats | Aggregate statistics |
memory report --stale --older-than 90 | Find prune candidates |
memory doctor | Self-diagnose readiness |
memory export [--output FILE] | Export all cases + signals as JSONL |
| Command | Description |
|---|---|
memory signal <id> <type> <value> | Append a signal (types: merge, ci, approval, review, regression) |
memory update <id> [--title] [--tags] [--outcome] | Update case metadata |
memory promote <id> | Pin a case as promoted (never auto-archived) |
memory link <id_a> <id_b> | Mark two cases as related |
| Command | Description |
|---|---|
memory prune [--reward-below 0.3] [--older-than 90] [--confirm] | Archive low-value cases (dry-run by default) |
memory delete <id> --confirm-token <token> | Hard-delete a case (requires two-step confirmation) |
memory daemon-stop | Stop the embedder daemon |
All commands accept --json for machine-readable output.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Not found |
| 2 | Validation error |
| 3 | Storage error |
| 75 | Memory unavailable (EX_TEMPFAIL — dependencies missing, workflows should tolerate) |
pip install -r ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/requirements.txt
python3 ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/memory.py init
python3 ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/memory.py doctor
First invocation downloads the BGE-small model (~67MB) into
~/.cache/rafayels-memory/fastembed/. Subsequent runs use the cached model.
memory-proposer skill — Pattern detection and auto-PR generation/re:memory-review command — Interactive audit workflowcompound-docs skill — Documents solved problems (paired with memory seed)AttributeError: 'sqlite3.Connection' object has no attribute 'enable_load_extension'Cause: macOS system Python and pyenv-installed Python are built without the loadable SQLite extension API. sqlite-vec cannot load into these interpreters.
Fix: Use Homebrew Python 3.12 which ships with --enable-loadable-sqlite-extensions:
brew install python@3.12
/opt/homebrew/bin/python3.12 -m pip install --break-system-packages \
-r ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/requirements.txt
Then invoke memory.py with Homebrew Python explicitly:
/opt/homebrew/bin/python3.12 ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/memory.py <subcommand>
Alternative: rebuild pyenv Python with extension support:
PYTHON_CONFIGURE_OPTS="--enable-loadable-sqlite-extensions" pyenv install 3.12.12
This is a macOS-specific platform limitation, not a memory layer bug. Linux distros typically ship Python with extension support enabled.
The memory layer requires Python 3.10–3.12. Python 3.13+ is not currently supported because fastembed==0.4.2 doesn't publish wheels for those versions. Pin yourself to 3.12 for now.
The --json flag is a top-level argparse option, so it must come before the subcommand:
# ✅ Correct
memory --json write --phase plan --query "..."
# ❌ Fails with "unrecognized arguments: --json"
memory write --phase plan --query "..." --json
memory doctor reports unavailableInstall dependencies:
pip install -r ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/requirements.txt
Workflows skip memory injection silently
Check memory doctor --json. If status is degraded or unavailable, the
workflows are correctly degrading. Install missing deps to re-enable.
Queries return empty results
The cold-start threshold requires k*3 active cases per phase. Write more
cases (via normal workflow use) or run memory seed to bootstrap.
Daemon won't start
python3 ${CLAUDE_PLUGIN_ROOT}/skills/memory/scripts/memory.py daemon-stop
# Delete stale PID file if needed
rm -f /tmp/rafayels-memory-$(id -u)/embed.pid
# Next query will auto-spawn a fresh daemon
Cross-project learning not working
The DB is user-scope at ~/.claude/plugins/rafayels-engineering/memory.db —
shared across all projects. Verify the path with memory doctor --json.