@unifiedmemory/cli 1.3.14 → 1.3.15
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/lib/memory-instructions.js +48 -54
- package/package.json +1 -1
|
@@ -1,82 +1,76 @@
|
|
|
1
1
|
// Unique marker to detect if instructions already present
|
|
2
|
-
export const MEMORY_INSTRUCTIONS_MARKER = '<!--
|
|
2
|
+
export const MEMORY_INSTRUCTIONS_MARKER = '<!-- UNIFIEDMEMORY_INSTRUCTIONS_V3 -->';
|
|
3
3
|
|
|
4
4
|
export function getMemoryInstructions() {
|
|
5
5
|
return `${MEMORY_INSTRUCTIONS_MARKER}
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# STOP - Read Before ANY Code Task
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**MANDATORY**: Call \`search_notes\` BEFORE writing any code. Always. No exceptions.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Pre-Implementation Checklist
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Before ANY coding task, you MUST:
|
|
14
|
+
- [ ] Call \`search_notes\` with relevant keywords
|
|
15
|
+
- [ ] Review results for existing patterns/decisions
|
|
16
|
+
- [ ] Mention what you found (or didn't) in your response
|
|
17
|
+
- [ ] THEN start implementation
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|------|---------|---------------------|
|
|
17
|
-
| \`search_notes\` | **Primary tool** - Search project knowledge base | \`query\` (search text) |
|
|
18
|
-
| \`create_note\` | Record decisions, plans, or completions | \`summary_text\`, \`topic\` |
|
|
19
|
-
| \`list_notes\` | List all notes in current project | None |
|
|
20
|
-
| \`get_note\` | Retrieve a specific note by ID | \`note_id\` |
|
|
21
|
-
| \`list_topics\` | List available topics/categories | None |
|
|
22
|
-
| \`create_topic\` | Create a new topic for organization | \`name\` |
|
|
23
|
-
| \`list_projects\` | List available projects | None |
|
|
19
|
+
---
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
## WRONG
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
\`\`\`
|
|
24
|
+
User: "Create a calculator app"
|
|
25
|
+
Assistant: [immediately writes code] ← NEVER DO THIS
|
|
26
|
+
\`\`\`
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
## CORRECT
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
\`\`\`
|
|
31
|
+
User: "Create a calculator app"
|
|
32
|
+
Assistant: [calls search_notes first]
|
|
33
|
+
Assistant: "No relevant patterns found in UnifiedMemory. Proceeding..."
|
|
34
|
+
Assistant: [writes code]
|
|
35
|
+
\`\`\`
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
---
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
- Implementing any feature (search for existing patterns)
|
|
40
|
-
- Fixing any bug (search for related issues)
|
|
41
|
-
- Answering architecture questions (search for design decisions)
|
|
42
|
-
- Modifying any component (search for existing conventions)
|
|
43
|
-
- ANY coding task, no exceptions
|
|
39
|
+
## When to Search (ALWAYS)
|
|
44
40
|
|
|
45
|
-
|
|
41
|
+
- Before implementing ANY feature ← search first
|
|
42
|
+
- Before fixing ANY bug ← search first
|
|
43
|
+
- Before answering architecture questions ← search first
|
|
44
|
+
- Before modifying ANY component ← search first
|
|
45
|
+
- For "simple" tasks ← search first (context always helps)
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
User: "Add authentication to the API"
|
|
49
|
-
|
|
50
|
-
Step 1: Call search_notes with query "authentication API security"
|
|
51
|
-
Step 2: Review results - found: "Decision: Use JWT with refresh tokens"
|
|
52
|
-
Step 3: Implement following the established pattern
|
|
53
|
-
Step 4: Respond: "Based on prior decisions in UnifiedMemory, I'll use JWT..."
|
|
54
|
-
\`\`\`
|
|
47
|
+
---
|
|
55
48
|
|
|
56
|
-
##
|
|
49
|
+
## MCP Tool Reference
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
| Tool | Purpose | Parameters |
|
|
52
|
+
|------|---------|------------|
|
|
53
|
+
| \`search_notes\` | **Search knowledge base** | \`body: {q: "search text"}\` |
|
|
54
|
+
| \`create_note\` | Record decisions/completions | \`body: {summary_text: "...", topic: "..."}\` |
|
|
55
|
+
| \`list_notes\` | Browse all notes | None |
|
|
56
|
+
| \`get_note\` | Get note by ID | \`body: {note_id: "..."}\` |
|
|
57
|
+
| \`list_topics\` | List categories | None |
|
|
58
|
+
| \`create_topic\` | Create category | \`body: {name: "..."}\` |
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
Project context is automatic - no extra config needed.
|
|
66
61
|
|
|
67
|
-
|
|
68
|
-
- Implementation decisions and rationale
|
|
69
|
-
- Completed features or fixes
|
|
70
|
-
- Architectural patterns established
|
|
71
|
-
- Gotchas or lessons learned
|
|
62
|
+
---
|
|
72
63
|
|
|
73
|
-
|
|
64
|
+
## After Completing Work
|
|
74
65
|
|
|
75
|
-
|
|
66
|
+
Use \`create_note\` to record:
|
|
67
|
+
- Decisions and rationale (the "why")
|
|
68
|
+
- Patterns established
|
|
69
|
+
- Gotchas or lessons learned
|
|
76
70
|
|
|
77
|
-
|
|
71
|
+
Keep notes under 1000 chars. Focus on "why" not "what".
|
|
78
72
|
|
|
79
73
|
---
|
|
80
|
-
*UnifiedMemory
|
|
74
|
+
*UnifiedMemory - \`search_notes\` FIRST, code SECOND*
|
|
81
75
|
`;
|
|
82
76
|
}
|