kodelyth-ecc 1.3.0 → 1.4.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/AGENTS.md +1 -1
- package/CHANGELOG.md +35 -0
- package/CLAUDE.md +5 -5
- package/KODELYTH.md +1 -1
- package/README.md +81 -14
- package/VERSION +1 -1
- package/agents/kodelyth-memory.md +87 -0
- package/bin/kodelyth-ecc.js +18 -12
- package/commands/memory.md +62 -0
- package/hooks/hooks.json +26 -0
- package/hooks/memory/capture-stop.js +88 -0
- package/hooks/memory/inject-start.js +60 -0
- package/install.ps1 +20 -1
- package/install.sh +1 -1
- package/package.json +4 -2
- package/rules/common/memory-protocol.md +56 -0
- package/scripts/memory/cli.js +200 -0
- package/scripts/memory/extract.js +176 -0
- package/scripts/memory/inject.js +145 -0
- package/scripts/memory/store.js +300 -0
- package/skills/kodelyth-memory/SKILL.md +136 -0
- package/tests/memory/store.test.js +121 -0
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AGENTS.md
|
|
2
2
|
|
|
3
|
-
This file is read by AI agents (Cascade, Cursor, Codex, etc.) on every session. It tells them how to work in this repo and how to use the
|
|
3
|
+
This file is read by AI agents (Cascade, Cursor, Codex, etc.) on every session. It tells them how to work in this repo and how to use the 59 specialist agents and 188 skills shipped with Kodelyth ECC.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Kodelyth ECC are documented here.
|
|
4
4
|
|
|
5
|
+
## v1.4.0 — Local Self-Learning Memory (May 2026)
|
|
6
|
+
|
|
7
|
+
### Added — Kodelyth Memory
|
|
8
|
+
- **Local self-learning memory store** — captures problems and solutions from past sessions, recalls them when relevant in future sessions
|
|
9
|
+
- **Zero dependencies, zero telemetry** — all memory lives at `~/.kodelyth/memory/` (override with `KODELYTH_MEMORY_DIR`)
|
|
10
|
+
- **BM25 retrieval** — pure JS keyword + tag search, sub-millisecond, no embeddings, no network
|
|
11
|
+
- **Cache-friendly injection** — context block is structured with stable prefix → variable suffix to maximise prompt-cache hits on Anthropic and OpenAI models
|
|
12
|
+
- **Model-agnostic** — works for Claude, GPT, Gemini, Llama, any model. Prompt-cache savings apply where the provider supports it; recall quality applies everywhere
|
|
13
|
+
- **Privacy-first** — never auto-stores. Stop hook extracts candidates → user reviews via `/memory review-pending` → user confirms before storing
|
|
14
|
+
|
|
15
|
+
### New files
|
|
16
|
+
- `agents/kodelyth-memory.md` — agent persona and protocols
|
|
17
|
+
- `skills/kodelyth-memory/SKILL.md` — when and how to use the memory system
|
|
18
|
+
- `commands/memory.md` — `/memory` slash command
|
|
19
|
+
- `rules/common/memory-protocol.md` — mid-session recall + capture rules
|
|
20
|
+
- `scripts/memory/store.js` — BM25 storage + retrieval
|
|
21
|
+
- `scripts/memory/inject.js` — cache-friendly context block builder
|
|
22
|
+
- `scripts/memory/extract.js` — heuristic learning extractor for session JSONL
|
|
23
|
+
- `scripts/memory/cli.js` — CLI entry point
|
|
24
|
+
- `hooks/memory/inject-start.js` — SessionStart hook
|
|
25
|
+
- `hooks/memory/capture-stop.js` — Stop hook
|
|
26
|
+
- `tests/memory/store.test.js` — 12 new tests (38 total passing)
|
|
27
|
+
|
|
28
|
+
### Honest disclosure
|
|
29
|
+
- "Self-learning" means **better context retrieval over time**, not model fine-tuning. The LLM is unchanged. We give it smarter context.
|
|
30
|
+
- Cloud-AI platforms (Windsurf, Antigravity, partial Cursor) store sessions server-side. Auto-extract from past sessions doesn't work there. Manual `/memory remember` still does.
|
|
31
|
+
|
|
32
|
+
### Counts
|
|
33
|
+
- Agents: 58 → **59** (+kodelyth-memory)
|
|
34
|
+
- Skills: 187 → **188** (+kodelyth-memory)
|
|
35
|
+
- Commands: 79 (+`/memory`, total stays 79 — replaces no slash)
|
|
36
|
+
- Rules: 15 → **16** (+memory-protocol)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
5
40
|
## v1.3.0 — God-Tier Intent Routing + 5 New Agents (May 2026)
|
|
6
41
|
|
|
7
42
|
### Removed
|
package/CLAUDE.md
CHANGED
|
@@ -6,11 +6,11 @@ Guidance for Claude Code when working with this repository.
|
|
|
6
6
|
|
|
7
7
|
**Kodelyth ECC** — a production-grade AI coding toolkit:
|
|
8
8
|
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
9
|
+
- **59 specialist agents** — debug-detective, code-reviewer, security-reviewer, kodelyth-memory, etc.
|
|
10
|
+
- **188 skills** — domain knowledge, patterns, testing, security, intent routing, local memory
|
|
11
|
+
- **80 commands** — slash workflows (`/tdd`, `/plan`, `/code-review`, `/memory`, ...)
|
|
12
|
+
- **18+ hooks** — automated quality gates, session memory, memory inject + capture
|
|
13
|
+
- **16 rules** — always-on coding standards + intent routing + memory protocol
|
|
14
14
|
|
|
15
15
|
Works with Claude Code, Windsurf, Cursor, Codex CLI, Antigravity, and OpenCode.
|
|
16
16
|
|
package/KODELYTH.md
CHANGED
|
@@ -20,7 +20,7 @@ Now the user just describes their problem in plain words and the AI:
|
|
|
20
20
|
2. Behaves as that agent
|
|
21
21
|
3. Teaches the user the explicit form (`Tip: type "use <agent>"`)
|
|
22
22
|
|
|
23
|
-
No more memorizing
|
|
23
|
+
No more memorizing 59 agent names.
|
|
24
24
|
|
|
25
25
|
### Added: 5 New Specialist Agents
|
|
26
26
|
|
package/README.md
CHANGED
|
@@ -8,17 +8,18 @@
|
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|

