keepmind 1.0.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 (105) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.codex-plugin/plugin.json +46 -0
  3. package/LICENSE +202 -0
  4. package/README.md +139 -0
  5. package/dist/npx-cli/index.js +1398 -0
  6. package/dist/opencode-plugin/index.js +68 -0
  7. package/openclaw/Dockerfile.e2e +46 -0
  8. package/openclaw/SKILL.md +462 -0
  9. package/openclaw/TESTING.md +279 -0
  10. package/openclaw/dist/index.js +20 -0
  11. package/openclaw/e2e-verify.sh +222 -0
  12. package/openclaw/install.sh +1653 -0
  13. package/openclaw/openclaw.plugin.json +98 -0
  14. package/openclaw/package.json +21 -0
  15. package/openclaw/skills/do/SKILL.md +1 -0
  16. package/openclaw/skills/make-plan/SKILL.md +1 -0
  17. package/openclaw/src/index.test.ts +1178 -0
  18. package/openclaw/src/index.ts +1136 -0
  19. package/openclaw/test-e2e.sh +40 -0
  20. package/openclaw/test-install.sh +2086 -0
  21. package/openclaw/test-sse-consumer.js +98 -0
  22. package/openclaw/tsconfig.json +26 -0
  23. package/package.json +187 -0
  24. package/plugin/.claude-plugin/plugin.json +24 -0
  25. package/plugin/.codex-plugin/plugin.json +46 -0
  26. package/plugin/.mcp.json +12 -0
  27. package/plugin/bun.lock +325 -0
  28. package/plugin/hooks/bugfixes-2026-01-10.md +92 -0
  29. package/plugin/hooks/codex-hooks.json +63 -0
  30. package/plugin/hooks/hooks.json +117 -0
  31. package/plugin/modes/code--ar.json +24 -0
  32. package/plugin/modes/code--bn.json +24 -0
  33. package/plugin/modes/code--chill.json +8 -0
  34. package/plugin/modes/code--cs.json +24 -0
  35. package/plugin/modes/code--da.json +24 -0
  36. package/plugin/modes/code--de.json +24 -0
  37. package/plugin/modes/code--el.json +24 -0
  38. package/plugin/modes/code--es.json +24 -0
  39. package/plugin/modes/code--fi.json +24 -0
  40. package/plugin/modes/code--fr.json +24 -0
  41. package/plugin/modes/code--he.json +24 -0
  42. package/plugin/modes/code--hi.json +24 -0
  43. package/plugin/modes/code--hu.json +24 -0
  44. package/plugin/modes/code--id.json +24 -0
  45. package/plugin/modes/code--it.json +24 -0
  46. package/plugin/modes/code--ja.json +24 -0
  47. package/plugin/modes/code--ko.json +24 -0
  48. package/plugin/modes/code--nl.json +24 -0
  49. package/plugin/modes/code--no.json +24 -0
  50. package/plugin/modes/code--pl.json +24 -0
  51. package/plugin/modes/code--pt-br.json +24 -0
  52. package/plugin/modes/code--ro.json +24 -0
  53. package/plugin/modes/code--ru.json +24 -0
  54. package/plugin/modes/code--sv.json +24 -0
  55. package/plugin/modes/code--th.json +24 -0
  56. package/plugin/modes/code--tr.json +24 -0
  57. package/plugin/modes/code--uk.json +24 -0
  58. package/plugin/modes/code--ur.json +25 -0
  59. package/plugin/modes/code--vi.json +24 -0
  60. package/plugin/modes/code--zh.json +24 -0
  61. package/plugin/modes/code.json +139 -0
  62. package/plugin/modes/email-investigation.json +120 -0
  63. package/plugin/modes/law-study--chill.json +7 -0
  64. package/plugin/modes/law-study-CLAUDE.md +85 -0
  65. package/plugin/modes/law-study.json +120 -0
  66. package/plugin/modes/meme-tokens.json +125 -0
  67. package/plugin/package.json +47 -0
  68. package/plugin/scripts/bun-runner.js +229 -0
  69. package/plugin/scripts/context-generator.cjs +1005 -0
  70. package/plugin/scripts/mcp-server.cjs +247 -0
  71. package/plugin/scripts/statusline-counts.js +45 -0
  72. package/plugin/scripts/transcript-watcher.cjs +27 -0
  73. package/plugin/scripts/version-check.js +193 -0
  74. package/plugin/scripts/worker-cli.js +19 -0
  75. package/plugin/scripts/worker-service.cjs +2638 -0
  76. package/plugin/scripts/worker-wrapper.cjs +2 -0
  77. package/plugin/skills/babysit/SKILL.md +87 -0
  78. package/plugin/skills/design-is/SKILL.md +312 -0
  79. package/plugin/skills/do/SKILL.md +45 -0
  80. package/plugin/skills/how-it-works/SKILL.md +22 -0
  81. package/plugin/skills/how-it-works/onboarding-explainer.md +17 -0
  82. package/plugin/skills/knowledge-agent/SKILL.md +80 -0
  83. package/plugin/skills/learn-codebase/SKILL.md +21 -0
  84. package/plugin/skills/make-plan/SKILL.md +67 -0
  85. package/plugin/skills/mem-search/SKILL.md +131 -0
  86. package/plugin/skills/oh-my-issues/SKILL.md +226 -0
  87. package/plugin/skills/pathfinder/SKILL.md +111 -0
  88. package/plugin/skills/smart-explore/SKILL.md +193 -0
  89. package/plugin/skills/standup/SKILL.md +142 -0
  90. package/plugin/skills/standup/agent-brief.md +47 -0
  91. package/plugin/skills/standup/standup.mjs +662 -0
  92. package/plugin/skills/timeline-report/SKILL.md +211 -0
  93. package/plugin/skills/version-bump/SKILL.md +74 -0
  94. package/plugin/skills/version-bump/scripts/generate_changelog.js +34 -0
  95. package/plugin/skills/weekly-digests/SKILL.md +262 -0
  96. package/plugin/skills/what-the/SKILL.md +6 -0
  97. package/plugin/skills/wowerpoint/SKILL.md +205 -0
  98. package/plugin/ui/assets/fonts/monaspace-radon-var.woff +0 -0
  99. package/plugin/ui/assets/fonts/monaspace-radon-var.woff2 +0 -0
  100. package/plugin/ui/icon-thick-completed.svg +8 -0
  101. package/plugin/ui/icon-thick-investigated.svg +8 -0
  102. package/plugin/ui/icon-thick-learned.svg +12 -0
  103. package/plugin/ui/icon-thick-next-steps.svg +8 -0
  104. package/plugin/ui/viewer-bundle.js +65 -0
  105. package/plugin/ui/viewer.html +3302 -0
