mema-kit 1.0.6 → 1.1.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.
@@ -4,37 +4,48 @@ description: Bootstrap the mema-kit memory system for this project. Creates .mem
4
4
 
5
5
  # /mema.onboard — Project Memory Bootstrap
6
6
 
7
- You are setting up the mema-kit memory system for this project. Follow these steps carefully. This command is idempotent — safe to re-run. Never overwrite existing data.
7
+ You are setting up the mema-kit memory system for this project. Follow these steps carefully. This command is idempotent — safe to re-run. Never overwrite existing data without confirming.
8
8
 
9
9
  ## Step 1: Check Current State
10
10
 
11
11
  Before creating anything, assess what already exists:
12
12
 
13
13
  1. Check if `.mema/` directory exists
14
- 2. Check if `CLAUDE.md` exists and whether it contains a `## Memory System` section
15
- 3. Check if `.gitignore` exists and whether it contains `.mema` entries
14
+ 2. Check if it uses the **old structure** (`project-memory/`, `task-memory/`, `agent-memory/`) if so, migration is needed
15
+ 3. Check if `CLAUDE.md` exists and has a `## Memory System` section
16
+ 4. Check if `.gitignore` contains `.mema` entries
16
17
 
17
- Report what you found to the user: "Setting up mema-kit. Found existing .mema/ directory — will verify and repair." or "Fresh setup — creating everything from scratch."
18
+ Report to the user: "Setting up mema-kit. Found existing .mema/ — will verify and update." or "Fresh setup — creating everything from scratch." or "Found old mema-kit structure — will migrate to new layout."
18
19
 
19
- ## Step 2: Create .mema/ Directory Structure
20
+ ## Step 2: Migrate Old Structure (if needed)
21
+
22
+ If the old directory structure exists, migrate it before creating anything new:
23
+
24
+ - If `.mema/project-memory/` exists and `.mema/project/` does not → rename to `.mema/project/`; tell user: "Migrated project-memory/ → project/"
25
+ - If `.mema/agent-memory/` exists and `.mema/agent/` does not → rename to `.mema/agent/`; tell user: "Migrated agent-memory/ → agent/"
26
+ - If `.mema/task-memory/` exists and `.mema/features/` does not → rename to `.mema/features/`; tell user: "Migrated task-memory/ → features/"
27
+
28
+ If new structure already exists: NOOP on that directory.
29
+
30
+ ## Step 3: Create .mema/ Directory Structure
20
31
 
21
32
  Create the following directories if they don't already exist:
22
33
 
23
34
  ```
24
35
  .mema/
25
- ├── _templates/
26
- ├── project-memory/
36
+ ├── product/
37
+ ├── features/
38
+ ├── project/
27
39
  │ └── decisions/
28
- ├── task-memory/
29
- ├── agent-memory/
40
+ ├── agent/
30
41
  └── archive/
31
42
  ```
32
43
 
33
44
  For each directory: if it exists, skip it. If it doesn't, create it.
34
45
 
35
- ## Step 3: Write Template Files
46
+ ## Step 4: Write Template Files
36
47
 
37
- Write the following files to `.mema/_templates/`. If a template file already exists, **skip it** (the user may have customized it).
48
+ Write the following files to `.mema/_templates/`. If a template file already exists, **skip it**.
38
49
 
39
50
  ### `.mema/_templates/decision.md`
40
51
 
@@ -44,85 +55,61 @@ Write the following files to `.mema/_templates/`. If a template file already exi
44
55
  **Status:** active | **Updated:** YYYY-MM-DD
45
56
 
46
57
  ## Context
47
- <!-- What situation or question prompted this decision? What problem are we solving? -->
48
58
 
49
59
  ## Decision
50
- <!-- What was decided? Be specific and concrete. -->
51
60
 
52
61
  ## Options Considered
53
62
 
54
63
  ### Option A: [Name]
55
- <!-- Brief description. Why chosen/rejected. -->
56
64
 
