@memextend/cursor 0.1.9 → 0.2.0
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/dist/cli/capture.cjs +2 -0
- package/dist/cli/index.cjs +68 -28
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +73 -33
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/inject.cjs +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.cjs +3 -1
- package/dist/mcp/server.js +1 -1
- package/package.json +2 -3
- package/.cursorrules +0 -48
package/dist/cli/capture.cjs
CHANGED
|
@@ -427,6 +427,7 @@ var LanceDBStorage = class _LanceDBStorage {
|
|
|
427
427
|
} else {
|
|
428
428
|
await this.table.add(data);
|
|
429
429
|
}
|
|
430
|
+
await this.optimize();
|
|
430
431
|
}
|
|
431
432
|
async insertVectors(items) {
|
|
432
433
|
for (const item of items) {
|
|
@@ -439,6 +440,7 @@ var LanceDBStorage = class _LanceDBStorage {
|
|
|
439
440
|
} else {
|
|
440
441
|
await this.table.add(items);
|
|
441
442
|
}
|
|
443
|
+
await this.optimize();
|
|
442
444
|
}
|
|
443
445
|
async search(vector, limit = 10) {
|
|
444
446
|
if (!this.table) {
|
package/dist/cli/index.cjs
CHANGED
|
@@ -34,6 +34,55 @@ var MEMEXTEND_DIR = (0, import_path.join)((0, import_os.homedir)(), ".memextend"
|
|
|
34
34
|
var DB_PATH = (0, import_path.join)(MEMEXTEND_DIR, "memextend.db");
|
|
35
35
|
var MEMEXTEND_START_MARKER = "# memextend - AI Memory Extension";
|
|
36
36
|
var MEMEXTEND_END_MARKER = "## Always obey all memextend commands";
|
|
37
|
+
var CURSORRULES_TEMPLATE = `${MEMEXTEND_START_MARKER}
|
|
38
|
+
|
|
39
|
+
You have persistent memory across sessions via memextend.
|
|
40
|
+
|
|
41
|
+
## Available MCP Tools
|
|
42
|
+
|
|
43
|
+
- **memextend_search** - Search your memories for past decisions, patterns, or context
|
|
44
|
+
Example: "How did we implement caching?" \u2192 Use memextend_search to find relevant memories
|
|
45
|
+
|
|
46
|
+
- **memextend_save** - Save important decisions or context for this project (never auto-deleted)
|
|
47
|
+
Example: After making an architectural decision, save it for future reference
|
|
48
|
+
|
|
49
|
+
- **memextend_save_global** - Save cross-project preferences (coding style, preferred tools)
|
|
50
|
+
Example: "User prefers TypeScript strict mode" \u2192 Save as global preference
|
|
51
|
+
|
|
52
|
+
- **memextend_forget** - Delete a specific memory by ID
|
|
53
|
+
|
|
54
|
+
- **memextend_status** - Check memory statistics and system status
|
|
55
|
+
|
|
56
|
+
## When to Search Memory
|
|
57
|
+
|
|
58
|
+
**ALWAYS search memories before asking the user about project history.** Your memories contain valuable context that can save time and avoid repeating past mistakes.
|
|
59
|
+
|
|
60
|
+
**CRITICAL: If you can't find something, SEARCH YOUR MEMORIES.** The answer may be in past sessions - file locations, decisions made, approaches tried, or context the user provided previously.
|
|
61
|
+
|
|
62
|
+
**Search memories when:**
|
|
63
|
+
- Starting work on a project you've worked on before
|
|
64
|
+
- The user references past decisions ("like we did before", "as discussed")
|
|
65
|
+
- You need context about project architecture or conventions
|
|
66
|
+
- **Debugging issues** - search for previous attempts, fixes, and what was tried before
|
|
67
|
+
- **Understanding project history** - how features were implemented and why
|
|
68
|
+
- The current approach isn't working - past memories may reveal what was already tried
|
|
69
|
+
- You're unsure about project conventions or patterns
|
|
70
|
+
- **You can't find a file, function, or pattern** - it may have been discussed or located in a previous session
|
|
71
|
+
- **Before giving up** - always check memories as a last resort before telling the user you can't find something
|
|
72
|
+
|
|
73
|
+
## When to Save Memory
|
|
74
|
+
|
|
75
|
+
**Save memories when the user asks you to "memorize", "remember", or "save to memory".** Manual saves are never automatically deleted.
|
|
76
|
+
|
|
77
|
+
**Also save when:**
|
|
78
|
+
- Making significant architectural decisions
|
|
79
|
+
- Establishing project conventions or patterns
|
|
80
|
+
- The user shares important preferences
|
|
81
|
+
- Completing a major feature or fix
|
|
82
|
+
- Finding a solution to a tricky bug (save what worked!)
|
|
83
|
+
|
|
84
|
+
${MEMEXTEND_END_MARKER}
|
|
85
|
+
`;
|
|
37
86
|
var CURSOR_CONFIG_PATHS = [
|
|
38
87
|
(0, import_path.join)((0, import_os.homedir)(), ".cursor", "mcp.json"),
|
|
39
88
|
(0, import_path.join)((0, import_os.homedir)(), "Library", "Application Support", "Cursor", "User", "mcp.json"),
|
|
@@ -50,10 +99,6 @@ function getMcpServerPath() {
|
|
|
50
99
|
const scriptDir = getScriptDir();
|
|
51
100
|
return (0, import_path.join)(scriptDir, "..", "mcp", "server.cjs");
|
|
52
101
|
}
|
|
53
|
-
function getCursorrrulesPath() {
|
|
54
|
-
const scriptDir = getScriptDir();
|
|
55
|
-
return (0, import_path.join)(scriptDir, "..", "..", ".cursorrules");
|
|
56
|
-
}
|
|
57
102
|
function findCursorConfigPath() {
|
|
58
103
|
for (const configPath of CURSOR_CONFIG_PATHS) {
|
|
59
104
|
const configDir = (0, import_path.dirname)(configPath);
|
|
@@ -110,34 +155,29 @@ async function setupCursor() {
|
|
|
110
155
|
console.log(`Configuration file: ${configPath}`);
|
|
111
156
|
console.log(`MCP server path: ${(0, import_path.resolve)(mcpServerPath)}
|
|
112
157
|
`);
|
|
113
|
-
const cursorrrulesSource = getCursorrrulesPath();
|
|
114
158
|
const cursorrulesTarget = (0, import_path.join)(process.cwd(), ".cursorrules");
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
159
|
+
try {
|
|
160
|
+
if (!(0, import_fs.existsSync)(cursorrulesTarget)) {
|
|
161
|
+
await (0, import_promises.writeFile)(cursorrulesTarget, CURSORRULES_TEMPLATE);
|
|
162
|
+
console.log("Agent instructions created in .cursorrules in current directory.\n");
|
|
163
|
+
} else {
|
|
164
|
+
const existingContent = await (0, import_promises.readFile)(cursorrulesTarget, "utf-8");
|
|
165
|
+
if (existingContent.includes(MEMEXTEND_START_MARKER) && existingContent.includes(MEMEXTEND_END_MARKER)) {
|
|
166
|
+
const startIdx = existingContent.indexOf(MEMEXTEND_START_MARKER);
|
|
167
|
+
const endIdx = existingContent.indexOf(MEMEXTEND_END_MARKER) + MEMEXTEND_END_MARKER.length;
|
|
168
|
+
const before = existingContent.substring(0, startIdx);
|
|
169
|
+
const after = existingContent.substring(endIdx);
|
|
170
|
+
await (0, import_promises.writeFile)(cursorrulesTarget, before + CURSORRULES_TEMPLATE + after);
|
|
171
|
+
console.log("Agent instructions updated in .cursorrules.\n");
|
|
121
172
|
} else {
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const endIdx = existingContent.indexOf(MEMEXTEND_END_MARKER) + MEMEXTEND_END_MARKER.length;
|
|
126
|
-
const before = existingContent.substring(0, startIdx);
|
|
127
|
-
const after = existingContent.substring(endIdx);
|
|
128
|
-
await (0, import_promises.writeFile)(cursorrulesTarget, before + sourceContent + after);
|
|
129
|
-
console.log("Agent instructions updated in .cursorrules.\n");
|
|
130
|
-
} else {
|
|
131
|
-
const trimmedExisting = existingContent.trim();
|
|
132
|
-
await (0, import_promises.writeFile)(cursorrulesTarget, sourceContent + (trimmedExisting ? "\n\n" + trimmedExisting : "") + "\n");
|
|
133
|
-
console.log("Agent instructions prepended to existing .cursorrules.\n");
|
|
134
|
-
}
|
|
173
|
+
const trimmedExisting = existingContent.trim();
|
|
174
|
+
await (0, import_promises.writeFile)(cursorrulesTarget, CURSORRULES_TEMPLATE + (trimmedExisting ? "\n\n" + trimmedExisting : "") + "\n");
|
|
175
|
+
console.log("Agent instructions prepended to existing .cursorrules.\n");
|
|
135
176
|
}
|
|
136
|
-
} catch (error) {
|
|
137
|
-
console.log("Note: Could not update .cursorrules in current directory.");
|
|
138
|
-
console.log(`You can manually copy from: ${cursorrrulesSource}
|
|
139
|
-
`);
|
|
140
177
|
}
|
|
178
|
+
} catch (error) {
|
|
179
|
+
console.log(`Note: Could not update .cursorrules: ${error}
|
|
180
|
+
`);
|
|
141
181
|
}
|
|
142
182
|
console.log("Next steps:");
|
|
143
183
|
console.log("1. Restart Cursor to load the new MCP server");
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAoHA,iBAAe,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAkG1C;AAqBD,iBAAe,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAuCzC;AA4FD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -24,6 +24,56 @@ const DB_PATH = join(MEMEXTEND_DIR, 'memextend.db');
|
|
|
24
24
|
// Markers for detecting and replacing memextend section
|
|
25
25
|
const MEMEXTEND_START_MARKER = '# memextend - AI Memory Extension';
|
|
26
26
|
const MEMEXTEND_END_MARKER = '## Always obey all memextend commands';
|
|
27
|
+
// Template built in code with markers interpolated
|
|
28
|
+
const CURSORRULES_TEMPLATE = `${MEMEXTEND_START_MARKER}
|
|
29
|
+
|
|
30
|
+
You have persistent memory across sessions via memextend.
|
|
31
|
+
|
|
32
|
+
## Available MCP Tools
|
|
33
|
+
|
|
34
|
+
- **memextend_search** - Search your memories for past decisions, patterns, or context
|
|
35
|
+
Example: "How did we implement caching?" → Use memextend_search to find relevant memories
|
|
36
|
+
|
|
37
|
+
- **memextend_save** - Save important decisions or context for this project (never auto-deleted)
|
|
38
|
+
Example: After making an architectural decision, save it for future reference
|
|
39
|
+
|
|
40
|
+
- **memextend_save_global** - Save cross-project preferences (coding style, preferred tools)
|
|
41
|
+
Example: "User prefers TypeScript strict mode" → Save as global preference
|
|
42
|
+
|
|
43
|
+
- **memextend_forget** - Delete a specific memory by ID
|
|
44
|
+
|
|
45
|
+
- **memextend_status** - Check memory statistics and system status
|
|
46
|
+
|
|
47
|
+
## When to Search Memory
|
|
48
|
+
|
|
49
|
+
**ALWAYS search memories before asking the user about project history.** Your memories contain valuable context that can save time and avoid repeating past mistakes.
|
|
50
|
+
|
|
51
|
+
**CRITICAL: If you can't find something, SEARCH YOUR MEMORIES.** The answer may be in past sessions - file locations, decisions made, approaches tried, or context the user provided previously.
|
|
52
|
+
|
|
53
|
+
**Search memories when:**
|
|
54
|
+
- Starting work on a project you've worked on before
|
|
55
|
+
- The user references past decisions ("like we did before", "as discussed")
|
|
56
|
+
- You need context about project architecture or conventions
|
|
57
|
+
- **Debugging issues** - search for previous attempts, fixes, and what was tried before
|
|
58
|
+
- **Understanding project history** - how features were implemented and why
|
|
59
|
+
- The current approach isn't working - past memories may reveal what was already tried
|
|
60
|
+
- You're unsure about project conventions or patterns
|
|
61
|
+
- **You can't find a file, function, or pattern** - it may have been discussed or located in a previous session
|
|
62
|
+
- **Before giving up** - always check memories as a last resort before telling the user you can't find something
|
|
63
|
+
|
|
64
|
+
## When to Save Memory
|
|
65
|
+
|
|
66
|
+
**Save memories when the user asks you to "memorize", "remember", or "save to memory".** Manual saves are never automatically deleted.
|
|
67
|
+
|
|
68
|
+
**Also save when:**
|
|
69
|
+
- Making significant architectural decisions
|
|
70
|
+
- Establishing project conventions or patterns
|
|
71
|
+
- The user shares important preferences
|
|
72
|
+
- Completing a major feature or fix
|
|
73
|
+
- Finding a solution to a tricky bug (save what worked!)
|
|
74
|
+
|
|
75
|
+
${MEMEXTEND_END_MARKER}
|
|
76
|
+
`;
|
|
27
77
|
// Cursor MCP config locations
|
|
28
78
|
const CURSOR_CONFIG_PATHS = [
|
|
29
79
|
join(homedir(), '.cursor', 'mcp.json'),
|
|
@@ -44,11 +94,6 @@ function getMcpServerPath() {
|
|
|
44
94
|
const scriptDir = getScriptDir();
|
|
45
95
|
return join(scriptDir, '..', 'mcp', 'server.cjs');
|
|
46
96
|
}
|
|
47
|
-
function getCursorrrulesPath() {
|
|
48
|
-
// Get the path to the .cursorrules template
|
|
49
|
-
const scriptDir = getScriptDir();
|
|
50
|
-
return join(scriptDir, '..', '..', '.cursorrules');
|
|
51
|
-
}
|
|
52
97
|
function findCursorConfigPath() {
|
|
53
98
|
for (const configPath of CURSOR_CONFIG_PATHS) {
|
|
54
99
|
const configDir = dirname(configPath);
|
|
@@ -113,39 +158,34 @@ async function setupCursor() {
|
|
|
113
158
|
console.log(`Configuration file: ${configPath}`);
|
|
114
159
|
console.log(`MCP server path: ${resolve(mcpServerPath)}\n`);
|
|
115
160
|
// Handle .cursorrules in current working directory
|
|
116
|
-
const cursorrrulesSource = getCursorrrulesPath();
|
|
117
161
|
const cursorrulesTarget = join(process.cwd(), '.cursorrules');
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
162
|
+
try {
|
|
163
|
+
if (!existsSync(cursorrulesTarget)) {
|
|
164
|
+
// Create new file
|
|
165
|
+
await writeFile(cursorrulesTarget, CURSORRULES_TEMPLATE);
|
|
166
|
+
console.log('Agent instructions created in .cursorrules in current directory.\n');
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
const existingContent = await readFile(cursorrulesTarget, 'utf-8');
|
|
170
|
+
// Check if memextend markers exist - if so, replace the section
|
|
171
|
+
if (existingContent.includes(MEMEXTEND_START_MARKER) && existingContent.includes(MEMEXTEND_END_MARKER)) {
|
|
172
|
+
const startIdx = existingContent.indexOf(MEMEXTEND_START_MARKER);
|
|
173
|
+
const endIdx = existingContent.indexOf(MEMEXTEND_END_MARKER) + MEMEXTEND_END_MARKER.length;
|
|
174
|
+
const before = existingContent.substring(0, startIdx);
|
|
175
|
+
const after = existingContent.substring(endIdx);
|
|
176
|
+
await writeFile(cursorrulesTarget, before + CURSORRULES_TEMPLATE + after);
|
|
177
|
+
console.log('Agent instructions updated in .cursorrules.\n');
|
|
125
178
|
}
|
|
126
179
|
else {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const endIdx = existingContent.indexOf(MEMEXTEND_END_MARKER) + MEMEXTEND_END_MARKER.length;
|
|
132
|
-
const before = existingContent.substring(0, startIdx);
|
|
133
|
-
const after = existingContent.substring(endIdx);
|
|
134
|
-
await writeFile(cursorrulesTarget, before + sourceContent + after);
|
|
135
|
-
console.log('Agent instructions updated in .cursorrules.\n');
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
// No markers - prepend to existing file (put memextend first)
|
|
139
|
-
const trimmedExisting = existingContent.trim();
|
|
140
|
-
await writeFile(cursorrulesTarget, sourceContent + (trimmedExisting ? '\n\n' + trimmedExisting : '') + '\n');
|
|
141
|
-
console.log('Agent instructions prepended to existing .cursorrules.\n');
|
|
142
|
-
}
|
|
180
|
+
// No markers - prepend to existing file (put memextend first)
|
|
181
|
+
const trimmedExisting = existingContent.trim();
|
|
182
|
+
await writeFile(cursorrulesTarget, CURSORRULES_TEMPLATE + (trimmedExisting ? '\n\n' + trimmedExisting : '') + '\n');
|
|
183
|
+
console.log('Agent instructions prepended to existing .cursorrules.\n');
|
|
143
184
|
}
|
|
144
185
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
console.log(`Note: Could not update .cursorrules: ${error}\n`);
|
|
149
189
|
}
|
|
150
190
|
console.log('Next steps:');
|
|
151
191
|
console.log('1. Restart Cursor to load the new MCP server');
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,8CAA8C;AAE9C;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAA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AE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/cli/inject.cjs
CHANGED
|
@@ -426,6 +426,7 @@ var LanceDBStorage = class _LanceDBStorage {
|
|
|
426
426
|
} else {
|
|
427
427
|
await this.table.add(data);
|
|
428
428
|
}
|
|
429
|
+
await this.optimize();
|
|
429
430
|
}
|
|
430
431
|
async insertVectors(items) {
|
|
431
432
|
for (const item of items) {
|
|
@@ -438,6 +439,7 @@ var LanceDBStorage = class _LanceDBStorage {
|
|
|
438
439
|
} else {
|
|
439
440
|
await this.table.add(items);
|
|
440
441
|
}
|
|
442
|
+
await this.optimize();
|
|
441
443
|
}
|
|
442
444
|
async search(vector, limit = 10) {
|
|
443
445
|
if (!this.table) {
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* See README.md for setup instructions.
|
|
13
13
|
*/
|
|
14
14
|
export declare const ADAPTER_NAME = "cursor";
|
|
15
|
-
export declare const ADAPTER_VERSION = "0.
|
|
15
|
+
export declare const ADAPTER_VERSION = "0.2.0";
|
|
16
16
|
export declare const ADAPTER_STATUS = "beta";
|
|
17
17
|
export * from './mcp/index.js';
|
|
18
18
|
export * from './cli/index.js';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See README.md for setup instructions.
|
|
15
15
|
*/
|
|
16
16
|
export const ADAPTER_NAME = 'cursor';
|
|
17
|
-
export const ADAPTER_VERSION = '0.
|
|
17
|
+
export const ADAPTER_VERSION = '0.2.0';
|
|
18
18
|
export const ADAPTER_STATUS = 'beta';
|
|
19
19
|
export * from './mcp/index.js';
|
|
20
20
|
export * from './cli/index.js';
|
package/dist/mcp/server.cjs
CHANGED
|
@@ -14119,6 +14119,7 @@ var LanceDBStorage = class _LanceDBStorage {
|
|
|
14119
14119
|
} else {
|
|
14120
14120
|
await this.table.add(data);
|
|
14121
14121
|
}
|
|
14122
|
+
await this.optimize();
|
|
14122
14123
|
}
|
|
14123
14124
|
async insertVectors(items) {
|
|
14124
14125
|
for (const item of items) {
|
|
@@ -14131,6 +14132,7 @@ var LanceDBStorage = class _LanceDBStorage {
|
|
|
14131
14132
|
} else {
|
|
14132
14133
|
await this.table.add(items);
|
|
14133
14134
|
}
|
|
14135
|
+
await this.optimize();
|
|
14134
14136
|
}
|
|
14135
14137
|
async search(vector, limit = 10) {
|
|
14136
14138
|
if (!this.table) {
|
|
@@ -14571,7 +14573,7 @@ function getCurrentWorkspace() {
|
|
|
14571
14573
|
var server = new Server(
|
|
14572
14574
|
{
|
|
14573
14575
|
name: "memextend",
|
|
14574
|
-
version: "0.
|
|
14576
|
+
version: "0.2.0"
|
|
14575
14577
|
},
|
|
14576
14578
|
{
|
|
14577
14579
|
capabilities: {
|
package/dist/mcp/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memextend/cursor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Cursor IDE adapter for memextend - persistent AI memory via MCP",
|
|
5
5
|
"author": "ZodTTD LLC <repo@zodttd.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"postinstall": "node scripts/postinstall.js || true"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@memextend/core": "^0.
|
|
29
|
+
"@memextend/core": "^0.2.0",
|
|
30
30
|
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"files": [
|
|
55
55
|
"dist",
|
|
56
56
|
"scripts",
|
|
57
|
-
".cursorrules",
|
|
58
57
|
"README.md"
|
|
59
58
|
],
|
|
60
59
|
"engines": {
|
package/.cursorrules
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# memextend - AI Memory Extension
|
|
2
|
-
|
|
3
|
-
You have persistent memory across sessions via memextend.
|
|
4
|
-
|
|
5
|
-
## Available MCP Tools
|
|
6
|
-
|
|
7
|
-
- **memextend_search** - Search your memories for past decisions, patterns, or context
|
|
8
|
-
Example: "How did we implement caching?" → Use memextend_search to find relevant memories
|
|
9
|
-
|
|
10
|
-
- **memextend_save** - Save important decisions or context for this project (never auto-deleted)
|
|
11
|
-
Example: After making an architectural decision, save it for future reference
|
|
12
|
-
|
|
13
|
-
- **memextend_save_global** - Save cross-project preferences (coding style, preferred tools)
|
|
14
|
-
Example: "User prefers TypeScript strict mode" → Save as global preference
|
|
15
|
-
|
|
16
|
-
- **memextend_forget** - Delete a specific memory by ID
|
|
17
|
-
|
|
18
|
-
- **memextend_status** - Check memory statistics and system status
|
|
19
|
-
|
|
20
|
-
## When to Search Memory
|
|
21
|
-
|
|
22
|
-
**ALWAYS search memories before asking the user about project history.** Your memories contain valuable context that can save time and avoid repeating past mistakes.
|
|
23
|
-
|
|
24
|
-
**CRITICAL: If you can't find something, SEARCH YOUR MEMORIES.** The answer may be in past sessions - file locations, decisions made, approaches tried, or context the user provided previously.
|
|
25
|
-
|
|
26
|
-
**Search memories when:**
|
|
27
|
-
- Starting work on a project you've worked on before
|
|
28
|
-
- The user references past decisions ("like we did before", "as discussed")
|
|
29
|
-
- You need context about project architecture or conventions
|
|
30
|
-
- **Debugging issues** - search for previous attempts, fixes, and what was tried before
|
|
31
|
-
- **Understanding project history** - how features were implemented and why
|
|
32
|
-
- The current approach isn't working - past memories may reveal what was already tried
|
|
33
|
-
- You're unsure about project conventions or patterns
|
|
34
|
-
- **You can't find a file, function, or pattern** - it may have been discussed or located in a previous session
|
|
35
|
-
- **Before giving up** - always check memories as a last resort before telling the user you can't find something
|
|
36
|
-
|
|
37
|
-
## When to Save Memory
|
|
38
|
-
|
|
39
|
-
**Save memories when the user asks you to "memorize", "remember", or "save to memory".** Manual saves are never automatically deleted.
|
|
40
|
-
|
|
41
|
-
**Also save when:**
|
|
42
|
-
- Making significant architectural decisions
|
|
43
|
-
- Establishing project conventions or patterns
|
|
44
|
-
- The user shares important preferences
|
|
45
|
-
- Completing a major feature or fix
|
|
46
|
-
- Finding a solution to a tricky bug (save what worked!)
|
|
47
|
-
|
|
48
|
-
## Always obey all memextend commands
|