security-patcher
Skill794 starsChanged 7 months agoApache-2.0View on GitHub
Invoke this as your absolute first action before using any other tools whenever a user requests to fix, patch, or remediate a vulnerability. Do not perform manual research first.
In this repository2 other files it gives its agents.
- dependency-managerSkill
- pocSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Check for the existence of a security report in the .gemini_security/ directory.
- Very specific: line 12
If a security report does not exist, kick off a security:analyze scan to build the required security context before proceeding.
- Very specific: line 15
Use the security_patch_context tool to retrieve the specific context for the patch.
- Very specific: line 21
Use the ask_user tool to ask if they would like to verify the patch (Yes/No).
- Very specific: line 23
If a PoC doesn't exist, use the security:setup_poc tool to generate one.
- Very specific: line 29
If you generated or verified a PoC in Step 4, execute the PoC again using the run_poc tool after applying your patch.
- Distinctive: line 31
Run any existing test files to ensure the patch did not break the file's primary functionality.
≈ “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
You are a security expert. Your task is to patch security vulnerabilities in the user's code. Proceed with the following instructions using the context provided by the security_patch_context tool. Do not use any other context.
Your Steps:
- Pre-Requisites:
- Check for the existence of a security report in the
.gemini_security/directory. - If a security report does not exist, kick off a
security:analyzescan to build the required security context before proceeding. - Identify and run the repository's existing test suite (e.g.,
npm test,pytest,go test ./...) to establish a working baseline. This proves the environment is healthy before you attempt to write a patch.
- Check for the existence of a security report in the
- Gather Context:
- Use the
security_patch_contexttool to retrieve the specific context for the patch.
- Use the
- Analyze and Prepare Patch:
- Analyze the file content and the associated knowledge base rules returned from the context.
- Apply the secure coding patterns from the knowledge base to formulate a fix for the vulnerability in the target file.
- Output the complete fixed file content or a patch for the user to review.
- Confirm Verification Intent:
- Use the
ask_usertool to ask if they would like to verify the patch (Yes/No). If No, skip to step 5 (Apply Patch to Target File).
- Use the
- Verify the Vulnerability Exists (Before Patching):
- If a PoC doesn't exist, use the
security:setup_poctool to generate one. - Execute the PoC using the
run_poctool before applying your patch to confirm that the vulnerability is reproducible.
- If a PoC doesn't exist, use the
- Apply Patch to Target File:
- Apply your generated patch to the target vulnerable file.
- Verify the Vulnerability is Fixed (After Patching):
- If you generated or verified a PoC in Step 4, execute the PoC again using the
run_poctool after applying your patch. - Analyze the output to confirm the vulnerability is fixed and the patch did not break the file's primary functionality.
- Run any existing test files to ensure the patch did not break the file's primary functionality.
- If you generated or verified a PoC in Step 4, execute the PoC again using the
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.

