agentleFS
gleicongleicon/devskills/skills/ds-semgrep/SKILL.md

ds-semgrep

Skill20 starsChanged 46 days agoMITView on GitHub

Run a local static application security test (SAST) with Semgrep to find exploitable patterns in source code.

  • Installs packages

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before /ds-security-review to surface mechanical SAST leads.

    line 11
  2. Distinctive:

    After a change to confirm no new dangerous patterns were introduced.

    line 12
  3. Distinctive:

    No args: scan the current directory with the default Semgrep ruleset.

    line 17
  4. Very specific:

    Check for semgrep binary. If missing:

    line 25
  5. Distinctive:

    Stop here. Do not proceed without the binary.

    line 32
  6. Distinctive:

    Run the scan with the default security ruleset:

    line 34
  7. Very specific:

    Do not auto-fix. Summarize actionable next steps and hand off to /ds-security-review for context and verification.

    line 51
  8. Distinctive:

    If zero findings: report clean with the ruleset and scope scanned.

    line 74
  9. Distinctive:

    Never apply Semgrep's autofix for security rules without human review — experimental fixes can change behavior or miss context.

    line 78
  10. Very specific:

    Treat Semgrep matches as leads, not verdicts.

    line 79
  11. Very specific:

    Use p/default for speed; use p/security-audit or p/owasp-top-ten only when explicitly requested.

    line 80

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/ds-semgrep is the local SAST counterpart to /ds-osv (dependency scanning). It runs Semgrep against the repo to catch dangerous patterns — injection sinks, secret leaks, auth bypass shapes, and other code-level weaknesses — without leaving the machine. Complements /ds-security-review by providing fast, mechanical findings that the review then triages and verifies in context.

When To Use

  • Before /ds-security-review to surface mechanical SAST leads.
  • After a change to confirm no new dangerous patterns were introduced.
  • As a standalone quick scan when semgrep is already installed.

Arguments

  • No args: scan the current directory with the default Semgrep ruleset.
  • <path>: scan a specific file or directory.
  • --config <id>: use a specific ruleset (e.g. p/default, p/security-audit, p/owasp-top-ten). Defaults to p/default.
  • --json: emit machine-readable JSON instead of the human summary.
  • --fix: do not auto-fix; Semgrep autofix is experimental and unsafe for security findings. Report only.

Process

  1. Check for semgrep binary. If missing:
    Install semgrep:
      macOS:  brew install semgrep
      pip:    pip install semgrep
      Other:  https://semgrep.dev/docs/getting-started/
    Stop here. Do not proceed without the binary.
  2. Run the scan with the default security ruleset:
    semgrep --config=p/default --error --json <path-or-.>
  3. Parse the JSON output. Classify findings:
    • ERROR (blocking) — high-confidence security matches
    • WARN — medium-confidence patterns that need review
    • INFO — low-confidence or style-oriented findings
  4. For each finding report:
    • File path and line range
    • Rule ID and message
    • Confidence/experimental flag
    • A one-line description of why the pattern matters
    • Whether it is a known-exploit class (e.g. SQL injection, SSRF, hardcoded secret) or a defense-in-depth gap
  5. Do not auto-fix. Summarize actionable next steps and hand off to /ds-security-review for context and verification.

Output

Semgrep SAST: <N> findings (<B> blocking, <M> warnings, <I> info)

BLOCKING
  <file>:<line>-<line>  <rule-id>
  <short description>
  Why it matters: <one-line attack vector or risk>

WARNINGS
  <file>:<line>  <rule-id>
  ...

INFO: <N> findings — run with --config=p/security-audit to expand.

Next steps:
  Review blocking findings with /ds-security-review.
  Re-run /ds-semgrep after fixes to confirm the pattern is gone.

If zero findings: report clean with the ruleset and scope scanned.

Rules

  • Never apply Semgrep's autofix for security rules without human review — experimental fixes can change behavior or miss context.
  • Treat Semgrep matches as leads, not verdicts. Every finding must be traced through /ds-security-review to confirm exploitability.
  • Use p/default for speed; use p/security-audit or p/owasp-top-ten only when explicitly requested.

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.