feat: add okf-wiki plugin for journal-to-wiki distillation - #884
Conversation
Adds a local Claude Code plugin marketplace (yxtay) under ~/.agents/plugins/ and an okf-wiki plugin that fires on SessionEnd and PreCompact to periodically distill memsearch journals into the ~/wiki OKF knowledge bundle via a headless claude -p call. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 18 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe changes add a local Claude plugin marketplace and an ChangesOKF wiki plugin workflow
Bootstrap command updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ClaudeSession
participant Hooks
participant Maintenance
participant Journals
participant NestedClaude
participant Wiki
ClaudeSession->>Hooks: trigger SessionEnd or PreCompact
Hooks->>Maintenance: invoke maintenance script asynchronously
Maintenance->>Journals: find recently modified markdown files
Maintenance->>NestedClaude: provide journals and review instructions
NestedClaude->>Wiki: update durable OKF bundle content
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅MegaLinter analysis: Success
Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| bash-exec | 4 | 1 | 0 | 0.01s | ||
| ✅ BASH | shellcheck | 4 | 0 | 0 | 0.14s | |
| ✅ REPOSITORY | betterleaks | yes | no | no | 1.21s | |
| ✅ REPOSITORY | checkov | yes | no | no | 22.73s | |
| ✅ REPOSITORY | devskim | yes | no | no | 1.25s | |
| ✅ REPOSITORY | dustilock | yes | no | no | 0.19s | |
| ✅ REPOSITORY | gitleaks | yes | no | no | 0.6s | |
| ✅ REPOSITORY | grype | yes | no | no | 35.34s | |
| ✅ REPOSITORY | kingfisher | yes | no | no | 5.65s | |
| ✅ REPOSITORY | osv-scanner | yes | no | no | 0.07s | |
| ✅ REPOSITORY | secretlint | yes | no | no | 1.05s | |
| ✅ REPOSITORY | syft | yes | no | no | 1.05s | |
| ✅ REPOSITORY | trivy | yes | no | no | 10.35s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.08s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 2.58s |
Detailed Issues
⚠️ BASH / bash-exec - 1 error
Results of bash-exec linter (version 5.3.9)
See documentation on https://megalinter.io/9.6.0/descriptors/bash_bash_exec/
-----------------------------------------------
✅ [SUCCESS] bin/cleanup-all.sh
✅ [SUCCESS] bin/update-all.sh
❌ [ERROR] chezmoi/private_dot_agents/plugins/okf-wiki/hooks/okf-wiki-maintenance.sh
Error: File:[chezmoi/private_dot_agents/plugins/okf-wiki/hooks/okf-wiki-maintenance.sh] is not executable
✅ [SUCCESS] install.sh
Notices
📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.6.0 --custom-flavor-setup --custom-flavor-linters BASH_EXEC,BASH_SHELLCHECK,REPOSITORY_CHECKOV,REPOSITORY_DEVSKIM,REPOSITORY_DUSTILOCK,REPOSITORY_GITLEAKS,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,REPOSITORY_KINGFISHER

