/agent-skills:security-fixfrom agent-skills
Fix a security vulnerability without leaking it before the release. Work happens on a local-only branch that is never pushed, then merges straight into the branch the release workflow publishes from. The fix becomes public at the same moment CI publishes the release, so the package keeps npm provenance. Use this skill whenever the user asks to fix a security issue, vulnerability, advisory, CVE or GHSA, or when other work finds one, even if they do not say "security-fix".
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The fix must not be public before the release ships, and the release must still go through CI so it keeps its provenance attestation. A manual npm publish drops provenance, and package managers with trust policies (pnpm trustPolicy: no-downgrade) then refuse to install the version.
A subagent that finds a vulnerability, such as a roadmap worker or a pr-author or pr-review run, does not fix it in its own branch. It does not push anything about it either. It stops and reports the finding to the orchestrator, which tells the user. The fix then starts at step 1 of this skill.
When the reporter or a co-maintainer works on the fix too, use the advisory's temporary private fork in place of the local-only branch. A draft GitHub Security Advisory has a "Start a temporary private fork" button. GitHub Actions do not run in that fork, so the local checks of step 7 are still the only verification. Merging the fork's pull request publishes the fix. Merge only when it holds the version bump of step 8 and step 9 passed. The rest of the steps still apply.
Find the release branch: the branch whose push triggers the publishing workflow. Read the on.push.branches trigger of the release workflow in .github/workflows/ (for example main, next or release/1.x). If several branches qualify, or the affected version line is released from a maintenance branch, ask the user which one to use. The steps below call it <release-branch>.
Draft the GitHub Security Advisory if none exists yet (gh api repos/{owner}/{repo}/security-advisories or the Security tab), and request a CVE on the draft. A draft stays private. The CVE can take a few days, so ask for it before the release, not after.
Review the advisory description. The description is published with the advisory, so it must not teach anyone how to exploit the vulnerability. A description from the reporter often does.
gh api -X PATCH repos/{owner}/{repo}/security-advisories/{ghsa_id} -F description=@<file>. Write <file> to a temporary folder outside the repo.gh api repos/{owner}/{repo}/security-advisories/{ghsa_id}/comments -F body=@<file>. Fix a comment with gh api -X PATCH repos/{owner}/{repo}/security-advisories/{ghsa_id}/comments/{comment_id} -F body=@<file>.Update the local <release-branch> from the remote (git fetch origin && git switch <release-branch> && git merge --ff-only origin/<release-branch>).
Create a local-only branch from <release-branch>, for example security/<short-name>. Do not set an upstream for it. Then guard it against pushes:
When git config core.hooksPath prints nothing, add a pre-push hook to .git/hooks/pre-push that refuses refs/heads/security/*. It blocks git push, git push --all and git push --mirror of the branch, and still lets <release-branch> push after the merge. If a pre-push hook already exists, add the check at its top instead of replacing it.
#!/bin/sh
while read local_ref local_sha remote_ref remote_sha; do
case "$local_ref" in refs/heads/security/*) echo "pre-push: refusing to push $local_ref" >&2; exit 1;; esac
done
Make it executable with chmod +x.
When core.hooksPath is set (husky and similar tools), git ignores .git/hooks, and the hooks folder is usually tracked. Do not write there. Tell the user the branch has no push guard.
Confirm the vulnerability on the branch. Write a test that reproduces it on the code of <release-branch> and check that the test fails. This test becomes the regression test of step 7.
gh api -X PATCH repos/{owner}/{repo}/security-advisories/{ghsa_id} -f state=closed. Delete the local branch and the pre-push check of step 5. A normal bug can then go through a public issue or pull request, without the reporter's exploit details.Apply the fix and keep the regression test of step 6 on that branch. Run the project's checks locally (build, typecheck, tests). CI does not see the code before the merge, so this is the only verification.
Bump the version on the branch so pushing <release-branch> publishes right away instead of opening a version PR. In a repo that uses changesets:
.changeset/ on <release-branch> has no other pending changesets. If it does, ask the user whether to release those first or include them..changeset/pre.json for prerelease mode, which changes the version the bump produces.pnpm changeset (patch) and then pnpm changeset version, so the bumped package.json and the CHANGELOG.md entry are committed and no .changeset/*.md file remains.Check that the release workflow can publish with provenance. A publish that fails after the push leaves the fix public with no release. In the release workflow:
permissions: id-token: write--provenance, NPM_CONFIG_PROVENANCE=true, or the package has "publishConfig": { "provenance": true }If any is missing, stop and tell the user. Do not fix the workflow in the same push.
Merge the branch into the local <release-branch> (fast-forward when possible).
Confirm with the user, then push <release-branch> (git push origin <release-branch>). This is the moment the fix becomes public, and it triggers the release workflow. Before pushing, check the repo visibility with gh repo view --json visibility. Do not push when the repo is private, because Actions minutes are billed. Ask the user instead.
Watch the release run and confirm the new version is on the registry with provenance (npm view <pkg>@<version> dist.attestations). The registry can lag a few minutes after a publish.
Publish the advisory with the patched version in it, or remind the user to publish it.
Remove the pre-push check added in step 5 and delete the local branch (git branch -D security/<short-name>).
In a repo with several integration branches (gitflow), merge <release-branch> back into the branches listed under back_merge by python3 <skills>/pr-review/scripts/branch_policy.py, for example next then dev. The fix is public now, so these can go through normal pull requests. Other supported version lines, such as a maintenance branch, need their own run of this skill. Tell the user which ones.
What SKILL.md sets; muted values are Claude Code's defaults
17 skills in this plugin
/changesetsWrite the changeset for a change in a repo that releases with changesets (a `.changeset/` folder exists). The bump level follows one question, whether the thing existed before: patch for changed behavior, minor for something new, major only with the maintainer's approval. Use this skill whenever finishing a change, opening a pull request or reviewing one in such a repo, even when nobody asks for a changeset, and when the user asks about bump levels or changelog entries./docs-siteMethod for planning, writing and maintaining a documentation site for a library, CLI, framework, API or app. Splits the site by what the reader needs (learn, do a task, understand, look up) into getting started, guides, concepts and reference, plus examples, troubleshooting, migration and a glossary. Gives each page type a fixed template, including the feature page (what it is, why, how it works, usage, options, limits, related) and the API reference entry. Covers navigation, code examples that run, keeping docs in step with the code, versioned docs and pages agents can read. Includes page templates, a checker script for page structure, links, orphan pages and code fences, and a review checklist. Use this skill whenever writing, restructuring, auditing or reviewing documentation, a docs site, a docs page, a README that has grown into docs, API reference, a getting started page, a migration guide or the docs part of the website/ folder, even if the user does not say "docs site". Load plain-writing with it.npx claudepluginhub lxsmnsyc/agent-skills --plugin agent-skillsOther plugins' skills for the same job