/csp
Generate Content Security Policy headers for a web application.
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/csp
Context preview
What this command does when you run it.
Generate Content Security Policy headers for a web application.
Command definition
csp.mdGenerate Content Security Policy headers for a web application.
Steps
1. Scan the project for frontend assets and their sources:
- JavaScript files: inline scripts, external CDN scripts, dynamic imports.
- CSS files: inline styles, external stylesheets, CSS-in-JS libraries.
- Images: local assets, external image CDNs, data URIs.
- Fonts: Google Fonts, self-hosted, CDN-hosted.
- API calls: `fetch`, `XMLHttpRequest`, WebSocket connections.
- Frames: iframes, embedded content.
2. Identify all external domains referenced in the codebase. 3. Build CSP directives:
- `default-src`: Fallback policy.
- `script-src`: JavaScript sources with nonce or hash strategy.
- `style-src`: CSS sources.
- `img-src`: Image sources.
- `connect-src`: API endpoints, WebSocket URLs.
- `font-src`: Font sources.
- `frame-src`: Iframe sources.
- `object-src`: Plugin sources (should be `'none'`).
4. Add reporting configuration: `report-uri` or `report-to`. 5. Generate both enforcing and report-only headers. 6. Output as HTTP header format and as meta tag format.
Format
Content-Security-Policy:
default-src 'self';
script-src 'self' 'nonce-{random}' https://cdn.example.com;
style-src 'self' 'unsafe-inline';
img-src 'self' data: https://images.example.com;
connect-src 'self' https://api.example.com;
font-src 'self' https://fonts.gstatic.com;
object-src 'none';
frame-ancestors 'none';
report-uri /csp-report;Rules
- Never use `unsafe-inline` for scripts; prefer nonces or hashes.
- Always include `object-src 'none'` and `frame-ancestors 'self'`.
- Start with a strict policy and relax only as needed.
- Provide a `Content-Security-Policy-Report-Only` header for testing.
- Document each allowed domain with a comment explaining why it is needed.
Read more
Generate Content Security Policy headers for a web application.
Steps
1. Scan the project for frontend assets and their sources:
- JavaScript files: inline scripts, external CDN scripts, dynamic imports.
- CSS files: inline styles, external stylesheets, CSS-in-JS libraries.
- Images: local assets, external image CDNs, data URIs.
- Fonts: Google Fonts, self-hosted, CDN-hosted.
- API calls: `fetch`, `XMLHttpRequest`, WebSocket connections.
- Frames: iframes, embedded content.
2. Identify all external domains referenced in the codebase. 3. Build CSP directives:
- `default-src`: Fallback policy.
- `script-src`: JavaScript sources with nonce or hash strategy.
- `style-src`: CSS sources.
- `img-src`: Image sources.
- `connect-src`: API endpoints, WebSocket URLs.
- `font-src`: Font sources.
- `frame-src`: Iframe sources.
- `object-src`: Plugin sources (should be `'none'`).
4. Add reporting configuration: `report-uri` or `report-to`. 5. Generate both enforcing and report-only headers. 6. Output as HTTP header format and as meta tag format.
Format
Content-Security-Policy:
default-src 'self';
script-src 'self' 'nonce-{random}' https://cdn.example.com;
style-src 'self' 'unsafe-inline';
img-src 'self' data: https://images.example.com;
connect-src 'self' https://api.example.com;
font-src 'self' https://fonts.gstatic.com;
object-src 'none';
frame-ancestors 'none';
report-uri /csp-report;Rules
- Never use `unsafe-inline` for scripts; prefer nonces or hashes.
- Always include `object-src 'none'` and `frame-ancestors 'self'`.
- Start with a strict policy and relax only as needed.
- Provide a `Content-Security-Policy-Report-Only` header for testing.
- Document each allowed domain with a comment explaining why it is needed.
The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.
Repo: rohitg00/awesome-claude-code-toolkit
Other commands on rohitg00-claude-code-toolkit.
- /adr
Write an Architecture Decision Record documenting a significant technical decision.
Open command - /design-review
Conduct a structured design review of a module, feature, or system component.
Open command - /diagram
Generate Mermaid diagrams from codebase analysis or description.
Open command - /migrate
Plan and execute a framework or library migration incrementally.
Open command - /plan
Create a structured implementation plan for the requested feature or change.
Open command - /refactor
Perform a systematic refactoring of the specified code area.
Open command