Show us your support by starring ⭐ the repository
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 5 | 0 | 0 | 0.37s | |
| ✅ ACTION | zizmor | 5 | 0 | 0 | 0 | 0.56s |
| bash-exec | 4 | 1 | 0 | 0.02s | ||
| ✅ BASH | shellcheck | 4 | 0 | 0 | 0.15s | |
| ✅ BASH | shfmt | 4 | 0 | 0 | 0 | 0.02s |
| ✅ COPYPASTE | jscpd | yes | no | no | 0.1s | |
| ✅ EDITORCONFIG | editorconfig-checker | 88 | 0 | 0 | 0.18s | |
| ✅ JSON | prettier | 8 | 0 | 0 | 0 | 0.48s |
| ✅ JSON | v8r | 12 | 0 | 0 | 4.1s | |
| ✅ MARKDOWN | markdownlint | 13 | 0 | 0 | 0 | 0.71s |
| ✅ MARKDOWN | markdown-table-formatter | 15 | 0 | 0 | 0 | 0.21s |
| ✅ REPOSITORY | betterleaks | yes | no | no | 3.07s | |
| ✅ REPOSITORY | checkov | yes | no | no | 24.33s | |
| ✅ REPOSITORY | gitleaks | yes | no | no | 1.03s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.01s | |
| ✅ REPOSITORY | grype | yes | no | no | 51.23s | |
| ✅ REPOSITORY | osv-scanner | yes | no | no | 0.19s | |
| ✅ REPOSITORY | secretlint | yes | no | no | 1.25s | |
| ✅ REPOSITORY | syft | yes | no | no | 3.68s | |
| ✅ REPOSITORY | trivy | yes | no | no | 10.17s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.24s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 3.64s | |
| lychee | 39 | 3 | 0 | 1.02s | ||
| ✅ YAML | prettier | 11 | 0 | 0 | 0 | 0.59s |
| ✅ YAML | v8r | 11 | 0 | 0 | 9.22s | |
| ✅ YAML | yamllint | 11 | 0 | 0 | 0.57s |
Detailed Issues
⚠️ BASH / bash-exec - 1 error
Results of bash-exec linter (version 5.3.9)
See documentation on https://megalinter.io/9.6.0/descriptors/bash_bash_exec/
-----------------------------------------------
✅ [SUCCESS] bin/cleanup-all.sh
✅ [SUCCESS] bin/update-all.sh
❌ [ERROR] chezmoi/private_dot_agents/plugins/okf-wiki/hooks/okf-wiki-maintenance.sh
Error: File:[chezmoi/private_dot_agents/plugins/okf-wiki/hooks/okf-wiki-maintenance.sh] is not executable
✅ [SUCCESS] install.sh
⚠️ SPELL / lychee - 3 errors
📝 Summary
---------------------
🔍 Total...........44
🔗 Unique..........29
✅ Successful......41
⏳ Timeouts.........0
🔀 Redirected.......7
👻 Excluded.........0
❓ Unknown..........0
🚫 Errors...........3
⛔ Unsupported......3
Errors in chezmoi/.chezmoitemplates/mcp_servers.json
[406] https://mcp.deepwiki.com/mcp (at 11:15) | Rejected status code: 406 Not Acceptable
Errors in chezmoi/.chezmoitemplates/opencode.json
[406] https://mcp.deepwiki.com/mcp (at 32:15) | Rejected status code: 406 Not Acceptable
Errors in chezmoi/private_dot_agents/plugins/dot_claude-plugin/marketplace.json
[404] https://anthropic.com/claude-code/marketplace.schema.json (at 2:15) | Rejected status code: 404 Not Found | Followed 1 redirect. Redirects: https://anthropic.com/claude-code/marketplace.schema.json --[301]--> https://www.anthropic.com/claude-code/marketplace.schema.json
Hint: Followed 7 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
Notices
📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.6.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,ACTION_ZIZMOR,BASH_EXEC,BASH_SHELLCHECK,BASH_SHFMT,COPYPASTE_JSCPD,EDITORCONFIG_EDITORCONFIG_CHECKER,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