|
|
11
|
-

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+

|
|
14
15
|
|
|
15
16
|
</div>
|
|
16
17
|
|
|
17
|
-
**Kodelyth ECC** is a production-grade AI coding toolkit — **
|
|
18
|
+
**Kodelyth ECC** is a production-grade AI coding toolkit — **59 specialist agents, 188 skills, 80 commands**, a god-tier **intent-routing system**, and **local self-learning memory** that gets smarter at helping *you* every session.
|
|
18
19
|
|
|
19
20
|
Works with **Claude Code**, **Windsurf**, **Cursor**, **Codex CLI**, **Google Antigravity**, and **OpenCode**.
|
|
20
21
|
|
|
21
|
-
> No dashboard. No telemetry. No cloud. Just rules, agents, and
|
|
22
|
+
> No dashboard. No telemetry. No cloud. Just rules, agents, skills, and your own private memory store — all on your disk.
|
|
22
23
|
|
|
23
24
|
---
|
|
24
25
|
|
|
@@ -151,25 +152,83 @@ See `skills/agent-handoff/SKILL.md` for the full handoff protocol and standard c
|
|
|
151
152
|
|
|
152
153
|
---
|
|
153
154
|
|
|
155
|
+
## Kodelyth Memory — Local Self-Learning (new in v1.4.0)
|
|
156
|
+
|
|
157
|
+
The first time you solve a hard problem, ECC remembers what worked. The next time you hit something similar, your AI surfaces the past solution before you ask.
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
Session 1 (March):
|
|
161
|
+
You: "Stripe webhook signatures are failing in production"
|
|
162
|
+
AI: [helps you debug, you discover raw body parser is required]
|
|
163
|
+
You: "Perfect, that worked, thanks"
|
|
164
|
+
→ ECC's Stop hook queues the lesson for review.
|
|
165
|
+
→ You confirm with /memory review-pending → stored locally.
|
|
166
|
+
|
|
167
|
+
Session 2 (August, new project):
|
|
168
|
+
You: "I need to add Stripe webhooks to checkout"
|
|
169
|
+
AI: I checked your memory — you solved this exact problem in March.
|
|
170
|
+
Raw body parser before signature validation, test with stripe-cli
|
|
171
|
+
not curl. Want me to apply the same pattern?
|
|
172
|
+
You: "Yes, do it"
|
|
173
|
+
→ 30 minutes of past debugging saved in 3 seconds.
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### How it works
|
|
177
|
+
|
|
178
|
+
| Layer | Mechanism |
|
|
179
|
+
|---|---|
|
|
180
|
+
| **Capture** | A Stop hook scans your session JSONL, extracts (problem, approach, gotchas, tags). Queues for your review — never auto-stores. |
|
|
181
|
+
| **Storage** | `~/.kodelyth/memory/memories.jsonl` — append-only log on your disk only. Override with `KODELYTH_MEMORY_DIR`. |
|
|
182
|
+
| **Retrieval** | BM25 keyword + tag search. Pure JS, sub-millisecond, no embeddings, no network. |
|
|
183
|
+
| **Injection** | A SessionStart hook builds a cache-friendly context block: stable prefix (your patterns + recent project memories) → variable suffix (relevant to current task). |
|
|
184
|
+
| **Cost win** | The stable prefix sits in the prompt cache. Anthropic charges 10% on cached tokens (5-min TTL); OpenAI auto-caches prefixes ≥1024 tokens. Long sessions become dramatically cheaper. |
|
|
185
|
+
|
|
186
|
+
### Privacy
|
|
187
|
+
|
|
188
|
+
Every byte stays on your machine. Verify any time with `ls -la ~/.kodelyth/memory/`. Sync across machines is opt-in (Dropbox/iCloud/git on that folder).
|
|
189
|
+
|
|
190
|
+
### Slash command
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
/memory # Stats and recent memories
|
|
194
|
+
/memory recall <query> # BM25 search
|
|
195
|
+
/memory remember "<title>" # Capture (interactive — confirms before storing)
|
|
196
|
+
/memory review-pending # Review Stop-hook candidates
|
|
197
|
+
/memory forget <id> # Soft-delete a memory
|
|
198
|
+
/memory inject [--query <text>] # Print what your AI sees about you
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Honest limits
|
|
202
|
+
|
|
203
|
+
- It is **not** model fine-tuning. The LLM never changes. We give it smarter context.
|
|
204
|
+
- Cache savings apply to Anthropic and OpenAI. Other models (Gemini, Llama, Mistral) get the recall quality without the discount.
|
|
205
|
+
- Cloud-AI platforms (Windsurf, Antigravity, partial Cursor) store sessions server-side. Auto-extract from past sessions doesn't work there. Manual `/memory remember` still does.
|
|
206
|
+
|
|
207
|
+
See `skills/kodelyth-memory/SKILL.md` for the full design + CLI reference.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
154
211
|
## What's Inside
|
|
155
212
|
|
|
156
213
|
| Component | Count | Description |
|
|
157
214
|
|---|---|---|
|
|
158
|
-
| Agents | **
|
|
159
|
-
| Skills | **
|
|
160
|
-
| Commands | **
|
|
161
|
-
| Hooks | **
|
|
162
|
-
| Rules | **
|
|
215
|
+
| Agents | **59** | Specialist subagents — reviewers, planners, debuggers, architects, doctors, memory curator |
|
|
216
|
+
| Skills | **188** | Domain knowledge — patterns, testing, security, DevOps, intent routing, memory |
|
|
217
|
+
| Commands | **80** | Slash command workflows (`/tdd`, `/plan`, `/memory`, etc.) |
|
|
218
|
+
| Hooks | **18+** | Quality gates, secret scanning, branch checks, memory inject + capture |
|
|
219
|
+
| Rules | **16** | Always-on coding standards + intent routing + memory protocol |
|
|
220
|
+
| Memory | **local** | BM25-indexed personal memory at `~/.kodelyth/memory/` (zero deps) |
|
|
163
221
|
|
|
164
222
|
---
|
|
165
223
|
|
|
166
224
|
## Agent Arsenal
|
|
167
225
|
|
|
168
|
-
### Kodelyth Exclusives — The
|
|
226
|
+
### Kodelyth Exclusives — The 13 Agents That Make ECC
|
|
169
227
|
|
|
170
228
|
| Agent | One-line job |
|
|
171
229
|
|---|---|
|
|
172
230
|
| `kodelyth-advisor` | Master guide — picks the right tool when you don't know where to start |
|
|
231
|
+
| `kodelyth-memory` | Curates your local memory — recalls past solutions, captures new ones |
|
|
173
232
|
| `pair-programmer` | The engineer who sits next to you **before** you write the code |
|
|
174
233
|
| `debug-detective` | Never guesses — traces every bug to root cause |
|
|
175
234
|
| `silent-failure-hunter` | Finds bugs that don't throw errors |
|
|
@@ -282,8 +341,8 @@ The intent router will route you to the right one. The AI announces who's taking
|
|
|
282
341
|
|
|
283
342
|
| Source | Destination | What it does |
|
|
284
343
|
|---|---|---|
|
|
285
|
-
| `agents/` | `~/.claude/agents/` | All
|
|
286
|
-
| `skills/` | `~/.claude/skills/` | All
|
|
344
|
+
| `agents/` | `~/.claude/agents/` | All 59 subagents available globally |
|
|
345
|
+
| `skills/` | `~/.claude/skills/` | All 188 skills loadable via commands |
|
|
287
346
|
| `hooks/hooks.json` | `~/.claude/hooks/` | Automated quality gates |
|
|
288
347
|
| `rules/` | `~/.claude/rules/` | Always-on standards + intent routing |
|
|
289
348
|
| `commands/` | `~/.claude/commands/` | Slash commands (`/tdd`, `/plan`, etc.) |
|
|
@@ -394,7 +453,15 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for templates, checklists, and the full K
|
|
|
394
453
|
|
|
395
454
|
## Changelog
|
|
396
455
|
|
|
397
|
-
See [CHANGELOG.md](CHANGELOG.md). v1.
|
|
456
|
+
See [CHANGELOG.md](CHANGELOG.md). v1.4.0 highlights:
|
|
457
|
+
|
|
458
|
+
- **Added:** `kodelyth-memory` — local self-learning memory (BM25, zero deps, cache-friendly)
|
|
459
|
+
- **Added:** SessionStart hook injects relevant past memories; Stop hook queues candidates for review
|
|
460
|
+
- **Added:** `/memory` slash command + `kodelyth-memory` agent + `memory-protocol` rule
|
|
461
|
+
- **Added:** 12 new tests (38 total passing)
|
|
462
|
+
- **Honest disclosure:** "Self-learning" means smarter context retrieval, not model fine-tuning
|
|
463
|
+
|
|
464
|
+
v1.3.0 highlights:
|
|
398
465
|
|
|
399
466
|
- **Removed:** Lens dashboard (was inaccurate across cloud-AI platforms)
|
|
400
467
|
- **Added:** God-tier `agent-intent-routing` rule — 10 priority tiers, 50+ patterns
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.4.0
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kodelyth-memory
|
|
3
|
+
description: Manages the local Kodelyth Memory store — captures patterns and solutions from past sessions, recalls them when relevant, and shapes context for prompt-cache savings. Use PROACTIVELY at session start to recall relevant memories, and at session end to capture what worked. Model-agnostic.
|
|
4
|
+
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Kodelyth Memory
|
|
9
|
+
|
|
10
|
+
You are **Kodelyth Memory** — the curator of the user's local AI memory. Everything you store stays on the user's machine. Nothing leaves.
|
|
11
|
+
|
|
12
|
+
## Your job
|
|
13
|
+
|
|
14
|
+
You do four things:
|
|
15
|
+
|
|
16
|
+
1. **Recall** — at the start of work on a new task, search past memories for relevant patterns and surface them to the user before they ask.
|
|
17
|
+
2. **Capture** — when the user solves a real problem, extract the lesson and store it.
|
|
18
|
+
3. **Curate** — keep memory honest. Forget stale entries, dedupe duplicates, escalate contradictions to the user.
|
|
19
|
+
4. **Shape context** — structure the injected memory block so it sits in the cacheable prefix of the model's context, maximising prompt-cache hits.
|
|
20
|
+
|
|
21
|
+
## Recall protocol
|
|
22
|
+
|
|
23
|
+
When invoked at session start (or when the user begins describing a new task):
|
|
24
|
+
|
|
25
|
+
1. Run `node scripts/memory/cli.js inject --query "<task summary>"` to get the relevant memory block
|
|
26
|
+
2. If `relevantCount > 0`, surface the memories naturally:
|
|
27
|
+
> "I see you solved a similar problem before — `<problem>` — using `<approach>`. Want me to apply the same pattern here, or is this case different?"
|
|
28
|
+
3. If no matches, stay quiet. Don't fabricate "you usually..." patterns from nothing.
|
|
29
|
+
4. Never recall a memory more than once per session — the user has already seen it.
|
|
30
|
+
|
|
31
|
+
## Capture protocol
|
|
32
|
+
|
|
33
|
+
When the user signals success (`"that worked"`, `"perfect"`, `"thanks"`, `"fixed it"`), or after a long iteration converges on a solution:
|
|
34
|
+
|
|
35
|
+
1. Identify:
|
|
36
|
+
- **Problem** (one sentence — what the user originally asked)
|
|
37
|
+
- **Approach** (1-3 sentences — what actually worked, not what you tried)
|
|
38
|
+
- **Gotchas** (specific traps, max 2)
|
|
39
|
+
- **Tags** (auto-extract from the conversation: `api-integration`, `auth`, `database`, etc.)
|
|
40
|
+
- **Files touched**
|
|
41
|
+
- **Language**
|
|
42
|
+
2. Show the proposed memory to the user **before storing** — silent capture is how memory systems become noise.
|
|
43
|
+
3. On confirmation, run:
|
|
44
|
+
```bash
|
|
45
|
+
node scripts/memory/cli.js remember "<problem>" --approach "<approach>" --tags "<tags>" --language "<lang>"
|
|
46
|
+
```
|
|
47
|
+
4. Confirm: "Stored. I'll bring this up next time you hit something similar."
|
|
48
|
+
|
|
49
|
+
## Curate protocol
|
|
50
|
+
|
|
51
|
+
Run `node scripts/memory/cli.js stats` weekly. Surface to user when:
|
|
52
|
+
- Memory count exceeds 500 (offer to consolidate)
|
|
53
|
+
- A tag appears in 20+ memories (offer to extract a pattern note)
|
|
54
|
+
- Two memories contradict each other (ask which is current)
|
|
55
|
+
|
|
56
|
+
## Cache-shaping rules
|
|
57
|
+
|
|
58
|
+
The injected block from `cli.js inject` is structured into:
|
|
59
|
+
- **Stable prefix** — patterns + recent project memories (identical across calls in same project)
|
|
60
|
+
- **Variable suffix** — relevant-to-this-task memories (changes per query)
|
|
61
|
+
|
|
62
|
+
Anthropic's prompt cache (5-min TTL, 10% cost on hits) and OpenAI's automatic caching both reward stable prefixes. Do not modify the stable section per session — this defeats the cache. If you need to add session-specific notes, append them after the memory block.
|
|
63
|
+
|
|
64
|
+
## What you must never do
|
|
65
|
+
|
|
66
|
+
- Capture without explicit user confirmation
|
|
67
|
+
- Send memory data to any network endpoint (it's local-only by design)
|
|
68
|
+
- Inject memories that contradict the current task without flagging the contradiction
|
|
69
|
+
- Recall the same memory twice in one session
|
|
70
|
+
- Auto-store every interaction as a memory (signal-to-noise dies)
|
|
71
|
+
|
|
72
|
+
## Honest limits
|
|
73
|
+
|
|
74
|
+
- Retrieval is **BM25 keyword + tag matching**, not semantic. It finds memories that share vocabulary with the query. It will miss semantic matches with no shared words.
|
|
75
|
+
- Memory is **per-machine**. Sync across machines requires the user opting in (Dropbox/iCloud/git on `~/.kodelyth/memory/`).
|
|
76
|
+
- On cloud-AI platforms (Windsurf, Antigravity), session data is server-side. Memory still works for capture (manual `/memory remember`) but auto-extract from past sessions is unavailable there.
|
|
77
|
+
|
|
78
|
+
## Example interaction
|
|
79
|
+
|
|
80
|
+
User: "I need to add Stripe webhooks to this project"
|
|
81
|
+
|
|
82
|
+
You (after running inject):
|
|
83
|
+
> I checked your memory — you set up Stripe webhooks 4 months ago in `payments-api`. Key things you discovered then:
|
|
84
|
+
> - Express body parser must be `raw`, not `json`, before signature validation
|
|
85
|
+
> - Test with `stripe listen --forward-to`, not curl — curl can't sign requests
|
|
86
|
+
>
|
|
87
|
+
> Want me to apply the same pattern, or is this project's setup different?
|
package/bin/kodelyth-ecc.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Kodelyth ECC — npx entry point
|
|
3
|
-
// Usage:
|
|
4
|
-
// npx
|
|
5
|
-
// npx
|
|
6
|
-
// npx
|
|
7
|
-
// npx
|
|
8
|
-
// npx
|
|
9
|
-
// npx
|
|
10
|
-
// npx
|
|
3
|
+
// Usage (from npm — recommended):
|
|
4
|
+
// npx kodelyth-ecc # Claude Code (default)
|
|
5
|
+
// npx kodelyth-ecc --target windsurf-project # Windsurf (project)
|
|
6
|
+
// npx kodelyth-ecc --target windsurf-home # Windsurf (global)
|
|
7
|
+
// npx kodelyth-ecc --target antigravity # Google Antigravity
|
|
8
|
+
// npx kodelyth-ecc --target cursor-project # Cursor IDE
|
|
9
|
+
// npx kodelyth-ecc --target codex-home # Codex CLI
|
|
10
|
+
// npx kodelyth-ecc --target opencode # OpenCode
|
|
11
|
+
//
|
|
12
|
+
// Usage (from GitHub — latest commit):
|
|
13
|
+
// npx github:sifxprime/kodelyth-ecc
|
|
11
14
|
|
|
12
15
|
'use strict';
|
|
13
16
|
|
|
@@ -26,7 +29,7 @@ if (args.includes('--help') || args.includes('-h')) {
|
|
|
26
29
|
Kodelyth ECC — AI Coding Toolkit installer
|
|
27
30
|
|
|
28
31
|
Usage:
|
|
29
|
-
npx
|
|
32
|
+
npx kodelyth-ecc [--target TARGET] [--profile PROFILE] [languages...]
|
|
30
33
|
|
|
31
34
|
Targets:
|
|
32
35
|
claude-home Claude Code — global install (default)
|
|
@@ -38,10 +41,13 @@ if (args.includes('--help') || args.includes('-h')) {
|
|
|
38
41
|
opencode OpenCode — project install (.opencode/)
|
|
39
42
|
|
|
40
43
|
Examples:
|
|
44
|
+
npx kodelyth-ecc
|
|
45
|
+
npx kodelyth-ecc --target windsurf-project
|
|
46
|
+
npx kodelyth-ecc --target antigravity --profile nextjs
|
|
47
|
+
npx kodelyth-ecc --target claude-home typescript python
|
|
48
|
+
|
|
49
|
+
# Always-latest unreleased commit:
|
|
41
50
|
npx github:sifxprime/kodelyth-ecc
|
|
42
|
-
npx github:sifxprime/kodelyth-ecc --target windsurf-project
|
|
43
|
-
npx github:sifxprime/kodelyth-ecc --target antigravity --profile nextjs
|
|
44
|
-
npx github:sifxprime/kodelyth-ecc --target claude-home typescript python
|
|
45
51
|
|
|
46
52
|
Flags:
|
|
47
53
|
--help, -h Show this help
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Manage local Kodelyth Memory — recall, capture, review, and curate what your AI knows about you
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /memory
|
|
6
|
+
|
|
7
|
+
Local self-learning memory. Everything stays on this machine.
|
|
8
|
+
|
|
9
|
+
## Subcommands
|
|
10
|
+
|
|
11
|
+
### `/memory`
|
|
12
|
+
Show storage stats and the 5 most recent memories for this project.
|
|
13
|
+
|
|
14
|
+
### `/memory recall <query>`
|
|
15
|
+
Search memory for `<query>` using BM25 keyword + tag retrieval. Surfaces the top 5 relevant matches.
|
|
16
|
+
|
|
17
|
+
Example:
|
|
18
|
+
```
|
|
19
|
+
/memory recall stripe webhook signature
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### `/memory remember "<title>"`
|
|
23
|
+
Capture a new memory. The agent will:
|
|
24
|
+
1. Ask for the approach (what worked) and any gotchas
|
|
25
|
+
2. Auto-extract tags and language from the conversation
|
|
26
|
+
3. Show you the proposed memory
|
|
27
|
+
4. Store only after you confirm
|
|
28
|
+
|
|
29
|
+
### `/memory review-pending`
|
|
30
|
+
Show the queue of candidate memories extracted automatically by the Stop hook from your last session. Confirm each one to store, or skip.
|
|
31
|
+
|
|
32
|
+
### `/memory forget <id>`
|
|
33
|
+
Mark a memory deleted. It's a soft-delete (the row stays in the log marked `deleted: true`) so you can recover it by editing `~/.kodelyth/memory/memories.jsonl`.
|
|
34
|
+
|
|
35
|
+
### `/memory list`
|
|
36
|
+
Show all stored memories — id, date, language, problem, tags.
|
|
37
|
+
|
|
38
|
+
### `/memory rebuild`
|
|
39
|
+
Rebuild the BM25 index from `memories.jsonl`. Run this if search results look stale or if you've manually edited the log.
|
|
40
|
+
|
|
41
|
+
### `/memory inject [--query <text>]`
|
|
42
|
+
Print the cache-friendly context block that the SessionStart hook would inject. Useful for debugging what your AI sees about you.
|
|
43
|
+
|
|
44
|
+
## Implementation
|
|
45
|
+
|
|
46
|
+
This command delegates to:
|
|
47
|
+
```bash
|
|
48
|
+
node ~/.claude/scripts/memory/cli.js <subcommand> [args]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or invoke the agent directly:
|
|
52
|
+
```
|
|
53
|
+
use kodelyth-memory
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Storage location
|
|
57
|
+
|
|
58
|
+
`~/.kodelyth/memory/` (override with `KODELYTH_MEMORY_DIR` env var)
|
|
59
|
+
|
|
60
|
+
- `memories.jsonl` — the source of truth
|
|
61
|
+
- `index.json` — BM25 inverted index
|
|
62
|
+
- `pending-review.jsonl` — Stop-hook candidates awaiting confirmation
|
package/hooks/hooks.json
CHANGED
|
@@ -163,6 +163,19 @@
|
|
|
163
163
|
],
|
|
164
164
|
"description": "Load previous context and detect package manager on new session",
|
|
165
165
|
"id": "session:start"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"matcher": "*",
|
|
169
|
+
"hooks": [
|
|
170
|
+
{
|
|
171
|
+
"type": "command",
|
|
172
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/memory/inject-start.js\"",
|
|
173
|
+
"async": true,
|
|
174
|
+
"timeout": 5
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"description": "Kodelyth Memory: inject relevant past memories as cache-friendly context",
|
|
178
|
+
"id": "kodelyth:session:start:memory-inject"
|
|
166
179
|
}
|
|
167
180
|
],
|
|
168
181
|
"PostToolUse": [
|
|
@@ -325,6 +338,19 @@
|
|
|
325
338
|
"description": "Kodelyth: Suggest the next logical agent or command after each response based on what just happened",
|
|
326
339
|
"id": "kodelyth:stop:smart-suggest"
|
|
327
340
|
},
|
|
341
|
+
{
|
|
342
|
+
"matcher": "*",
|
|
343
|
+
"hooks": [
|
|
344
|
+
{
|
|
345
|
+
"type": "command",
|
|
346
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/memory/capture-stop.js\"",
|
|
347
|
+
"async": true,
|
|
348
|
+
"timeout": 10
|
|
349
|
+
}
|
|
350
|
+
],
|
|
351
|
+
"description": "Kodelyth Memory: extract memory candidates from session and queue for review (never auto-stores)",
|
|
352
|
+
"id": "kodelyth:stop:memory-capture"
|
|
353
|
+
},
|
|
328
354
|
{
|
|
329
355
|
"matcher": "*",
|
|
330
356
|
"hooks": [
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Kodelyth ECC — Memory Capture Hook (Stop)
|
|
4
|
+
//
|
|
5
|
+
// Runs at the end of a Claude Code session. Locates the session JSONL,
|
|
6
|
+
// extracts memory candidates, writes them to a review queue at:
|
|
7
|
+
// ~/.kodelyth/memory/pending-review.jsonl
|
|
8
|
+
//
|
|
9
|
+
// Candidates are NEVER auto-stored. The user reviews via:
|
|
10
|
+
// /memory review-pending
|
|
11
|
+
// or:
|
|
12
|
+
// node scripts/memory/cli.js list-pending
|
|
13
|
+
// =============================================================================
|
|
14
|
+
|
|
15
|
+
'use strict';
|
|
16
|
+
|
|
17
|
+
const fs = require('fs');
|
|
18
|
+
const os = require('os');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
|
|
21
|
+
let payload = '';
|
|
22
|
+
process.stdin.setEncoding('utf8');
|
|
23
|
+
process.stdin.on('data', chunk => { payload += chunk; });
|
|
24
|
+
process.stdin.on('end', main);
|
|
25
|
+
setTimeout(() => { if (!process.stdin.readableEnded) main(); }, 100);
|
|
26
|
+
|
|
27
|
+
function main() {
|
|
28
|
+
try {
|
|
29
|
+
const data = payload ? JSON.parse(payload) : {};
|
|
30
|
+
const sessionJsonl = data.session_path
|
|
31
|
+
|| data.transcript_path
|
|
32
|
+
|| findLatestClaudeSession(data.cwd || process.cwd());
|
|
33
|
+
|
|
34
|
+
if (!sessionJsonl || !fs.existsSync(sessionJsonl)) {
|
|
35
|
+
process.exit(0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const { extractCandidates } = require(path.join(__dirname, '..', '..', 'scripts', 'memory', 'extract'));
|
|
39
|
+
const candidates = extractCandidates(sessionJsonl);
|
|
40
|
+
if (candidates.length === 0) {
|
|
41
|
+
process.exit(0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const dir = process.env.KODELYTH_MEMORY_DIR
|
|
45
|
+
|| path.join(os.homedir(), '.kodelyth', 'memory');
|
|
46
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
47
|
+
|
|
48
|
+
const queueFile = path.join(dir, 'pending-review.jsonl');
|
|
49
|
+
const sessionId = data.session_id || path.basename(sessionJsonl, '.jsonl');
|
|
50
|
+
|
|
51
|
+
const lines = candidates.map(c => JSON.stringify({
|
|
52
|
+
...c,
|
|
53
|
+
session_id: sessionId,
|
|
54
|
+
project_path: data.cwd || process.cwd(),
|
|
55
|
+
queued_at: new Date().toISOString(),
|
|
56
|
+
}));
|
|
57
|
+
|
|
58
|
+
fs.appendFileSync(queueFile, lines.join('\n') + '\n');
|
|
59
|
+
|
|
60
|
+
// Emit advisory message so user sees something happened
|
|
61
|
+
process.stdout.write(JSON.stringify({
|
|
62
|
+
message: `Kodelyth Memory: ${candidates.length} candidate(s) queued for review. Run "/memory review-pending" to confirm.`,
|
|
63
|
+
}));
|
|
64
|
+
process.exit(0);
|
|
65
|
+
} catch (err) {
|
|
66
|
+
process.stderr.write(`kodelyth-memory capture: ${err.message}\n`);
|
|
67
|
+
process.exit(0);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function findLatestClaudeSession(cwd) {
|
|
72
|
+
try {
|
|
73
|
+
const projectsDir = path.join(os.homedir(), '.claude', 'projects');
|
|
74
|
+
if (!fs.existsSync(projectsDir)) return null;
|
|
75
|
+
// Project dirs are encoded paths
|
|
76
|
+
const encoded = '-' + cwd.replace(/\//g, '-');
|
|
77
|
+
const matches = fs.readdirSync(projectsDir).filter(d => d.endsWith(encoded.slice(-30)));
|
|
78
|
+
if (matches.length === 0) return null;
|
|
79
|
+
const projectDir = path.join(projectsDir, matches[0]);
|
|
80
|
+
const sessions = fs.readdirSync(projectDir)
|
|
81
|
+
.filter(f => f.endsWith('.jsonl'))
|
|
82
|
+
.map(f => ({ f, mtime: fs.statSync(path.join(projectDir, f)).mtimeMs }))
|
|
83
|
+
.sort((a, b) => b.mtime - a.mtime);
|
|
84
|
+
return sessions[0] ? path.join(projectDir, sessions[0].f) : null;
|
|
85
|
+
} catch {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Kodelyth ECC — Memory Inject Hook (SessionStart)
|
|
4
|
+
//
|
|
5
|
+
// Runs at the start of every Claude Code session. Reads the project root
|
|
6
|
+
// from the hook payload (or cwd fallback), builds the memory context block,
|
|
7
|
+
// and emits it as additional system context.
|
|
8
|
+
//
|
|
9
|
+
// Hook contract: prints JSON to stdout that Claude Code will merge into
|
|
10
|
+
// the session's system context. Exits 0 even on error — never block a
|
|
11
|
+
// session because memory is unavailable.
|
|
12
|
+
// =============================================================================
|
|
13
|
+
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const path = require('path');
|
|
17
|
+
|
|
18
|
+
let payload = {};
|
|
19
|
+
try {
|
|
20
|
+
let raw = '';
|
|
21
|
+
process.stdin.setEncoding('utf8');
|
|
22
|
+
process.stdin.on('data', chunk => { raw += chunk; });
|
|
23
|
+
process.stdin.on('end', () => {
|
|
24
|
+
try { payload = raw ? JSON.parse(raw) : {}; } catch { payload = {}; }
|
|
25
|
+
main();
|
|
26
|
+
});
|
|
27
|
+
// Fallback: if stdin closes immediately (no piped input), proceed
|
|
28
|
+
setTimeout(() => { if (!process.stdin.readableEnded) main(); }, 100);
|
|
29
|
+
} catch {
|
|
30
|
+
main();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function main() {
|
|
34
|
+
try {
|
|
35
|
+
const projectRoot = payload.cwd || payload.project_root || process.cwd();
|
|
36
|
+
const { buildContextBlock } = require(path.join(__dirname, '..', '..', 'scripts', 'memory', 'inject'));
|
|
37
|
+
|
|
38
|
+
const block = buildContextBlock({ projectRoot });
|
|
39
|
+
if (!block || !block.text) {
|
|
40
|
+
process.exit(0);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Emit as additional context — non-blocking, advisory
|
|
44
|
+
const output = {
|
|
45
|
+
additionalContext: block.text,
|
|
46
|
+
meta: {
|
|
47
|
+
source: 'kodelyth-memory',
|
|
48
|
+
memoryCount: block.memoryCount,
|
|
49
|
+
projectMemoryCount: block.projectMemoryCount,
|
|
50
|
+
patternCount: block.patternCount,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
process.stdout.write(JSON.stringify(output));
|
|
54
|
+
process.exit(0);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
// Never crash a session because memory hook failed — log to stderr and continue
|
|
57
|
+
process.stderr.write(`kodelyth-memory inject: ${err.message}\n`);
|
|
58
|
+
process.exit(0);
|
|
59
|
+
}
|
|
60
|
+
}
|
package/install.ps1
CHANGED
|
@@ -21,7 +21,7 @@ $ErrorActionPreference = "Stop"
|
|
|
21
21
|
# ── Banner ────────────────────────────────────────────────────────────────────
|
|
22
22
|
Write-Host ""
|
|
23
23
|
Write-Host " Kodelyth ECC — Production-grade AI coding agent toolkit" -ForegroundColor Cyan
|
|
24
|
-
Write-Host "
|
|
24
|
+
Write-Host " 59 agents · 188 skills · 80 commands · 18+ hooks · intent routing · local memory" -ForegroundColor Gray
|
|
25
25
|
Write-Host ""
|
|
26
26
|
|
|
27
27
|
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
@@ -219,11 +219,30 @@ switch ($Target) {
|
|
|
219
219
|
Write-Host " 2. Type: /kodelyth-quickstart"
|
|
220
220
|
Write-Host " 3. Or: use kodelyth-advisor"
|
|
221
221
|
}
|
|
222
|
+
{ $_ -in "windsurf-project","windsurf-home" } {
|
|
223
|
+
Write-Host " 1. Open the project in Windsurf"
|
|
224
|
+
Write-Host " 2. Cascade auto-loads .windsurfrules on every session"
|
|
225
|
+
Write-Host " 3. Try: use kodelyth-advisor"
|
|
226
|
+
}
|
|
227
|
+
"cursor-project" {
|
|
228
|
+
Write-Host " 1. Open the project in Cursor"
|
|
229
|
+
Write-Host " 2. Rules and skills are now active in chat"
|
|
230
|
+
Write-Host " 3. Try: use kodelyth-advisor"
|
|
231
|
+
}
|
|
232
|
+
"codex-home" {
|
|
233
|
+
Write-Host " 1. Restart Codex CLI (codex)"
|
|
234
|
+
Write-Host " 2. All 59 agents and 188 skills are now available"
|
|
235
|
+
Write-Host " 3. Try: use kodelyth-advisor"
|
|
236
|
+
}
|
|
222
237
|
"antigravity" {
|
|
223
238
|
Write-Host " 1. Open your project in Antigravity"
|
|
224
239
|
Write-Host " 2. Agents are available as Skills"
|
|
225
240
|
Write-Host " 3. Commands are available as Workflows"
|
|
226
241
|
}
|
|
242
|
+
"opencode" {
|
|
243
|
+
Write-Host " 1. Open the project in OpenCode"
|
|
244
|
+
Write-Host " 2. Rules in .opencode/rules/ are now loaded"
|
|
245
|
+
}
|
|
227
246
|
default {
|
|
228
247
|
Write-Host " 1. Restart your AI coding agent"
|
|
229
248
|
Write-Host " 2. Agents, skills, and rules are now active"
|