I'd like to use claude's /security-review command ...
# how-do-i
j
I'd like to use claude's /security-review command (blog post), but the source prompt is not compatible with non-base branches in graphite stacks since it uses the following commands to get the diffs to review.
Copy code
FILES MODIFIED:
!
git diff --name-only origin/HEAD...
Copy code
COMMITS:
!
git log --no-decorate origin/HEAD...
Copy code
DIFF CONTENT:
!
git diff --merge-base origin/HEAD
`````` We could of course fork this prompt, but ideally we don't have to do that so we can automatically benefit from any updates that the anthropic team pushes. Has anyone else found a simple workaround for this / other workflows that aren't natively graphite compatible?
p
(If applicable) To help us more clearly understand what you're trying to do, please provide additional details about: - Screenshots / debug logs / list of commands you've tried to run so far - Your workflow - Current state
a
yea - we have run into similar issues with things like path filtering (e.g. only run frontend tests on PRs with just frontend changes). Figuring out if a PR in stack somewhere has frontend only changes is a bit tough since you have to compare to the previous PR not the base of the stack/previous commit/main/whatever (things CircleCI natively supports) the gist of it is we use the github api to fetch the correct base revision for each PR so that things run just on the changes in a PR. for this specifically i'm not quite sure since the git commands are fixed - you might be able to lie to claude in your own prompt and tell it to
origin/HEAD
is actually something else. But yes - it would be nice if there was some native functionality or even best practices doc for "run stuff on just the changes in this graphite PR"
➕ 1
👀 1
j
@Pylon is there someone from the graphite team that could respond?