Compare commits

...

2 Commits

Author SHA1 Message Date
Ryan Walters
3c1ebfe086 refactor: reorganize Claude settings for better readability
Restructure claude-settings.json by moving permissions (allow/deny/ask) before enabledPlugins section for improved logical grouping and readability.
2025-11-06 09:50:26 -06:00
Ryan Walters
4d20cbbacd docs: improve template system documentation with context parameter clarification
- Distinguish between regular templates and partials for variable access
- Document how partials receive context via explicit parameters
- Add examples for both template types with correct syntax
- Templatize global CLAUDE.md for platform-specific shell environment sections
- Add conditional rendering for Windows, WSL, and Linux environments
2025-11-04 11:35:53 -06:00
3 changed files with 105 additions and 71 deletions

View File

@@ -20,7 +20,14 @@ This is a **chezmoi source directory** for managing dotfiles across multiple mac
**Template System:**
- Uses Go templates with platform detection
- Variables: `.chezmoi.os`, `.chezmoi.homeDir`, `.data.*`
- Two types of templates with different variable access patterns:
- **Regular templates** (e.g., `home/dot_bashrc.tmpl`): Direct access to Chezmoi context
- Built-in: `.chezmoi.os`, `.chezmoi.homeDir`
- Custom data: `.wsl`, `.chassis`
- **Partials** (reusable templates in `home/.chezmoitemplates/`): Must receive context via explicit parameter
- Partials don't have automatic access to Chezmoi's context
- Context passed as parameter (commonly `data`) when calling the partial
- Access everything through parameter: `.data.chezmoi.os`, `.data.wsl`, `.data.chassis`
- Conditional rendering for Windows/Linux/macOS/WSL
**Secret Management:**
@@ -82,9 +89,11 @@ This is a **chezmoi source directory** for managing dotfiles across multiple mac
- `chezmoi status` - see what's changed
4. **Use templates correctly**
- Platform detection: `.chezmoi.os`, `.data.wsl`, `.data.chassis`
- Platform detection in regular templates: `.chezmoi.os`, `.wsl`, `.chassis`
- Platform detection in partials: `.data.chezmoi.os`, `.data.wsl`, `.data.chassis`
- Doppler secrets: `{{ dopplerProjectJson.SECRET_NAME }}`
- Conditional logic: `{{ if }}...{{ else }}...{{ end }}`
- Example partial call: `{{ template "commonrc.sh.tmpl" . }}` (passes entire context as `data`)
5. **Suggest TODO list updates** (but DO NOT modify automatically)
- When a task is completed, check if `TODO.md` exists in the repository

View File

