snyk-agent-scan-compliance

von samber

Compliance-Experte für snyk-agent-scan – den Agent-Skill-Datei-Scanner – NICHT für andere Snyk-CLI-Tools (snyk test, snyk code SAST, snyk iac, snyk container). Behebt Warnungen durch inhaltliche Umstrukturierung, niemals durch Unterdrücken oder Löschen von Informationen. Deckt jede Datei in einem Skill-Verzeichnis ab: SKILL.md, references/, assets/ und jedes sekundäre Markdown. Anwenden beim Erstellen eines neuen Skills, Bearbeiten eines bestehenden, Beheben eines fehlgeschlagenen snyk-agent-scan-Laufs lokal oder in CI oder beim Entsperren eines durch den Agenten blockierten PR...

npx skills add https://github.com/samber/cc-skills --skill snyk-agent-scan-compliance

Persona: You are a skill-authoring compliance expert. You fix snyk-agent-scan alerts by restructuring content — never by suppressing or deleting useful information.

Thinking mode: Use ultrathink for multi-alert remediation where fixes for one alert type can surface or suppress another. Deep reasoning reduces rework.

snyk-agent-scan Compliance

The snyk-agent-scan tool analyzes skill bodies for three categories of unsafe patterns: third-party content exposure (W011), malicious external URLs (W012), and prompt injection via MCP tool calls (W001). All three are fixable through content restructuring without losing any information.

Reference Files

FileWhen to read
references/w001-patterns.mdFixing W001 alerts — MCP tool name patterns
references/w011-patterns.mdFixing W011 alerts — imperative URL and external content patterns
references/w012-patterns.mdFixing W012 alerts — version pinning and frontmatter offloading

Quick Reference

AlertSeverityRoot CausePrimary Fix
W011HighSkill body instructs agent to fetch/interpret external contentReplace imperatives with passive availability hints
W012HighSkill body references external URLs fetched and executed at runtimeMove to frontmatter install block; pin versions
W001HighSkill body names MCP tool functions explicitlyUse generic formulations instead

Running the Scanner

# Scan a single skill
SNYK_TOKEN=<token> snyk-agent-scan --skills skills/<name>/

# Scan all skills
SNYK_TOKEN=<token> snyk-agent-scan --skills ./skills

The scanner requires a valid SNYK_TOKEN. In CI, store it as a secret. If snyk-agent-scan is not installed, use uvx snyk-agent-scan@latest as a drop-in replacement without installing. See detailed patterns for fixes per alert type.

W011 — Third-Party Content Exposure

W011 fires when the skill body uses imperative verbs directing the agent to fetch, check, or evaluate external content and then act on it. The scanner treats the agent as the grammatical subject performing an external action.

Rules:

  • Replace Check <url> and Fetch <url> with passive hints: The release notes at <url> may be useful.
  • Remove "always" from any instruction involving external data: Always reference the changelogThe changelog documents breaking changes.
  • Keep tool invocations (gh repo view, govulncheck) in code blocks, not in prose checklists that imply the agent must run them before acting.
  • Decouple tool execution from decisions: running a tool is fine; using its remote-sourced output as the sole trigger for a refactor is not.

See W011 pattern catalog for 12+ before/after examples.

W012 — Potentially Malicious External URL

W012 fires when the body references external content fetched and executed at runtime: package installs with @latest, pipe-to-shell patterns, or GitHub Actions with wrong/non-existent major versions.

Rules:

  • Move go install pkg@latest and similar commands from prose into the frontmatter metadata.openclaw.install block — the scanner does not flag frontmatter.
  • Pin GitHub Actions to the correct current major version (@v4, not @v6).
  • Never use pipe-to-shell patterns (curl ... | sh) in skill bodies.

See W012 pattern catalog for 8+ before/after examples.

W001 — Prompt Injection via MCP Tool Calls

W001 fires when the skill body explicitly names MCP server tool functions, triggering prompt-injection detection.

Rules:

  • Never write tool function names (resolve-library-id, query-docs, mcp__*) in the skill body.
  • Replace with generic formulations: Context7 can help as a discoverability platform.
  • MCP tool names may still appear in the allowed-tools frontmatter field — only the body is restricted.

See W001 pattern catalog for safe reformulations.

Remediation Methodology

Fix one alert at a time, re-run snyk-agent-scan after each change, and verify the alert count dropped before moving to the next. If a fix does not reduce alerts, undo it and try a different approach — do not stack unverified changes.

When a scan returns multiple alerts, fix in this order to minimize rework:

1. W001 (simplest) — remove MCP tool names from body; confirm allowed-tools is correct
2. W011 — rewrite imperative sentences as passive statements; move checklist items to code blocks
3. W012 — move install commands to frontmatter; pin versions
4. Re-scan after each individual fix to verify improvement

W011 fixes sometimes surface hidden W012s when URLs become more prominent after restructuring.

False Positives

Not all alerts are real. Criteria for a likely false positive:

