fix(create-pr): Split compound shell command into parseable steps#60
Merged
fix(create-pr): Split compound shell command into parseable steps#60
Conversation
Replace the BASE=$(...) shell substitution with a standalone gh repo view command so Claude Code can parse and pattern-match it for permission allow-listing. Subsequent git commands now use a placeholder (BASE) that the agent substitutes with the actual branch name, keeping each command clean and individually allowable. Co-Authored-By: Claude <noreply@anthropic.com>
cleptric
approved these changes
Feb 19, 2026
Member
Author
|
confirmed this worked during the making of this PR :D |
Comment on lines
34
to
+35
| git status | ||
| git log $BASE..HEAD --oneline | ||
| git log BASE..HEAD --oneline |
There was a problem hiding this comment.
Bug: The create-pr skill uses the literal string "BASE" in git commands, expecting an AI to substitute it. This will fail at runtime as "BASE" is not a valid git revision.
Severity: CRITICAL
Suggested Fix
Revert to using standard bash variable substitution. Define the base branch using a command like BASE=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name) and then use the $BASE variable in subsequent git commands to ensure a valid branch name is used.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: plugins/sentry-skills/skills/create-pr/SKILL.md#L34-L35
Potential issue: The `create-pr/SKILL.md` file was updated to use the literal string
`"BASE"` as a placeholder in `git log BASE..HEAD` and `git diff BASE...HEAD` commands.
The skill's instructions direct an AI agent to substitute this placeholder with a branch
name derived from a previous command. However, this substitution mechanism is not
supported. As a result, the `git` commands will be executed literally, causing them to
fail at runtime with a `fatal: ambiguous argument 'BASE': unknown revision` error. This
breaks the `create-pr` skill.
Did we get this right? 👍 / 👎 to inform future reviews.
Member
Author
There was a problem hiding this comment.
it's an AI so it will know to substitute BASE for what we ran above
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
create-prskill's Step 1 usedBASE=$(gh repo view ...)— a compoundshell expression that Claude Code cannot parse for permission matching. This
means users always get a permission prompt and cannot add an "always allow"
entry for it.
Splitting it into a standalone
gh repo viewcommand lets Claude Code seeeach command individually. Claude can then match it against a simple
Bash(gh repo view*)allow pattern in settings.json, and future UXimprovements could offer "always allow" at the prompt itself.
Subsequent git commands now receive the branch name as a literal substitution
(e.g.
git log main..HEAD) rather than a shell variable, keeping them cleanand allowable too.