meta: Add hook to auto-add Linear issue links#1131
Conversation
Add a `commit-msg` `pre-commit` hook that expands GitHub issue footers into markdown links and appends a matching Linear footer when GitHub comments include a linked Linear issue. Running this as a hook ensures footer expansion happens for both agent-written and manually-written commit messages. Add a commit agent skill that fetches Sentry commit guidelines before creating or amending commits and documents the footer format expected by the hook. I have been using a similar [commit skill](https://github.com/szokeasaurusrex/pi-agent/blob/85d169d0022f31c46cf7821e2f176bd739b1b2a2/skills/commit/SKILL.md) locally; this checks it into this repo with modifications for the new `pre-commit` hook. ### Examples A footer for [#1](#1): ``` References #1 ``` becomes: ``` References [#1](#1) ``` A footer for [#1130](#1130), which has a Linear linkback to [RUST-216](https://linear.app/getsentry/issue/RUST-216): ``` References #1130 ``` becomes: ``` References [#1130](#1130) References [RUST-216](https://linear.app/getsentry/issue/RUST-216) ```
There was a problem hiding this comment.
This script is admittedly 100% vibe-coded 🤖
I have skimmed the script, and it looks reasonable, but did not fully read it. In my limited testing, it appears to work. Given that this is only used as a pre-commit script, I think that should be okay; we can fix bugs as they are discovered.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7b4b827. Configure here.
lcian
left a comment
There was a problem hiding this comment.
Sounds good, but not sure how the agent is supposed to know which issue we're working on unless you include it in the prompt at some point.
My typical workflow involves telling the agent to "work on #XYZ" so usually it knows already. But yeah, that is of course a limitation; at some point you need to tell the agent what issue you are working on |

Add a
commit-msgpre-commithook that expands GitHub issue footers into markdown links and appends a matching Linear footer when GitHub comments include a linked Linear issue. Running this as a hook ensures footer expansion happens for both agent-written and manually-written commit messages.Add a commit agent skill that fetches Sentry commit guidelines before creating or amending commits and documents the footer format expected by the hook. I have been using a similar commit skill locally; this checks it into this repo with modifications for the new
pre-commithook.Examples
A footer for getsentry/sentry-rust#1:
becomes:
A footer for getsentry/sentry-rust#1130, which has a Linear linkback to RUST-216:
becomes: