feat(claude): random improvements

This commit is contained in:
Barrett Ruth 2026-03-06 16:39:23 -05:00
parent 44b9ac8a7e
commit 2c4ff5cb8c
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
5 changed files with 34 additions and 12 deletions

View file

@ -10,7 +10,9 @@ requests unless explicitly specified.
If given express permission to use git, NEVER sign yourself as a contributor OR mention yourself in the PR.
If given express permission to use git, NEVER push to a main/master branch.
If given express permission to use git, NEVER push to a main/master branch. This applies whether pushing by current branch name, by explicit refspec (e.g. `git push origin main`), or via `HEAD:main`. The hook will block you — do not attempt workarounds.
If given express permission to use git, if GPG signing fails for any reason, always retry with `--no-gpg-sign` rather than stopping or asking.
If given express permission to use git, NEVER commit ai-related files (e.g. CLAUDE.md).

View file

@ -4,17 +4,16 @@ set -euo pipefail
INPUT=$(cat)
CMD=$(printf '%s' "$INPUT" | jq -r '.tool_input.command // empty')
if printf '%s' "$CMD" | grep -qE '\bgh\b.*\s(-R|--repo)\b'; then
echo "Blocked: do not target other repos with -R/--repo. Run gh commands against the current repo only." >&2
exit 2
fi
if printf '%s' "$CMD" | grep -qE '\bgit\s+push\b'; then
BRANCH=$(git branch --show-current 2>/dev/null || true)
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
echo "Blocked: never push directly to $BRANCH. Use a feature branch." >&2
exit 2
fi
if printf '%s' "$CMD" | grep -qE '\bgit\s+push\b.*\b(main|master)\b'; then
echo "Blocked: never push to main/master by name. Use a feature branch." >&2
exit 2
fi
fi
exit 0

View file

@ -82,6 +82,21 @@ If no template exists, fall back to:
Write concise prose. No bullet-point walls, no verbose AI-style markdown.
Use backticks for code references.
## Post-PR Steps
After creating a PR, immediately:
1. Fetch upstream: `git fetch origin`
2. Check for conflicts between your branch and `origin/main`:
`git merge-tree $(git merge-base HEAD origin/main) HEAD origin/main`
3. If conflicts exist, rebase or merge `origin/main` into the branch and resolve
them before considering the PR done.
## GPG Signing
If GPG signing fails for any reason, retry the commit or push with
`--no-gpg-sign` rather than stopping.
## Decomposition Rules
- One logical change per commit.

View file

@ -41,7 +41,13 @@ Create a pull request from the current branch.
If it fails, show the output and stop. Do NOT create the PR.
5. Run exactly one Bash command:
5. Push the branch:
```
git push -u origin HEAD
```
If GPG signing fails, retry with `--no-gpg-sign`.
6. Run exactly one Bash command:
```
gh pr create --title "<title>" --body "$(cat <<'EOF'
<body here>
@ -50,8 +56,8 @@ Create a pull request from the current branch.
```
Print the PR URL from the output.
Total: 2 Bash calls (gather + create), or 3 if CI ran. Do not run any other
commands. Do not read files, explore code, or run additional git commands beyond
what is listed above.
Total: 3 Bash calls (gather + push + create), or 4 if CI ran. Do not run any
other commands. Do not read files, explore code, or run additional git commands
beyond what is listed above.
Never force-push, even with lease. Never target main/master as the head branch.

View file

@ -171,7 +171,7 @@ in
on-click-right = "ctl audio sink";
on-click-middle = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
tooltip = true;
tooltip-format = "Audio Sink: {node_name}\nVolume: {volume}%";
tooltip-format = "Volume: {volume}%";
};
"wireplumber#source" = {
@ -196,7 +196,7 @@ in
on-click-right = "ctl audio source";
on-click-middle = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
tooltip = true;
tooltip-format = "Audio Source: {node_name}\nVolume: {volume}%";
tooltip-format = "Volume: {volume}%";
};
network = {