gitmem-mcp 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/CHANGELOG.md +47 -0
- package/CLAUDE.md.template +65 -0
- package/LICENSE +21 -0
- package/README.md +221 -0
- package/bin/gitmem.js +383 -0
- package/dist/commands/check.d.ts +33 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +492 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/constants/closing-questions.d.ts +40 -0
- package/dist/constants/closing-questions.d.ts.map +1 -0
- package/dist/constants/closing-questions.js +107 -0
- package/dist/constants/closing-questions.js.map +1 -0
- package/dist/diagnostics/anonymizer.d.ts +55 -0
- package/dist/diagnostics/anonymizer.d.ts.map +1 -0
- package/dist/diagnostics/anonymizer.js +191 -0
- package/dist/diagnostics/anonymizer.js.map +1 -0
- package/dist/diagnostics/channels.d.ts +132 -0
- package/dist/diagnostics/channels.d.ts.map +1 -0
- package/dist/diagnostics/channels.js +150 -0
- package/dist/diagnostics/channels.js.map +1 -0
- package/dist/diagnostics/collector.d.ts +183 -0
- package/dist/diagnostics/collector.d.ts.map +1 -0
- package/dist/diagnostics/collector.js +227 -0
- package/dist/diagnostics/collector.js.map +1 -0
- package/dist/diagnostics/index.d.ts +28 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +31 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/absorb-observations.d.ts +63 -0
- package/dist/schemas/absorb-observations.d.ts.map +1 -0
- package/dist/schemas/absorb-observations.js +25 -0
- package/dist/schemas/absorb-observations.js.map +1 -0
- package/dist/schemas/active-sessions.d.ts +71 -0
- package/dist/schemas/active-sessions.d.ts.map +1 -0
- package/dist/schemas/active-sessions.js +19 -0
- package/dist/schemas/active-sessions.js.map +1 -0
- package/dist/schemas/analyze.d.ts +38 -0
- package/dist/schemas/analyze.d.ts.map +1 -0
- package/dist/schemas/analyze.js +30 -0
- package/dist/schemas/analyze.js.map +1 -0
- package/dist/schemas/common.d.ts +55 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +65 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/create-decision.d.ts +48 -0
- package/dist/schemas/create-decision.d.ts.map +1 -0
- package/dist/schemas/create-decision.js +31 -0
- package/dist/schemas/create-decision.js.map +1 -0
- package/dist/schemas/create-learning.d.ts +107 -0
- package/dist/schemas/create-learning.d.ts.map +1 -0
- package/dist/schemas/create-learning.js +64 -0
- package/dist/schemas/create-learning.js.map +1 -0
- package/dist/schemas/get-transcript.d.ts +24 -0
- package/dist/schemas/get-transcript.d.ts.map +1 -0
- package/dist/schemas/get-transcript.js +22 -0
- package/dist/schemas/get-transcript.js.map +1 -0
- package/dist/schemas/index.d.ts +23 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +23 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/log.d.ts +36 -0
- package/dist/schemas/log.d.ts.map +1 -0
- package/dist/schemas/log.js +27 -0
- package/dist/schemas/log.js.map +1 -0
- package/dist/schemas/prepare-context.d.ts +41 -0
- package/dist/schemas/prepare-context.d.ts.map +1 -0
- package/dist/schemas/prepare-context.js +31 -0
- package/dist/schemas/prepare-context.js.map +1 -0
- package/dist/schemas/recall.d.ts +41 -0
- package/dist/schemas/recall.d.ts.map +1 -0
- package/dist/schemas/recall.js +47 -0
- package/dist/schemas/recall.js.map +1 -0
- package/dist/schemas/record-scar-usage-batch.d.ts +82 -0
- package/dist/schemas/record-scar-usage-batch.d.ts.map +1 -0
- package/dist/schemas/record-scar-usage-batch.js +25 -0
- package/dist/schemas/record-scar-usage-batch.js.map +1 -0
- package/dist/schemas/record-scar-usage.d.ts +51 -0
- package/dist/schemas/record-scar-usage.d.ts.map +1 -0
- package/dist/schemas/record-scar-usage.js +32 -0
- package/dist/schemas/record-scar-usage.js.map +1 -0
- package/dist/schemas/save-transcript.d.ts +38 -0
- package/dist/schemas/save-transcript.d.ts.map +1 -0
- package/dist/schemas/save-transcript.js +30 -0
- package/dist/schemas/save-transcript.js.map +1 -0
- package/dist/schemas/search.d.ts +36 -0
- package/dist/schemas/search.d.ts.map +1 -0
- package/dist/schemas/search.js +27 -0
- package/dist/schemas/search.js.map +1 -0
- package/dist/schemas/session-close.d.ts +371 -0
- package/dist/schemas/session-close.d.ts.map +1 -0
- package/dist/schemas/session-close.js +95 -0
- package/dist/schemas/session-close.js.map +1 -0
- package/dist/schemas/session-start.d.ts +46 -0
- package/dist/schemas/session-start.d.ts.map +1 -0
- package/dist/schemas/session-start.js +33 -0
- package/dist/schemas/session-start.js.map +1 -0
- package/dist/schemas/thread.d.ts +72 -0
- package/dist/schemas/thread.d.ts.map +1 -0
- package/dist/schemas/thread.js +39 -0
- package/dist/schemas/thread.js.map +1 -0
- package/dist/server.d.ts +22 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +313 -0
- package/dist/server.js.map +1 -0
- package/dist/services/active-sessions.d.ts +66 -0
- package/dist/services/active-sessions.d.ts.map +1 -0
- package/dist/services/active-sessions.js +311 -0
- package/dist/services/active-sessions.js.map +1 -0
- package/dist/services/agent-detection.d.ts +25 -0
- package/dist/services/agent-detection.d.ts.map +1 -0
- package/dist/services/agent-detection.js +93 -0
- package/dist/services/agent-detection.js.map +1 -0
- package/dist/services/analytics.d.ts +201 -0
- package/dist/services/analytics.d.ts.map +1 -0
- package/dist/services/analytics.js +483 -0
- package/dist/services/analytics.js.map +1 -0
- package/dist/services/cache.d.ts +148 -0
- package/dist/services/cache.d.ts.map +1 -0
- package/dist/services/cache.js +384 -0
- package/dist/services/cache.js.map +1 -0
- package/dist/services/cache.test.d.ts +8 -0
- package/dist/services/cache.test.d.ts.map +1 -0
- package/dist/services/cache.test.js +267 -0
- package/dist/services/cache.test.js.map +1 -0
- package/dist/services/compliance-validator.d.ts +30 -0
- package/dist/services/compliance-validator.d.ts.map +1 -0
- package/dist/services/compliance-validator.js +257 -0
- package/dist/services/compliance-validator.js.map +1 -0
- package/dist/services/config.d.ts +48 -0
- package/dist/services/config.d.ts.map +1 -0
- package/dist/services/config.js +128 -0
- package/dist/services/config.js.map +1 -0
- package/dist/services/embedding.d.ts +58 -0
- package/dist/services/embedding.d.ts.map +1 -0
- package/dist/services/embedding.js +243 -0
- package/dist/services/embedding.js.map +1 -0
- package/dist/services/gitmem-dir.d.ts +38 -0
- package/dist/services/gitmem-dir.d.ts.map +1 -0
- package/dist/services/gitmem-dir.js +84 -0
- package/dist/services/gitmem-dir.js.map +1 -0
- package/dist/services/local-file-storage.d.ts +56 -0
- package/dist/services/local-file-storage.d.ts.map +1 -0
- package/dist/services/local-file-storage.js +213 -0
- package/dist/services/local-file-storage.js.map +1 -0
- package/dist/services/local-vector-search.d.ts +137 -0
- package/dist/services/local-vector-search.d.ts.map +1 -0
- package/dist/services/local-vector-search.js +311 -0
- package/dist/services/local-vector-search.js.map +1 -0
- package/dist/services/metrics.d.ts +104 -0
- package/dist/services/metrics.d.ts.map +1 -0
- package/dist/services/metrics.js +264 -0
- package/dist/services/metrics.js.map +1 -0
- package/dist/services/session-state.d.ts +113 -0
- package/dist/services/session-state.d.ts.map +1 -0
- package/dist/services/session-state.js +203 -0
- package/dist/services/session-state.js.map +1 -0
- package/dist/services/startup.d.ts +112 -0
- package/dist/services/startup.d.ts.map +1 -0
- package/dist/services/startup.js +436 -0
- package/dist/services/startup.js.map +1 -0
- package/dist/services/storage.d.ts +43 -0
- package/dist/services/storage.d.ts.map +1 -0
- package/dist/services/storage.js +92 -0
- package/dist/services/storage.js.map +1 -0
- package/dist/services/supabase-client.d.ts +163 -0
- package/dist/services/supabase-client.d.ts.map +1 -0
- package/dist/services/supabase-client.js +510 -0
- package/dist/services/supabase-client.js.map +1 -0
- package/dist/services/thread-dedup.d.ts +44 -0
- package/dist/services/thread-dedup.d.ts.map +1 -0
- package/dist/services/thread-dedup.js +113 -0
- package/dist/services/thread-dedup.js.map +1 -0
- package/dist/services/thread-manager.d.ts +77 -0
- package/dist/services/thread-manager.d.ts.map +1 -0
- package/dist/services/thread-manager.js +250 -0
- package/dist/services/thread-manager.js.map +1 -0
- package/dist/services/thread-suggestions.d.ts +66 -0
- package/dist/services/thread-suggestions.d.ts.map +1 -0
- package/dist/services/thread-suggestions.js +243 -0
- package/dist/services/thread-suggestions.js.map +1 -0
- package/dist/services/thread-supabase.d.ts +111 -0
- package/dist/services/thread-supabase.d.ts.map +1 -0
- package/dist/services/thread-supabase.js +459 -0
- package/dist/services/thread-supabase.js.map +1 -0
- package/dist/services/thread-vitality.d.ts +65 -0
- package/dist/services/thread-vitality.d.ts.map +1 -0
- package/dist/services/thread-vitality.js +143 -0
- package/dist/services/thread-vitality.js.map +1 -0
- package/dist/services/tier.d.ts +52 -0
- package/dist/services/tier.d.ts.map +1 -0
- package/dist/services/tier.js +109 -0
- package/dist/services/tier.js.map +1 -0
- package/dist/services/timezone.d.ts +37 -0
- package/dist/services/timezone.d.ts.map +1 -0
- package/dist/services/timezone.js +147 -0
- package/dist/services/timezone.js.map +1 -0
- package/dist/services/transcript-chunker.d.ts +18 -0
- package/dist/services/transcript-chunker.d.ts.map +1 -0
- package/dist/services/transcript-chunker.js +237 -0
- package/dist/services/transcript-chunker.js.map +1 -0
- package/dist/services/triple-writer.d.ts +128 -0
- package/dist/services/triple-writer.d.ts.map +1 -0
- package/dist/services/triple-writer.js +338 -0
- package/dist/services/triple-writer.js.map +1 -0
- package/dist/services/variant-assignment.d.ts +92 -0
- package/dist/services/variant-assignment.d.ts.map +1 -0
- package/dist/services/variant-assignment.js +196 -0
- package/dist/services/variant-assignment.js.map +1 -0
- package/dist/tools/absorb-observations.d.ts +16 -0
- package/dist/tools/absorb-observations.d.ts.map +1 -0
- package/dist/tools/absorb-observations.js +82 -0
- package/dist/tools/absorb-observations.js.map +1 -0
- package/dist/tools/analyze.d.ts +55 -0
- package/dist/tools/analyze.d.ts.map +1 -0
- package/dist/tools/analyze.js +139 -0
- package/dist/tools/analyze.js.map +1 -0
- package/dist/tools/cleanup-threads.d.ts +47 -0
- package/dist/tools/cleanup-threads.d.ts.map +1 -0
- package/dist/tools/cleanup-threads.js +127 -0
- package/dist/tools/cleanup-threads.js.map +1 -0
- package/dist/tools/confirm-scars.d.ts +23 -0
- package/dist/tools/confirm-scars.d.ts.map +1 -0
- package/dist/tools/confirm-scars.js +209 -0
- package/dist/tools/confirm-scars.js.map +1 -0
- package/dist/tools/create-decision.d.ts +15 -0
- package/dist/tools/create-decision.d.ts.map +1 -0
- package/dist/tools/create-decision.js +138 -0
- package/dist/tools/create-decision.js.map +1 -0
- package/dist/tools/create-learning.d.ts +15 -0
- package/dist/tools/create-learning.d.ts.map +1 -0
- package/dist/tools/create-learning.js +226 -0
- package/dist/tools/create-learning.js.map +1 -0
- package/dist/tools/create-thread.d.ts +42 -0
- package/dist/tools/create-thread.d.ts.map +1 -0
- package/dist/tools/create-thread.js +180 -0
- package/dist/tools/create-thread.js.map +1 -0
- package/dist/tools/definitions.d.ts +5013 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +2017 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/dismiss-suggestion.d.ts +20 -0
- package/dist/tools/dismiss-suggestion.d.ts.map +1 -0
- package/dist/tools/dismiss-suggestion.js +40 -0
- package/dist/tools/dismiss-suggestion.js.map +1 -0
- package/dist/tools/get-transcript.d.ts +24 -0
- package/dist/tools/get-transcript.d.ts.map +1 -0
- package/dist/tools/get-transcript.js +52 -0
- package/dist/tools/get-transcript.js.map +1 -0
- package/dist/tools/graph-traverse.d.ts +83 -0
- package/dist/tools/graph-traverse.d.ts.map +1 -0
- package/dist/tools/graph-traverse.js +394 -0
- package/dist/tools/graph-traverse.js.map +1 -0
- package/dist/tools/list-threads.d.ts +15 -0
- package/dist/tools/list-threads.d.ts.map +1 -0
- package/dist/tools/list-threads.js +114 -0
- package/dist/tools/list-threads.js.map +1 -0
- package/dist/tools/log.d.ts +43 -0
- package/dist/tools/log.d.ts.map +1 -0
- package/dist/tools/log.js +157 -0
- package/dist/tools/log.js.map +1 -0
- package/dist/tools/prepare-context.d.ts +36 -0
- package/dist/tools/prepare-context.d.ts.map +1 -0
- package/dist/tools/prepare-context.js +353 -0
- package/dist/tools/prepare-context.js.map +1 -0
- package/dist/tools/promote-suggestion.d.ts +25 -0
- package/dist/tools/promote-suggestion.d.ts.map +1 -0
- package/dist/tools/promote-suggestion.js +60 -0
- package/dist/tools/promote-suggestion.js.map +1 -0
- package/dist/tools/recall.d.ts +77 -0
- package/dist/tools/recall.d.ts.map +1 -0
- package/dist/tools/recall.js +423 -0
- package/dist/tools/recall.js.map +1 -0
- package/dist/tools/recall.test.d.ts +5 -0
- package/dist/tools/recall.test.d.ts.map +1 -0
- package/dist/tools/recall.test.js +155 -0
- package/dist/tools/recall.test.js.map +1 -0
- package/dist/tools/record-scar-usage-batch.d.ts +10 -0
- package/dist/tools/record-scar-usage-batch.d.ts.map +1 -0
- package/dist/tools/record-scar-usage-batch.js +153 -0
- package/dist/tools/record-scar-usage-batch.js.map +1 -0
- package/dist/tools/record-scar-usage.d.ts +14 -0
- package/dist/tools/record-scar-usage.d.ts.map +1 -0
- package/dist/tools/record-scar-usage.js +94 -0
- package/dist/tools/record-scar-usage.js.map +1 -0
- package/dist/tools/resolve-thread.d.ts +16 -0
- package/dist/tools/resolve-thread.d.ts.map +1 -0
- package/dist/tools/resolve-thread.js +102 -0
- package/dist/tools/resolve-thread.js.map +1 -0
- package/dist/tools/save-transcript.d.ts +29 -0
- package/dist/tools/save-transcript.d.ts.map +1 -0
- package/dist/tools/save-transcript.js +97 -0
- package/dist/tools/save-transcript.js.map +1 -0
- package/dist/tools/search.d.ts +46 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +186 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/session-close.d.ts +14 -0
- package/dist/tools/session-close.d.ts.map +1 -0
- package/dist/tools/session-close.js +881 -0
- package/dist/tools/session-close.js.map +1 -0
- package/dist/tools/session-start.d.ts +38 -0
- package/dist/tools/session-start.d.ts.map +1 -0
- package/dist/tools/session-start.js +1104 -0
- package/dist/tools/session-start.js.map +1 -0
- package/dist/types/index.d.ts +456 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +76 -0
- package/schema/setup.sql +193 -0
- package/schema/starter-scars.json +206 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to gitmem will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.2.0] - 2026-02-08
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Full monorepo sync**: Standalone repo is now source of truth (Option A — OD-574, GIT-1)
|
|
14
|
+
- **Zod schemas**: 14 schema files for all tool parameter validation (`src/schemas/`)
|
|
15
|
+
- **Diagnostics suite**: Health checks, channel instrumentation, anonymization (`src/diagnostics/`)
|
|
16
|
+
- **Single source of truth constants**: Closing questions defined once (`src/constants/closing-questions.ts`)
|
|
17
|
+
- **Multi-agent tools**: `prepare_context` and `absorb_observations` (GitMem v2 Phase 1-2)
|
|
18
|
+
- **Tool definitions module**: Centralized tool registration (`src/tools/definitions.ts`)
|
|
19
|
+
- **Commands module**: `gitmem check` CLI health diagnostics (`src/commands/check.ts`)
|
|
20
|
+
- **Full test suite**: 354+ unit tests across 20 test files, plus integration, e2e, and performance benchmarks
|
|
21
|
+
- **Vitest configs**: Separate configs for unit, integration, e2e, and performance tests
|
|
22
|
+
- **Compliance validator warnings**: Q3/Q5 substantive answers warn if no learnings created
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **Critical**: GitMem now loads ALL learning types (scars, patterns, wins, anti-patterns) instead of just scars
|
|
26
|
+
- Closing reflection schema now includes Q7 (`institutional_memory_items`) field
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
- `build` script now runs unit tests after compilation (`tsc && npm run test:unit`)
|
|
30
|
+
- Version bumped to 0.2.0 to reflect full feature parity with monorepo
|
|
31
|
+
|
|
32
|
+
## [0.1.0] - 2026-02-03
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
- Initial MCP server implementation
|
|
36
|
+
- Predict tool (scar search with temporal decay)
|
|
37
|
+
- Session lifecycle (session_start, session_close)
|
|
38
|
+
- Learning capture (scars, wins, patterns)
|
|
39
|
+
- Decision logging
|
|
40
|
+
- Scar usage tracking
|
|
41
|
+
- Local vector search with OpenRouter embeddings
|
|
42
|
+
- Cache management (status, flush, health)
|
|
43
|
+
- Agent identity detection
|
|
44
|
+
|
|
45
|
+
[Unreleased]: https://github.com/nTEG-dev/gitmem/compare/v0.2.0...HEAD
|
|
46
|
+
[0.2.0]: https://github.com/nTEG-dev/gitmem/compare/v0.1.0...v0.2.0
|
|
47
|
+
[0.1.0]: https://github.com/nTEG-dev/gitmem/releases/tag/v0.1.0
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# GitMem — Institutional Memory
|
|
2
|
+
|
|
3
|
+
## What is this?
|
|
4
|
+
GitMem gives your AI coding agent persistent memory across sessions. It remembers mistakes (scars), successes (wins), and decisions — so you never repeat the same mistake twice.
|
|
5
|
+
|
|
6
|
+
## Automatic behaviors
|
|
7
|
+
|
|
8
|
+
When working on this project, follow these memory protocols:
|
|
9
|
+
|
|
10
|
+
### Before any task
|
|
11
|
+
- Call `recall` with a brief description of what you're about to do
|
|
12
|
+
- Review any scars that surface — they're warnings from past experience
|
|
13
|
+
- Acknowledge relevant scars before proceeding
|
|
14
|
+
|
|
15
|
+
### At session start
|
|
16
|
+
- Call `session_start` to load context from the last session
|
|
17
|
+
- Review open threads from the previous session
|
|
18
|
+
|
|
19
|
+
### When mistakes happen
|
|
20
|
+
- If something breaks unexpectedly, suggest creating a scar with `create_learning`
|
|
21
|
+
- Include counter-arguments (why someone might think the mistake is OK)
|
|
22
|
+
- Scars need: title, description, severity, and at least 2 counter_arguments
|
|
23
|
+
|
|
24
|
+
### When things go well
|
|
25
|
+
- If a pattern or approach works particularly well, capture it as a win
|
|
26
|
+
- Wins help replicate success across sessions
|
|
27
|
+
|
|
28
|
+
### When making decisions
|
|
29
|
+
- For architectural or significant operational decisions, log them with `create_decision`
|
|
30
|
+
- Include what alternatives were considered and why they were rejected
|
|
31
|
+
|
|
32
|
+
### At session end
|
|
33
|
+
- On "closing", "done for now", or "wrapping up", call `session_close`
|
|
34
|
+
- Reflect on what worked, what broke, and what to do differently
|
|
35
|
+
- Record which scars you applied during the session
|
|
36
|
+
- **Run tests before pushing** — `npm run test:unit` at minimum
|
|
37
|
+
|
|
38
|
+
## Tool quick reference
|
|
39
|
+
|
|
40
|
+
| Tool | Alias | When to use |
|
|
41
|
+
|------|-------|-------------|
|
|
42
|
+
| `recall` | `gitmem-r` | Before any task — check for relevant warnings |
|
|
43
|
+
| `session_start` | `gitmem-ss` | Beginning of session — load context |
|
|
44
|
+
| `session_close` | `gitmem-sc` | End of session — persist learnings |
|
|
45
|
+
| `create_learning` | `gitmem-cl` | After mistakes or successes — capture knowledge |
|
|
46
|
+
| `create_decision` | `gitmem-cd` | When making choices — log the reasoning |
|
|
47
|
+
| `record_scar_usage` | `gitmem-rs` | Track which scars helped |
|
|
48
|
+
| `help` | `gitmem-help` | Show all commands |
|
|
49
|
+
|
|
50
|
+
## Development Commands
|
|
51
|
+
|
|
52
|
+
When contributing to GitMem itself:
|
|
53
|
+
|
|
54
|
+
| Command | Purpose |
|
|
55
|
+
|---------|---------|
|
|
56
|
+
| `npm run build` | Build + run unit tests (fails if tests fail) |
|
|
57
|
+
| `npm run test:unit` | Run Tier 1 unit tests (~2s) |
|
|
58
|
+
| `npm run test:integration` | Run Tier 2 integration tests (requires Docker) |
|
|
59
|
+
| `npm run test:perf` | Run Tier 3 performance benchmarks |
|
|
60
|
+
| `npm run test:e2e` | Run Tier 4 E2E smoke tests (requires Docker) |
|
|
61
|
+
| `npm run test:all` | Run all test tiers |
|
|
62
|
+
| `npx gitmem check` | Quick health check (~5s) |
|
|
63
|
+
| `npx gitmem check --full` | Full diagnostic with benchmarks (~30s) |
|
|
64
|
+
|
|
65
|
+
**Before pushing:** Always run `npm run test:unit` at minimum.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nTEG Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# GitMem
|
|
2
|
+
|
|
3
|
+
Institutional memory for AI coding agents. Never repeat the same mistake.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Predict**: Check institutional memory for relevant learnings before taking action (core GitMem MVP tool)
|
|
8
|
+
- **Session Start**: Initialize session, detect agent identity, load last session context, retrieve relevant learnings, load recent decisions
|
|
9
|
+
- **Session Close**: Persist session with compliance validation (standard/quick/autonomous close types)
|
|
10
|
+
- **Learning Capture**: Create scars, wins, patterns, and anti-patterns in institutional memory
|
|
11
|
+
- **Decision Logging**: Log architectural and operational decisions
|
|
12
|
+
- **Scar Usage Tracking**: Track scar application for effectiveness measurement
|
|
13
|
+
- **[Threads](docs/threads.md)**: Persistent work items that carry across sessions — create, list, resolve
|
|
14
|
+
- **[Doc-Debt Tracking](docs/doc-debt-tracking.md)**: Detect when decisions outpace documentation updates
|
|
15
|
+
|
|
16
|
+
### Learning Types
|
|
17
|
+
|
|
18
|
+
GitMem tracks **all learning types**:
|
|
19
|
+
- **Scars** — Failures to avoid (critical institutional memory)
|
|
20
|
+
- **Patterns** — Neutral observations and recurring patterns
|
|
21
|
+
- **Wins** — Successes to replicate
|
|
22
|
+
- **Anti-patterns** — Known bad approaches
|
|
23
|
+
|
|
24
|
+
All learning types use the same vector search infrastructure and are queried together for comprehensive institutional context.
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
### Free Tier (zero config)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx gitmem init
|
|
32
|
+
npx gitmem configure
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Copy `CLAUDE.md.template` into your project, then start coding — memory is active.
|
|
36
|
+
|
|
37
|
+
### Pro Tier (with Supabase)
|
|
38
|
+
|
|
39
|
+
1. Create a free Supabase project at [database.new](https://database.new)
|
|
40
|
+
2. `npx gitmem setup` — copy the SQL output into Supabase SQL Editor
|
|
41
|
+
3. Get an API key for embeddings (OpenAI, OpenRouter, or Ollama)
|
|
42
|
+
4. `npx gitmem configure` — generates your `.mcp.json` config
|
|
43
|
+
5. `npx gitmem init` — loads starter scars into Supabase
|
|
44
|
+
6. Copy `CLAUDE.md.template` into your project
|
|
45
|
+
7. Start coding — memory is active!
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
### npm (recommended)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install gitmem
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### npx (no install)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx gitmem init
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### MCP Registration
|
|
62
|
+
|
|
63
|
+
Add to your project's `.mcp.json` (Claude Code) or IDE settings (Cursor, Windsurf):
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"gitmem": {
|
|
69
|
+
"command": "npx",
|
|
70
|
+
"args": ["-y", "gitmem"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
For Pro tier, add environment variables:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mcpServers": {
|
|
81
|
+
"gitmem": {
|
|
82
|
+
"command": "npx",
|
|
83
|
+
"args": ["-y", "gitmem"],
|
|
84
|
+
"env": {
|
|
85
|
+
"SUPABASE_URL": "https://your-project.supabase.co",
|
|
86
|
+
"SUPABASE_SERVICE_ROLE_KEY": "eyJ...",
|
|
87
|
+
"OPENAI_API_KEY": "sk-..."
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Verify
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
claude mcp list
|
|
98
|
+
# Should show: gitmem: ✓ Connected
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## CLI Commands
|
|
102
|
+
|
|
103
|
+
| Command | Description |
|
|
104
|
+
|---------|-------------|
|
|
105
|
+
| `gitmem init` | Initialize memory (loads starter scars) |
|
|
106
|
+
| `gitmem setup` | Output SQL for Supabase schema setup |
|
|
107
|
+
| `gitmem configure` | Generate `.mcp.json` config |
|
|
108
|
+
| `gitmem server` | Start MCP server (default) |
|
|
109
|
+
| `gitmem help` | Show help |
|
|
110
|
+
|
|
111
|
+
## MCP Tools
|
|
112
|
+
|
|
113
|
+
### `predict`
|
|
114
|
+
|
|
115
|
+
Check institutional memory for relevant learnings before taking action.
|
|
116
|
+
|
|
117
|
+
**Parameters:**
|
|
118
|
+
- `plan` (required) - What you're about to do (e.g., "deploy to production")
|
|
119
|
+
- `project?` - Project scope (default: "orchestra_dev")
|
|
120
|
+
- `match_count?` - Number of learnings to return (default: 3)
|
|
121
|
+
|
|
122
|
+
### `session_start`
|
|
123
|
+
|
|
124
|
+
Initialize session and load institutional context.
|
|
125
|
+
|
|
126
|
+
**Parameters:**
|
|
127
|
+
- `agent_identity?` - Override agent identity (auto-detects if not provided)
|
|
128
|
+
- `linear_issue?` - Current Linear issue identifier
|
|
129
|
+
- `project?` - Project scope
|
|
130
|
+
|
|
131
|
+
### `session_close`
|
|
132
|
+
|
|
133
|
+
Persist session with compliance validation.
|
|
134
|
+
|
|
135
|
+
**Parameters:**
|
|
136
|
+
- `session_id` (required) - From session_start
|
|
137
|
+
- `close_type` (required) - "standard" | "quick" | "autonomous"
|
|
138
|
+
- `closing_reflection?` - Reflection answers (required for standard)
|
|
139
|
+
- `human_corrections?` - Human additions (required for standard)
|
|
140
|
+
|
|
141
|
+
### `create_learning`
|
|
142
|
+
|
|
143
|
+
Create scar, win, or pattern entry.
|
|
144
|
+
|
|
145
|
+
**Parameters:**
|
|
146
|
+
- `learning_type` (required) - "scar" | "win" | "pattern"
|
|
147
|
+
- `title`, `description` (required)
|
|
148
|
+
- `severity?` - For scars: "critical" | "high" | "medium" | "low"
|
|
149
|
+
- `counter_arguments?` - For scars: min 2 required
|
|
150
|
+
|
|
151
|
+
### `create_decision`
|
|
152
|
+
|
|
153
|
+
Log decision to institutional memory.
|
|
154
|
+
|
|
155
|
+
**Parameters:**
|
|
156
|
+
- `title`, `decision`, `rationale` (required)
|
|
157
|
+
- `alternatives_considered?` - Rejected options
|
|
158
|
+
- `docs_affected?` - Docs/files affected by this decision (relative paths from repo root). Used for [doc-debt tracking](docs/doc-debt-tracking.md).
|
|
159
|
+
- `personas_involved?` - Team personas involved
|
|
160
|
+
- `linear_issue?` - Associated issue
|
|
161
|
+
|
|
162
|
+
### `record_scar_usage`
|
|
163
|
+
|
|
164
|
+
Track scar application.
|
|
165
|
+
|
|
166
|
+
**Parameters:**
|
|
167
|
+
- `scar_id` (required) - Learning UUID
|
|
168
|
+
- `reference_type` (required) - "explicit" | "implicit" | "acknowledged" | "refuted" | "none"
|
|
169
|
+
- `reference_context` (required) - How scar was applied
|
|
170
|
+
|
|
171
|
+
### `list_threads`
|
|
172
|
+
|
|
173
|
+
List open threads (persistent work items across sessions). See [threads docs](docs/threads.md).
|
|
174
|
+
|
|
175
|
+
**Parameters:**
|
|
176
|
+
- `status?` - Filter: "open" (default) or "resolved"
|
|
177
|
+
- `include_resolved?` - Include recently resolved threads
|
|
178
|
+
|
|
179
|
+
### `create_thread`
|
|
180
|
+
|
|
181
|
+
Create a new open thread.
|
|
182
|
+
|
|
183
|
+
**Parameters:**
|
|
184
|
+
- `text` (required) - Thread description
|
|
185
|
+
|
|
186
|
+
### `resolve_thread`
|
|
187
|
+
|
|
188
|
+
Mark a thread as resolved.
|
|
189
|
+
|
|
190
|
+
**Parameters:**
|
|
191
|
+
- `thread_id?` - Exact thread ID (e.g., "t-a1b2c3d4")
|
|
192
|
+
- `text_match?` - Case-insensitive substring match
|
|
193
|
+
- `resolution_note?` - Brief resolution explanation
|
|
194
|
+
|
|
195
|
+
## Agent Detection
|
|
196
|
+
|
|
197
|
+
Automatically detects agent identity based on:
|
|
198
|
+
- `CLAUDE_CODE_ENTRYPOINT` environment variable
|
|
199
|
+
- Docker container presence (`/.dockerenv`)
|
|
200
|
+
- Hostname
|
|
201
|
+
|
|
202
|
+
| ENTRYPOINT | Docker | Identity |
|
|
203
|
+
|------------|--------|----------|
|
|
204
|
+
| cli | YES | CLI |
|
|
205
|
+
| cli | NO | CODA-1 |
|
|
206
|
+
| claude-desktop | NO | DAC |
|
|
207
|
+
| (empty) | (has fs) | Brain_Local |
|
|
208
|
+
| (empty) | (no fs) | Brain_Cloud |
|
|
209
|
+
|
|
210
|
+
## Development
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
npm install
|
|
214
|
+
npm run build
|
|
215
|
+
npm run dev # Watch mode
|
|
216
|
+
npm test
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## License
|
|
220
|
+
|
|
221
|
+
MIT
|