|
1 | 1 | # patchman |
2 | 2 |
|
3 | 3 | [](https://github.com/MuhammedZohaib/patchman) |
4 | | -[](https://github.com/MuhammedZohaib/patchman) |
5 | | -[](./LICENSE) |
6 | 4 | [](https://github.com/MuhammedZohaib/patchman/releases) |
| 5 | +[](./LICENSE) |
7 | 6 |
|
8 | | -Defensive security audit skills for agentic code review and web application assessment. |
9 | | - |
10 | | -`patchman` is a Claude/Codex-style skill and plugin bundle for authorized security reviews. It stays in read-first, review-first mode by default, inspects code and architecture against OWASP and common appsec failure patterns, and produces structured findings with remediation guidance instead of offensive playbooks. |
11 | | - |
12 | | -## What It Is |
13 | | - |
14 | | -- A reusable skill pack for secure code review, API review, auth review, business-logic review, PR diff review, and quick triage. |
15 | | -- A plugin bundle that mirrors Caveman’s distribution shape: repo-level metadata, installable plugin packaging, top-level skills, mirrored plugin-level skills, commands, hooks, docs, evals, rules, and release automation. |
16 | | -- A defensive review copilot that helps engineers find high-value vulnerabilities early and explain fixes clearly. |
17 | | - |
18 | | -## What It Catches |
19 | | - |
20 | | -- OWASP Top 10 classes with emphasis on exploitability and code evidence |
21 | | -- Broken authentication and authorization flows |
22 | | -- Session, cookie, and token handling flaws |
23 | | -- Business logic gaps, approval bypasses, and abuse-case failures |
24 | | -- IDOR and tenant-isolation bugs |
25 | | -- Unsafe file upload, SSRF, XSS, CSRF, injection, and insecure deserialization risks |
26 | | -- Secret handling mistakes and sensitive logging |
27 | | -- Insecure defaults, weak headers, and risky crypto choices |
28 | | -- Rate limiting and anti-abuse gaps |
29 | | -- ORM misuse, N+1 query smells, and security-adjacent data-access regressions |
30 | | -- Admin path, migration, webhook, queue, and background-job hazards |
| 7 | +Defensive security audit skill pack for agentic code review and web application assessment. |
31 | 8 |
|
32 | | -## Review Modes |
| 9 | +--- |
33 | 10 |
|
34 | | -- `full security audit` |
35 | | -- `auth-only review` |
36 | | -- `business-logic review` |
37 | | -- `API review` |
38 | | -- `ORM / N+1 / data-access review` |
39 | | -- `PR diff review` |
40 | | -- `quick triage` |
| 11 | +## Overview |
41 | 12 |
|
42 | | -## Supported Agents / Platforms |
| 13 | +Patchman is a skill and plugin bundle for **authorized security reviews**. It operates in read-first, review-first mode — inspecting code and architecture against OWASP and common appsec failure patterns, then producing structured findings with actionable remediation guidance. |
43 | 14 |
|
44 | | -- Claude Code via local plugin directory or marketplace-style repo metadata |
45 | | -- Codex via `.codex-plugin` packaging and top-level skill folders |
46 | | -- Cursor / Windsurf / Copilot / Gemini-style skill installers with manual path import |
| 15 | +**Supported agents:** Claude Code · Codex · Cursor · Windsurf · Copilot · Gemini-style skill installers |
47 | 16 |
|
48 | | -## Install |
| 17 | +--- |
49 | 18 |
|
50 | | -### Claude Code (recommended) |
| 19 | +## Installation |
51 | 20 |
|
52 | | -Two commands — no cloning required: |
| 21 | +### Claude Code (Recommended) |
53 | 22 |
|
54 | 23 | ```bash |
55 | 24 | claude plugin marketplace add github:MuhammedZohaib/patchman |
56 | 25 | claude plugin install patchman@patchman-marketplace |
57 | 26 | ``` |
58 | 27 |
|
59 | | -Restart Claude Code. The session hooks activate automatically and print `PATCHMAN ACTIVE` on start. |
60 | | - |
61 | | -To verify the install: |
| 28 | +Restart Claude Code. The session hooks activate automatically. |
62 | 29 |
|
| 30 | +**Verify installation** |
63 | 31 | ```bash |
64 | 32 | claude plugin list |
65 | 33 | ``` |
66 | 34 |
|
67 | | -To remove: |
68 | | - |
| 35 | +**Uninstall** |
69 | 36 | ```bash |
70 | 37 | claude plugin uninstall patchman@patchman-marketplace |
71 | 38 | ``` |
72 | 39 |
|
73 | | -### Claude Code — local install from clone |
| 40 | +--- |
| 41 | + |
| 42 | +### Claude Code — Local Install |
74 | 43 |
|
75 | 44 | ```bash |
76 | 45 | git clone https://github.com/MuhammedZohaib/patchman.git |
77 | 46 | claude plugin marketplace add ./patchman |
78 | 47 | claude plugin install patchman@patchman-marketplace |
79 | 48 | ``` |
80 | 49 |
|
81 | | -### Codex local install |
| 50 | +--- |
| 51 | + |
| 52 | +### Codex — Local Install |
82 | 53 |
|
83 | 54 | ```bash |
84 | 55 | git clone https://github.com/MuhammedZohaib/patchman.git |
85 | 56 | mkdir -p ~/.codex/plugins |
86 | 57 | cp -R patchman/plugins/patchman ~/.codex/plugins/patchman |
87 | 58 | ``` |
88 | 59 |
|
89 | | -Then search for `Patchman` in the plugin picker or point Codex at `~/.codex/plugins/patchman`. |
| 60 | +Open the Codex plugin picker and search for `Patchman`, or point it directly at `~/.codex/plugins/patchman`. |
90 | 61 |
|
91 | | -### Repo metadata for marketplace-style installs |
| 62 | +--- |
92 | 63 |
|
93 | | -- Claude-style marketplace metadata: [`.claude-plugin/marketplace.json`](./.claude-plugin/marketplace.json) |
94 | | -- Codex-style marketplace metadata: [`.agents/plugins/marketplace.json`](./.agents/plugins/marketplace.json) |
95 | | -- Packaged Codex plugin manifest: [`plugins/patchman/.codex-plugin/plugin.json`](./plugins/patchman/.codex-plugin/plugin.json) |
96 | | - |
97 | | -## Example Commands |
| 64 | +## Review Modes |
98 | 65 |
|
99 | | -- `/security-audit focus=full severity>=medium output=report` |
100 | | -- `/auth-review area=login,session,reset` |
101 | | -- `/bizlogic-review feature=billing-upgrade workflow=invite-approval` |
102 | | -- `/api-review surface=public-api include=authz,rate-limit,headers` |
103 | | -- `/query-review path=app/models include=n-plus-one,tenant-scope` |
104 | | -- `/pr-diff-review base=main head=feature/auth-refactor` |
105 | | -- `/quick-triage path=admin/ reason=pre-release` |
106 | | -- `/threat-model feature=file-import` |
107 | | -- `/audit-report format=engineering-summary` |
| 66 | +| Mode | Command | |
| 67 | +|---|---| |
| 68 | +| Full security audit | `/security-audit focus=full severity>=medium output=report` | |
| 69 | +| Auth review | `/auth-review area=login,session,reset` | |
| 70 | +| Business logic review | `/bizlogic-review feature=billing-upgrade workflow=invite-approval` | |
| 71 | +| API review | `/api-review surface=public-api include=authz,rate-limit,headers` | |
| 72 | +| ORM / data-access review | `/query-review path=app/models include=n-plus-one,tenant-scope` | |
| 73 | +| PR diff review | `/pr-diff-review base=main head=feature/auth-refactor` | |
| 74 | +| Quick triage | `/quick-triage path=admin/ reason=pre-release` | |
| 75 | +| Threat modeling | `/threat-model feature=file-import` | |
| 76 | +| Audit report | `/audit-report format=engineering-summary` | |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## What Patchman Detects |
| 81 | + |
| 82 | +- OWASP Top 10 classes with code-level evidence |
| 83 | +- Broken authentication, authorization, and session management |
| 84 | +- IDOR and tenant isolation failures |
| 85 | +- Business logic gaps and approval bypasses |
| 86 | +- SSRF, XSS, CSRF, injection, and insecure deserialization |
| 87 | +- Secret leakage and sensitive data in logs |
| 88 | +- Unsafe file upload handling |
| 89 | +- Weak headers, insecure defaults, and risky cryptography |
| 90 | +- Missing rate limiting and anti-abuse controls |
| 91 | +- ORM misuse, N+1 query issues, and cross-tenant data access |
| 92 | +- Admin path, webhook, queue, and background job vulnerabilities |
| 93 | + |
| 94 | +--- |
108 | 95 |
|
109 | 96 | ## Example Prompts |
110 | 97 |
|
111 | | -```text |
112 | | -Run a full security audit on this repo. Prioritize broken access control, unsafe defaults, tenant isolation, secret handling, and exploitable auth issues. Use the Patchman findings format. |
| 98 | +**Full audit** |
113 | 99 | ``` |
114 | | - |
115 | | -```text |
116 | | -Review only the password reset flow. Focus on token lifetime, replay, host header trust, user enumeration, and session invalidation after reset. |
| 100 | +Run a full security audit on this repo. Prioritize broken access control, unsafe defaults, |
| 101 | +tenant isolation, secret handling, and exploitable auth issues. Use the Patchman findings format. |
117 | 102 | ``` |
118 | 103 |
|
119 | | -```text |
120 | | -Audit this pull request as a defensive security reviewer. Flag regressions, rank by severity and confidence, and suggest minimal safe patches. |
| 104 | +**Targeted review** |
121 | 105 | ``` |
122 | | - |
123 | | -```text |
124 | | -Check the ORM layer for N+1 issues that become security problems under multi-tenant load or leak cross-tenant metadata. |
| 106 | +Review only the password reset flow. Focus on token lifetime, replay attacks, host header |
| 107 | +trust, user enumeration, and session invalidation after reset. |
125 | 108 | ``` |
126 | 109 |
|
127 | | -## Safety Posture |
| 110 | +**PR review** |
| 111 | +``` |
| 112 | +Audit this pull request as a defensive security reviewer. Flag regressions, rank by severity |
| 113 | +and confidence, and suggest minimal safe patches. |
| 114 | +``` |
128 | 115 |
|
129 | | -`patchman` is for authorized defensive auditing only. |
| 116 | +--- |
130 | 117 |
|
131 | | -It refuses: |
| 118 | +## Findings Format |
132 | 119 |
|
133 | | -- unauthorized intrusion |
134 | | -- exploit weaponization |
135 | | -- credential harvesting |
136 | | -- malware, persistence, or stealth guidance |
137 | | -- destructive payloads or service disruption |
138 | | -- live attack chains beyond high-level defensive explanation |
| 120 | +Every finding includes: |
139 | 121 |
|
140 | | -It does support: |
| 122 | +- **Evidence** — specific code or configuration reference |
| 123 | +- **Severity** — based on blast radius and realistic abuse conditions |
| 124 | +- **Confidence** — drops when context is incomplete |
| 125 | +- **Remediation** — specific enough to implement directly |
141 | 126 |
|
142 | | -- secure code review |
143 | | -- architecture review |
144 | | -- configuration review |
145 | | -- safe exploitability analysis in plain language |
146 | | -- remediation planning and patch guidance |
| 127 | +--- |
147 | 128 |
|
148 | | -## Limitations |
| 129 | +## Scope and Limitations |
149 | 130 |
|
150 | | -- It infers risk from code, config, framework conventions, and diffs; it does not replace runtime validation. |
151 | | -- It can overestimate exploitability when repository context is incomplete. |
152 | | -- It will ask for missing deployment, proxy, tenant, or identity-boundary context when evidence is thin. |
153 | | -- It is intentionally conservative about offensive detail. |
| 131 | +Patchman is for **authorized defensive auditing only**. |
154 | 132 |
|
155 | | -## Evaluation Philosophy |
| 133 | +**In scope:** secure code review, architecture review, configuration review, exploitability analysis in plain language, remediation planning |
156 | 134 |
|
157 | | -Patchman optimizes for signal over theater. |
| 135 | +**Out of scope:** unauthorized intrusion, exploit weaponization, credential harvesting, malware or persistence guidance, destructive payloads, live attack chains |
158 | 136 |
|
159 | | -- Findings must cite code or configuration evidence. |
160 | | -- Severity must reflect blast radius and realistic abuse conditions. |
161 | | -- Confidence must drop when important context is missing. |
162 | | -- Remediations must be specific enough to implement. |
163 | | -- False positives should be easy to dismiss with explicit assumptions. |
| 137 | +Patchman infers risk from static code and configuration. It does not replace runtime validation and will request missing deployment, proxy, or identity-boundary context when evidence is insufficient. |
164 | 138 |
|
165 | | -See [evals/README.md](./evals/README.md) and [docs/false-positive-handling.md](./docs/false-positive-handling.md). |
| 139 | +--- |
166 | 140 |
|
167 | | -## Repo Layout |
| 141 | +## Repository Structure |
168 | 142 |
|
169 | | -```text |
| 143 | +``` |
170 | 144 | patchman/ |
171 | | -├── .agents/plugins/marketplace.json |
172 | 145 | ├── .claude-plugin/ |
173 | | -├── .codex/ |
174 | | -├── .cursor/ |
175 | | -├── .github/workflows/ |
176 | | -├── benchmarks/ |
| 146 | +├── .agents/plugins/ |
177 | 147 | ├── commands/ |
178 | 148 | ├── docs/ |
179 | 149 | ├── evals/ |
180 | 150 | ├── hooks/ |
181 | 151 | ├── plugins/patchman/ |
182 | 152 | ├── rules/ |
183 | 153 | ├── skills/ |
184 | | -├── tests/ |
185 | | -├── AGENTS.md |
186 | | -├── CLAUDE.md |
187 | | -├── CONTRIBUTING.md |
188 | | -├── LICENSE |
189 | | -├── README.md |
190 | 154 | └── patchman.skill |
191 | 155 | ``` |
192 | 156 |
|
| 157 | +--- |
| 158 | + |
193 | 159 | ## Contributing |
194 | 160 |
|
195 | | -Open an issue or PR with one of these: |
| 161 | +Contributions welcome. Open a PR with any of the following: |
| 162 | + |
| 163 | +- New defensive review heuristics |
| 164 | +- Framework-specific false positive reductions |
| 165 | +- Safer remediation examples |
| 166 | +- Eval fixtures with expected findings |
| 167 | +- Packaging improvements for Claude or Codex |
| 168 | + |
| 169 | +See [CONTRIBUTING.md](./CONTRIBUTING.md) to get started. |
| 170 | + |
| 171 | +--- |
196 | 172 |
|
197 | | -- new defensive review heuristics |
198 | | -- safer remediation examples |
199 | | -- framework-specific false positive reductions |
200 | | -- eval fixtures with clear expected findings |
201 | | -- packaging improvements for Claude/Codex compatibility |
| 173 | +## License |
202 | 174 |
|
203 | | -Start with [CONTRIBUTING.md](./CONTRIBUTING.md). |
| 175 | +See [LICENSE](./LICENSE). |
0 commit comments