plugins/astro-expert/skills/astro-security/SKILL.md
Use when configuring Content Security Policy (CSP) in Astro 7, setting security headers, managing script/style hashes, using nonces, or implementing experimentalStaticHeaders for adapter deployments.
npx skillsauth add fusengine/agents astro-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before ANY implementation, use TeamCreate to spawn 3 agents:
After implementation, run fuse-ai-pilot:sniper for validation.
security.csp in astro.config.mjsexperimentalStaticHeaders for adapter-based CSP headersAstro 6 ships Content Security Policy as a stable feature (previously experimental). When enabled:
<meta http-equiv="content-security-policy"> in each page's <head>script-src and style-src directives by defaultLimitations:
dev mode — test with build + preview<ClientRouter /> view transitions (use native View Transition API)| Topic | Reference | When to Consult | |-------|-----------|-----------------| | CSP overview | csp-overview.md | Understanding CSP in Astro | | Configuration | csp-config.md | All config options | | Script directive | script-directive.md | script-src configuration | | Style directive | style-directive.md | style-src configuration | | Nonces | nonces.md | Dynamic script injection | | Static headers | static-headers.md | Adapter-based CSP headers |
| Template | When to Use | |----------|-------------| | csp-basic.md | Basic CSP enable with algorithm | | csp-advanced.md | Full config with directives + static headers |
'self' explicitly — not included by default in resourcesexperimentalStaticHeaders for Vercel/Netlifydev mode (doesn't work — always use build + preview)<ClientRouter /> with CSP enabled'self' when using resources arrayunsafe-inline (defeats purpose of CSP)testing
Copy self-audit and ban-lists — filler verbs/hype adjectives, slop placeholder names, fake-precise numbers, Title Case headlines, humor in error copy ('Oops!'), em-dash crutch, one copy register per page.
development
Logged-in web apps — dashboards, auth flows, settings, onboarding, data tables, command palettes, modals, toasts. Register `product`: density and glance-speed over marketing polish, no hero/CTA-tricks, every data surface covers empty/loading/error explicitly, tables and dataviz follow preattentive-processing rules.
development
Marketing sites, landing pages, campaign pages — register `brand` (design IS the product). Structure comes from the register's POV + a macrostructure pick, never from copying an inspiration site's section flow. Hero discipline, deviated section order, asymmetric grids, and a silhouette lookalike-test gate before ship.
development
Token-strategy core — OKLCH color rules, neutral tinting, accent-commitment levels, type scale, 8pt spacing grid, touch targets, and the canonical output format of design-system.md (the file the harness gates on). This is routing step 1 of design-method/SKILL.md — read it before design-web/design-webapp/design-ios/design-android, before picking or auditing a single color/type/spacing value.