Show us your support by starring ⭐ the repository
There was a problem hiding this comment.
Code Review
This pull request introduces a new Claude plugin, okf-wiki, which periodically distills memsearch journals into a personal wiki directory using Claude. It also configures a local marketplace for personal plugins, adds the plugin to the installation script, updates the opencode setup to use npm exec, and removes the microsoft-edge cask. The feedback highlights two potential runtime issues in the okf-wiki-maintenance.sh script: an unbound variable error with ${CLAUDE_PLUGIN_ROOT} under set -u, and a potential bash syntax error during arithmetic evaluation if the state file is empty or non-numeric.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@chezmoi/.chezmoiscripts/run_onchange_setup_opencode.sh.tmpl`:
- Line 12: Update the npm exec invocation in run_onchange_setup_opencode.sh.tmpl
to pin github:JuliusBrussee/caveman to a reviewed tag or commit via a `#ref`, and
replace the broad --allow-git=all setting with the narrowest Git permission
required for this dependency.
- Line 12: Update the setup script around the npm exec invocation to detect
whether the installed npm version is at least 11.9.0 before passing
--allow-git=all. Use the guarded npm command for supported versions and fall
back to an equivalent npx invocation for older npm releases, preserving the
existing caveman arguments and bootstrap behavior.
In `@chezmoi/private_dot_agents/plugins/okf-wiki/hooks/hooks.json`:
- Around line 4-27: Increase the hook timeout for both the SessionEnd and
PreCompact entries in hooks.json from 15 seconds to a duration sufficient for
the maintenance.sh claude -p workflow, such as 300 seconds, so the process can
complete without being killed.
In `@chezmoi/private_dot_agents/plugins/okf-wiki/hooks/okf-wiki-maintenance.sh`:
- Around line 24-26: Validate last_run from STATE_FILE before calculating
elapsed_hours, treating empty or non-numeric content as 0 so the interval gate
uses an explicit safe fallback. Update the state-loading logic immediately
before the elapsed_hours calculation while preserving valid numeric timestamps
unchanged.
- Around line 41-58: Move the date write to STATE_FILE until after the claude -p
command succeeds, and remove the unconditional success suppression so failures
do not advance state. Add a lock-file or equivalent atomic guard around the
maintenance flow to prevent concurrent SessionEnd and PreCompact executions,
releasing the lock on every exit path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 12e4ea9a-9f63-40cc-b9e7-d0db161359c8
📒 Files selected for processing (10)
CLAUDE.mdCLAUDE.mdchezmoi/.chezmoiscripts/run_before_brew_install.sh.tmplchezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmplchezmoi/.chezmoiscripts/run_onchange_setup_opencode.sh.tmplchezmoi/private_dot_agents/plugins/marketplace.jsonchezmoi/private_dot_agents/plugins/okf-wiki/.claude-plugin/plugin.jsonchezmoi/private_dot_agents/plugins/okf-wiki/hooks/hooks.jsonchezmoi/private_dot_agents/plugins/okf-wiki/hooks/okf-wiki-maintenance.shchezmoi/private_dot_agents/plugins/okf-wiki/okf-wiki-review.txt
💤 Files with no reviewable changes (1)
- chezmoi/.chezmoiscripts/run_before_brew_install.sh.tmpl
Pass PROJECT.md/USER.md as higher-signal sources alongside journals. Restructure prompt with explicit rules, action vocabulary, and skill invocation order — modelled on memsearch's own prompt conventions. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Literal .claude-plugin dirs in the chezmoi source tree never deployed — chezmoi requires the dot_ prefix convention for leading-dot paths. This left marketplace.json and plugin.json missing on disk, causing `claude plugin marketplace add` to fail with "file not found". Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new Claude Code plugin, okf-wiki, which periodically distills memsearch journals into a personal wiki, alongside minor configuration updates such as removing the Microsoft Edge cask and updating the OpenCode setup script. The review feedback focuses on improving the robustness of the okf-wiki-maintenance.sh script by handling empty state files, ensuring the wiki directory exists, fixing newline formatting in bash, and only updating the state file upon successful execution. Additionally, it is recommended to increase the hook execution timeout in hooks.json to prevent premature termination of the distillation process.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
- Background claude -p so hook returns within 15s timeout; write state
file only on success so failed runs don't suppress the next trigger
- Add flock lock guard to prevent concurrent SessionEnd + PreCompact runs
- Guard arithmetic against empty/non-numeric state file (set -e safety)
- Check wiki dir exists before invoking claude -p
- Add CLAUDE_PLUGIN_ROOT fallback for manual invocation
- Remove {{AGENT_NAME}} placeholder (was never substituted)
- Restructure prompt as numbered steps with explicit early-exit condition
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…n-blocking Backgrounding released the flock immediately, allowing a concurrent PreCompact trigger to start a second run while the first was still running. With async:true in hooks.json Claude Code does not block on the script — running claude -p synchronously keeps the lock held for the full duration and fixes the race. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Update key scripts list to match current run_onchange_after_ naming and add missing scripts. Add clarifying comments for fd-based flock and CLAUDECODE= in the hook script. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Summary
yxtay) sourced from~/.agents/plugins/okf-wikiplugin: fires onSessionEndandPreCompactto distill recent memsearch journals into~/wikiOKF knowledge bundle via headlessclaude -prun_onchange_setup_opencode.sh.tmplto usenpm exec --allow-git=allfor caveman installTest plan
chezmoi apply— verify~/.agents/plugins/deployed,claude plugin marketplace addandclaude plugin install okf-wiki@yxtaysucceed~/.memsearch/.okf-wiki-last-runstate file created and~/wiki/updated🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
okf-wikiplugin.Updates