frontend-spa

frontend-spa is a skill for Claude Code from ayalaphiscan/web-security-guard. It costs 189 tokens per session (8,453 once invoked), scanned A, original, MIT.

A security guide for single-page apps and static websites built with tools such as React, Vite, Vue, or Svelte. A single-page app is a site whose interface mostly runs in the browser rather than on a new server page for each action.

In plain words
What is it for?
It helps configure a strict content security policy, avoid unsafe inline scripts, protect browser tokens and public settings, and review source maps, service workers, and dependencies.
Why use it?
Browser code is visible to users, and a cross-site scripting attack can steal browser-held login tokens or run an attacker’s code in the page.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the web-security-guard plugin — 15 skills, 4 commands shipped together

Good fit It helps configure a strict content security policy, avoid unsafe inline scripts, protect browser tokens and public settings, and review source maps, service workers, and dependencies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ayalaphiscan/web-security-guard/frontend-spa
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ayalaphiscan/web-security-guard --skill frontend-spa
Clone the repo
git clone --depth 1 https://github.com/ayalaphiscan/web-security-guard

Made for: Claude Code.

Or install web-security-guard, the plugin that ships this one along with the rest of its 15 skills, 4 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for frontend-spa

README.md
[![agentmods](https://agentmods.dev/badge/skills/ayalaphiscan/web-security-guard/frontend-spa/github.svg)](https://agentmods.dev/skills/ayalaphiscan/web-security-guard/frontend-spa)
Your own site
<a href="https://agentmods.dev/skills/ayalaphiscan/web-security-guard/frontend-spa"><img src="https://agentmods.dev/badge/skills/ayalaphiscan/web-security-guard/frontend-spa/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for frontend-spa

Your own site · 80×15
<a href="https://agentmods.dev/skills/ayalaphiscan/web-security-guard/frontend-spa"><img src="https://agentmods.dev/badge/skills/ayalaphiscan/web-security-guard/frontend-spa.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 189 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,453 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00189 $0.08453
Opus 5.5 $0.00076 $0.03381
Sonnet 5.5 $0.00038 $0.01691
Haiku 4.5 $0.00019 $0.00845

Measured 1mo ago against content hash 66266d14e941, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

frontend-spa scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sI https://app.example.com/percorso/profondo | grep -icE 'content-security-policy|strict-transport|x-frame|nosniff|referrer-policy|permissions-policy' # 6
skills/frontend-spa/SKILL.md · 259 lines

How it starts

The opening of the file, as written. The whole thing — 259 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Frontend e SPA sicuri · Secure Front-end and SPAs

🇮🇹 Versione italiana qui sotto · 🇬🇧 English version below

In una single-page app su hosting statico (React, Vite, Vue, Svelte) non c'è un server dell'app: tutto il codice gira nel browser, chiunque può leggerlo, e i dati sono protetti solo dalle regole del backend (supabase-sicuro, api-sicura). Il frontend ha un compito suo: non far girare codice altrui nella pagina. Con Supabase JS la sessione sta in localStorage, quindi un XSS equivale a prendersi l'account: lo script dell'attaccante legge il refresh token e lo usa da un altro computer. Header generali e HTTPS sono in hardening-siti; qui c'è ciò che è specifico dei frontend statici.

Regole obbligatorie

1. CSP stretta, senza script inline

  • Su un hosting statico i nonce sono impossibili (serve un valore nuovo a ogni risposta) e gli hash vanno ricalcolati a ogni build. La via semplice: nessuno script inline, solo file esterni e script-src 'self'. Lo script che applica il tema prima del primo disegno va in un file (/theme-init.js) caricato nel <head>.
  • Mai 'unsafe-inline' o 'unsafe-eval' in script-src: una libreria che chiede eval si cambia o si usa precompilata. Per WebAssembly basta 'wasm-unsafe-eval'. 'unsafe-inline' in style-src è accettabile solo se una libreria inserisce tag <style>; gli stili di React (style={{…}}) passano comunque.
  • connect-src con domini esatti, mai https: o *.supabase.co: il secondo lascia spedire i dati rubati al progetto Supabase dell'attaccante. Le mappe caricano tile, stili e glifi con fetch (quindi connect-src) e spesso avviano worker da blob:.
  • img-src solo dai propri domini: un'immagine con URL scelto da un utente fa chiamare a ogni lettore il server dell'attaccante, che riceve l'IP (cioè la zona). Esempio per React + Supabase + mappa:
default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data: blob: https://REF.supabase.co;
connect-src 'self' https://REF.supabase.co wss://REF.supabase.co https://tiles.openfreemap.org;
worker-src 'self' blob:; font-src 'self'; manifest-src 'self'; frame-src 'none'; object-src 'none';
base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests; report-to csp
  • report-to csp vuole l'header Reporting-Endpoints: csp="https://…" (un servizio di raccolta o una Edge Function con limite di frequenza); aggiungere report-uri per i browser che non supportano report-to. Una policy nuova va prima pubblicata come Content-Security-Policy-Report-Only per una settimana, leggendo i rapporti. In locale, la stessa CSP in preview.headers di vite.config mostra gli errori con vite preview. Il tag <meta http-equiv> ignora frame-ancestors, report-uri e sandbox: solo dove l'hosting non permette header.

Read the full file on GitHub · 259 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 259 lines · 189 tokens per session scan A 66266d14e941

Subscribe to this mod's changes

frontend-spa is a skill published in the GitHub repository ayalaphiscan/web-security-guard (4 stars, last pushed 1mo ago), licensed MIT. It adds 189 tokens to every session and 8,453 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-24.

Related

frontend-spa compared with skills from other repositories

frontend-spa next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
frontend-spaayalaphiscan/web-security-guardSkill41mo agoMITA189Claude Code
top-designwondelai/skillsSkill2.9k3d agoMITA113Claude Code, Codex
web-typographywondelai/skillsSkill2.9k3d agoMITA128Claude Code, Codex
edit-sitemicrosoft/power-platform-skillsSkill1.2ktodayMITA104Claude Code
designlang-tokensManavarya09/design-extractSkill5.3k2d agoMITA30Claude Code
refactoring-uiwondelai/skillsSkill2.9k3d agoMITA132Claude Code, Codex
interface-craftcbrock84/headcountSkill2.6k3d agoMITA79Claude Code