@@ -0,0 +1,211 @@
1
+ ---
2
+ name: timeline-report
3
+ description: Generate a "Journey Into [Project]" narrative report analyzing a project's entire development history from claude-mem's timeline. Use when asked for a timeline report, project history analysis, development journey, or full project report.
4
+ ---
5
+
6
+ # Timeline Report
7
+
8
+ Generate a comprehensive narrative analysis of a project's entire development history using claude-mem's persistent memory timeline.
9
+
10
+ ## When to Use
11
+
12
+ Use when users ask for:
13
+
14
+ - "Write a timeline report"
15
+ - "Journey into [project]"
16
+ - "Analyze my project history"
17
+ - "Full project report"
18
+ - "Summarize the entire development history"
19
+ - "What's the story of this project?"
20
+
21
+ ## Prerequisites
22
+
23
+ The claude-mem worker must be running. The project must have claude-mem observations recorded.
24
+
25
+ **Resolve the worker port** (do this once at the start and reuse `$WORKER_PORT` in every curl call below):
26
+
27
+ ```bash
28
+ WORKER_PORT="${CLAUDE_MEM_WORKER_PORT:-$(node -e "const fs=require('fs'),p=require('path'),os=require('os');const uid=(typeof process.getuid==='function'?process.getuid():77);const fallback=String(37700+(uid%100));try{const s=JSON.parse(fs.readFileSync(p.join(os.homedir(),'.claude-mem','settings.json'),'utf-8'));process.stdout.write(String(s.CLAUDE_MEM_WORKER_PORT||fallback));}catch{process.stdout.write(fallback);}" 2>/dev/null)}"
29
+ ```
30
+
31
+ This honors `CLAUDE_MEM_WORKER_PORT` env, then `~/.claude-mem/settings.json`, then falls back to the per-UID default `37700 + (uid % 100)` — matching how the worker itself picks its port. Required for multi-account setups (#2101) and any user who has overridden the default port (#2103).
32
+
33
+ ## Workflow
34
+
35
+ ### Step 1: Determine the Project Name
36
+
37
+ Ask the user which project to analyze if not obvious from context. The project name is typically the directory name of the project (e.g., "tokyo", "my-app"). If the user says "this project", use the current working directory's basename.
38
+
39
+ **Worktree Detection:** Before using the directory basename, check if the current directory is a git worktree. In a worktree, the data source is the **parent project**, not the worktree directory itself. Run:
40
+
41
+ ```bash
42
+ git_dir=$(git rev-parse --git-dir 2>/dev/null)
43
+ git_common_dir=$(git rev-parse --git-common-dir 2>/dev/null)
44
+ if [ "$git_dir" != "$git_common_dir" ]; then
45
+ # We're in a worktree — resolve the parent project name
46
+ parent_project=$(basename "$(dirname "$git_common_dir")")
47
+ echo "Worktree detected. Parent project: $parent_project"
48
+ else
49
+ parent_project=$(basename "$PWD")
50
+ fi
51
+ echo "$parent_project"
52
+ ```
53
+
54
+ If a worktree is detected, use `$parent_project` (the basename of the parent repo) as the project name for all API calls. Inform the user: "Detected git worktree. Using parent project '[name]' as the data source."
55
+
56
+ ### Step 2: Fetch the Full Timeline
57
+
58
+ Use Bash to fetch the complete timeline from the claude-mem worker API:
59
+
60
+ ```bash
61
+ curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=PROJECT_NAME&full=true"
62
+ ```
63
+
64
+ This returns the entire compressed timeline -- every observation, session boundary, and summary across the project's full history. The response is pre-formatted markdown optimized for LLM consumption.
65
+
66
+ **Token estimates:** The full timeline size depends on the project's history:
67
+ - Small project (< 1,000 observations): ~20-50K tokens
68
+ - Medium project (1,000-10,000 observations): ~50-300K tokens
69
+ - Large project (10,000-35,000 observations): ~300-750K tokens
70
+
71
+ If the response is empty or returns an error, the worker may not be running or the project name may be wrong. Try `curl -s "http://localhost:${WORKER_PORT}/api/search?query=*&limit=1"` to verify the worker is healthy.
72
+
73
+ ### Step 3: Estimate Token Count
74
+
75
+ Before proceeding, estimate the token count of the fetched timeline (roughly 1 token per 4 characters). Report this to the user:
76
+
77
+ ```
78
+ Timeline fetched: ~X observations, estimated ~Yk tokens.
79
+ This analysis will consume approximately Yk input tokens + ~5-10k output tokens.
80
+ Proceed? (y/n)
81
+ ```
82
+
83
+ Wait for user confirmation before continuing if the timeline exceeds 100K tokens.
84
+
85
+ ### Step 4: Analyze with a Subagent
86
+
87
+ Deploy an Agent (using the Task tool) with the full timeline and the following analysis prompt. Pass the ENTIRE timeline as context to the agent. The agent should also be instructed to query the SQLite database at `~/.claude-mem/claude-mem.db` for the Token Economics section.
88
+
89
+ **Agent prompt:**
90
+
91
+ ```
92
+ You are a technical historian analyzing a software project's complete development timeline from claude-mem's persistent memory system. The timeline below contains every observation, session boundary, and summary recorded across the project's entire history.
93
+
94
+ You also have access to the claude-mem SQLite database at ~/.claude-mem/claude-mem.db. Use it to run queries for the Token Economics & Memory ROI section. The database has an "observations" table with columns: id, memory_session_id, project, text, type, title, subtitle, facts, narrative, concepts, files_read, files_modified, prompt_number, discovery_tokens, created_at, created_at_epoch, source_tool, source_input_summary.
95
+
96
+ Write a comprehensive narrative report titled "Journey Into [PROJECT_NAME]" that covers:
97
+
98
+ ## Required Sections
99
+
100
+ 1. **Project Genesis** -- When and how the project started. What were the first commits, the initial vision, the founding technical decisions? What problem was being solved?
101
+
102
+ 2. **Architectural Evolution** -- How did the architecture change over time? What were the major pivots? Why did they happen? Trace the evolution from initial design through each significant restructuring.
103
+
104
+ 3. **Key Breakthroughs** -- Identify the "aha" moments: when a difficult problem was finally solved, when a new approach unlocked progress, when a prototype first worked. These are the observations where the tone shifts from investigation to resolution.
105
+
106
+ 4. **Work Patterns** -- Analyze the rhythm of development. Identify debugging cycles (clusters of bug fixes), feature sprints (rapid observation sequences), refactoring phases (architectural changes without new features), and exploration phases (many discoveries without changes).
107
+
108
+ 5. **Technical Debt** -- Track where shortcuts were taken and when they were paid back. Identify patterns of accumulation (rapid feature work) and resolution (dedicated refactoring sessions).
109
+
110
+ 6. **Challenges and Debugging Sagas** -- The hardest problems encountered. Multi-session debugging efforts, architectural dead-ends that required backtracking, platform-specific issues that took days to resolve.
111
+
112
+ 7. **Memory and Continuity** -- How did persistent memory (claude-mem itself, if applicable) affect the development process? Were there moments where recalled context from prior sessions saved significant time or prevented repeated mistakes?
113
+
114
+ 8. **Token Economics & Memory ROI** -- Quantitative analysis of how memory recall saved work:
115
+ - Query the database directly for these metrics using `sqlite3 ~/.claude-mem/claude-mem.db`
116
+ - Count total discovery_tokens across all observations (the original cost of all work)
117
+ - Count sessions that had context injection available (sessions after the first)
118
+ - Calculate the compression ratio: average discovery_tokens vs average read_tokens per observation
119
+ - Identify the highest-value observations (highest discovery_tokens -- these are the most expensive decisions, bugs, and discoveries that memory prevents re-doing)
120
+ - Identify explicit recall events (observations where source_tool contains "search", "smart_search", "get_observations", "timeline", or where narrative mentions "recalled", "from memory", "previous session")
121
+ - Estimate passive recall savings: each session with context injection receives ~50 observations. Use a 30% relevance factor (conservative estimate that 30% of injected context prevents re-work). Savings = sessions_with_context × avg_discovery_value_of_50_obs_window × 0.30
122
+ - Estimate explicit recall savings: ~10K tokens per explicit recall query
123
+ - Calculate net ROI: total_savings / total_read_tokens_invested
124
+ - Present as a table with monthly breakdown
125
+ - Highlight the top 5 most expensive observations by discovery_tokens -- these represent the highest-value memories in the system (architecture decisions, hard bugs, implementation plans that cost 100K+ tokens to produce originally)
126
+
127
+ Use these SQL queries as a starting point:
128
+ ```sql
129
+ -- Total discovery tokens
130
+ SELECT SUM(discovery_tokens) FROM observations WHERE project = 'PROJECT_NAME';
131
+
132
+ -- Sessions with context available (not the first session)
133
+ SELECT COUNT(DISTINCT memory_session_id) FROM observations WHERE project = 'PROJECT_NAME';
134
+
135
+ -- Average tokens per observation
136
+ SELECT AVG(discovery_tokens) as avg_discovery, AVG(LENGTH(title || COALESCE(subtitle,'') || COALESCE(narrative,'') || COALESCE(facts,'')) / 4) as avg_read FROM observations WHERE project = 'PROJECT_NAME' AND discovery_tokens > 0;
137
+
138
+ -- Top 5 most expensive observations (highest-value memories)
139
+ SELECT id, title, discovery_tokens FROM observations WHERE project = 'PROJECT_NAME' ORDER BY discovery_tokens DESC LIMIT 5;
140
+
141
+ -- Monthly breakdown
142
+ SELECT strftime('%Y-%m', created_at) as month, COUNT(*) as obs, SUM(discovery_tokens) as total_discovery, COUNT(DISTINCT memory_session_id) as sessions FROM observations WHERE project = 'PROJECT_NAME' GROUP BY month ORDER BY month;
143
+
144
+ -- Explicit recall events
145
+ SELECT COUNT(*) FROM observations WHERE project = 'PROJECT_NAME' AND (source_tool LIKE '%search%' OR source_tool LIKE '%timeline%' OR source_tool LIKE '%get_observations%' OR narrative LIKE '%recalled%' OR narrative LIKE '%from memory%' OR narrative LIKE '%previous session%');
146
+ ```
147
+
148
+ 9. **Timeline Statistics** -- Quantitative summary:
149
+ - Date range (first observation to last)
150
+ - Total observations and sessions
151
+ - Breakdown by observation type (features, bug fixes, discoveries, decisions, changes)
152
+ - Most active days/weeks
153
+ - Longest debugging sessions
154
+
155
+ 10. **Lessons and Meta-Observations** -- What patterns emerge from the full history? What would a new developer learn about this codebase from reading the timeline? What recurring themes or principles guided development?
156
+
157
+ ## Writing Style
158
+
159
+ - Write as a technical narrative, not a list of bullet points
160
+ - Use specific observation IDs and timestamps when referencing events (e.g., "On Dec 14 (#26766), the root cause was finally identified...")
161
+ - Connect events across time -- show how early decisions created later consequences
162
+ - Be honest about struggles and dead ends, not just successes
163
+ - Target 3,000-6,000 words depending on project size
164
+ - Use markdown formatting with headers, emphasis, and code references where appropriate
165
+
166
+ ## Important
167
+
168
+ - Analyze the ENTIRE timeline chronologically -- do not skip early history
169
+ - Look for narrative arcs: problem -> investigation -> solution
170
+ - Identify turning points where the project's direction fundamentally changed
171
+ - Note any observations about the development process itself (tooling, workflow, collaboration patterns)
172
+
173
+ Here is the complete project timeline:
174
+
175
+ [TIMELINE CONTENT GOES HERE]
176
+ ```
177
+
178
+ ### Step 5: Save the Report
179
+
180
+ Save the agent's output as a markdown file. Default location:
181
+
182
+ ```
183
+ ./journey-into-PROJECT_NAME.md
184
+ ```
185
+
186
+ Or if the user specified a different output path, use that instead.
187
+
188
+ ### Step 6: Report Completion
189
+
190
+ Tell the user:
191
+ - Where the report was saved
192
+ - The approximate token cost (input timeline + output report)
193
+ - The date range covered
194
+ - Number of observations analyzed
195
+
196
+ ## Error Handling
197
+
198
+ - **Empty timeline:** "No observations found for project 'X'. Check the project name with: `curl -s \"http://localhost:${WORKER_PORT}/api/search?query=*&limit=1\"`"
199
+ - **Worker not running:** "The claude-mem worker is not responding on port ${WORKER_PORT}. Start it with your usual method or check `ps aux | grep worker-service`."
200
+ - **Timeline too large:** For projects with 50,000+ observations, the timeline may exceed context limits. Suggest using date range filtering: `curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=X&full=true"` -- the current endpoint returns all observations; for extremely large projects, the user may want to analyze in time-windowed segments.
201
+
202
+ ## Example
203
+
204
+ User: "Write a journey report for the tokyo project"
205
+
206
+ 1. Fetch: `curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=tokyo&full=true"`
207
+ 2. Estimate: "Timeline fetched: ~34,722 observations, estimated ~718K tokens. Proceed?"
208
+ 3. User confirms
209
+ 4. Deploy analysis agent with full timeline
210
+ 5. Save to `./journey-into-tokyo.md`
211
+ 6. Report: "Report saved. Analyzed 34,722 observations spanning Oct 2025 - Mar 2026 (~718K input tokens, ~8K output tokens)."
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: claude-code-plugin-release
3
+ description: Automated semantic versioning and release workflow for Claude Code plugins. Handles version increments across package.json, marketplace.json, plugin.json manifests, build verification, git tagging, GitHub releases, and changelog generation. NPM publishing (so `npx claude-mem@X.Y.Z` resolves) is handed off to the human maintainer, who raised npm security.
4
+ ---
5
+
6
+ # Version Bump & Release Workflow
7
+
8
+ **IMPORTANT:** Plan and write detailed release notes before starting.
9
+
10
+ **CRITICAL:** Commit EVERYTHING (including build artifacts). At the end of this workflow, NOTHING should be left uncommitted or unpushed. Run `git status` at the end to verify.
11
+
12
+ ## Preparation
13
+
14
+ 1. **Analyze**: Determine if the change is **PATCH** (bug fixes), **MINOR** (features), or **MAJOR** (breaking).
15
+ 2. **Environment**: Identify repository owner/name from `git remote -v`.
16
+ 3. **Paths — every file that carries the version string**:
17
+ - `package.json` — **the npm/npx-published version** (`npx claude-mem@X.Y.Z` resolves from this)
18
+ - `plugin/package.json` — bundled plugin runtime deps
19
+ - `.claude-plugin/marketplace.json` — version inside `plugins[0].version`
20
+ - `.claude-plugin/plugin.json` — top-level Claude-plugin manifest
21
+ - `plugin/.claude-plugin/plugin.json` — bundled Claude-plugin manifest
22
+ - `.codex-plugin/plugin.json` — Codex-plugin manifest
23
+ - `plugin/.codex-plugin/plugin.json` — bundled Codex-plugin manifest
24
+ - `openclaw/openclaw.plugin.json` — OpenClaw plugin manifest
25
+
26
+ Verify coverage before editing: `git grep -l "\"version\": \"<OLD>\""` should list all eight. If a new manifest has been added since this doc was last updated, update this list.
27
+
28
+ ## Workflow
29
+
30
+ 1. **Update**: Increment the version string in every path above. Do NOT touch `CHANGELOG.md` — it's regenerated.
31
+ 2. **Verify**: `git grep -n "\"version\": \"<NEW>\""` — confirm all eight files match. `git grep -n "\"version\": \"<OLD>\""` — should return zero hits.
32
+ 3. **Build and sync**: `npm run build-and-sync` to regenerate artifacts, sync the local marketplace copy, restart the worker, and clear the queue. Do not use plain `npm run build` for release validation because it can leave the local marketplace/worker out of sync.
33
+ 4. **Commit**: `git add -A && git commit -m "chore: bump version to X.Y.Z"`.
34
+ 5. **Tag**: `git tag -a vX.Y.Z -m "Version X.Y.Z"`.
35
+ 6. **Push**: `git push origin main && git push origin vX.Y.Z`.
36
+ 7. **Publish to npm — HAND OFF TO HUMAN.** The human maintainer raised npm
37
+ security, so publishing now requires credentials/2FA only they can provide.
38
+ The agent MUST NOT run `npm publish` (or `np` / `npm run release:*`, which
39
+ also publish) itself. **Hand off NPM publishing to the human now:** stop and
40
+ tell them the version is committed, tagged, and pushed, and that they must
41
+ publish to npm to make `npx claude-mem@X.Y.Z` resolve. Give them the command:
42
+ ```bash
43
+ npm publish # run by the HUMAN — the prepublishOnly script rebuilds the package
44
+ ```
45
+ Wait for the human to confirm they published, then verify it landed:
46
+ ```bash
47
+ npm view claude-mem@X.Y.Z version # should print X.Y.Z
48
+ ```
49
+ If the publish build touched local artifacts, run `npm run build-and-sync` again afterward.
50
+ 8. **GitHub release**: `gh release create vX.Y.Z --title "vX.Y.Z" --notes "RELEASE_NOTES"`.
51
+ 9. **Changelog**: Regenerate via the project's changelog script:
52
+ ```bash
53
+ npm run changelog:generate
54
+ ```
55
+ (Runs `node scripts/generate-changelog.js`, which pulls releases from the GitHub API and rewrites `CHANGELOG.md`.)
56
+ 10. **Sync changelog**: Commit and push the updated `CHANGELOG.md`.
57
+ 11. **Notify**: Run the Discord notification from `~/Scripts/claude-mem/`, where the `.env` with Discord webhook details lives:
58
+ ```bash
59
+ cd ~/Scripts/claude-mem/ && npm run discord:notify vX.Y.Z
60
+ ```
61
+ Do this even when the release worktree does not have a local `.env`.
62
+ 12. **Finalize**: `git status` — working tree must be clean.
63
+
64
+ ## Checklist
65
+
66
+ - [ ] All eight config files have matching versions
67
+ - [ ] `git grep` for old version returns zero hits
68
+ - [ ] `npm run build-and-sync` succeeded
69
+ - [ ] Git tag created and pushed
70
+ - [ ] **NPM publishing handed off to the human** (agent does NOT run `npm publish` — human raised security); once they publish, `npm view claude-mem@X.Y.Z version` confirms it (so `npx claude-mem@X.Y.Z` resolves)
71
+ - [ ] GitHub release created with notes
72
+ - [ ] `CHANGELOG.md` updated and pushed
73
+ - [ ] Discord notification run from `~/Scripts/claude-mem/`
74
+ - [ ] `git status` shows clean tree
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ const fs = require('fs');
3
+
4
+ function generate() {
5
+ try {
6
+ const input = fs.readFileSync(0, 'utf8');
7
+ if (!input || input.trim() === '') {
8
+ process.stderr.write('No input received on stdin
9
+ ');
10
+ process.exit(1);
11
+ }
12
+
13
+ const releases = JSON.parse(input);
14
+ const lines = ['# Changelog', '', 'All notable changes to this project.', ''];
15
+
16
+ releases.slice(0, 50).forEach(r => {
17
+ const date = r.published_at.split('T')[0];
18
+ lines.push(`## [${r.tag_name}] - ${date}`);
19
+ lines.push('');
20
+ if (r.body) lines.push(r.body.trim());
21
+ lines.push('');
22
+ });
23
+
24
+ process.stdout.write(lines.join('
25
+ ') + '
26
+ ');
27
+ } catch (err) {
28
+ process.stderr.write(`Error generating changelog: ${err.message}
29
+ `);
30
+ process.exit(1);
31
+ }
32
+ }
33
+
34
+ generate();
@@ -0,0 +1,262 @@
1
+ ---
2
+ name: weekly-digests
3
+ description: Generate a serial week-by-week narrative digest of a project's full claude-mem timeline. Splits the timeline into per-ISO-week files, then runs one consecutive subagent per week — each receiving the prior week's carry-forward block — to produce one chapter per ISO week of data. Use when asked for "weekly digests", "week-by-week story", "serial timeline", or "narrative chapters" of a project's history.
4
+ ---
5
+
6
+ # Weekly Digests
7
+
8
+ Produce a serial, multi-chapter narrative digest of a project's complete claude-mem history. Differs from `timeline-report` (one long report) — this generates one digest *per ISO week*, with each subagent reading the prior week's carry-forward block so the story stays coherent.
9
+
10
+ **The chapter count equals the number of ISO weeks the timeline covers.** A project with 2 weeks of data produces 2 chapters; one with 30 weeks produces 30. There is no fixed length — count the weeks first, then drive the pipeline off that count.
11
+
12
+ ## When to Use
13
+
14
+ Trigger when the user asks for:
15
+
16
+ - "Weekly digests"
17
+ - "Week-by-week story"
18
+ - "Serial timeline"
19
+ - "Story chapters of [project]"
20
+ - "Run a digest for each week"
21
+ - "Continue the story week by week"
22
+
23
+ If the user wants a single sweeping report, use `timeline-report` instead. This skill is for serial chapter format.
24
+
25
+ ## Prerequisites
26
+
27
+ - claude-mem worker running
28
+ - Project has at least one ISO week of observations (the pipeline degenerates gracefully — even N=1 works)
29
+ - A clean output directory the user is comfortable writing into
30
+
31
+ **Resolve the worker port** (do this once, reuse `$WORKER_PORT`):
32
+
33
+ ```bash
34
+ WORKER_PORT="${CLAUDE_MEM_WORKER_PORT:-$(node -e "const fs=require('fs'),p=require('path'),os=require('os');const uid=(typeof process.getuid==='function'?process.getuid():77);const fallback=String(37700+(uid%100));try{const s=JSON.parse(fs.readFileSync(p.join(os.homedir(),'.claude-mem','settings.json'),'utf-8'));process.stdout.write(String(s.CLAUDE_MEM_WORKER_PORT||fallback));}catch{process.stdout.write(fallback);}" 2>/dev/null)}"
35
+ ```
36
+
37
+ ## Workflow
38
+
39
+ ### Step 1: Determine the Project Name
40
+
41
+ Same worktree-detection pattern as `timeline-report`. In a worktree, the data source is the **parent project**:
42
+
43
+ ```bash
44
+ git_dir=$(git rev-parse --git-dir 2>/dev/null)
45
+ git_common_dir=$(git rev-parse --git-common-dir 2>/dev/null)
46
+ if [ "$git_dir" != "$git_common_dir" ]; then
47
+ parent_project=$(basename "$(dirname "$git_common_dir")")
48
+ else
49
+ parent_project=$(basename "$PWD")
50
+ fi
51
+ echo "$parent_project"
52
+ ```
53
+
54
+ ### Step 2: Fetch the Full Timeline and Save It
55
+
56
+ ```bash
57
+ mkdir -p .scratch
58
+ curl -s "http://localhost:${WORKER_PORT}/api/context/inject?project=PROJECT_NAME&full=true" \
59
+ > .scratch/cm-timeline.md
60
+ wc -l .scratch/cm-timeline.md
61
+ ```
62
+
63
+ Sanity-check: confirm the file is non-empty and has the expected structure (preamble, then date headers like `### Mon DD, YYYY`, then numeric observation lines `<id> <time> <emoji> <title>` and session boundary lines `S<n> <prompt> (Mon DD at HH:MMpm)`).
64
+
65
+ ### Step 3: Split the Timeline Into Per-ISO-Week Files
66
+
67
+ Write a Python script to `.scratch/split-timeline.py` that:
68
+
69
+ 1. Parses date headers (`### Mon DD, YYYY`).
70
+ 2. Groups days into ISO weeks via `date.isocalendar()` (Monday-start).
71
+ 3. Emits one file per week to `docs/timeline-weeks/<YYYY>-W<NN>-<MonDD>-to-<MonDD>.md`, preserving each day's section verbatim.
72
+ 4. Runs a dual-pass sanity check: total observations distributed must equal the count in the source file.
73
+
74
+ Output structure (filenames illustrative):
75
+
76
+ ```
77
+ docs/timeline-weeks/
78
+ README.md # weekly index table
79
+ YYYY-W<NN>-MonDD-to-MonDD.md # one per ISO week the timeline covers
80
+ ...
81
+ ```
82
+
83
+ Each weekly file should preserve the original daily sections verbatim. Do not paraphrase at this stage — the digest agents need raw fidelity.
84
+
85
+ **Count the resulting files** before launching the pipeline. That count is `TOTAL` and drives every subsequent step. Empty weeks (zero observations between active weeks) should be skipped — the pipeline only operates on weeks that have content.
86
+
87
+ ### Step 4: Build the Weekly Index README
88
+
89
+ Write `docs/timeline-weeks/README.md` with a markdown table: Week | Dates | Observations | Sessions | File. This becomes the operator's roadmap and helps the agents understand pacing (peak weeks vs trough weeks).
90
+
91
+ ### Step 5: Run the Consecutive Subagent Pipeline
92
+
93
+ **Critical: subagents run sequentially, NOT in parallel.** Each agent receives the prior agent's carry-forward block. This is the entire point of the skill — without it you have N disjoint summaries; with it you have an N-chapter serial narrative.
94
+
95
+ Create the output directory:
96
+
97
+ ```bash
98
+ mkdir -p docs/timeline-weeks/digests
99
+ ```
100
+
101
+ For each week, in chronological order, dispatch a Task subagent (general-purpose) with this prompt template. **Wait for each agent to complete before launching the next.** Capture the carry-forward block from the result and inject it as `STORY_SO_FAR` into the next prompt.
102
+
103
+ #### Subagent Prompt Template
104
+
105
+ ```
106
+ You are writing chapter {N} of {TOTAL} in a serial week-by-week digest of the {PROJECT} project's development history. Chapters 1 through {N-1} are written. {SPECIAL_NOTE: e.g. "This is the LARGEST week", "This is the TROUGH", "This is the FINAL chapter", "This is the ONLY chapter — both first AND final week"}.
107
+
108
+ **Source file (read in full):**
109
+ {ABSOLUTE_PATH_TO_WEEK_FILE}
110
+
111
+ **Output digest file (write):**
112
+ {ABSOLUTE_PATH_TO_DIGEST_FILE}
113
+
114
+ **Format key for the source file:**
115
+ - Numeric lines like `1 7:59p 🔵 Save hook file is empty` are observations (ID, time, type-emoji, title)
116
+ - `S##` lines are session boundaries (the user prompt that started the session)
117
+ - Emoji legend: 🎯session 🔴bugfix 🟣feature 🔄refactor ✅change 🔵discovery ⚖️decision 🚨security_alert 🔐security_note
118
+
119
+ **Story so far (carry-forward from Week {N-1}):**
120
+
121
+ {STORY_SO_FAR_BLOCK_OR_EMPTY_FOR_WEEK_1}
122
+
123
+ **Your digest must include:**
124
+ 1. **Title line** — `# Week {N} ({WEEK_LABEL}): {DATE_RANGE} — [your chosen subtitle]`
125
+ 2. **One-line tagline** — what this week is about, in plain English
126
+ 3. **Narrative section** ({BUDGET}) — tell the story. Resolve threads from prior weeks where the data shows resolution. Introduce new arcs. Use specific observation details.
127
+ 4. **Threads continued / opened / resolved** sections
128
+ 5. **Cliffhanger / What's next**
129
+ 6. **Carry-forward block** at the very bottom, fenced as ```carry-forward ... ``` — structured handoff for the next week's agent.
130
+
131
+ **CARRY-FORWARD DISCIPLINE:**
132
+ - Cap at ~350 words.
133
+ - AGGRESSIVELY PRUNE: drop arcs that didn't surface this week unless they're actively unresolved cliffhangers.
134
+ - Drop cast members absent 2+ weeks unless load-bearing for the long arc.
135
+ - Quality over completeness. The next agent inherits what you mention; mention judiciously.
136
+
137
+ Required carry-forward sub-sections:
138
+ - **Active arcs** — ongoing themes/projects the next agent should watch for
139
+ - **Cast** — notable named systems/people/tools (continuing + new)
140
+ - **Unresolved** — open questions or unfinished work
141
+ - **Tone notes** — how the story is being told (voice, perspective, register evolution)
142
+
143
+ **Tone rules:**
144
+ - Third-person narrator, sharp, observational. Not twee.
145
+ - AI is "Claude"; human is "{USER_FIRST_NAME}".
146
+ - Treat codebase components as characters — whatever the project's recurring named systems are (e.g. a worker, a queue, a process manager, a recurring bug, a flaky migration). Don't import names from another project; use what shows up in this project's observations.
147
+ - Don't manufacture drama. Name what's there.
148
+ - Track the user's prompt-register evolution week by week (frustration markers, escalation language, shifts in tone).
149
+ - Note meta-recursion if the project is reflexive about its own behavior (e.g. a tool that documents its own work, an AI agent debugging itself, a system that catches its own regressions).
150
+ - Watch for new villains or co-stars and name them.
151
+ - For trough/silent weeks: silence IS the story. Don't pad. Name what didn't happen.
152
+ - For surge weeks (>2,000 obs): pick 4-7 spine arcs and tell them well. Don't catalog.
153
+
154
+ **Important:** Do NOT speculate beyond what's in the source file.
155
+
156
+ After writing the file, return:
157
+ 1. Path of the file you wrote
158
+ 2. The carry-forward block verbatim
159
+ 3. One-sentence summary of the week
160
+ ```
161
+
162
+ #### Narrative Budget by Observation Count
163
+
164
+ Scale narrative length proportionally to the week's volume:
165
+
166
+ | Obs count | Narrative section budget |
167
+ | --- | --- |
168
+ | < 100 | 200–400 words |
169
+ | 100–500 | 300–600 words |
170
+ | 500–1,500 | 500–900 words |
171
+ | 1,500–3,000 | 700–1,100 words |
172
+ | 3,000+ | 800–1,300 words |
173
+
174
+ Pad these into the `{BUDGET}` slot of the prompt for each week.
175
+
176
+ #### The First Week
177
+
178
+ For Week 1, pass an empty `STORY_SO_FAR_BLOCK` and an instruction noting it's the origin chapter — the agent should establish initial cast, tone, and arcs for everyone after.
179
+
180
+ #### The Final Week
181
+
182
+ The final week gets a different ending: **no carry-forward block**. Instead, instruct the agent to write a `## Where We Are` section (~250 words) naming what's still open at the moment of writing. Tell the agent the project is ongoing — the digest stops; the story doesn't. Don't give the story a false ending.
183
+
184
+ #### When N = 1 (single-week project)
185
+
186
+ Apply BOTH treatments to the same chapter: empty `STORY_SO_FAR_BLOCK` AND `## Where We Are` instead of a carry-forward block. The agent is writing both the origin and the close in one pass. Don't reference prior or future chapters that don't exist.
187
+
188
+ ### Step 6: Rename Files for Sortable Order
189
+
190
+ The agents write digests with names like `YYYY-W<NN>-digest.md`. These already sort chronologically by ISO week (until a project crosses a year boundary inside one project name), but **add a zero-padded numeric prefix** so the order is unambiguous to humans browsing or scripting against the directory:
191
+
192
+ ```bash
193
+ cd docs/timeline-weeks/digests
194
+ total=$(ls *.md | wc -l | tr -d ' ')
195
+ width=${#total} # 1 for N<10, 2 for N<100, 3 for N<1000
196
+ [ "$width" -lt 2 ] && width=2 # always pad to at least 2 for readability
197
+ i=0
198
+ for f in *.md; do
199
+ printf -v prefix "%0${width}d" $i
200
+ mv "$f" "${prefix}-$f"
201
+ i=$((i+1))
202
+ done
203
+ ```
204
+
205
+ Result for N=30: `00-...md` through `29-...md`. For N=4: `00-...md` through `03-...md`. For N=120: `000-...md` through `119-...md`. **Always zero-pad** — `1-...md` and `10-...md` sort wrong without it.
206
+
207
+ Do NOT also prepend the order number to the digest title line inside each file. The filename prefix is for sorting; the title stays clean: `# Week N (W##): Date — Subtitle`.
208
+
209
+ ### Step 7: Report Completion
210
+
211
+ Tell the user:
212
+ - Total weeks digested (N)
213
+ - Output directory path
214
+ - Date range covered
215
+ - Any silent/trough weeks worth flagging
216
+ - A one-sentence capstone summarizing the arc — written by the final-chapter agent, or composed by the operator from the final agent's `## Where We Are` section.
217
+
218
+ ## Pipeline Discipline
219
+
220
+ These rules emerged from running the pipeline end-to-end. Encode them every time:
221
+
222
+ 1. **Sequential, not parallel.** The whole point is the carry-forward chain. Parallelism breaks it.
223
+ 2. **Carry-forward is bounded.** It will bloat without active pruning. Tell every agent: cap ~350 words, drop dormant arcs, drop absent cast.
224
+ 3. **Track register evolution explicitly.** The user's prompt-style across weeks is a story arc. Frustration markers shift over time (whatever they happen to be in this project's data). Name the shifts.
225
+ 4. **Treat components as characters.** Whatever recurring named systems show up in the observations are this project's villains and co-stars. Stable cast across weeks builds narrative coherence.
226
+ 5. **Honor silence.** Trough weeks (10–100 obs) are real chapters. Name what didn't happen. Don't pad.
227
+ 6. **Don't manufacture drama.** Just observe the data. If the project is reflexive, the recursion is the drama; you don't need to add more.
228
+ 7. **Final week: no false ending.** The digest stops; the project doesn't. Write `## Where We Are`, not "the end."
229
+
230
+ ## Error Handling
231
+
232
+ - **Empty timeline**: project name wrong, or worker not running. `curl -s "http://localhost:${WORKER_PORT}/api/search?query=*&limit=1"` to verify.
233
+ - **Worker not running**: start it via your usual method or check `ps aux | grep worker-service`.
234
+ - **Subagent returns malformed carry-forward**: extract the carry-forward block by regex (` ```carry-forward ... ``` `) and pass forward verbatim. If missing, ask the agent to retry with the explicit instruction "your reply MUST include the carry-forward block fenced as ```carry-forward ... ``` at the very end."
235
+ - **One agent fails mid-pipeline**: retry that week with the same carry-forward. Don't skip — the chain breaks.
236
+ - **Carry-forward growing past ~500 words**: tighten the discipline instruction in subsequent prompts. Force pruning explicitly.
237
+
238
+ ## Examples
239
+
240
+ ### Long-running project (~30 weeks)
241
+
242
+ User: "Make weekly digests for [project] from beginning to end"
243
+
244
+ 1. Resolve worker port, detect project name.
245
+ 2. Fetch full timeline → `.scratch/cm-timeline.md`.
246
+ 3. Run `.scratch/split-timeline.py` → N weekly files in `docs/timeline-weeks/` (e.g. 30).
247
+ 4. Generate `docs/timeline-weeks/README.md` index.
248
+ 5. Launch N subagents consecutively, one per week. Each gets the prior week's carry-forward. The first chapter starts with empty carry-forward; the final chapter writes `## Where We Are` instead of a carry-forward block.
249
+ 6. Rename digests with zero-padded order prefix (`00-...md` through `29-...md`).
250
+ 7. Report total chapters, date range, any troughs/peaks, and the one-line capstone the final agent produced.
251
+
252
+ ### Short-lived project (~3 weeks)
253
+
254
+ Same flow, just smaller. N=3, so:
255
+ - Chapter 1: empty carry-forward, establish cast/tone/arcs.
256
+ - Chapter 2: receives chapter 1's carry-forward, builds on it.
257
+ - Chapter 3: receives chapter 2's carry-forward, BUT gets the final-chapter treatment (`## Where We Are` instead of carry-forward block).
258
+ - Filenames: `00-...md`, `01-...md`, `02-...md`.
259
+
260
+ ### Single-week project (N=1)
261
+
262
+ Apply both first-and-final-chapter treatment to the only chapter: empty carry-forward, `## Where We Are` close, no inter-chapter references. Filename: `00-...md`.
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: what-the
3
+ description: "What the? Use when the user wants a plain-English breakdown of something technical — the who, what, where, why, and when."
4
+ ---
5
+
6
+ that sounds mad technical. explain to me the who, what, where, why, and when of this