memtrace 1.1.0 → 1.1.2
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/installer/dist/transformers/claude.d.ts +2 -0
- package/installer/dist/transformers/claude.js +17 -33
- package/installer/package.json +2 -1
- package/installer/plugin-assets/index.d.ts +19 -0
- package/installer/plugin-assets/index.js +51 -0
- package/installer/plugins/memtrace-skills/.claude-plugin/plugin.json +23 -0
- package/installer/plugins/memtrace-skills/README.md +16 -0
- package/installer/plugins/memtrace-skills/commands/mt-impact.md +10 -0
- package/installer/plugins/memtrace-skills/commands/mt-onboard.md +10 -0
- package/installer/plugins/memtrace-skills/commands/mt-preflight.md +10 -0
- package/installer/plugins/memtrace-skills/commands/mt-recall.md +10 -0
- package/lib/claude-integration.js +5 -0
- package/package.json +7 -7
|
@@ -5,10 +5,12 @@ import { Transformer, TransformResult } from './types.js';
|
|
|
5
5
|
* Each skill becomes a directory with SKILL.md inside skills/<skill-name>/
|
|
6
6
|
*/
|
|
7
7
|
export declare function transformForClaude(skill: Skill): TransformResult[];
|
|
8
|
+
export declare function findCanonicalPluginCacheDirAt(cacheRoot: string, canonicalVersion: string): string | null;
|
|
8
9
|
/**
|
|
9
10
|
* Fallback cache directory when the CLI install didn't create one.
|
|
10
11
|
*/
|
|
11
12
|
export declare function getClaudePluginCacheDir(): string;
|
|
13
|
+
export declare function copyBundledPluginAssetsAt(cacheDir: string, sourcePluginDir?: string): void;
|
|
12
14
|
export interface SettingsMutationResult {
|
|
13
15
|
registered: boolean;
|
|
14
16
|
backupPath?: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import os from 'os';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { copyCanonicalPluginAssets, copyCanonicalPluginManifest, readCanonicalPluginVersion, } from '../../plugin-assets/index.js';
|
|
4
6
|
import { execCommand, commandExists } from '../utils.js';
|
|
5
7
|
import { safeReadJson, writeJsonAtomic } from '../fs-safe.js';
|
|
6
8
|
import { LEGACY_MCP_SERVER_NAME, MEMTRACE_MCP_ENV, removeLegacyMcpServer, } from './shared.js';
|
|
@@ -9,6 +11,7 @@ const MARKETPLACE_NAME = 'memtrace';
|
|
|
9
11
|
const MARKETPLACE_REPO = 'syncable-dev/memtrace-public';
|
|
10
12
|
const MARKETPLACE_GIT_URL = `https://github.com/${MARKETPLACE_REPO}.git`;
|
|
11
13
|
const PLUGIN_KEY = `${PLUGIN_NAME}@${MARKETPLACE_NAME}`;
|
|
14
|
+
const BUNDLED_PLUGIN_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..', 'plugins', PLUGIN_NAME);
|
|
12
15
|
const MARKETPLACE_SETTING_KEYS = [
|
|
13
16
|
MARKETPLACE_NAME,
|
|
14
17
|
'syncable-dev-memtrace',
|
|
@@ -111,21 +114,24 @@ function getPluginCacheRoot() {
|
|
|
111
114
|
*/
|
|
112
115
|
function findCliInstalledCacheDir() {
|
|
113
116
|
const root = getPluginCacheRoot();
|
|
114
|
-
|
|
117
|
+
const canonicalVersion = readCanonicalPluginVersion(BUNDLED_PLUGIN_DIR);
|
|
118
|
+
return findCanonicalPluginCacheDirAt(root, canonicalVersion);
|
|
119
|
+
}
|
|
120
|
+
export function findCanonicalPluginCacheDirAt(cacheRoot, canonicalVersion) {
|
|
121
|
+
const canonicalCacheDir = path.join(cacheRoot, canonicalVersion);
|
|
122
|
+
if (!fs.existsSync(canonicalCacheDir))
|
|
115
123
|
return null;
|
|
116
|
-
|
|
117
|
-
const dir = path.join(root, entry);
|
|
118
|
-
if (!fs.statSync(dir).isDirectory())
|
|
119
|
-
continue;
|
|
120
|
-
return dir;
|
|
121
|
-
}
|
|
122
|
-
return null;
|
|
124
|
+
return fs.statSync(canonicalCacheDir).isDirectory() ? canonicalCacheDir : null;
|
|
123
125
|
}
|
|
124
126
|
/**
|
|
125
127
|
* Fallback cache directory when the CLI install didn't create one.
|
|
126
128
|
*/
|
|
127
129
|
export function getClaudePluginCacheDir() {
|
|
128
|
-
return path.join(getPluginCacheRoot(),
|
|
130
|
+
return path.join(getPluginCacheRoot(), readCanonicalPluginVersion(BUNDLED_PLUGIN_DIR));
|
|
131
|
+
}
|
|
132
|
+
export function copyBundledPluginAssetsAt(cacheDir, sourcePluginDir = BUNDLED_PLUGIN_DIR) {
|
|
133
|
+
copyCanonicalPluginAssets(sourcePluginDir, cacheDir);
|
|
134
|
+
copyCanonicalPluginManifest(sourcePluginDir, cacheDir);
|
|
129
135
|
}
|
|
130
136
|
// ────────────────────────────────────────────────────────────────────────────
|
|
131
137
|
// Installation strategy (in priority order):
|
|
@@ -171,28 +177,6 @@ async function tryClaudeCliInstall() {
|
|
|
171
177
|
return false;
|
|
172
178
|
}
|
|
173
179
|
}
|
|
174
|
-
/**
|
|
175
|
-
* Write the plugin.json manifest inside the cache directory.
|
|
176
|
-
*/
|
|
177
|
-
function writePluginManifest(cacheDir) {
|
|
178
|
-
const manifestDir = path.join(cacheDir, '.claude-plugin');
|
|
179
|
-
fs.mkdirSync(manifestDir, { recursive: true });
|
|
180
|
-
const version = path.basename(cacheDir);
|
|
181
|
-
const manifest = {
|
|
182
|
-
name: PLUGIN_NAME,
|
|
183
|
-
description: 'Memtrace skills for codebase exploration, code search, relationship analysis, temporal evolution, blast radius impact, code quality, graph algorithms, API topology, and multi-step workflows.',
|
|
184
|
-
version,
|
|
185
|
-
author: {
|
|
186
|
-
name: 'Syncable',
|
|
187
|
-
email: 'support@memtrace.io',
|
|
188
|
-
},
|
|
189
|
-
homepage: 'https://memtrace.io',
|
|
190
|
-
repository: `https://github.com/${MARKETPLACE_REPO}`,
|
|
191
|
-
license: 'SEE LICENSE IN LICENSE',
|
|
192
|
-
keywords: ['memtrace', 'code-intelligence', 'knowledge-graph', 'mcp', 'temporal-analysis'],
|
|
193
|
-
};
|
|
194
|
-
fs.writeFileSync(path.join(manifestDir, 'plugin.json'), JSON.stringify(manifest, null, 2));
|
|
195
|
-
}
|
|
196
180
|
/**
|
|
197
181
|
* Merge-add the memtrace MCP server into a Claude settings.json file.
|
|
198
182
|
* Never overwrites a malformed file — backs it up and returns registered=false.
|
|
@@ -520,7 +504,8 @@ export async function installClaudePlugin(skills, memtraceBinaryPath) {
|
|
|
520
504
|
}
|
|
521
505
|
}
|
|
522
506
|
}
|
|
523
|
-
// Step 5: Write skills
|
|
507
|
+
// Step 5: Write plugin assets and skills
|
|
508
|
+
copyBundledPluginAssetsAt(cacheDir);
|
|
524
509
|
const skillsDir = path.join(cacheDir, 'skills');
|
|
525
510
|
if (fs.existsSync(skillsDir)) {
|
|
526
511
|
fs.rmSync(skillsDir, { recursive: true });
|
|
@@ -533,7 +518,6 @@ export async function installClaudePlugin(skills, memtraceBinaryPath) {
|
|
|
533
518
|
fs.writeFileSync(fullPath, content);
|
|
534
519
|
}
|
|
535
520
|
}
|
|
536
|
-
writePluginManifest(cacheDir);
|
|
537
521
|
enablePluginInSettings();
|
|
538
522
|
// Step 6: Register MCP server
|
|
539
523
|
await registerMcpServer(memtraceBinaryPath);
|
package/installer/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memtrace-skills",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Memtrace skills for AI coding agents — codebase exploration, temporal evolution, impact analysis, and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"dist/",
|
|
11
11
|
"skills/",
|
|
12
12
|
"plugins/",
|
|
13
|
+
"plugin-assets/",
|
|
13
14
|
"README.md"
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const PLUGIN_ASSET_PATHS: readonly ['commands', 'README.md'];
|
|
2
|
+
export const PLUGIN_MANIFEST_PATH: string;
|
|
3
|
+
export const LEGACY_PLUGIN_ASSET_PATHS: readonly [
|
|
4
|
+
'hooks',
|
|
5
|
+
'MEMTRACE.md',
|
|
6
|
+
'INSTALLABLE-DIRECTIVE.md',
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export function copyCanonicalPluginAssets(
|
|
10
|
+
sourcePluginDir: string,
|
|
11
|
+
destinationPluginDir: string,
|
|
12
|
+
): void;
|
|
13
|
+
|
|
14
|
+
export function copyCanonicalPluginManifest(
|
|
15
|
+
sourcePluginDir: string,
|
|
16
|
+
destinationPluginDir: string,
|
|
17
|
+
): void;
|
|
18
|
+
|
|
19
|
+
export function readCanonicalPluginVersion(sourcePluginDir: string): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
export const PLUGIN_ASSET_PATHS = Object.freeze(['commands', 'README.md']);
|
|
5
|
+
export const PLUGIN_MANIFEST_PATH = path.join('.claude-plugin', 'plugin.json');
|
|
6
|
+
export const LEGACY_PLUGIN_ASSET_PATHS = Object.freeze([
|
|
7
|
+
'hooks',
|
|
8
|
+
'MEMTRACE.md',
|
|
9
|
+
'INSTALLABLE-DIRECTIVE.md',
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
export function copyCanonicalPluginAssets(sourcePluginDir, destinationPluginDir) {
|
|
13
|
+
removeLegacyPluginAssets(destinationPluginDir);
|
|
14
|
+
for (const relativePath of PLUGIN_ASSET_PATHS) {
|
|
15
|
+
copyRequiredAsset(sourcePluginDir, destinationPluginDir, relativePath);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function removeLegacyPluginAssets(destinationPluginDir) {
|
|
20
|
+
for (const relativePath of LEGACY_PLUGIN_ASSET_PATHS) {
|
|
21
|
+
fs.rmSync(path.join(destinationPluginDir, relativePath), {
|
|
22
|
+
recursive: true,
|
|
23
|
+
force: true,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function copyCanonicalPluginManifest(sourcePluginDir, destinationPluginDir) {
|
|
29
|
+
copyRequiredAsset(sourcePluginDir, destinationPluginDir, PLUGIN_MANIFEST_PATH);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function readCanonicalPluginVersion(sourcePluginDir) {
|
|
33
|
+
const manifestPath = path.join(sourcePluginDir, PLUGIN_MANIFEST_PATH);
|
|
34
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
35
|
+
if (typeof manifest.version !== 'string' || manifest.version.length === 0) {
|
|
36
|
+
throw new Error(`Canonical plugin manifest has no version: ${manifestPath}`);
|
|
37
|
+
}
|
|
38
|
+
return manifest.version;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function copyRequiredAsset(sourcePluginDir, destinationPluginDir, relativePath) {
|
|
42
|
+
const sourcePath = path.join(sourcePluginDir, relativePath);
|
|
43
|
+
if (!fs.existsSync(sourcePath)) {
|
|
44
|
+
throw new Error(`Missing canonical plugin asset: ${sourcePath}`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const destinationPath = path.join(destinationPluginDir, relativePath);
|
|
48
|
+
fs.rmSync(destinationPath, { recursive: true, force: true });
|
|
49
|
+
fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
|
|
50
|
+
fs.cpSync(sourcePath, destinationPath, { recursive: true });
|
|
51
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "memtrace-skills",
|
|
3
|
+
"description": "Memtrace skills for codebase exploration, code search, relationship analysis, temporal evolution, blast radius impact, code quality, graph algorithms, API topology, GitHub PR code review, multi-agent fleet coordination (branch-scoped intents, conflict classification, and agent-judged Class C resolution), and multi-step workflows for change impact, incident investigation, refactoring, session continuity, co-change analysis, and episode replay, Cortex decision memory (decision recall, provenance, intent verification), session bookends (daily briefing, hotspots, self-audit), and single-symbol pre-edit preflight checks.",
|
|
4
|
+
"version": "0.4.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Syncable",
|
|
7
|
+
"email": "support@syncable.dev"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://memtrace.io",
|
|
10
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"memtrace",
|
|
13
|
+
"code-intelligence",
|
|
14
|
+
"knowledge-graph",
|
|
15
|
+
"mcp",
|
|
16
|
+
"temporal-analysis",
|
|
17
|
+
"blast-radius",
|
|
18
|
+
"refactoring",
|
|
19
|
+
"architecture",
|
|
20
|
+
"multi-agent",
|
|
21
|
+
"fleet-coordination"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Memtrace skills plugin
|
|
2
|
+
|
|
3
|
+
`skills/` is the workflow source of truth. `commands/` contains manual
|
|
4
|
+
shortcuts only.
|
|
5
|
+
|
|
6
|
+
| Shortcut | Delegated workflow |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| `/memtrace-skills:mt-onboard` | `memtrace-codebase-exploration` |
|
|
9
|
+
| `/memtrace-skills:mt-impact` | `memtrace-impact` |
|
|
10
|
+
| `/memtrace-skills:mt-preflight` | `memtrace-preflight` |
|
|
11
|
+
| `/memtrace-skills:mt-recall` | `memtrace-decision-memory` |
|
|
12
|
+
|
|
13
|
+
Plugin-root documentation is not ambient Claude context. The consented npm
|
|
14
|
+
setup manages `~/.claude/MEMTRACE.md`. Native Rail owns discovery enforcement:
|
|
15
|
+
use `memtrace rail enable nudge|rail|strict` or `memtrace rail disable`. This
|
|
16
|
+
plugin deliberately ships no second shell hook.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Shortcut to the canonical Memtrace impact analysis skill
|
|
3
|
+
argument-hint: "<symbol> [repo_id]"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use the `Skill` tool to invoke `memtrace-skills:memtrace-impact` exactly once,
|
|
8
|
+
passing `$ARGUMENTS` unchanged. Treat that skill as the sole source of truth for
|
|
9
|
+
repository resolution, current MCP schemas, safety rules, and output. Do not
|
|
10
|
+
call MCP tools before loading it or reproduce its workflow here.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Shortcut to the canonical Memtrace codebase exploration skill
|
|
3
|
+
argument-hint: "[repo_id]"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use the `Skill` tool to invoke `memtrace-skills:memtrace-codebase-exploration`
|
|
8
|
+
exactly once, passing `$ARGUMENTS` unchanged. Treat that skill as the sole source
|
|
9
|
+
of truth for repository resolution, current MCP schemas, safety rules, and
|
|
10
|
+
output. Do not call MCP tools before loading it or reproduce its workflow here.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Shortcut to the canonical Memtrace preflight skill
|
|
3
|
+
argument-hint: "<symbol> [repo_id]"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use the `Skill` tool to invoke `memtrace-skills:memtrace-preflight` exactly once,
|
|
8
|
+
passing `$ARGUMENTS` unchanged. Treat that skill as the sole source of truth for
|
|
9
|
+
repository resolution, current MCP schemas, safety rules, and output. Do not
|
|
10
|
+
call MCP tools before loading it or reproduce its workflow here.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Shortcut to the canonical Memtrace decision-memory skill
|
|
3
|
+
argument-hint: "<query>"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use the `Skill` tool to invoke `memtrace-skills:memtrace-decision-memory`
|
|
8
|
+
exactly once, passing `$ARGUMENTS` unchanged. Treat that skill as the sole source
|
|
9
|
+
of truth for repository resolution, current MCP schemas, safety rules, and
|
|
10
|
+
output. Do not call MCP tools before loading it or reproduce its workflow here.
|
|
@@ -59,6 +59,11 @@ match: \`mcp__memtrace__get_symbol_context\` for callers/callees,
|
|
|
59
59
|
\`mcp__memtrace__get_evolution\` for history. Read source ONLY at the
|
|
60
60
|
exact spans Memtrace returned, with a few lines of context.
|
|
61
61
|
|
|
62
|
+
Before modifying an existing symbol, call
|
|
63
|
+
\`mcp__memtrace__preflight_check\`. Before deleting, refactoring, or
|
|
64
|
+
contradicting odd-looking code, call \`mcp__memtrace__recall_decision\`
|
|
65
|
+
to check recorded decisions, bans, and conventions.
|
|
66
|
+
|
|
62
67
|
\`Read\` / \`Grep\` / \`Glob\` remain correct ONLY for:
|
|
63
68
|
|
|
64
69
|
- Config files (\`.env\`, \`package.json\`, README, raw JSON/YAML/TOML)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memtrace",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Code intelligence graph — MCP server + AI agent skills + visualization UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"fs-extra": "^11.0.0"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@memtrace/darwin-arm64": "1.1.
|
|
44
|
-
"@memtrace/linux-x64": "1.1.
|
|
45
|
-
"@memtrace/linux-arm64": "1.1.
|
|
46
|
-
"@memtrace/win32-x64": "1.1.
|
|
47
|
-
"@memtrace/linux-x64-noavx2": "1.1.
|
|
48
|
-
"@memtrace/win32-x64-noavx2": "1.1.
|
|
43
|
+
"@memtrace/darwin-arm64": "1.1.2",
|
|
44
|
+
"@memtrace/linux-x64": "1.1.2",
|
|
45
|
+
"@memtrace/linux-arm64": "1.1.2",
|
|
46
|
+
"@memtrace/win32-x64": "1.1.2",
|
|
47
|
+
"@memtrace/linux-x64-noavx2": "1.1.2",
|
|
48
|
+
"@memtrace/win32-x64-noavx2": "1.1.2"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=18"
|