@shahmilsaari/memory-core 0.2.15 → 0.2.17
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 +133 -9
- package/dist/chunk-T4WJR6L6.js +1287 -0
- package/dist/{chunk-DUUQHRIB.js → chunk-WUL7HLAA.js} +26 -11
- package/dist/cli.js +388 -1447
- package/dist/dashboard/assets/index-BCu-gBna.js +2 -0
- package/dist/dashboard/assets/index-BxS_xPdw.css +1 -0
- package/dist/dashboard/index.html +13 -0
- package/dist/dashboard-server-EVN4FL4L.js +547 -0
- package/dist/{db-VLOR7L6Q.js → db-MF3VKVKH.js} +1 -1
- package/package.json +14 -4
- package/templates/AGENTS.md.hbs +1 -1
- package/templates/AI_RULES.md.hbs +1 -2
- package/templates/ARCHITECTURE.md.hbs +1 -1
- package/templates/CLAUDE.md.hbs +1 -1
- package/templates/DEVIN.md.hbs +1 -1
- package/templates/PROJECT_MEMORY.md.hbs +1 -4
- package/templates/amazonq-guidelines.md.hbs +1 -1
- package/templates/clinerules.hbs +1 -1
- package/templates/copilot-instructions.md.hbs +1 -1
- package/templates/cursor-rule.mdc.hbs +1 -1
- package/templates/cursorrules.hbs +1 -1
- package/templates/gemini-styleguide.md.hbs +1 -1
- package/templates/jetbrains-ai.md.hbs +1 -1
- package/templates/roo-rule.md.hbs +1 -1
- package/templates/windsurfrules.hbs +1 -1
package/README.md
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
You decide the architecture. memory-core remembers it. Every AI tool — Copilot, Cursor, Claude Code, Windsurf, and 10 more — reads those rules before writing a single line of code.
|
|
6
6
|
|
|
7
|
+
Website: https://memory-core.shahmilsaari.my/
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
10
|
npx @shahmilsaari/memory-core init
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
Fully local or cloud — your choice. **v0.2.
|
|
13
|
+
Fully local or cloud — your choice. **v0.2.16**
|
|
12
14
|
|
|
13
15
|
---
|
|
14
16
|
|
|
@@ -133,6 +135,7 @@ CREATE TABLE IF NOT EXISTS memories (
|
|
|
133
135
|
title TEXT,
|
|
134
136
|
content TEXT NOT NULL,
|
|
135
137
|
reason TEXT,
|
|
138
|
+
context JSONB NOT NULL DEFAULT '{}',
|
|
136
139
|
tags TEXT[] DEFAULT '{}',
|
|
137
140
|
embedding vector(768),
|
|
138
141
|
created_at TIMESTAMP DEFAULT now()
|
|
@@ -170,9 +173,33 @@ For the full CLI reference, examples, and command behavior notes, see [COMMANDS.
|
|
|
170
173
|
New setup-management commands:
|
|
171
174
|
- `memory-core status` — show project name, provider/model, agents, hook state, generated files, and health checks
|
|
172
175
|
- `memory-core auto-sync` — show or change automatic agent file regeneration (`on`, `off`, or `status`)
|
|
176
|
+
- `memory-core uninstall` — remove memory-core from the current project; use `reset` when you only need to regenerate files
|
|
173
177
|
- `memory-core provider set <provider>` — switch code-checking provider without rerunning `init`
|
|
174
178
|
- `memory-core model set <model>` — update chat or embedding model from the CLI
|
|
175
179
|
- `memory-core model doctor` — verify database, Ollama, model installation, and cloud API key presence
|
|
180
|
+
- `memory-core dashboard` — open the local Svelte command center with live WebSocket updates
|
|
181
|
+
|
|
182
|
+
## User Documentation
|
|
183
|
+
|
|
184
|
+
The public docs focus on how to install, use, configure, reset, and uninstall memory-core:
|
|
185
|
+
|
|
186
|
+
- Website: https://memory-core.shahmilsaari.my/
|
|
187
|
+
- Docs: https://memory-core.shahmilsaari.my/docs/
|
|
188
|
+
- Quick start and installation: `website/docs/intro.md`, `website/docs/installation.md`
|
|
189
|
+
- Daily usage: `website/docs/workflow.md`
|
|
190
|
+
- CLI reference: `website/docs/commands.md`
|
|
191
|
+
- Dashboard and model setup: `website/docs/dashboard.md`, `website/docs/models.md`
|
|
192
|
+
- Reset and uninstall behavior: `website/docs/cleanup.md`
|
|
193
|
+
|
|
194
|
+
The static homepage remains `index.html` at `/`. Public docs are plain static HTML generated from the markdown files in `website/docs/` and served under `/docs/`.
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm run site:start # build and preview the full site at / and /docs/
|
|
198
|
+
npm run site:build # assemble static output in site-build/
|
|
199
|
+
npm run site:serve # serve an existing site-build/ locally
|
|
200
|
+
npm run docs:build # build only the static docs app
|
|
201
|
+
npm run docs:serve # preview the existing site-build/ output
|
|
202
|
+
```
|
|
176
203
|
|
|
177
204
|
### `init` — Set up a project
|
|
178
205
|
|
|
@@ -240,6 +267,9 @@ npx @shahmilsaari/memory-core remember "Use DTOs for all API responses" \
|
|
|
240
267
|
--type rule \
|
|
241
268
|
--scope global \
|
|
242
269
|
--reason "Raw DB entities expose internal schema and sensitive fields" \
|
|
270
|
+
--applies-to "controllers,API responses" \
|
|
271
|
+
--avoid-when "internal domain transformations" \
|
|
272
|
+
--example "return UserResponseDto instead of UserEntity" \
|
|
243
273
|
--tags "api,dto"
|
|
244
274
|
```
|
|
245
275
|
|
|
@@ -248,8 +278,14 @@ npx @shahmilsaari/memory-core remember "Use DTOs for all API responses" \
|
|
|
248
278
|
| `--type` | `decision` `rule` `pattern` `note` | `decision` |
|
|
249
279
|
| `--scope` | `global` `project` | `project` |
|
|
250
280
|
| `--reason` | any text | asked interactively |
|
|
281
|
+
| `--applies-to` | comma-separated use cases | none |
|
|
282
|
+
| `--avoid-when` | comma-separated exceptions | none |
|
|
283
|
+
| `--example` | comma-separated examples | none |
|
|
284
|
+
| `--source` | source note, ticket, or review | none |
|
|
251
285
|
| `--tags` | comma-separated | none |
|
|
252
286
|
|
|
287
|
+
Structured context is stored in the database as JSON and rendered into generated agent files as `Why`, `Use when`, `Avoid when`, and `Examples`, which gives AI agents clearer guidance than a flat rule sentence.
|
|
288
|
+
|
|
253
289
|
---
|
|
254
290
|
|
|
255
291
|
### `search` — Find a rule or decision
|
|
@@ -306,20 +342,46 @@ Options:
|
|
|
306
342
|
```bash
|
|
307
343
|
npx @shahmilsaari/memory-core watch --path src/ # watch a specific folder only
|
|
308
344
|
npx @shahmilsaari/memory-core watch --verbose # show extra details
|
|
345
|
+
npx @shahmilsaari/memory-core watch --debug # show prompt, diff, and raw model output
|
|
309
346
|
```
|
|
310
347
|
|
|
311
348
|
Only checks source files — ignores `node_modules`, `dist`, config files, JSON, etc.
|
|
312
349
|
|
|
313
350
|
---
|
|
314
351
|
|
|
352
|
+
### `dashboard` — Local command center
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
npx @shahmilsaari/memory-core dashboard
|
|
356
|
+
npx @shahmilsaari/memory-core dashboard --port 5178
|
|
357
|
+
npx @shahmilsaari/memory-core dashboard --path src/
|
|
358
|
+
npx @shahmilsaari/memory-core dashboard --no-watch
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Starts a local Svelte dashboard at `http://localhost:5178` by default. The dashboard includes:
|
|
362
|
+
|
|
363
|
+
- WebSocket live feed for `watch` events
|
|
364
|
+
- terminal-style violation details with file, line, rule, reason, issue, fix, and code context
|
|
365
|
+
- PostgreSQL connection status, database name, host, and redacted URL
|
|
366
|
+
- code-checking model status, resolved Ollama model, embedding model, and provider
|
|
367
|
+
- architecture-aware rule browser filtered to the project initialized during `init`
|
|
368
|
+
- stats for most violated rules and files
|
|
369
|
+
- live reload for `.env`, `.memory-core.env`, `.memory-core.json`, and `.memory-core-stats.json`
|
|
370
|
+
|
|
371
|
+
The WebSocket endpoint is local: `ws://localhost:5178/ws`. Runtime config changes are reloaded and pushed to the browser without restarting the dashboard after the dashboard process is running.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
315
375
|
### `check` — Manual check (for CI)
|
|
316
376
|
|
|
317
377
|
```bash
|
|
318
378
|
npx @shahmilsaari/memory-core check --staged # check staged files
|
|
319
379
|
npx @shahmilsaari/memory-core check --staged --verbose # with extra detail
|
|
380
|
+
npx @shahmilsaari/memory-core check --staged --debug # show prompt, diff, and raw model output
|
|
381
|
+
npx @shahmilsaari/memory-core check --ci # CI mode using memories.json
|
|
320
382
|
```
|
|
321
383
|
|
|
322
|
-
|
|
384
|
+
`--staged` is the same path used by the pre-commit hook. `--ci` reads `memories.json` and uses a deterministic CI-friendly diff check, so pull requests can enforce rules without a local database or Ollama setup.
|
|
323
385
|
|
|
324
386
|
---
|
|
325
387
|
|
|
@@ -398,19 +460,41 @@ npx @shahmilsaari/memory-core list --limit 50
|
|
|
398
460
|
|
|
399
461
|
```bash
|
|
400
462
|
npx @shahmilsaari/memory-core remove <id>
|
|
463
|
+
npx @shahmilsaari/memory-core remove <id> --no-sync
|
|
401
464
|
```
|
|
402
465
|
|
|
403
466
|
Deletes a memory by its ID. Get the ID from `list` or `search`.
|
|
404
467
|
|
|
405
468
|
---
|
|
406
469
|
|
|
470
|
+
### `forget` — Bulk-delete memories
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
npx @shahmilsaari/memory-core forget --tag nextjs --scope global
|
|
474
|
+
npx @shahmilsaari/memory-core forget --type ignore
|
|
475
|
+
npx @shahmilsaari/memory-core forget --arch nuxt
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
Deletes memories by filter. At least one filter is required, so an empty `forget` command cannot wipe the database by accident.
|
|
479
|
+
|
|
480
|
+
| Flag | What it does |
|
|
481
|
+
|---|---|
|
|
482
|
+
| `--tag <tag>` | Delete memories with a tag |
|
|
483
|
+
| `--scope <scope>` | Filter by scope: `global` `project` |
|
|
484
|
+
| `--type <type>` | Filter by type |
|
|
485
|
+
| `--arch <architecture>` | Filter by architecture profile |
|
|
486
|
+
| `--no-sync` | Skip automatic agent file regeneration |
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
407
490
|
### `edit` — Edit a memory
|
|
408
491
|
|
|
409
492
|
```bash
|
|
410
493
|
npx @shahmilsaari/memory-core edit <id>
|
|
494
|
+
npx @shahmilsaari/memory-core edit <id> --no-sync
|
|
411
495
|
```
|
|
412
496
|
|
|
413
|
-
Opens the memory interactively so you can update its content, reason, tags, type, or scope.
|
|
497
|
+
Opens the memory interactively so you can update its content, reason, structured context, tags, type, or scope.
|
|
414
498
|
|
|
415
499
|
---
|
|
416
500
|
|
|
@@ -431,6 +515,7 @@ Exports all memories from the database to `memories.json` in the project root (o
|
|
|
431
515
|
npx @shahmilsaari/memory-core import
|
|
432
516
|
npx @shahmilsaari/memory-core import --file path/to/my-rules.json
|
|
433
517
|
npx @shahmilsaari/memory-core import --url https://example.com/team-rules.json
|
|
518
|
+
npx @shahmilsaari/memory-core import --no-sync
|
|
434
519
|
```
|
|
435
520
|
|
|
436
521
|
Imports memories into the local database. Skips duplicates by content hash — safe to run more than once.
|
|
@@ -439,6 +524,7 @@ Imports memories into the local database. Skips duplicates by content hash — s
|
|
|
439
524
|
|---|---|
|
|
440
525
|
| `--file <path>` | Import from a custom local file path |
|
|
441
526
|
| `--url <url>` | Import from a remote URL |
|
|
527
|
+
| `--no-sync` | Skip automatic agent file regeneration |
|
|
442
528
|
|
|
443
529
|
---
|
|
444
530
|
|
|
@@ -453,17 +539,30 @@ Saves a pattern so the hook and watcher never flag it again. Useful for intentio
|
|
|
453
539
|
```bash
|
|
454
540
|
npx @shahmilsaari/memory-core ignore --list # show all saved ignore patterns
|
|
455
541
|
npx @shahmilsaari/memory-core ignore --remove <id> # delete an ignore pattern
|
|
542
|
+
npx @shahmilsaari/memory-core ignore "..." --no-sync # save without regenerating agent files
|
|
456
543
|
```
|
|
457
544
|
|
|
458
545
|
---
|
|
459
546
|
|
|
547
|
+
### `allow` — Allow intentional project patterns
|
|
548
|
+
|
|
549
|
+
```bash
|
|
550
|
+
npx @shahmilsaari/memory-core allow "generated by sqlc"
|
|
551
|
+
npx @shahmilsaari/memory-core allow --list
|
|
552
|
+
npx @shahmilsaari/memory-core allow --remove "generated by sqlc"
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
Stores lightweight per-project allowlist strings in `.memory-core.json`. Hook and watch checks treat these patterns as intentional before surfacing violations.
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
460
559
|
### `ci-setup` — GitHub Actions integration
|
|
461
560
|
|
|
462
561
|
```bash
|
|
463
562
|
npx @shahmilsaari/memory-core ci-setup
|
|
464
563
|
```
|
|
465
564
|
|
|
466
|
-
Generates `.github/workflows/memory-core.yml`. Adds a PR check that runs
|
|
565
|
+
Generates `.github/workflows/memory-core.yml`. Adds a PR check that runs `npx @shahmilsaari/memory-core check --ci`, using `memories.json` so CI can enforce architecture rules without a project-local database.
|
|
467
566
|
|
|
468
567
|
---
|
|
469
568
|
|
|
@@ -477,15 +576,36 @@ Shows which rules fire most often and which files have the most violations. Usef
|
|
|
477
576
|
|
|
478
577
|
---
|
|
479
578
|
|
|
480
|
-
### `reset`
|
|
579
|
+
### `reset` vs `uninstall` — Cleanup commands
|
|
580
|
+
|
|
581
|
+
Use `reset` when you want to keep using memory-core but need to regenerate or reinitialize project files. Use `uninstall` when you want memory-core removed from the current project.
|
|
582
|
+
|
|
583
|
+
| Command | User intent | What it removes | Database |
|
|
584
|
+
|---|---|---|---|
|
|
585
|
+
| `reset --soft` | Regenerate agent files from a clean slate | Generated agent files only | Kept |
|
|
586
|
+
| `reset` | Reinitialize memory-core in this project | Generated agent files, `.memory-core.json`, hook | Kept |
|
|
587
|
+
| `reset --db` | Reinitialize and clear stored memories | Same as `reset` | Drops `memories` after confirmation |
|
|
588
|
+
| `uninstall` | Remove memory-core from this project | Generated files, config/env/state, CI workflow, hook, `.gitignore` block | Kept |
|
|
589
|
+
| `uninstall --db` | Remove project footprint and stored memory table | Same as `uninstall` | Drops `memories` after confirmation |
|
|
590
|
+
|
|
591
|
+
### `reset` — Reinitialize generated files
|
|
481
592
|
|
|
482
593
|
```bash
|
|
483
|
-
npx @shahmilsaari/memory-core reset # remove
|
|
594
|
+
npx @shahmilsaari/memory-core reset # remove generated files + .memory-core.json + hook
|
|
484
595
|
npx @shahmilsaari/memory-core reset --soft # keep config and DB, remove only generated files
|
|
485
596
|
npx @shahmilsaari/memory-core reset --db # also drop the memories table from the database
|
|
486
597
|
```
|
|
487
598
|
|
|
488
|
-
|
|
599
|
+
Use this when memory-core should stay part of the project, but generated files need to be rebuilt or the project config should be recreated. Use `--soft` for the safest regeneration path.
|
|
600
|
+
|
|
601
|
+
### `uninstall` — Remove memory-core from a project
|
|
602
|
+
|
|
603
|
+
```bash
|
|
604
|
+
npx @shahmilsaari/memory-core uninstall # remove generated files, config, env, hook, stats, and gitignore block
|
|
605
|
+
npx @shahmilsaari/memory-core uninstall --db # also drop the memories table after confirmation
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
Use this when you want the project back to a pre-memory-core state. Database deletion is opt-in and only happens with `--db`.
|
|
489
609
|
|
|
490
610
|
---
|
|
491
611
|
|
|
@@ -595,6 +715,9 @@ npx @shahmilsaari/memory-core search "caching strategy"
|
|
|
595
715
|
# Inspect current setup, provider, model, and health checks
|
|
596
716
|
npx @shahmilsaari/memory-core status
|
|
597
717
|
|
|
718
|
+
# Open the local command center with live watch/config updates
|
|
719
|
+
npx @shahmilsaari/memory-core dashboard
|
|
720
|
+
|
|
598
721
|
# Switch code-checking provider or model without rerunning init
|
|
599
722
|
npx @shahmilsaari/memory-core provider set openai --model gpt-4o-mini --api-key $OPENAI_API_KEY
|
|
600
723
|
npx @shahmilsaari/memory-core model set qwen2.5-coder --provider ollama
|
|
@@ -709,15 +832,16 @@ npm run smoke:npx
|
|
|
709
832
|
| ✓ | Export / import — portable memories.json for version control and team sharing |
|
|
710
833
|
| ✓ | List / remove / edit — full CRUD for stored memories |
|
|
711
834
|
| ✓ | False positive tagging — `ignore` command saves exceptions for hook and watcher |
|
|
712
|
-
| ✓ |
|
|
835
|
+
| ✓ | Cleanup commands — `reset` regenerates/reinitializes files; `uninstall` removes memory-core from a project |
|
|
713
836
|
| ✓ | Test suite — smoke tests for all core commands and providers |
|
|
714
837
|
| ✓ | Multi-provider code checking — Ollama, OpenAI, Anthropic, MiniMax |
|
|
715
838
|
| ✓ | Context-aware retrieval — surface the most relevant rules for the file being edited |
|
|
716
839
|
| ✓ | Setup management — `status`, `provider set`, `model set`, `model doctor` |
|
|
717
840
|
| ✓ | `--debug` flag — verbose output for diagnosing hook and watcher issues |
|
|
841
|
+
| ✓ | Local Svelte dashboard — WebSocket live feed, runtime status, stats, and architecture-filtered rules |
|
|
842
|
+
| ✓ | Live config reload — dashboard updates when `.env`, `.memory-core.env`, project config, or stats change |
|
|
718
843
|
| | Model guidance during init — recommend a model based on machine specs |
|
|
719
844
|
| | Violation → rule pipeline — auto-suggest a new rule when the same violation repeats |
|
|
720
|
-
| | Rule analytics dashboard — visual breakdown of rule coverage and violations |
|
|
721
845
|
| | Team sync — shared database so the whole team works from the same rule set |
|
|
722
846
|
|
|
723
847
|
---
|