Skip to content
Skills Library
Security · Building & coding

threat-patch

/threat-patch

Remediate security findings by producing minimal, surgical code patches. Triggers on 'patch security findings', 'fix vulnerabilities', 'remediate findings', 'threat patch', or when the user provides a findings.json (from threat-model), a Codex security findings CSV, a THREAT-MODEL.md, or individual vulnerability descriptions and wants them fixed. Also trigger when reviewing code flagged by a security scanner and the user wants actionable fixes rather than just reports.

Repository
dot-skills ↗
Licence
MIT
Last repository change
15.08.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
9
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 15.08.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/parse-findings.sh

What it does and when to use it

Remediate security findings by producing minimal, surgical code patches. Triggers on 'patch security findings', 'fix vulnerabilities', 'remediate findings', 'threat patch', or when the user provides a findings.json (from threat-model), a Codex security findings CSV, a THREAT-MODEL.md, or individual vulnerability descriptions and wants them fixed. Also trigger when reviewing code flagged by a security scanner and the user wants actionable fixes rather than just reports.

Triggers from the description

patch security findingsfix vulnerabilitiesremediate findingsthreat patch
Original author description

Remediate security findings by producing minimal, surgical code patches. Triggers on 'patch security findings', 'fix vulnerabilities', 'remediate findings', 'threat patch', or when the user provides a findings.json (from threat-model), a Codex security findings CSV, a THREAT-MODEL.md, or individual vulnerability descriptions and wants them fixed. Also trigger when reviewing code flagged by a security scanner and the user wants actionable fixes rather than just reports.

How it works

  1. When to Apply
  2. Input Sources (priority order)
  3. Workflow Overview
  4. How to Use
  5. Key Principles
  6. Guardrails
  7. Output Modes
  8. References
Original SKILL.md headings · 84 lines, 704 words
SKILL.md preview
---
name: threat-patch
description: Remediate security findings by producing minimal, surgical code patches. Triggers on 'patch security findings', 'fix vulnerabilities', 'remediate findings', 'threat patch', or when the user provides a findings.json (from threat-model), a Codex security findings CSV, a THREAT-MODEL.md, or individual vulnerability descriptions and wants them fixed. Also trigger when reviewing code flagged by a security scanner and the user wants actionable fixes rather than just reports.
---
# Threat Patch

Reads security findings and produces minimal, surgical code patches with structured documentation. Fixes are code-grounded — each patch targets specific files and functions identified in the finding. Output includes a summary, validation steps, and the code changes.

## When to Apply

- User provides a `findings.json` (from threat-model) and wants fixes
- User provides a Codex security findings CSV and wants fixes
- User has a THREAT-MODEL.md and wants to remediate identified risks
- User describes a specific vulnerability and wants a patch
- Reviewing security scanner output and needs actionable fixes
- After a security audit, turning findings into code changes

## Input Sources (priority order)

| Source | What It Provides | How to Use |
|--------|-----------------|-----------|
| **findings.json** (from threat-model) | Structured findings with data flow traces, systemic groupings, exploit chains, and severity ratings | Read directly — richest input, already triaged and grouped |
| **Codex CSV** | Title, description, severity, relevant_paths per finding | Run `scripts/parse-findings.sh <csv-path>` to extract structured output |
| **THREAT-MODEL.md** | Human-readable threat model | Extract findings from Criticality Calibration section |
| **Inline description** | User describes a specific vulnerability | Parse from conversation context |

When `findings.json` is available, it's the preferred input — it includes data flow traces (entry → chain → sink) that directly inform where to apply fixes, and systemic groupings that suggest centralized fixes over individual patches.

## Workflow Overview

```
1. Ingest Findings   → Read findings.json / CSV / descriptions
2. Triage & Group    → Sort by severity, use systemic groupings if available
3. For each finding:
   a. Read Code      → Open relevant_paths, understand the pattern
   b. Confirm        → Verify issue is still present in HEAD
   c. Design Fix     → Determine minimal fix approach
   d. Implement      → Write the code changes
   e. Document       → Summary + Validation + Attack-path (if needed)
   f. Test           → Run relevant tests
4. Output            → Per-patch deliverable with summary and diff
5. Update State      → Mark patched findings in findings.json (if present)
```

