From dd6922da876903be47f2defc3ca42526fd217406 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:40:15 +0800 Subject: [PATCH 01/10] feat: trim-claude-plugins --- chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl | 8 -------- 1 file changed, 8 deletions(-) diff --git a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl index ac842ed7..9f2b7aea 100644 --- a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl +++ b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl @@ -20,16 +20,8 @@ done plugins=( superpowers@claude-plugins-official caveman@caveman - code-review@claude-plugins-official - code-simplifier@claude-plugins-official - feature-dev@claude-plugins-official claude-md-management@claude-plugins-official - ralph-loop@claude-plugins-official typescript-lsp@claude-plugins-official - security-guidance@claude-plugins-official - commit-commands@claude-plugins-official - claude-code-setup@claude-plugins-official - pr-review-toolkit@claude-plugins-official pyright-lsp@claude-plugins-official context-mode@context-mode memsearch@memsearch From af7c70d56b306ab6970009e00ef58d2ba1f2b016 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:42:45 +0800 Subject: [PATCH 02/10] Update run_onchange_setup_claude.sh.tmpl --- chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl index 9f2b7aea..414148f0 100644 --- a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl +++ b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl @@ -18,11 +18,12 @@ for entry in "${marketplaces[@]}"; do done plugins=( - superpowers@claude-plugins-official - caveman@caveman claude-md-management@claude-plugins-official - typescript-lsp@claude-plugins-official + gopls-lsp@claude-plugins-official pyright-lsp@claude-plugins-official + typescript-lsp@claude-plugins-official + superpowers@claude-plugins-official + caveman@caveman context-mode@context-mode memsearch@memsearch ) From b2027fbfb1770da94551432e92f17dd87e94fcee Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:42:57 +0800 Subject: [PATCH 03/10] Update run_onchange_setup_claude.sh.tmpl --- chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl index 414148f0..70a504ff 100644 --- a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl +++ b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl @@ -22,10 +22,10 @@ plugins=( gopls-lsp@claude-plugins-official pyright-lsp@claude-plugins-official typescript-lsp@claude-plugins-official - superpowers@claude-plugins-official caveman@caveman context-mode@context-mode memsearch@memsearch + superpowers@claude-plugins-official ) for entry in "${plugins[@]}"; do claude plugin install "${entry}" From 7b25d51ad57cd975b75285734c9b54e2a55aefab Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:44:59 +0800 Subject: [PATCH 04/10] Update run_onchange_setup_claude.sh.tmpl --- chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl index 70a504ff..618f3b1e 100644 --- a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl +++ b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl @@ -18,6 +18,7 @@ for entry in "${marketplaces[@]}"; do done plugins=( + claude-code-setup@claude-plugins-official claude-md-management@claude-plugins-official gopls-lsp@claude-plugins-official pyright-lsp@claude-plugins-official From 67640680b30d2c52f552d7b8fa1313e3cc91c9dd Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:01:21 +0800 Subject: [PATCH 05/10] refactor: share agent instructions via chezmoi template Extract AGENTS.md into a reusable .chezmoitemplates entry consumed by opencode and the agents dir. CLAUDE.md and opencode AGENTS.md become modify-templates that preserve plugin edits after a CHEZMOI_END marker. Exclude those templates from markdownlint so it can't mangle the chezmoi comment syntax. Rename memsearch plugin source and ignore .memsearch dirs. Co-Authored-By: Claude Opus 4.8 (1M context) --- .pre-commit-config.yaml | 1 + .../run_onchange_setup_claude.sh.tmpl | 2 +- .../AGENTS.md | 0 chezmoi/private_dot_agents/AGENTS.md.tmpl | 1 + chezmoi/private_dot_claude/create_CLAUDE.md.tmpl | 1 - chezmoi/private_dot_claude/modify_CLAUDE.md | 13 +++++++++++++ chezmoi/private_dot_config/git/ignore.tmpl | 1 + .../private_dot_config/opencode/modify_AGENTS.md | 13 +++++++++++++ .../opencode/symlink_AGENTS.md.tmpl | 1 - 9 files changed, 30 insertions(+), 3 deletions(-) rename chezmoi/{private_dot_agents => .chezmoitemplates}/AGENTS.md (100%) create mode 100644 chezmoi/private_dot_agents/AGENTS.md.tmpl delete mode 100644 chezmoi/private_dot_claude/create_CLAUDE.md.tmpl create mode 100644 chezmoi/private_dot_claude/modify_CLAUDE.md create mode 100644 chezmoi/private_dot_config/opencode/modify_AGENTS.md delete mode 100644 chezmoi/private_dot_config/opencode/symlink_AGENTS.md.tmpl diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 485908b9..2660fe76 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,6 +49,7 @@ repos: hooks: - id: markdownlint-cli2 args: [--fix] + exclude: ^chezmoi/(private_dot_claude/modify_CLAUDE|private_dot_config/opencode/modify_AGENTS)\.md$ - repo: https://github.com/scop/pre-commit-shfmt rev: v3.13.1-1 diff --git a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl index 618f3b1e..c7294a2f 100644 --- a/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl +++ b/chezmoi/.chezmoiscripts/run_onchange_setup_claude.sh.tmpl @@ -25,7 +25,7 @@ plugins=( typescript-lsp@claude-plugins-official caveman@caveman context-mode@context-mode - memsearch@memsearch + memsearch@memsearch-plugins superpowers@claude-plugins-official ) for entry in "${plugins[@]}"; do diff --git a/chezmoi/private_dot_agents/AGENTS.md b/chezmoi/.chezmoitemplates/AGENTS.md similarity index 100% rename from chezmoi/private_dot_agents/AGENTS.md rename to chezmoi/.chezmoitemplates/AGENTS.md diff --git a/chezmoi/private_dot_agents/AGENTS.md.tmpl b/chezmoi/private_dot_agents/AGENTS.md.tmpl new file mode 100644 index 00000000..d250d7bf --- /dev/null +++ b/chezmoi/private_dot_agents/AGENTS.md.tmpl @@ -0,0 +1 @@ +{{ template "AGENTS.md" }} diff --git a/chezmoi/private_dot_claude/create_CLAUDE.md.tmpl b/chezmoi/private_dot_claude/create_CLAUDE.md.tmpl deleted file mode 100644 index 43c994c2..00000000 --- a/chezmoi/private_dot_claude/create_CLAUDE.md.tmpl +++ /dev/null @@ -1 +0,0 @@ -@AGENTS.md diff --git a/chezmoi/private_dot_claude/modify_CLAUDE.md b/chezmoi/private_dot_claude/modify_CLAUDE.md new file mode 100644 index 00000000..09b63bc4 --- /dev/null +++ b/chezmoi/private_dot_claude/modify_CLAUDE.md @@ -0,0 +1,13 @@ +{{- /* chezmoi:modify-template */ -}} +{{- $currentContent := .chezmoi.stdin -}} +{{- $marker := "" -}} + +{{- printf "%s\n" "@AGENTS.md\n" -}} +{{- printf "%s\n" $marker -}} + +{{- /* Extract and append only the plugin modifications */ -}} +{{- if contains $marker $currentContent -}} +{{- /* Split the file by the marker and grab everything after it */ -}} +{{- $splitContent := splitList $marker $currentContent -}} +{{- printf "%s" (index $splitContent 1 | trim) -}} +{{- end -}} diff --git a/chezmoi/private_dot_config/git/ignore.tmpl b/chezmoi/private_dot_config/git/ignore.tmpl index 2d17dedc..e0126764 100644 --- a/chezmoi/private_dot_config/git/ignore.tmpl +++ b/chezmoi/private_dot_config/git/ignore.tmpl @@ -109,3 +109,4 @@ nohup.out {{- end }} **/.claude/settings.local.json +.memsearch/** diff --git a/chezmoi/private_dot_config/opencode/modify_AGENTS.md b/chezmoi/private_dot_config/opencode/modify_AGENTS.md new file mode 100644 index 00000000..be78b041 --- /dev/null +++ b/chezmoi/private_dot_config/opencode/modify_AGENTS.md @@ -0,0 +1,13 @@ +{{- /* chezmoi:modify-template */ -}} +{{- $currentContent := .chezmoi.stdin -}} +{{- $marker := "" -}} + +{{- printf "%s\n" (includeTemplate "AGENTS.md") -}} +{{- printf "%s\n" $marker -}} + +{{- /* Extract and append only the plugin modifications */ -}} +{{- if contains $marker $currentContent -}} +{{- /* Split the file by the marker and grab everything after it */ -}} +{{- $splitContent := splitList $marker $currentContent -}} +{{- printf "%s" (index $splitContent 1 | trim) -}} +{{- end -}} diff --git a/chezmoi/private_dot_config/opencode/symlink_AGENTS.md.tmpl b/chezmoi/private_dot_config/opencode/symlink_AGENTS.md.tmpl deleted file mode 100644 index 635418cf..00000000 --- a/chezmoi/private_dot_config/opencode/symlink_AGENTS.md.tmpl +++ /dev/null @@ -1 +0,0 @@ -../../.agents/AGENTS.md From d8ad565e940825c35d26ee492646aee670216966 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:02:15 +0800 Subject: [PATCH 06/10] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2660fe76..498bbadd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,7 +49,7 @@ repos: hooks: - id: markdownlint-cli2 args: [--fix] - exclude: ^chezmoi/(private_dot_claude/modify_CLAUDE|private_dot_config/opencode/modify_AGENTS)\.md$ + exclude: ^chezmoi/.*/modify_.*\.md$ - repo: https://github.com/scop/pre-commit-shfmt rev: v3.13.1-1 From 052d90027c00ed85567317083eb1b587da70ebc6 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:04:13 +0800 Subject: [PATCH 07/10] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 498bbadd..ddd90b86 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,7 +49,7 @@ repos: hooks: - id: markdownlint-cli2 args: [--fix] - exclude: ^chezmoi/.*/modify_.*\.md$ + exclude: /modify_.*\.md$ - repo: https://github.com/scop/pre-commit-shfmt rev: v3.13.1-1 From 225f0db529f6b86380591d645301a7a13f197f31 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 05:05:31 +0000 Subject: [PATCH 08/10] fix: apply megalinter fixes --- chezmoi/private_dot_claude/modify_CLAUDE.md | 6 +++--- chezmoi/private_dot_config/opencode/modify_AGENTS.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chezmoi/private_dot_claude/modify_CLAUDE.md b/chezmoi/private_dot_claude/modify_CLAUDE.md index 09b63bc4..21391690 100644 --- a/chezmoi/private_dot_claude/modify_CLAUDE.md +++ b/chezmoi/private_dot_claude/modify_CLAUDE.md @@ -1,13 +1,13 @@ -{{- /* chezmoi:modify-template */ -}} +{{- /*chezmoi:modify-template*/ -}} {{- $currentContent := .chezmoi.stdin -}} {{- $marker := "" -}} {{- printf "%s\n" "@AGENTS.md\n" -}} {{- printf "%s\n" $marker -}} -{{- /* Extract and append only the plugin modifications */ -}} +{{- /*Extract and append only the plugin modifications */ -}} {{- if contains $marker $currentContent -}} -{{- /* Split the file by the marker and grab everything after it */ -}} +{{- /* Split the file by the marker and grab everything after it*/ -}} {{- $splitContent := splitList $marker $currentContent -}} {{- printf "%s" (index $splitContent 1 | trim) -}} {{- end -}} diff --git a/chezmoi/private_dot_config/opencode/modify_AGENTS.md b/chezmoi/private_dot_config/opencode/modify_AGENTS.md index be78b041..48a876da 100644 --- a/chezmoi/private_dot_config/opencode/modify_AGENTS.md +++ b/chezmoi/private_dot_config/opencode/modify_AGENTS.md @@ -1,13 +1,13 @@ -{{- /* chezmoi:modify-template */ -}} +{{- /*chezmoi:modify-template*/ -}} {{- $currentContent := .chezmoi.stdin -}} {{- $marker := "" -}} {{- printf "%s\n" (includeTemplate "AGENTS.md") -}} {{- printf "%s\n" $marker -}} -{{- /* Extract and append only the plugin modifications */ -}} +{{- /*Extract and append only the plugin modifications */ -}} {{- if contains $marker $currentContent -}} -{{- /* Split the file by the marker and grab everything after it */ -}} +{{- /* Split the file by the marker and grab everything after it*/ -}} {{- $splitContent := splitList $marker $currentContent -}} {{- printf "%s" (index $splitContent 1 | trim) -}} {{- end -}} From 5d66e00454951b52d7a8a5eeac12d07fb0261178 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:10:06 +0800 Subject: [PATCH 09/10] minor --- chezmoi/private_dot_claude/modify_CLAUDE.md | 2 +- chezmoi/private_dot_config/git/ignore.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chezmoi/private_dot_claude/modify_CLAUDE.md b/chezmoi/private_dot_claude/modify_CLAUDE.md index 21391690..014510e0 100644 --- a/chezmoi/private_dot_claude/modify_CLAUDE.md +++ b/chezmoi/private_dot_claude/modify_CLAUDE.md @@ -2,7 +2,7 @@ {{- $currentContent := .chezmoi.stdin -}} {{- $marker := "" -}} -{{- printf "%s\n" "@AGENTS.md\n" -}} +{{- printf "%s\n" "@AGENTS.md" -}} {{- printf "%s\n" $marker -}} {{- /*Extract and append only the plugin modifications */ -}} diff --git a/chezmoi/private_dot_config/git/ignore.tmpl b/chezmoi/private_dot_config/git/ignore.tmpl index e0126764..6c81ae05 100644 --- a/chezmoi/private_dot_config/git/ignore.tmpl +++ b/chezmoi/private_dot_config/git/ignore.tmpl @@ -109,4 +109,4 @@ nohup.out {{- end }} **/.claude/settings.local.json -.memsearch/** +.memsearch/ From cdbd405af9a9d46f4ab4c76d8cfbc3cd1aad9b03 Mon Sep 17 00:00:00 2001 From: yxtay <5795122+yxtay@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:14:52 +0800 Subject: [PATCH 10/10] Update modify_AGENTS.md --- chezmoi/private_dot_config/opencode/modify_AGENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chezmoi/private_dot_config/opencode/modify_AGENTS.md b/chezmoi/private_dot_config/opencode/modify_AGENTS.md index 48a876da..9e9b0a9f 100644 --- a/chezmoi/private_dot_config/opencode/modify_AGENTS.md +++ b/chezmoi/private_dot_config/opencode/modify_AGENTS.md @@ -5,9 +5,9 @@ {{- printf "%s\n" (includeTemplate "AGENTS.md") -}} {{- printf "%s\n" $marker -}} -{{- /*Extract and append only the plugin modifications */ -}} +{{- /*Extract and append only the plugin modifications*/ -}} {{- if contains $marker $currentContent -}} -{{- /* Split the file by the marker and grab everything after it*/ -}} +{{- /*Split the file by the marker and grab everything after it*/ -}} {{- $splitContent := splitList $marker $currentContent -}} {{- printf "%s" (index $splitContent 1 | trim) -}} {{- end -}}