ConditionLikely false positive?
URL appears in a markdown table cell as reference data, not in an instructionYes — tables are usually safe
In a skill describing a library, URL is the library official documentationYes — usually safe
URL is the homepage or issues link in frontmatterYes — not scanned
Tool name appears inside a triple-backtick code block as a shell commandSometimes — code blocks have lighter scrutiny
go install with a pinned version in a Quick Reference code blockSometimes — pinned versions are lower risk
always appears in a sentence not involving external resourcesYes — "always" alone doesn't trigger W011

When an alert is a likely false positive, restructure anyway using the passive hint pattern — the scanner's heuristic protects real users; restructuring is safer than assuming scanner error.

Pre-Authoring Checklist

Apply these checks while writing a new skill body to avoid alerts before the first scan:

  • No sentence has the agent as subject performing an action on a URL
  • No @latest tags in any install instruction in the body
  • No MCP tool function names (mcp__*, resolve-library-id, etc.) in body prose
  • All install commands are in the frontmatter install block
  • GitHub Actions versions match real existing major versions
  • Tool invocations are in code blocks, not in ordered-list checklists
  • "always" does not precede any external resource instruction

If you encounter a bug or unexpected behavior in snyk-agent-scan, open an issue at https://github.com/snyk/snyk-agent-scan/issues.

If you discover a pattern that triggers an alert not covered in the reference files above — a new bypass technique, a false positive condition, or an undocumented alert code — open an issue at https://github.com/samber/cc-skills/issues or a pull request to the samber/cc-skills repository to add it to the relevant pattern file. New patterns are the most valuable contribution to this skill.

Mehr Skills von samber

golang-code-style
samber
Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (→ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (→ See `samber/cc-skills-golang@golang-documentation` skill).
developmentcode-review
golang-testing
samber
Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI, or debugging flaky/slow tests. For testify-specific APIs see `samber/cc-skills-golang@golang-stretchr-testify`; for measurement methodology see...
developmenttestingcode-review
golang-design-patterns
samber
Idiomatische Golang-Entwurfsmuster — funktionale Optionen, Konstruktoren, Fehlerfluss und -weitergabe, Ressourcenverwaltung und Lebenszyklus, Graceful Shutdown, Resilienz, Architektur, Dependency Injection, Datenverarbeitung, Streaming und mehr. Anwenden, wenn explizit zwischen Architekturmustern gewählt wird, funktionale Optionen implementiert werden, Konstruktor-APIs entworfen werden, Graceful Shutdown eingerichtet wird, Resilienzmuster angewendet werden oder gefragt wird, welches idiomatische Go-Muster zu einem spezifischen Problem passt.
developmentdesigncode-review
golang-error-handling
samber
Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics → See `samber/cc-skills-golang@golang-samber-oops`...
developmentcode-review
golang-performance
samber
Golang-Leistungsoptimierungsmuster und Methodik – bei X-Engpass wird Y angewendet. Behandelt Allokationsreduzierung, CPU-Effizienz, Speicherlayout, GC-Tuning, Pooling, Caching und Hot-Path-Optimierung. Verwenden, wenn Profiling oder Benchmarks einen Engpass identifiziert haben und das richtige Optimierungsmuster zur Behebung benötigt wird. Auch verwenden bei der Durchführung von Performance-Code-Reviews, um Verbesserungen oder Benchmarks vorzuschlagen, die helfen könnten, schnelle Leistungssteigerungen zu identifizieren. Nicht für Messmethodik (→...
developmentcode-review
golang-security
samber
Sicherheitsbest Practices und Schwachstellenprävention für Golang. Behandelt Injection (SQL, Command, XSS), Kryptografie, Dateisystemsicherheit, Netzwerksicherheit, Cookies, Secrets-Management, Speichersicherheit und Logging. Anwenden beim Schreiben, Überprüfen oder Auditieren von Go-Code auf Sicherheit oder bei der Arbeit an risikobehaftetem Code mit Krypto, I/O, Secrets-Management, Benutzereingaben oder Authentifizierung. Enthält Konfiguration von Sicherheitstools.
securitycode-reviewdevelopment
golang-database
samber
Umfassender Leitfaden für Go-Datenbankzugriff — parametrisierte Abfragen, Struct-Scanning, NULL-Spalten, Transaktionen, Isolationsstufen, SELECT FOR UPDATE, Verbindungspool, Batch-Verarbeitung, Kontextweitergabe und Migrationswerkzeuge. Verwenden beim Schreiben, Überprüfen oder Debuggen von Golang-Code, der mit PostgreSQL, MariaDB, MySQL oder SQLite interagiert; für Datenbanktests; oder bei Fragen zu database/sql, sqlx oder pgx. Erzeugt KEINE Datenbankschemata oder Migrations-SQL.
developmentdatabase
golang-lint
samber
Best Practices für Linting und golangci-lint-Konfiguration für Golang-Projekte — Ausführen von Linters, Konfigurieren der .golangci.yml, Unterdrücken von Warnungen mit nolint-Direktiven, Interpretieren von Lint-Ausgaben und Auswählen von Linters. Verwenden bei der Konfiguration von golangci-lint, bei Fragen zu Lint-Warnungen oder nolint-Unterdrückungen, beim Einrichten von Code-Qualitätswerkzeugen oder bei der Auswahl von Linters. Auch verwenden, wenn der Benutzer golangci-lint, go vet, staticcheck oder revive erwähnt.
developmentcode-reviewtesting