Skip to content

Comments

fix(create-pr): Split compound shell command into parseable steps#60

Merged
JoshFerge merged 1 commit intomainfrom
fix/create-pr-parseable-commands
Feb 19, 2026
Merged

fix(create-pr): Split compound shell command into parseable steps#60
JoshFerge merged 1 commit intomainfrom
fix/create-pr-parseable-commands

Conversation

@JoshFerge
Copy link
Member

The create-pr skill's Step 1 used BASE=$(gh repo view ...) — a compound
shell 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 view command lets Claude Code see
each command individually. Claude can then match it against a simple
Bash(gh repo view*) allow pattern in settings.json, and future UX
improvements 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 clean
and allowable too.

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>
@JoshFerge JoshFerge marked this pull request as ready for review February 19, 2026 22:01
@JoshFerge JoshFerge requested a review from cleptric February 19, 2026 22:01
@JoshFerge
Copy link
Member Author

confirmed this worked during the making of this PR :D

@JoshFerge JoshFerge merged commit f9a86fd into main Feb 19, 2026
10 checks passed
@JoshFerge JoshFerge deleted the fix/create-pr-parseable-commands branch February 19, 2026 22:02
Comment on lines 34 to +35
git status
git log $BASE..HEAD --oneline
git log BASE..HEAD --oneline
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's an AI so it will know to substitute BASE for what we ran above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants