mema-kit 1.0.3 → 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 -2
- package/docs/guide.md +31 -1
- package/package.json +1 -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
|
package/docs/guide.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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
|
|
|
@@ -30,10 +30,38 @@ Think of it like a developer's notebook — it doesn't give you a bigger brain,
|
|
|
30
30
|
npx mema-kit # install skills to .claude/skills/
|
|
31
31
|
claude
|
|
32
32
|
> /onboard # scan project, create .mema/, populate initial memory
|
|
33
|
+
> /recall # next new session: load memory into context
|
|
33
34
|
```
|
|
34
35
|
|
|
35
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.
|
|
36
37
|
|
|
38
|
+
`/recall` loads your project memory into the current session — use it at the start of every new conversation to restore context instantly.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Recalling Memory: /recall
|
|
43
|
+
|
|
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.
|
|
45
|
+
|
|
46
|
+
### Modes
|
|
47
|
+
|
|
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 |
|
|
52
|
+
|
|
53
|
+
### When to use which
|
|
54
|
+
|
|
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 |
|
|
62
|
+
|
|
63
|
+
`/recall` is **read-only** — it never modifies memory files. Safe to run at any time.
|
|
64
|
+
|
|
37
65
|
---
|
|
38
66
|
|
|
39
67
|
## Example: Building a Spec-Driven Dev Workflow
|
|
@@ -126,6 +154,8 @@ The agent loads the plan, architecture, and past lessons. It implements each ste
|
|
|
126
154
|
|
|
127
155
|
Each skill reads what previous skills wrote. The index ties it all together.
|
|
128
156
|
|
|
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.
|
|
158
|
+
|
|
129
159
|
---
|
|
130
160
|
|
|
131
161
|
## The Memory Protocol
|
package/package.json
CHANGED
|
@@ -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.
|