mema-kit 1.0.2 → 1.0.4
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 +6 -4
- package/docs/guide.md +124 -243
- package/package.json +5 -1
- package/skills/recall/SKILL.md +135 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Memory protocol kit for Claude Code skills. Give any skill persistent, curated m
|
|
|
4
4
|
|
|
5
5
|
**What it does:** A `.mema/` directory in your project stores architecture decisions, requirements, lessons learned, and reusable patterns as curated markdown. Skills automatically load relevant context at the start of each session and save curated knowledge when done.
|
|
6
6
|
|
|
7
|
-
**Key differentiator:** The memory protocol (AUTO-LOAD → WORK → AUTO-SAVE & CURATE → AUTO-INDEX) is a reusable pattern. Any skill you build can plug into it — not just the
|
|
7
|
+
**Key differentiator:** The memory protocol (AUTO-LOAD → WORK → AUTO-SAVE & CURATE → AUTO-INDEX) is a reusable pattern. Any skill you build can plug into it — not just the three that ship with mema-kit.
|
|
8
8
|
|
|
9
9
|
## Quick Start
|
|
10
10
|
|
|
@@ -15,15 +15,19 @@ npx mema-kit
|
|
|
15
15
|
# 2. Open Claude Code and bootstrap memory
|
|
16
16
|
claude
|
|
17
17
|
> /onboard
|
|
18
|
+
|
|
19
|
+
# 3. Next session: load memory into context
|
|
20
|
+
> /recall
|
|
18
21
|
```
|
|
19
22
|
|
|
20
|
-
`/onboard` scans your project, creates the `.mema/` memory structure, populates initial architecture and requirements docs, and configures CLAUDE.md and `.gitignore`.
|
|
23
|
+
`/onboard` scans your project, creates the `.mema/` memory structure, populates initial architecture and requirements docs, and configures CLAUDE.md and `.gitignore`. `/recall` loads that memory into any future session.
|
|
21
24
|
|
|
22
25
|
## Built-in Skills
|
|
23
26
|
|
|
24
27
|
| Command | Purpose |
|
|
25
28
|
|---------|---------|
|
|
26
29
|
| `/onboard` | Bootstrap memory for a project — scans codebase, creates `.mema/`, populates initial knowledge |
|
|
30
|
+
| `/recall` | Load project memory into the current session — instant context on cold start |
|
|
27
31
|
| `/create-skill` | Generate a new memory-aware skill with the correct lifecycle phases |
|
|
28
32
|
|
|
29
33
|
## How Memory Works
|
|
@@ -76,8 +80,6 @@ This creates `.claude/skills/review/SKILL.md` with the full 4-phase memory lifec
|
|
|
76
80
|
- **Standard** (4 phases) — Most skills that read and write memory
|
|
77
81
|
- **Advanced** (4 phases + task management) — Multi-step workflows with archiving
|
|
78
82
|
|
|
79
|
-
See [docs/guide.md](docs/guide.md) for a complete worked example.
|
|
80
|
-
|
|
81
83
|
## Updating
|
|
82
84
|
|
|
83
85
|
```bash
|
package/docs/guide.md
CHANGED
|
@@ -2,327 +2,208 @@
|
|
|
2
2
|
|
|
3
3
|
**A memory protocol kit for Claude Code skills.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Three built-in skills. Persistent memory across sessions. A protocol for building your own.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Why Memory Matters
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
**There's no magic.** Claude Code has a **context window** — everything it "knows" during a conversation. mema-kit works **within** that context window, not outside it.
|
|
11
|
+
Claude Code has a **context window** — everything it "knows" during a conversation. mema-kit works within that window, not outside it.
|
|
14
12
|
|
|
15
13
|
```
|
|
16
|
-
"Load memory"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"Save memory" = Agent uses the Write tool to write .mema/ files
|
|
20
|
-
→ knowledge persists on disk for the next session
|
|
21
|
-
|
|
22
|
-
"Decide what's = Agent reads the short index.md (~20 lines),
|
|
23
|
-
relevant" then chooses which files to Read based on your request
|
|
14
|
+
"Load memory" = Read .mema/ files → contents enter the context window
|
|
15
|
+
"Save memory" = Write .mema/ files → knowledge persists for next session
|
|
16
|
+
"What's relevant" = Read index.md (~20 lines) → choose which files to load
|
|
24
17
|
```
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
**Without mema-kit:** Every new session starts blank. The agent knows nothing about your project. You re-explain everything, or the agent explores your entire codebase (slow, expensive, loads irrelevant files into context).
|
|
19
|
+
**Without mema-kit:** every session starts blank. You re-explain everything, or the agent explores your entire codebase (slow, expensive).
|
|
29
20
|
|
|
30
|
-
**With mema-kit:**
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
Without kit: With kit:
|
|
34
|
-
┌──────────────────────┐ ┌──────────────────────┐
|
|
35
|
-
│ Context Window │ │ Context Window │
|
|
36
|
-
│ │ │ │
|
|
37
|
-
│ CLAUDE.md │ │ CLAUDE.md │
|
|
38
|
-
│ Your message │ │ SKILL.md instructions │
|
|
39
|
-
│ ...nothing else. │ │ Your message │
|
|
40
|
-
│ │ │ index.md (auto-read) │
|
|
41
|
-
│ Agent must explore │ │ architecture.md │
|
|
42
|
-
│ entire codebase │ │ relevant decision.md │
|
|
43
|
-
│ from scratch. │ │ │
|
|
44
|
-
│ ❌ Slow, expensive │ │ Agent starts work │
|
|
45
|
-
│ ❌ Loads irrelevant │ │ with RIGHT context. │
|
|
46
|
-
│ files into context │ │ ✓ Fast, token-lean │
|
|
47
|
-
└──────────────────────┘ └──────────────────────┘
|
|
48
|
-
```
|
|
21
|
+
**With mema-kit:** the agent reads `index.md`, instantly knows your architecture and recent decisions, loads only the 2-3 files relevant to your task, and gets to work.
|
|
49
22
|
|
|
50
|
-
|
|
23
|
+
Think of it like a developer's notebook — it doesn't give you a bigger brain, it gives you the right information faster.
|
|
51
24
|
|
|
52
25
|
---
|
|
53
26
|
|
|
54
|
-
## Quick
|
|
27
|
+
## Quick Start
|
|
55
28
|
|
|
56
29
|
```bash
|
|
57
|
-
|
|
58
|
-
npx mema-kit
|
|
59
|
-
|
|
60
|
-
# 2. Open your project in Claude Code
|
|
61
|
-
cd your-project
|
|
30
|
+
npx mema-kit # install skills to .claude/skills/
|
|
62
31
|
claude
|
|
63
|
-
|
|
64
|
-
#
|
|
65
|
-
/onboard
|
|
32
|
+
> /onboard # scan project, create .mema/, populate initial memory
|
|
33
|
+
> /recall # next new session: load memory into context
|
|
66
34
|
```
|
|
67
35
|
|
|
68
|
-
|
|
36
|
+
`/onboard` reads your package.json, README, directory structure, and representative source files, then writes real content to `architecture.md` and `requirements.md`. Idempotent — safe to re-run.
|
|
69
37
|
|
|
70
|
-
|
|
71
|
-
your-project/
|
|
72
|
-
├── .claude/skills/ # mema-kit skills (2 commands) — committed to git
|
|
73
|
-
│ ├── _memory-protocol.md # Shared curation rules
|
|
74
|
-
│ ├── onboard/SKILL.md # /onboard — bootstrap memory
|
|
75
|
-
│ └── create-skill/SKILL.md # /create-skill — generate new skills
|
|
76
|
-
├── .mema/ # Memory system (auto-managed) — gitignored
|
|
77
|
-
│ ├── _templates/ # Templates for memory files
|
|
78
|
-
│ ├── index.md # Memory map — agent reads this first
|
|
79
|
-
│ ├── project-memory/ # Tech stack, requirements, decisions
|
|
80
|
-
│ ├── task-memory/ # Per-task context, plans, decisions
|
|
81
|
-
│ ├── agent-memory/ # Lessons learned, reusable patterns
|
|
82
|
-
│ └── archive/ # Completed task memories
|
|
83
|
-
├── .gitignore # .mema/ gitignored by /onboard
|
|
84
|
-
└── CLAUDE.md # Memory system conventions
|
|
85
|
-
```
|
|
38
|
+
`/recall` loads your project memory into the current session — use it at the start of every new conversation to restore context instantly.
|
|
86
39
|
|
|
87
40
|
---
|
|
88
41
|
|
|
89
|
-
##
|
|
42
|
+
## Recalling Memory: /recall
|
|
90
43
|
|
|
91
|
-
|
|
44
|
+
Every new Claude Code session starts with a blank context. `/recall` fixes the cold-start problem by reading `.mema/` and printing a formatted summary into the conversation.
|
|
92
45
|
|
|
93
|
-
|
|
94
|
-
You: /onboard
|
|
95
|
-
```
|
|
46
|
+
### Modes
|
|
96
47
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
4. Populates `requirements.md` with discovered project purpose and constraints
|
|
102
|
-
5. Creates starter `lessons.md` and `patterns.md` (with any gotchas found during scanning)
|
|
103
|
-
6. Builds `index.md` pointing to all populated files
|
|
104
|
-
7. Adds memory system section to CLAUDE.md
|
|
105
|
-
8. Adds `.mema/` to `.gitignore`
|
|
48
|
+
| Mode | Command | What you get |
|
|
49
|
+
|------|---------|--------------|
|
|
50
|
+
| **Minimal** (default) | `/recall` or `/recall minimal` | Purpose, stack, architecture, current status, memory map |
|
|
51
|
+
| **Full** | `/recall full` | Everything in Minimal + recent decisions, lessons, patterns, active context & plans |
|
|
106
52
|
|
|
107
|
-
|
|
53
|
+
### When to use which
|
|
108
54
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Project scan results:
|
|
118
|
-
- TypeScript 5.x + Fastify 4.x + PostgreSQL via Drizzle ORM
|
|
119
|
-
- REST API with controller → service → repository layers
|
|
120
|
-
- 4 source directories mapped (src/, tests/, drizzle/, config/)
|
|
121
|
-
- Vitest for testing, pnpm for package management
|
|
122
|
-
|
|
123
|
-
Memory populated:
|
|
124
|
-
- architecture.md — Node.js + Fastify + PostgreSQL + Drizzle stack
|
|
125
|
-
- requirements.md — Task management REST API with JWT auth
|
|
126
|
-
- lessons.md — 0 initial lessons
|
|
127
|
-
- patterns.md — 0 initial patterns
|
|
128
|
-
```
|
|
55
|
+
| Situation | Mode |
|
|
56
|
+
|-----------|------|
|
|
57
|
+
| Starting a new session, need quick context | Minimal |
|
|
58
|
+
| Picking up a multi-day task | Full |
|
|
59
|
+
| Onboarding a teammate to the project | Full |
|
|
60
|
+
| Quick check on what decisions exist | Full |
|
|
61
|
+
| Daily development work | Minimal |
|
|
129
62
|
|
|
130
|
-
|
|
63
|
+
`/recall` is **read-only** — it never modifies memory files. Safe to run at any time.
|
|
131
64
|
|
|
132
65
|
---
|
|
133
66
|
|
|
134
|
-
##
|
|
67
|
+
## Example: Building a Spec-Driven Dev Workflow
|
|
135
68
|
|
|
136
|
-
|
|
69
|
+
mema-kit ships with `/onboard` and `/create-skill`. Everything else you build yourself. Here's how to create a 3-skill workflow: **explore → plan → implement**.
|
|
70
|
+
|
|
71
|
+
### Step 1: Create `/explore`
|
|
137
72
|
|
|
138
73
|
```
|
|
139
|
-
|
|
74
|
+
> /create-skill
|
|
75
|
+
Name: explore
|
|
76
|
+
Purpose: Research technical decisions and save findings
|
|
77
|
+
Complexity: standard
|
|
140
78
|
```
|
|
141
79
|
|
|
142
|
-
|
|
80
|
+
Creates `.claude/skills/explore/SKILL.md` — a 4-phase skill that loads existing architecture and decisions, helps you research options, then saves new decisions and context to `.mema/`.
|
|
143
81
|
|
|
144
|
-
|
|
82
|
+
**Using it:**
|
|
145
83
|
|
|
146
84
|
```
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
Agent: What should this skill be called?
|
|
150
|
-
You: review
|
|
151
|
-
|
|
152
|
-
Agent: What does /review do?
|
|
153
|
-
You: Reviews code changes for quality, consistency with project patterns, and potential issues.
|
|
154
|
-
|
|
155
|
-
Agent: Memory needs — should /review read memory, write memory, or both?
|
|
156
|
-
Default is both (read architecture + patterns, save new lessons).
|
|
157
|
-
You: both is good
|
|
158
|
-
|
|
159
|
-
Agent: Complexity level?
|
|
160
|
-
- Simple (3 phases) — read-only, no memory writes
|
|
161
|
-
- Standard (4 phases) — read + write memory [default]
|
|
162
|
-
- Advanced (4 phases + task management)
|
|
163
|
-
You: standard
|
|
85
|
+
> /explore what auth strategy should we use?
|
|
164
86
|
```
|
|
165
87
|
|
|
166
|
-
|
|
88
|
+
The agent loads your stack from memory, researches JWT vs sessions vs OAuth, and saves the decision:
|
|
167
89
|
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
# /review — Code Review
|
|
174
|
-
|
|
175
|
-
You are executing the /review skill. Follow these steps carefully.
|
|
90
|
+
```
|
|
91
|
+
.mema/project-memory/decisions/2026-02-24-auth-strategy.md
|
|
92
|
+
→ "JWT with refresh tokens. Why: stateless, fits our REST API, team has experience."
|
|
93
|
+
```
|
|
176
94
|
|
|
177
|
-
|
|
178
|
-
1. Read `.mema/index.md` to understand current project state
|
|
179
|
-
2. If `index.md` is missing or empty, run the Rebuild Procedure from `_memory-protocol.md`
|
|
180
|
-
3. Based on the user's request, identify and read relevant memory files
|
|
181
|
-
4. Read only what's needed — don't load everything
|
|
95
|
+
Next session, any skill that loads memory will know this decision exists.
|
|
182
96
|
|
|
183
|
-
|
|
184
|
-
- `project-memory/architecture.md` — for technical context
|
|
185
|
-
- `project-memory/decisions/` — for past decisions related to this work
|
|
186
|
-
- `agent-memory/lessons.md` — for mistakes to avoid
|
|
187
|
-
- `agent-memory/patterns.md` — for reusable approaches
|
|
97
|
+
### Step 2: Create `/plan`
|
|
188
98
|
|
|
189
|
-
|
|
190
|
-
|
|
99
|
+
```
|
|
100
|
+
> /create-skill
|
|
101
|
+
Name: plan
|
|
102
|
+
Purpose: Generate implementation plans from exploration findings
|
|
103
|
+
Complexity: standard
|
|
104
|
+
```
|
|
191
105
|
|
|
192
|
-
|
|
193
|
-
[Save any new lessons or patterns discovered during review...]
|
|
106
|
+
**Using it:**
|
|
194
107
|
|
|
195
|
-
## Phase 4: AUTO-INDEX
|
|
196
|
-
[Update index.md to reflect changes...]
|
|
197
108
|
```
|
|
109
|
+
> /plan plan the user auth endpoints
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The agent loads the auth decision from Step 1, architecture, and requirements — then writes a step-by-step plan to `.mema/task-memory/user-auth/plan.md`.
|
|
198
113
|
|
|
199
|
-
|
|
114
|
+
### Step 3: Create `/implement`
|
|
200
115
|
|
|
201
116
|
```
|
|
202
|
-
|
|
117
|
+
> /create-skill
|
|
118
|
+
Name: implement
|
|
119
|
+
Purpose: Implement code following a plan, run tests, save lessons
|
|
120
|
+
Complexity: advanced
|
|
203
121
|
```
|
|
204
122
|
|
|
205
|
-
|
|
123
|
+
Advanced complexity adds task tracking and archiving. When the task is done, the agent moves task files to `archive/` and records any lessons learned.
|
|
206
124
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
## The Memory Protocol in Depth
|
|
125
|
+
**Using it:**
|
|
210
126
|
|
|
211
|
-
|
|
127
|
+
```
|
|
128
|
+
> /implement implement user auth endpoints
|
|
129
|
+
```
|
|
212
130
|
|
|
213
|
-
|
|
131
|
+
The agent loads the plan, architecture, and past lessons. It implements each step, runs tests, and when done:
|
|
214
132
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
4. If `index.md` is missing, rebuild it from the `.mema/` directory structure
|
|
133
|
+
- Saves "Drizzle needs explicit type casting for enums" to `lessons.md`
|
|
134
|
+
- Archives `task-memory/user-auth/` to `archive/user-auth/`
|
|
135
|
+
- Updates `index.md`
|
|
219
136
|
|
|
220
|
-
|
|
137
|
+
### How Memory Flows Between Skills
|
|
221
138
|
|
|
222
|
-
|
|
139
|
+
```
|
|
140
|
+
/explore /plan /implement
|
|
141
|
+
│ │ │
|
|
142
|
+
├─ reads: ├─ reads: ├─ reads:
|
|
143
|
+
│ architecture │ architecture │ plan
|
|
144
|
+
│ requirements │ decisions │ lessons
|
|
145
|
+
│ │ context │ patterns
|
|
146
|
+
├─ writes: ├─ writes: │
|
|
147
|
+
│ decisions │ plan ├─ writes:
|
|
148
|
+
│ context │ status │ lessons
|
|
149
|
+
│ │ │ patterns
|
|
150
|
+
│ │ │ status → archive
|
|
151
|
+
▼ ▼ ▼
|
|
152
|
+
all flow through .mema/index.md
|
|
153
|
+
```
|
|
223
154
|
|
|
224
|
-
|
|
155
|
+
Each skill reads what previous skills wrote. The index ties it all together.
|
|
225
156
|
|
|
226
|
-
|
|
157
|
+
> **Tip:** Start every new session with `/recall` to load project context before using other skills. It takes seconds and saves minutes of re-exploration.
|
|
227
158
|
|
|
228
|
-
|
|
159
|
+
---
|
|
229
160
|
|
|
230
|
-
|
|
231
|
-
|--------|------------|
|
|
232
|
-
| **ADD** | New knowledge that doesn't exist yet (new decision, finding, lesson, pattern) |
|
|
233
|
-
| **UPDATE** | Existing knowledge that has changed (refined reasoning, adjusted plan, new example) |
|
|
234
|
-
| **DELETE** | Knowledge that is wrong, superseded, or irrelevant (dead-end exploration, duplicate info) |
|
|
235
|
-
| **NOOP** | Still accurate and relevant — leave unchanged (most files, most of the time) |
|
|
161
|
+
## The Memory Protocol
|
|
236
162
|
|
|
237
|
-
|
|
163
|
+
Every skill follows four phases, defined in `_memory-protocol.md`:
|
|
238
164
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
- **
|
|
242
|
-
|
|
165
|
+
**1. AUTO-LOAD** — Read `index.md`, load relevant files only
|
|
166
|
+
**2. WORK** — Do the skill's job with loaded context
|
|
167
|
+
**3. AUTO-SAVE & CURATE** — For each piece of knowledge: ADD, UPDATE, DELETE, or NOOP
|
|
168
|
+
**4. AUTO-INDEX** — Update `index.md` to reflect changes
|
|
243
169
|
|
|
244
|
-
###
|
|
170
|
+
### Curation Rules
|
|
245
171
|
|
|
246
|
-
|
|
172
|
+
| Action | When |
|
|
173
|
+
|--------|------|
|
|
174
|
+
| **ADD** | New decision, finding, lesson, or pattern |
|
|
175
|
+
| **UPDATE** | Existing knowledge changed (refined reasoning, new example) |
|
|
176
|
+
| **DELETE** | Wrong, superseded, or redundant |
|
|
177
|
+
| **NOOP** | Still accurate — leave it alone (most files, most of the time) |
|
|
247
178
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
179
|
+
Different file types have different curation styles:
|
|
180
|
+
- **Decisions** — conservative (rarely delete, even reversed decisions teach)
|
|
181
|
+
- **Context** — aggressive (prune dead ends, consolidate overlaps)
|
|
182
|
+
- **Plans** — replace (keep final version only)
|
|
183
|
+
- **Lessons/Patterns** — consolidate (merge similar entries)
|
|
252
184
|
|
|
253
185
|
---
|
|
254
186
|
|
|
255
|
-
## Memory Structure
|
|
187
|
+
## Memory Structure
|
|
256
188
|
|
|
257
189
|
```
|
|
258
190
|
.mema/
|
|
259
|
-
├──
|
|
260
|
-
|
|
261
|
-
│
|
|
262
|
-
├──
|
|
263
|
-
|
|
264
|
-
├──
|
|
265
|
-
|
|
266
|
-
│ ├── requirements.md # Purpose, constraints, requirements
|
|
267
|
-
│ └── decisions/ # Individual decision records
|
|
268
|
-
│ ├── 2026-02-23-tech-stack.md
|
|
269
|
-
│ └── 2026-02-23-auth-jwt.md
|
|
270
|
-
│
|
|
271
|
-
├── task-memory/ # Per-task working memory
|
|
272
|
-
│ └── api-setup/
|
|
273
|
-
│ ├── context.md # Research findings
|
|
274
|
-
│ ├── plan.md # Implementation plan
|
|
275
|
-
│ └── status.md # Progress tracking
|
|
276
|
-
│
|
|
277
|
-
├── agent-memory/ # Agent-learned knowledge
|
|
278
|
-
│ ├── lessons.md # Mistakes and surprises
|
|
279
|
-
│ └── patterns.md # Reusable approaches
|
|
280
|
-
│
|
|
281
|
-
└── archive/ # Completed tasks (preserved for reference)
|
|
282
|
-
└── api-setup/
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### Metadata Format
|
|
286
|
-
|
|
287
|
-
Every memory file includes in-body metadata (not YAML frontmatter):
|
|
288
|
-
|
|
289
|
-
```
|
|
290
|
-
**Status:** active | **Updated:** 2026-02-23
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
Status values: `active` (current), `complete` (finished but useful), `archived` (moved to archive/).
|
|
294
|
-
|
|
295
|
-
### Index Format
|
|
296
|
-
|
|
297
|
-
```markdown
|
|
298
|
-
# Memory Index
|
|
299
|
-
|
|
300
|
-
**Updated:** 2026-02-23
|
|
301
|
-
|
|
302
|
-
## Active Tasks
|
|
303
|
-
- `task-memory/api-setup/` — Setting up REST API with Fastify (plan ready, implementing)
|
|
304
|
-
|
|
305
|
-
## Project Knowledge
|
|
306
|
-
- `project-memory/architecture.md` — Node.js + Fastify + PostgreSQL + Drizzle stack
|
|
307
|
-
- `project-memory/requirements.md` — Core requirements and constraints
|
|
308
|
-
|
|
309
|
-
## Recent Decisions
|
|
310
|
-
- `project-memory/decisions/2026-02-23-tech-stack.md` — Chose Fastify + PostgreSQL + Drizzle
|
|
311
|
-
|
|
312
|
-
## Agent Lessons
|
|
313
|
-
- `agent-memory/lessons.md` — 3 lessons recorded
|
|
314
|
-
- `agent-memory/patterns.md` — 2 patterns recorded
|
|
191
|
+
├── index.md # Pointer map — read this first
|
|
192
|
+
├── project-memory/ # Architecture, requirements, decisions
|
|
193
|
+
│ └── decisions/ # YYYY-MM-DD-short-name.md
|
|
194
|
+
├── task-memory/ # Per-task context, plans, status
|
|
195
|
+
├── agent-memory/ # Lessons learned, reusable patterns
|
|
196
|
+
├── archive/ # Completed tasks
|
|
197
|
+
└── _templates/ # File templates
|
|
315
198
|
```
|
|
316
199
|
|
|
317
|
-
The index is a **rebuildable cache** —
|
|
200
|
+
The index is a **rebuildable cache** — if it gets out of sync, the next skill rebuilds it from the directory structure. The actual `.mema/` files are the source of truth.
|
|
318
201
|
|
|
319
202
|
---
|
|
320
203
|
|
|
321
204
|
## Tips
|
|
322
205
|
|
|
323
|
-
- **Memory is just markdown.** Open any
|
|
324
|
-
-
|
|
325
|
-
- **
|
|
326
|
-
-
|
|
327
|
-
- **Any skill can use the protocol.** The memory protocol isn't limited to the two built-in skills. Use `/create-skill` to generate new ones, or manually follow the 4-phase lifecycle in any SKILL.md.
|
|
328
|
-
- **Curate, don't hoard.** The value of memory is in its signal-to-noise ratio. Aggressive pruning of dead-end explorations and consolidation of similar lessons keeps memory useful.
|
|
206
|
+
- **Memory is just markdown.** Open any file to see what the agent knows. Edit directly if something's wrong.
|
|
207
|
+
- **`.mema/` is gitignored by default.** To share decisions with your team, uncomment `!.mema/project-memory/` in `.gitignore`.
|
|
208
|
+
- **Curate, don't hoard.** The value of memory is its signal-to-noise ratio. Prune aggressively.
|
|
209
|
+
- **Any skill can use the protocol.** Use `/create-skill` or manually follow the 4-phase lifecycle.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mema-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Memory protocol kit for Claude Code skills",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mema-kit": "bin/cli.js"
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"agent-memory"
|
|
20
20
|
],
|
|
21
21
|
"license": "MIT",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/simonv15/mema-kit.git"
|
|
25
|
+
},
|
|
22
26
|
"engines": {
|
|
23
27
|
"node": ">=16.7.0"
|
|
24
28
|
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Recall project memory into the current session. Loads .mema/ knowledge (architecture, decisions, lessons, patterns) and prints a formatted summary. Use at the start of a session to restore context.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /recall — Session Memory Recall
|
|
6
|
+
|
|
7
|
+
You are executing the /recall skill. This is a **read-only** skill — it loads memory and prints a summary into the conversation. It never writes to any files.
|
|
8
|
+
|
|
9
|
+
Follow these steps carefully.
|
|
10
|
+
|
|
11
|
+
## Step 1: Determine Mode
|
|
12
|
+
|
|
13
|
+
Parse the user's input to decide which mode to use:
|
|
14
|
+
|
|
15
|
+
- **No arguments** or `minimal` → **Minimal mode** (default) — fast overview of project purpose, stack, and current status
|
|
16
|
+
- `full` → **Full mode** — everything in Minimal plus decisions, lessons, patterns, and active context/plans
|
|
17
|
+
|
|
18
|
+
If the user provides an unrecognized argument (not `minimal`, `full`, or empty):
|
|
19
|
+
1. Warn them: "Unknown argument '[arg]'. Available modes: `minimal` (default), `full`."
|
|
20
|
+
2. Fall back to **Minimal mode** and continue.
|
|
21
|
+
|
|
22
|
+
## Step 2: AUTO-LOAD
|
|
23
|
+
|
|
24
|
+
1. Read `.mema/index.md`
|
|
25
|
+
2. If `index.md` is missing or `.mema/` does not exist:
|
|
26
|
+
- Tell the user: "No memory found. Run `/onboard` first to set up mema-kit for this project."
|
|
27
|
+
- **Stop here** — do not continue to further steps.
|
|
28
|
+
3. Parse the index to identify available memory files and their summaries.
|
|
29
|
+
|
|
30
|
+
## Step 3: Load Project Purpose
|
|
31
|
+
|
|
32
|
+
Read the following files (skip any that don't exist):
|
|
33
|
+
|
|
34
|
+
1. `.mema/project-memory/architecture.md` — extract tech stack, project structure, architecture pattern, and key commands
|
|
35
|
+
2. `.mema/project-memory/requirements.md` — extract project purpose, key requirements, and constraints
|
|
36
|
+
|
|
37
|
+
These form the core context for both Minimal and Full modes.
|
|
38
|
+
|
|
39
|
+
## Step 4: Load Current Status
|
|
40
|
+
|
|
41
|
+
1. Check the `## Active Tasks` section in `index.md`
|
|
42
|
+
2. If there are active tasks listed, read any linked status files (e.g., `task-memory/[task-name]/status.md`)
|
|
43
|
+
3. Note which tasks are in progress, their current step, and any blockers
|
|
44
|
+
|
|
45
|
+
## Step 5: Load Additional Files (Full Mode Only)
|
|
46
|
+
|
|
47
|
+
**Skip this step entirely if in Minimal mode.**
|
|
48
|
+
|
|
49
|
+
In Full mode, also read these files (skip any that don't exist):
|
|
50
|
+
|
|
51
|
+
1. **Recent decisions** — Read files listed under `## Recent Decisions` in `index.md`
|
|
52
|
+
2. **Lessons** — Read `agent-memory/lessons.md`
|
|
53
|
+
3. **Patterns** — Read `agent-memory/patterns.md`
|
|
54
|
+
4. **Active context and plans** — Read any `context.md` and `plan.md` files linked from active tasks in `index.md`
|
|
55
|
+
|
|
56
|
+
Read only files that exist and are listed in the index. Do not scan the directory tree for unlisted files.
|
|
57
|
+
|
|
58
|
+
## Step 6: REPORT
|
|
59
|
+
|
|
60
|
+
Print the memory summary directly into the conversation. **Never write output to a file.**
|
|
61
|
+
|
|
62
|
+
Use the format below based on the current mode.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### Minimal Mode Output
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
## Project Memory (Minimal)
|
|
70
|
+
|
|
71
|
+
### Purpose
|
|
72
|
+
[Project name and what it does — from requirements.md]
|
|
73
|
+
|
|
74
|
+
### Stack & Architecture
|
|
75
|
+
[Tech stack, architecture pattern, key entry points — from architecture.md]
|
|
76
|
+
|
|
77
|
+
### Current Status
|
|
78
|
+
[Active tasks and their progress — from index.md + status files]
|
|
79
|
+
[If no active tasks: "No active tasks."]
|
|
80
|
+
|
|
81
|
+
### Memory Map
|
|
82
|
+
[List each section from index.md with file count, e.g.:]
|
|
83
|
+
- Project Knowledge: [N] files
|
|
84
|
+
- Recent Decisions: [N] decisions
|
|
85
|
+
- Agent Lessons: [N] lessons, [N] patterns
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
*Showing minimal recall. Use `/recall full` for decisions, lessons, and patterns.*
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### Full Mode Output
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
## Project Memory (Full)
|
|
97
|
+
|
|
98
|
+
### Purpose
|
|
99
|
+
[Project name and what it does — from requirements.md]
|
|
100
|
+
|
|
101
|
+
### Stack & Architecture
|
|
102
|
+
[Tech stack, architecture pattern, key entry points — from architecture.md]
|
|
103
|
+
|
|
104
|
+
### Current Status
|
|
105
|
+
[Active tasks and their progress — from index.md + status files]
|
|
106
|
+
[If no active tasks: "No active tasks."]
|
|
107
|
+
|
|
108
|
+
### Recent Decisions
|
|
109
|
+
[For each decision file, list:]
|
|
110
|
+
- **[Decision title]** ([date]) — [one-line summary or key choice made]
|
|
111
|
+
[If no decisions: "No decisions recorded yet."]
|
|
112
|
+
|
|
113
|
+
### Lessons
|
|
114
|
+
[Bullet list of lessons from lessons.md]
|
|
115
|
+
[If no lessons: "No lessons recorded yet."]
|
|
116
|
+
|
|
117
|
+
### Patterns
|
|
118
|
+
[Bullet list of patterns from patterns.md]
|
|
119
|
+
[If no patterns: "No patterns recorded yet."]
|
|
120
|
+
|
|
121
|
+
### Active Context & Plans
|
|
122
|
+
[For each active task, summarize its context and plan]
|
|
123
|
+
[If none: omit this section]
|
|
124
|
+
|
|
125
|
+
### Memory Map
|
|
126
|
+
- Project Knowledge: [N] files
|
|
127
|
+
- Recent Decisions: [N] decisions
|
|
128
|
+
- Agent Lessons: [N] lessons, [N] patterns
|
|
129
|
+
- Active Tasks: [N] tasks
|
|
130
|
+
- Archived Tasks: [N] archived
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
**Important:** This skill is purely informational. If you notice memory files are missing or out of date, suggest the user run `/onboard` or the relevant skill — do not attempt to fix memory yourself.
|