@hir4ta/mneme 0.17.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.
Files changed (43) hide show
  1. package/.claude-plugin/plugin.json +29 -0
  2. package/.mcp.json +18 -0
  3. package/README.ja.md +400 -0
  4. package/README.md +410 -0
  5. package/bin/mneme.js +203 -0
  6. package/dist/lib/db.js +340 -0
  7. package/dist/lib/fuzzy-search.js +214 -0
  8. package/dist/lib/github.js +121 -0
  9. package/dist/lib/similarity.js +193 -0
  10. package/dist/lib/utils.js +62 -0
  11. package/dist/public/apple-touch-icon.png +0 -0
  12. package/dist/public/assets/index-BgqCALAg.css +1 -0
  13. package/dist/public/assets/index-EMvn4VEa.js +330 -0
  14. package/dist/public/assets/react-force-graph-2d-DWoBaKmT.js +46 -0
  15. package/dist/public/favicon-128-max.png +0 -0
  16. package/dist/public/favicon-256-max.png +0 -0
  17. package/dist/public/favicon-32-max.png +0 -0
  18. package/dist/public/favicon-512-max.png +0 -0
  19. package/dist/public/favicon-64-max.png +0 -0
  20. package/dist/public/index.html +15 -0
  21. package/dist/server.js +4791 -0
  22. package/dist/servers/db-server.js +30558 -0
  23. package/dist/servers/search-server.js +30366 -0
  24. package/hooks/default-tags.json +1055 -0
  25. package/hooks/hooks.json +61 -0
  26. package/hooks/post-tool-use.sh +96 -0
  27. package/hooks/pre-compact.sh +187 -0
  28. package/hooks/session-end.sh +567 -0
  29. package/hooks/session-start.sh +380 -0
  30. package/hooks/user-prompt-submit.sh +253 -0
  31. package/package.json +77 -0
  32. package/servers/db-server.ts +993 -0
  33. package/servers/search-server.ts +675 -0
  34. package/skills/AGENTS.override.md +5 -0
  35. package/skills/harvest/skill.md +295 -0
  36. package/skills/init-mneme/skill.md +101 -0
  37. package/skills/plan/skill.md +422 -0
  38. package/skills/report/skill.md +74 -0
  39. package/skills/resume/skill.md +278 -0
  40. package/skills/review/skill.md +419 -0
  41. package/skills/save/skill.md +482 -0
  42. package/skills/search/skill.md +175 -0
  43. package/skills/using-mneme/skill.md +185 -0
