pr-security-review/SKILL.md
Use when the user wants a security-focused review pass on a PR with findings actioned as commits on the same branch. Trigger phrases - "/pr-security-review", "security review and fix".
npx skillsauth add paulund/ai pr-security-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Security-focused review of a PR's diff, with findings actioned as commits on the same branch.
When invoked with arguments, the first line of the prompt may carry a context envelope as JSON:
{ "pr": 123, "branch": "agent/issue-582-foo" }
gh pr view <pr> --json number,title,body,headRefName,baseRefName
gh pr diff <pr>
Read the full diff. Note any imports, framework patterns, and existing security utilities (sanitizers, rate-limiters, auth middleware) referenced.
Identify the data flow boundaries the change touches:
getServerSession, middleware checks, RLS policies, RBAC decisionsIf the diff doesn't touch any of these, report no security-relevant changes and exit at Step 5.
Examine each modified file for the categories below. Trace data flow from the entry point to each sink.
Only flag findings where you are >80% confident of actual exploitability. Severity rubric:
Do NOT flag:
For every HIGH and MEDIUM finding: fix the code in this run. Do not defer.
For LOW findings: fix if trivial. Defer only if genuinely out of scope; create a tracking issue in that case:
gh issue create \
--title "security: <short description>" \
--body "Deferred from PR #<N> security review — accepted as-is because <reason>." \
--label "security,planned,afk"
git add <files>
git commit -m "Security review: <one-line summary>"
git push origin HEAD
gh pr comment <pr> --body "$(cat <<EOF
## Security review
### Fixed
- [HIGH/MEDIUM/LOW | file:line | category | what was wrong → how it was fixed]
### Deferred (LOW only)
- [item — reason — tracked in #N]
EOF
)"
{ "pr": <N>, "findings": <count>, "fixed": <count>, "deferred": <count> }
security label.quality-gate's job.development
Use when implementing any logic, fixing any bug, or changing any behaviour. Use when you need to prove code works, when a bug report arrives, or when modifying existing functionality. Do NOT use for config changes, data migrations, or dependency updates.
development
Use when starting a new feature, when requirements are unclear, when asked to write code without a clear spec, or before any non-trivial implementation. Do NOT use for trivial bug fixes or one-line changes.
development
Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters. Detects the stack from dependency files, fetches official documentation, implements following documented patterns, and cites sources for every framework-specific decision.
development
Use when preparing to ship a feature, release, or deployment. Use before merging to main, creating a release, or deploying to production. Do NOT use for CI-only changes or internal refactors that don't reach production.