specialist-agent 2.11.4 → 2.13.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.
Files changed (80) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/.codex/INSTALL.md +32 -9
  4. package/.cursor-plugin/marketplace.json +4 -4
  5. package/.cursor-plugin/plugin.json +2 -2
  6. package/.opencode/opencode.json +45 -0
  7. package/README.md +18 -2
  8. package/agents/analyst-lite.md +1 -1
  9. package/agents/analyst.md +5 -1
  10. package/agents/api.md +1 -0
  11. package/agents/architect-lite.md +1 -1
  12. package/agents/architect.md +10 -1
  13. package/agents/autopilot-lite.md +46 -0
  14. package/agents/autopilot.md +196 -0
  15. package/agents/cloud-lite.md +1 -1
  16. package/agents/cloud.md +2 -1
  17. package/agents/data.md +1 -0
  18. package/agents/debugger.md +3 -0
  19. package/agents/deps-lite.md +1 -1
  20. package/agents/deps.md +2 -1
  21. package/agents/designer.md +8 -0
  22. package/agents/devops-lite.md +1 -1
  23. package/agents/devops.md +2 -1
  24. package/agents/docs-lite.md +1 -1
  25. package/agents/docs.md +2 -1
  26. package/agents/executor-lite.md +1 -1
  27. package/agents/executor.md +58 -31
  28. package/agents/explorer-lite.md +1 -1
  29. package/agents/explorer.md +14 -1
  30. package/agents/finance.md +1 -0
  31. package/agents/i18n.md +1 -0
  32. package/agents/legal.md +1 -0
  33. package/agents/marketing.md +9 -0
  34. package/agents/memory.md +103 -178
  35. package/agents/orchestrator-lite.md +1 -1
  36. package/agents/orchestrator.md +62 -39
  37. package/agents/pair-lite.md +1 -1
  38. package/agents/pair.md +2 -1
  39. package/agents/perf.md +1 -0
  40. package/agents/planner-lite.md +1 -1
  41. package/agents/planner.md +17 -11
  42. package/agents/product.md +9 -0
  43. package/agents/refactor.md +1 -0
  44. package/agents/ripple-lite.md +1 -1
  45. package/agents/ripple.md +4 -1
  46. package/agents/scout-lite.md +1 -1
  47. package/agents/scout.md +2 -1
  48. package/agents/security-lite.md +1 -1
  49. package/agents/security.md +4 -1
  50. package/agents/sentry-triage-lite.md +1 -1
  51. package/agents/sentry-triage.md +4 -1
  52. package/agents/starter-lite.md +1 -1
  53. package/agents/starter.md +2 -1
  54. package/agents/support.md +1 -0
  55. package/agents/tdd.md +3 -0
  56. package/agents/tester.md +1 -0
  57. package/cli/index.mjs +1 -1
  58. package/hooks/hooks.json +11 -0
  59. package/hooks/lifecycle.json +10 -0
  60. package/hooks/native/auto-dispatch.mjs +7 -2
  61. package/hooks/native/session-end.mjs +42 -0
  62. package/package.json +1 -1
  63. package/skills/audit/SKILL.md +71 -9
  64. package/skills/autopilot/SKILL.md +286 -0
  65. package/skills/brainstorm/SKILL.md +60 -7
  66. package/skills/codereview/SKILL.md +16 -3
  67. package/skills/copywriting/SKILL.md +218 -0
  68. package/skills/cro/SKILL.md +234 -0
  69. package/skills/design-review/SKILL.md +217 -0
  70. package/skills/grill/SKILL.md +270 -0
  71. package/skills/improve-architecture/SKILL.md +205 -0
  72. package/skills/prd/SKILL.md +241 -0
  73. package/skills/recall/SKILL.md +36 -74
  74. package/skills/remember/SKILL.md +41 -91
  75. package/skills/seo-audit/SKILL.md +240 -0
  76. package/skills/tdd/SKILL.md +49 -4
  77. package/skills/write-skill/SKILL.md +18 -6
  78. package/templates/autopilot/PROMPT.md +39 -0
  79. package/templates/autopilot/README.md +122 -0
  80. package/templates/autopilot/devcontainer.json +21 -0
