home / skills / ehtbanton / claudeskillsrepo / csp-header-generator
This skill generates a complete CSP header configuration adhering to CSP Level 3 to enhance web security.
npx playbooks add skill ehtbanton/claudeskillsrepo --skill csp-header-generatorReview the files below or copy the command above to add this skill to your agents.
---
name: csp-header-generator
description: Generate Content Security Policy (CSP) header configurations for web security. Triggers on "create csp header", "generate content security policy", "csp config", "security headers".
---
# CSP Header Generator
Generate Content Security Policy configurations for enhanced web security.
## Output Requirements
**File Output:** CSP configuration or middleware code
**Format:** Valid CSP directives
**Standards:** CSP Level 3
## When Invoked
Immediately generate a complete CSP configuration for the application type.
## Example Invocations
**Prompt:** "Create CSP headers for React SPA"
**Output:** Complete CSP configuration with appropriate directives.
This skill generates Content Security Policy (CSP) header configurations tailored to application types and deployment needs. It outputs complete, valid CSP Level 3 directives or ready-to-use middleware snippets for common platforms. The goal is to reduce attack surface by providing pragmatic, secure defaults and options for incremental relaxation.
Provide the application type, frameworks, third-party services, and any runtime needs (inline scripts, eval, CDN usage). The skill analyzes those inputs and produces a CSP policy that balances strictness with required functionality, including report-only options and example middleware. It validates directives against CSP Level 3 semantics and includes practical comments for customization.
Can this generate middleware for my Node/Express app?
Yes. Request the target platform and it will output example middleware showing header setting and nonce generation.
How do I handle inline scripts?
Prefer nonces or script hashes. The skill can produce examples for generating nonces per response or computing hashes for static inline scripts.