Threat patch

From pproenca/dot-skills · View interactive version

Threat patch is an AI agent skill from the GitHub repository pproenca/dot-skills. 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

How to use this skill

Skill file

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

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 for the detailed patching methodology at each step
  2. Read fix patterns when designing fixes — common patterns by vulnerability class
  3. Read output format 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

Guardrails

This skill modifies source code. Safety measures:

Output Modes

Code patch — when a fix is implemented:

Analysis only — when the fix needs user decision or architectural changes:

References

| File | When to Read |

|------|-------------|

| references/workflow.md | Before starting — detailed approach for each patching phase |

| references/fix-patterns.md | When designing fixes — patterns by vulnerability class |

| references/output-format.md | When documenting — templates for both output modes |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.