synabun 1.3.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/CHANGELOG.md +665 -0
- package/LICENSE +191 -0
- package/README.md +853 -0
- package/hooks/claude-code/post-plan.mjs +391 -0
- package/hooks/claude-code/post-remember.mjs +239 -0
- package/hooks/claude-code/pre-compact.mjs +241 -0
- package/hooks/claude-code/pre-websearch.mjs +90 -0
- package/hooks/claude-code/prompt-submit.mjs +861 -0
- package/hooks/claude-code/session-start.mjs +494 -0
- package/hooks/claude-code/shared.mjs +368 -0
- package/hooks/claude-code/stop.mjs +646 -0
- package/hooks/claude-code/test-user-learning.mjs +531 -0
- package/mcp-server/package.json +38 -0
- package/mcp-server/run.mjs +10 -0
- package/mcp-server/src/config.ts +70 -0
- package/mcp-server/src/http.ts +93 -0
- package/mcp-server/src/index.ts +203 -0
- package/mcp-server/src/preload-http.ts +25 -0
- package/mcp-server/src/preload.ts +29 -0
- package/mcp-server/src/scripts/migrate-qdrant-to-sqlite.ts +506 -0
- package/mcp-server/src/services/categories.ts +429 -0
- package/mcp-server/src/services/discord.ts +702 -0
- package/mcp-server/src/services/file-checksums.ts +33 -0
- package/mcp-server/src/services/local-embeddings.ts +77 -0
- package/mcp-server/src/services/neural-interface.ts +344 -0
- package/mcp-server/src/services/sqlite.ts +823 -0
- package/mcp-server/src/tools/browser-advanced.ts +123 -0
- package/mcp-server/src/tools/browser-interact.ts +255 -0
- package/mcp-server/src/tools/browser-navigate.ts +77 -0
- package/mcp-server/src/tools/browser-observe.ts +1330 -0
- package/mcp-server/src/tools/browser.ts +107 -0
- package/mcp-server/src/tools/card-tools.ts +193 -0
- package/mcp-server/src/tools/card.ts +22 -0
- package/mcp-server/src/tools/category.ts +379 -0
- package/mcp-server/src/tools/discord-channel.ts +274 -0
- package/mcp-server/src/tools/discord-guild.ts +188 -0
- package/mcp-server/src/tools/discord-member.ts +158 -0
- package/mcp-server/src/tools/discord-message.ts +231 -0
- package/mcp-server/src/tools/discord-onboarding.ts +228 -0
- package/mcp-server/src/tools/discord-role.ts +209 -0
- package/mcp-server/src/tools/discord-thread.ts +110 -0
- package/mcp-server/src/tools/discord-webhook.ts +176 -0
- package/mcp-server/src/tools/discord.ts +40 -0
- package/mcp-server/src/tools/forget.ts +38 -0
- package/mcp-server/src/tools/git-tools.ts +141 -0
- package/mcp-server/src/tools/git.ts +13 -0
- package/mcp-server/src/tools/image-tools.ts +98 -0
- package/mcp-server/src/tools/image.ts +17 -0
- package/mcp-server/src/tools/leonardo-browser-tools.ts +281 -0
- package/mcp-server/src/tools/leonardo.ts +28 -0
- package/mcp-server/src/tools/loop.ts +348 -0
- package/mcp-server/src/tools/memories.ts +118 -0
- package/mcp-server/src/tools/recall.ts +323 -0
- package/mcp-server/src/tools/reflect.ts +145 -0
- package/mcp-server/src/tools/remember.ts +115 -0
- package/mcp-server/src/tools/response.ts +26 -0
- package/mcp-server/src/tools/restore.ts +34 -0
- package/mcp-server/src/tools/sync.ts +114 -0
- package/mcp-server/src/tools/tictactoe-tools.ts +98 -0
- package/mcp-server/src/tools/tictactoe.ts +13 -0
- package/mcp-server/src/tools/utils.ts +25 -0
- package/mcp-server/src/tools/whiteboard-tools.ts +260 -0
- package/mcp-server/src/tools/whiteboard.ts +22 -0
- package/mcp-server/src/tui.ts +940 -0
- package/mcp-server/src/types.ts +85 -0
- package/mcp-server/tsconfig.json +19 -0
- package/neural-interface/package.json +27 -0
- package/neural-interface/public/apple-touch-icon.png +0 -0
- package/neural-interface/public/category-logos/claude.svg +1 -0
- package/neural-interface/public/category-logos/gemini-color.svg +1 -0
- package/neural-interface/public/category-logos/openai.svg +1 -0
- package/neural-interface/public/category-logos/synabun.png +0 -0
- package/neural-interface/public/claude-chat.css +878 -0
- package/neural-interface/public/claude-chat.html +92 -0
- package/neural-interface/public/claude-chat.js +1168 -0
- package/neural-interface/public/favicon-16x16.png +0 -0
- package/neural-interface/public/favicon-32x32.png +0 -0
- package/neural-interface/public/gallery.svg +6 -0
- package/neural-interface/public/icon-192.png +0 -0
- package/neural-interface/public/icon-512.png +0 -0
- package/neural-interface/public/index-legacy.html +14677 -0
- package/neural-interface/public/index.html +212 -0
- package/neural-interface/public/index2d-legacy.html +8193 -0
- package/neural-interface/public/index2d.html +127 -0
- package/neural-interface/public/invite.html +351 -0
- package/neural-interface/public/leonardoai.svg +1 -0
- package/neural-interface/public/logo-synabun.png +0 -0
- package/neural-interface/public/logoHD.png +0 -0
- package/neural-interface/public/manifest.json +14 -0
- package/neural-interface/public/offline.html +299 -0
- package/neural-interface/public/onboarding.html +2335 -0
- package/neural-interface/public/openclaw-logo-text.png +0 -0
- package/neural-interface/public/pin-svgrepo-com.svg +25 -0
- package/neural-interface/public/sessionicon.svg +8 -0
- package/neural-interface/public/shared/ansi-parser.js +305 -0
- package/neural-interface/public/shared/api.js +1043 -0
- package/neural-interface/public/shared/colors.js +153 -0
- package/neural-interface/public/shared/constants.js +141 -0
- package/neural-interface/public/shared/html-shell.js +777 -0
- package/neural-interface/public/shared/html-term-renderer.js +1022 -0
- package/neural-interface/public/shared/i18n.js +147 -0
- package/neural-interface/public/shared/registry.js +82 -0
- package/neural-interface/public/shared/state.js +86 -0
- package/neural-interface/public/shared/storage.js +150 -0
- package/neural-interface/public/shared/styles.css +21212 -0
- package/neural-interface/public/shared/ui-automation-studio.js +3573 -0
- package/neural-interface/public/shared/ui-bookmarks.js +231 -0
- package/neural-interface/public/shared/ui-claude-panel.js +6333 -0
- package/neural-interface/public/shared/ui-command-runner.js +534 -0
- package/neural-interface/public/shared/ui-cost-widget.js +602 -0
- package/neural-interface/public/shared/ui-detail.js +1454 -0
- package/neural-interface/public/shared/ui-explorer.js +1356 -0
- package/neural-interface/public/shared/ui-file-explorer.js +2750 -0
- package/neural-interface/public/shared/ui-games.js +411 -0
- package/neural-interface/public/shared/ui-help.js +107 -0
- package/neural-interface/public/shared/ui-image-gallery.js +461 -0
- package/neural-interface/public/shared/ui-invite.js +519 -0
- package/neural-interface/public/shared/ui-keybinds.js +452 -0
- package/neural-interface/public/shared/ui-layouts.js +297 -0
- package/neural-interface/public/shared/ui-link.js +731 -0
- package/neural-interface/public/shared/ui-loading.js +255 -0
- package/neural-interface/public/shared/ui-menubar.js +499 -0
- package/neural-interface/public/shared/ui-multiselect.js +93 -0
- package/neural-interface/public/shared/ui-navbar.js +222 -0
- package/neural-interface/public/shared/ui-notifications.js +287 -0
- package/neural-interface/public/shared/ui-panels.js +309 -0
- package/neural-interface/public/shared/ui-resume.js +653 -0
- package/neural-interface/public/shared/ui-search.js +145 -0
- package/neural-interface/public/shared/ui-sessions.js +531 -0
- package/neural-interface/public/shared/ui-settings.js +5987 -0
- package/neural-interface/public/shared/ui-sidebar.js +1905 -0
- package/neural-interface/public/shared/ui-skills.js +2805 -0
- package/neural-interface/public/shared/ui-stats.js +38 -0
- package/neural-interface/public/shared/ui-sync.js +201 -0
- package/neural-interface/public/shared/ui-terminal.js +6385 -0
- package/neural-interface/public/shared/ui-tooltip.js +123 -0
- package/neural-interface/public/shared/ui-trash.js +439 -0
- package/neural-interface/public/shared/ui-tutorial-draw.js +875 -0
- package/neural-interface/public/shared/ui-tutorial-steps.js +2276 -0
- package/neural-interface/public/shared/ui-tutorial.js +1117 -0
- package/neural-interface/public/shared/ui-update.js +244 -0
- package/neural-interface/public/shared/ui-whiteboard.js +3262 -0
- package/neural-interface/public/shared/ui-workspaces.js +722 -0
- package/neural-interface/public/shared/utils.js +360 -0
- package/neural-interface/public/shared/vterm-buffer.js +1102 -0
- package/neural-interface/public/sw.js +52 -0
- package/neural-interface/public/synabun.png +0 -0
- package/neural-interface/public/toolbar-album.svg +8 -0
- package/neural-interface/public/toolbar-question.svg +6 -0
- package/neural-interface/public/toolbar-sessions.svg +6 -0
- package/neural-interface/public/variant/2d/background.js +113 -0
- package/neural-interface/public/variant/2d/context-menu.js +133 -0
- package/neural-interface/public/variant/2d/gfx.js +45 -0
- package/neural-interface/public/variant/2d/graph.js +1635 -0
- package/neural-interface/public/variant/2d/hulls.js +207 -0
- package/neural-interface/public/variant/2d/lasso.js +135 -0
- package/neural-interface/public/variant/2d/layout.js +594 -0
- package/neural-interface/public/variant/2d/main.js +521 -0
- package/neural-interface/public/variant/2d/minimap.js +312 -0
- package/neural-interface/public/variant/2d/settings-gfx.js +98 -0
- package/neural-interface/public/variant/3d/background.js +884 -0
- package/neural-interface/public/variant/3d/camera.js +661 -0
- package/neural-interface/public/variant/3d/gfx.js +116 -0
- package/neural-interface/public/variant/3d/graph.js +2399 -0
- package/neural-interface/public/variant/3d/main.js +500 -0
- package/neural-interface/public/variant/3d/settings-gfx.js +228 -0
- package/neural-interface/scripts/rebuild-pty.js +100 -0
- package/neural-interface/server.js +15000 -0
- package/neural-interface/templates/CLAUDE-template.md +211 -0
- package/package.json +53 -0
- package/postinstall.js +135 -0
- package/setup.js +260 -0
- package/skills/leonardo/SKILL.md +159 -0
- package/skills/leonardo/icon.svg +1 -0
- package/skills/leonardo/modules/browser-guide.md +378 -0
- package/skills/leonardo/modules/image-prompter.md +277 -0
- package/skills/leonardo/modules/model-advisor.md +100 -0
- package/skills/leonardo/modules/prompt-library.md +110 -0
- package/skills/leonardo/modules/style-guide.md +186 -0
- package/skills/leonardo/modules/video-prompter.md +311 -0
- package/skills/synabun/SKILL.md +185 -0
- package/skills/synabun/icon.png +0 -0
- package/skills/synabun/modules/audit.md +374 -0
- package/skills/synabun/modules/changelog.md +194 -0
- package/skills/synabun/modules/idea.md +144 -0
- package/skills/synabun/modules/memorize.md +188 -0
- package/skills/synabun/synabunicon.png +0 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
# Audit — Memory Validation Against Codebase
|
|
2
|
+
|
|
3
|
+
You are now in **memory audit mode**. Your job is to systematically validate SynaBun memories against the current state of the codebase, identify stale or invalid memories, and help the user clean them up interactively.
|
|
4
|
+
|
|
5
|
+
**Input scope**: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
- If the input is empty → interactively ask the user to choose a scope (Phase 1b)
|
|
8
|
+
- If the input is "all" → audit all categories
|
|
9
|
+
- If the input matches a category name → audit that category (and its children if it is a parent)
|
|
10
|
+
|
|
11
|
+
## CRITICAL: SynaBun MCP Tool Quirks
|
|
12
|
+
|
|
13
|
+
- Make ALL SynaBun MCP calls **sequentially** (never in parallel — one failure cascades to all sibling calls in the batch).
|
|
14
|
+
- `remember` accepts `tags` and `importance` directly and returns the full UUID.
|
|
15
|
+
- `reflect` requires the **FULL UUID** (e.g., `8f7cab3b-644e-4cea-8662-de0ca695bdf2`). Use the UUID returned by `remember`, or `recall` to find existing memories.
|
|
16
|
+
- The `forget` tool also requires the full UUID.
|
|
17
|
+
- The `memories` tool maxes out at 50 results per call. If a category has more than 50 memories, warn the user that only the 50 most recent will be audited.
|
|
18
|
+
|
|
19
|
+
## Classification Definitions
|
|
20
|
+
|
|
21
|
+
| Status | Meaning | Default Action |
|
|
22
|
+
|--------|---------|----------------|
|
|
23
|
+
| **VALID** | Memory content is still accurate per the current codebase | Keep as-is |
|
|
24
|
+
| **STALE** | Memory references something that has changed — info is outdated | Update via `reflect` |
|
|
25
|
+
| **INVALID** | Memory references things that no longer exist (deleted files, removed functions, renamed patterns) | Delete via `forget` |
|
|
26
|
+
| **UNVERIFIABLE** | Cannot determine accuracy from code alone (process decisions, external API behavior, user preferences, conversation context) | Skip (manual review) |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Process
|
|
31
|
+
|
|
32
|
+
Execute these phases in order. Do NOT skip phases or combine them.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
### Phase 1 — Configuration
|
|
37
|
+
|
|
38
|
+
This phase collects three pieces of information: audit scope, model choice, and user confirmation.
|
|
39
|
+
|
|
40
|
+
#### Step 1a: Landscape Survey
|
|
41
|
+
|
|
42
|
+
1. Call `category_list` with format `tree` to get the full category hierarchy.
|
|
43
|
+
2. Call `memories` with action `stats` to get total counts and per-category breakdowns.
|
|
44
|
+
3. Internalize the results — you'll need them for every subsequent step.
|
|
45
|
+
|
|
46
|
+
#### Step 1b: Scope Selection
|
|
47
|
+
|
|
48
|
+
**If `$ARGUMENTS` is not empty and is not "all":**
|
|
49
|
+
- Check if the argument matches a category name (parent or child) from the tree.
|
|
50
|
+
- If it matches a parent, the scope is that parent and all its children.
|
|
51
|
+
- If it matches a child, the scope is just that child category.
|
|
52
|
+
- If it matches nothing, inform the user and fall through to interactive selection.
|
|
53
|
+
|
|
54
|
+
**If `$ARGUMENTS` is "all":**
|
|
55
|
+
- Scope is every category. Proceed to Step 1c.
|
|
56
|
+
|
|
57
|
+
**If `$ARGUMENTS` is empty or did not match:**
|
|
58
|
+
|
|
59
|
+
Use `AskUserQuestion` with these options:
|
|
60
|
+
|
|
61
|
+
- **Audit everything** — "Full audit of all [N] memories across all categories"
|
|
62
|
+
- **Audit a parent category** — "Audit a parent and all its children"
|
|
63
|
+
- **Audit a specific category** — "Audit just one category"
|
|
64
|
+
|
|
65
|
+
If user picks **parent category**, follow up with another `AskUserQuestion` listing only parent categories with their total memory counts (sum of parent + all children). Let the user pick one.
|
|
66
|
+
|
|
67
|
+
If user picks **specific category**, follow up with another `AskUserQuestion` listing all categories (flat) with their memory counts. Let the user pick one.
|
|
68
|
+
|
|
69
|
+
#### Step 1c: Model Selection
|
|
70
|
+
|
|
71
|
+
Use `AskUserQuestion` to ask which model should verify memories against code:
|
|
72
|
+
|
|
73
|
+
- **Sonnet (Recommended)** — "Good balance of quality and cost"
|
|
74
|
+
- **Opus** — "Most thorough analysis, highest token cost"
|
|
75
|
+
- **Haiku** — "Fastest and cheapest, may miss subtle staleness"
|
|
76
|
+
|
|
77
|
+
Store the selection. This will be used as the `model` parameter when calling the `Task` tool in Phase 4.
|
|
78
|
+
|
|
79
|
+
#### Step 1d: Cost Warning and Confirmation
|
|
80
|
+
|
|
81
|
+
Calculate the estimated scope:
|
|
82
|
+
- Count total memories in scope (from stats).
|
|
83
|
+
- Count categories in scope.
|
|
84
|
+
|
|
85
|
+
Use `AskUserQuestion`:
|
|
86
|
+
|
|
87
|
+
- **Proceed** — "Start the audit"
|
|
88
|
+
- **Abort** — "Cancel and return to normal mode"
|
|
89
|
+
|
|
90
|
+
Frame the question with this context (adapt numbers to actual counts):
|
|
91
|
+
|
|
92
|
+
> **Token cost warning**: This audit will check **N memories** across **M categories** using **[model]**. Each memory requires reading its content and verifying against the codebase. This can be a high-token-cost operation, especially with Opus on large scopes.
|
|
93
|
+
|
|
94
|
+
If user aborts, end gracefully with a message.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Phase 2 — Checksum Pre-scan (Fast Pass)
|
|
99
|
+
|
|
100
|
+
This phase uses the `sync` MCP tool for instant staleness detection on memories that have stored file checksums. This is essentially free — no LLM verification tokens needed.
|
|
101
|
+
|
|
102
|
+
1. Call `sync` (with `project` parameter if scope is project-specific, otherwise without).
|
|
103
|
+
2. Parse the results:
|
|
104
|
+
- Memories flagged as stale by sync → **pre-classified as STALE** with HIGH confidence.
|
|
105
|
+
- Note the specific files that changed for each stale memory.
|
|
106
|
+
3. Filter results to only include memories whose category matches the selected scope.
|
|
107
|
+
|
|
108
|
+
**Output to user**: Brief summary — "Pre-scan found X memories with changed files out of Y total memories with file checksums."
|
|
109
|
+
|
|
110
|
+
If sync returns no results or errors, that's fine — move on. Not all memories have file checksums.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### Phase 3 — Memory Retrieval (Bulk Fetch)
|
|
115
|
+
|
|
116
|
+
Fetch all memories in the selected scope to get their full UUIDs, content, and metadata.
|
|
117
|
+
|
|
118
|
+
**For "all categories" scope:**
|
|
119
|
+
- Iterate through each category from Phase 1.
|
|
120
|
+
- For each category with memories, call `memories` with action `by-category`, category set to the current one, limit `50`.
|
|
121
|
+
- Collect all results into a master list.
|
|
122
|
+
|
|
123
|
+
**For parent category scope:**
|
|
124
|
+
- Identify all child categories from the Phase 1 tree.
|
|
125
|
+
- Call `memories` with action `by-category` for each child (and the parent itself if it has direct memories), limit `50`.
|
|
126
|
+
|
|
127
|
+
**For single category scope:**
|
|
128
|
+
- Call `memories` with action `by-category` for that category, limit `50`.
|
|
129
|
+
|
|
130
|
+
**Progress reporting**: After fetching, output: "Fetched N memories across M categories."
|
|
131
|
+
|
|
132
|
+
**After retrieval, triage into buckets:**
|
|
133
|
+
|
|
134
|
+
- **Bucket A**: Memories already flagged STALE by sync (Phase 2) → confirmed stale, skip verification.
|
|
135
|
+
- **Bucket B**: Memories with `related_files` whose checksums matched (not flagged by sync) → classify VALID, skip verification.
|
|
136
|
+
- **Bucket C**: Memories with `related_files` where the referenced file no longer exists on disk → INVALID candidates, verify in Phase 4.
|
|
137
|
+
- **Bucket D**: Memories without `related_files` metadata → require full semantic verification in Phase 4.
|
|
138
|
+
|
|
139
|
+
**Output to user**: Summary of bucket sizes:
|
|
140
|
+
```
|
|
141
|
+
Ready to verify:
|
|
142
|
+
Pre-confirmed stale (checksums changed): [A count]
|
|
143
|
+
Pre-confirmed valid (checksums match): [B count]
|
|
144
|
+
Possibly invalid (files missing): [C count]
|
|
145
|
+
Need semantic verification (no checksums): [D count]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Edge cases:**
|
|
149
|
+
- Empty categories → skip silently, don't call the MCP tool for them.
|
|
150
|
+
- If Buckets C and D are both empty → skip Phase 4 entirely, output "All memories verified via checksum comparison."
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### Phase 4 — Semantic Verification (Task Agent Delegation)
|
|
155
|
+
|
|
156
|
+
This is the most token-intensive phase. Only Bucket C and Bucket D memories need verification.
|
|
157
|
+
|
|
158
|
+
**Skip this phase entirely** if Buckets C and D are both empty.
|
|
159
|
+
|
|
160
|
+
#### Verification via Task Tool
|
|
161
|
+
|
|
162
|
+
Batch memories from Buckets C and D into groups of **5 memories** per Task call. Sort by importance descending so the most critical memories are verified first.
|
|
163
|
+
|
|
164
|
+
For each batch, call the `Task` tool with:
|
|
165
|
+
- `description`: "Verify N SynaBun memories"
|
|
166
|
+
- `subagent_type`: "general-purpose"
|
|
167
|
+
- `model`: the model selected in Phase 1c (opus / sonnet / haiku)
|
|
168
|
+
- `prompt`: A detailed prompt containing the verification instructions and memories (see template below)
|
|
169
|
+
|
|
170
|
+
**Verification prompt template for each Task call:**
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
You are verifying stored memories against the current state of the codebase.
|
|
174
|
+
For each memory below, determine if the information is still accurate.
|
|
175
|
+
|
|
176
|
+
Use Read, Grep, and Glob tools to check the codebase. Be thorough but efficient.
|
|
177
|
+
- Check if referenced files still exist
|
|
178
|
+
- Check if referenced functions, patterns, or configurations are still present
|
|
179
|
+
- Check if described behavior matches current code
|
|
180
|
+
|
|
181
|
+
For each memory, output EXACTLY this format:
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
MEMORY_ID: [full uuid]
|
|
185
|
+
STATUS: VALID | STALE | INVALID | UNVERIFIABLE
|
|
186
|
+
CONFIDENCE: HIGH | MEDIUM | LOW
|
|
187
|
+
REASON: [1-2 sentence explanation]
|
|
188
|
+
SUGGESTED_ACTION: KEEP | UPDATE | DELETE | SKIP
|
|
189
|
+
SUGGESTED_CONTENT: [If STATUS is STALE, provide corrected content. Otherwise "N/A"]
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
Classification rules:
|
|
193
|
+
- VALID: Code/files/patterns described still exist and work as described.
|
|
194
|
+
- STALE: Code exists but has changed — memory describes an older version.
|
|
195
|
+
- INVALID: Files, functions, or patterns referenced no longer exist at all.
|
|
196
|
+
- UNVERIFIABLE: Memory describes decisions, preferences, external behavior, or conversation context that cannot be verified by reading code.
|
|
197
|
+
|
|
198
|
+
Memories to verify:
|
|
199
|
+
|
|
200
|
+
[For each memory in batch:]
|
|
201
|
+
=== Memory [full-uuid] ===
|
|
202
|
+
Category: [category]
|
|
203
|
+
Project: [project]
|
|
204
|
+
Importance: [importance]
|
|
205
|
+
Created: [created_at]
|
|
206
|
+
Content:
|
|
207
|
+
[full memory content]
|
|
208
|
+
===
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
After each Task completes, parse its structured output and add results to the master results list.
|
|
212
|
+
|
|
213
|
+
**Progress reporting**: After each batch, output:
|
|
214
|
+
"Verified batch X/Y — [count] VALID, [count] STALE, [count] INVALID, [count] UNVERIFIABLE so far..."
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
### Phase 5 — Interactive Results
|
|
219
|
+
|
|
220
|
+
Present findings and let the user decide what to do with each flagged memory.
|
|
221
|
+
|
|
222
|
+
#### Summary Dashboard
|
|
223
|
+
|
|
224
|
+
Output this formatted summary:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
══════════════════════════════════════════
|
|
228
|
+
MEMORY AUDIT RESULTS
|
|
229
|
+
══════════════════════════════════════════
|
|
230
|
+
Scope: [description of scope]
|
|
231
|
+
Model: [model used]
|
|
232
|
+
Checked: [total] memories
|
|
233
|
+
|
|
234
|
+
VALID: [count]
|
|
235
|
+
STALE: [count]
|
|
236
|
+
INVALID: [count]
|
|
237
|
+
UNVERIFIABLE: [count]
|
|
238
|
+
══════════════════════════════════════════
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**If 0 STALE and 0 INVALID**: Skip all interactive sections below and go straight to Phase 6. Just show the dashboard.
|
|
242
|
+
|
|
243
|
+
#### Stale Memories (Interactive)
|
|
244
|
+
|
|
245
|
+
Process stale memories one at a time, sorted by importance descending.
|
|
246
|
+
|
|
247
|
+
For each stale memory, output:
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
── STALE MEMORY ──────────────────────────
|
|
251
|
+
ID: [short-id] | [category] | importance: [N]
|
|
252
|
+
Age: [how old]
|
|
253
|
+
Confidence: [HIGH/MEDIUM/LOW]
|
|
254
|
+
Reason: [why it's stale]
|
|
255
|
+
|
|
256
|
+
Current content (preview):
|
|
257
|
+
[first 200 chars of content]
|
|
258
|
+
|
|
259
|
+
Suggested update (preview):
|
|
260
|
+
[first 200 chars of suggested content]
|
|
261
|
+
──────────────────────────────────────────
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Then use `AskUserQuestion` with these options:
|
|
265
|
+
|
|
266
|
+
- **Update** — "Apply the suggested content update via reflect"
|
|
267
|
+
- **Delete** — "Remove this memory entirely"
|
|
268
|
+
- **Skip** — "Leave it as-is for now"
|
|
269
|
+
- **View full** — "Show full current + suggested content, then decide"
|
|
270
|
+
|
|
271
|
+
If there are more than 1 stale memory remaining after presenting the first one, add bulk options:
|
|
272
|
+
|
|
273
|
+
- **Update all remaining** — "Apply suggested updates to ALL remaining stale memories"
|
|
274
|
+
- **Skip all remaining** — "Skip all remaining stale memories"
|
|
275
|
+
|
|
276
|
+
Actions:
|
|
277
|
+
- **Update**: Call `reflect` with `memory_id` (full UUID) and `content` (suggested update).
|
|
278
|
+
- **Delete**: Call `forget` with the full UUID.
|
|
279
|
+
- **View full**: Show both full texts, then re-present the same `AskUserQuestion`.
|
|
280
|
+
- **Update all**: Loop through remaining stale memories, call `reflect` for each sequentially.
|
|
281
|
+
- **Skip / Skip all**: Move on.
|
|
282
|
+
|
|
283
|
+
#### Invalid Memories (Interactive)
|
|
284
|
+
|
|
285
|
+
Same pattern but simpler — no suggested update.
|
|
286
|
+
|
|
287
|
+
For each invalid memory, output:
|
|
288
|
+
|
|
289
|
+
```
|
|
290
|
+
── INVALID MEMORY ────────────────────────
|
|
291
|
+
ID: [short-id] | [category] | importance: [N]
|
|
292
|
+
Age: [how old]
|
|
293
|
+
Confidence: [HIGH/MEDIUM/LOW]
|
|
294
|
+
Reason: [what no longer exists]
|
|
295
|
+
|
|
296
|
+
Content (preview):
|
|
297
|
+
[first 200 chars]
|
|
298
|
+
──────────────────────────────────────────
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Use `AskUserQuestion` with options:
|
|
302
|
+
|
|
303
|
+
- **Delete** — "Remove this memory"
|
|
304
|
+
- **Skip** — "Keep it for now"
|
|
305
|
+
- **View full** — "Show full content, then decide"
|
|
306
|
+
|
|
307
|
+
Plus bulk options if more than 1 remaining:
|
|
308
|
+
|
|
309
|
+
- **Delete all remaining** — "Delete ALL remaining invalid memories"
|
|
310
|
+
- **Skip all remaining** — "Skip all remaining"
|
|
311
|
+
|
|
312
|
+
#### Unverifiable Memories (Informational Only)
|
|
313
|
+
|
|
314
|
+
If there are unverifiable memories, present as a numbered list. No interactive prompts — purely informational.
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
── UNVERIFIABLE (manual review) ──────────
|
|
318
|
+
These memories could not be verified from code alone:
|
|
319
|
+
|
|
320
|
+
1. [short-id] | [category] | imp: [N]
|
|
321
|
+
Reason: [why unverifiable]
|
|
322
|
+
[first 100 chars of content]
|
|
323
|
+
|
|
324
|
+
2. ...
|
|
325
|
+
──────────────────────────────────────────
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
### Phase 6 — Audit Report and Capture
|
|
331
|
+
|
|
332
|
+
#### Final Summary
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
══════════════════════════════════════════
|
|
336
|
+
AUDIT COMPLETE
|
|
337
|
+
══════════════════════════════════════════
|
|
338
|
+
Memories updated: [count]
|
|
339
|
+
Memories deleted: [count]
|
|
340
|
+
Memories skipped: [count]
|
|
341
|
+
Memories valid: [count]
|
|
342
|
+
Memories unverifiable: [count]
|
|
343
|
+
Total checked: [total]
|
|
344
|
+
══════════════════════════════════════════
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
#### Save Report
|
|
348
|
+
|
|
349
|
+
Use `AskUserQuestion`:
|
|
350
|
+
|
|
351
|
+
- **Save report** — "Store this audit report in SynaBun for tracking memory health over time"
|
|
352
|
+
- **No thanks** — "Skip saving"
|
|
353
|
+
|
|
354
|
+
If save:
|
|
355
|
+
1. Call `remember` with:
|
|
356
|
+
- `content`: Structured summary — date, scope, model, counts per classification, list of updated/deleted memory short-IDs, notable findings
|
|
357
|
+
- `category`: "synabun"
|
|
358
|
+
- `project`: current detected project
|
|
359
|
+
- `importance`: 6
|
|
360
|
+
- `tags`: ["audit", "memory-health"]
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Guidelines
|
|
365
|
+
|
|
366
|
+
- **Respect the user's time** — if there are 0 STALE and 0 INVALID, skip interactive sections and just show the summary.
|
|
367
|
+
- **Sequential MCP calls only** — never call two SynaBun tools in the same parallel batch.
|
|
368
|
+
- **Full UUIDs always** — the `memories` tool returns full UUIDs in `[uuid]` brackets. Parse these carefully. Never use shortened IDs with `reflect` or `forget`.
|
|
369
|
+
- **Importance-first ordering** — always process higher-importance memories first. A stale importance-9 architectural decision matters more than a stale importance-3 debug note.
|
|
370
|
+
- **Batch Task calls at 5 memories each** — balances token efficiency with reliability.
|
|
371
|
+
- **Do not fabricate updates** — if a memory is STALE but you cannot determine the correct updated content, set SUGGESTED_ACTION to SKIP rather than guessing.
|
|
372
|
+
- **Empty categories** — skip silently during Phase 3. Do not call MCP tools for categories with 0 memories.
|
|
373
|
+
- **Large audits** — if total memories in scope exceeds 100, warn the user during Phase 1d and suggest narrowing scope.
|
|
374
|
+
- **The `forget` tool is a soft delete** — sets `trashed_at` timestamp. Memories can be recovered from the Neural Interface trash panel. Reassure the user of this when presenting delete options.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Changelog — Auto-Generate CHANGELOG.md Entries
|
|
2
|
+
|
|
3
|
+
You are now in **changelog mode**. Your job is to analyze the current session's work — conversation context, git changes, and code modifications — then generate properly formatted CHANGELOG.md entries and write them to the project's changelog file.
|
|
4
|
+
|
|
5
|
+
**Input**: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
- If the input is empty → analyze the full session context and all recent git changes
|
|
8
|
+
- If the input contains text → use it as a focus hint (e.g., "changelog the auth refactor" → focus on that specific work within the session)
|
|
9
|
+
|
|
10
|
+
## CRITICAL: SynaBun MCP Tool Quirks
|
|
11
|
+
|
|
12
|
+
- Make ALL SynaBun MCP calls **sequentially** (never in parallel — one failure cascades).
|
|
13
|
+
- `remember` accepts `tags` and `importance` directly and returns the full UUID.
|
|
14
|
+
- `reflect` requires the **FULL UUID**. Use the UUID returned by `remember`, or `recall` to find existing memories.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Process
|
|
19
|
+
|
|
20
|
+
Execute these phases in order. Do NOT skip phases or combine them.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
### Phase 1 — Context Gathering
|
|
25
|
+
|
|
26
|
+
> **SCOPE RULE:** Only document work performed in THIS session. Git history contains commits from other sessions — you MUST use `$SESSION_START_COMMIT` to filter. If a git change doesn't match anything in your conversation context, **exclude it**.
|
|
27
|
+
|
|
28
|
+
Analyze all available information about the session's work:
|
|
29
|
+
|
|
30
|
+
1. **Conversation analysis** — Scan the entire conversation history in your context window. Extract all work performed: features added, bugs fixed, things refactored/changed, configuration modifications, file creation/deletion. Note specific function names, file paths, and technical details. **This is your primary source of truth.**
|
|
31
|
+
|
|
32
|
+
2. **Session baseline** — Search your conversation context for a line matching `Session start commit:` followed by a commit hash. Store it as `$SESSION_START_COMMIT`. If not found, fall back to `git log --oneline -1 --before='8 hours ago' --format='%H'` as a rough approximation.
|
|
33
|
+
|
|
34
|
+
3. **Git state** — Run these Bash commands to understand the actual code changes **scoped to this session**:
|
|
35
|
+
- `git rev-parse --show-toplevel` — determine the project root. Store as `$PROJECT_ROOT`.
|
|
36
|
+
- `git diff --stat` — see uncommitted file changes. Cross-reference against conversation context — only include changes you actually made in this session.
|
|
37
|
+
- `git log --oneline $SESSION_START_COMMIT..HEAD` — see only commits made since this session started. Do NOT use `git log -20` or any other unscoped log command.
|
|
38
|
+
- `git diff $SESSION_START_COMMIT --stat` — aggregate changes since session start.
|
|
39
|
+
|
|
40
|
+
4. **Focus filtering** — If `$ARGUMENTS` contains a focus hint, narrow the analysis to only changes related to that topic. Ignore unrelated work.
|
|
41
|
+
|
|
42
|
+
5. **Cross-check** — Before proceeding, verify every identified change exists in BOTH the conversation context AND the session-scoped git output. Remove anything that only appears in git but was not discussed or worked on in this conversation.
|
|
43
|
+
|
|
44
|
+
6. **Date** — Determine today's date in `YYYY-MM-DD` format (from conversation context or `date +%Y-%m-%d`).
|
|
45
|
+
|
|
46
|
+
**Output to user:** A brief summary of what was found:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
Found [N] changes to document:
|
|
50
|
+
- [N] additions, [N] fixes, [N] modifications
|
|
51
|
+
- [N] files touched
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### Phase 2 — Categorize & Draft
|
|
57
|
+
|
|
58
|
+
Before drafting, do a final scope check: remove any item from your list that documents work you did NOT perform in this conversation. Git commits from other sessions must not appear in the changelog output.
|
|
59
|
+
|
|
60
|
+
Categorize each piece of work into exactly one section type:
|
|
61
|
+
|
|
62
|
+
- **Added** — New features, new capabilities, new files/systems that did not exist before
|
|
63
|
+
- **Fixed** — Bug fixes, corrections to existing behavior, things that were broken and now work
|
|
64
|
+
- **Changed** — Refactors, modifications to existing behavior, config changes, dependency updates, UI polish
|
|
65
|
+
|
|
66
|
+
Draft entries following the project's exact CHANGELOG.md format:
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
### Added — Descriptive Feature Name
|
|
70
|
+
- **Bold title** — Description with specific technical detail. Include `functionName()`, `path/to/file.ts`, actual behavior changes. Be precise — someone reading this should understand what changed without looking at code.
|
|
71
|
+
- Sub-bullet for additional detail when an entry covers multiple related changes
|
|
72
|
+
|
|
73
|
+
### Fixed — Descriptive Bug Name (Scope)
|
|
74
|
+
- **What was broken** — What the bug was, root cause, and how it was fixed. Reference actual code constructs.
|
|
75
|
+
|
|
76
|
+
### Changed — Descriptive Modification Name
|
|
77
|
+
- **What changed** — What the old behavior was, what the new behavior is, and why.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Format rules:**
|
|
81
|
+
- Section header: `### Added/Fixed/Changed — Descriptive Name`
|
|
82
|
+
- Entry format: `- **Bold title** — Description` (em dash ` — `, not hyphen)
|
|
83
|
+
- Sub-entries: 2-space indent, same bullet format
|
|
84
|
+
- Inline backticks for code references (`functionName()`, `path/to/file.ts`, `configKey`)
|
|
85
|
+
- No version numbers — use date-only headers
|
|
86
|
+
- Group related changes under a single `### Type — Name` header with multiple entries
|
|
87
|
+
- Unrelated changes of the same type get separate `### Type — Name` headers (e.g., two unrelated features each get their own `### Added — Name` section)
|
|
88
|
+
|
|
89
|
+
**Do NOT output anything to the user during this phase** — drafting is internal.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### Phase 3 — Review & Confirm
|
|
94
|
+
|
|
95
|
+
Present the drafted entries to the user:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
══════════════════════════════════════════
|
|
99
|
+
AUTO CHANGELOG
|
|
100
|
+
══════════════════════════════════════════
|
|
101
|
+
Date: [YYYY-MM-DD]
|
|
102
|
+
Project: [project root basename]
|
|
103
|
+
Entries: [N] Added, [N] Fixed, [N] Changed
|
|
104
|
+
══════════════════════════════════════════
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Then output the full drafted entries exactly as they would appear in CHANGELOG.md — the `### Added/Fixed/Changed` sections with all bullet points.
|
|
108
|
+
|
|
109
|
+
Then use `AskUserQuestion` with:
|
|
110
|
+
|
|
111
|
+
- **Save as-is** — "Write these entries to CHANGELOG.md"
|
|
112
|
+
- **Edit first** — "I want to adjust entries before saving"
|
|
113
|
+
- **Cancel** — "Don't save anything"
|
|
114
|
+
|
|
115
|
+
**If user picks "Edit first":** The Neural Interface opens the entries in the code editor. The user edits and saves, and you receive the answer prefixed with `"Edit first — here are the edited entries:"` followed by the edited content. Use these edited entries exactly as provided — proceed directly to Phase 4. Do NOT re-draft or ask additional questions.
|
|
116
|
+
|
|
117
|
+
**If user picks "Cancel":** End with a brief message. Do not write anything.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### Phase 4 — Write to File
|
|
122
|
+
|
|
123
|
+
Once the user confirms:
|
|
124
|
+
|
|
125
|
+
1. Set the changelog path: `$PROJECT_ROOT/CHANGELOG.md`
|
|
126
|
+
|
|
127
|
+
2. Check if the file exists by attempting to `Read` it.
|
|
128
|
+
|
|
129
|
+
**If CHANGELOG.md does NOT exist:**
|
|
130
|
+
|
|
131
|
+
Create a new file using the `Write` tool:
|
|
132
|
+
|
|
133
|
+
```markdown
|
|
134
|
+
# Project Changelog
|
|
135
|
+
|
|
136
|
+
## [YYYY-MM-DD]
|
|
137
|
+
|
|
138
|
+
[all drafted entries]
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**If CHANGELOG.md EXISTS:**
|
|
142
|
+
|
|
143
|
+
Read the entire file, then determine the insertion point:
|
|
144
|
+
|
|
145
|
+
- **Case A — Today's date section already exists** (a `## YYYY-MM-DD` line matching today's date is found):
|
|
146
|
+
- Find the end of today's date block (just before the next `## ` line or end of file).
|
|
147
|
+
- Insert the new `### Type — Name` sections at the end of today's block, before the next date header.
|
|
148
|
+
- Do NOT duplicate entries — if a `### Added — Same Name` already exists under today's date with the same content, skip it.
|
|
149
|
+
|
|
150
|
+
- **Case B — Today's date section does NOT exist:**
|
|
151
|
+
- Insert a new `## YYYY-MM-DD` section immediately after the first `# ` title line (and any blank line after it), before any existing `## ` date entries.
|
|
152
|
+
- Place all drafted entries under the new date header.
|
|
153
|
+
|
|
154
|
+
Use the `Edit` tool for modifications to existing files.
|
|
155
|
+
|
|
156
|
+
After writing, confirm to the user:
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
══════════════════════════════════════════
|
|
160
|
+
Changelog updated successfully.
|
|
161
|
+
File: [path]
|
|
162
|
+
Date: [YYYY-MM-DD]
|
|
163
|
+
Entries: [count] written
|
|
164
|
+
══════════════════════════════════════════
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
### Phase 5 — Memory (Auto)
|
|
170
|
+
|
|
171
|
+
Silently call `remember` with:
|
|
172
|
+
- `content`: Brief summary of what was added to the changelog (date, section types, one-line per entry)
|
|
173
|
+
- `category`: `conversations`
|
|
174
|
+
- `project`: current project name
|
|
175
|
+
- `importance`: 5
|
|
176
|
+
- `tags`: `["changelog", "documentation", "session-summary"]`
|
|
177
|
+
- `related_files`: `["CHANGELOG.md"]`
|
|
178
|
+
|
|
179
|
+
Do NOT use `AskUserQuestion` here — auto-remember is mandatory per project rules.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Guidelines
|
|
184
|
+
|
|
185
|
+
- **Be specific, not generic** — "Added Instagram browser extractor tools (5 tools)" not "Added social media support". Every entry should mention actual code constructs.
|
|
186
|
+
- **Match the existing tone** — Read the existing CHANGELOG.md entries for the voice. This project uses detailed, technical entries with inline backticks, not marketing copy.
|
|
187
|
+
- **Em dashes, not hyphens** — Use ` — ` (space-em-dash-space) as the separator between bold titles and descriptions.
|
|
188
|
+
- **One concept per entry** — Don't combine unrelated changes. A bug fix and a feature addition are separate entries even if they touched the same file.
|
|
189
|
+
- **Sub-bullets for depth** — When a single entry has multiple related sub-items (e.g., 5 new tools), use 2-space-indented sub-bullets rather than cramming everything into one line.
|
|
190
|
+
- **Group related changes** — Multiple changes that are part of the same feature go under a single `### Added — Feature Name` header with multiple `- **Bold** — Description` entries.
|
|
191
|
+
- **Separate unrelated changes** — Two unrelated features both get their own `### Added — Name` section headers, even on the same day.
|
|
192
|
+
- **Don't duplicate** — If today's date section already has entries for the same work, skip those entries.
|
|
193
|
+
- **Conversation is truth (HARD RULE)** — NEVER include changes that were not discussed or worked on in this conversation, even if they appear in git history. Git is used only to enrich detail for work you already know about from the conversation. If a commit or diff doesn't match conversation context, it belongs to another session — skip it.
|
|
194
|
+
- **Sequential MCP calls only** — Never call two SynaBun tools in the same parallel batch.
|