Skip to content

feat: add lessons learned reference and update session scripts#27

Merged
Disdjj merged 1 commit into
mainfrom
feat_lessons_learned
May 23, 2026
Merged

feat: add lessons learned reference and update session scripts#27
Disdjj merged 1 commit into
mainfrom
feat_lessons_learned

Conversation

@wh1teAlter

Copy link
Copy Markdown
Collaborator

Introduced a new reference file for lessons learned to serve as a curated memory archive. Updated session start and stop scripts to incorporate checks for active memory files and summarize lessons when the threshold is exceeded.

Introduced a new reference file for lessons learned to serve as a curated memory archive. Updated session start and stop scripts to incorporate checks for active memory files and summarize lessons when the threshold is exceeded.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a structured memory archiving system for the llmdoc skill. It adds a new reference document defining the archival process, updates the session start hook to include the lessons-learned summary in the context, and modifies the stop hook to monitor active memory files and trigger archival reminders when the count exceeds five. A review comment suggested optimizing the file counting logic in the stop hook to improve performance and robustness by using the -prune flag and suppressing error output.

Comment on lines +13 to +20
active_memory_count="$(
find "$project_dir/llmdoc/memory" -type f \
! -path "$project_dir/llmdoc/memory/archive/*" \
! -name "lessons-learned.md" \
! -name "doc-gaps.md" \
| wc -l \
| tr -d '[:space:]'
)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current find command is inefficient because it traverses the entire archive/ directory only to filter out its contents. Additionally, since set -e is active, any error (such as a permission denied error on a subdirectory) will cause the hook script to terminate prematurely. Using -prune to skip the archive directory and redirecting stderr to /dev/null makes the script more robust and performant as the project history grows.

Suggested change
active_memory_count="$(
find "$project_dir/llmdoc/memory" -type f \
! -path "$project_dir/llmdoc/memory/archive/*" \
! -name "lessons-learned.md" \
! -name "doc-gaps.md" \
| wc -l \
| tr -d '[:space:]'
)"
active_memory_count="$(find "$project_dir/llmdoc/memory" -path "$project_dir/llmdoc/memory/archive" -prune -o -type f ! -name "lessons-learned.md" ! -name "doc-gaps.md" -print 2>/dev/null | wc -l | tr -d '[:space:]')"

@Disdjj

Disdjj commented May 21, 2026

Copy link
Copy Markdown
Member

再更新下小版本吧, 可以直接合并 @wh1teAlter

@Disdjj Disdjj merged commit 50206c3 into main May 23, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants