mema-kit 1.0.1 → 1.0.3
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 +0 -2
- package/docs/guide.md +179 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -76,8 +76,6 @@ This creates `.claude/skills/review/SKILL.md` with the full 4-phase memory lifec
|
|
|
76
76
|
- **Standard** (4 phases) — Most skills that read and write memory
|
|
77
77
|
- **Advanced** (4 phases + task management) — Multi-step workflows with archiving
|
|
78
78
|
|
|
79
|
-
See [docs/guide.md](docs/guide.md) for a complete worked example.
|
|
80
|
-
|
|
81
79
|
## Updating
|
|
82
80
|
|
|
83
81
|
```bash
|
package/docs/guide.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# mema-kit — Usage Guide
|
|
2
|
+
|
|
3
|
+
**A memory protocol kit for Claude Code skills.**
|
|
4
|
+
|
|
5
|
+
Two built-in skills. Persistent memory across sessions. A protocol for building your own.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Why Memory Matters
|
|
10
|
+
|
|
11
|
+
Claude Code has a **context window** — everything it "knows" during a conversation. mema-kit works within that window, not outside it.
|
|
12
|
+
|
|
13
|
+
```
|
|
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
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Without mema-kit:** every session starts blank. You re-explain everything, or the agent explores your entire codebase (slow, expensive).
|
|
20
|
+
|
|
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.
|
|
22
|
+
|
|
23
|
+
Think of it like a developer's notebook — it doesn't give you a bigger brain, it gives you the right information faster.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx mema-kit # install skills to .claude/skills/
|
|
31
|
+
claude
|
|
32
|
+
> /onboard # scan project, create .mema/, populate initial memory
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`/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.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Example: Building a Spec-Driven Dev Workflow
|
|
40
|
+
|
|
41
|
+
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**.
|
|
42
|
+
|
|
43
|
+
### Step 1: Create `/explore`
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
> /create-skill
|
|
47
|
+
Name: explore
|
|
48
|
+
Purpose: Research technical decisions and save findings
|
|
49
|
+
Complexity: standard
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
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/`.
|
|
53
|
+
|
|
54
|
+
**Using it:**
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
> /explore what auth strategy should we use?
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The agent loads your stack from memory, researches JWT vs sessions vs OAuth, and saves the decision:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
.mema/project-memory/decisions/2026-02-24-auth-strategy.md
|
|
64
|
+
→ "JWT with refresh tokens. Why: stateless, fits our REST API, team has experience."
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Next session, any skill that loads memory will know this decision exists.
|
|
68
|
+
|
|
69
|
+
### Step 2: Create `/plan`
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
> /create-skill
|
|
73
|
+
Name: plan
|
|
74
|
+
Purpose: Generate implementation plans from exploration findings
|
|
75
|
+
Complexity: standard
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Using it:**
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
> /plan plan the user auth endpoints
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
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`.
|
|
85
|
+
|
|
86
|
+
### Step 3: Create `/implement`
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
> /create-skill
|
|
90
|
+
Name: implement
|
|
91
|
+
Purpose: Implement code following a plan, run tests, save lessons
|
|
92
|
+
Complexity: advanced
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Advanced complexity adds task tracking and archiving. When the task is done, the agent moves task files to `archive/` and records any lessons learned.
|
|
96
|
+
|
|
97
|
+
**Using it:**
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
> /implement implement user auth endpoints
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The agent loads the plan, architecture, and past lessons. It implements each step, runs tests, and when done:
|
|
104
|
+
|
|
105
|
+
- Saves "Drizzle needs explicit type casting for enums" to `lessons.md`
|
|
106
|
+
- Archives `task-memory/user-auth/` to `archive/user-auth/`
|
|
107
|
+
- Updates `index.md`
|
|
108
|
+
|
|
109
|
+
### How Memory Flows Between Skills
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
/explore /plan /implement
|
|
113
|
+
│ │ │
|
|
114
|
+
├─ reads: ├─ reads: ├─ reads:
|
|
115
|
+
│ architecture │ architecture │ plan
|
|
116
|
+
│ requirements │ decisions │ lessons
|
|
117
|
+
│ │ context │ patterns
|
|
118
|
+
├─ writes: ├─ writes: │
|
|
119
|
+
│ decisions │ plan ├─ writes:
|
|
120
|
+
│ context │ status │ lessons
|
|
121
|
+
│ │ │ patterns
|
|
122
|
+
│ │ │ status → archive
|
|
123
|
+
▼ ▼ ▼
|
|
124
|
+
all flow through .mema/index.md
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Each skill reads what previous skills wrote. The index ties it all together.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## The Memory Protocol
|
|
132
|
+
|
|
133
|
+
Every skill follows four phases, defined in `_memory-protocol.md`:
|
|
134
|
+
|
|
135
|
+
**1. AUTO-LOAD** — Read `index.md`, load relevant files only
|
|
136
|
+
**2. WORK** — Do the skill's job with loaded context
|
|
137
|
+
**3. AUTO-SAVE & CURATE** — For each piece of knowledge: ADD, UPDATE, DELETE, or NOOP
|
|
138
|
+
**4. AUTO-INDEX** — Update `index.md` to reflect changes
|
|
139
|
+
|
|
140
|
+
### Curation Rules
|
|
141
|
+
|
|
142
|
+
| Action | When |
|
|
143
|
+
|--------|------|
|
|
144
|
+
| **ADD** | New decision, finding, lesson, or pattern |
|
|
145
|
+
| **UPDATE** | Existing knowledge changed (refined reasoning, new example) |
|
|
146
|
+
| **DELETE** | Wrong, superseded, or redundant |
|
|
147
|
+
| **NOOP** | Still accurate — leave it alone (most files, most of the time) |
|
|
148
|
+
|
|
149
|
+
Different file types have different curation styles:
|
|
150
|
+
- **Decisions** — conservative (rarely delete, even reversed decisions teach)
|
|
151
|
+
- **Context** — aggressive (prune dead ends, consolidate overlaps)
|
|
152
|
+
- **Plans** — replace (keep final version only)
|
|
153
|
+
- **Lessons/Patterns** — consolidate (merge similar entries)
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Memory Structure
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
.mema/
|
|
161
|
+
├── index.md # Pointer map — read this first
|
|
162
|
+
├── project-memory/ # Architecture, requirements, decisions
|
|
163
|
+
│ └── decisions/ # YYYY-MM-DD-short-name.md
|
|
164
|
+
├── task-memory/ # Per-task context, plans, status
|
|
165
|
+
├── agent-memory/ # Lessons learned, reusable patterns
|
|
166
|
+
├── archive/ # Completed tasks
|
|
167
|
+
└── _templates/ # File templates
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
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.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Tips
|
|
175
|
+
|
|
176
|
+
- **Memory is just markdown.** Open any file to see what the agent knows. Edit directly if something's wrong.
|
|
177
|
+
- **`.mema/` is gitignored by default.** To share decisions with your team, uncomment `!.mema/project-memory/` in `.gitignore`.
|
|
178
|
+
- **Curate, don't hoard.** The value of memory is its signal-to-noise ratio. Prune aggressively.
|
|
179
|
+
- **Any skill can use the protocol.** Use `/create-skill` or manually follow the 4-phase lifecycle.
|
package/package.json
CHANGED