skills/forgewright/skills/memory-manager/SKILL.md
Persistent project memory using JSONL (git-committed). TF-IDF search, markdown-aware chunking, value-weighted GC. Stores decisions, architecture, blockers, and task status for cross-session continuity.
npx skillsauth add ouakar/ubinarys-dental memory-managerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Purpose: Give the AI agent persistent, searchable project memory so it doesn't re-discover the same context every session. Retrieve only what's relevant, compress the rest.
| Category | Examples | Weight (GC) | |----------|----------|-------------| | decisions | "Chose PostgreSQL because..." | 10 | | architecture | "Using Next.js + Prisma + PostgreSQL" | 8 | | project | "Forgewright v7.1 — 47 skills, 19 modes" | 8 | | blockers | "Waiting on API key from vendor" | 7 | | session | "Session completed: built auth module" | 6 | | tasks | "BUILD complete: 3 services, 142 tests pass" | 5 | | conversation | Extracted facts from summarized files | 4 | | general | User-added notes | 4 | | git-activity | Recent commit summaries | 3 | | ingested | Chunked README/docs sections | 2 |
All commands use scripts/mem0-cli.py:
# Search memory — TF-IDF with cosine similarity
python3 scripts/mem0-cli.py search "authentication flow" --limit 5
# Add a memory manually
python3 scripts/mem0-cli.py add "Decided to use JWT + refresh tokens for auth" --category decisions
# Refresh project state — replaces old ingested data with current reality
python3 scripts/mem0-cli.py refresh
# Ingest files — markdown-aware chunking with section context
python3 scripts/mem0-cli.py ingest README.md VISION.md
# Ingest from recent git history
python3 scripts/mem0-cli.py ingest-git --days 7
# Summarize file — extracts structured facts (key-value, decisions, blockers)
python3 scripts/mem0-cli.py summarize path/to/conversation.md
# List all memories (with optional category filter)
python3 scripts/mem0-cli.py list --category decisions
# Delete a specific memory
python3 scripts/mem0-cli.py delete <memory_id>
# Export all memories to markdown
python3 scripts/mem0-cli.py export > project-memory.md
# Stats: memory count, file size, token estimate, categories
python3 scripts/mem0-cli.py stats
# Garbage collection — value-weighted (category × recency)
python3 scripts/mem0-cli.py gc --max-memories 200
Search uses TF-IDF (Term Frequency × Inverse Document Frequency) with cosine similarity — all Python stdlib, zero external dependencies.
Query: "authentication JWT"
→ Tokenize → Compute TF-IDF vectors → Cosine similarity against all memories
→ Return top-N ranked results
Advantages over keyword search:
MEM0_MAX_TOKENS)The CLI automatically redacts patterns matching:
sk-*, key-*, Bearer tokens)Create .memignore at project root to exclude files/folders from ingestion.
MEM0_DISABLED=true to skip all memory operations# Storage (JSONL, git-committed)
MEM0_PROJECT_ID=my-project # namespace for multi-project
# Limits
MEM0_MAX_TOKENS=500 # max tokens per retrieval
MEM0_MAX_MEMORIES=200 # max stored memories before GC
# Safety
MEM0_REDACT_SECRETS=true # auto-redact API keys, passwords
MEM0_DISABLED=false # set true to skip all ops
The orchestrator calls memory-manager at specific lifecycle points. All hooks are wired with exact CLI commands in skills/_shared/protocols/session-lifecycle.md:
| Hook | Trigger | Memory Command |
|------|---------|---------------|
| SESSION_START | Pipeline begins | search "<project> <keywords>" --limit 5 |
| PHASE_COMPLETE | After DEFINE/BUILD/HARDEN/SHIP | add "Phase [name]: [summary]" --category tasks |
| GATE_DECISION | After Gate 1/2/3 | add "Gate [N] [decision]: [feedback]" --category decisions |
| SESSION_END | Pipeline completes | add "Session completed: [summary]" --category session + refresh |
| ERROR | Task failure/escalation | add "BLOCKER: [task] failed: [details]" --category blockers |
Memory works alongside .forgewright/project-profile.json:
When the Business Analyst skill completes:
ba-package.md, requirements register) are referenced by memoryAny skill can invoke memory commands directly:
# Before starting work
python3 scripts/mem0-cli.py search "current task" --limit 3 --format compact
# After completing work
python3 scripts/mem0-cli.py add "Completed: auth module with JWT + refresh tokens" --category decisions
GC scores each entry: category_weight × recency_factor, then prunes lowest-scored:
| Category | Weight | Rationale | |----------|--------|-----------| | decisions | 10 | Most valuable — architecture choices persist | | architecture | 8 | Stack identity rarely changes | | project | 8 | Core project facts | | blockers | 7 | Active impediments need attention | | session | 6 | Recent work history | | tasks | 5 | Phase completion status | | conversation | 4 | Summarized context | | general | 4 | User notes | | git-activity | 3 | Easily re-ingested | | ingested | 2 | Easily re-ingested from source files |
Recency factor: today=1.0, 30 days ago=0.7, 90+ days ago=0.1.
forgewright/
├── skills/memory-manager/
│ └── SKILL.md ← this file
├── scripts/
│ └── mem0-cli.py ← CLI tool (TF-IDF, JSONL, zero deps)
├── .memignore ← exclusion patterns
└── .forgewright/
├── memory.jsonl ← source of truth (committed to git)
├── project-profile.json ← project fingerprint (committed)
├── code-conventions.md ← detected patterns (committed)
├── session-log.json ← session history (gitignored)
└── .gitignore ← auto-generated
development
[production-grade internal] Builds AR/VR/MR applications — spatial UI/UX, hand tracking, gaze input, controller interaction, comfort optimization, and cross-platform XR (Quest, Vision Pro, WebXR, PCVR). Routed via the production-grade orchestrator (Game Build mode).
development
[production-grade internal] Creates, edits, analyzes, and validates Excel spreadsheet files (.xlsx, .csv, .tsv). Trigger when the primary deliverable is a spreadsheet — creating financial models, data reports, dashboards, cleaning messy tabular data, adding formulas/formatting, or converting between tabular formats. Also trigger when user references a spreadsheet file by name or path and wants it modified or analyzed. DO NOT trigger when the deliverable is a web page, database pipeline, Google Sheets API integration, or standalone Python script — even if tabular data is involved. Routed via the production-grade orchestrator (Feature/Custom mode).
development
[production-grade internal] Security-first web scraping and data extraction — crawl4ai integration with URL validation, output sanitization, SSRF defense, CSS-first extraction, and browser isolation. Library-only mode (no Docker API). Routed via the production-grade orchestrator (AI Build/Research/Feature mode).
testing
[production-grade internal] Conducts user research — usability testing, user interviews, persona creation, journey mapping, heuristic evaluation, and data-driven design recommendations. Routed via the production-grade orchestrator (Design mode).