repomemory 1.9.0 → 1.11.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/README.md +51 -17
- package/dist/commands/go.d.ts.map +1 -1
- package/dist/commands/go.js +2 -1
- package/dist/commands/go.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/risk.d.ts +8 -0
- package/dist/commands/risk.d.ts.map +1 -0
- package/dist/commands/risk.js +87 -0
- package/dist/commands/risk.js.map +1 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +145 -27
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/wizard.d.ts.map +1 -1
- package/dist/commands/wizard.js +51 -22
- package/dist/commands/wizard.js.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/git-intelligence.d.ts +59 -0
- package/dist/lib/git-intelligence.d.ts.map +1 -0
- package/dist/lib/git-intelligence.js +274 -0
- package/dist/lib/git-intelligence.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +114 -1
- package/dist/mcp/server.js.map +1 -1
- package/package.json +1 -1
- package/server.json +6 -2
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ npx repomemory go
|
|
|
21
21
|
|
|
22
22
|
<div align="center">
|
|
23
23
|
|
|
24
|
-
https://github.com/DanielGuru/repomemory/raw/main/repomemory-demo.gif.mp4
|
|
24
|
+
<video src="https://github.com/DanielGuru/repomemory/raw/main/repomemory-demo.gif.mp4" width="100%" autoplay loop muted playsinline></video>
|
|
25
25
|
|
|
26
26
|
</div>
|
|
27
27
|
|
|
@@ -52,7 +52,7 @@ Your `CLAUDE.md` / `.cursorrules` helps, but it's static and gets stale.
|
|
|
52
52
|
|
|
53
53
|
## Quick Start
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### With an API key (Claude Code, terminal workflows)
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
58
|
npx repomemory go
|
|
@@ -60,25 +60,54 @@ npx repomemory go
|
|
|
60
60
|
|
|
61
61
|
One command: sets up global profile, creates `.context/`, configures Claude Code + Cursor, runs AI analysis, prints CLAUDE.md instructions.
|
|
62
62
|
|
|
63
|
-
###
|
|
63
|
+
### With Cursor (no API key needed)
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
npx repomemory
|
|
66
|
+
npx repomemory setup cursor
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
This installs everything Cursor needs:
|
|
70
|
+
- **MCP server** in `~/.cursor/mcp.json` (auto-starts repomemory in every project)
|
|
71
|
+
- **Rules** in `.cursor/rules/repomemory.mdc` (teaches Cursor's AI to use context)
|
|
72
|
+
- **6 commands** in `.cursor/commands/` (run with `/` in Cursor chat)
|
|
73
|
+
|
|
74
|
+
Then in Cursor chat, type:
|
|
75
|
+
```
|
|
76
|
+
/repomemory-analyze
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Cursor's own AI scans your repo and populates `.context/` via the MCP tools. No external API key required — your Cursor subscription handles it.
|
|
80
|
+
|
|
81
|
+
**Available Cursor commands:**
|
|
82
|
+
|
|
83
|
+
| Command | What it does |
|
|
84
|
+
|---------|-------------|
|
|
85
|
+
| `/repomemory-analyze` | Full repo analysis — populates facts, decisions, index |
|
|
86
|
+
| `/repomemory-orient` | Quick orientation at start of session |
|
|
87
|
+
| `/repomemory-search` | Search the knowledge base |
|
|
88
|
+
| `/repomemory-record` | Record a fact, decision, or regression |
|
|
89
|
+
| `/repomemory-session` | Save a session summary |
|
|
90
|
+
| `/repomemory-status` | Show context coverage |
|
|
70
91
|
|
|
71
|
-
### Guided
|
|
92
|
+
### Guided wizard
|
|
72
93
|
|
|
73
94
|
```bash
|
|
74
95
|
npx repomemory wizard
|
|
75
96
|
```
|
|
76
97
|
|
|
77
|
-
Walks through provider selection, tool integration, and first analysis.
|
|
98
|
+
Walks through provider selection, tool integration, and first analysis. If no API keys are detected, offers a **"None — I use Cursor"** option that skips external analysis entirely.
|
|
99
|
+
|
|
100
|
+
### Non-interactive (CI-safe)
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npx repomemory go --yes --provider anthropic --embedding-provider gemini --max-files 80
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
No prompts when `--yes` / `--defaults` / `--no-prompt` is used.
|
|
78
107
|
|
|
79
108
|
## MCP Server — Agents With Real Memory
|
|
80
109
|
|
|
81
|
-
The real power is the MCP server. When configured via `repomemory setup claude`, it auto-starts with Claude Code and gives agents
|
|
110
|
+
The real power is the MCP server. When configured via `repomemory setup claude`, it auto-starts with Claude Code and gives agents 7 tools:
|
|
82
111
|
|
|
83
112
|
| Tool | What It Does |
|
|
84
113
|
|------|-------------|
|
|
@@ -87,6 +116,7 @@ The real power is the MCP server. When configured via `repomemory setup claude`,
|
|
|
87
116
|
| `context_write` | Write entries with smart scope routing (preferences → global) |
|
|
88
117
|
| `context_read` | Read full content, repo-first with global fallback |
|
|
89
118
|
| `context_list` | Browse entries with `[repo]`/`[global]` provenance tags |
|
|
119
|
+
| `context_risk` | Assess modification risk — hotspots, hidden coupling, bus factor |
|
|
90
120
|
| `context_delete` | Remove stale knowledge |
|
|
91
121
|
|
|
92
122
|
```
|
|
@@ -107,15 +137,17 @@ Sessions are auto-captured on shutdown. Zero config — `repomemory setup claude
|
|
|
107
137
|
|
|
108
138
|
## Supported Tools
|
|
109
139
|
|
|
110
|
-
| Tool | Integration |
|
|
111
|
-
|
|
112
|
-
| **Claude Code** | MCP server (auto-starts) + post-commit hook |
|
|
113
|
-
| **Cursor** | MCP server +
|
|
114
|
-
| **GitHub Copilot** | `copilot-instructions.md` |
|
|
115
|
-
| **Windsurf** | `.windsurfrules` |
|
|
116
|
-
| **Cline** | `.clinerules` |
|
|
117
|
-
| **Aider** | `.aider.conf.yml` |
|
|
118
|
-
| **Continue** | `.continue/rules/` |
|
|
140
|
+
| Tool | Integration | API Key Required? |
|
|
141
|
+
|------|------------|-------------------|
|
|
142
|
+
| **Claude Code** | MCP server (auto-starts) + post-commit hook | Yes (for analysis) |
|
|
143
|
+
| **Cursor** | MCP server + rules + 6 slash commands | **No** — uses Cursor's built-in AI |
|
|
144
|
+
| **GitHub Copilot** | `copilot-instructions.md` | Yes (for analysis) |
|
|
145
|
+
| **Windsurf** | `.windsurfrules` | Yes (for analysis) |
|
|
146
|
+
| **Cline** | `.clinerules` | Yes (for analysis) |
|
|
147
|
+
| **Aider** | `.aider.conf.yml` | Yes (for analysis) |
|
|
148
|
+
| **Continue** | `.continue/rules/` | Yes (for analysis) |
|
|
149
|
+
|
|
150
|
+
> **Cursor users:** You don't need any API key. Run `npx repomemory setup cursor`, then use `/repomemory-analyze` in Cursor chat. Cursor's AI does the analysis using the MCP tools — whatever model Cursor is using (it can even switch models mid-task).
|
|
119
151
|
|
|
120
152
|
## Supported Providers
|
|
121
153
|
|
|
@@ -140,6 +172,8 @@ repomemory search <query> # Search knowledge base from terminal
|
|
|
140
172
|
repomemory status # Coverage and freshness report
|
|
141
173
|
repomemory doctor # Diagnostics and health check
|
|
142
174
|
repomemory dashboard # Local web UI (localhost:3333)
|
|
175
|
+
repomemory risk # Hotspots, coupling, ownership analysis
|
|
176
|
+
repomemory risk -f src/auth.ts # Targeted risk assessment for specific files
|
|
143
177
|
repomemory sync # Sync git history to changelog
|
|
144
178
|
repomemory setup <tool> # Configure Claude/Cursor/Copilot/etc
|
|
145
179
|
repomemory hook install # Auto-sync changelog on commits
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"go.d.ts","sourceRoot":"","sources":["../../src/commands/go.ts"],"names":[],"mappings":"AAYA,wBAAsB,SAAS,CAAC,OAAO,EAAE;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,
|
|
1
|
+
{"version":3,"file":"go.d.ts","sourceRoot":"","sources":["../../src/commands/go.ts"],"names":[],"mappings":"AAYA,wBAAsB,SAAS,CAAC,OAAO,EAAE;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,iBAwSA"}
|
package/dist/commands/go.js
CHANGED
|
@@ -240,7 +240,8 @@ export async function goCommand(options) {
|
|
|
240
240
|
}
|
|
241
241
|
else {
|
|
242
242
|
console.log(chalk.yellow(`${currentStep}/${totalSteps} No API key found. Skipping analysis.`));
|
|
243
|
-
console.log(chalk.dim("
|
|
243
|
+
console.log(chalk.dim(" If you use Cursor, type /repomemory-analyze in chat to populate context with Cursor's AI."));
|
|
244
|
+
console.log(chalk.dim(" Or set your API key and run: npx repomemory analyze"));
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
247
|
else if (options.skipAnalyze) {
|
package/dist/commands/go.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"go.js","sourceRoot":"","sources":["../../src/commands/go.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa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d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const STARTER_INDEX = "# Project Context\n\n> Auto-generated by [repomemory](https://github.com/DanielGuru/repomemory). Run `repomemory analyze` to populate.\n\n## Quick Orient\n*Run `repomemory analyze` to generate project-specific orientation.*\n\n## Context Files\n- `facts/` \u2014 Architecture, patterns, integrations\n- `decisions/` \u2014 Why things are this way (prevents re-debating)\n- `regressions/` \u2014 Known gotchas, things that broke before\n- `sessions/` \u2014 Compressed session summaries\n- `changelog/` \u2014 Recent changes by month\n- `preferences/` \u2014 Coding style, preferred patterns, tool configs\n\n## For AI Agents\nSearch this directory for task-relevant context before starting work.\nWrite new learnings using the `context_write` MCP tool during your session.\n";
|
|
2
2
|
export declare function writeDefaultConfigFile(repoRoot: string, provider: string, model: string, embeddingProvider?: string): void;
|
|
3
|
-
export declare const CLAUDE_MD_BLOCK = "## Repository Memory (repomemory)\n\nThis repo uses [repomemory](https://github.com/DanielGuru/repomemory) for persistent AI memory.\n\n**IMPORTANT: Before starting ANY task, you MUST call `context_search` with relevant\nkeywords. This is NOT optional. The knowledge base contains architecture docs,\npast decisions, and known regressions that WILL save you from mistakes.\nDo NOT skip this step even if the task seems simple.**\n\n**ALWAYS at the start of every task:**\n1. Call `context_search` with keywords related to your task\n2. If this is a new session, call `context_auto_orient` for a full project overview\n3. NEVER propose changes without first checking for past decisions\n\n**During your session:**\n- ALWAYS use `context_write` to record discoveries, decisions, and gotchas\n- ALWAYS use `context_delete` to remove stale or incorrect knowledge\n- Record coding preferences in `context_write(category=\"preferences\", ...)`\n\n**Before modifying code:**\n- You MUST search for known regressions related to the component\n- You MUST check for past decisions before proposing alternatives\n\n**At end of session (REQUIRED):**\n- Write a session summary: `context_write(category=\"sessions\", ...)`\n- Route discoveries to the right category (facts/, decisions/, preferences/)";
|
|
3
|
+
export declare const CLAUDE_MD_BLOCK = "## Repository Memory (repomemory)\n\nThis repo uses [repomemory](https://github.com/DanielGuru/repomemory) for persistent AI memory.\n\n**IMPORTANT: Before starting ANY task, you MUST call `context_search` with relevant\nkeywords. This is NOT optional. The knowledge base contains architecture docs,\npast decisions, and known regressions that WILL save you from mistakes.\nDo NOT skip this step even if the task seems simple.**\n\n**ALWAYS at the start of every task:**\n1. Call `context_search` with keywords related to your task\n2. If this is a new session, call `context_auto_orient` for a full project overview\n3. NEVER propose changes without first checking for past decisions\n\n**During your session:**\n- ALWAYS use `context_write` to record discoveries, decisions, and gotchas\n- ALWAYS use `context_delete` to remove stale or incorrect knowledge\n- Record coding preferences in `context_write(category=\"preferences\", ...)`\n\n**Before modifying code:**\n- You MUST search for known regressions related to the component\n- You MUST check for past decisions before proposing alternatives\n- Call `context_risk` with the file paths you plan to modify \u2014 it reveals hidden coupling (files that must change together), ownership concentration, and churn hotspots\n\n**At end of session (REQUIRED):**\n- Write a session summary: `context_write(category=\"sessions\", ...)`\n- Route discoveries to the right category (facts/, decisions/, preferences/)";
|
|
4
4
|
export declare function initCommand(options: {
|
|
5
5
|
dir?: string;
|
|
6
6
|
provider?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,2wBAkBzB,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,iBAAiB,CAAC,EAAE,MAAM,GACzB,IAAI,CAkBN;AAED,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,2wBAkBzB,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,iBAAiB,CAAC,EAAE,MAAM,GACzB,IAAI,CAkBN;AAED,eAAO,MAAM,eAAe,27CA0BiD,CAAC;AAE9E,wBAAsB,WAAW,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,iBAkEzG"}
|
package/dist/commands/init.js
CHANGED
|
@@ -63,6 +63,7 @@ Do NOT skip this step even if the task seems simple.**
|
|
|
63
63
|
**Before modifying code:**
|
|
64
64
|
- You MUST search for known regressions related to the component
|
|
65
65
|
- You MUST check for past decisions before proposing alternatives
|
|
66
|
+
- Call \`context_risk\` with the file paths you plan to modify — it reveals hidden coupling (files that must change together), ownership concentration, and churn hotspots
|
|
66
67
|
|
|
67
68
|
**At end of session (REQUIRED):**
|
|
68
69
|
- Write a session summary: \`context_write(category="sessions", ...)\`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;CAkB5B,CAAC;AAEF,MAAM,UAAU,sBAAsB,CACpC,QAAgB,EAChB,QAAgB,EAChB,KAAa,EACb,iBAA0B;IAE1B,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IACtD,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,MAAM,aAAa,GAA4B;YAC7C,QAAQ;YACR,KAAK;YACL,UAAU,EAAE,c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AAC,IAAI,CACR,+HAA+H,CAChI,CACF,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC7B,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,IAAI,CACR,gQAAgQ,CACjQ,CACF,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qFAAqF,CAAC,CAAC,CAAC;AAChH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk.d.ts","sourceRoot":"","sources":["../../src/commands/risk.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,OAAO,EAAE;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,iBAgGA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { analyzeGitIntelligence, assessFileRisk } from "../lib/git-intelligence.js";
|
|
3
|
+
export async function riskCommand(options) {
|
|
4
|
+
const repoRoot = options.dir || process.cwd();
|
|
5
|
+
const topN = parseInt(options.limit || "15");
|
|
6
|
+
const maxCommits = parseInt(options.maxCommits || "500");
|
|
7
|
+
if (options.files) {
|
|
8
|
+
// Targeted assessment
|
|
9
|
+
const targets = options.files.split(",").map((f) => f.trim());
|
|
10
|
+
console.log(chalk.bold(`\n🔍 Assessing risk for ${targets.length} file${targets.length === 1 ? "" : "s"}...\n`));
|
|
11
|
+
const result = assessFileRisk(repoRoot, targets, { maxCommits });
|
|
12
|
+
if (options.json) {
|
|
13
|
+
console.log(JSON.stringify(result, null, 2));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
for (const a of result.assessments) {
|
|
17
|
+
const color = a.riskLevel === "high" ? chalk.red : a.riskLevel === "medium" ? chalk.yellow : chalk.green;
|
|
18
|
+
const icon = a.riskLevel === "high" ? "⚠️" : a.riskLevel === "medium" ? "⚡" : "✅";
|
|
19
|
+
console.log(`${icon} ${chalk.bold(a.file)} — ${color(a.riskLevel + " risk")}`);
|
|
20
|
+
if (a.riskFactors.length > 0) {
|
|
21
|
+
for (const f of a.riskFactors) {
|
|
22
|
+
console.log(chalk.dim(` ${f}`));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
console.log(chalk.dim(" No significant risk factors detected"));
|
|
27
|
+
}
|
|
28
|
+
if (a.ownership) {
|
|
29
|
+
console.log(chalk.dim(` Owner: ${a.ownership.primaryOwner} (${a.ownership.ownershipPct}%), bus factor: ${a.ownership.busFactor}`));
|
|
30
|
+
}
|
|
31
|
+
if (a.coChangePartners.length > 0) {
|
|
32
|
+
console.log(chalk.dim(" Often changes with:"));
|
|
33
|
+
for (const c of a.coChangePartners) {
|
|
34
|
+
const partner = c.fileA === a.file ? c.fileB : c.fileA;
|
|
35
|
+
console.log(chalk.dim(` - ${partner} (${c.coChangeCount} co-changes)`));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
console.log();
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// Global overview
|
|
43
|
+
console.log(chalk.bold(`\n🔍 Analyzing git intelligence (up to ${maxCommits} commits)...\n`));
|
|
44
|
+
const intel = analyzeGitIntelligence(repoRoot, { maxCommits, topN });
|
|
45
|
+
if (intel.analyzedCommits === 0) {
|
|
46
|
+
throw new Error("No git history found. Is this a git repository?");
|
|
47
|
+
}
|
|
48
|
+
if (options.json) {
|
|
49
|
+
console.log(JSON.stringify(intel, null, 2));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
console.log(chalk.dim(` Analyzed ${intel.analyzedCommits} commits over ${intel.timespan}\n`));
|
|
53
|
+
// Hotspots
|
|
54
|
+
if (intel.hotspots.length > 0) {
|
|
55
|
+
console.log(chalk.bold.red(" 🔥 Hotspot Files (high churn — modify with care)\n"));
|
|
56
|
+
for (const h of intel.hotspots) {
|
|
57
|
+
const bar = renderBar(h.score);
|
|
58
|
+
console.log(` ${bar} ${chalk.bold(h.file)}`);
|
|
59
|
+
console.log(chalk.dim(` ${h.commits} commits, ${h.churn} lines churned, ${h.authors} authors\n`));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Co-change pairs
|
|
63
|
+
if (intel.coChangePairs.length > 0) {
|
|
64
|
+
console.log(chalk.bold.yellow(" 🔗 Hidden Coupling (files that change together)\n"));
|
|
65
|
+
for (const c of intel.coChangePairs.slice(0, 10)) {
|
|
66
|
+
console.log(` ${chalk.cyan(c.fileA)} ↔ ${chalk.cyan(c.fileB)}`);
|
|
67
|
+
console.log(chalk.dim(` ${c.coChangeCount} co-changes, confidence: ${c.confidence}\n`));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// Ownership
|
|
71
|
+
if (intel.ownership.length > 0) {
|
|
72
|
+
console.log(chalk.bold.blue(" 👤 Ownership Concentration\n"));
|
|
73
|
+
for (const o of intel.ownership) {
|
|
74
|
+
const risk = o.busFactor === 1 ? chalk.red(" ⚠️ bus-factor risk") : "";
|
|
75
|
+
console.log(` ${chalk.bold(o.file)} — ${o.primaryOwner} (${o.ownershipPct}%), bus factor: ${o.busFactor}${risk}`);
|
|
76
|
+
}
|
|
77
|
+
console.log();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function renderBar(score) {
|
|
81
|
+
const width = 15;
|
|
82
|
+
const filled = Math.round(score * width);
|
|
83
|
+
const empty = width - filled;
|
|
84
|
+
const color = score >= 0.7 ? chalk.red : score >= 0.4 ? chalk.yellow : chalk.green;
|
|
85
|
+
return color("█".repeat(filled) + "░".repeat(empty)) + chalk.dim(` ${(score * 100).toFixed(0)}%`);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=risk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk.js","sourceRoot":"","sources":["../../src/commands/risk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEpF,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAMjC;IACC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC,CAAC;IAEzD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,sBAAsB;QACtB,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,2BAA2B,OAAO,CAAC,MAAM,QAAQ,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;QAEjH,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QAEjE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,IAAI,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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAiBA,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,iBAyBzE"}
|
package/dist/commands/setup.js
CHANGED
|
@@ -2,6 +2,16 @@ import { existsSync, readFileSync, writeFileSync, mkdirSync, chmodSync } from "f
|
|
|
2
2
|
import { join } from "path";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
const SUPPORTED_TOOLS = ["claude", "cursor", "copilot", "windsurf", "cline", "aider", "continue"];
|
|
5
|
+
function printCursorCommands() {
|
|
6
|
+
console.log();
|
|
7
|
+
console.log(chalk.bold("Cursor commands available (type / in chat):"));
|
|
8
|
+
console.log(chalk.cyan(" /repomemory-analyze") + chalk.dim(" — Full repo analysis, populate context"));
|
|
9
|
+
console.log(chalk.cyan(" /repomemory-orient") + chalk.dim(" — Quick project orientation"));
|
|
10
|
+
console.log(chalk.cyan(" /repomemory-search") + chalk.dim(" — Search knowledge base"));
|
|
11
|
+
console.log(chalk.cyan(" /repomemory-record") + chalk.dim(" — Record a fact, decision, or regression"));
|
|
12
|
+
console.log(chalk.cyan(" /repomemory-session") + chalk.dim(" — Save session summary"));
|
|
13
|
+
console.log(chalk.cyan(" /repomemory-status") + chalk.dim(" — Show context coverage"));
|
|
14
|
+
}
|
|
5
15
|
export async function setupCommand(tool, options) {
|
|
6
16
|
const repoRoot = options.dir || process.cwd();
|
|
7
17
|
if (!SUPPORTED_TOOLS.includes(tool)) {
|
|
@@ -151,7 +161,9 @@ function setupCursor(repoRoot) {
|
|
|
151
161
|
const cursorConfigDir = join(homeDir, ".cursor");
|
|
152
162
|
const mcpConfigPath = join(cursorConfigDir, "mcp.json");
|
|
153
163
|
let mcpAlreadyConfigured = false;
|
|
154
|
-
if (homeDir
|
|
164
|
+
if (homeDir) {
|
|
165
|
+
// Create ~/.cursor/ if it doesn't exist (Cursor will use it on next launch)
|
|
166
|
+
mkdirSync(cursorConfigDir, { recursive: true });
|
|
155
167
|
let mcpConfig = {};
|
|
156
168
|
if (existsSync(mcpConfigPath)) {
|
|
157
169
|
try {
|
|
@@ -185,29 +197,28 @@ globs: **/*
|
|
|
185
197
|
# Repository Memory (repomemory)
|
|
186
198
|
|
|
187
199
|
This project uses repomemory for persistent AI memory via MCP tools.
|
|
200
|
+
You have access to both Cursor's native codebase understanding AND repomemory's knowledge base.
|
|
201
|
+
**Use both together** — Cursor sees the code, repomemory remembers the context across sessions.
|
|
188
202
|
|
|
189
|
-
|
|
190
|
-
keywords. This is NOT optional. The knowledge base contains architecture docs,
|
|
191
|
-
past decisions, and known regressions that WILL save you from mistakes.
|
|
192
|
-
Do NOT skip this step even if the task seems simple.**
|
|
203
|
+
## Before ANY Task (Required)
|
|
193
204
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
205
|
+
1. Call \`context_search\` with keywords related to your task — this checks past decisions, known regressions, and architecture docs that will save you from mistakes
|
|
206
|
+
2. If this is a new session or you feel disoriented, call \`context_auto_orient\` for a full project overview
|
|
207
|
+
3. Use Cursor's native codebase search to find relevant files, then cross-reference with repomemory's stored knowledge
|
|
208
|
+
4. NEVER propose changes without checking \`context_search\` for past decisions on that component
|
|
198
209
|
|
|
199
|
-
|
|
200
|
-
- ALWAYS use \`context_write\` to record discoveries, decisions, and gotchas
|
|
201
|
-
- ALWAYS use \`context_delete\` to remove stale or incorrect knowledge
|
|
202
|
-
- Record coding preferences in \`context_write(category="preferences", ...)\`
|
|
210
|
+
## During Your Session
|
|
203
211
|
|
|
204
|
-
**
|
|
205
|
-
-
|
|
206
|
-
-
|
|
212
|
+
- When you discover something about the codebase (via reading files, debugging, etc.), **record it** with \`context_write\` — future sessions will thank you
|
|
213
|
+
- Use \`context_delete\` to remove stale or incorrect knowledge you find
|
|
214
|
+
- Record coding preferences in \`context_write(category="preferences", ...)\` — these persist globally across all projects
|
|
207
215
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
-
|
|
216
|
+
## Combining Cursor + repomemory
|
|
217
|
+
|
|
218
|
+
- **Cursor's strength:** Real-time code understanding, symbol search, file navigation, inline completions
|
|
219
|
+
- **repomemory's strength:** Cross-session memory, architectural decisions, regression history, team knowledge
|
|
220
|
+
- When searching: use \`context_search\` for high-level knowledge (decisions, patterns, regressions), use Cursor's native search for specific code
|
|
221
|
+
- When analyzing: use Cursor to read and understand code, then use \`context_write\` to persist what you learned
|
|
211
222
|
|
|
212
223
|
## MCP Tools Available
|
|
213
224
|
|
|
@@ -233,31 +244,138 @@ Do NOT skip this step even if the task seems simple.**
|
|
|
233
244
|
\`\`\`
|
|
234
245
|
`;
|
|
235
246
|
writeFileSync(join(cursorRulesDir, "repomemory.mdc"), ruleContent);
|
|
247
|
+
// --- Part 3: Create .cursor/commands/ for Cursor-driven workflows ---
|
|
248
|
+
const cursorCommandsDir = join(repoRoot, ".cursor", "commands");
|
|
249
|
+
mkdirSync(cursorCommandsDir, { recursive: true });
|
|
250
|
+
// Command: Full repo analysis
|
|
251
|
+
writeFileSync(join(cursorCommandsDir, "repomemory-analyze.md"), `---
|
|
252
|
+
description: Analyze this repo and populate repomemory context
|
|
253
|
+
---
|
|
254
|
+
Use your full codebase understanding to analyze this repository and populate the repomemory knowledge base. You have access to both Cursor's native code indexing and the repomemory MCP tools — use both.
|
|
255
|
+
|
|
256
|
+
## Step 1: Discover (use Cursor's native capabilities)
|
|
257
|
+
|
|
258
|
+
Browse the project structure, read key files (package.json, config files, entry points, schema files, README, etc.), understand the architecture, tech stack, patterns, and important decisions. Use Cursor's codebase search and symbol navigation to explore thoroughly.
|
|
259
|
+
|
|
260
|
+
## Step 2: Record (use repomemory MCP tools)
|
|
261
|
+
|
|
262
|
+
Write what you discovered to the knowledge base:
|
|
263
|
+
|
|
264
|
+
1. Call \`context_write(category="facts", filename="architecture")\` — Tech stack, directory structure, frameworks, languages, service boundaries. Reference actual file paths.
|
|
265
|
+
|
|
266
|
+
2. Call \`context_write(category="facts", filename="database")\` — Data layer: ORM, database type, schema patterns, migrations. Skip if no database.
|
|
267
|
+
|
|
268
|
+
3. Call \`context_write(category="facts", filename="deployment")\` — How the app deploys: hosting, CI/CD, env config, infrastructure. Skip if not apparent.
|
|
269
|
+
|
|
270
|
+
4. Call \`context_write(category="facts", filename="patterns")\` — Key code patterns: error handling, auth, API design, state management, testing approach.
|
|
271
|
+
|
|
272
|
+
5. Call \`context_write(category="facts", filename="api")\` — API routes/endpoints, request/response patterns, middleware. Skip if not an API.
|
|
273
|
+
|
|
274
|
+
6. Call \`context_write(category="decisions")\` for any clear architectural decisions visible in the code (e.g., framework choices, library selections, patterns that suggest deliberate choices).
|
|
275
|
+
|
|
276
|
+
7. Update the project index: Write a concise project summary to \`.context/index.md\` — what this project is, the main entry points, and how to get oriented quickly. Use \`context_write(category="facts", filename="index-overview")\` if you want to persist it as a searchable entry.
|
|
277
|
+
|
|
278
|
+
## Quality Standards
|
|
279
|
+
|
|
280
|
+
- **Reference actual file paths** — don't be vague, point to real files
|
|
281
|
+
- **Be specific about versions** — note framework/library versions from package.json or lock files
|
|
282
|
+
- **Include code patterns** — show actual function signatures or patterns used, not just descriptions
|
|
283
|
+
- **Note what's missing** — if there are no tests, no CI, no types, say so — that's valuable context too
|
|
284
|
+
|
|
285
|
+
This context will be used by AI agents in every future session, so accuracy matters more than brevity.
|
|
286
|
+
`);
|
|
287
|
+
// Command: Quick orientation
|
|
288
|
+
writeFileSync(join(cursorCommandsDir, "repomemory-orient.md"), `---
|
|
289
|
+
description: Orient yourself in this project using repomemory context
|
|
290
|
+
---
|
|
291
|
+
Get oriented in this project by combining repomemory's stored knowledge with Cursor's live codebase understanding.
|
|
292
|
+
|
|
293
|
+
1. Call \`context_auto_orient()\` to load stored context — project index, coding preferences, recent sessions, and recent changes.
|
|
294
|
+
2. Cross-reference with the actual codebase — verify the stored context is still accurate by checking key files Cursor can see.
|
|
295
|
+
3. If context seems sparse or empty, suggest running \`/repomemory-analyze\` first.
|
|
296
|
+
|
|
297
|
+
Summarize what you know about this project, noting any discrepancies between stored context and current code state.
|
|
298
|
+
`);
|
|
299
|
+
// Command: Search context
|
|
300
|
+
writeFileSync(join(cursorCommandsDir, "repomemory-search.md"), `---
|
|
301
|
+
description: Search repomemory context for relevant knowledge
|
|
302
|
+
---
|
|
303
|
+
Search for knowledge using both repomemory's stored context and Cursor's live codebase understanding.
|
|
304
|
+
|
|
305
|
+
1. Call \`context_search(query="<search terms>")\` with relevant keywords to find stored knowledge (past decisions, known regressions, architecture docs, preferences).
|
|
306
|
+
2. Use Cursor's native codebase search to find relevant code, files, and symbols that relate to the query.
|
|
307
|
+
3. Combine both results — stored knowledge gives you the "why" and history, Cursor's code search gives you the current "what".
|
|
308
|
+
|
|
309
|
+
Present results clearly:
|
|
310
|
+
- **From repomemory:** Category, key findings, relevance to the query
|
|
311
|
+
- **From codebase:** Relevant files, functions, patterns found
|
|
312
|
+
- **Gaps:** Note if something exists in code but isn't documented in repomemory (offer to record it)
|
|
313
|
+
`);
|
|
314
|
+
// Command: Record knowledge
|
|
315
|
+
writeFileSync(join(cursorCommandsDir, "repomemory-record.md"), `---
|
|
316
|
+
description: Record a fact, decision, or regression to repomemory
|
|
317
|
+
---
|
|
318
|
+
Ask the user what they want to record, or infer from the current conversation. Determine the right category:
|
|
319
|
+
|
|
320
|
+
- **facts/** — How things work (architecture, APIs, patterns, integrations)
|
|
321
|
+
- **decisions/** — Why something was chosen ("We use X instead of Y because...")
|
|
322
|
+
- **regressions/** — Bugs, gotchas, things that broke ("Never do X because Y happens")
|
|
323
|
+
- **preferences/** — Coding style, conventions ("Always use early returns", "Prefer X over Y")
|
|
324
|
+
|
|
325
|
+
Call \`context_write(category="<category>", filename="<descriptive-name>", content="<content>")\` with well-structured markdown content.
|
|
326
|
+
|
|
327
|
+
Confirm what was recorded and where.
|
|
328
|
+
`);
|
|
329
|
+
// Command: Session summary
|
|
330
|
+
writeFileSync(join(cursorCommandsDir, "repomemory-session.md"), `---
|
|
331
|
+
description: Save a summary of this session to repomemory
|
|
332
|
+
---
|
|
333
|
+
Review the current conversation and summarize what was accomplished, what was learned, and any important decisions or discoveries.
|
|
334
|
+
|
|
335
|
+
Call \`context_write(category="sessions", filename="<date-slug>", content="<summary>")\` with a structured summary including:
|
|
336
|
+
|
|
337
|
+
- **What was done** — Tasks completed, files changed
|
|
338
|
+
- **Decisions made** — Any choices about architecture, approach, tools
|
|
339
|
+
- **Issues found** — Bugs, gotchas, unexpected behavior
|
|
340
|
+
- **Next steps** — What should happen next
|
|
341
|
+
|
|
342
|
+
This helps future AI sessions pick up where you left off.
|
|
343
|
+
`);
|
|
344
|
+
// Command: Show status
|
|
345
|
+
writeFileSync(join(cursorCommandsDir, "repomemory-status.md"), `---
|
|
346
|
+
description: Show repomemory context coverage and freshness
|
|
347
|
+
---
|
|
348
|
+
Call \`context_list()\` to see all entries in the knowledge base.
|
|
349
|
+
|
|
350
|
+
Present the results as a status report:
|
|
351
|
+
- How many entries per category (facts, decisions, regressions, preferences, sessions)
|
|
352
|
+
- Which categories are empty or sparse
|
|
353
|
+
- When entries were last updated (if dates are visible in content)
|
|
354
|
+
|
|
355
|
+
Suggest what's missing — e.g., "No regressions recorded yet" or "Architecture facts could use more detail."
|
|
356
|
+
`);
|
|
236
357
|
// --- Output ---
|
|
237
358
|
if (mcpAlreadyConfigured) {
|
|
238
359
|
console.log(chalk.green("\n\u2713 Cursor configured!\n"));
|
|
239
360
|
console.log(` ${chalk.green("\u2713")} MCP server already in ${mcpConfigPath}`);
|
|
240
361
|
console.log(` ${chalk.green("\u2713")} Updated .cursor/rules/repomemory.mdc`);
|
|
362
|
+
console.log(` ${chalk.green("\u2713")} Updated .cursor/commands/ (6 commands)`);
|
|
241
363
|
console.log();
|
|
242
364
|
console.log(chalk.dim("Restart Cursor to pick up any changes."));
|
|
365
|
+
printCursorCommands();
|
|
243
366
|
return;
|
|
244
367
|
}
|
|
245
368
|
console.log(chalk.green("\n\u2713 Cursor configured!\n"));
|
|
246
|
-
if (homeDir
|
|
369
|
+
if (homeDir) {
|
|
247
370
|
console.log(chalk.bold(`MCP server added to ${mcpConfigPath}:`));
|
|
248
371
|
console.log(chalk.dim(JSON.stringify({ repomemory: { command: "npx", args: ["-y", "repomemory", "serve"] } }, null, 2)));
|
|
249
372
|
console.log();
|
|
250
373
|
}
|
|
251
|
-
else {
|
|
252
|
-
console.log(chalk.yellow(" \u26a0 ~/.cursor/ not found. Install Cursor, then add the MCP server manually:"));
|
|
253
|
-
console.log(chalk.dim(` Add to ~/.cursor/mcp.json:`));
|
|
254
|
-
console.log(chalk.dim(JSON.stringify({ mcpServers: { repomemory: { command: "npx", args: ["-y", "repomemory", "serve"] } } }, null, 2)));
|
|
255
|
-
console.log();
|
|
256
|
-
}
|
|
257
374
|
console.log(` ${chalk.green("\u2713")} Created .cursor/rules/repomemory.mdc`);
|
|
375
|
+
console.log(` ${chalk.green("\u2713")} Created .cursor/commands/ (6 commands)`);
|
|
258
376
|
console.log();
|
|
259
377
|
console.log(chalk.dim("Restart Cursor to activate. The MCP server will auto-start in every project."));
|
|
260
|
-
|
|
378
|
+
printCursorCommands();
|
|
261
379
|
}
|
|
262
380
|
function setupCopilot(repoRoot) {
|
|
263
381
|
const githubDir = join(repoRoot, ".github");
|