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.
This commit is contained in:
@@ -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:
|
||||
<type>(<scope>): <description>
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user