Skip to content

Commit bf00725

Browse files
committed
feat: add chezmoi-development skill and fix .claude directory management
- Add comprehensive chezmoi-development skill with documentation for .chezmoidata and modify scripts - Replace dot_claude/settings.json with run_onchange_after_update-claude-settings.sh.tmpl - Add .claude to .chezmoiignore to prevent management conflicts with symlinks - Remove run_before_00_remove-claude-symlink.sh.tmpl that was breaking symlinks - Configure fx/cc marketplace and enable fx-dev@fx-cc plugin by default - Improve install.sh to detect and use local repository for testing - Clear chezmoi state database and use --force flag to avoid prompts - Suppress confusing "Cloning into" message when using local repository This approach allows .claude to remain a symlink in Coder workspaces while still applying settings updates via the run_onchange_after script, which works with both directories and symlinks.
1 parent 9e99e66 commit bf00725

File tree

9 files changed

+885
-32
lines changed

9 files changed

+885
-32
lines changed

.chezmoidata/claude.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
# Claude Code marketplace configuration
3+
# This data is merged into ~/.claude/settings.json via modify_ script
4+
5+
marketplace:
6+
extraKnownMarketplaces:
7+
fx-cc:
8+
source:
9+
source: git
10+
url: git@github.com:fx/cc.git
11+
12+
settings:
13+
includeCoAuthoredBy: false
14+
enableAllProjectMcpServers: true
15+
enabledPlugins:
16+
fx-dev@fx-cc: true

.chezmoiignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ test-*.sh
1111
*.bak
1212

1313
# Note: shared directory stays in source for symlink targets, not installed to home
14-
shared/
14+
shared/
15+
16+
# .claude directory is managed by run_onchange_after_update-claude-settings.sh script
17+
# Not by chezmoi's file management (allows symlinks to work in Coder)
18+
.claude

.chezmoiscripts/run_before_00_remove-claude-symlink.sh.tmpl

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
# Update ~/.claude/settings.json with marketplace configuration
3+
# Works with both real directories and symlinks
4+
5+
{{ if .include_defaults -}}
6+
set -e
7+
8+
# Ensure ~/.claude exists (as directory or symlink)
9+
if [ ! -e "$HOME/.claude" ]; then
10+
mkdir -p "$HOME/.claude"
11+
fi
12+
13+
SETTINGS_FILE="$HOME/.claude/settings.json"
14+
15+
# Read existing settings or start with empty object
16+
if [ -f "$SETTINGS_FILE" ]; then
17+
existing=$(cat "$SETTINGS_FILE")
18+
else
19+
existing='{}'
20+
fi
21+
22+
# Our required settings from .chezmoidata/claude.yaml
23+
required_settings='{{ .settings | toJson }}'
24+
marketplace_config='{{ .marketplace | toJson }}'
25+
26+
# Merge: existing settings + our required settings + marketplace config
27+
# Our settings take precedence (using * operator for recursive merge)
28+
result=$(echo "$existing" | jq --argjson required "$required_settings" \
29+
--argjson marketplace "$marketplace_config" \
30+
'. * $required * $marketplace')
31+
32+
# Write the merged result
33+
echo "$result" > "$SETTINGS_FILE"
34+
35+
echo "✓ Updated $SETTINGS_FILE"
36+
{{ end -}}

0 commit comments

Comments
 (0)