-
-
Notifications
You must be signed in to change notification settings - Fork 0
docs: optimize CLAUDE.md with enhanced directives #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,49 +1,131 @@ | ||||||
| # Repo Manual: Arch/Debian Dotfiles | ||||||
|
|
||||||
| **Purpose:** Dotfiles management instructions for Claude AI **Model:** claude-\* (all Claude models) **Tone:** Blunt, | ||||||
| precise. `Result ∴ Cause`. Lists ≤7 | ||||||
| **Purpose:** Claude AI operational directives for dotfiles repo | ||||||
| **Model:** claude-\* (all) **Tone:** Blunt, precise. `Result ∴ Cause`. Lists ≤7 | ||||||
| **System:** YADM (`Home/`→`~/`) + Tuckr (`etc/`,`usr/`→`/`) | ||||||
| **Targets:** Arch (CachyOS), Debian, Termux | ||||||
| **Priority:** User>Rules. Verify>Assume. Edit>Create. Debt-First. | ||||||
|
|
||||||
| **System:** YADM (`Home/`→`~/`) + Tuckr (`etc/`,`usr/`→`/`). **Targets:** Arch (CachyOS), Debian, Termux. | ||||||
| **Directives:** User>Rules. Verify. Edit>Create (min Δ). Debt-First. | ||||||
| ## Core Standards | ||||||
|
|
||||||
| ## Standards | ||||||
| ### Bash | ||||||
| - **Header:** `#!/usr/bin/env bash` + `set -euo pipefail` | ||||||
| - **Idioms:** `[[ ]]`, `mapfile -t`, `local -n`, `printf`, `ret=$(fn)`, `${var}` | ||||||
| - **Ban:** `eval`, `ls` parse, backticks, unquoted vars | ||||||
| - **Packages:** `paru`→`yay` (Arch) | `apt` (Debian). Verify with `pacman -Q` first. | ||||||
|
|
||||||
| - **Bash:** `set -euo pipefail`. `#!/usr/bin/env bash`. | ||||||
| - _Idioms:_ `[[ regex ]]`, `mapfile -t`, `local -n`, `printf`, `ret=$(fn)`. | ||||||
| - _Ban:_ `eval`, `ls` parse, backticks. | ||||||
| - _Pkg:_ `paru`→`yay` (Arch) | `apt` (Debian). Check `pacman -Q` first. | ||||||
| - **Tools:** fd→find | rg→grep | bat→cat | sd→sed | aria2→curl | jaq→jq | rust-parallel. | ||||||
| - **Perf:** Batch I/O. Async. Anchor regex (`grep -F`). Cache hot data. | ||||||
| - **Protected:** `pacman.conf`, `.zshrc`, `.gitconfig`, `sysctl.d/`. | ||||||
| ### Tools (Prefer Modern) | ||||||
| fd→find | rg→grep | bat→cat | sd→sed | aria2→curl | jaq→jq | rust-parallel | ||||||
|
|
||||||
| ## Workflow | ||||||
| ### Performance | ||||||
| Batch I/O. Parallel ops. Anchor regex (`grep -F`). Cache hot paths. Single-pass parsing. | ||||||
|
|
||||||
| - **Cycle:** TDD (Red→Green→Refactor). Edit > Create. | ||||||
| - **Sync:** `yadm-sync.sh` (User). `tuckr set etc usr` (Sys). | ||||||
| - **CI:** `lint-format` (shfmt, shellcheck, biome, ruff, actionlint). | ||||||
| - **QA:** Shellcheck + Syntax verify before save. | ||||||
| ### Protected Files (Read-Only) | ||||||
| `pacman.conf`, `.zshrc`, `.gitconfig`, `sysctl.d/*.conf`, `paru.conf`, `makepkg.conf` | ||||||
|
|
||||||
| ## Key Assets | ||||||
| ## Git Workflow | ||||||
|
|
||||||
| - **Scripts (`~/.local/bin`):** | ||||||
| - _Sys:_ `pkgui` (TUI), `systool` (maint), `dosudo` (priv), `autostart`. | ||||||
| - _Media:_ `media-opt`, `ffwrap`, `wp`. | ||||||
| - _File/Net:_ `fzgrep`, `fzgit`, `netinfo`, `websearch`. | ||||||
| - _Dev:_ `yadm-sync`, `lint-format`. | ||||||
| - **Configs:** 88 total. Shells (Bash/Zsh/Fish), Terminals, Dev tools (VSCode/Git/Mise). | ||||||
| - **AI:** Claude (Agents/Cmds), Copilot, Gemini (`.gemini/`). | ||||||
| ### Branch Management | ||||||
| - **Develop on:** `claude/*` branches (e.g., `claude/optimize-claude-md-K4K9r`) | ||||||
| - **Never:** Push to `main`/`master` without explicit permission | ||||||
| - **Create:** `git checkout -b <branch>` if missing | ||||||
|
|
||||||
| ## Deployment | ||||||
| ### Commits | ||||||
| - **Message:** `<action>: <what> [why if non-obvious]` (e.g., `fix: quote vars in systool`) | ||||||
| - **Stage:** Selective (`git add <files>`). Never `-A` without review. | ||||||
| - **Verify:** `git status` + `git diff --staged` before commit | ||||||
|
|
||||||
| `yadm clone --bootstrap` → Install Pkgs → Deploy Home → Deploy Sys (Tuckr). | ||||||
| ### Push Protocol | ||||||
| - **Command:** `git push -u origin <branch-name>` | ||||||
| - **Retry:** 4× with backoff (2s, 4s, 8s, 16s) on network errors only | ||||||
| - **Validation:** Branch must start with `claude/` and match session ID | ||||||
|
||||||
| - **Validation:** Branch must start with `claude/` and match session ID | |
| - **Validation:** Branch name must start with `claude/` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency and precision, the retry instruction for 'Fetch/Pull' could specify the backoff times, similar to the 'Push Protocol' section. This ensures uniform behavior for network error handling across different Git operations.
| - **Retry:** 4× with backoff on network errors | |
| - **Retry:** 4× with backoff (2s, 4s, 8s, 16s) on network errors only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'Tool Priority' section introduces abstract tool names (e.g., Read tool, Grep/Glob tools). To enhance clarity and ensure the AI uses the intended modern tools, consider providing examples or direct mappings to the specific tools listed in the 'Tools (Prefer Modern)' section (e.g., bat for Read tool, rg for Grep tool). This would make the directives more actionable and reduce potential ambiguity.
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instruction specifies "Bash: ONLY for git, package managers, system commands" but then contradicts this in the decision tree at line 101 which says "Bash: git, paru/apt, systemctl, service management". The decision tree provides more specific guidance and should be aligned with the tool priority section. Either add "systemctl, service management" to line 54 or ensure both sections use identical language for consistency.
| 5. **Bash:** ONLY for git, package managers, system commands | |
| 5. **Bash:** git, paru/apt, systemctl, service management |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instruction "Read file FIRST (Edit/Write tools require it)" may not be technically accurate for all contexts. The Edit tool can work without first using Read if the file content is already known or if making targeted changes. Consider revising to "Read file FIRST when content is unknown or to verify current state" to be more precise.
| - **Always:** Read file FIRST (Edit/Write tools require it) | |
| - **Always:** Read file FIRST when content is unknown or to verify current state |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instruction "Edit: File exists in repo (99% of cases)" implies this is the default for almost all scenarios, but the guidance should be more nuanced. Claude should check if the file exists before deciding to edit vs create, not assume based on percentages. Consider revising to "Edit: When file exists in repo (always verify first)" to be more actionable.
| - **Edit:** File exists in repo (99% of cases) | |
| - **Edit:** When file exists in repo (always verify first) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The retry protocol specifies "4× with backoff" but this could lead to very long wait times (2+4+8+16 = 30 seconds total wait time plus actual operation time). For git operations in an interactive AI context, this may be excessive. Consider documenting whether Claude should inform the user about retry attempts, or if a shorter retry sequence would be more appropriate for the use case.