agentleFS
HayatelinHayatelin/devsecops-skills/skills/secure-code-review/SKILL.md

secure-code-review

Skill0 starsChanged 5 months agoMITView on GitHub

Run a security-focused review pass over a diff, PR, or file. Trigger when the user says "security review this", "is this PR safe to merge", "review for vulnerabilities", or before merging code that touches auth, input handling, data access, or external requests.

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use vulnerability-triage, threat-modeling and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • superagent-aiSkill

    vulnerability-triage

    Triage inbound vulnerability reports - GitHub Advisories (GHSA/CVE), bug bounty submissions, HackerOne/Bugcrowd/Intigriti exports, or a researcher's issue - to decide whether a finding is real, by-design, or noise. Reads the report offline, cross-references the project's documented intent and threat model (SECURITY.md, README, code, closed issues), statically audits any PoC without executing it, and emits a structured markdown triage report with a P0-P3 / By-Design severity and a recommended action. Use whenever the user asks to triage, assess, or score a vulnerability report, advisory, CVE, GHSA, or bug bounty submission, or asks "is this a real finding or by-design?".

    Also in 3 projects that use this

  • msewellSkill

    threat-modeling

    Produces structured threat models for software systems using STRIDE on data flow diagrams. Generates DFDs with trust boundaries, identifies threats per element, scores risks, and defines concrete mitigations. Outputs a complete threat model Markdown document through phased, interactive delivery. Use when threat modeling a system, analyzing security threats, identifying attack surfaces, performing STRIDE analysis, assessing security risks in architecture, creating a threat model document, or when the user mentions threat model, attack surface, trust boundaries, STRIDE, or security risk analysis.

    Also in 3 projects that use this

  • AnthropicSkill

    competitive-analysis

    Framework for building competitive landscape decks — market positioning, competitor deep-dives, comparative analysis, strategic synthesis. Use when the user asks for a competitive landscape, competitor analysis, peer comparison, market positioning assessment, strategic review, or investment memo deck. Also triggers on "who are the competitors to X", "benchmark X against peers", "build a market map", or any request to systematically evaluate competitive dynamics across an industry.

    Also in 3 projects that use this

  • AnthropicSkill

    incident-response

    Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.

    Also in 3 projects that use this

The file

Files
SKILL.md

When to use

  • Reviewing a PR or diff before merge, especially one touching auth, user input, DB/queries, file I/O, outbound requests, or crypto.
  • The user asks "any security issues here?" or wants a second pass focused only on vulnerabilities (not style).
  • Complements secscan (automated) — this is the human-grade reasoning pass.

Process

  1. Get the diff scope: git diff main...HEAD or the PR's changed files. Review the change, not the whole repo, but read enough surrounding code to judge data flow.
  2. Trace untrusted input from entry point to sink — where does external data reach a query, command, file path, template, or response?
  3. Walk the checklist below against the changed code.
  4. For each finding, assign a severity (Critical/High/Medium/Low) and write the exact file:line, the risk, and a concrete fix.
  5. Distinguish real exploitable issues from theoretical ones; don't drown the author in noise.
  6. Output a prioritized list, Critical/High first.

Checklist

  • AuthN/AuthZ — every new endpoint/action checks identity AND permission; no missing per-object authorization (IDOR); no trusting client-supplied user IDs, roles, or is_admin flags.
  • Input validation — untrusted input validated/allow-listed at the boundary; length/type/format enforced.
  • Injection — SQL/NoSQL parameterized; no string-built queries; no shell=True/os.system on user input; no command, LDAP, or template injection.
  • SSRF — outbound URLs from user input are allow-listed; no fetching arbitrary user-supplied URLs/IPs (block internal ranges & metadata endpoints).
  • Insecure deserialization — no pickle/yaml.load/Java native deser on untrusted data; use safe loaders.
  • Secrets — no hardcoded keys/tokens/passwords; config from env/secrets manager.
  • Crypto — strong algorithms (AES-GCM, SHA-256+, bcrypt/argon2); no MD5/SHA1 for security; TLS verification on; secrets not random for tokens.
  • Error handling / info leak — no stack traces, SQL, or secrets in responses/logs; fail closed; generic error messages to users.
  • XSS / output encoding — output encoded for its context; no dangerouslySetInnerHTML/innerHTML with untrusted data; safe templating.
  • Access control on files/paths — no path traversal (../), uploads validated for type/size and stored outside the web root.

How to fix

  • For each finding give the specific remediation: parameterize the query, add the authz check at line X, swap random → secrets, allow-list the URL host, switch yaml.load → yaml.safe_load, encode the output.
  • Recommend the framework-native control where one exists (the ORM's binding, the framework's CSRF token, the platform's secrets store).
  • Flag anything that needs a follow-up ticket vs. must-block-merge.

Report back

Output findings grouped by severity (Critical → Low), each with file:line, one-line risk, and the fix. Lead with a verdict: "block merge — N critical/high issues" or "approve — only low-severity notes". Note what you reviewed and any areas you couldn't fully assess.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.