@@ -1,44 +1,5 @@
{
"includeCoAuthoredBy": false,
"alwaysThinkingEnabled": true,
"enabledPlugins": {
"backend-development@claude-code-workflows": true,
"javascript-typescript@claude-code-workflows": true,
"security-guidance@claude-code-plugins": true,
"commit-commands@claude-code-plugins": true,
"feature-dev@claude-code-plugins": true,
"code-documentation@claude-code-workflows": true,
"debugging-toolkit@claude-code-workflows": true,
"git-pr-workflows@claude-code-workflows": true,
"full-stack-orchestration@claude-code-workflows": true,
"unit-testing@claude-code-workflows": true,
"tdd-workflows@claude-code-workflows": true,
"code-review-ai@claude-code-workflows": true,
"code-refactoring@claude-code-workflows": true,
"dependency-management@claude-code-workflows": true,
"error-debugging@claude-code-workflows": true,
"error-diagnostics@claude-code-workflows": true,
"deployment-strategies@claude-code-workflows": true,
"deployment-validation@claude-code-workflows": true,
"cicd-automation@claude-code-workflows": true,
"application-performance@claude-code-workflows": true,
"comprehensive-review@claude-code-workflows": true,
"performance-testing-review@claude-code-workflows": true,
"framework-migration@claude-code-workflows": true,
"codebase-cleanup@claude-code-workflows": true,
"database-design@claude-code-workflows": true,
"data-validation-suite@claude-code-workflows": true,
"api-scaffolding@claude-code-workflows": true,
"api-testing-observability@claude-code-workflows": true,
"documentation-generation@claude-code-workflows": true,
"game-development@claude-code-workflows": true,
"accessibility-compliance@claude-code-workflows": true,
"systems-programming@claude-code-workflows": true,
"functional-programming@claude-code-workflows": true,
"shell-scripting@claude-code-workflows": true,
"observability-monitoring@claude-code-workflows": true,
"database-cloud-optimization@claude-code-workflows": true
},
"permissions": {
"allow": [
"WebSearch",
@@ -145,12 +106,38 @@
"Bash(wsl ls:*)",
"Bash(wsl:*)",
"Bash(tasklist:*)",
"Bash(powershell \"Get-Process:*)",
"Bash(Select-String:*)",
"Bash(Select-Object:*)",
"Bash(findstr:*)",
"Bash(dir:*)"
],
"deny": [
"Bash(git push --force:*)",
"Bash(git push -f:*)",
"Bash(git push --force-with-lease:*)",
"Bash(git reset --hard:*)",
"Bash(git branch -D:*)",
"Bash(git clean -fd:*)",
"Bash(git clean -f:*)",
"Bash(git filter-branch:*)",
"Bash(git push --delete:*)",
"Bash(git push origin --delete:*)",
"Bash(git push origin :*)",
"Bash(gh repo delete:*)",
"Bash(gh repo archive:*)",
"Bash(gh secret delete:*)",
"Bash(gh release delete:*)",
"Bash(cargo clean:*)",
"Bash(cargo yank:*)",
"Bash(cargo uninstall --all:*)",
"Bash(wrangler delete:*)",
"Bash(wrangler secret delete:*)",
"Bash(rm -rf:*)",
"Bash(rmdir /s:*)",
"Bash(rd /s:*)",
"Bash(Remove-Item -Recurse -Force:*)",
"Bash(del /s:*)"
],
"ask": [
"Bash(cargo uninstall:*)",
"Bash(cargo update:*)",
@@ -185,33 +172,50 @@
"Bash(Move-Item:*)",
"Bash(rm:*)",
"Bash(del:*)"
],
"deny": [
"Bash(git push --force:*)",
"Bash(git push -f:*)",
"Bash(git push --force-with-lease:*)",
"Bash(git reset --hard:*)",
"Bash(git branch -D:*)",
"Bash(git clean -fd:*)",
"Bash(git clean -f:*)",
"Bash(git filter-branch:*)",
"Bash(git push --delete:*)",
"Bash(git push origin --delete:*)",
"Bash(git push origin :*)",
"Bash(gh repo delete:*)",
"Bash(gh repo archive:*)",
"Bash(gh secret delete:*)",
"Bash(gh release delete:*)",
"Bash(cargo clean:*)",
"Bash(cargo yank:*)",
"Bash(cargo uninstall --all:*)",
"Bash(wrangler delete:*)",
"Bash(wrangler secret delete:*)",
"Bash(rm -rf:*)",
"Bash(rmdir /s:*)",
"Bash(rd /s:*)",
"Bash(Remove-Item -Recurse -Force:*)",
"Bash(del /s:*)"
]
}
},
"statusLine": {
"type": "command",
"command": "bunx -y ccstatusline@latest",
"padding": 0
},
"enabledPlugins": {
"backend-development@claude-code-workflows": true,
"javascript-typescript@claude-code-workflows": true,
"security-guidance@claude-code-plugins": true,
"commit-commands@claude-code-plugins": true,
"feature-dev@claude-code-plugins": true,
"code-documentation@claude-code-workflows": true,
"debugging-toolkit@claude-code-workflows": true,
"git-pr-workflows@claude-code-workflows": true,
"full-stack-orchestration@claude-code-workflows": true,
"unit-testing@claude-code-workflows": true,
"tdd-workflows@claude-code-workflows": true,
"code-review-ai@claude-code-workflows": true,
"code-refactoring@claude-code-workflows": true,
"dependency-management@claude-code-workflows": true,
"error-debugging@claude-code-workflows": true,
"error-diagnostics@claude-code-workflows": true,
"deployment-strategies@claude-code-workflows": true,
"deployment-validation@claude-code-workflows": true,
"cicd-automation@claude-code-workflows": true,
"application-performance@claude-code-workflows": true,
"comprehensive-review@claude-code-workflows": true,
"performance-testing-review@claude-code-workflows": true,
"framework-migration@claude-code-workflows": true,
"codebase-cleanup@claude-code-workflows": true,
"database-design@claude-code-workflows": true,
"data-validation-suite@claude-code-workflows": true,
"api-scaffolding@claude-code-workflows": true,
"api-testing-observability@claude-code-workflows": true,
"documentation-generation@claude-code-workflows": true,
"game-development@claude-code-workflows": true,
"accessibility-compliance@claude-code-workflows": true,
"systems-programming@claude-code-workflows": true,
"functional-programming@claude-code-workflows": true,
"shell-scripting@claude-code-workflows": true,
"observability-monitoring@claude-code-workflows": true,
"database-cloud-optimization@claude-code-workflows": true
},
"alwaysThinkingEnabled": true
}

View File

@@ -1,4 +1,6 @@
**Note**: Project-specific CLAUDE.md files take precedence for project-specific patterns.
**Note**: Project-specific CLAUDE.md files take precedence for project-specific patterns.
{{- if and (eq .chezmoi.os "windows") (not .wsl) }}
## Shell Environment (Windows)
@@ -7,6 +9,25 @@
- ❌ Do NOT use CMD commands (`dir`, `copy`, `del`)
- ✅ Use standard Bash/Unix commands (`ls`, `cp`, `mv`, `rm`, `grep`)
- Prefer relative paths for simplicity
{{- else if .wsl }}
## Shell Environment (WSL)
- **You are in WSL (Windows Subsystem for Linux)**
- ✅ Use standard Linux/Bash commands (`ls`, `cp`, `mv`, `rm`, `grep`)
- ✅ Full access to Linux tooling and package managers
- ⚠️ Can access Windows filesystem via `/mnt/c/`, but prefer Linux paths
- ⚠️ Can call Windows executables (`.exe`), but prefer native Linux tools
- Prefer relative paths for simplicity
{{- else if eq .chezmoi.os "linux" }}
## Shell Environment (Linux)
- **You are in a standard Linux environment**
- ✅ Use standard Bash/Unix commands (`ls`, `cp`, `mv`, `rm`, `grep`)
- ✅ Full access to Linux tooling and package managers
- Prefer relative paths for simplicity
{{- end }}
## Build & Package Management