## How to Use

1. Read [workflow](references/workflow.md) for the detailed patching methodology at each step
2. Read [fix patterns](references/fix-patterns.md) when designing fixes — common patterns by vulnerability class
3. Read [output format](references/output-format.md) for the documentation template per patch
4. If input is findings.json: read it directly — it's already structured
5. If input is Codex CSV: run `scripts/parse-findings.sh <csv-path>` to extract structured output

## Key Principles

- **Minimal diff**: Fix the vulnerability, don't refactor surrounding code. The smallest correct patch is the best patch
- **Centralize over duplicate**: When multiple code paths share the same vulnerability pattern, extract a shared helper rather than patching each site independently
- **Explicit error paths**: Add specific error types for rejected inputs with clear operator feedback, not silent failures or generic errors
- **Confirm before fixing**: Always verify the finding is still present in HEAD — code may have moved or been refactored since the finding was detected
- **User approval before edits**: Present the fix design (files to change, approach) and wait for approval before modifying source code. Hooks gate Edit/Write tool calls for additional safety
- **Document even failures**: When a fix can't be tested due to environment limitations, document the test command and the limitation

## Guardrails

This skill modifies source code. Safety measures:
- **PreToolUse hooks** on Edit and Write tools prompt for confirmation before each file change
- **Confirmation gate** in the workflow between fix design and implementation
- **Revert path**: Without commits (default), use `git checkout -- <files>` to undo. With commits, use `git revert`

## Output Modes

**Code patch** — when a fix is implemented:
- Summary of what was confirmed and what the fix does
- Testing section with build/test commands
- The actual code changes

**Analysis only** — when the fix needs user decision or architectural changes:
- Summary of what was confirmed
- Validation checklist
- Attack-path analysis (path, likelihood, impact, assumptions, controls, blindspots)

## References

| File | When to Read |
|------|-------------|
| [references/workflow.md](references/workflow.md) | Before starting — detailed approach for each patching phase |
| [references/fix-patterns.md](references/fix-patterns.md) | When designing fixes — patterns by vulnerability class |
| [references/output-format.md](references/output-format.md) | When documenting — templates for both output modes |
Files in this package (9)
  • SKILL.md 5 KB
  • config.json 1 KB
  • gotchas.md 1 KB
  • metadata.json 1 KB
  • hooks/hooks.json 1 KB
  • references/fix-patterns.md 10 KB
  • references/output-format.md 4 KB
  • references/workflow.md 11 KB
  • scripts/parse-findings.sh 3 KB

Versions

The database has no other skills named threat-patch.

Database snapshot: 13.11.2026 · package version 675cd41cfc3f (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90threat-model
    Use when Codex is already in the threat-modeling phase of a security scan, the user explicitly invokes $threat-model, or the user explicitly asks to create, update, or persist a repository threat model. Do not use as the primary trigger for full PR, commit, branch, patch, or repository scans.
  • 100threat-model
    Use when Codex is already in the threat-modeling phase of a security scan, the user explicitly invokes $threat-model, or the user explicitly asks to create, update, or persist a repository threat model. Do not use as the primary trigger for full PR, commit, branch, patch, or repository scans.
  • 100threat-model
    Use when Codex is already in the threat-modeling phase of a security scan, the user explicitly invokes $threat-model, or the user explicitly asks to create, update, or persist a repository threat model. Do not use as the primary trigger for full PR, commit, branch, patch, or repository scans.
  • 100fix
    This skill should be used when the user asks to "fix security finding", "fix vulnerability", "generate security fix", "appsec fix", "patch vulnerability", "remediate finding", or "apply security patch". Also triggers when the user references a finding ID (e.g., INJ-001) and asks…
  • 100threat-model-creator
    Create threat model creator operations. Auto-activating skill for Security Advanced. Triggers on: threat model creator, threat model creator Part of the Security Advanced skill category. Use when working with threat model creator functionality. Trigger with phrases like "threat…
  • 90security-threat-model-and-design
    Assess and remediate threat models, abuse cases, architecture and secure design reviews in frontend and associated web services. Use for threat model, trust boundary, abuse case, design review, security architecture.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.