@@ -0,0 +1,241 @@
1
+ ---
2
+ name: prd
3
+ description: "Use when translating a product idea, feature request, or stakeholder requirement into a structured PRD with user stories, acceptance criteria, and GitHub issues."
4
+ user-invocable: true
5
+ argument-hint: "[feature or product idea]"
6
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep
7
+ ---
8
+
9
+ # /prd - Product Requirements Document
10
+
11
+ Transform product ideas into structured, implementable PRDs with user stories, acceptance criteria, and issue decomposition - bridging the gap between stakeholder intent and developer action.
12
+
13
+ **Target:** $ARGUMENTS
14
+
15
+ ## When to Use
16
+
17
+ - Translating a vague feature request into actionable requirements
18
+ - Starting a new feature that needs stakeholder alignment
19
+ - Converting user feedback into development tasks
20
+ - When `@product` or `@analyst` needs a structured output format
21
+ - Before `/plan` for features that need formal requirements
22
+ - NOT for: bug fixes (use `/debug`)
23
+ - NOT for: technical tasks with clear specs (use `/plan` directly)
24
+ - NOT for: exploratory ideation (use `/brainstorm` first)
25
+
26
+ ## Workflow
27
+
28
+ ### Step 1: Problem & Scope Definition
29
+
30
+ 1. **Identify the problem statement** - What pain point does this solve?
31
+ 2. **Define target users** - Primary and secondary personas
32
+ 3. **Establish success criteria** - Measurable outcomes (not vague goals)
33
+ 4. **Set scope boundaries** - Explicit in-scope and out-of-scope items
34
+ 5. **Scan existing codebase** for related features:
35
+
36
+ ```bash
37
+ # Find related modules, components, services
38
+ grep -rl "$KEYWORD" src/ --include="*.ts" --include="*.tsx" --include="*.vue" --include="*.svelte" 2>/dev/null | head -20
39
+ ```
40
+
41
+ **Output:**
42
+ ```markdown
43
+ ## 1. Problem & Scope
44
+
45
+ **Problem:** [Clear problem statement with evidence]
46
+ **Users:** [Primary: ..., Secondary: ...]
47
+ **Success Criteria:**
48
+ - [ ] [Measurable outcome 1]
49
+ - [ ] [Measurable outcome 2]
50
+ **In Scope:** [what's included]
51
+ **Out of Scope:** [what's explicitly excluded]
52
+ **Existing Code:** [related modules found in codebase]
53
+ ```
54
+
55
+ **BLOCKED** until problem statement is clear and measurable.
56
+
57
+ ### Step 2: User Stories & Acceptance Criteria
58
+
59
+ 1. **Write user stories** in standard format with Gherkin acceptance criteria
60
+ 2. **Cover all personas** identified in Step 1
61
+ 3. **Include edge cases** - What happens when things go wrong?
62
+ 4. **Prioritize stories** using MoSCoW (Must/Should/Could/Won't)
63
+
64
+ For each story:
65
+ ```markdown
66
+ ### US-[N]: [Story Title]
67
+
68
+ **As a** [persona],
69
+ **I want** [action],
70
+ **So that** [benefit].
71
+
72
+ **Priority:** Must Have | Should Have | Could Have | Won't Have
73
+
74
+ **Acceptance Criteria:**
75
+ ```gherkin
76
+ GIVEN [precondition]
77
+ WHEN [action]
78
+ THEN [expected result]
79
+
80
+ GIVEN [precondition]
81
+ WHEN [error condition]
82
+ THEN [error handling]
83
+ ```
84
+ ```
85
+
86
+ **BLOCKED** until at least 3 user stories with Gherkin criteria exist.
87
+
88
+ ### Step 3: Requirements Matrix
89
+
90
+ 1. **Functional requirements** - What the system must do
91
+ 2. **Non-functional requirements** - Performance, security, accessibility, i18n
92
+ 3. **Technical constraints** - Stack, infrastructure, API compatibility
93
+ 4. **Dependencies** - External services, other teams, data sources
94
+
95
+ **Output:**
96
+ ```markdown
97
+ ## 3. Requirements Matrix
98
+
99
+ ### Functional
100
+ | ID | Requirement | Priority | Story |
101
+ |----|------------|----------|-------|
102
+ | FR-1 | [requirement] | Must | US-1 |
103
+
104
+ ### Non-Functional
105
+ | ID | Requirement | Target | Measurement |
106
+ |----|------------|--------|-------------|
107
+ | NFR-1 | Response time | < 200ms p95 | Load test |
108
+ | NFR-2 | Accessibility | WCAG AA | Axe audit |
109
+
110
+ ### Constraints
111
+ - [Technical constraint 1]
112
+ - [Infrastructure constraint]
113
+
114
+ ### Dependencies
115
+ - [External service/team]
116
+ ```
117
+
118
+ ### Step 4: Technical Feasibility Scan
119
+
120
+ 1. **Scan codebase** for reusable patterns:
121
+
122
+ ```bash
123
+ # Identify existing patterns, services, utilities
124
+ find src/ -type f -name "*.ts" -o -name "*.tsx" | head -50
125
+ # Check for existing API routes
126
+ find src/ -path "*/api/*" -name "*.ts" 2>/dev/null | head -20
127
+ # Check for existing types/interfaces
128
+ grep -rn "interface\|type " src/types/ 2>/dev/null | head -20
129
+ ```
130
+
131
+ 2. **Identify integration points** - What existing code touches this feature?
132
+ 3. **Estimate new infrastructure** - New tables, APIs, services, queues needed
133
+ 4. **Flag risks** - Breaking changes, migration needs, data concerns
134
+
135
+ **Output:**
136
+ ```markdown
137
+ ## 4. Technical Feasibility
138
+
139
+ **Reusable:** [existing modules/patterns to leverage]
140
+ **New infrastructure:** [tables, APIs, services needed]
141
+ **Integration points:** [existing code that needs changes]
142
+ **Risks:** [breaking changes, migrations, data concerns]
143
+ ```
144
+
145
+ ### Step 5: Issue Decomposition
146
+
147
+ 1. **Break PRD into implementable issues** - Each issue is a single PR
148
+ 2. **Estimate size** - S (< 2h), M (2-4h), L (4-8h), XL (> 8h, split further)
149
+ 3. **Map dependencies** - Which issues block others?
150
+ 4. **Suggest agent assignments** - Which specialist agent handles each issue?
151
+
152
+ **Output:**
153
+ ```markdown
154
+ ## 5. Issue Breakdown
155
+
156
+ | # | Issue Title | Size | Depends On | Agent |
157
+ |---|------------|------|------------|-------|
158
+ | 1 | Create [model/schema] | S | - | @data |
159
+ | 2 | Implement [API endpoint] | M | #1 | @api |
160
+ | 3 | Build [UI component] | M | #2 | @builder |
161
+ | 4 | Add [tests] | M | #3 | @tester |
162
+ | 5 | Add [observability] | S | #2 | @builder |
163
+
164
+ **Critical Path:** #1 → #2 → #3 → #4
165
+ **Parallelizable:** #5 can run alongside #3-#4
166
+ ```
167
+
168
+ ### Step 6: PRD Document Generation
169
+
170
+ 1. **Compile all sections** into a single document
171
+ 2. **Write to file:** `docs/PRD-[feature-name].md`
172
+ 3. **Include metadata:** date, author, version, status (Draft/Review/Approved)
173
+
174
+ ### Step 7 (Optional): GitHub Issue Creation
175
+
176
+ If the user requests it, create issues:
177
+
178
+ ```bash
179
+ # Create issues from the breakdown
180
+ gh issue create --title "[Issue Title]" --body "[Description with acceptance criteria]" --label "feature,[size]"
181
+ ```
182
+
183
+ ## Verification Protocol
184
+
185
+ **Before claiming the PRD is complete:**
186
+
187
+ 1. Problem statement exists with measurable success criteria
188
+ 2. At least 3 user stories with Gherkin acceptance criteria
189
+ 3. Non-functional requirements have measurable targets (not "fast" but "< 200ms")
190
+ 4. Codebase scan was performed - reusable code identified
191
+ 5. Issue breakdown exists with size estimates and dependencies
192
+ 6. Every Must Have story maps to at least one issue
193
+ 7. PRD file was written to `docs/PRD-[name].md`
194
+ 8. No vague terms remain - all clarified with specifics
195
+
196
+ ## Anti-Rationalization
197
+
198
+ | Excuse | Reality |
199
+ |--------|---------|
200
+ | "Requirements are in my head" | Unwritten requirements become misunderstood requirements. Write them down. Memory is not documentation. |
201
+ | "We can figure out scope during development" | Scope creep costs 3-10x more than upfront definition. Define it now. |
202
+ | "User stories are too formal" | Stories are negotiable contracts, not bureaucracy. They prevent the rework that comes from verbal specs. |
203
+ | "The PRD will be outdated immediately" | A living document beats no document. Update as you learn. Outdated > nonexistent. |
204
+ | "Just tell the developer what to build" | Developers need acceptance criteria, not verbal instructions that get lost between Slack messages. |
205
+ | "NFRs are obvious, we don't need to write them" | "Fast" means 50ms to one person and 2s to another. Write the number. |
206
+ | "We'll add acceptance criteria later" | Criteria written after implementation are just documentation, not specifications. Write them first. |
207
+
208
+ ## Rules
209
+
210
+ 1. **Problem before solution** - Never write user stories without a clear problem statement
211
+ 2. **Measurable criteria only** - Every success metric and NFR must have a number
212
+ 3. **Gherkin is mandatory** - Every user story gets GIVEN/WHEN/THEN acceptance criteria
213
+ 4. **Codebase grounded** - Scan existing code before proposing new infrastructure
214
+ 5. **Issues must be PR-sized** - Any XL issue must be split further
215
+ 6. **MoSCoW prioritization** - Every story gets a priority, no "everything is Must Have"
216
+ 7. **Dependencies explicit** - Every issue lists what it blocks and what blocks it
217
+ 8. **Agent-ready** - Each issue suggests which specialist agent should handle it
218
+
219
+ ## Output
220
+
221
+ ```
222
+ ──── /prd ────
223
+ Feature: $ARGUMENTS
224
+
225
+ Problem: [1-line problem statement]
226
+ Users: [primary persona]
227
+ Stories: [N] (Must: X, Should: Y, Could: Z)
228
+
229
+ Requirements:
230
+ Functional: N
231
+ Non-Functional: N
232
+ Constraints: N
233
+
234
+ Issues: N (S: X, M: Y, L: Z)
235
+ Critical Path: [issue chain]
236
+
237
+ PRD saved: docs/PRD-[name].md
238
+ Issues created: [N] (if requested)
239
+
240
+ ──── Ready for /plan ────
241
+ ```
@@ -3,99 +3,64 @@ name: recall
3
3
  description: "Use when you need to retrieve a past decision, preference, or convention that was saved with /remember."
4
4
  user-invocable: true
5
5
  argument-hint: "[topic or 'all']"
6
- allowed-tools: Read
6
+ allowed-tools: Read, Glob
7
7
  ---
8
8
 
9
- # /recall - Query Session Memory
9
+ # /recall - Query Project Memory
10
10
 
11
- Recall decisions, preferences, and lessons from previous sessions.
11
+ Recall decisions, preferences, and lessons from previous sessions using Claude Code's native auto-memory system.
12
12
 
13
13
  **Query:** $ARGUMENTS
14
14
 
15
15
  ## Workflow
16
16
 
17
- ### Step 1: Load Memory
17
+ ### Step 1: Load Memory Index
18
18
 
19
- ```javascript
20
- const memoryFile = '.claude/session-memory.json';
19
+ Read `MEMORY.md` from the memory directory. This file is automatically loaded into conversation context, so it may already be available.
21
20
 
22
- if (!exists(memoryFile)) {
23
- return "No session memory found. Use /remember to save memories.";
24
- }
25
-
26
- const memory = JSON.parse(read(memoryFile));
27
- ```
21
+ Memory directory: `.claude/projects/<project-hash>/memory/`
28
22
 
29
23
  ### Step 2: Process Query
30
24
 
31
25
  #### If "all" or empty:
32
- Show full memory summary.
26
+ Show full memory summary by reading all memory files listed in MEMORY.md.
33
27
 
34
28
  #### If specific topic:
35
- Search in:
36
- 1. decisions[].topic
37
- 2. preferences keys
38
- 3. patterns.avoided
39
- 4. patterns.preferred
40
- 5. lessons[].issue
29
+ Search memory file names, descriptions, and content for matches.
30
+
31
+ ### Step 3: Read Relevant Files
41
32
 
42
- ### Step 3: Format Output
33
+ For matched memories, read the full `.md` file to get details including Why and How to apply.
43
34
 
44
35
  ## Output Formats
45
36
 
46
37
  ### Full Memory (/recall all)
47
38
  ```
48
39
  ══════════════════════════════════════════════
49
- 📝 PROJECT MEMORY
40
+ PROJECT MEMORY
50
41
  ══════════════════════════════════════════════
51
42
 
52
- Project: [name]
53
- Last updated: [date]
54
-
55
- ──────────────────────────────────────────────
56
- DECISIONS (N)
57
- ──────────────────────────────────────────────
58
-
59
- • [Topic]: [Decision]
60
- Reason: [Why]
61
- Date: [When]
62
-
63
- • [Topic]: [Decision]
64
- Reason: [Why]
65
- Date: [When]
66
-
67
43
  ──────────────────────────────────────────────
68
- PREFERENCES
44
+ DECISIONS & CONTEXT (project)
69
45
  ──────────────────────────────────────────────
70
46
 
71
- Code Style:
72
- • Quotes: [value]
73
- • Indent: [value]
74
- • Semicolons: [value]
75
-
76
- Naming:
77
- • Components: [convention]
78
- • Files: [convention]
47
+ - [Topic]: [Decision]
48
+ Why: [Reason]
49
+ How to apply: [Guidance]
79
50
 
80
51
  ──────────────────────────────────────────────
81
- PATTERNS
52
+ PREFERENCES & LESSONS (feedback)
82
53
  ──────────────────────────────────────────────
83
54
 
84
- ✓ Preferred:
85
- • [pattern]
86
- • [pattern]
87
-
88
- ✗ Avoided:
89
- • [pattern]
90
- • [pattern]
55
+ - [Rule or preference]
56
+ Why: [Reason]
57
+ How to apply: [When/where]
91
58
 
92
59
  ──────────────────────────────────────────────
93
- LESSONS LEARNED (N)
60
+ REFERENCES
94
61
  ──────────────────────────────────────────────
95
62
 
96
- • Issue: [what happened]
97
- Solution: [how to fix]
98
- Prevention: [rule]
63
+ - [Resource]: [Where to find it]
99
64
 
100
65
  ══════════════════════════════════════════════
101
66
  ```
@@ -106,16 +71,14 @@ Naming:
106
71
 
107
72
  Found 2 related memories:
108
73
 
109
- 📌 Decision: State Management
74
+ Decision: State Management (project)
110
75
  Use Zustand instead of Redux
111
- Reason: Simpler API, less boilerplate
112
- Decided: 2024-01-15
113
-
114
- 📌 Pattern (Avoid): Redux
115
- We avoid Redux in this project
76
+ Why: Simpler API, less boilerplate
77
+ How to apply: All new state should use Zustand
116
78
 
117
- Related:
118
- • See also: "React Query" decision
79
+ Pattern (feedback):
80
+ Never use Redux in this project
81
+ Why: Team consensus on simplicity
119
82
  ```
120
83
 
121
84
  ### No Results
@@ -125,8 +88,8 @@ Related:
125
88
  No memories found for "[topic]".
126
89
 
127
90
  Suggestions:
128
- • Try /recall all to see all memories
129
- • Use /remember to add new memories
91
+ - Try /recall all to see all memories
92
+ - Use /remember to add new memories
130
93
  ```
131
94
 
132
95
  ## Query Examples
@@ -136,15 +99,14 @@ Suggestions:
136
99
  /recall all # Show all memories
137
100
  /recall state management # Search for topic
138
101
  /recall testing # Search for topic
139
- /recall decisions # Show only decisions
140
- /recall preferences # Show only preferences
141
- /recall patterns # Show patterns
142
- /recall lessons # Show lessons learned
102
+ /recall decisions # Show only project-type memories
103
+ /recall preferences # Show only feedback-type memories
104
+ /recall references # Show only reference-type memories
143
105
  ```
144
106
 
145
107
  ## Rules
146
108
 
147
- 1. **Fuzzy match** - "state" matches "State Management"
148
- 2. **Show context** - Include reason and date
109
+ 1. **Fuzzy match** - "state" matches "state-management-decision"
110
+ 2. **Show context** - Include Why and How to apply
149
111
  3. **Suggest related** - Link to similar memories
150
- 4. **Handle empty** - Graceful message if no memory
112
+ 4. **Handle empty** - Graceful message if no memory exists
@@ -3,12 +3,12 @@ name: remember
3
3
  description: "Use when making a decision, choosing a convention, or learning a lesson that should persist across sessions."
4
4
  user-invocable: true
5
5
  argument-hint: "[what to remember]"
6
- allowed-tools: Read, Write
6
+ allowed-tools: Read, Write, Glob
7
7
  ---
8
8
 
9
- # /remember - Save to Session Memory
9
+ # /remember - Save to Project Memory
10
10
 
11
- Save decisions, preferences, and lessons that persist across sessions.
11
+ Save decisions, preferences, and lessons that persist across sessions using Claude Code's native auto-memory system.
12
12
 
13
13
  **Input:** $ARGUMENTS
14
14
 
@@ -17,103 +17,53 @@ Save decisions, preferences, and lessons that persist across sessions.
17
17
  ### Step 1: Parse Input
18
18
 
19
19
  Detect type of memory:
20
- - **Decision**: "Use X instead of Y because Z"
21
- - **Preference**: "Always use single quotes"
22
- - **Pattern avoid**: "Never use any types"
23
- - **Pattern prefer**: "Prefer composition over inheritance"
24
- - **Lesson**: "API changed and broke app. Solution: version contracts"
25
-
26
- ### Step 2: Load Existing Memory
27
-
28
- ```javascript
29
- const memoryFile = '.claude/session-memory.json';
30
- let memory = {};
31
-
32
- if (exists(memoryFile)) {
33
- memory = JSON.parse(read(memoryFile));
34
- } else {
35
- memory = {
36
- version: "1.0",
37
- projectId: getProjectName(),
38
- created: new Date().toISOString(),
39
- decisions: [],
40
- preferences: {},
41
- context: {},
42
- patterns: { avoided: [], preferred: [] },
43
- lessons: []
44
- };
45
- }
46
- ```
20
+ - **Decision** → type: `project` (e.g., "Use X instead of Y because Z")
21
+ - **Preference** → type: `feedback` (e.g., "Always use single quotes")
22
+ - **Pattern avoid** → type: `feedback` (e.g., "Never use any types")
23
+ - **Pattern prefer** → type: `feedback` (e.g., "Prefer composition over inheritance")
24
+ - **Lesson** → type: `feedback` (e.g., "API changed and broke app. Solution: version contracts")
25
+ - **Project context** → type: `project` (e.g., "Merge freeze starts March 5")
26
+ - **External resource** → type: `reference` (e.g., "Bugs tracked in Linear project INGEST")
47
27
 
48
- ### Step 3: Add to Memory
49
-
50
- #### For Decisions:
51
- ```json
52
- {
53
- "id": "d001",
54
- "date": "2024-01-15",
55
- "topic": "[extracted topic]",
56
- "decision": "[what was decided]",
57
- "reason": "[why]",
58
- "agent": "[current agent or 'user']"
59
- }
60
- ```
28
+ ### Step 2: Create Memory File
61
29
 
62
- #### For Preferences:
63
- ```json
64
- {
65
- "preferences": {
66
- "[category]": {
67
- "[key]": "[value]"
68
- }
69
- }
70
- }
71
- ```
30
+ Write a markdown file to the memory directory with frontmatter:
72
31
 
73
- #### For Patterns:
74
- ```json
75
- {
76
- "patterns": {
77
- "avoided": ["[pattern]"],
78
- "preferred": ["[pattern]"]
79
- }
80
- }
81
- ```
32
+ ```markdown
33
+ ---
34
+ name: [kebab-case-topic-name]
35
+ description: [one-line description for relevance matching]
36
+ type: [project | feedback | reference]
37
+ ---
38
+
39
+ [Memory content]
82
40
 
83
- #### For Lessons:
84
- ```json
85
- {
86
- "lessons": [{
87
- "date": "2024-01-15",
88
- "issue": "[what happened]",
89
- "solution": "[how to fix]",
90
- "preventionRule": "[how to prevent]"
91
- }]
92
- }
41
+ **Why:** [reason or context]
42
+ **How to apply:** [when/where this applies]
93
43
  ```
94
44
 
95
- ### Step 4: Save Memory
45
+ Memory directory: `.claude/projects/<project-hash>/memory/`
96
46
 
97
- ```javascript
98
- memory.updated = new Date().toISOString();
99
- write(memoryFile, JSON.stringify(memory, null, 2));
100
- ```
47
+ ### Step 3: Update Memory Index
48
+
49
+ Add an entry to `MEMORY.md` in the memory directory. Keep it concise - just a link and brief description.
50
+
51
+ ### Step 4: Check for Duplicates
52
+
53
+ Before creating a new file, check if a memory on the same topic already exists. If yes, UPDATE the existing file instead of creating a duplicate.
101
54
 
102
55
  ## Output
103
56
 
104
57
  ```
105
58
  ──── /remember ────
106
59
 
107
- ✓ Saved to session memory
60
+ Saved to project memory
108
61
 
109
- Type: [Decision | Preference | Pattern | Lesson]
62
+ Type: [Decision | Preference | Pattern | Lesson | Context | Reference]
110
63
  Topic: [topic]
111
64
  Content: [what was saved]
112
65
 
113
- This will be recalled in future sessions.
114
-
115
- Memory file: .claude/session-memory.json
116
- Total memories: [N] decisions, [N] preferences, [N] patterns, [N] lessons
66
+ This will be recalled in future sessions via MEMORY.md.
117
67
  ```
118
68
 
119
69
  ## Examples
@@ -125,14 +75,12 @@ Total memories: [N] decisions, [N] preferences, [N] patterns, [N] lessons
125
75
 
126
76
  Output:
127
77
  ```
128
- ✓ Saved to session memory
78
+ Saved to project memory
129
79
 
130
- Type: Decision
80
+ Type: Decision (project)
131
81
  Topic: State Management
132
82
  Content: Use Zustand instead of Redux
133
- Reason: Simpler
134
-
135
- This will be recalled in future sessions.
83
+ Reason: Simpler API, less boilerplate
136
84
  ```
137
85
 
138
86
  ### Remember a Preference
@@ -152,7 +100,9 @@ This will be recalled in future sessions.
152
100
 
153
101
  ## Rules
154
102
 
155
- 1. **Extract key info** - Don't store raw text
156
- 2. **Categorize correctly** - Decision vs preference vs pattern
103
+ 1. **Extract key info** - Don't store raw text, structure with Why/How to apply
104
+ 2. **Categorize correctly** - Use correct memory type (project, feedback, reference)
157
105
  3. **No duplicates** - Update existing if same topic
158
- 4. **No secrets** - Never store credentials
106
+ 4. **No secrets** - Never store credentials or PII
107
+ 5. **Convert dates** - Use absolute dates, not relative ("2026-03-05" not "Thursday")
108
+ 6. **Keep MEMORY.md under 200 lines** - Be concise in the index