claude_memory 0.7.1 → 0.9.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.
- checksums.yaml +4 -4
- data/.claude/memory.sqlite3 +0 -0
- data/.claude/rules/claude_memory.generated.md +32 -2
- data/.claude/settings.json +65 -15
- data/.claude/settings.local.json +5 -2
- data/.claude/skills/improve/SKILL.md +113 -25
- data/.claude/skills/upgrade-dependencies/SKILL.md +154 -0
- data/.claude-plugin/commands/distill-transcripts.md +98 -0
- data/.claude-plugin/commands/memory-recall.md +67 -0
- data/.claude-plugin/marketplace.json +2 -2
- data/.claude-plugin/plugin.json +3 -3
- data/.claude-plugin/scripts/hook-runner.sh +14 -0
- data/.claude-plugin/scripts/serve-mcp.sh +14 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +90 -1
- data/CLAUDE.md +56 -18
- data/README.md +35 -0
- data/db/migrations/013_add_mcp_tool_calls.rb +26 -0
- data/db/migrations/014_canonicalize_predicates.rb +30 -0
- data/docs/improvements.md +74 -74
- data/docs/influence/claude-mem.md +1 -0
- data/docs/influence/claude-supermemory.md +1 -0
- data/docs/influence/episodic-memory.md +1 -0
- data/docs/influence/grepai.md +1 -0
- data/docs/influence/kbs.md +1 -0
- data/docs/influence/lossless-claw.md +1 -0
- data/docs/influence/qmd.md +1 -0
- data/docs/quality_review.md +119 -224
- data/hooks/hooks.json +39 -7
- data/lib/claude_memory/commands/checks/distill_check.rb +61 -0
- data/lib/claude_memory/commands/checks/hooks_check.rb +2 -2
- data/lib/claude_memory/commands/checks/vec_check.rb +2 -1
- data/lib/claude_memory/commands/completion_command.rb +149 -0
- data/lib/claude_memory/commands/doctor_command.rb +2 -0
- data/lib/claude_memory/commands/embeddings_command.rb +198 -0
- data/lib/claude_memory/commands/help_command.rb +12 -1
- data/lib/claude_memory/commands/hook_command.rb +2 -1
- data/lib/claude_memory/commands/index_command.rb +85 -78
- data/lib/claude_memory/commands/initializers/database_ensurer.rb +16 -0
- data/lib/claude_memory/commands/initializers/global_initializer.rb +2 -1
- data/lib/claude_memory/commands/initializers/hooks_configurator.rb +55 -11
- data/lib/claude_memory/commands/initializers/project_initializer.rb +2 -1
- data/lib/claude_memory/commands/install_skill_command.rb +78 -0
- data/lib/claude_memory/commands/registry.rb +47 -32
- data/lib/claude_memory/commands/reject_command.rb +62 -0
- data/lib/claude_memory/commands/restore_command.rb +77 -0
- data/lib/claude_memory/commands/skills/distill-transcripts.md +102 -0
- data/lib/claude_memory/commands/skills/memory-recall.md +67 -0
- data/lib/claude_memory/commands/stats_command.rb +98 -2
- data/lib/claude_memory/configuration.rb +14 -1
- data/lib/claude_memory/core/fact_ranker.rb +2 -2
- data/lib/claude_memory/core/rr_fusion.rb +23 -6
- data/lib/claude_memory/core/snippet_extractor.rb +7 -3
- data/lib/claude_memory/core/text_builder.rb +11 -0
- data/lib/claude_memory/distill/json_schema.md +8 -4
- data/lib/claude_memory/distill/null_distiller.rb +2 -0
- data/lib/claude_memory/domain/entity.rb +13 -1
- data/lib/claude_memory/domain/fact.rb +26 -2
- data/lib/claude_memory/domain/provenance.rb +0 -1
- data/lib/claude_memory/embeddings/api_adapter.rb +97 -0
- data/lib/claude_memory/embeddings/dimension_check.rb +23 -0
- data/lib/claude_memory/embeddings/fastembed_adapter.rb +46 -12
- data/lib/claude_memory/embeddings/generator.rb +4 -0
- data/lib/claude_memory/embeddings/inspector.rb +91 -0
- data/lib/claude_memory/embeddings/model_registry.rb +210 -0
- data/lib/claude_memory/embeddings/resolver.rb +44 -0
- data/lib/claude_memory/hook/context_injector.rb +58 -2
- data/lib/claude_memory/hook/distillation_runner.rb +46 -0
- data/lib/claude_memory/hook/handler.rb +11 -2
- data/lib/claude_memory/index/vector_index.rb +15 -2
- data/lib/claude_memory/infrastructure/schema_validator.rb +3 -3
- data/lib/claude_memory/ingest/ingester.rb +17 -0
- data/lib/claude_memory/mcp/handlers/context_handlers.rb +38 -0
- data/lib/claude_memory/mcp/handlers/management_handlers.rb +169 -0
- data/lib/claude_memory/mcp/handlers/query_handlers.rb +115 -0
- data/lib/claude_memory/mcp/handlers/setup_handlers.rb +211 -0
- data/lib/claude_memory/mcp/handlers/shortcut_handlers.rb +37 -0
- data/lib/claude_memory/mcp/handlers/stats_handlers.rb +205 -0
- data/lib/claude_memory/mcp/instructions_builder.rb +19 -1
- data/lib/claude_memory/mcp/query_guide.rb +10 -0
- data/lib/claude_memory/mcp/response_formatter.rb +1 -0
- data/lib/claude_memory/mcp/server.rb +22 -1
- data/lib/claude_memory/mcp/telemetry.rb +86 -0
- data/lib/claude_memory/mcp/text_summary.rb +26 -0
- data/lib/claude_memory/mcp/tool_definitions.rb +116 -4
- data/lib/claude_memory/mcp/tool_helpers.rb +43 -0
- data/lib/claude_memory/mcp/tools.rb +50 -679
- data/lib/claude_memory/publish.rb +40 -5
- data/lib/claude_memory/recall/dual_engine.rb +105 -0
- data/lib/claude_memory/recall/legacy_engine.rb +138 -0
- data/lib/claude_memory/recall/query_core.rb +371 -0
- data/lib/claude_memory/recall.rb +121 -673
- data/lib/claude_memory/resolve/predicate_policy.rb +63 -3
- data/lib/claude_memory/resolve/resolver.rb +43 -0
- data/lib/claude_memory/shortcuts.rb +4 -4
- data/lib/claude_memory/store/retry_handler.rb +61 -0
- data/lib/claude_memory/store/schema_manager.rb +68 -0
- data/lib/claude_memory/store/sqlite_store.rb +334 -201
- data/lib/claude_memory/store/store_manager.rb +50 -1
- data/lib/claude_memory/sweep/maintenance.rb +115 -1
- data/lib/claude_memory/sweep/sweeper.rb +3 -0
- data/lib/claude_memory/templates/hooks.example.json +26 -7
- data/lib/claude_memory/version.rb +1 -1
- data/lib/claude_memory.rb +16 -0
- metadata +48 -8
- data/.claude/memory.sqlite3-shm +0 -0
- data/.claude/memory.sqlite3-wal +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b42d582ddd17dd325f8048268c889d6c80c1ca9c229732da1a8d619279201af
|
|
4
|
+
data.tar.gz: 8853caacc212900483a4a3f9939e8261e18f53b886675f01b4c5a5b61a506d26
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a65038105334c741d26c5e485da7565016ae670ed24f04d4c23b2bb00329d729ee3bfd91cf333ea36ad518937e40e4c95c4d0846bcb423984b0ec683fee59b5a
|
|
7
|
+
data.tar.gz: d94e2ce5fbd1ed496a0c56f094b7f1fbb01b9eb255c819a95b2ffe6ecf79ea9c1706408fd658b2bcaee19d440a87d45a1185a7e471cb05fc7c003d433d6e5808
|
data/.claude/memory.sqlite3
CHANGED
|
Binary file
|
|
@@ -1,21 +1,51 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!--
|
|
2
2
|
This file is auto-generated by claude-memory.
|
|
3
3
|
Do not edit manually - changes will be overwritten.
|
|
4
|
-
Generated: 2026-
|
|
4
|
+
Generated: 2026-04-15T17:38:20Z
|
|
5
5
|
-->
|
|
6
6
|
|
|
7
7
|
# Project Memory
|
|
8
8
|
|
|
9
9
|
## Current Decisions
|
|
10
10
|
|
|
11
|
+
- MCP tool-call telemetry stores minimal columns (tool_name, duration_ms, result_count, scope, error_class) — deliberately no query_text or query_hash. YAGNI: hashes are write-only without the raw text, and raw text adds privacy concerns without clear value beyond existing shortcut tools (memory.decisions, memory.conventions).
|
|
11
12
|
- From QMD 2026-02-02 restudy: adopt Claude Code plugin format, MCP structured content pattern, MCP query guide prompt, inline status checks. Carry forward sqlite-vec, RRF, docids, smart expansion from 2026-01-26. Reject custom fine-tuned models, LLM reranking, YAML collections.
|
|
12
13
|
- From claude-supermemory study: adopt SessionStart hook context injection (hookSpecificOutput.additionalContext), tool-specific observation compression, and relative time formatting. Reject cloud storage dependency and no-test approach.
|
|
13
14
|
|
|
14
15
|
## Conventions
|
|
15
16
|
|
|
17
|
+
- Never use Sequel.sqlite for DB reads; this gem only depends on extralite. Use Sequel.connect("extralite://#{db_path}") or SQLiteStore.new. Sequel.sqlite requires the ungem'd sqlite3 adapter and fails at runtime.
|
|
18
|
+
- Two distinct tool_calls tables exist: tool_calls (v3) for transcript-observed Claude Code tool usage, and mcp_tool_calls (v13) for MCP server telemetry. Disjoint purposes, never join.
|
|
19
|
+
- MCP tool-call telemetry is recorded via MCP::Telemetry wrapping Server#handle_tools_call. Writes to mcp_tool_calls table in the project DB. Swallows DB errors so telemetry never breaks a real tool response. Viewable via 'claude-memory stats --tools [--since DAYS]'.
|
|
20
|
+
- mcp_tool_calls retention is 90 days, enforced by Sweep::Maintenance#prune_old_mcp_tool_calls wired into Sweeper#run!. Configurable via mcp_tool_call_retention_days in Maintenance DEFAULT_CONFIG.
|
|
21
|
+
- CLAUDE_CONFIG_DIR env var overrides the default ~/.claude location for Configuration#global_db_path. Access via Configuration#claude_config_dir. Additive, backwards compatible.
|
|
22
|
+
- Registry::COMMANDS stores {class:, description:} entries as the single source of truth for command name, class reference, and shell-completion description. Class constants stored directly (no const_get). Registry.descriptions feeds CompletionCommand; adding a new command requires updating only this hash.
|
|
23
|
+
- Prefer do...end over braces when a block has repeated argument names, multiple expressions, or non-trivial body. Single-expression simple blocks can still use braces.
|
|
24
|
+
- EXPECTED_HOOKS constant must stay in sync with events in HooksConfigurator#build_hooks_config. Adding a new hook event without updating EXPECTED_HOOKS causes false doctor warnings.
|
|
25
|
+
- Tests using --db for hook context only set the project DB path. StoreManager still connects to the real global DB. Must stub Configuration to return a temp global path for isolation.
|
|
26
|
+
- Version must be updated in three places: lib/claude_memory/version.rb, .claude-plugin/plugin.json, .claude-plugin/marketplace.json. Runtime code uses ClaudeMemory::VERSION dynamically.
|
|
27
|
+
- Use module inclusion (not class extraction) to break up god objects — preserves public API so zero tests need modification
|
|
28
|
+
- Configuration class has instance methods only — use Configuration.new.global_db_path, not Configuration.global_db_path. Stub with instance_double + allow(Configuration).to receive(:new).and_return(config)
|
|
29
|
+
- OperationTracker.reset_stuck_operations only resets operations older than 24 hours (STALE_THRESHOLD_SECONDS). Tests must backdate started_at to trigger resets.
|
|
30
|
+
- SCHEMA_VERSION constant lives in Store::SchemaManager module but is accessible as SQLiteStore::SCHEMA_VERSION via Ruby include-based constant lookup
|
|
16
31
|
- MCP tools return dual content (text summary) + structuredContent (JSON) via TextSummary module and Server#handle_tools_call. Compact mode (compact: true) omits receipts for ~60% smaller responses.
|
|
17
32
|
- ContentSanitizer strips system-reminder, local-command-caveat, command-message, command-name, command-args tags in addition to private/no-memory/secret/claude-memory-context.
|
|
18
33
|
- Core::RelativeTime module provides progressive time formatting: just now → Xm ago → Xh ago → Xd ago → YYYY-MM-DD. Used in ResponseFormatter for *_ago fields.
|
|
19
34
|
- MCP server registers memory_guide prompt via prompts/list and prompts/get endpoints. QueryGuide module holds prompt content.
|
|
20
35
|
- Claude Code plugin with marketplace.json, skill definitions, MCP server bundling. 5,700+ stars, by Tobi Lütke. Custom fine-tuned query expansion (Qwen3-1.7B, SFT+GRPO). Dual content/structuredContent MCP pattern.
|
|
21
36
|
- Cloud-backed Claude Code plugin (~1,195 LOC JavaScript) using Supermemory API for persistent memory across sessions. Uses hooks for SessionStart context injection and Stop transcript capture. No local database.
|
|
37
|
+
|
|
38
|
+
## Technical Constraints
|
|
39
|
+
|
|
40
|
+
- **Uses database**: sqlite
|
|
41
|
+
|
|
42
|
+
## Additional Knowledge
|
|
43
|
+
|
|
44
|
+
### Architecture
|
|
45
|
+
|
|
46
|
+
- MCP::Tools: Thin 104-line dispatcher that includes 6 handler modules in mcp/handlers/: QueryHandlers, ShortcutHandlers, ContextHandlers, ManagementHandlers, StatsHandlers, SetupHandlers
|
|
47
|
+
- Recall: 94-line facade delegating to @engine (DualEngine or LegacyEngine), both include shared QueryCore module with all store-level query logic
|
|
48
|
+
- SQLiteStore: 386-line CRUD class that includes RetryHandler (retry/connection logic) and SchemaManager (migrations/version sync) modules
|
|
49
|
+
- Embeddings: Pluggable providers via Embeddings.resolve(name, env:). Three providers: tfidf (default), fastembed, api. Duck-typed contract: name, dimensions, generate(text). ENV: CLAUDE_MEMORY_EMBEDDING_PROVIDER
|
|
50
|
+
- Embeddings::DimensionCheck: Pure value object — DimensionCheck.call(store, provider) returns Data.define Result with :fresh/:match/:mismatch status. No side effects; caller decides how to handle mismatch.
|
|
51
|
+
|
data/.claude/settings.json
CHANGED
|
@@ -5,24 +5,33 @@
|
|
|
5
5
|
"hooks": [
|
|
6
6
|
{
|
|
7
7
|
"type": "command",
|
|
8
|
-
"command": "claude-memory hook ingest",
|
|
9
|
-
"timeout":
|
|
8
|
+
"command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
|
|
9
|
+
"timeout": 5,
|
|
10
|
+
"statusMessage": "Saving memory..."
|
|
10
11
|
}
|
|
11
12
|
]
|
|
12
13
|
}
|
|
13
14
|
],
|
|
14
|
-
"
|
|
15
|
+
"StopFailure": [
|
|
15
16
|
{
|
|
16
17
|
"hooks": [
|
|
17
18
|
{
|
|
18
19
|
"type": "command",
|
|
19
|
-
"command": "claude-memory hook ingest",
|
|
20
|
-
"timeout":
|
|
21
|
-
|
|
20
|
+
"command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
|
|
21
|
+
"timeout": 5,
|
|
22
|
+
"statusMessage": "Saving memory..."
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"SessionStart": [
|
|
28
|
+
{
|
|
29
|
+
"hooks": [
|
|
22
30
|
{
|
|
23
31
|
"type": "command",
|
|
24
32
|
"command": "claude-memory hook context",
|
|
25
|
-
"timeout": 5
|
|
33
|
+
"timeout": 5,
|
|
34
|
+
"statusMessage": "Loading memory..."
|
|
26
35
|
}
|
|
27
36
|
]
|
|
28
37
|
}
|
|
@@ -32,13 +41,15 @@
|
|
|
32
41
|
"hooks": [
|
|
33
42
|
{
|
|
34
43
|
"type": "command",
|
|
35
|
-
"command": "claude-memory hook ingest",
|
|
36
|
-
"timeout": 30
|
|
44
|
+
"command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
|
|
45
|
+
"timeout": 30,
|
|
46
|
+
"statusMessage": "Saving memory..."
|
|
37
47
|
},
|
|
38
48
|
{
|
|
39
49
|
"type": "command",
|
|
40
|
-
"command": "claude-memory hook sweep",
|
|
41
|
-
"timeout": 30
|
|
50
|
+
"command": "claude-memory hook sweep --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
|
|
51
|
+
"timeout": 30,
|
|
52
|
+
"statusMessage": "Sweeping memory..."
|
|
42
53
|
}
|
|
43
54
|
]
|
|
44
55
|
}
|
|
@@ -48,13 +59,52 @@
|
|
|
48
59
|
"hooks": [
|
|
49
60
|
{
|
|
50
61
|
"type": "command",
|
|
51
|
-
"command": "claude-memory hook ingest",
|
|
52
|
-
"timeout": 30
|
|
62
|
+
"command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
|
|
63
|
+
"timeout": 30,
|
|
64
|
+
"statusMessage": "Saving memory..."
|
|
53
65
|
},
|
|
54
66
|
{
|
|
55
67
|
"type": "command",
|
|
56
|
-
"command": "claude-memory hook sweep",
|
|
57
|
-
"timeout": 30
|
|
68
|
+
"command": "claude-memory hook sweep --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
|
|
69
|
+
"timeout": 30,
|
|
70
|
+
"statusMessage": "Sweeping memory..."
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"TaskCompleted": [
|
|
76
|
+
{
|
|
77
|
+
"hooks": [
|
|
78
|
+
{
|
|
79
|
+
"type": "command",
|
|
80
|
+
"command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
|
|
81
|
+
"timeout": 10,
|
|
82
|
+
"statusMessage": "Saving memory..."
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"TeammateIdle": [
|
|
88
|
+
{
|
|
89
|
+
"hooks": [
|
|
90
|
+
{
|
|
91
|
+
"type": "command",
|
|
92
|
+
"command": "claude-memory hook ingest --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
|
|
93
|
+
"timeout": 15,
|
|
94
|
+
"statusMessage": "Saving memory..."
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"Notification": [
|
|
100
|
+
{
|
|
101
|
+
"matcher": "idle_prompt",
|
|
102
|
+
"hooks": [
|
|
103
|
+
{
|
|
104
|
+
"type": "command",
|
|
105
|
+
"command": "claude-memory hook sweep --db /Users/valentinostoll/src/claude_memory/.claude/memory.sqlite3",
|
|
106
|
+
"timeout": 10,
|
|
107
|
+
"statusMessage": "Sweeping memory..."
|
|
58
108
|
}
|
|
59
109
|
]
|
|
60
110
|
}
|
data/.claude/settings.local.json
CHANGED
|
@@ -48,8 +48,11 @@
|
|
|
48
48
|
"Bash(claude-memory search:*)",
|
|
49
49
|
"Bash(bundle exec:*)",
|
|
50
50
|
"Skill(improve)",
|
|
51
|
-
"Skill(improve:*)"
|
|
51
|
+
"Skill(improve:*)",
|
|
52
|
+
"WebFetch(domain:arxiv.org)",
|
|
53
|
+
"mcp__memory__memory_conflicts"
|
|
52
54
|
]
|
|
53
55
|
},
|
|
54
|
-
"enableAllProjectMcpServers": true
|
|
56
|
+
"enableAllProjectMcpServers": true,
|
|
57
|
+
"outputStyle": "memory-aware"
|
|
55
58
|
}
|
|
@@ -3,23 +3,88 @@ name: improve
|
|
|
3
3
|
description: Incrementally implement feature improvements from docs/improvements.md with tests and atomic commits. Focuses on new functionality rather than refactoring.
|
|
4
4
|
agent: general-purpose
|
|
5
5
|
allowed-tools: Read, Grep, Edit, Write, Bash
|
|
6
|
+
arguments:
|
|
7
|
+
- name: mode
|
|
8
|
+
description: "Execution mode: 'sub-agent' (default, sequential) or 'agent-team' (parallel via agent teams)"
|
|
9
|
+
required: false
|
|
10
|
+
default: "sub-agent"
|
|
6
11
|
---
|
|
7
12
|
|
|
8
13
|
# Feature Improvements - Incremental Implementation
|
|
9
14
|
|
|
10
15
|
Systematically implement feature improvements from `docs/improvements.md`, making tested, atomic commits for each feature addition.
|
|
11
16
|
|
|
17
|
+
## Execution Modes
|
|
18
|
+
|
|
19
|
+
This skill supports two modes, passed as the first argument:
|
|
20
|
+
|
|
21
|
+
- **`sub-agent`** (default): A single agent works through improvements sequentially. Best for small batches (1-3 features) or features with dependencies.
|
|
22
|
+
- **`agent-team`**: Spawns a coordinated team of agents that implement independent features in parallel. Best for larger batches (3+) of independent features.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Mode: agent-team
|
|
27
|
+
|
|
28
|
+
When invoked with `agent-team`, follow this process:
|
|
29
|
+
|
|
30
|
+
### Step 1: Read and Assess Improvements
|
|
31
|
+
|
|
32
|
+
Read `docs/improvements.md` and identify all implementable features using the same feasibility criteria as sub-agent mode (skip Categories D-F, "Features to Avoid", "If Requested" items).
|
|
33
|
+
|
|
34
|
+
### Step 2: Group Independent Features
|
|
35
|
+
|
|
36
|
+
Partition implementable features into independent groups:
|
|
37
|
+
- Features touching **different files** can be parallelized
|
|
38
|
+
- Features sharing files or with dependencies must be sequential
|
|
39
|
+
- Aim for 3-5 teammates maximum
|
|
40
|
+
|
|
41
|
+
### Step 3: Create the Agent Team
|
|
42
|
+
|
|
43
|
+
Create an agent team. For each teammate:
|
|
44
|
+
|
|
45
|
+
1. **Assign one or two related features** per teammate
|
|
46
|
+
2. **Provide full context** — teammates don't share your conversation history
|
|
47
|
+
3. **Include these instructions for each teammate**:
|
|
48
|
+
- Read relevant existing code before making changes
|
|
49
|
+
- Follow the project's code style (Standard Ruby, frozen_string_literal)
|
|
50
|
+
- Write tests for all new functionality
|
|
51
|
+
- Run `bundle exec rake standard:fix` before committing
|
|
52
|
+
- Run relevant spec file after each edit, full suite before committing
|
|
53
|
+
- Run `bundle exec rspec` to verify all tests pass
|
|
54
|
+
- Make atomic commits with `[Feature]` prefix format
|
|
55
|
+
- Update `docs/improvements.md` to mark features as implemented
|
|
56
|
+
- Reference `.claude/skills/improve/feature-patterns.md` for implementation recipes
|
|
57
|
+
|
|
58
|
+
### Step 4: Monitor and Coordinate
|
|
59
|
+
|
|
60
|
+
- Wait for all teammates to complete their tasks
|
|
61
|
+
- If a teammate reports a blocker or conflict, help resolve it
|
|
62
|
+
- Do NOT implement tasks yourself — let teammates do the work
|
|
63
|
+
|
|
64
|
+
### Step 5: Validate and Report
|
|
65
|
+
|
|
66
|
+
After all teammates finish:
|
|
67
|
+
|
|
68
|
+
1. Run the full test suite: `bundle exec rspec`
|
|
69
|
+
2. Run the linter: `bundle exec rake standard:fix`
|
|
70
|
+
3. If any failures, fix them or coordinate with the relevant teammate
|
|
71
|
+
4. Provide a consolidated progress report (same Final Report format as sub-agent mode)
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Mode: sub-agent (default)
|
|
76
|
+
|
|
12
77
|
## Process Overview
|
|
13
78
|
|
|
14
79
|
1. **Check memory health** by calling `memory.check_setup` to verify the system is operational
|
|
15
80
|
2. **Read the improvements document** from `docs/improvements.md`
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
81
|
+
3. **Identify unimplemented features** from "Remaining Tasks" section
|
|
82
|
+
4. **Prioritize by stated priority** (Medium → Low)
|
|
83
|
+
5. **Assess feasibility** (skip if too complex or requires external services)
|
|
84
|
+
6. **Implement features incrementally** (one logical feature at a time)
|
|
85
|
+
7. **Run tests after each change** to ensure nothing breaks
|
|
86
|
+
8. **Make atomic commits** that capture the feature and its purpose
|
|
87
|
+
9. **Update improvements.md** to mark features as implemented
|
|
23
88
|
|
|
24
89
|
## Detailed Steps
|
|
25
90
|
|
|
@@ -100,11 +165,15 @@ For each feature:
|
|
|
100
165
|
```bash
|
|
101
166
|
bundle exec rake standard:fix
|
|
102
167
|
```
|
|
103
|
-
5. **Run tests
|
|
168
|
+
5. **Run targeted tests** after each edit:
|
|
169
|
+
```bash
|
|
170
|
+
bundle exec rspec spec/claude_memory/<relevant_spec>.rb
|
|
171
|
+
```
|
|
172
|
+
6. **Run full suite** before committing:
|
|
104
173
|
```bash
|
|
105
174
|
bundle exec rspec
|
|
106
175
|
```
|
|
107
|
-
|
|
176
|
+
7. **Fix any test failures** before proceeding
|
|
108
177
|
|
|
109
178
|
### Step 5: Make Atomic Commit
|
|
110
179
|
|
|
@@ -300,9 +369,15 @@ Is it marked "Features to Avoid"?
|
|
|
300
369
|
↓
|
|
301
370
|
Category D (Background)?
|
|
302
371
|
├─ YES → Assess carefully, may skip
|
|
303
|
-
└─ NO →
|
|
372
|
+
└─ NO → Continue
|
|
304
373
|
↓
|
|
305
|
-
|
|
374
|
+
Does it have dependencies on other features?
|
|
375
|
+
├─ YES → Are dependencies complete?
|
|
376
|
+
│ ├─ NO → SKIP, note dependency
|
|
377
|
+
│ └─ YES → Continue
|
|
378
|
+
└─ NO → Implement (Categories A-C safe)
|
|
379
|
+
↓
|
|
380
|
+
Implement the feature
|
|
306
381
|
↓
|
|
307
382
|
Run tests
|
|
308
383
|
↓
|
|
@@ -324,11 +399,15 @@ Is it marked "Features to Avoid"?
|
|
|
324
399
|
## Time Budgets
|
|
325
400
|
|
|
326
401
|
**Per Feature:**
|
|
327
|
-
- Category A (Schema): Max
|
|
328
|
-
- Category B (Reporting): Max
|
|
329
|
-
- Category C (CLI): Max 30 minutes
|
|
330
|
-
- Category D (Background): Max
|
|
331
|
-
- Category E (External): Max
|
|
402
|
+
- Category A (Schema): Max 15 minutes — skip if stuck after 15
|
|
403
|
+
- Category B (Reporting): Max 20 minutes — skip if stuck after 20
|
|
404
|
+
- Category C (CLI): Max 30 minutes — skip if stuck after 30
|
|
405
|
+
- Category D (Background): Max 45 minutes (or skip at first sign of daemon complexity)
|
|
406
|
+
- Category E (External): Max 30 minutes (or skip at first sign of dependency issues)
|
|
407
|
+
|
|
408
|
+
**Per Debug Cycle:**
|
|
409
|
+
- Test failure fix: Max 15 minutes — if you can't fix it in 15 minutes, revert and skip
|
|
410
|
+
- Understanding code: Max 10 minutes — if unclear after 10 minutes, skip and report
|
|
332
411
|
|
|
333
412
|
**Session Total:** Max 2 hours
|
|
334
413
|
|
|
@@ -337,26 +416,35 @@ If time budget exceeded: SKIP remaining features and report.
|
|
|
337
416
|
## Testing Strategy
|
|
338
417
|
|
|
339
418
|
### Test Frequency
|
|
340
|
-
- After
|
|
341
|
-
- After
|
|
342
|
-
- After
|
|
343
|
-
- Before commit: Full test suite
|
|
419
|
+
- After each file edit: Run the relevant spec file
|
|
420
|
+
- After schema changes: Run `spec/claude_memory/store/`
|
|
421
|
+
- After new command: Run `spec/claude_memory/commands/`
|
|
422
|
+
- Before each commit: Full test suite
|
|
423
|
+
- If >5 files changed: Full test suite immediately
|
|
344
424
|
|
|
345
425
|
### Test Commands
|
|
346
426
|
```bash
|
|
347
|
-
#
|
|
348
|
-
bundle exec rspec spec/claude_memory/commands/
|
|
427
|
+
# Single relevant spec (fastest feedback)
|
|
428
|
+
bundle exec rspec spec/claude_memory/commands/metrics_command_spec.rb
|
|
349
429
|
|
|
350
|
-
#
|
|
430
|
+
# Module-level specs
|
|
431
|
+
bundle exec rspec spec/claude_memory/commands/
|
|
351
432
|
bundle exec rspec spec/claude_memory/store/
|
|
352
433
|
|
|
353
|
-
# Full suite
|
|
434
|
+
# Full suite (before commit)
|
|
354
435
|
bundle exec rspec
|
|
355
436
|
|
|
356
|
-
# With linting
|
|
437
|
+
# With linting (final check)
|
|
357
438
|
bundle exec rake
|
|
358
439
|
```
|
|
359
440
|
|
|
441
|
+
### Test Failure Response
|
|
442
|
+
1. Read error message carefully
|
|
443
|
+
2. Check if your change caused it (vs pre-existing)
|
|
444
|
+
3. If your change: fix within 15 minutes or revert and skip
|
|
445
|
+
4. If pre-existing: note and continue
|
|
446
|
+
5. If unsure: revert change and skip item
|
|
447
|
+
|
|
360
448
|
### New Feature Tests
|
|
361
449
|
|
|
362
450
|
Always add tests for new features:
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: upgrade-dependencies
|
|
3
|
+
description: "Upgrade all Ruby gem dependencies to their latest versions with release note review and codebase alignment checks. Use this skill whenever the user asks to update, upgrade, or bump dependencies, gems, or packages — even casually like 'update my gems' or 'are my deps up to date?'"
|
|
4
|
+
agent: general-purpose
|
|
5
|
+
allowed-tools: Read, Grep, Glob, Bash, Edit, Write, Agent, WebFetch
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Dependency Upgrade Skill
|
|
9
|
+
|
|
10
|
+
Systematically upgrade Ruby gem dependencies by researching latest versions, reviewing release notes for breaking changes, updating version constraints, verifying with tests, and confirming codebase alignment.
|
|
11
|
+
|
|
12
|
+
The goal is a *thoughtful* upgrade — not blindly bumping versions, but understanding what changed and ensuring the codebase is compatible. This matters because a silent API change can introduce bugs that tests don't catch if the tests don't exercise the affected code path.
|
|
13
|
+
|
|
14
|
+
## Process Overview
|
|
15
|
+
|
|
16
|
+
1. **Discover** current dependencies and their constraints
|
|
17
|
+
2. **Research** latest versions and release notes (in parallel)
|
|
18
|
+
3. **Analyze** breaking changes and codebase impact
|
|
19
|
+
4. **Upgrade** version constraints and install
|
|
20
|
+
5. **Verify** with the full test suite
|
|
21
|
+
6. **Report** a summary table with upgrade details
|
|
22
|
+
|
|
23
|
+
## Step 1: Discover Current Dependencies
|
|
24
|
+
|
|
25
|
+
Read the gemspec and Gemfile to build a complete dependency inventory.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Read *.gemspec → runtime dependencies (add_dependency)
|
|
29
|
+
Read Gemfile → development dependencies (gem declarations)
|
|
30
|
+
Run: bundle outdated → current vs latest versions, which are constrained
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Build a working list with these columns:
|
|
34
|
+
- **Gem name**
|
|
35
|
+
- **Source** (gemspec or Gemfile)
|
|
36
|
+
- **Current constraint** (e.g., `~> 5.0`)
|
|
37
|
+
- **Installed version** (from `bundle outdated` or `Gemfile.lock`)
|
|
38
|
+
- **Latest version** (from `bundle outdated`)
|
|
39
|
+
- **Constrained?** (is the version constraint preventing upgrade?)
|
|
40
|
+
|
|
41
|
+
## Step 2: Research Release Notes
|
|
42
|
+
|
|
43
|
+
For each gem that has a newer version available, research what changed. Launch these as parallel Agent subagents — one per gem — to avoid sequential delays.
|
|
44
|
+
|
|
45
|
+
Each research agent should:
|
|
46
|
+
|
|
47
|
+
1. Run `gem search <name> --exact --versions` to confirm the latest version
|
|
48
|
+
2. Fetch the changelog or release notes from GitHub (check CHANGELOG.md, CHANGES, HISTORY.md, or GitHub Releases)
|
|
49
|
+
3. Summarize changes between the installed version and latest version
|
|
50
|
+
4. Flag any **breaking changes**, **deprecations**, or **API changes**
|
|
51
|
+
5. Note if it's a **major version bump** (higher risk)
|
|
52
|
+
|
|
53
|
+
For transitive dependencies (not directly declared but showing in `bundle outdated`), research is optional — focus on direct dependencies. Transitive deps are upgraded automatically when their parent gem allows it.
|
|
54
|
+
|
|
55
|
+
### What to look for in release notes
|
|
56
|
+
|
|
57
|
+
- **Removed methods or classes** the codebase might use
|
|
58
|
+
- **Renamed options or changed defaults** that could silently alter behavior
|
|
59
|
+
- **New required arguments** to methods we call
|
|
60
|
+
- **Deprecated features** we rely on (working now, but will break later)
|
|
61
|
+
- **Changed return types** or data structures
|
|
62
|
+
- **Minimum Ruby version bumps** that could affect CI or deployment
|
|
63
|
+
|
|
64
|
+
## Step 3: Analyze Codebase Impact
|
|
65
|
+
|
|
66
|
+
For each gem with breaking changes or API modifications:
|
|
67
|
+
|
|
68
|
+
1. **Grep the codebase** for usage of affected APIs
|
|
69
|
+
2. **Check test coverage** — are the affected code paths tested?
|
|
70
|
+
3. **Determine if changes are needed** before or after the upgrade
|
|
71
|
+
|
|
72
|
+
Classify each upgrade:
|
|
73
|
+
|
|
74
|
+
- **Safe** — no breaking changes, or breaking changes don't affect our usage
|
|
75
|
+
- **Needs code changes** — our code uses a deprecated or removed API
|
|
76
|
+
- **Held back** — a transitive dependency constraint prevents the upgrade (explain which parent gem and why)
|
|
77
|
+
|
|
78
|
+
If code changes are needed, make them *before* bumping the version constraint so the upgrade commit is clean.
|
|
79
|
+
|
|
80
|
+
## Step 4: Upgrade Dependencies
|
|
81
|
+
|
|
82
|
+
### Gemspec dependencies (runtime)
|
|
83
|
+
|
|
84
|
+
Update version constraints to target the latest version. Use `~>` with the appropriate precision:
|
|
85
|
+
|
|
86
|
+
- For stable gems (1.0+): `~> X.Y` allows patch updates (e.g., `~> 5.102` allows 5.102.x)
|
|
87
|
+
- For pre-1.0 gems: `~> 0.X, ">= 0.X.Y"` to pin a minimum while allowing patches
|
|
88
|
+
- For gems where a specific fix matters: add `">= X.Y.Z"` as an additional constraint
|
|
89
|
+
|
|
90
|
+
### Gemfile dependencies (development)
|
|
91
|
+
|
|
92
|
+
Same approach. If a major version bump is available (e.g., lefthook 1.x → 2.x), check the migration guide before bumping.
|
|
93
|
+
|
|
94
|
+
### Install
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
bundle update
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
If `bundle update` fails due to dependency conflicts, resolve them. Common strategies:
|
|
101
|
+
- Relax an overly tight constraint
|
|
102
|
+
- Update the conflicting parent gem first
|
|
103
|
+
- Accept that a gem can't be upgraded yet and document why
|
|
104
|
+
|
|
105
|
+
## Step 5: Verify with Tests
|
|
106
|
+
|
|
107
|
+
Run the full test suite:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
bundle exec rspec
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Also run the linter to catch any style issues:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
bundle exec rake standard
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
If tests fail:
|
|
120
|
+
1. Read the failure carefully — is it caused by the upgrade or pre-existing?
|
|
121
|
+
2. If caused by the upgrade, fix the code to work with the new version
|
|
122
|
+
3. If unfixable, revert that specific gem's upgrade and note it in the report
|
|
123
|
+
|
|
124
|
+
## Step 6: Present Summary
|
|
125
|
+
|
|
126
|
+
Present a clear summary table of all changes:
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
| Gem | Old Version | New Version | Old Constraint | New Constraint | Notes |
|
|
130
|
+
|-----|------------|-------------|----------------|----------------|-------|
|
|
131
|
+
| sequel | 5.100.0 | 5.102.0 | ~> 5.0 | ~> 5.102 | No breaking changes |
|
|
132
|
+
| lefthook | 1.13.6 | 2.1.4 | ~> 1.6 | ~> 2.1 | Major version bump, reviewed migration guide |
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Follow the table with:
|
|
136
|
+
|
|
137
|
+
1. **Breaking changes found** — what changed and how the codebase was updated
|
|
138
|
+
2. **Gems held back** — which gems couldn't be upgraded and why (e.g., "diff-lcs 2.0 held back by rspec's ~> 1.4 constraint")
|
|
139
|
+
3. **Notable new features** — anything worth adopting from the new versions
|
|
140
|
+
4. **Test results** — confirmation that all tests pass
|
|
141
|
+
|
|
142
|
+
## Edge Cases
|
|
143
|
+
|
|
144
|
+
### Gems with no GitHub repository
|
|
145
|
+
Fall back to `gem info <name>` and the RubyGems page for release history. Note reduced confidence in the review.
|
|
146
|
+
|
|
147
|
+
### Yanked versions
|
|
148
|
+
If `bundle update` fails because a version was yanked, try the next most recent version.
|
|
149
|
+
|
|
150
|
+
### Pre-release versions
|
|
151
|
+
Do not upgrade to pre-release or alpha versions unless the user explicitly asks. Stick to stable releases.
|
|
152
|
+
|
|
153
|
+
### Monorepo gems
|
|
154
|
+
Some gems (like rails components) are versioned together. Upgrade them as a group.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Distill Transcripts
|
|
2
|
+
|
|
3
|
+
Extract structured knowledge (facts, entities, decisions) from undistilled transcript content and persist it to long-term memory.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/distill-transcripts
|
|
9
|
+
/distill-transcripts --limit 10
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
You are a knowledge extraction specialist. Your job is to read raw transcript content and extract structured facts, entities, and decisions, then persist them via the memory.store_extraction MCP tool.
|
|
15
|
+
|
|
16
|
+
### Step 1: Get Undistilled Content
|
|
17
|
+
|
|
18
|
+
Call `memory.undistilled` with `limit: 10` to get transcript content that hasn't been processed yet.
|
|
19
|
+
|
|
20
|
+
If no items are returned, report "No undistilled content found" and stop.
|
|
21
|
+
|
|
22
|
+
### Step 2: Extract Knowledge (per item)
|
|
23
|
+
|
|
24
|
+
For each content item, carefully read the raw_text and extract:
|
|
25
|
+
|
|
26
|
+
**Entities** — Named things mentioned:
|
|
27
|
+
- type: database, framework, language, platform, repo, module, person, service
|
|
28
|
+
- name: Canonical name (e.g., "PostgreSQL" not "postgres")
|
|
29
|
+
- confidence: 0.0-1.0
|
|
30
|
+
|
|
31
|
+
**Facts** — Knowledge learned:
|
|
32
|
+
- subject: Entity name or "repo" for project-level facts
|
|
33
|
+
- predicate: uses_database, uses_framework, convention, decision, auth_method, deployment_platform, depends_on, testing_strategy
|
|
34
|
+
- object: The value
|
|
35
|
+
- confidence: 0.0-1.0
|
|
36
|
+
- quote: Source excerpt (max 200 chars)
|
|
37
|
+
- strength: "stated" (explicitly said) or "inferred" (implied)
|
|
38
|
+
- scope_hint: "project" (this project only) or "global" (all projects)
|
|
39
|
+
|
|
40
|
+
**Decisions** — Choices made:
|
|
41
|
+
- title: Short summary (max 100 chars)
|
|
42
|
+
- summary: Full description
|
|
43
|
+
- status_hint: "accepted", "proposed", or "rejected"
|
|
44
|
+
|
|
45
|
+
### What to Extract
|
|
46
|
+
|
|
47
|
+
- Technology choices ("we use PostgreSQL", "switched to React")
|
|
48
|
+
- Conventions ("always use frozen_string_literal", "test files go in spec/")
|
|
49
|
+
- Architectural decisions ("API uses REST", "auth via JWT")
|
|
50
|
+
- Preferences ("prefer 4-space indent", "use Standard Ruby")
|
|
51
|
+
- Project structure ("migrations in db/migrations/", "commands in commands/")
|
|
52
|
+
|
|
53
|
+
### What to Skip
|
|
54
|
+
|
|
55
|
+
- Debugging steps and transient errors
|
|
56
|
+
- Code output and tool observations
|
|
57
|
+
- File contents that were just being read
|
|
58
|
+
- Ephemeral task details ("fix this test", "run the linter")
|
|
59
|
+
- Information already obvious from the codebase itself
|
|
60
|
+
|
|
61
|
+
### Scope Detection
|
|
62
|
+
|
|
63
|
+
Set scope_hint to "global" when the text contains signals like:
|
|
64
|
+
- "I always...", "in all my projects...", "my preference is..."
|
|
65
|
+
- "everywhere", "across all repos"
|
|
66
|
+
|
|
67
|
+
Default to "project" for everything else.
|
|
68
|
+
|
|
69
|
+
### Step 3: Persist Each Extraction
|
|
70
|
+
|
|
71
|
+
For each content item with extracted knowledge:
|
|
72
|
+
|
|
73
|
+
1. Call `memory.store_extraction` with the entities, facts, and decisions arrays
|
|
74
|
+
2. Call `memory.mark_distilled` with the content_item_id and facts_extracted count
|
|
75
|
+
3. If nothing was extracted, still call `memory.mark_distilled` with facts_extracted: 0
|
|
76
|
+
|
|
77
|
+
### Step 4: Report
|
|
78
|
+
|
|
79
|
+
Return a summary:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
## Distillation Complete
|
|
83
|
+
|
|
84
|
+
- Items processed: N
|
|
85
|
+
- Facts extracted: N
|
|
86
|
+
- Entities found: N
|
|
87
|
+
- Decisions captured: N
|
|
88
|
+
- Items skipped (nothing to extract): N
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Guidelines
|
|
92
|
+
|
|
93
|
+
- Process items one at a time to keep extractions focused
|
|
94
|
+
- Use `compact: true` on `memory.undistilled` for smaller responses
|
|
95
|
+
- Be conservative — only extract facts you're confident about (>0.7)
|
|
96
|
+
- Prefer "stated" strength over "inferred" unless clearly implied
|
|
97
|
+
- Do NOT fabricate facts — only extract what's actually in the text
|
|
98
|
+
- If text is mostly code/tool output with no conversational knowledge, mark as distilled with 0 facts
|