@@ -0,0 +1,185 @@
1
+ ---
2
+ name: using-mneme
3
+ description: |
4
+ Guide for using mneme plugin. Auto-loaded at session start to provide context.
5
+ user-invocable: false
6
+ ---
7
+
8
+ # Using mneme
9
+
10
+ mneme is a long-term memory plugin for Claude Code.
11
+
12
+ ## Setup
13
+
14
+ Initialize mneme in your project:
15
+
16
+ ```bash
17
+ # From Claude Code (after /plugin add)
18
+ /init-mneme
19
+
20
+ # Or from terminal
21
+ npx @hir4ta/mneme --init
22
+ ```
23
+
24
+ This creates the `.mneme/` directory with the required structure. mneme will not track sessions until initialized.
25
+
26
+ ## Features
27
+
28
+ 1. **Auto-save interactions**: Conversations auto-saved at session end (jq-based, no Claude needed)
29
+ 2. **Auto memory search**: Related past sessions/decisions automatically injected on each prompt
30
+ 3. **Manual save**: `/mneme:save` for full data extraction (interactions, summary, decisions, patterns, rules)
31
+ 4. **Smart planning**: `/mneme:plan` uses Claude Code's native plan mode with memory search
32
+ 5. **Session resume**: `/mneme:resume` to restore past sessions with chain tracking
33
+ 6. **Knowledge search**: `/mneme:search` to find saved information
34
+ 7. **Rule-based review**: `/mneme:review` for code review based on rules (supports PR URLs)
35
+ 8. **Knowledge harvesting**: `/mneme:harvest` to extract rules/patterns from PR comments
36
+ 9. **Weekly reports**: `/mneme:report` to generate review summary
37
+ 10. **Web dashboard**: Visual management of sessions and decisions
38
+
39
+ ## Core Commands
40
+
41
+ | Command | Description |
42
+ |---------|-------------|
43
+ | `/init-mneme` | Initialize mneme in current project |
44
+ | `/mneme:save` | Save all data: interactions, summary, decisions, patterns, rules |
45
+ | `/mneme:plan [topic]` | Native plan mode + memory search + Socratic questions + design validation |
46
+ | `/mneme:resume [id]` | Resume session (omit ID for list) |
47
+ | `/mneme:search <query>` | Search knowledge |
48
+ | `/mneme:review [--staged\|--all\|--diff=branch\|--full]` | Rule-based review |
49
+ | `/mneme:review <PR URL>` | Review GitHub PR |
50
+ | `/mneme:harvest <PR URL>` | Extract knowledge from PR review comments |
51
+ | `/mneme:report [--from YYYY-MM-DD --to YYYY-MM-DD]` | Weekly review report |
52
+
53
+ ## Session Saving
54
+
55
+ ### Auto-Save (at Session End)
56
+
57
+ **Interactions are auto-saved** by SessionEnd hook to `.mneme/local.db`:
58
+
59
+ ```
60
+ [Session ends] → [SessionEnd hook] → [jq extracts from transcript] → [SQLite updated]
61
+ ```
62
+
63
+ Automatically saved to local.db:
64
+ - User messages
65
+ - Assistant responses (including thinking blocks)
66
+ - Tool usage
67
+ - File changes
68
+
69
+ **Auto-compact handling:** If auto-compact occurred during the session, the SessionEnd hook
70
+ automatically merges `preCompactBackups` with newly extracted interactions to preserve
71
+ the complete conversation history.
72
+
73
+ ### Manual Save (`/mneme:save`)
74
+
75
+ **Run anytime** to save all session data (no need to exit first):
76
+
77
+ | Data | Destination |
78
+ |------|-------------|
79
+ | **Interactions** (conversation history) | local.db |
80
+ | Summary (title, goal, outcome) | sessions/*.json |
81
+ | Discussions → **Decisions** | decisions/*.json |
82
+ | Errors → **Patterns** | patterns/*.json |
83
+ | Dev rules | rules/dev-rules.json |
84
+ | Review guidelines | rules/review-guidelines.json |
85
+
86
+ <phases>
87
+ Execute all phases in order:
88
+ - Phase 0: Master Session (merge child sessions)
89
+ - Phase 1: Interactions (save to local.db)
90
+ - Phase 2: Summary
91
+ - Phase 3: Decisions
92
+ - Phase 4: Patterns
93
+ - Phase 5: Rules (scan for explicit instructions and implicit technical standards)
94
+ </phases>
95
+
96
+ ### Auto Memory Search
97
+
98
+ **On every prompt**, mneme automatically:
99
+ 1. Extracts keywords from your message
100
+ 2. Searches sessions/decisions/patterns/rules
101
+ 3. Injects relevant context to Claude
102
+
103
+ This means past knowledge is always available without manual lookup.
104
+
105
+ ## Recommended Workflow
106
+
107
+ ```
108
+ plan → implement → save → review
109
+ ```
110
+
111
+ 1. **plan**: `/mneme:plan` activates Claude Code's native plan mode
112
+ - Searches past decisions/patterns/rules
113
+ - Explores codebase (read-only)
114
+ - Asks clarifying questions (1 at a time)
115
+ - Presents design in sections for validation
116
+ - Writes design doc to `docs/plans/`
117
+ - Exits plan mode for approval
118
+ 2. **implement**: Follow the approved plan
119
+ 3. **save**: Extract decisions, patterns, rules
120
+ 4. **review**: Verify against plan and code quality
121
+
122
+ ## Dashboard
123
+
124
+ ```bash
125
+ npx @hir4ta/mneme --dashboard
126
+ ```
127
+
128
+ ## Data Location
129
+
130
+ `.mneme/` directory stores all data:
131
+
132
+ ```
133
+ .mneme/
134
+ ├── local.db # SQLite database (interactions - gitignored)
135
+ ├── tags.json # Tag master file
136
+ ├── sessions/ # Session metadata (no interactions)
137
+ │ └── YYYY/MM/
138
+ │ └── {id}.json
139
+ ├── decisions/ # Technical decisions (from /save)
140
+ │ └── YYYY/MM/
141
+ │ └── {id}.json
142
+ ├── patterns/ # Error patterns (from /save)
143
+ │ └── {user}.json
144
+ ├── rules/ # Dev rules / review guidelines
145
+ ├── reviews/ # Review results
146
+ └── reports/ # Weekly reports
147
+ ```
148
+
149
+ **Privacy**: `local.db` is gitignored (private conversations stay local).
150
+
151
+ ## What Gets Saved
152
+
153
+ | Field | Trigger | Destination |
154
+ |-------|---------|-------------|
155
+ | interactions | SessionEnd or /mneme:save | local.db |
156
+ | files | SessionEnd or /mneme:save | sessions/*.json |
157
+ | metrics | SessionEnd or /mneme:save | sessions/*.json |
158
+ | title, tags | /mneme:save | sessions/*.json |
159
+ | summary | /mneme:save | sessions/*.json |
160
+ | discussions → decisions/ | /mneme:save | decisions/*.json |
161
+ | errors → patterns/ | /mneme:save | patterns/*.json |
162
+ | rules/ | /mneme:save | rules/*.json |
163
+ | handoff | /mneme:save | sessions/*.json |
164
+ | references | /mneme:save | sessions/*.json |
165
+
166
+ **Note:** `/mneme:save` saves interactions to local.db immediately - no need to exit first.
167
+
168
+ ## tags.json (Tag Master)
169
+
170
+ Reference when selecting tags:
171
+
172
+ ```json
173
+ {
174
+ "version": 1,
175
+ "tags": [
176
+ {
177
+ "id": "frontend",
178
+ "label": "Frontend",
179
+ "aliases": ["front", "client", "ui"],
180
+ "category": "domain",
181
+ "color": "#3B82F6"
182
+ }
183
+ ]
184
+ }
185
+ ```