feat(claude): random improvements
This commit is contained in:
parent
44b9ac8a7e
commit
2c4ff5cb8c
5 changed files with 34 additions and 12 deletions
|
|
@ -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 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).
|
If given express permission to use git, NEVER commit ai-related files (e.g. CLAUDE.md).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,16 @@ set -euo pipefail
|
||||||
INPUT=$(cat)
|
INPUT=$(cat)
|
||||||
CMD=$(printf '%s' "$INPUT" | jq -r '.tool_input.command // empty')
|
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
|
if printf '%s' "$CMD" | grep -qE '\bgit\s+push\b'; then
|
||||||
BRANCH=$(git branch --show-current 2>/dev/null || true)
|
BRANCH=$(git branch --show-current 2>/dev/null || true)
|
||||||
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
|
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
|
||||||
echo "Blocked: never push directly to $BRANCH. Use a feature branch." >&2
|
echo "Blocked: never push directly to $BRANCH. Use a feature branch." >&2
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,21 @@ If no template exists, fall back to:
|
||||||
Write concise prose. No bullet-point walls, no verbose AI-style markdown.
|
Write concise prose. No bullet-point walls, no verbose AI-style markdown.
|
||||||
Use backticks for code references.
|
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
|
## Decomposition Rules
|
||||||
|
|
||||||
- One logical change per commit.
|
- One logical change per commit.
|
||||||
|
|
|
||||||
|
|
@ -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.
|
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'
|
gh pr create --title "<title>" --body "$(cat <<'EOF'
|
||||||
<body here>
|
<body here>
|
||||||
|
|
@ -50,8 +56,8 @@ Create a pull request from the current branch.
|
||||||
```
|
```
|
||||||
Print the PR URL from the output.
|
Print the PR URL from the output.
|
||||||
|
|
||||||
Total: 2 Bash calls (gather + create), or 3 if CI ran. Do not run any other
|
Total: 3 Bash calls (gather + push + create), or 4 if CI ran. Do not run any
|
||||||
commands. Do not read files, explore code, or run additional git commands beyond
|
other commands. Do not read files, explore code, or run additional git commands
|
||||||
what is listed above.
|
beyond what is listed above.
|
||||||
|
|
||||||
Never force-push, even with lease. Never target main/master as the head branch.
|
Never force-push, even with lease. Never target main/master as the head branch.
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ in
|
||||||
on-click-right = "ctl audio sink";
|
on-click-right = "ctl audio sink";
|
||||||
on-click-middle = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
on-click-middle = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||||
tooltip = true;
|
tooltip = true;
|
||||||
tooltip-format = "Audio Sink: {node_name}\nVolume: {volume}%";
|
tooltip-format = "Volume: {volume}%";
|
||||||
};
|
};
|
||||||
|
|
||||||
"wireplumber#source" = {
|
"wireplumber#source" = {
|
||||||
|
|
@ -196,7 +196,7 @@ in
|
||||||
on-click-right = "ctl audio source";
|
on-click-right = "ctl audio source";
|
||||||
on-click-middle = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
on-click-middle = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
||||||
tooltip = true;
|
tooltip = true;
|
||||||
tooltip-format = "Audio Source: {node_name}\nVolume: {volume}%";
|
tooltip-format = "Volume: {volume}%";
|
||||||
};
|
};
|
||||||
|
|
||||||
network = {
|
network = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue