From 85b7d2548623f004f73a291e9c4f79fc46e0c329 Mon Sep 17 00:00:00 2001 From: 0xWheatyz Date: Mon, 16 Mar 2026 18:58:12 -0400 Subject: [PATCH] feat(claude): add CLAUDE.md, commit command, and update permissions Add home-manager managed CLAUDE.md with commit behavior instructions, a /commit slash command for conventional commits workflow, and expand allowed Bash permissions to include nix commands. Remove inline customInstructions in favor of CLAUDE.md file. --- home.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/home.nix b/home.nix index a89fb1c..a2fb6f4 100644 --- a/home.nix +++ b/home.nix @@ -177,6 +177,46 @@ programs.neovim-kickstart.enable = true; # Claude Code configuration + home.file.".claude/CLAUDE.md" = { + text = '' + ## Commit Behavior + + After completing each logical unit of work, use the /commit skill to stage + and commit changes before proceeding to the next task. Do not batch unrelated + changes into a single commit. Do not wait to be asked. + ''; + force = true; + }; + + home.file.".claude/commands/commit.md" = { + text = '' + --- + description: Stage and commit changes as a conventional commit with one logical unit per commit + --- + + Review the current working tree with `git status` and `git diff --staged` and `git diff`. + + Then do the following: + + 1. Identify the smallest logical unit of change present. If multiple unrelated changes exist, only stage and commit one unit at a time — leave the rest unstaged. + + 2. Stage only the files (or hunks via `git add -p`) relevant to that logical unit. + + 3. Write a commit message following the Conventional Commits format: + (): + + Types: feat, fix, docs, style, refactor, perf, test, chore, ci + - scope is optional but use it when the change is clearly scoped to a module, package, or domain + - description: lowercase, imperative mood, no trailing period, max ~72 chars + - if the change warrants a body, add it after a blank line + + 4. Run `git commit` with that message. Never use `--no-verify`. + + 5. Report what was committed and what (if anything) remains uncommitted. + ''; + force = true; + }; + home.file.".claude/settings.json" = { text = builtins.toJSON { permissions = { @@ -184,9 +224,11 @@ "Edit" "Write" "Bash(git:*)" - ]; + "Bash(nix-shell:*)" + "Bash(nix eval:*)" + "Bash(nix flake check:*)" + ]; }; - customInstructions = "When working in a git repository, always use conventional commits format (e.g., feat:, fix:, docs:, style:, refactor:, test:, chore:) for commit messages. Do not include the Claude Code signature or Co-Authored-By line in commit messages."; alwaysThinkingEnabled = true; includeCoAuthoredBy = false; };