@hir4ta/mneme 0.23.2 → 0.24.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 +1 -1
- package/README.ja.md +29 -9
- package/README.md +29 -9
- package/dist/lib/save/index.js +94 -13
- package/dist/lib/search/prompt.js +281 -35
- package/dist/lib/session/finalize.js +104 -18
- package/dist/lib/session/init.js +12 -9
- package/dist/public/assets/index-BL-68Hbg.css +1 -0
- package/dist/public/assets/index-rwYM2mwM.js +382 -0
- package/dist/public/assets/{react-force-graph-2d-B1uwikBG.js → react-force-graph-2d-n2R24ZBV.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/server.js +338 -99
- package/dist/servers/db-server.js +66 -31483
- package/dist/servers/search-server.js +47 -30527
- package/hooks/user-prompt-submit.sh +36 -5
- package/package.json +5 -2
- package/servers/db/save.ts +2 -2
- package/servers/db/session-summary.ts +37 -9
- package/servers/db/tools.ts +6 -5
- package/servers/db/utils.ts +6 -0
- package/servers/db/validate-sources.ts +361 -0
- package/servers/db-server.ts +2 -0
- package/servers/search-server.ts +14 -2
- package/skills/harvest/SKILL.md +3 -3
- package/skills/init-mneme/SKILL.md +11 -85
- package/skills/reflect/SKILL.md +267 -0
- package/skills/report/SKILL.md +42 -1
- package/skills/report/report-template.html +11 -0
- package/skills/save/SKILL.md +19 -7
- package/skills/search/SKILL.md +56 -9
- package/skills/using-mneme/SKILL.md +11 -0
- package/dist/public/assets/index-P9gPhKHo.css +0 -1
- package/dist/public/assets/index-huCa1m_y.js +0 -377
package/skills/harvest/SKILL.md
CHANGED
|
@@ -83,8 +83,8 @@ Use explicit section markers and XML-style tags for hard constraints:
|
|
|
83
83
|
4. Deduplicate/conflict-check against existing sources.
|
|
84
84
|
5. Save source artifacts with `prSource` metadata.
|
|
85
85
|
6. Run source validation gate:
|
|
86
|
-
-
|
|
87
|
-
- If failed: fix artifacts and rerun.
|
|
86
|
+
- Call MCP tool `mneme_validate_sources`
|
|
87
|
+
- If failed (`valid: false`): fix artifacts and rerun.
|
|
88
88
|
7. Regenerate units from sources.
|
|
89
89
|
8. Show pending units for approval.
|
|
90
90
|
|
|
@@ -94,6 +94,6 @@ Use explicit section markers and XML-style tags for hard constraints:
|
|
|
94
94
|
- extracted source item counts by type
|
|
95
95
|
- duplicate/conflict summary
|
|
96
96
|
- priority distribution (`p0/p1/p2` for added/updated rules)
|
|
97
|
-
- validation result (`
|
|
97
|
+
- validation result (`mneme_validate_sources`)
|
|
98
98
|
- regenerated units count
|
|
99
99
|
- pending units count
|
|
@@ -9,99 +9,25 @@ disable-model-invocation: true
|
|
|
9
9
|
# Initialize mneme
|
|
10
10
|
|
|
11
11
|
<instructions>
|
|
12
|
-
|
|
12
|
+
Initialize mneme in the current project by running the CLI command.
|
|
13
13
|
|
|
14
14
|
<required>
|
|
15
15
|
- Never overwrite existing user data under `.mneme/` without explicit confirmation.
|
|
16
|
-
-
|
|
17
|
-
- Ensure `.mneme/local.db` is gitignored.
|
|
16
|
+
- Check if `.mneme` already exists first - if so, inform the user it's already initialized.
|
|
18
17
|
</required>
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
2. Create the directory structure:
|
|
22
|
-
- `.mneme/sessions/`
|
|
23
|
-
- `.mneme/rules/`
|
|
24
|
-
- `.mneme/patterns/`
|
|
25
|
-
- `.mneme/decisions/`
|
|
26
|
-
3. Copy default tags from the plugin's `hooks/default-tags.json` to `.mneme/tags.json`
|
|
27
|
-
4. Create `.mneme/.gitignore` to exclude local database:
|
|
28
|
-
```
|
|
29
|
-
# Local SQLite database (private interactions)
|
|
30
|
-
local.db
|
|
31
|
-
local.db-wal
|
|
32
|
-
local.db-shm
|
|
33
|
-
```
|
|
34
|
-
5. Create empty rules files:
|
|
35
|
-
- `.mneme/rules/dev-rules.json`
|
|
36
|
-
- `.mneme/rules/review-guidelines.json`
|
|
37
|
-
6. Initialize local SQLite database at `.mneme/local.db`
|
|
38
|
-
- Note: Data is stored locally within the project
|
|
39
|
-
- The local.db is gitignored (private interactions)
|
|
19
|
+
Run the following command:
|
|
40
20
|
|
|
41
|
-
Use this JSON template for the rules files:
|
|
42
|
-
```json
|
|
43
|
-
{
|
|
44
|
-
"schemaVersion": 1,
|
|
45
|
-
"createdAt": "<current ISO timestamp>",
|
|
46
|
-
"updatedAt": "<current ISO timestamp>",
|
|
47
|
-
"items": []
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
For SQLite initialization (local database):
|
|
52
21
|
```bash
|
|
53
|
-
|
|
54
|
-
MNEME_DIR=".mneme"
|
|
55
|
-
|
|
56
|
-
# Initialize with schema
|
|
57
|
-
sqlite3 "$MNEME_DIR/local.db" < /path/to/mneme/lib/schema.sql
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Or if schema.sql is not available, create minimal schema:
|
|
61
|
-
```bash
|
|
62
|
-
MNEME_DIR=".mneme"
|
|
63
|
-
|
|
64
|
-
sqlite3 "$MNEME_DIR/local.db" "
|
|
65
|
-
CREATE TABLE IF NOT EXISTS interactions (
|
|
66
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
67
|
-
session_id TEXT NOT NULL,
|
|
68
|
-
project_path TEXT NOT NULL,
|
|
69
|
-
repository TEXT,
|
|
70
|
-
repository_url TEXT,
|
|
71
|
-
repository_root TEXT,
|
|
72
|
-
owner TEXT NOT NULL,
|
|
73
|
-
role TEXT NOT NULL,
|
|
74
|
-
content TEXT NOT NULL,
|
|
75
|
-
thinking TEXT,
|
|
76
|
-
tool_calls TEXT,
|
|
77
|
-
timestamp TEXT NOT NULL,
|
|
78
|
-
is_compact_summary INTEGER DEFAULT 0,
|
|
79
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
80
|
-
);
|
|
81
|
-
CREATE INDEX IF NOT EXISTS idx_interactions_session ON interactions(session_id);
|
|
82
|
-
CREATE INDEX IF NOT EXISTS idx_interactions_owner ON interactions(owner);
|
|
83
|
-
CREATE INDEX IF NOT EXISTS idx_interactions_project ON interactions(project_path);
|
|
84
|
-
CREATE INDEX IF NOT EXISTS idx_interactions_repo ON interactions(repository);
|
|
85
|
-
|
|
86
|
-
CREATE TABLE IF NOT EXISTS pre_compact_backups (
|
|
87
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
88
|
-
session_id TEXT NOT NULL,
|
|
89
|
-
project_path TEXT NOT NULL,
|
|
90
|
-
owner TEXT NOT NULL,
|
|
91
|
-
interactions TEXT NOT NULL,
|
|
92
|
-
created_at TEXT DEFAULT (datetime('now'))
|
|
93
|
-
);
|
|
94
|
-
CREATE INDEX IF NOT EXISTS idx_backups_session ON pre_compact_backups(session_id);
|
|
95
|
-
CREATE INDEX IF NOT EXISTS idx_backups_project ON pre_compact_backups(project_path);
|
|
96
|
-
|
|
97
|
-
CREATE TABLE IF NOT EXISTS migrations (
|
|
98
|
-
project_path TEXT PRIMARY KEY,
|
|
99
|
-
migrated_at TEXT DEFAULT (datetime('now'))
|
|
100
|
-
);
|
|
101
|
-
"
|
|
22
|
+
npx @hir4ta/mneme --init
|
|
102
23
|
```
|
|
103
24
|
|
|
104
|
-
|
|
25
|
+
This single command handles all initialization:
|
|
26
|
+
- Creates `.mneme/` directory structure (sessions, rules, patterns)
|
|
27
|
+
- Copies default tags to `.mneme/tags.json`
|
|
28
|
+
- Creates empty rule files (dev-rules.json, review-guidelines.json)
|
|
29
|
+
- Creates `.gitignore` for local database files
|
|
30
|
+
- Initializes SQLite database at `.mneme/local.db`
|
|
105
31
|
|
|
106
|
-
After
|
|
32
|
+
After the command completes, confirm success and explain that mneme will now track sessions in this project.
|
|
107
33
|
</instructions>
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reflect
|
|
3
|
+
description: |
|
|
4
|
+
Analyze accumulated knowledge to detect patterns, contradictions, and stale items.
|
|
5
|
+
Use when: (1) reviewing knowledge health, (2) finding promotion candidates,
|
|
6
|
+
(3) detecting contradictions between decisions.
|
|
7
|
+
disable-model-invocation: true
|
|
8
|
+
context: fork
|
|
9
|
+
allowed-tools: Read, Glob, Grep, AskUserQuestion
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# /mneme:reflect
|
|
13
|
+
|
|
14
|
+
Analyze accumulated mneme knowledge across sessions, decisions, patterns, and rules. Produce a meta-analysis report identifying recurring themes, contradictions, promotion candidates, stale items, and overall knowledge health.
|
|
15
|
+
|
|
16
|
+
## Language
|
|
17
|
+
|
|
18
|
+
Generate report content in the user's language (detect from conversation context).
|
|
19
|
+
|
|
20
|
+
## Execution Phases
|
|
21
|
+
|
|
22
|
+
### Phase 1: Period Selection
|
|
23
|
+
|
|
24
|
+
Use `AskUserQuestion` to let the user choose the analysis scope:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Question: "分析の対象期間を選択してください"
|
|
28
|
+
Options:
|
|
29
|
+
- "全期間 (Recommended)" -> all data
|
|
30
|
+
- "過去90日" -> 90 days
|
|
31
|
+
- "過去30日" -> 30 days
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Phase 2: Data Collection
|
|
35
|
+
|
|
36
|
+
Read all data from the project's `.mneme/` directory. Filter by period using `createdAt` / `updatedAt` timestamps.
|
|
37
|
+
|
|
38
|
+
**Sessions** -- Read all `.mneme/sessions/YYYY/MM/*.json`:
|
|
39
|
+
```
|
|
40
|
+
Key fields:
|
|
41
|
+
- id, title, tags, createdAt, updatedAt
|
|
42
|
+
- summary.sessionType
|
|
43
|
+
- discussions[].topic, discussions[].decision
|
|
44
|
+
- errors[].error, errors[].solution
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Decisions** -- Read all `.mneme/decisions/YYYY/MM/*.json`:
|
|
48
|
+
```
|
|
49
|
+
Key fields:
|
|
50
|
+
- id, title, decision, reasoning, alternatives[]
|
|
51
|
+
- tags, status (draft/active/superseded/deprecated)
|
|
52
|
+
- createdAt, updatedAt
|
|
53
|
+
- relatedSessions[]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Patterns** -- Read `.mneme/patterns/*.json` (each file has `items[]` or `patterns[]` array):
|
|
57
|
+
```
|
|
58
|
+
Key fields:
|
|
59
|
+
- id, type (good/bad/error-solution), title/description
|
|
60
|
+
- tags, status (draft/active/approved)
|
|
61
|
+
- sourceId, createdAt, updatedAt
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Rules** -- Read `.mneme/rules/dev-rules.json` and `.mneme/rules/review-guidelines.json`:
|
|
65
|
+
```
|
|
66
|
+
Key fields:
|
|
67
|
+
- id, key, text/rule, category, priority (p0/p1/p2)
|
|
68
|
+
- tags, status (draft/approved/active/rejected)
|
|
69
|
+
- sourceRef: { type, id }
|
|
70
|
+
- appliedCount, acceptedCount, lastAppliedAt
|
|
71
|
+
- createdAt, updatedAt
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Tags** -- Read `.mneme/tags.json` for the full tag definitions.
|
|
75
|
+
|
|
76
|
+
### Phase 3: Analysis (5 Categories)
|
|
77
|
+
|
|
78
|
+
Analyze the collected data and produce findings for each category.
|
|
79
|
+
|
|
80
|
+
#### Category 1: Recurring Themes
|
|
81
|
+
|
|
82
|
+
Aggregate tags across ALL artifact types (sessions, decisions, patterns, rules).
|
|
83
|
+
|
|
84
|
+
For tags appearing in 3+ artifacts:
|
|
85
|
+
- Count artifacts per tag, grouped by type
|
|
86
|
+
- Calculate "knowledge density" = (decisions + patterns + rules) / sessions for each tag
|
|
87
|
+
- High density (>0.5) = well-documented topic
|
|
88
|
+
- Low density (<0.2) = frequently worked on but under-documented
|
|
89
|
+
|
|
90
|
+
Output as a table:
|
|
91
|
+
|
|
92
|
+
```markdown
|
|
93
|
+
| Theme (Tags) | Sessions | Decisions | Patterns | Rules | Density |
|
|
94
|
+
|---|---|---|---|---|---|
|
|
95
|
+
| auth | 5 | 2 | 1 | 1 | 0.80 |
|
|
96
|
+
| refactor | 8 | 1 | 1 | 0 | 0.25 |
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Flag low-density topics as candidates for knowledge extraction.
|
|
100
|
+
|
|
101
|
+
#### Category 2: Contradiction Detection
|
|
102
|
+
|
|
103
|
+
Compare active decisions that share the same tags or categories:
|
|
104
|
+
|
|
105
|
+
1. Group active/approved decisions by their primary tags
|
|
106
|
+
2. For each group with 2+ decisions, compare their `decision` and `reasoning` fields
|
|
107
|
+
3. Flag potential contradictions where:
|
|
108
|
+
- Decisions reference the same technology/pattern but reach different conclusions
|
|
109
|
+
- One decision recommends X while another recommends avoiding X
|
|
110
|
+
- Decisions with overlapping `alternatives` where one chose what another rejected
|
|
111
|
+
|
|
112
|
+
<required>
|
|
113
|
+
- Use your judgment as an AI to detect semantic contradictions, not just keyword matches.
|
|
114
|
+
- A contradiction is when two active decisions give conflicting guidance for the same situation.
|
|
115
|
+
- Different decisions for genuinely different contexts are NOT contradictions.
|
|
116
|
+
</required>
|
|
117
|
+
|
|
118
|
+
Output:
|
|
119
|
+
```markdown
|
|
120
|
+
## 2. Potential Contradictions
|
|
121
|
+
|
|
122
|
+
### Found N potential contradiction(s)
|
|
123
|
+
|
|
124
|
+
**[dec-xxx] vs [dec-yyy]**
|
|
125
|
+
- dec-xxx: "Chose A because ..."
|
|
126
|
+
- dec-yyy: "Chose B because ..."
|
|
127
|
+
- Shared tags: [tag1, tag2]
|
|
128
|
+
- Assessment: [Genuine contradiction / Different contexts / Superseded]
|
|
129
|
+
- Recommendation: [Supersede one / Clarify scope / Keep both with context notes]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
If no contradictions found, output: "No contradictions detected among active decisions."
|
|
133
|
+
|
|
134
|
+
#### Category 3: Promotion Candidates
|
|
135
|
+
|
|
136
|
+
Find approved patterns that could be promoted to rules:
|
|
137
|
+
|
|
138
|
+
1. Read all patterns with `status === "approved"` or `status === "active"`
|
|
139
|
+
2. Read all rules and build a set of `sourceRef.id` values
|
|
140
|
+
3. For each approved pattern NOT referenced by any rule's `sourceRef`:
|
|
141
|
+
- Check if it represents a broadly applicable practice (not context-specific)
|
|
142
|
+
- Suggest promotion with a draft rule text
|
|
143
|
+
|
|
144
|
+
Output:
|
|
145
|
+
```markdown
|
|
146
|
+
## 3. Promotion Candidates
|
|
147
|
+
|
|
148
|
+
### Patterns -> Rules
|
|
149
|
+
|
|
150
|
+
- **[pat-xxx]** "{description}"
|
|
151
|
+
- Type: {good/bad/error-solution}
|
|
152
|
+
- Tags: {tags}
|
|
153
|
+
- Suggested rule: "{imperative rule text}"
|
|
154
|
+
- Suggested priority: {p1/p2}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Also check for approved decisions that represent broadly applicable guidance:
|
|
158
|
+
- Decisions where the reasoning applies beyond the original context
|
|
159
|
+
- Decisions referenced by 2+ sessions
|
|
160
|
+
|
|
161
|
+
#### Category 4: Staleness Check
|
|
162
|
+
|
|
163
|
+
Flag potentially outdated knowledge:
|
|
164
|
+
|
|
165
|
+
**Stale Decisions** (createdAt > 90 days ago AND no updatedAt):
|
|
166
|
+
```
|
|
167
|
+
- [dec-xxx] "{title}" - created {N} days ago, never updated
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Unused Rules** (appliedCount === 0 AND createdAt > 30 days ago):
|
|
171
|
+
```
|
|
172
|
+
- [rule-xxx] "{text}" - created {N} days ago, never applied
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Forgotten Drafts** (status === "draft" AND createdAt > 30 days ago):
|
|
176
|
+
```
|
|
177
|
+
- [dec-xxx] "{title}" - draft for {N} days, consider approving or deleting
|
|
178
|
+
- [pat-xxx] "{description}" - draft for {N} days
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Low Effectiveness Rules** (appliedCount > 3 AND acceptedCount/appliedCount < 0.3):
|
|
182
|
+
```
|
|
183
|
+
- [rule-xxx] "{text}" - applied {N} times, accepted only {M} times ({ratio}%)
|
|
184
|
+
Consider revising or deprecating
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
#### Category 5: Knowledge Health Report
|
|
188
|
+
|
|
189
|
+
Generate aggregate metrics:
|
|
190
|
+
|
|
191
|
+
```markdown
|
|
192
|
+
## 5. Knowledge Health
|
|
193
|
+
|
|
194
|
+
### Overview
|
|
195
|
+
| Metric | Count |
|
|
196
|
+
|---|---|
|
|
197
|
+
| Total Sessions | N |
|
|
198
|
+
| Total Decisions | N (active: N, draft: N, superseded: N) |
|
|
199
|
+
| Total Patterns | N (approved: N, draft: N) |
|
|
200
|
+
| Total Rules | N (active: N, draft: N, rejected: N) |
|
|
201
|
+
|
|
202
|
+
### Priority Distribution (Active Rules)
|
|
203
|
+
| Priority | Count | % |
|
|
204
|
+
|---|---|---|
|
|
205
|
+
| p0 (critical) | N | X% |
|
|
206
|
+
| p1 (important) | N | X% |
|
|
207
|
+
| p2 (advisory) | N | X% |
|
|
208
|
+
|
|
209
|
+
### Approval Pipeline
|
|
210
|
+
- Draft -> Approved rate: X% (N/M items)
|
|
211
|
+
- Average age of drafts: N days
|
|
212
|
+
- Oldest unapproved draft: [id] ({N} days)
|
|
213
|
+
|
|
214
|
+
### Tag Coverage
|
|
215
|
+
- Defined tags (in tags.json): N
|
|
216
|
+
- Used tags: N
|
|
217
|
+
- Unused tags: [list]
|
|
218
|
+
|
|
219
|
+
### Rule Effectiveness (active rules with appliedCount > 0)
|
|
220
|
+
- Average acceptance rate: X%
|
|
221
|
+
- Most effective: [rule-xxx] ({ratio}%)
|
|
222
|
+
- Least effective: [rule-xxx] ({ratio}%)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Phase 4: Report Output
|
|
226
|
+
|
|
227
|
+
Output the complete report to the console in Markdown format.
|
|
228
|
+
|
|
229
|
+
Structure:
|
|
230
|
+
```markdown
|
|
231
|
+
# mneme Reflection Report
|
|
232
|
+
|
|
233
|
+
**Project**: {projectName}
|
|
234
|
+
**Period**: {period description}
|
|
235
|
+
**Generated**: {date}
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 1. Recurring Themes
|
|
240
|
+
{Category 1 output}
|
|
241
|
+
|
|
242
|
+
## 2. Potential Contradictions
|
|
243
|
+
{Category 2 output}
|
|
244
|
+
|
|
245
|
+
## 3. Promotion Candidates
|
|
246
|
+
{Category 3 output}
|
|
247
|
+
|
|
248
|
+
## 4. Stale Knowledge
|
|
249
|
+
{Category 4 output}
|
|
250
|
+
|
|
251
|
+
## 5. Knowledge Health
|
|
252
|
+
{Category 5 output}
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Summary & Recommendations
|
|
257
|
+
|
|
258
|
+
{AI-generated 3-5 bullet points with actionable recommendations based on ALL findings above}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Important Notes
|
|
262
|
+
|
|
263
|
+
- This skill is READ-ONLY: do not modify any files
|
|
264
|
+
- Do not access `.mneme/local.db` (SQLite) -- privacy constraint; use only shared JSON files
|
|
265
|
+
- If the project has very few artifacts (< 3 sessions), note this and provide a minimal report
|
|
266
|
+
- Focus on actionable insights, not just raw numbers
|
|
267
|
+
- For contradiction detection, use AI judgment -- don't just pattern-match keywords
|
package/skills/report/SKILL.md
CHANGED
|
@@ -38,7 +38,7 @@ Options:
|
|
|
38
38
|
|
|
39
39
|
Read all data from the project's `.mneme/` directory. Filter by period using `createdAt` / `updatedAt` timestamps.
|
|
40
40
|
|
|
41
|
-
**Sessions** — Read all `.mneme/sessions/YYYY/MM/*.json
|
|
41
|
+
**Sessions** — Read all `.mneme/sessions/YYYY/MM/*.json` (also collect `context.user.name` for team attribution):
|
|
42
42
|
```
|
|
43
43
|
Key fields:
|
|
44
44
|
- title, sessionType, tags, createdAt
|
|
@@ -128,6 +128,46 @@ Get `projectName` and `repository` from any session's `context` field.
|
|
|
128
128
|
4 KPIs: Sessions, Decisions, Patterns, Rule Changes.
|
|
129
129
|
Use `data-type` attribute for color coding.
|
|
130
130
|
|
|
131
|
+
#### Section 2.5: Team Contributions (conditional)
|
|
132
|
+
|
|
133
|
+
**Condition**: Only render this section if there are 2 or more unique users found in session `context.user.name` fields. For solo projects (1 user), skip this section entirely.
|
|
134
|
+
|
|
135
|
+
Collect per-user counts by iterating sessions (`context.user.name`), decisions (`user.name`), and pattern files (filename convention `{user}.json`).
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<section class="section">
|
|
139
|
+
<h2>
|
|
140
|
+
<span data-i18n="teamEn">Team Contributions</span>
|
|
141
|
+
<span data-i18n="teamJa">チーム貢献</span>
|
|
142
|
+
</h2>
|
|
143
|
+
<div class="team-grid">
|
|
144
|
+
<article class="team-card">
|
|
145
|
+
<div class="team-name">{userName}</div>
|
|
146
|
+
<div class="team-stats">
|
|
147
|
+
<span class="team-stat">
|
|
148
|
+
<span class="team-stat-value">{sessionCount}</span>
|
|
149
|
+
<span class="team-stat-label">Sessions</span>
|
|
150
|
+
</span>
|
|
151
|
+
<span class="team-stat">
|
|
152
|
+
<span class="team-stat-value">{decisionCount}</span>
|
|
153
|
+
<span class="team-stat-label">Decisions</span>
|
|
154
|
+
</span>
|
|
155
|
+
<span class="team-stat">
|
|
156
|
+
<span class="team-stat-value">{patternCount}</span>
|
|
157
|
+
<span class="team-stat-label">Patterns</span>
|
|
158
|
+
</span>
|
|
159
|
+
</div>
|
|
160
|
+
<div class="team-bar">
|
|
161
|
+
<div class="team-bar-fill" style="width:{sessionPercentage}%; background: var(--session);"></div>
|
|
162
|
+
</div>
|
|
163
|
+
</article>
|
|
164
|
+
<!-- Repeat for each team member -->
|
|
165
|
+
</div>
|
|
166
|
+
</section>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Sort members by session count descending.
|
|
170
|
+
|
|
131
171
|
#### Section 3: Development Activity Summary (AI-generated)
|
|
132
172
|
|
|
133
173
|
```html
|
|
@@ -147,6 +187,7 @@ Analyze ALL sessions and generate a 3-5 paragraph narrative summary:
|
|
|
147
187
|
- Key outcomes and achievements
|
|
148
188
|
- Notable technical challenges and how they were resolved
|
|
149
189
|
- Trends (e.g., "refactoring was the main focus" or "multiple bug fixes across modules")
|
|
190
|
+
- **Team contributions** (if multiple users): who worked on what, collaboration patterns (same branch/tags), notable individual contributions
|
|
150
191
|
|
|
151
192
|
Write in a style that is informative for junior engineers — explain WHY things were done, not just WHAT.
|
|
152
193
|
Make the summary bilingual using `data-i18n-item="en"` / `data-i18n-item="ja"` spans.
|
|
@@ -64,6 +64,17 @@
|
|
|
64
64
|
.kpi .label { color: var(--ink-subtle); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
|
|
65
65
|
.kpi .value { font-size: 30px; font-weight: 700; margin-top: 6px; }
|
|
66
66
|
|
|
67
|
+
/* Team Contributions */
|
|
68
|
+
.team-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
|
|
69
|
+
.team-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 2px 8px var(--shadow); }
|
|
70
|
+
.team-name { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
|
|
71
|
+
.team-stats { display: flex; gap: 12px; }
|
|
72
|
+
.team-stat { display: flex; flex-direction: column; align-items: center; }
|
|
73
|
+
.team-stat-value { font-size: 22px; font-weight: 700; }
|
|
74
|
+
.team-stat-label { font-size: 11px; color: var(--ink-subtle); text-transform: uppercase; letter-spacing: 0.06em; }
|
|
75
|
+
.team-bar { height: 6px; background: var(--chip); border-radius: 999px; margin-top: 8px; overflow: hidden; }
|
|
76
|
+
.team-bar-fill { height: 100%; border-radius: 999px; }
|
|
77
|
+
|
|
67
78
|
/* Sections */
|
|
68
79
|
.section { margin-top: 26px; }
|
|
69
80
|
.section h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.01em; }
|
package/skills/save/SKILL.md
CHANGED
|
@@ -60,6 +60,9 @@ Always render missing required fields as blocking errors before write.
|
|
|
60
60
|
|
|
61
61
|
3. **Session summary extraction (required MCP)**
|
|
62
62
|
- Extract from the conversation: `title`, `goal`, `outcome`, `description`, `tags`, `sessionType`.
|
|
63
|
+
- Extract **file and technology context** (critical for search and session recommendations):
|
|
64
|
+
- `filesModified`: files changed during session (path + action: create/edit/delete/rename)
|
|
65
|
+
- `technologies`: technologies, frameworks, and libraries used (e.g., "React", "Hono", "SQLite")
|
|
63
66
|
- Additionally extract **structured context** (data likely lost during auto-compact):
|
|
64
67
|
- `plan`: session goals, task list (completed tasks use `[x] ` prefix), remaining tasks
|
|
65
68
|
- `discussions`: design discussions (topic, decision, reasoning, alternatives)
|
|
@@ -71,7 +74,7 @@ Always render missing required fields as blocking errors before write.
|
|
|
71
74
|
- **Then call `mneme_mark_session_committed`** to finalize the commit.
|
|
72
75
|
|
|
73
76
|
<required>
|
|
74
|
-
- Call `mneme_update_session_summary` with: `claudeSessionId`, `title`, `summary` (`goal`, `outcome`), `tags`, `sessionType`
|
|
77
|
+
- Call `mneme_update_session_summary` with: `claudeSessionId`, `title`, `summary` (`goal`, `outcome`), `tags`, `sessionType`, `filesModified`, `technologies`
|
|
75
78
|
- Call `mneme_mark_session_committed` AFTER `mneme_update_session_summary` succeeds
|
|
76
79
|
- Do NOT skip this step even for short/research sessions
|
|
77
80
|
</required>
|
|
@@ -81,6 +84,17 @@ Always render missing required fields as blocking errors before write.
|
|
|
81
84
|
Auto-compact triggers at ~80% context window usage, replacing older messages with summaries.
|
|
82
85
|
The following data is easily lost in summaries, so save it explicitly as structured data.
|
|
83
86
|
|
|
87
|
+
**filesModified** — always extract when implementation occurred:
|
|
88
|
+
- Extract from tool usage (Read, Edit, Write, Bash) in the conversation
|
|
89
|
+
- Use relative paths from project root
|
|
90
|
+
- Actions: "create" (new file), "edit" (modified), "delete" (removed), "rename" (moved)
|
|
91
|
+
- Exclude: node_modules, dist, .git, lock files
|
|
92
|
+
|
|
93
|
+
**technologies** — always extract:
|
|
94
|
+
- List frameworks, languages, libraries actively used (not just imported)
|
|
95
|
+
- Examples: "TypeScript", "React", "Hono", "SQLite", "Zod", "Tailwind CSS"
|
|
96
|
+
- Keep concise: 3-10 items typical
|
|
97
|
+
|
|
84
98
|
**plan** — when applicable:
|
|
85
99
|
- `goals`: goals set at session start
|
|
86
100
|
- `tasks`: task list. Completed: `[x] task name`, incomplete: `[ ] task name`
|
|
@@ -236,20 +250,18 @@ Recommended controlled tags:
|
|
|
236
250
|
|
|
237
251
|
## Validation gate (must pass)
|
|
238
252
|
|
|
239
|
-
After writing sources and before rule generation,
|
|
253
|
+
After writing sources and before rule generation, call MCP tool:
|
|
240
254
|
|
|
241
|
-
|
|
242
|
-
npm run validate:sources
|
|
243
|
-
```
|
|
255
|
+
`mneme_validate_sources`
|
|
244
256
|
|
|
245
|
-
If validation fails, fix artifacts first, then continue.
|
|
257
|
+
If validation fails (`valid: false`), fix artifacts first, then continue.
|
|
246
258
|
|
|
247
259
|
## Output to user
|
|
248
260
|
|
|
249
261
|
Report at minimum:
|
|
250
262
|
- interactions saved count
|
|
251
263
|
- created/updated counts for decisions/patterns/rules
|
|
252
|
-
- validation result (`
|
|
264
|
+
- validation result (`mneme_validate_sources`)
|
|
253
265
|
- rule linter result (`mneme_rule_linter`)
|
|
254
266
|
- search benchmark result (`mneme_search_eval`)
|
|
255
267
|
- saved decisions/patterns/rules summary
|
package/skills/search/SKILL.md
CHANGED
|
@@ -28,25 +28,53 @@ Search sessions + approved units.
|
|
|
28
28
|
/mneme:search <query> --type unit
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
## Execution
|
|
31
|
+
## Execution — Progressive Disclosure (3-Layer)
|
|
32
|
+
|
|
33
|
+
Use a 3-layer progressive disclosure pattern to minimize token usage:
|
|
34
|
+
|
|
35
|
+
### Layer 1: Compact Index (default)
|
|
36
|
+
|
|
37
|
+
Call `mneme_search` with `detail: "compact"` (default) to get a lightweight index:
|
|
38
|
+
- Returns: `id`, `title`, `score`, `matchedFields`, `tags`, `createdAt`
|
|
39
|
+
- No snippet — ~50 tokens per result
|
|
40
|
+
- Use this to identify relevant results quickly
|
|
41
|
+
|
|
42
|
+
### Layer 2: Summary
|
|
43
|
+
|
|
44
|
+
If more context is needed, call `mneme_search` with `detail: "summary"`:
|
|
45
|
+
- Returns: all Layer 1 fields + `snippet`, `goal`
|
|
46
|
+
- ~150 tokens per result
|
|
47
|
+
|
|
48
|
+
### Layer 3: Full Details
|
|
49
|
+
|
|
50
|
+
For specific items that need deep investigation:
|
|
51
|
+
- `mneme_get_session({ sessionId })` — full session JSON
|
|
52
|
+
- Use only for 1-2 items that are most relevant
|
|
53
|
+
|
|
54
|
+
### Recommended Flow
|
|
32
55
|
|
|
33
56
|
1. Call `mneme_search` with `$ARGUMENTS` as the query (or prompt user if empty).
|
|
34
|
-
2. Show
|
|
35
|
-
3. If
|
|
57
|
+
2. Show compact results (Layer 1).
|
|
58
|
+
3. If user wants more detail on specific items, call Layer 2 or 3.
|
|
59
|
+
4. If response includes `page.nextOffset`, allow paging:
|
|
36
60
|
- next call: `mneme_search({ ..., offset: page.nextOffset })`
|
|
37
|
-
4. If details are needed:
|
|
38
|
-
- `mneme_get_session({ sessionId })`
|
|
39
|
-
- `mneme_get_unit({ unitId })`
|
|
40
61
|
|
|
41
62
|
### MCP examples
|
|
42
63
|
|
|
43
64
|
```typescript
|
|
65
|
+
// Layer 1: Compact (default)
|
|
44
66
|
mneme_search({ query: "JWT auth", limit: 10 })
|
|
45
|
-
mneme_search({ query: "JWT auth",
|
|
67
|
+
mneme_search({ query: "JWT auth", detail: "compact" })
|
|
68
|
+
|
|
69
|
+
// Layer 2: Summary
|
|
70
|
+
mneme_search({ query: "JWT auth", detail: "summary", limit: 10 })
|
|
71
|
+
|
|
72
|
+
// Layer 3: Full details for a specific session
|
|
73
|
+
mneme_get_session({ sessionId: "abc123" })
|
|
74
|
+
|
|
75
|
+
// Pagination
|
|
46
76
|
mneme_search({ query: "JWT auth", limit: 50, offset: 0 })
|
|
47
77
|
mneme_search({ query: "JWT auth", limit: 50, offset: 50 })
|
|
48
|
-
mneme_get_session({ sessionId: "abc123" })
|
|
49
|
-
mneme_get_unit({ unitId: "mc-decision-jwt-auth-001" })
|
|
50
78
|
```
|
|
51
79
|
|
|
52
80
|
## Search targets
|
|
@@ -67,9 +95,28 @@ mneme_get_unit({ unitId: "mc-decision-jwt-auth-001" })
|
|
|
67
95
|
- `tags`
|
|
68
96
|
- `sourceType`
|
|
69
97
|
|
|
98
|
+
## Query construction tips
|
|
99
|
+
|
|
100
|
+
Effective queries use specific technical terms rather than natural language:
|
|
101
|
+
|
|
102
|
+
| Instead of | Use |
|
|
103
|
+
|-----------|-----|
|
|
104
|
+
| "how did we handle auth" | "JWT authentication middleware" |
|
|
105
|
+
| "that error we fixed" | "CORS preflight 403" |
|
|
106
|
+
| "the refactoring we did" | "refactor session-parser" |
|
|
107
|
+
| "what was decided about DB" | "SQLite WAL migration" |
|
|
108
|
+
|
|
109
|
+
Best practices:
|
|
110
|
+
- Use **specific technical terms**: library names, error messages, API names
|
|
111
|
+
- Use **file paths**: component or module names that were modified
|
|
112
|
+
- Use **error text**: paste the exact error message or key portion
|
|
113
|
+
- **Combine terms**: "FTS5 tokenizer unicode61" is better than "search"
|
|
114
|
+
- When the first query returns no results, try **synonyms or related terms**
|
|
115
|
+
|
|
70
116
|
## Notes
|
|
71
117
|
|
|
72
118
|
- If no approved units exist, search will effectively return sessions/interactions only.
|
|
119
|
+
- Stopwords (common English/Japanese words) are automatically removed from queries.
|
|
73
120
|
|
|
74
121
|
## Failure conditions
|
|
75
122
|
|
|
@@ -31,6 +31,17 @@ mneme is a long-term memory plugin for Claude Code.
|
|
|
31
31
|
3. **`/mneme:save`**: writes structured metadata (decisions, patterns, rules).
|
|
32
32
|
4. **SessionEnd**: finalizes session status.
|
|
33
33
|
|
|
34
|
+
## When to proactively search mneme
|
|
35
|
+
|
|
36
|
+
Search mneme (`/mneme:search`) when you encounter these situations during implementation:
|
|
37
|
+
|
|
38
|
+
- **Recurring error**: search with the error message to find past solutions
|
|
39
|
+
- **Design decision**: search with the technical topic to find prior decisions and reasoning
|
|
40
|
+
- **Unfamiliar area**: search with module/file names to find sessions that worked on the same code
|
|
41
|
+
- **Before refactoring**: search to understand historical context and past approaches
|
|
42
|
+
|
|
43
|
+
The `<mneme-context>` block injected on each prompt provides automatic matches, but deeper search with specific technical terms often reveals more relevant context.
|
|
44
|
+
|
|
34
45
|
## Recommended workflow
|
|
35
46
|
|
|
36
47
|
```
|