create-ai-memory 0.8.0 → 0.8.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
@@ -358,6 +358,9 @@ $AI_MEM_ROOT/
358
358
  _session_template.md scaffold for new session logs
359
359
  <repo>/
360
360
  <repo>-<timestamp>.md one file per session
361
+ _lessons/
362
+ _lesson_template.md scaffold for new lesson topics
363
+ <topic-slug>.md cross-project decisions/mistakes, filed by ai-lesson
361
364
  ```
362
365
 
363
366
  Notes are created from templates on first use and never overwritten. Edit
package/install.sh CHANGED
@@ -78,7 +78,7 @@ ask AI_MEM_AGENTS "Which agents should get <agent>-start launchers?" "$AI_MEM_AG
78
78
  # --- scaffold the vault ------------------------------------------------------
79
79
  echo
80
80
  echo " scaffolding vault at: $AI_MEM_ROOT"
81
- mkdir -p "$AI_MEM_ROOT/_projects" "$AI_MEM_ROOT/_session_logs"
81
+ mkdir -p "$AI_MEM_ROOT/_projects" "$AI_MEM_ROOT/_session_logs" "$AI_MEM_ROOT/_lessons"
82
82
 
83
83
  copy_if_absent() { # never overwrite the user's real notes on a re-run
84
84
  local src="$1" dst="$2"
@@ -88,6 +88,7 @@ copy_if_absent "$HERE/vault-template/_Global_Profile.md" "$AI_ME
88
88
  copy_if_absent "$HERE/vault-template/_Standards.md" "$AI_MEM_ROOT/_Standards.md"
89
89
  copy_if_absent "$HERE/vault-template/_projects/_project_template.md" "$AI_MEM_ROOT/_projects/_project_template.md"
90
90
  copy_if_absent "$HERE/vault-template/_session_logs/_session_template.md" "$AI_MEM_ROOT/_session_logs/_session_template.md"
91
+ copy_if_absent "$HERE/vault-template/_lessons/_lesson_template.md" "$AI_MEM_ROOT/_lessons/_lesson_template.md"
91
92
 
92
93
  # --- assemble the ~/.zshrc lines ---------------------------------------------
93
94
  LINES="export AI_MEM_ROOT=\"$AI_MEM_ROOT\""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ai-memory",
3
- "version": "0.8.0",
3
+ "version": "0.8.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
@@ -135,10 +135,11 @@ _ai_mem_latest_session_log() {
135
135
  # plugin-manager install (source only, no install.sh) still gets a working vault.
136
136
  _ai_mem_ensure_vault() {
137
137
  [[ -d "$AI_MEM_TEMPLATE_SRC" ]] || return 0
138
- mkdir -p "$AI_MEM_PROJECT_DIR" "$AI_MEM_SESSION_DIR"
138
+ mkdir -p "$AI_MEM_PROJECT_DIR" "$AI_MEM_SESSION_DIR" "$AI_MEM_ROOT/_lessons"
139
139
  local rel
140
140
  for rel in _Global_Profile.md _Standards.md \
141
- _projects/_project_template.md _session_logs/_session_template.md; do
141
+ _projects/_project_template.md _session_logs/_session_template.md \
142
+ _lessons/_lesson_template.md; do
142
143
  local src="$AI_MEM_TEMPLATE_SRC/$rel" dst="$AI_MEM_ROOT/$rel"
143
144
  if [[ -f "$src" && ! -f "$dst" ]]; then
144
145
  _ai_mem_guard "$dst" || return 1
@@ -587,7 +588,12 @@ ai-lesson() {
587
588
 
588
589
  if [[ ! -f "$lesson_file" ]]; then
589
590
  mkdir -p "$AI_MEM_ROOT/_lessons"
590
- printf -- '---\ntype: ai-lesson\ntopic: %s\n---\n\n# %s\n' "$slug" "$slug" > "$lesson_file"
591
+ local lesson_template="$AI_MEM_ROOT/_lessons/_lesson_template.md"
592
+ if [[ -f "$lesson_template" ]]; then
593
+ TOPIC="$slug" perl -0pe 's/\{\{topic\}\}/$ENV{TOPIC}/g' "$lesson_template" > "$lesson_file"
594
+ else
595
+ printf -- '---\ntype: ai-lesson\ntopic: %s\n---\n\n# %s\n' "$slug" "$slug" > "$lesson_file"
596
+ fi
591
597
  fi
592
598
 
593
599
  printf -- '\n- %s [%s] %s\n' "$timestamp" "$project_name" "$text" >> "$lesson_file"
@@ -659,7 +665,7 @@ ai-mem-search() {
659
665
  fi
660
666
 
661
667
  local raw
662
- raw="$(grep -rn --exclude-dir=.git --exclude='_session_template.md' --exclude='_project_template.md' -- "$term" "$search_root" 2>/dev/null)"
668
+ raw="$(grep -rn --exclude-dir=.git --exclude='_session_template.md' --exclude='_project_template.md' --exclude='_lesson_template.md' -- "$term" "$search_root" 2>/dev/null)"
663
669
 
664
670
  if [[ -z "$raw" ]]; then
665
671
  print -r -- "no matches for '$term' in $search_root"
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: ai-lesson
3
+ topic: {{topic}}
4
+ ---
5
+
6
+ # {{topic}}