57
65
  ### Option B: [Name]
58
- <!-- Brief description. Why chosen/rejected. -->
59
66
 
60
67
  ## Reasoning
61
- <!-- Why this option was selected. What factors mattered most? What trade-offs were accepted? -->
62
68
 
63
69
  ## Consequences
64
- <!-- What are the implications? What does this enable or constrain? Any known trade-offs or risks? -->
65
70
  ```
66
71
 
67
- ### `.mema/_templates/context.md`
72
+ ### `.mema/_templates/spec.md`
68
73
 
69
74
  ```
70
- # [Topic] — Exploration Context
75
+ # [Feature Name] — Spec
71
76
 
72
77
  **Status:** active | **Updated:** YYYY-MM-DD
73
78
 
74
- ## Summary
75
- <!-- 2-3 sentence overview of what was explored and the key takeaway. -->
79
+ ## Purpose
76
80
 
77
- ## Key Findings
78
- <!-- Bullet list of important facts, constraints, or insights discovered. Be specific and concise. -->
81
+ ## User Scenarios
79
82
 
80
- -
81
- -
82
- -
83
+ ### Scenario 1
83
84
 
84
- ## Open Questions
85
- <!-- What remains unresolved? What needs further exploration or a decision? -->
85
+ Given [state], When [action], Then [outcome]
86
86
 
87
- -
88
- -
87
+ ## Acceptance Criteria
89
88
 
90
- ## Relates To
91
- <!-- Links to related memory files (decisions, other context, plans). Use relative paths. -->
89
+ - [ ] [Criterion]
92
90
 
93
- -
91
+ ## Constraints
94
92
  ```
95
93
 
96
- ### `.mema/_templates/plan.md`
94
+ ### `.mema/_templates/status.md`
97
95
 
98
96
  ```
99
- # [Task Name] — Implementation Plan
97
+ # [Feature Name] — Status
100
98
 
101
- **Status:** active | **Updated:** YYYY-MM-DD
102
-
103
- ## General Plan
104
- <!-- High-level approach: architecture decisions, component design, data flow. Keep it to 1-2 paragraphs or a short list. This should answer "what are we building and how does it fit together?" -->
99
+ **Status:** pending | **Updated:** YYYY-MM-DD
105
100
 
106
- ## Detailed Plan
107
- <!-- Step-by-step implementation tasks. Each step should be specific enough to implement directly. -->
101
+ ## Current Status
108
102
 
109
- ### Step 1: [Action]
110
- <!-- What to do, which files to create/modify, any dependencies on prior steps. -->
111
- - Files: `path/to/file`
112
- - Details:
103
+ `pending` not started
113
104
 
114
- ### Step 2: [Action]
115
- - Files: `path/to/file`
116
- - Details:
105
+ ## Progress Log
117
106
 
118
- ### Step 3: [Action]
119
- - Files: `path/to/file`
120
- - Details:
107
+ | Date | Task | Notes |
108
+ |------|------|-------|
121
109
 
122
- ## Out of Scope
123
- <!-- What this plan explicitly does NOT cover. Prevents scope creep during implementation. -->
110
+ ## Next Task
124
111
 
125
- -
112
+ ## Blockers
126
113
  ```
127
114
 
128
115
  ### `.mema/_templates/lessons.md`
@@ -135,13 +122,10 @@ Write the following files to `.mema/_templates/`. If a template file already exi
135
122
  ## Lessons
136
123
 
137
124
  ### [Short Title]
138
- <!-- One-sentence lesson. -->
139
- - **Context:** <!-- When/how this was discovered. -->
140
- - **Example:** <!-- Concrete code example or scenario if applicable. -->
125
+ - **Context:**
126
+ - **Example:**
141
127
 
142
128
  ---
143
-
144
- <!-- Add new lessons above this line. When entries exceed ~30, consolidate related lessons under grouped headers. -->
145
129
  ```
146
130
 
