mema-kit 1.0.5 → 1.1.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.
- package/README.md +89 -40
- package/bin/cli.js +3 -3
- package/docs/guide.md +121 -218
- package/package.json +2 -2
- package/skills/_memory-protocol.md +32 -25
- package/skills/mema.challenge/SKILL.md +121 -0
- package/skills/mema.clarify/SKILL.md +109 -0
- package/skills/mema.create-skill/SKILL.md +304 -0
- package/skills/mema.implement/SKILL.md +167 -0
- package/skills/mema.onboard/SKILL.md +364 -0
- package/skills/mema.plan/SKILL.md +150 -0
- package/skills/mema.recall/SKILL.md +129 -0
- package/skills/mema.research/SKILL.md +109 -0
- package/skills/mema.roadmap/SKILL.md +134 -0
- package/skills/mema.seed/SKILL.md +88 -0
- package/skills/mema.specify/SKILL.md +120 -0
- package/skills/mema.tasks/SKILL.md +128 -0
- package/templates/agent/lessons.md +16 -0
- package/templates/agent/patterns.md +16 -0
- package/templates/features/feature/plan.md +23 -0
- package/templates/features/feature/spec.md +30 -0
- package/templates/features/feature/status.md +23 -0
- package/templates/features/feature/tasks.md +16 -0
- package/templates/index.md +16 -5
- package/templates/product/challenge.md +23 -0
- package/templates/product/clarify.md +23 -0
- package/templates/product/research.md +21 -0
- package/templates/product/roadmap.md +26 -0
- package/templates/product/seed.md +11 -0
- package/templates/project/architecture.md +28 -0
- package/templates/project/decisions/decision.md +23 -0
- package/templates/project/requirements.md +16 -0
- package/skills/create-skill/SKILL.md +0 -242
- package/skills/implement/SKILL.md +0 -184
- package/skills/onboard/SKILL.md +0 -557
- package/skills/plan/SKILL.md +0 -206
- package/skills/recall/SKILL.md +0 -135
package/skills/plan/SKILL.md
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Break a high-level goal into a structured implementation plan. Explores the codebase, produces step-by-step specs, and saves them to task-memory/ for use by /implement.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# /plan — Implementation Planning
|
|
6
|
-
|
|
7
|
-
You are executing the /plan skill. Follow these steps carefully.
|
|
8
|
-
|
|
9
|
-
This skill takes a user's goal (e.g., `/plan add user authentication`), explores the codebase, and produces a detailed implementation plan saved to `.mema/task-memory/[task-name]/`.
|
|
10
|
-
|
|
11
|
-
## Phase 1: AUTO-LOAD
|
|
12
|
-
|
|
13
|
-
1. Read `.mema/index.md` to understand current project state
|
|
14
|
-
2. If `index.md` is missing or `.mema/` does not exist:
|
|
15
|
-
- Tell the user: "No memory found. Run `/onboard` first to set up mema-kit for this project."
|
|
16
|
-
- **Stop here** — do not continue to further steps.
|
|
17
|
-
3. If `index.md` is empty, run the **Rebuild Procedure** from `_memory-protocol.md`
|
|
18
|
-
4. Load relevant memory files:
|
|
19
|
-
- `project-memory/architecture.md` — to understand the current stack and structure
|
|
20
|
-
- `project-memory/requirements.md` — to check how the goal fits project requirements
|
|
21
|
-
- `project-memory/decisions/` — recent decisions that might affect the plan
|
|
22
|
-
- `agent-memory/lessons.md` — mistakes to avoid in the plan
|
|
23
|
-
- `agent-memory/patterns.md` — reusable approaches to incorporate
|
|
24
|
-
|
|
25
|
-
Read only what's needed — don't load everything.
|
|
26
|
-
|
|
27
|
-
## Phase 2: WORK
|
|
28
|
-
|
|
29
|
-
### 2a: Parse the Goal
|
|
30
|
-
|
|
31
|
-
Extract the task goal from the user's input. The goal is everything after `/plan`.
|
|
32
|
-
|
|
33
|
-
- Example: `/plan add user authentication` → goal is "add user authentication"
|
|
34
|
-
- Example: `/plan refactor the database layer` → goal is "refactor the database layer"
|
|
35
|
-
|
|
36
|
-
If no goal is provided, ask the user: "What would you like to plan? Describe your goal in a sentence or two."
|
|
37
|
-
|
|
38
|
-
**Derive the task name** from the goal in kebab-case:
|
|
39
|
-
- "add user authentication" → `user-authentication`
|
|
40
|
-
- "refactor the database layer" → `database-layer-refactor`
|
|
41
|
-
- Keep it short (2-4 words max). Drop filler words like "add", "create", "the".
|
|
42
|
-
|
|
43
|
-
### 2b: Check for Existing Task
|
|
44
|
-
|
|
45
|
-
Check if `task-memory/[task-name]/` already exists:
|
|
46
|
-
|
|
47
|
-
- **If it exists:** Read the existing `plan.md`, `context.md`, and `status.md`. Tell the user: "Found an existing plan for [task-name]. Would you like to revise it, or start fresh?" If revising, load the existing plan as a starting point. If starting fresh, overwrite the existing files.
|
|
48
|
-
- **If it doesn't exist:** Continue to the next step.
|
|
49
|
-
|
|
50
|
-
### 2c: Explore the Codebase
|
|
51
|
-
|
|
52
|
-
Before writing the plan, explore the codebase to understand what exists and what needs to change. This is the intelligence step — don't skip it.
|
|
53
|
-
|
|
54
|
-
1. **Identify relevant files** — Based on the goal and loaded architecture, determine which source files, configs, and tests are relevant
|
|
55
|
-
2. **Read representative files** — Read 3-5 key files to understand current patterns, conventions, and structure
|
|
56
|
-
3. **Map dependencies** — Note what existing code the new work depends on or affects
|
|
57
|
-
4. **Identify constraints** — Note any technical constraints, compatibility requirements, or limitations discovered
|
|
58
|
-
|
|
59
|
-
### 2d: Clarify if Needed
|
|
60
|
-
|
|
61
|
-
If the goal is ambiguous, ask **1-2 clarifying questions** (no more). Use the AskUserQuestion tool.
|
|
62
|
-
|
|
63
|
-
Good clarifying questions:
|
|
64
|
-
- "Should X support Y, or is Z sufficient for now?"
|
|
65
|
-
- "Do you want this to follow the existing pattern in [file], or take a different approach?"
|
|
66
|
-
|
|
67
|
-
Skip this step if the goal is clear from context + exploration.
|
|
68
|
-
|
|
69
|
-
### 2e: Write the Plan
|
|
70
|
-
|
|
71
|
-
Using your exploration findings and loaded memory, produce the plan in three parts:
|
|
72
|
-
|
|
73
|
-
**General Plan** — High-level approach in 1-2 paragraphs:
|
|
74
|
-
- What are we building/changing?
|
|
75
|
-
- How does it fit with the existing architecture?
|
|
76
|
-
- What key architectural decisions does this plan make?
|
|
77
|
-
|
|
78
|
-
**Detailed Steps** — Step-by-step implementation specs. Each step must include:
|
|
79
|
-
- **Action:** What to do (create file, modify function, add test, etc.)
|
|
80
|
-
- **Files:** Specific file paths to create or modify
|
|
81
|
-
- **Details:** Enough detail that `/implement` can execute the step without ambiguity
|
|
82
|
-
- **Dependencies:** Which prior steps must be complete first (if any)
|
|
83
|
-
|
|
84
|
-
Rules for steps:
|
|
85
|
-
- Each step should be small enough to implement in a single `/implement` invocation
|
|
86
|
-
- Order steps logically (foundations first, then features, then tests, then cleanup)
|
|
87
|
-
- Be specific about file paths — use the actual paths discovered during exploration
|
|
88
|
-
- Include test steps where appropriate (not just at the end)
|
|
89
|
-
|
|
90
|
-
**Out of Scope** — Explicitly list what this plan does NOT cover. This prevents scope creep during implementation.
|
|
91
|
-
|
|
92
|
-
### 2f: Write Task Files
|
|
93
|
-
|
|
94
|
-
Create `task-memory/[task-name]/` with three files:
|
|
95
|
-
|
|
96
|
-
**`context.md`** — Exploration findings relevant to this task:
|
|
97
|
-
```
|
|
98
|
-
# [Task Name] — Exploration Context
|
|
99
|
-
|
|
100
|
-
**Status:** active | **Updated:** [today's date]
|
|
101
|
-
|
|
102
|
-
## Summary
|
|
103
|
-
[2-3 sentences: what was explored and the key takeaway]
|
|
104
|
-
|
|
105
|
-
## Key Findings
|
|
106
|
-
- [Important facts, constraints, or insights discovered during exploration]
|
|
107
|
-
|
|
108
|
-
## Open Questions
|
|
109
|
-
- [Anything unresolved that might affect implementation]
|
|
110
|
-
|
|
111
|
-
## Relates To
|
|
112
|
-
- [Links to related memory files]
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**`plan.md`** — The full implementation plan:
|
|
116
|
-
```
|
|
117
|
-
# [Task Name] — Implementation Plan
|
|
118
|
-
|
|
119
|
-
**Status:** active | **Updated:** [today's date]
|
|
120
|
-
|
|
121
|
-
## General Plan
|
|
122
|
-
[High-level approach from 2e]
|
|
123
|
-
|
|
124
|
-
## Detailed Plan
|
|
125
|
-
|
|
126
|
-
### Step 1: [Action]
|
|
127
|
-
- **Files:** `path/to/file`
|
|
128
|
-
- **Details:** [Specific implementation details]
|
|
129
|
-
- **Dependencies:** None
|
|
130
|
-
|
|
131
|
-
### Step 2: [Action]
|
|
132
|
-
- **Files:** `path/to/file`
|
|
133
|
-
- **Details:** [Specific implementation details]
|
|
134
|
-
- **Dependencies:** Step 1
|
|
135
|
-
|
|
136
|
-
[... more steps ...]
|
|
137
|
-
|
|
138
|
-
## Out of Scope
|
|
139
|
-
- [What this plan does NOT cover]
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
**`status.md`** — Progress checklist mirroring the plan:
|
|
143
|
-
```
|
|
144
|
-
# [Task Name] — Status
|
|
145
|
-
|
|
146
|
-
**Status:** active | **Updated:** [today's date]
|
|
147
|
-
|
|
148
|
-
## Progress
|
|
149
|
-
|
|
150
|
-
- [ ] Step 1: [description]
|
|
151
|
-
- [ ] Step 2: [description]
|
|
152
|
-
- [ ] Step 3: [description]
|
|
153
|
-
|
|
154
|
-
## Notes
|
|
155
|
-
<!-- Any blockers, deviations from plan, or important observations. -->
|
|
156
|
-
|
|
157
|
-
## Completed
|
|
158
|
-
**Completed:**
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### 2g: Present the Plan
|
|
162
|
-
|
|
163
|
-
Print a summary to the user:
|
|
164
|
-
|
|
165
|
-
```
|
|
166
|
-
## Plan: [Task Name]
|
|
167
|
-
|
|
168
|
-
### Approach
|
|
169
|
-
[1-2 sentence summary of general plan]
|
|
170
|
-
|
|
171
|
-
### Steps ([N] total)
|
|
172
|
-
1. [Step 1 summary]
|
|
173
|
-
2. [Step 2 summary]
|
|
174
|
-
3. [Step 3 summary]
|
|
175
|
-
...
|
|
176
|
-
|
|
177
|
-
### Out of Scope
|
|
178
|
-
- [Item 1]
|
|
179
|
-
- [Item 2]
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
Plan saved to task-memory/[task-name]/
|
|
183
|
-
To start implementing: /implement [task-name]
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
## Phase 3: AUTO-SAVE & CURATE
|
|
187
|
-
|
|
188
|
-
Follow the curation rules in `_memory-protocol.md`. For each piece of knowledge produced:
|
|
189
|
-
|
|
190
|
-
- **Decisions made** about approach → ADD to `project-memory/decisions/YYYY-MM-DD-short-name.md` (only if the plan includes a significant architectural or technical decision worth preserving beyond this task)
|
|
191
|
-
- **Architecture insights** discovered during exploration → UPDATE `project-memory/architecture.md` (only if you found something missing or incorrect)
|
|
192
|
-
- **Lessons learned** during planning → ADD/UPDATE `agent-memory/lessons.md`
|
|
193
|
-
- **Patterns discovered** during exploration → ADD/UPDATE `agent-memory/patterns.md`
|
|
194
|
-
|
|
195
|
-
Apply ADD/UPDATE/DELETE/NOOP to each memory file. Most files will be NOOP.
|
|
196
|
-
|
|
197
|
-
**Do NOT save the plan itself as a decision.** The plan lives in task-memory. Only save standalone decisions that have value beyond this specific task.
|
|
198
|
-
|
|
199
|
-
## Phase 4: AUTO-INDEX
|
|
200
|
-
|
|
201
|
-
Update `.mema/index.md`:
|
|
202
|
-
1. Re-read the current index
|
|
203
|
-
2. Add an entry under `## Active Tasks`: `- \`task-memory/[task-name]/\` — [one-line summary] (plan ready)`
|
|
204
|
-
3. Update summaries for any modified files (decisions, lessons, patterns)
|
|
205
|
-
4. Remove entries for any deleted files
|
|
206
|
-
5. Update the `**Updated:**` date
|
package/skills/recall/SKILL.md
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
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.
|