musememory 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musememory",
3
- "version": "1.6.1",
3
+ "version": "1.7.1",
4
4
  "description": "Autonomous, self-organizing cognitive memory system for AI agents and agency networks",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -10,6 +10,8 @@
10
10
  },
11
11
  "files": [
12
12
  "dist",
13
+ "skills",
14
+ ".agents",
13
15
  "schema.json",
14
16
  "README.md",
15
17
  "LICENSE",
@@ -21,7 +23,6 @@
21
23
  "typecheck": "tsc --noEmit",
22
24
  "validate": "bun run dist/index.js validate --dry-run",
23
25
  "start": "bun run dist/index.js mcp",
24
- "postinstall": "node scripts/postinstall.js || true",
25
26
  "prepublishOnly": "bun run build && bun test"
26
27
  },
27
28
  "keywords": [
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: muse-brief
3
+ description: Proactive daily briefing and knowledge hygiene governor. Scans decaying knowledge, audits policy staleness, tracks overdue due_at deadlines, and surfaces unresolved open loops with zero resident daemons.
4
+ ---
5
+
6
+ # ⏰ Muse Brief (`muse-brief`)
7
+
8
+ > **When to use**: Execute at the start of a workday, during daily standup/planning, or when performing knowledge hygiene and backlog triage.
9
+
10
+ ---
11
+
12
+ ## 🚀 Execution Workflow
13
+
14
+ ### Step 1: Generate Actionable Daily Briefing
15
+ Run `memory briefing` (or execute via `memory routine run daily-briefing`):
16
+
17
+ ```bash
18
+ memory briefing --limit 10
19
+ ```
20
+
21
+ The briefing renders a clean Markdown summary containing:
22
+ 1. **Fresh Insights**: Recently confirmed architectural decisions and bug fixes.
23
+ 2. **Upcoming & Overdue Items**: Entries with `due_at` timestamps requiring attention.
24
+ 3. **Active Constraints**: Current rules in `.memory/CURRENT.md`.
25
+ 4. **Open Loops**: Extracted tasks and unresolved commitments from recent agent sessions.
26
+
27
+ ### Step 2: Run Staleness & Attention Audits
28
+ Run `memory nudge` to inspect decaying knowledge:
29
+ - **Policy Decay Check**: Flags fixes older than 90 days or operational rules older than 180 days.
30
+ - **Action**: Prompt the user or agent to re-verify, mark stale (`memory mark-stale <id>`), or supersede with updated patterns.
31
+
32
+ ### Step 3: Run Routine Automation (Zero Daemon)
33
+ Declare routine workflows in `.memory/routines.yaml`:
34
+
35
+ ```yaml
36
+ routines:
37
+ - name: daily-hygiene
38
+ schedule: "0 9 * * 1-5"
39
+ commands:
40
+ - "memory nudge"
41
+ - "memory briefing"
42
+ - "memory wiki compile"
43
+ ```
44
+
45
+ Install the crontab line via `memory routine install daily-hygiene` to run via system cron without any persistent background Node daemon.
46
+
47
+ ---
48
+
49
+ ## 🛡️ Invariant Rules for Agents
50
+
51
+ - **Deterministic & Zero-Daemon**: Never launch a long-running background daemon process; execute on-demand or via cron.
52
+ - **Actionable Output**: Highlight only actionable staleness warnings and open loops rather than dumping entire databases.
53
+
54
+ ---
55
+
56
+ ## 💻 CLI Equivalents (Zero-MCP Fallback)
57
+
58
+ ```bash
59
+ # Generate daily briefing
60
+ memory briefing
61
+
62
+ # Surface overdue items and decaying knowledge
63
+ memory nudge
64
+
65
+ # Execute declared routine
66
+ memory routine run daily-hygiene
67
+ ```
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: muse-capture
3
+ description: Autonomous post-fix and architectural decision distillation. Captures atomic, verified knowledge units with inline Vibeguard secret defense and supersedes outdated patterns.
4
+ ---
5
+
6
+ # 🧠 Muse Capture (`muse-capture`)
7
+
8
+ > **When to use**: Execute immediately after fixing a non-trivial bug, establishing an architectural pattern, learning an operational rule, or making a system decision.
9
+
10
+ ---
11
+
12
+ ## 🚀 Execution Workflow
13
+
14
+ ### Step 1: Verify Evidence Before Capturing
15
+ Ensure the fix or decision has been verified with real build outputs, test runs, or command logs:
16
+ - **Evidence Directive**: Do not propose speculative or unverified fixes.
17
+ - **Verification Level**: Tag with `observed`, `reproducible`, `user-confirmed`, or `independently-verified`.
18
+
19
+ ### Step 2: Propose Atomic Memory Unit
20
+ Call the `memory_capture` MCP tool:
21
+
22
+ ```json
23
+ {
24
+ "title": "Fix SQLite Connection Pool Exhaustion under Bun Microtasks",
25
+ "content": "SQLite WAL mode with busy_timeout=5000ms prevents disk lock errors during concurrent microtask flushes. Use PRAGMA busy_timeout = 5000 in openDatabase.",
26
+ "project": "my-project",
27
+ "type": "fix",
28
+ "tags": ["sqlite", "bun", "concurrency"],
29
+ "salience": 0.9,
30
+ "verification": {
31
+ "level": "independently-verified",
32
+ "test_command": "bun test test/sqlite_concurrency.test.ts"
33
+ }
34
+ }
35
+ ```
36
+
37
+ ### Step 3: Handle Knowledge Supersession (When Deprecating Old Knowledge)
38
+ If the new fix or architecture replaces an outdated pattern:
39
+ 1. Identify the existing memory ID (e.g. `m_1700000001000_old_pool`).
40
+ 2. Call `memory_supersede` to atomically update bidirectional links:
41
+
42
+ ```json
43
+ {
44
+ "old_id": "m_1700000001000_old_pool",
45
+ "new_id": "m_1700000002000_new_pool"
46
+ }
47
+ ```
48
+
49
+ ---
50
+
51
+ ## 🛡️ Vibeguard Zero-Leakage Protocol
52
+
53
+ - **Automatic Interception**: `memory_capture` automatically scans all proposed fields (title, content, tags, verification commands).
54
+ - **Hard Rejection**: Any presence of AI API keys (`sk-*`), GitHub tokens (`ghp_*`), AWS keys (`AKIA*`), private keys, or passwords will immediately throw an error.
55
+ - **Sanitization Directive**: Always redact secrets to `[REDACTED_SECRET]` before proposing.
56
+
57
+ ---
58
+
59
+ ## 💻 CLI Equivalents (Zero-MCP Fallback)
60
+
61
+ ```bash
62
+ # Propose a new candidate memory
63
+ memory capture "Fix details" --title "Title" --project my-project --type fix
64
+
65
+ # Confirm a candidate memory
66
+ memory confirm <id>
67
+
68
+ # Supersede an old memory with a confirmed replacement
69
+ memory supersede <old_id> --with <new_id>
70
+ ```
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: muse-current
3
+ description: Active working constraints and interruption-proof session handoff manager. Synchronizes hard invariants, open loops, and in-flight checkpoints directly into CURRENT.md.
4
+ ---
5
+
6
+ # 📐 Muse Current (`muse-current`)
7
+
8
+ > **When to use**: Execute when the user establishes a hard project invariant, when starting a multi-step task, or before context compaction/task switching to record in-flight handoffs.
9
+
10
+ ---
11
+
12
+ ## 🚀 Execution Workflow
13
+
14
+ ### Step 1: Record Hard Constraints
15
+ When a non-negotiable rule or invariant is declared:
16
+ Call `memory_current` or `memory_capture(type="constraint")`:
17
+
18
+ ```json
19
+ {
20
+ "action": "append",
21
+ "text": "- Invariant: Never allow cross-origin POST mutations without Origin header check (CSRF defense)."
22
+ }
23
+ ```
24
+
25
+ This immediately updates `.memory/CURRENT.md` and dual-persists a constraint memory in SQLite.
26
+
27
+ ### Step 2: Record Interruption-Proof Session Handoffs
28
+ When completing a subtask, hitting context limits, or preparing for the next agent:
29
+ Append a structured handoff block to `CURRENT.md`:
30
+
31
+ ```markdown
32
+ ## Active Handoff & Session Checkpoint
33
+ - **Goal**: Migrate SQLite WAL connection pool to asynchronous microtask flushes.
34
+ - **Completed**:
35
+ - Implemented async query worker in `src/sqlite/worker.ts`.
36
+ - Added unit test suite `test/sqlite_worker.test.ts`.
37
+ - **In-Flight / Next Steps**:
38
+ - Wire worker into `src/store.ts` save transaction.
39
+ - Run full suite: `bun test`.
40
+ ```
41
+
42
+ ### Step 3: Clear Resolved Invariants
43
+ When a temporary constraint or migration phase is complete, update `CURRENT.md` to prune obsolete rules so future context windows stay lightweight.
44
+
45
+ ---
46
+
47
+ ## 🛡️ Invariant Rules for Agents
48
+
49
+ - **High Locality**: `CURRENT.md` must contain only active, high-priority invariants and current handoffs—not historical archives.
50
+ - **Zero Hallucination**: Do not contradict constraints recorded in `CURRENT.md`.
51
+
52
+ ---
53
+
54
+ ## 💻 CLI Equivalents (Zero-MCP Fallback)
55
+
56
+ ```bash
57
+ # Read active working constraints
58
+ memory current get
59
+
60
+ # Append a new active constraint
61
+ memory current set "- Hard constraint description" --project my-project
62
+ ```
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: muse-graph
3
+ description: AST code-aware symbol graph investigation and indexing. Integrates CodeGraph and Graphify to map codebase identifiers, auto-tag memories, and rank symbol-matching decisions with graph overlap bonuses.
4
+ ---
5
+
6
+ # 🌐 Muse Graph (`muse-graph`)
7
+
8
+ > **When to use**: Execute during deep codebase investigation, refactoring critical classes/modules, or diagnosing complex bugs where symbol-level architectural context is required.
9
+
10
+ ---
11
+
12
+ ## 🚀 Execution Workflow
13
+
14
+ ### Step 1: Check & Index AST Symbol Graph
15
+ Verify provider status or build the cached AST symbol map:
16
+ - Call `graph_status` MCP tool to check provider availability (`.codegraph` or `.graphify`).
17
+ - Call `graph_index` MCP tool (or run `memory graph index`) to compile a fresh symbol map in `.memory/graph-symbols.json`.
18
+
19
+ ```json
20
+ {}
21
+ ```
22
+
23
+ ### Step 2: Code-Aware Retrieval Queries
24
+ When querying memories for a specific function, class, or type, include the exact identifier name in your query:
25
+
26
+ ```json
27
+ {
28
+ "query": "queryContext knapsack token scoring formula in retrieval.ts",
29
+ "project": "my-project",
30
+ "token_budget": 1500
31
+ }
32
+ ```
33
+
34
+ ### Step 3: Multi-Factor AST Overlap Scoring Bonus
35
+ The retrieval engine matches query tokens against indexed symbols (`entry.graph.symbol_names`), awarding up to **+0.2 graph bonus**:
36
+
37
+ $$\text{Score} = 1.0 \times \text{Applicability} + \text{StatusBonus} + \text{VerificationBonus} + \mathbf{GraphBonus (+0.2)} + \text{TimeDecay}$$
38
+
39
+ Symbol-matching architectural decisions and past fixes rank above generic prose matching.
40
+
41
+ ---
42
+
43
+ ## 🛡️ Invariant Rules for Agents
44
+
45
+ - **Opt-In & Non-Blocking**: If no AST graph provider is installed, memory queries and captures fall back gracefully with zero behavioral disruption.
46
+ - **Affected Paths**: Inspect `entry.graph.affected_paths` to discover related files that may be impacted by a refactor.
47
+
48
+ ---
49
+
50
+ ## 💻 CLI Equivalents (Zero-MCP Fallback)
51
+
52
+ ```bash
53
+ # Check provider status (provider type, availability, revision, symbol count)
54
+ memory graph status
55
+
56
+ # Index codebase AST symbols and cache to .memory/graph-symbols.json
57
+ memory graph index
58
+
59
+ # Search with symbol terms
60
+ memory search "queryContext" --token-budget 1500
61
+ ```
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: muse-ground
3
+ description: Pre-flight context and invariant grounding for AI coding agents. Retrieves Top-K relevant memories, active USER.md persona, and CURRENT.md working constraints at the start of any session or major task.
4
+ ---
5
+
6
+ # 🎯 Muse Ground (`muse-ground`)
7
+
8
+ > **When to use**: Execute at the start of every session, task initiation, or context switch before proposing code changes, creating plans, or executing refactors.
9
+
10
+ ---
11
+
12
+ ## 🚀 Execution Workflow
13
+
14
+ ### Step 1: Query Context & Constraints
15
+ Call the `get_context` MCP tool (or run `memory context "<query>"`) using your current task objective or keyword domain:
16
+
17
+ ```json
18
+ {
19
+ "query": "authentication JWT expiration and database pool configuration",
20
+ "project": "my-project",
21
+ "token_budget": 2000
22
+ }
23
+ ```
24
+
25
+ ### Step 2: Ingest Three-Tier Grounding Hierarchy
26
+ The grounding response deterministically packages 3 critical layers in strict priority order:
27
+
28
+ 1. **`### User Profile & Preferences (USER.md)`**:
29
+ - Understand the user's role (`developer`, `designer`, `marketer`, `casual`, `custom`).
30
+ - Ground in explicit communication rules (e.g. terse output, runnable diffs, fail-fast mechanics).
31
+
32
+ 2. **`### Active Working Constraints (CURRENT.md)`**:
33
+ - Inspect immutable hard invariants (e.g. "Never commit secrets", "Preserve v1 backward compatibility").
34
+ - Review active session handoffs and in-flight checkpoints from previous agents.
35
+
36
+ 3. **`### Relevant Memories & Learned Patterns (Top-K)`**:
37
+ - Review past architectural decisions (`type: architecture`).
38
+ - Review previously solved edge-case bug fixes (`type: fix`).
39
+ - Avoid re-introducing known antipatterns or rejected hypotheses (`type: failure` / `status: rejected`).
40
+
41
+ ---
42
+
43
+ ## 🛡️ Invariant Rules for Agents
44
+
45
+ - **Read Before Mutating**: Never edit code without first checking `CURRENT.md` and active constraints.
46
+ - **Fail Fast on Missing Context**: If `get_context` reveals a conflicting historical decision, escalate or verify rather than blindly overriding.
47
+ - **Tone Alignment**: Strictly mirror the persona defined in `USER.md`.
48
+
49
+ ---
50
+
51
+ ## 💻 CLI Equivalents (Zero-MCP Fallback)
52
+
53
+ ```bash
54
+ # Retrieve top-ranked prompt context
55
+ memory context "query terms" --token-budget 2000
56
+
57
+ # Inspect active working constraints directly
58
+ memory current get
59
+
60
+ # Inspect active user persona profile
61
+ memory user get
62
+ ```
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: muse-wiki
3
+ description: Obsidian-compatible knowledge compounding and entity graph generation. Compiles confirmed memories into interlinked Markdown concept pages and tracks named entity co-occurrences.
4
+ ---
5
+
6
+ # 📚 Muse Wiki (`muse-wiki`)
7
+
8
+ > **When to use**: Execute at milestone completion, weekly review, or when synthesizing scattered memory units into a structured, readable documentation wiki.
9
+
10
+ ---
11
+
12
+ ## 🚀 Execution Workflow
13
+
14
+ ### Step 1: Compile Knowledge Wiki
15
+ Call the `memory_wiki_compile` MCP tool (or run `memory wiki compile`):
16
+
17
+ ```json
18
+ {
19
+ "project": "my-project",
20
+ "min_cluster_size": 2
21
+ }
22
+ ```
23
+
24
+ This compiles confirmed memories into structured Obsidian Markdown files in `.memory/wiki/`:
25
+ - **Concept Pages (`wiki/concepts/`)**: Clustered architectural concepts with bidirectional `[[concept-slug]]` wikilinks.
26
+ - **Entity Pages (`wiki/entities/`)**: Extracted tools, frameworks, components, and libraries.
27
+ - **Master Index (`wiki/index.md`)**: Table of contents mapping all domain topics.
28
+
29
+ ### Step 2: Query Wiki Concepts & Entity Graph
30
+ - Call `memory_wiki_search` / `memory_wiki_get` to read synthesized domain documentation.
31
+ - Call `memory_entities_search` / `memory_entities_get` to inspect entity co-occurrence networks (e.g. which libraries are frequently paired with specific architectures).
32
+
33
+ ---
34
+
35
+ ## 🛡️ Invariant Rules for Agents
36
+
37
+ - **Confirmed Only**: Only `confirmed` memories are compiled into wiki pages to guarantee high signal and prevent draft noise.
38
+ - **Dual Persistence**: Wiki pages are plain Markdown files with YAML frontmatter, fully editable in Obsidian, VS Code, or Cursor.
39
+
40
+ ---
41
+
42
+ ## 💻 CLI Equivalents (Zero-MCP Fallback)
43
+
44
+ ```bash
45
+ # Compile confirmed memories into Obsidian-compatible wiki
46
+ memory wiki compile
47
+
48
+ # List compiled wiki pages
49
+ memory wiki list
50
+
51
+ # Read a specific concept page
52
+ memory wiki show auth-patterns
53
+
54
+ # Inspect entity relationships
55
+ memory entities show nextjs
56
+ memory entities related nextjs
57
+ ```