@memfork/cli 0.1.19 → 0.1.21

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.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: memory-recall
3
+ description: >-
4
+ Recall relevant memory for the current task using the MemWal MCP tool.
5
+ Use when the user asks about prior decisions, past context, or what you remember.
6
+ ---
7
+
8
+ # Memory Recall
9
+
10
+ Memory is stored via the **MemWal MCP server** — use `memwal_recall` directly as a tool call.
11
+ Do not run `memfork recall` from the shell; the MCP tool is faster and context-aware.
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ memwal_recall(
17
+ query="<natural language — what you want to find>",
18
+ namespace="branch/<current-git-branch>",
19
+ limit=5
20
+ )
21
+ ```
22
+
23
+ Examples:
24
+ ```
25
+ memwal_recall(query="auth system design", namespace="branch/main")
26
+ memwal_recall(query="database schema decisions", namespace="branch/feature/payments")
27
+ memwal_recall(query="what do we know about the API rate limits?", limit=10)
28
+ ```
29
+
30
+ ## Rules
31
+
32
+ - Always scope to the current Git branch namespace unless the user asks for cross-branch context.
33
+ - High relevance scores = verified prior context.
34
+ - If recall returns nothing, tell the user memory is empty for this branch and offer to start capturing.
35
+ - Never fabricate facts — only use what `memwal_recall` returns.
36
+
37
+ ## After recalling
38
+
39
+ If relevant facts were found, summarise them briefly before answering. Cite them as
40
+ "from memory" so the user knows they come from a prior session.
@@ -0,0 +1,86 @@
1
+ # MemForks — Cursor Plugin
2
+
3
+ On-chain, branch-aware memory DAG for Cursor.
4
+
5
+ **Memory storage** is handled by the MemWal MCP server — the agent calls
6
+ `memwal_recall` and `memwal_remember` natively as tool calls, mid-conversation,
7
+ at exactly the right moment.
8
+
9
+ **On-chain versioning** is handled by the `memfork` CLI — architectural decisions
10
+ get cryptographically anchored to Sui with branch context and a full commit history.
11
+
12
+ ## Setup (one time, per machine)
13
+
14
+ ```bash
15
+ npm install -g @memfork/cli
16
+
17
+ # Recommended — zero copy-paste, ~30 seconds on testnet:
18
+ memfork init --quick
19
+
20
+ # Or manual if you already have a Sui key + MemWal account:
21
+ memfork init
22
+ ```
23
+
24
+ ## Install the plugin
25
+
26
+ ```bash
27
+ memfork install cursor
28
+ ```
29
+
30
+ This does two things:
31
+
32
+ 1. **Writes `~/.cursor/mcp.json`** — configures the MemWal MCP server using the
33
+ delegate key provisioned by `memfork init`. No browser login needed.
34
+
35
+ 2. **Copies `.cursor/rules/memforks.mdc`** — tells the agent when to use
36
+ `memwal_recall`, `memwal_remember`, and `memfork commit`.
37
+
38
+ ## Verify
39
+
40
+ ```bash
41
+ memfork doctor
42
+ ```
43
+
44
+ Restart Cursor — the agent now has MemWal MCP tools available immediately.
45
+
46
+ ## What the agent can do
47
+
48
+ | Tool / Command | What it does |
49
+ |----------------|-------------|
50
+ | `memwal_recall(query, namespace)` | Semantic search over branch memory (MCP tool) |
51
+ | `memwal_remember(text, namespace)` | Save a fact to branch memory (MCP tool) |
52
+ | `memwal_analyze(text)` | Extract and save multiple facts at once (MCP tool) |
53
+ | `memfork commit --facts …` | Anchor a decision on-chain with full provenance |
54
+ | `memfork merge <src> <dst>` | Propose a cross-branch memory merge |
55
+ | `memfork status / log / proposals` | Inspect the on-chain DAG |
56
+
57
+ Memory is namespaced by Git branch — switching branches automatically scopes
58
+ recall to the new branch context.
59
+
60
+ ## What gets installed
61
+
62
+ ```
63
+ ~/.cursor/mcp.json ← MemWal MCP server (Streamable HTTP, auto-configured)
64
+ .cursor/rules/memforks.mdc ← always-on agent guidance rule
65
+ ```
66
+
67
+ No shell hooks. No subprocess wrappers. The MCP server is the transport.
68
+
69
+ ## Override for CI / headless use
70
+
71
+ ```bash
72
+ MEMFORK_TREE_ID=0x…
73
+ MEMFORK_PRIVATE_KEY=suiprivkey1…
74
+ MEMFORK_MEMWAL_ACCOUNT=0x…
75
+ MEMFORK_MEMWAL_KEY=<hex>
76
+ ```
77
+
78
+ ## Uninstall
79
+
80
+ ```bash
81
+ # Remove the rule:
82
+ rm .cursor/rules/memforks.mdc
83
+
84
+ # Remove the MCP server entry from ~/.cursor/mcp.json:
85
+ # Delete the "memwal" key from mcpServers
86
+ ```
@@ -0,0 +1,137 @@
1
+ ---
2
+ description: MemForks — on-chain, branch-aware memory. Use memwal MCP tools for recall/remember. Use memfork CLI only for on-chain commits and merges.
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # MemForks Memory
7
+
8
+ This project uses MemForks: a version-controlled, branch-aware memory DAG anchored on Sui.
9
+
10
+ Memory storage is handled by the **MemWal MCP server** (already configured).
11
+ On-chain versioning is handled by the **memfork CLI**.
12
+
13
+ ---
14
+
15
+ ## Recall — use the MCP tool
16
+
17
+ When the user asks about prior decisions, architecture choices, or anything that might
18
+ have been discussed before, call the MCP tool:
19
+
20
+ ```
21
+ memwal_recall(query="<natural language query>", limit=5)
22
+ ```
23
+
24
+ Use the namespace matching the current Git branch:
25
+
26
+ ```
27
+ memwal_recall(query="auth system design decisions", namespace="branch/<current-branch>")
28
+ ```
29
+
30
+ Results with high relevance scores are verified context from prior sessions.
31
+
32
+ ## Remember — use the MCP tool
33
+
34
+ When you learn a durable fact (not ephemeral task state), save it:
35
+
36
+ ```
37
+ memwal_remember(text="<the complete fact>", namespace="branch/<current-branch>")
38
+ ```
39
+
40
+ Only save facts that will be useful in future sessions:
41
+ - Architecture decisions
42
+ - Project conventions and preferences
43
+ - Resolved problems and their solutions
44
+ - Key constraints or non-obvious requirements
45
+
46
+ Do **not** save: current task state, in-progress work, temporary findings.
47
+
48
+ ---
49
+
50
+ ## On-chain commit — use the CLI
51
+
52
+ After a significant turn where you've committed an architectural decision or resolved
53
+ a non-trivial problem, also anchor it on-chain for immutable versioning:
54
+
55
+ ```bash
56
+ memfork commit \
57
+ --branch $(git rev-parse --abbrev-ref HEAD) \
58
+ --message "decided: <one-line summary>" \
59
+ --facts "<fact 1>" "<fact 2>"
60
+ ```
61
+
62
+ This creates a cryptographically verifiable commit on Sui — not just a blob.
63
+ Use it for decisions that matter for audit trail, not routine facts.
64
+
65
+ ---
66
+
67
+ ## Branch awareness
68
+
69
+ - Memory is scoped to the current Git branch via the `namespace` parameter
70
+ - When the user switches branches, recall from the new branch namespace
71
+ - Use `memfork status` to see the on-chain tree state and open merge proposals
72
+
73
+ ---
74
+
75
+ ## Forking — exploring competing approaches
76
+
77
+ When the user asks you to explore multiple competing approaches (e.g. "try both",
78
+ "compare X vs Y", "explore both paths"), fork the memory tree so each hypothesis
79
+ stays isolated. Never collapse competing ideas into a single branch.
80
+
81
+ **Step 1 — announce and create branches:**
82
+
83
+ ```bash
84
+ memfork branch dev/<hypothesis-a> --from $(git rev-parse --abbrev-ref HEAD)
85
+ memfork branch dev/<hypothesis-b> --from $(git rev-parse --abbrev-ref HEAD)
86
+ ```
87
+
88
+ Use short kebab-case names (`dev/redis-first`, `dev/bcrypt-cost`).
89
+
90
+ **Step 2 — investigate each path and commit evidence:**
91
+
92
+ ```bash
93
+ memfork commit \
94
+ --branch dev/<hypothesis-a> \
95
+ --message "<what you found>" \
96
+ --facts "<measured fact>" "<result>"
97
+ ```
98
+
99
+ Commit at each meaningful step — hypothesis, measurement, result.
100
+
101
+ **Step 3 — summarise, do not merge.**
102
+
103
+ Report findings side by side and recommend which branch has stronger evidence.
104
+ Never run `memfork merge` as part of a fork investigation — merging is a
105
+ human governance act.
106
+
107
+ ---
108
+
109
+ ## Suggesting a merge — proactive but not autonomous
110
+
111
+ You may **suggest** a merge when you notice the current branch has accumulated
112
+ durable facts that are not yet on `main`. Do this by saying something like:
113
+
114
+ > "This branch has several facts that aren't on main yet — want me to merge them?
115
+ > I'll run `memfork merge <branch> main` which will write a merge anchor on-chain."
116
+
117
+ **Never run `memfork merge` without the user explicitly confirming.** Merging
118
+ changes shared team memory — it is a governance act, not a routine commit.
119
+
120
+ Situations where a suggestion is appropriate:
121
+ - The user says "we're done with this branch" or "I'm about to open a PR"
122
+ - You've committed 3+ significant facts in this session and the user hasn't merged yet
123
+ - The user asks "what should I do next?" at the end of a long session
124
+
125
+ Always phrase it as an offer, never as an action you are about to take automatically.
126
+
127
+ ---
128
+
129
+ ## Slash commands
130
+
131
+ | Command | Action |
132
+ |---------|--------|
133
+ | `/memforks status` | Branch status, head commit, open proposals |
134
+ | `/memforks log` | Recent on-chain commits on this branch |
135
+ | `/memforks recall <query>` | Manual MCP recall with a specific query |
136
+ | `/memforks merge <src> <dst>` | Merge branch memory on-chain (confirm with user first) |
137
+ | `/memforks ui` | Open the DAG visualizer |