security-fix
Skill4 starsChanged 14 days agoMITView on GitHub
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".
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- glowingkitty/OpenMatestheir own version, first seen Nov 9, 2026
- ceptln/quota-burnertheir own version, first seen Sep 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- glowingkitty/OpenMates★ 53same name
- ceptln/quota-burner★ 18same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- changesetsSkill
- goal-debateSkill
- parallel-roadmapSkill
- perf-passSkill
- plain-writingSkill
- pr-authorSkill
- pr-reviewSkill
- repo-setupSkill
- ts-styleSkill
- ui-styleSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 9 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Never push the fix branch to any remote.
- Distinctive: line 13
Never open a pull request, issue or public comment about the vulnerability.
- Distinctive: line 14
Never publish manually. CI publishes once the release branch is pushed.
- Distinctive: line 15
Keep commit messages and changelog lines plain (for example, "fix: harden input validation in X").
- Distinctive: line 37
Remove proof-of-concept code, payloads, exact requests, step-by-step reproduction, the vulnerable file and line, internal hosts and paths, …
- Very specific: line 38
Update the draft with gh api -X PATCH repos/{owner}/{repo}/security-advisories/{ghsa_id} -F description=@<file>.
- Very specific: line 40
Update the local <release-branch> from the remote (git fetch origin && git switch <release-branch> && git merge --ff-only …
- Very specific: line 41
Create a local-only branch from <release-branch>, for example security/<short-name>.
- Very specific: line 52
When core.hooksPath is set (husky and similar tools), git ignores .git/hooks, and the hooks folder is usually tracked.
- Distinctive: line 54
When it reproduces, leave a comment on the advisory.
- Distinctive: line 55
When it does not reproduce, do not start a fix.
- Very specific: line 60
Check that .changeset/ on <release-branch> has no other pending changesets.
- Very specific: line 61
Check .changeset/pre.json for prerelease mode, which changes the version the bump produces.
- Very specific: line 62
Run pnpm changeset (patch) and then pnpm changeset version, so the bumped package.json and the CHANGELOG.md entry are committed and no …
- Distinctive: line 63
Check that the release workflow can publish with provenance.
- Distinctive: line 68
If any is missing, stop and tell the user.
- Very specific: line 73
Remove the pre-push check added in step 5 and delete the local branch (git branch -D security/<short-name>).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security fix
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.
Rules
- Never push the fix branch to any remote.
- Never open a pull request, issue or public comment about the vulnerability. Comments on the draft advisory are private to its collaborators, so they are the place for the details.
- Never publish manually. CI publishes once the release branch is pushed.
- Keep commit messages and changelog lines plain (for example, "fix: harden input validation in X"). The details go in the advisory, not in git.
Found during other work
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.
Working with others
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.
Steps
- Find the release branch: the branch whose push triggers the publishing workflow. Read the
on.push.branchestrigger of the release workflow in.github/workflows/(for examplemain,nextorrelease/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-advisoriesor 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.
- Post the original description as a comment on the advisory first, so the details stay with the collaborators. Quote it in full and say it is the reporter's original text.
- Rewrite the description with the plain-writing skill, under these headings:
- Summary: one or two sentences on the vulnerability class (the CWE) and the affected package.
- Impact: who is affected and what an attacker can do, in general terms.
- Affected versions and Patches: the vulnerable range and the patched version once it exists.
- Workarounds: what users can do before they upgrade, or "None".
- References: the CVE and links that are already public.
- Remove proof-of-concept code, payloads, exact requests, step-by-step reproduction, the vulnerable file and line, internal hosts and paths, and any secret or token.
- Update the draft with
gh api -X PATCH repos/{owner}/{repo}/security-advisories/{ghsa_id} -F description=@<file>. Write<file>to a temporary folder outside the repo. - Post the comment with
gh api repos/{owner}/{repo}/security-advisories/{ghsa_id}/comments -F body=@<file>. Fix a comment withgh 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 examplesecurity/<short-name>. Do not set an upstream for it. Then guard it against pushes:When
git config core.hooksPathprints nothing, add a pre-push hook to.git/hooks/pre-pushthat refusesrefs/heads/security/*. It blocksgit push,git push --allandgit push --mirrorof the branch, and still lets<release-branch>push after the merge. If apre-pushhook 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 doneMake it executable with
chmod +x.- When
core.hooksPathis 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.- When it reproduces, leave a comment on the advisory. Say the vulnerability is confirmed, name the version and commit, and say a fix is in progress. Post it the same way as the comment of step 3.
- When it does not reproduce, do not start a fix. Tell the user, and ask the reporter for the missing details in an advisory comment.
- Reject the advisory when it still does not reproduce consistently after the reporter answers, or when it does not merit an advisory. A normal bug with no security impact does not merit one. Neither does documented behavior, or an attack that needs access the attacker already has.
- To reject, ask the user first. Then leave a comment that says why the advisory is rejected, and close it with
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:- Check that
.changeset/on<release-branch>has no other pending changesets. If it does, ask the user whether to release those first or include them. - Check
.changeset/pre.jsonfor prerelease mode, which changes the version the bump produces. - Run
pnpm changeset(patch) and thenpnpm changeset version, so the bumpedpackage.jsonand theCHANGELOG.mdentry are committed and no.changeset/*.mdfile remains.
- Check that
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:
- the publishing job has
permissions: id-token: write - it publishes with
--provenance,NPM_CONFIG_PROVENANCE=true, or the package has"publishConfig": { "provenance": true } - it authenticates with an npm token secret or npm trusted publishing
If any is missing, stop and tell the user. Do not fix the workflow in the same push.
- the publishing job has
- 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 withgh 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 underback_mergebypython3 <skills>/pr-review/scripts/branch_policy.py, for examplenextthendev. 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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

