create-ai-memory 0.8.3 → 0.9.1

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/README.md CHANGED
@@ -274,7 +274,7 @@ optional. Set `AI_MEM_ROOT` in `~/.zshrc` first if you do not want the default
274
274
  | `ai-start [project]` | Prepare the session (project note and fresh log) without launching an agent |
275
275
  | `ai-context [project]` | Print the vault context block for the current repo, and arm the git commit guard |
276
276
  | `ai-note <text>` | Append a timestamped note to today's session log while you work |
277
- | `ai-lesson <topic-slug> <text>` | Append a timestamped note to a cross-project `_lessons/<topic-slug>.md` -- decisions, mistakes, solutions worth recalling outside the current project |
277
+ | `ai-lesson <topic-slug> <problem> <solution>` | Append a dated Problem/Solution entry to a cross-project `_lessons/<topic-slug>.md` -- decisions, mistakes, solutions worth recalling outside the current project |
278
278
  | `ai-mem-lint` | Check the vault's links: orphaned session logs, dangling `previous` links, unreferenced project notes |
279
279
  | `ai-mem-search <term> [project]` | Grep across the vault (or one project's logs) for a term, with `file:line:excerpt` |
280
280
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ai-memory",
3
- "version": "0.8.3",
3
+ "version": "0.9.1",
4
4
  "description": "Persistent, agent-agnostic session memory for AI coding CLIs (Claude Code, Codex, Gemini, Cursor, opencode). One Markdown vault, any agent.",
5
5
  "bin": {
6
6
  "create-ai-memory": "bin/create-ai-memory.js"
package/shell/ai-mem.zsh CHANGED
@@ -262,7 +262,7 @@ Use the Obsidian vault as the persistent memory layer.
262
262
  Treat the global profile and standards note as the shared baseline for every run.
263
263
  Keep durable preferences and project facts in the vault, and keep the active session log updated with decisions, blockers, and next steps.
264
264
  For anything not covered above -- a decision from further back, a different project, a health check on the vault's links -- run \`ai-mem-search <term> [project]\` or \`ai-mem-lint\` yourself; both are plain shell commands already on PATH.
265
- When you hit a mistake, decision, or solution worth remembering across projects (not just this one), run \`ai-lesson <topic-slug> <text>\`. State the problem first, then the fix -- e.g. \`ai-lesson rate-limiting "a fixed-window limiter kept losing bursts of legitimate traffic; switched to a token bucket, which absorbs bursts correctly"\`, not just the fix alone. It appends to a cross-project note at _lessons/<topic-slug>.md; ai-mem-search already covers it.
265
+ When you hit a mistake, decision, or solution worth remembering across projects (not just this one), run \`ai-lesson <topic-slug> <problem> <solution>\` -- e.g. \`ai-lesson rate-limiting "a fixed-window limiter kept losing bursts of legitimate traffic" "switched to a token bucket, which absorbs bursts correctly"\`. It appends a dated Problem/Solution entry to a cross-project note at _lessons/<topic-slug>.md; ai-mem-search already covers it.
266
266
  EOF
267
267
  }
268
268
 
@@ -560,15 +560,9 @@ codex-lesson() {
560
560
  # (ADR/postmortem shape, not a full wiki) so ai-mem-search already covers it
561
561
  # for free -- no new search path, no taxonomy to maintain.
562
562
  ai-lesson() {
563
- local topic="${1:-}"
564
- if [[ -z "$topic" ]]; then
565
- echo "Usage: ai-lesson <topic-slug> <text>"
566
- return 1
567
- fi
568
- shift
569
- local text="${*:-}"
570
- if [[ -z "$text" ]]; then
571
- echo "Usage: ai-lesson <topic-slug> <text>"
563
+ local topic="${1:-}" problem="${2:-}" solution="${3:-}"
564
+ if [[ -z "$topic" || -z "$problem" || -z "$solution" ]]; then
565
+ echo "Usage: ai-lesson <topic-slug> <problem> <solution>"
572
566
  return 1
573
567
  fi
574
568
 
@@ -590,13 +584,15 @@ ai-lesson() {
590
584
  mkdir -p "$AI_MEM_ROOT/_lessons"
591
585
  local lesson_template="$AI_MEM_ROOT/_lessons/_lesson_template.md"
592
586
  if [[ -f "$lesson_template" ]]; then
593
- TOPIC="$slug" perl -0pe 's/\{\{topic\}\}/$ENV{TOPIC}/g' "$lesson_template" > "$lesson_file"
587
+ TOPIC="$slug" perl -0pe 's/\{\{topic\}\}/$ENV{TOPIC}/g' "$lesson_template" \
588
+ | awk '/^# /{print; exit} {print}' > "$lesson_file"
594
589
  else
595
590
  printf -- '---\ntype: ai-lesson\ntopic: %s\n---\n\n# %s\n' "$slug" "$slug" > "$lesson_file"
596
591
  fi
597
592
  fi
598
593
 
599
- printf -- '\n- %s [[%s]] %s\n' "$timestamp" "$project_name" "$text" >> "$lesson_file"
594
+ printf -- '\n## %s [[%s]]\n\n### Problem\n%s\n\n### Solution\n%s\n' \
595
+ "$timestamp" "$project_name" "$problem" "$solution" >> "$lesson_file"
600
596
  printf 'Appended to %s\n' "$lesson_file"
601
597
  }
602
598
  # Lints the vault's links: session logs missing a project wikilink, previous
@@ -5,4 +5,10 @@ topic: "{{topic}}"
5
5
 
6
6
  # {{topic}}
7
7
 
8
- _Each entry: state the problem first, then the fix -- not just the fix alone._
8
+ ## [Date] [Project]
9
+
10
+ ### Problem
11
+ [What went wrong]
12
+
13
+ ### Solution
14
+ [What fixed it]