147
131
  ### `.mema/_templates/patterns.md`
@@ -154,404 +138,262 @@ Write the following files to `.mema/_templates/`. If a template file already exi
154
138
  ## Patterns
155
139
 
156
140
  ### [Pattern Name]
157
- - **Structure:** <!-- How the pattern is organized. -->
158
- - **Example:** <!-- Concrete usage example. -->
141
+ - **Structure:**
142
+ - **Example:**
159
143
 
160
144
  ---
161
-
162
- <!-- Add new patterns above this line. -->
163
145
  ```
164
146
 
165
- ### `.mema/_templates/status.md`
147
+ ## Step 5: Scan the Project
166
148
 
167
- ```
168
- # [Task Name] — Status
149
+ Read and analyze the project to populate memory with real content.
169
150
 
170
- **Status:** active | **Updated:** YYYY-MM-DD
151
+ ### 5a: Detect Project Type and Stack
171
152
 
172
- ## Progress
153
+ Read (skip any that don't exist):
154
+ 1. `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `pom.xml`, or `Gemfile` — language, framework, dependencies
155
+ 2. `README.md` — project purpose and setup
156
+ 3. `CLAUDE.md` — existing conventions
157
+ 4. Config files (`tsconfig.json`, `.eslintrc`, etc.)
173
158
 
174
- - [ ] Step 1: [description]
175
- - [ ] Step 2: [description]
176
- - [ ] Step 3: [description]
159
+ ### 5b: Scan Directory Structure
177
160
 
178
- ## Notes
179
- <!-- Any blockers, deviations from plan, or important observations during implementation. -->
161
+ List top-level directories and key subdirectories (1-2 levels deep). Note source, test, and config locations.
180
162
 
181
- ## Completed
182
- **Completed:**
183
- ```
184
-
185
- ## Step 4: Scan the Project
186
-
187
- This is the intelligence step. Read and analyze the project to populate memory with real content instead of empty placeholders.
188
-
189
- ### 4a: Detect Project Type and Stack
190
-
191
- Read the following files (skip any that don't exist):
192
-
193
- 1. `package.json` or `pyproject.toml` or `Cargo.toml` or `go.mod` or `pom.xml` or `Gemfile` — to identify language, framework, and dependencies
194
- 2. `README.md` — to understand project purpose and setup
195
- 3. `CLAUDE.md` — to understand existing conventions and instructions
196
- 4. `tsconfig.json` or equivalent config files — to understand build setup
197
-
198
- ### 4b: Scan Directory Structure
163
+ ### 5c: Read Representative Source Files
199
164
 
200
- List the top-level directories and key subdirectories (1-2 levels deep) to understand the project layout. Note:
201
- - Source code location (`src/`, `lib/`, `app/`, etc.)
202
- - Test location (`tests/`, `__tests__/`, `test/`, etc.)
203
- - Config files present
204
- - Any existing documentation
165
+ Pick 2-3 files that best represent the codebase: main entry point, a representative module, a test file.
205
166
 
206
- ### 4c: Read Representative Source Files
167
+ ### 5d: Compile Findings
207
168
 
208
- Pick 2-3 source files that best represent the codebase patterns:
209
- - The main entry point (e.g., `src/index.ts`, `main.py`, `main.go`)
210
- - A representative module/component
211
- - A test file (if tests exist)
212
-
213
- Read these to understand coding patterns, style, and architecture.
214
-
215
- ### 4d: Summarize Findings
216
-
217
- Before writing memory, compile your findings:
218
- - **Project name** and purpose
219
- - **Language/framework/stack** with versions
220
- - **Architecture pattern** (monolith, microservices, CLI tool, library, etc.)
221
- - **Key directories** and what they contain
222
- - **Testing setup** (framework, patterns)
223
- - **Build/run commands**
224
- - **Notable conventions** (naming, patterns, config)
225
-
226
- ## Step 5: Populate Initial Memory
227
-
228
- Using the scan findings, create memory files with **real content** (not empty placeholders).
169
+ Before writing memory, note:
170
+ - Project name and purpose
171
+ - Language/framework/stack with versions
172
+ - Architecture pattern
173
+ - Key directories
174
+ - Testing setup
175
+ - Build/run commands
176
+ - Notable conventions
229
177
 
230
- ### `.mema/project-memory/architecture.md`
178
+ ## Step 6: Populate Initial Memory
231
179
 
232
- Write an architecture overview based on what you discovered. Include:
233
- - Tech stack with versions
234
- - Project structure (key directories and their purposes)
235
- - Architecture pattern
236
- - Key entry points
237
- - Build and run commands
180
+ Using scan findings, create files with **real content** (not empty placeholders).
238
181
 
239
- Example format:
182
+ ### `.mema/project/architecture.md`
240
183
 
241
184
  ```
242
185
  # Project Architecture
243
186
 
244
- **Status:** active | **Updated:** [today's date]
187
+ **Status:** active | **Updated:** [today]
245
188
 
246
189
  ## Stack
247
- - **Language:** TypeScript 5.x
248
- - **Runtime:** Node.js 20+
249
- - **Framework:** Fastify 4.x
250
- - **Database:** PostgreSQL 16 via Drizzle ORM
251
- - **Testing:** Vitest
190
+ - **Language:** [detected]
191
+ - **Framework:** [detected]
192
+ [other stack items]
252
193
 
253
194
  ## Structure
254
- - `src/` — Application source code
255
- - `routes/` — API route handlers
256
- - `services/` — Business logic
257
- - `db/` — Database schema and migrations
258
- - `tests/` — Test files mirroring src/ structure
195
+ - `[dir]/` — [purpose]
196
+ [other directories]
259
197
 
260
198
  ## Architecture
261
- REST API following controller service → repository layers.
262
- Entry point: `src/app.ts`
199
+ [Pattern in 1-2 sentences. Entry point: path/to/entry]
263
200
 
264
201
  ## Commands
265
- - `npm run dev` — Start development server
266
- - `npm test` — Run test suite
267
- - `npm run build` — Build for production
202
+ - `[dev command]` — Start development
203
+ - `[test command]` — Run tests
268
204
  ```
269
205
 
270
- ### `.mema/project-memory/requirements.md`
271
-
272
- Write a requirements summary based on README, package.json description, and observed functionality:
206
+ ### `.mema/project/requirements.md`
273
207
 
274
208
  ```
275
209
  # Project Requirements
276
210
 
277
- **Status:** active | **Updated:** [today's date]
211
+ **Status:** active | **Updated:** [today]
278
212
 
279
213
  ## Purpose
280
- [What this project does, based on README and code]
214
+ [What this project does, from README and code]
281
215
 
282
216
  ## Key Requirements
283
- - [Requirement discovered from code/docs]
284
- - [Requirement discovered from code/docs]
217
+ - [Requirement from code/docs]
285
218
 
286
219
  ## Constraints
287
- - [Any constraints discovered (Node version, dependencies, etc.)]
220
+ - [Constraint discovered]
288
221
  ```
289
222
 
290
- ### `.mema/agent-memory/lessons.md`
223
+ ### `.mema/project/structure.md`
291
224
 
292
- Create a starter lessons file with any project-specific gotchas discovered during scanning:
225
+ Using the directory scan from Step 5b, write an annotated repo tree and navigation guide:
293
226
 
294
227
  ```
295
- # Agent Lessons
228
+ # Repository Structure
296
229
 
297
- **Updated:** [today's date]
230
+ **Status:** active | **Updated:** [today]
298
231
 
299
- ## Lessons
232
+ ## Directory Tree
300
233
 
301
- <!-- Lessons will be added here as the agent learns from development experience. -->
302
234
  ```
303
-
304
- If you discovered anything notable during scanning (e.g., unusual config, non-obvious setup steps), add it as the first lesson.
305
-
306
- ### `.mema/agent-memory/patterns.md`
307
-
308
- Create a starter patterns file. If you identified clear patterns from the source files you read, add them:
309
-
235
+ [project-name]/
236
+ [2–3 level annotated tree derived from Step 5b scan]
310
237
  ```
311
- # Agent Patterns
312
238
 
313
- **Updated:** [today's date]
239
+ ## Entry Points
314
240
 
315
- ## Patterns
241
+ [Key files per subsystem, e.g.:]
242
+ - `[entry file]` — [what it does]
316
243
 
317
- <!-- Patterns will be added here as the agent discovers reusable approaches. -->
318
- ```
244
+ ## Source vs. Generated
319
245
 
320
- ### `.mema/index.md`
246
+ - **Source:** [source dirs]
247
+ - **Generated:** [build output, node_modules, etc.]
248
+ - **Gitignored:** `.mema/`, [other gitignored items]
321
249
 
322
- Build the index from the files you just created:
250
+ ## Where to Find X
323
251
 
252
+ [Quick-reference for the top subsystems found during scan:]
253
+ - **[Component type]:** `[path/]`
324
254
  ```
325
- # Memory Index
326
-
327
- **Updated:** [today's date]
328
255
 
329
- ## Active Tasks
256
+ ### `.mema/agent/lessons.md`
330
257
 
331
- ## Project Knowledge
332
- - `project-memory/architecture.md` — [one-line summary of stack/architecture]
333
- - `project-memory/requirements.md` — [one-line summary of purpose]
334
-
335
- ## Recent Decisions
336
-
337
- ## Agent Lessons
338
- - `agent-memory/lessons.md` — [N] lessons recorded
339
- - `agent-memory/patterns.md` — [N] patterns recorded
340
258
  ```
259
+ # Agent Lessons
341
260
 
342
- ## Step 6: Update CLAUDE.md
343
-
344
- Read the current `CLAUDE.md` (if it exists) and follow the appropriate path:
345
-
346
- ### Path A: CLAUDE.md already exists
347
-
348
- 1. Search for `## Memory System` in the file content
349
- 2. If found → **skip this step entirely** (already configured). Record outcome as **skipped**.
350
- 3. If not found → append the Memory System section (see below) at the end of the file. Record outcome as **appended**.
261
+ **Updated:** [today]
351
262
 
352
- Memory System section to append:
263
+ ## Lessons
353
264
 
265
+ [Add any project-specific gotchas found during scan, or leave as:]
266
+ <!-- Lessons will be added here as development experience accumulates. -->
354
267
  ```
355
- ## Memory System
356
268
 
357
- This project uses mema-kit for persistent memory across sessions.
358
-
359
- Memory lives in `.mema/`. At the start of each task, read `.mema/index.md` to load relevant context. After completing work, curate and save knowledge following the memory protocol in `.claude/skills/_memory-protocol.md`.
269
+ ### `.mema/agent/patterns.md`
360
270
 
361
- Memory is managed automatically by skills — do not manually modify `.mema/` files unless correcting an error.
362
271
  ```
272
+ # Agent Patterns
363
273
 
364
- ### Path B: CLAUDE.md does NOT exist — Generate comprehensive file
365
-
366
- Follow sub-steps 6a through 6f to build a rich CLAUDE.md from scratch. Use the scan data collected in Step 4 for all content. Record outcome as **generated**.
367
-
368
- #### 6a: Ask user "About Me"
369
-
370
- Ask the user a single question using the AskUserQuestion tool:
371
-
372
- > "Before I generate your CLAUDE.md, I'd like to personalize it. How would you describe yourself? (e.g., experience level, preferences for code style, anything you want Claude to know)"
373
-
374
- Provide 3 options:
375
- - **Junior developer** — "I'm learning. Explain decisions, be thorough in comments, correct my terminology gently."
376
- - **Senior developer** — "I'm experienced. Keep explanations brief, focus on trade-offs and edge cases."
377
- - **Skip** — "Skip personalization, use a sensible default."
274
+ **Updated:** [today]
378
275
 
379
- If the user selects "Skip" or doesn't respond, use this default:
276
+ ## Patterns
380
277
 
278
+ [Add any clear patterns from source files, or leave as:]
279
+ <!-- Patterns will be added here as development experience accumulates. -->
381
280
  ```
382
- When I ask you to implement something, briefly explain key decisions. Prefer clear, well-commented code.
383
- ```
384
-
385
- #### 6b: Write the `# About Me` section
386
-
387
- Use the user's response from 6a to write a natural-language paragraph (3-5 lines). This section uses **H1** (`# About Me`), matching mema-kit's own CLAUDE.md convention.
388
-
389
- #### 6c: Write the `## Project Overview` section
390
-
391
- Using Step 4 scan data, generate three sub-sections:
392
281
 
393
- **Opening paragraph:** Project name (from `package.json` name field, `README.md` title, or directory name as fallback) and a 1-2 sentence description of what the project does.
282
+ ### `.mema/index.md`
394
283
 
395
- **`### Repository Structure`:** A directory tree (top-level + 1 level deep) with inline comments explaining each directory's purpose. Use the `tree` format:
284
+ Build the index from files just created:
396
285
 
397
286
  ```
398
- project-name/
399
- ├── src/ # Source code
400
- ├── tests/ # Test suite
401
- └── package.json # Dependencies and scripts
402
- ```
403
-
404
- **`### Architecture`:** Architecture pattern (e.g., REST API, CLI tool, library), key entry points, and data flow. Keep to 2-4 sentences. If the project is too simple or unclear for an architecture description, write: "Architecture details will be added as the project grows."
405
-
406
- #### 6d: Write the `## Coding Standards` section
407
-
408
- Using Step 4c source file analysis, generate a bullet list covering:
287
+ # Memory Index
409
288
 
410
- - **Naming:** Conventions observed (camelCase, snake_case, kebab-case for files, etc.)
411
- - **Style:** Formatting patterns (semicolons, quotes, indentation)
412
- - **Patterns:** Recurring code patterns (e.g., "error-first callbacks", "async/await throughout")
413
- - **Tooling:** Linting/formatting tools detected (ESLint, Prettier, Black, rustfmt, etc. — check `devDependencies`, config files like `.eslintrc`, `.prettierrc`, `pyproject.toml [tool.black]`)
289
+ **Updated:** [today]
414
290
 
415
- If insufficient data for any bullet, use a placeholder like: "No linting configuration detected — consider adding one."
291
+ ## Active Features
416
292
 
417
- #### 6e: Write the `## Technical Workflows` section
293
+ ## Product Discovery
418
294
 
419
- Using Step 4a package manager files (`package.json` scripts, `Makefile` targets, `pyproject.toml [tool.poetry.scripts]`, `Cargo.toml`, etc.), generate a list of common commands:
295
+ ## Project Knowledge
296
+ - `project/architecture.md` — [one-line stack/architecture summary]
297
+ - `project/requirements.md` — [one-line purpose summary]
298
+ - `project/structure.md` — [one-line: e.g. "Annotated repo tree, 3 top-level dirs"]
420
299
 
421
- ```
422
- - `npm run dev` — Start development server
423
- - `npm test` — Run test suite
424
- - `npm run build` — Build for production
300
+ ## Agent Knowledge
301
+ - `agent/lessons.md` — [N] lessons recorded
302
+ - `agent/patterns.md` — [N] patterns recorded
425
303
  ```
426
304
 
427
- Include dev, test, build, and lint commands at minimum (if they exist). If no commands are detected, write: "No build/test commands detected. Add scripts to `package.json` (or equivalent) as the project matures."
305
+ ## Step 7: Update CLAUDE.md
428
306
 
429
- #### 6f: Write the `## Skill Commands` and `## Memory System` sections
307
+ Read the current `CLAUDE.md` (if exists) and follow the appropriate path:
430
308
 
431
- **Skill Commands:** Scan the `.claude/skills/` directory. For each subdirectory containing a `SKILL.md`, read the YAML frontmatter `description` field. Generate an entry:
309
+ ### Path A: CLAUDE.md already exists
432
310
 
433
- ```
434
- - `/skill-name` [description from frontmatter]
435
- ```
311
+ 1. Search for `## Memory System`
312
+ 2. If found **skip this step** (already configured)
313
+ 3. If not found → append the Memory System section below
436
314
 
437
- If no skills are found (shouldn't happen since we just installed them, but as a fallback):
315
+ Memory System section:
438
316
 
439
317
  ```
440
- - `/mema.onboard` — Bootstrap the mema-kit memory system
441
- - `/mema.recall` — Recall project memory into current session
442
- - `/mema.create-skill` — Generate a new memory-aware skill
443
- ```
444
-
445
- **Memory System:** Append the standard Memory System section (same text as Path A).
318
+ ## Memory System
446
319
 
447
- #### Assemble the final CLAUDE.md
320
+ This project uses mema-kit for persistent memory across sessions.
448
321
 
449
- Combine all sections into a single file in this order and write it:
322
+ Memory lives in `.mema/`. At the start of each task, read `.mema/index.md` to load relevant context. After completing work, curate and save knowledge following the memory protocol in `.claude/skills/_memory-protocol.md`.
450
323
 
324
+ Memory is managed automatically by skills — do not manually modify `.mema/` files unless correcting an error.
451
325
  ```
452
- # CLAUDE.md
453
-
454
- This file provides guidance to Claude Code when working with code in this repository.
455
-
456
- # About Me
457
- [Content from 6b]
458
-
459
- ## Project Overview
460
-
461
- [Content from 6c — opening paragraph]
462
-
463
- ### Repository Structure
464
-
465
- [Content from 6c — tree]
466
-
467
- ### Architecture
468
-
469
- [Content from 6c — architecture description]
470
-
471
- ## Coding Standards
472
326
 
473
- [Content from 6d]
327
+ ### Path B: CLAUDE.md does NOT exist — Generate from scratch
474
328
 
475
- ## Technical Workflows
329
+ Follow sub-steps 7a through 7f.
476
330
 
477
- [Content from 6e]
331
+ #### 7a: Ask user "About Me"
478
332
 
479
- ## Skill Commands
333
+ Ask one question using AskUserQuestion:
480
334
 
481
- [Content from 6f skill list]
335
+ > "Before I generate your CLAUDE.md, how would you describe yourself?"
482
336
 
483
- ## Memory System
337
+ Options:
338
+ - **Junior developer** — "I'm learning. Explain decisions, be thorough, correct my terminology gently."
339
+ - **Senior developer** — "I'm experienced. Keep explanations brief, focus on trade-offs and edge cases."
340
+ - **Skip** — Use a sensible default
484
341
 
485
- This project uses mema-kit for persistent memory across sessions.
342
+ #### 7b–7f: Generate CLAUDE.md sections
486
343
 
487
- Memory lives in `.mema/`. At the start of each task, read `.mema/index.md` to load relevant context. After completing work, curate and save knowledge following the memory protocol in `.claude/skills/_memory-protocol.md`.
488
-
489
- Memory is managed automatically by skills do not manually modify `.mema/` files unless correcting an error.
490
- ```
344
+ Use Step 5 scan data to write:
345
+ - `# About Me` — from user's answer in 7a
346
+ - `## Project Overview`name, description, directory tree, architecture
347
+ - `## Coding Standards` — naming conventions, style, patterns, tooling detected
348
+ - `## Technical Workflows` — dev/test/build commands from package scripts
349
+ - `## Skill Commands` — scan `.claude/skills/` for SKILL.md frontmatter descriptions
350
+ - `## Memory System` — standard section (same as Path A)
491
351
 
492
- ## Step 7: Update .gitignore
352
+ ## Step 8: Update .gitignore
493
353
 
494
- 1. Read the current `.gitignore` (if it exists)
495
- 2. Search for `.mema` in the file content
496
- 3. If found**skip this step** (already configured)
497
- 4. If not found → append the following block at the end of the file
498
- 5. If `.gitignore` doesn't exist → create the file with this content
499
-
500
- Append this block:
354
+ 1. Read current `.gitignore` (if exists)
355
+ 2. If `.mema` is already excluded → skip
356
+ 3. If notappend:
501
357
 
502
358
  ```
503
359
  # mema-kit memory (developer-local)
504
360
  .mema/*
505
361
  # Uncomment to share project decisions with your team:
506
- # !.mema/project-memory/
362
+ # !.mema/project/
507
363
  ```
508
364
 
509
- ## Step 8: Confirm to the User
510
-
511
- Print a summary of what was done, including what you discovered about the project. Use the CLAUDE.md outcome recorded in Step 6 to select the appropriate message.
512
-
513
- For the CLAUDE.md line, use the matching outcome:
365
+ ## Step 9: Confirm to User
514
366
 
515
- - **generated** `[check] CLAUDE.md generated with project overview, coding standards, workflows, and memory system`
516
- - **appended** → `[check] CLAUDE.md updated — memory system section appended`
517
- - **skipped** → `[check] CLAUDE.md — memory system section already present`
518
-
519
- ### Fresh setup (first run):
367
+ Print a summary of what was done:
520
368
 
521
369
  ```
522
- mema-kit initialized! Here's what was set up:
523
-
524
- [check] .mema/ directory structure (memory system)
525
- [check] Memory templates in .mema/_templates/
526
- [check] [CLAUDE.md outcome message from above]
527
- [check] .gitignore updated to exclude .mema/
370
+ mema-kit initialized!
528
371
 
529
- Project scan results:
530
- - [Language/framework discovered]
531
- - [Architecture pattern discovered]
532
- - [N] source directories mapped
533
- - [Notable findings]
372
+ [check] .mema/ structure created (product/, features/, project/, agent/)
373
+ [check] project/structure.md generated
374
+ [check] CLAUDE.md [generated / updated / already configured]
375
+ [check] .gitignore updated
534
376
 
535
- Memory populated:
536
- - architecture.md — [summary]
537
- - requirements.md — [summary]
538
- - lessons.md — [N] initial lessons
539
- - patterns.md — [N] initial patterns
377
+ Project scan:
378
+ - [Language/framework]
379
+ - [Architecture pattern]
380
+ - [Key finding]
540
381
 
541
- Next: Start working on your project. Memory will be loaded and saved automatically by any mema-kit skill.
382
+ Next steps:
383
+ - New idea? Run /mema.seed to start the discovery workflow
384
+ - Existing feature to build? Run /mema.specify to create a feature spec
385
+ - Start a new session? Run /mema.recall to load context
542
386
  ```
543
387
 
544
- ### Re-run (some items already existed):
545
-
546
- Adjust the summary to show what was verified vs. created:
388
+ For a re-run with migration:
547
389
 
548
390
  ```
549
- mema-kit verified! Everything looks good:
391
+ mema-kit updated!
550
392
 
551
- [check] .mema/ directory structure — already exists, verified
552
- [check] Memory templates already exist, skipped
553
- [check] [CLAUDE.md outcome message from above]
554
- [check] .gitignore .mema/ already excluded
393
+ [check] Migrated project-memory/ project/
394
+ [check] Migrated agent-memory/ agent/
395
+ [check] Migrated task-memory/ features/
396
+ [check] Directory structure verified
555
397
 
556
- Your setup is intact. No changes were needed.
398
+ Your existing memory is preserved. Run /mema.recall to see current state.
557
399
  ```