agentleFS
digitalcomposerdigitalcomposer/csp-skill/csp/SKILL.md

csp

Skill0 starsChanged 7 months agoMITView on GitHub

Audit and implement Content-Security-Policy for web apps. Use when working on CSP headers, nonce or hash wiring, inline script/style removal, report-only rollout, or stack-specific CSP setup after running /csp audit or /csp implement.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. qian-gugugaga/Character_Skill_Producer★ 281same name
    2. ChristopherAlphonse/calphonse-skills★ 1same name
    3. cocart-headless/cocart-skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 15 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to inspect a project for CSP exposure, design a stronger policy, and apply it safely.

    line 10
  2. Very specific:

    Run /csp audit when you need discovery and recommendations.

    line 12
  3. Very specific:

    Run /csp implement when you want the policy wired into the app.

    line 13
  4. Distinctive:

    Prefer a report-only rollout first unless the user explicitly asks to enforce immediately.

    line 15
  5. Very specific:

    Keep object-src 'none' unless the app genuinely needs plugins.

    line 29
  6. Very specific:

    Add base-uri 'self' and a frame-ancestors policy.

    line 30
  7. Distinctive:

    Prefer nonces for per-request inline code, hashes for static inline code, and refactoring for event handlers.

    line 31
  8. Very specific:

    Treat unsafe-eval as a last resort, usually only for development or legacy tooling.

    line 32
  9. Very specific:

    Start with Content-Security-Policy-Report-Only when the impact is uncertain.

    line 33
  10. Distinctive:

    Prefer report-only plus browser-console verification before enforcing production changes.

    line 34
  11. Distinctive:

    Treat any exception as temporary until it is justified by a real runtime need.

    line 35
  12. Distinctive:

    Read mdn-csp-guide.md first for the canonical CSP model and browser behavior.

    line 50
  13. Distinctive:

    Read content-security-policy-complete.md for the extended CSP knowledge base.

    line 51
  14. Distinctive:

    Read github-skill-summary.md to borrow security-workflow patterns.

    line 52
  15. Distinctive:

    Read github-security-patterns.md for the actionable audit habits.

    line 53
  16. Distinctive:

    Read detect-stack.md to identify the stack quickly.

    line 54
  17. Distinctive:

    Read audit-checklist.md to catalog resources.

    line 55
  18. Distinctive:

    Read common-principles.md for policy design rules.

    line 56
  19. Distinctive:

    Read the matching stack reference before editing headers or nonce plumbing.

    line 57
  20. Distinctive:

    Use implement-flow.md to make the change and test it.

    line 58
  21. Distinctive:

    When finishing an audit, provide:

    line 71

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

Content Security Policy

Overview

Use this skill to inspect a project for CSP exposure, design a stronger policy, and apply it safely.

Run /csp audit when you need discovery and recommendations. Run /csp implement when you want the policy wired into the app.

Prefer a report-only rollout first unless the user explicitly asks to enforce immediately.

Workflow

  1. Detect the stack and rendering model.
  2. Audit every CSP-relevant surface.
  3. Classify each item as refactor, nonce, hash, allowlist, or remove.
  4. Draft the tightest practical policy.
  5. Implement the policy and verify that the app still renders.
  6. Re-run the audit after each CSP change to catch regressions.

Core Rules

  • Eliminate unsafe-inline from script-src whenever a practical alternative exists.
  • Keep object-src 'none' unless the app genuinely needs plugins.
  • Add base-uri 'self' and a frame-ancestors policy.
  • Prefer nonces for per-request inline code, hashes for static inline code, and refactoring for event handlers.
  • Treat unsafe-eval as a last resort, usually only for development or legacy tooling.
  • Start with Content-Security-Policy-Report-Only when the impact is uncertain.
  • Prefer report-only plus browser-console verification before enforcing production changes.
  • Treat any exception as temporary until it is justified by a real runtime need.

What To Inspect

  • Server entry points and header middleware
  • HTML templates and component render paths
  • Inline <script> and <style> blocks
  • Inline event handlers such as onclick
  • eval, new Function, template compilation, and string-based script injection
  • Script, style, image, font, connect, frame, worker, and media origins
  • Third-party widgets, analytics, and payment providers
  • Deployment layer headers that may need to be updated alongside app code

How To Work

  1. Read mdn-csp-guide.md first for the canonical CSP model and browser behavior.
  2. Read content-security-policy-complete.md for the extended CSP knowledge base.
  3. Read github-skill-summary.md to borrow security-workflow patterns.
  4. Read github-security-patterns.md for the actionable audit habits.
  5. Read detect-stack.md to identify the stack quickly.
  6. Read audit-checklist.md to catalog resources.
  7. Read common-principles.md for policy design rules.
  8. Read the matching stack reference before editing headers or nonce plumbing.
  9. Use implement-flow.md to make the change and test it.

Rationalizations To Reject

  • "We can leave unsafe-inline for now."
  • "The inline script is tiny, so it is harmless."
  • "We only need the allowlist in production."
  • "The browser console warning is just noise."
  • "We can add a wide domain wildcard and tighten it later."
  • "The site works in report-only, so we do not need to remove the inline code."

Output Shape

When finishing an audit, provide:

  • the detected stack
  • a resource catalog
  • inline-code findings
  • recommended fixes
  • the final CSP header

When implementing, provide:

  • files changed
  • how nonce or hash propagation works
  • any residual exceptions or report-only items

Stack References

  • MDN CSP Guide Notes
  • CSP Knowledge Base
  • GitHub Skill Summary
  • GitHub Security Patterns
  • Next.js
  • Nuxt
  • SvelteKit
  • Remix
  • Astro
  • Express
  • Fastify
  • NestJS
  • Hono
  • Django
  • Rails
  • Laravel
  • Spring Boot
  • Nginx
  • Apache
  • Vercel
  • Netlify
  • Cloudflare
  • Static HTML

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.