repomemory 0.1.0 → 0.2.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/.claude-plugin/plugin.json +8 -0
- package/.mcp.json +8 -0
- package/README.md +151 -104
- package/dist/commands/analyze.d.ts +2 -0
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +162 -188
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/dashboard.d.ts +5 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +520 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +33 -34
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +2 -1
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +151 -35
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/status.d.ts +4 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +87 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +57 -27
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/wizard.d.ts +4 -0
- package/dist/commands/wizard.d.ts.map +1 -0
- package/dist/commands/wizard.js +184 -0
- package/dist/commands/wizard.js.map +1 -0
- package/dist/index.js +37 -42
- package/dist/index.js.map +1 -1
- package/dist/lib/ai-provider.d.ts +11 -0
- package/dist/lib/ai-provider.d.ts.map +1 -1
- package/dist/lib/ai-provider.js +139 -69
- package/dist/lib/ai-provider.js.map +1 -1
- package/dist/lib/config.d.ts +11 -15
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +34 -22
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/context-store.d.ts +11 -0
- package/dist/lib/context-store.d.ts.map +1 -1
- package/dist/lib/context-store.js +51 -18
- package/dist/lib/context-store.js.map +1 -1
- package/dist/lib/git.d.ts +1 -0
- package/dist/lib/git.d.ts.map +1 -1
- package/dist/lib/git.js +34 -20
- package/dist/lib/git.js.map +1 -1
- package/dist/lib/json-repair.d.ts +24 -0
- package/dist/lib/json-repair.d.ts.map +1 -0
- package/dist/lib/json-repair.js +140 -0
- package/dist/lib/json-repair.js.map +1 -0
- package/dist/lib/repo-scanner.d.ts.map +1 -1
- package/dist/lib/repo-scanner.js +103 -26
- package/dist/lib/repo-scanner.js.map +1 -1
- package/dist/lib/search.d.ts +10 -4
- package/dist/lib/search.d.ts.map +1 -1
- package/dist/lib/search.js +136 -51
- package/dist/lib/search.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +163 -54
- package/dist/mcp/server.js.map +1 -1
- package/package.json +25 -9
- package/server.json +46 -0
- package/skills/repomemory/SKILL.md +29 -0
package/.mcp.json
ADDED
package/README.md
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# repomemory
|
|
2
4
|
|
|
3
|
-
**Your
|
|
5
|
+
**Your codebase never forgets.**
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
AI agents lose context every session. repomemory fixes that.
|
|
8
|
+
One command analyzes your repo and creates a persistent knowledge base that any AI tool can search, read, and write to.
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
[](https://www.npmjs.com/package/repomemory)
|
|
11
|
+
[](https://github.com/DanielGuru/repomemory/blob/main/LICENSE)
|
|
12
|
+
[](https://github.com/DanielGuru/repomemory/actions)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx repomemory wizard
|
|
9
16
|
```
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
</div>
|
|
12
19
|
|
|
13
20
|
---
|
|
14
21
|
|
|
@@ -21,11 +28,11 @@ Every time you open a project with Claude Code, Cursor, Copilot, or any AI codin
|
|
|
21
28
|
- It proposes changes that were already debated and rejected
|
|
22
29
|
- It re-introduces bugs that were already fixed
|
|
23
30
|
|
|
24
|
-
Your CLAUDE.md / .cursorrules helps, but it's
|
|
31
|
+
Your CLAUDE.md / .cursorrules helps, but it's static and manually maintained. It gets stale.
|
|
25
32
|
|
|
26
33
|
## The Solution
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
repomemory creates a structured, searchable knowledge base that AI agents can **search, read, and write to** during sessions:
|
|
29
36
|
|
|
30
37
|
```
|
|
31
38
|
.context/
|
|
@@ -48,70 +55,58 @@ Your CLAUDE.md / .cursorrules helps, but it's a static file you manually maintai
|
|
|
48
55
|
|
|
49
56
|
## Quick Start
|
|
50
57
|
|
|
51
|
-
###
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npx repomemory init
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 2. Set Your API Key
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
# Pick one:
|
|
61
|
-
export ANTHROPIC_API_KEY=sk-ant-... # Claude (recommended)
|
|
62
|
-
export OPENAI_API_KEY=sk-... # GPT-4o
|
|
63
|
-
export GEMINI_API_KEY=... # Gemini
|
|
64
|
-
export GROK_API_KEY=... # Grok
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### 3. Analyze Your Repo
|
|
58
|
+
### Interactive Setup (Recommended)
|
|
68
59
|
|
|
69
60
|
```bash
|
|
70
|
-
npx repomemory
|
|
61
|
+
npx repomemory wizard
|
|
71
62
|
```
|
|
72
63
|
|
|
73
|
-
|
|
64
|
+
The wizard walks you through provider selection, tool integration, and first analysis — all in one beautiful flow.
|
|
74
65
|
|
|
75
|
-
###
|
|
66
|
+
### Manual Setup
|
|
76
67
|
|
|
77
68
|
```bash
|
|
78
|
-
#
|
|
79
|
-
npx repomemory
|
|
80
|
-
|
|
81
|
-
# Cursor
|
|
82
|
-
npx repomemory setup cursor
|
|
69
|
+
# 1. Initialize
|
|
70
|
+
npx repomemory init
|
|
83
71
|
|
|
84
|
-
#
|
|
85
|
-
|
|
86
|
-
```
|
|
72
|
+
# 2. Set your API key
|
|
73
|
+
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY, GEMINI_API_KEY, GROK_API_KEY
|
|
87
74
|
|
|
88
|
-
|
|
75
|
+
# 3. Analyze your repo (2-5 min, uses AI)
|
|
76
|
+
npx repomemory analyze
|
|
89
77
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
# 4. Connect to your AI tool
|
|
79
|
+
npx repomemory setup claude # Claude Code (MCP server auto-starts)
|
|
80
|
+
npx repomemory setup cursor # Cursor
|
|
81
|
+
npx repomemory setup copilot # GitHub Copilot
|
|
82
|
+
npx repomemory setup windsurf # Windsurf
|
|
83
|
+
npx repomemory setup cline # Cline
|
|
84
|
+
npx repomemory setup aider # Aider
|
|
85
|
+
npx repomemory setup continue # Continue
|
|
86
|
+
|
|
87
|
+
# 5. Commit to git — your team shares the knowledge
|
|
88
|
+
git add .context/ && git commit -m "Add repomemory knowledge base"
|
|
93
89
|
```
|
|
94
90
|
|
|
95
|
-
|
|
91
|
+
## Features
|
|
96
92
|
|
|
97
|
-
|
|
93
|
+
### MCP Server — AI Agents With Memory
|
|
98
94
|
|
|
99
|
-
The real power is the MCP server
|
|
95
|
+
The real power is the MCP server. It gives AI agents tools to search, read, write, and delete context:
|
|
100
96
|
|
|
101
97
|
```bash
|
|
102
98
|
npx repomemory serve
|
|
103
99
|
```
|
|
104
100
|
|
|
105
|
-
### Tools Exposed
|
|
106
|
-
|
|
107
101
|
| Tool | What It Does |
|
|
108
102
|
|------|-------------|
|
|
109
|
-
| `context_search` |
|
|
110
|
-
| `context_write` | Write new
|
|
111
|
-
| `context_list` | Browse all entries by category |
|
|
103
|
+
| `context_search` | Full-text search across all knowledge |
|
|
104
|
+
| `context_write` | Write new facts, decisions, regressions, session notes |
|
|
112
105
|
| `context_read` | Read a specific context file |
|
|
106
|
+
| `context_list` | Browse all entries by category |
|
|
107
|
+
| `context_delete` | Remove stale or incorrect knowledge |
|
|
113
108
|
|
|
114
|
-
When configured via `repomemory setup claude`, the MCP server auto-starts with Claude Code
|
|
109
|
+
When configured via `repomemory setup claude`, the MCP server auto-starts with Claude Code:
|
|
115
110
|
|
|
116
111
|
```
|
|
117
112
|
Agent: "Let me search for context about the authentication flow..."
|
|
@@ -123,81 +118,128 @@ Agent: "I discovered a race condition in token refresh. Let me record this."
|
|
|
123
118
|
→ Persisted. Next session will find it.
|
|
124
119
|
```
|
|
125
120
|
|
|
126
|
-
|
|
121
|
+
### Web Dashboard
|
|
127
122
|
|
|
128
|
-
|
|
123
|
+
Browse and search your context files in a beautiful local web UI:
|
|
129
124
|
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
125
|
+
```bash
|
|
126
|
+
npx repomemory dashboard
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Opens `http://localhost:3333` with category filtering, full-text search, and file previews.
|
|
130
|
+
|
|
131
|
+
### Smart Analysis
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Full analysis
|
|
135
|
+
npx repomemory analyze
|
|
136
|
+
|
|
137
|
+
# Preview what would happen (no API call)
|
|
138
|
+
npx repomemory analyze --dry-run
|
|
139
|
+
|
|
140
|
+
# Update without overwriting your manual edits
|
|
141
|
+
npx repomemory analyze --merge
|
|
142
|
+
|
|
143
|
+
# Use a different provider or model
|
|
144
|
+
npx repomemory analyze --provider openai --model gpt-4o
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Features:
|
|
148
|
+
- Cost estimation before running
|
|
149
|
+
- API key validation before expensive calls
|
|
150
|
+
- Retry with exponential backoff on failures
|
|
151
|
+
- Coverage report showing facts/decisions/regressions
|
|
152
|
+
- Merge mode that preserves manual edits
|
|
153
|
+
|
|
154
|
+
### Git Sync
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npx repomemory sync
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Syncs recent git commits to `changelog/YYYY-MM.md` with smart deduplication.
|
|
161
|
+
|
|
162
|
+
### Status & Coverage
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npx repomemory status
|
|
141
166
|
```
|
|
142
167
|
|
|
143
|
-
|
|
168
|
+
Shows coverage bars, freshness indicators, stale file warnings, and suggestions.
|
|
169
|
+
|
|
170
|
+
## Supported Providers
|
|
144
171
|
|
|
145
172
|
| Provider | Models | Env Variable |
|
|
146
173
|
|----------|--------|-------------|
|
|
147
|
-
| `anthropic` | claude-sonnet-4-5
|
|
174
|
+
| `anthropic` | claude-sonnet-4-5, claude-opus-4-6 | `ANTHROPIC_API_KEY` |
|
|
148
175
|
| `openai` | gpt-4o, o3-mini | `OPENAI_API_KEY` |
|
|
149
|
-
| `gemini` | gemini-2.0-flash, gemini-2.5-pro | `GEMINI_API_KEY` |
|
|
150
|
-
| `grok` | grok-3, grok-3-mini | `GROK_API_KEY` |
|
|
176
|
+
| `gemini` | gemini-2.0-flash, gemini-2.5-pro | `GEMINI_API_KEY` / `GOOGLE_API_KEY` |
|
|
177
|
+
| `grok` | grok-3, grok-3-mini | `GROK_API_KEY` / `XAI_API_KEY` |
|
|
151
178
|
|
|
152
|
-
##
|
|
179
|
+
## Supported AI Tools
|
|
180
|
+
|
|
181
|
+
| Tool | Integration | Command |
|
|
182
|
+
|------|------------|---------|
|
|
183
|
+
| **Claude Code** | MCP server (auto-starts) | `repomemory setup claude` |
|
|
184
|
+
| **Cursor** | .cursor/rules/ | `repomemory setup cursor` |
|
|
185
|
+
| **GitHub Copilot** | copilot-instructions.md | `repomemory setup copilot` |
|
|
186
|
+
| **Windsurf** | .windsurfrules | `repomemory setup windsurf` |
|
|
187
|
+
| **Cline** | .clinerules | `repomemory setup cline` |
|
|
188
|
+
| **Aider** | .aider.conf.yml | `repomemory setup aider` |
|
|
189
|
+
| **Continue** | .continue/rules/ | `repomemory setup continue` |
|
|
190
|
+
|
|
191
|
+
## All Commands
|
|
153
192
|
|
|
154
193
|
| Command | Description |
|
|
155
194
|
|---------|-------------|
|
|
195
|
+
| `repomemory wizard` | Interactive guided setup (recommended for first use) |
|
|
156
196
|
| `repomemory init` | Scaffold `.context/` directory |
|
|
157
|
-
| `repomemory analyze` | AI-powered repo analysis
|
|
158
|
-
| `repomemory
|
|
159
|
-
| `repomemory
|
|
160
|
-
| `repomemory
|
|
161
|
-
| `repomemory
|
|
162
|
-
|
|
163
|
-
|
|
197
|
+
| `repomemory analyze` | AI-powered repo analysis |
|
|
198
|
+
| `repomemory analyze --dry-run` | Preview analysis without API call |
|
|
199
|
+
| `repomemory analyze --merge` | Update without overwriting edits |
|
|
200
|
+
| `repomemory sync` | Sync git history to changelog |
|
|
201
|
+
| `repomemory serve` | Start MCP server |
|
|
202
|
+
| `repomemory setup <tool>` | Configure AI tool integration |
|
|
203
|
+
| `repomemory status` | Show context coverage and freshness |
|
|
204
|
+
| `repomemory dashboard` | Open web dashboard |
|
|
164
205
|
|
|
165
|
-
|
|
166
|
-
# Use a specific provider
|
|
167
|
-
repomemory analyze --provider openai --model gpt-4o
|
|
206
|
+
## Configuration
|
|
168
207
|
|
|
169
|
-
|
|
170
|
-
repomemory analyze --dir /path/to/repo
|
|
208
|
+
Create `.repomemory.json` in your repo root:
|
|
171
209
|
|
|
172
|
-
|
|
173
|
-
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"provider": "anthropic",
|
|
213
|
+
"model": "claude-sonnet-4-5-20250929",
|
|
214
|
+
"contextDir": ".context",
|
|
215
|
+
"maxFilesForAnalysis": 80,
|
|
216
|
+
"maxGitCommits": 100,
|
|
217
|
+
"ignorePatterns": [],
|
|
218
|
+
"keyFilePatterns": []
|
|
219
|
+
}
|
|
174
220
|
```
|
|
175
221
|
|
|
222
|
+
Custom `ignorePatterns` and `keyFilePatterns` are **additive** — they extend the built-in defaults, not replace them.
|
|
223
|
+
|
|
176
224
|
## How It Works
|
|
177
225
|
|
|
178
|
-
### Initial Analysis
|
|
226
|
+
### Initial Analysis
|
|
179
227
|
|
|
180
|
-
1. **Scans** your repo
|
|
181
|
-
2. **Reads** key files — package.json, configs, schemas, READMEs,
|
|
182
|
-
3. **Mines** git history — commits, contributors, change patterns
|
|
183
|
-
4. **
|
|
184
|
-
5. **
|
|
185
|
-
6. **
|
|
228
|
+
1. **Scans** your repo — files, directories, languages, frameworks
|
|
229
|
+
2. **Reads** key files — package.json, configs, schemas, READMEs, CLAUDE.md
|
|
230
|
+
3. **Mines** git history — commits, contributors, change patterns
|
|
231
|
+
4. **Respects** .gitignore — won't scan ignored files
|
|
232
|
+
5. **Sends** everything to your AI model with a structured analysis prompt
|
|
233
|
+
6. **Writes** organized knowledge to `.context/`
|
|
234
|
+
7. **Indexes** all files for FTS5 full-text search
|
|
186
235
|
|
|
187
236
|
### During Sessions (MCP Server)
|
|
188
237
|
|
|
189
238
|
- Agent searches for relevant context at task start
|
|
190
239
|
- Agent writes discoveries, decisions, and gotchas during work
|
|
240
|
+
- Agent can delete stale or incorrect knowledge
|
|
191
241
|
- Knowledge accumulates session over session
|
|
192
|
-
- Next
|
|
193
|
-
|
|
194
|
-
### Git Sync (`sync`)
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
repomemory sync
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
Reads recent git commits and writes them to `changelog/YYYY-MM.md`. Run periodically or as a post-merge hook.
|
|
242
|
+
- Next session starts with everything previous sessions learned
|
|
201
243
|
|
|
202
244
|
## Why Not Just Use CLAUDE.md?
|
|
203
245
|
|
|
@@ -205,18 +247,17 @@ Reads recent git commits and writes them to `changelog/YYYY-MM.md`. Run periodic
|
|
|
205
247
|
|--|-----------|-------------|
|
|
206
248
|
| **Maintenance** | Manual | AI-generated + agent-maintained |
|
|
207
249
|
| **Search** | Load everything | FTS5 search, return only relevant |
|
|
208
|
-
| **Cross-tool** | Claude Code only |
|
|
250
|
+
| **Cross-tool** | Claude Code only | 7 AI tools supported |
|
|
209
251
|
| **Team knowledge** | One person writes | Every AI session contributes |
|
|
210
|
-
| **Decisions** | Mixed in with instructions | Structured, searchable
|
|
211
|
-
| **Regressions** | Not tracked |
|
|
252
|
+
| **Decisions** | Mixed in with instructions | Structured, searchable |
|
|
253
|
+
| **Regressions** | Not tracked | Prevents repeat bugs |
|
|
254
|
+
| **Freshness** | Unknown | Staleness detection + warnings |
|
|
212
255
|
|
|
213
|
-
|
|
256
|
+
repomemory doesn't replace CLAUDE.md — it complements it. Your CLAUDE.md stays for instructions and rules. `.context/` holds the knowledge that grows over time.
|
|
214
257
|
|
|
215
|
-
##
|
|
258
|
+
## Contributing
|
|
216
259
|
|
|
217
|
-
|
|
218
|
-
- **[Aider](https://aider.chat/)** — Repo maps and convention files showed the value of structured context.
|
|
219
|
-
- **Context Engineering** — The emerging discipline of curating what AI models see for better outcomes.
|
|
260
|
+
See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for development setup, testing, and contribution guidelines.
|
|
220
261
|
|
|
221
262
|
## License
|
|
222
263
|
|
|
@@ -224,4 +265,10 @@ MIT
|
|
|
224
265
|
|
|
225
266
|
---
|
|
226
267
|
|
|
268
|
+
<div align="center">
|
|
269
|
+
|
|
227
270
|
**Built for developers who are tired of AI agents forgetting everything between sessions.**
|
|
271
|
+
|
|
272
|
+
[Report Bug](https://github.com/DanielGuru/repomemory/issues) · [Request Feature](https://github.com/DanielGuru/repomemory/issues) · [npm](https://www.npmjs.com/package/repomemory)
|
|
273
|
+
|
|
274
|
+
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/commands/analyze.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/commands/analyze.ts"],"names":[],"mappings":"AA2EA,wBAAsB,cAAc,CAAC,OAAO,EAAE;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,iBAuPA"}
|