web_spa

web_spa is a skill for Claude Code, Codex from jkaninda/okapi-skills. It costs 0 tokens per session (930 once invoked), scanned A, original, MIT.

A web-serving feature for Go applications that serve a front-end app such as React, Vue, Svelte, or Angular alongside an API. It also sends the main HTML file when a browser requests a client-side route.

In plain words
What is it for?
It helps serve front-end files from disk or an embedded file system, support routes such as `/users/42`, and package the front end inside one Go program.
Why use it?
It lets browser-based navigation work while keeping API routes available and taking precedence over front-end routes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is // Serves ./web/index.html for "/", "/login", "/users/42", ....

Good fit It helps serve front-end files from disk or an embedded file system, support routes such as /users/42, and package the front end inside one Go program.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/jkaninda/okapi-skills
agentmods
npx agentmods add skills/jkaninda/okapi-skills/web_spa

Made for: Claude Code, Codex.

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 web_spa

README.md
[![agentmods](https://agentmods.dev/badge/skills/jkaninda/okapi-skills/web_spa/github.svg)](https://agentmods.dev/skills/jkaninda/okapi-skills/web_spa)
Your own site
<a href="https://agentmods.dev/skills/jkaninda/okapi-skills/web_spa"><img src="https://agentmods.dev/badge/skills/jkaninda/okapi-skills/web_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 web_spa

Your own site · 80×15
<a href="https://agentmods.dev/skills/jkaninda/okapi-skills/web_spa"><img src="https://agentmods.dev/badge/skills/jkaninda/okapi-skills/web_spa.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 930 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.00930
Opus 5 $0.00000 $0.00465
Sonnet 5 $0.00000 $0.00186
Haiku 4.5 $0.00000 $0.00093

Measured 9d ago against content hash a11e57f4bc69, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

web_spa scanned grade A with 0 findings 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 9d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

web_spa/SKILL.md · 106 lines

How it starts

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

Okapi Web / SPA Serving

Okapi serves a front-end application (React, Vue, Svelte, Angular, …) alongside the API. Real files are served directly; any unmatched path under the prefix falls back to the index document so the client-side router takes over.

Two entry points:

o.Web(prefix, dir string, cfg ...WebConfig)        // from a directory on disk
o.WebFS(prefix string, fsys fs.FS, cfg ...WebConfig) // from any fs.FS (embed.FS, os.DirFS, …)

SPA / SPAFS / SPAConfig are deprecated aliases of Web / WebFS / WebConfig. They still work unchanged.

Register Web/WebFS after your API routes so the API keeps precedence.

Serve from Disk (development)

o := okapi.Default()

o.Get("/api/v1/users", listUsers)

// Serves ./web/index.html for "/", "/login", "/users/42", ...
o.Web("/", "./web")

o.Start()

Serve from an Embedded FS (production, single binary)

//go:embed all:web/dist
var dist embed.FS

func main() {
    o := okapi.Default()

    o.Get("/api/v1/users", listUsers)

    o.WebFS("/", dist, okapi.WebConfig{
        Root:   "web/dist", // sub-directory inside the embed.FS
        MaxAge: time.Hour,  // Cache-Control for assets
    })

    o.Start()
}

Use the all: prefix in the //go:embed directive so files beginning with _ or . (common in build output) are included.

WebConfig

Field Type Description
Index string File served for client-side routes. Defaults to index.html.
Root string Sub-directory inside the fs.FS holding the built app. WebFS only — ignored by Web.
Exclude []string Extra path prefixes that must never fall back to the index.
DisableAutoExclude bool Turn off auto-excluding the top-level segment of registered routes; only Exclude is consulted.
MaxAge time.Duration Cache-Control max-age for asset files. The index is always no-cache.

The zero value is valid: serve index.html, auto-exclude registered API routes, no asset caching header.

Read the full file on GitHub · 106 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. 9d ago First seen · 106 lines · 0 tokens per session scan A a11e57f4bc69

Subscribe to this mod's changes

web_spa is a skill published in the GitHub repository jkaninda/okapi-skills (3 stars, last pushed 24d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 930 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

fullstack-guide

A development guide for building full-stack applications with React and TypeScript on the frontend and Node.js and Supabase on the backend. It covers component structure, data loading, routing, styling, performance, and TypeScript practices.

VidyFoo/antigravity-skill-engine · 74 tokens

graphql-client

Operational skill for GraphQL clients: Apollo Client and urql patterns for queries, mutations, cache, error policies, and auth headers.

alivirgo/Major-AI-Skills · 30 tokens

copilotkit-upgrade

Use when migrating a CopilotKit v1 application to v2 -- updating package imports, replacing deprecated hooks and components, switching from GraphQL runtime to AG-UI protocol runtime, and resolving breaking API changes.

CopilotKit/CopilotKit · 48 tokens

nextjs-pages-router

Set up tRPC in Next.js Pages Router with createNextApiHandler, createTRPCNext, withTRPC HOC, SSR via ssr option and ssrPrepass, SSG via createServerSideHelpers with getStaticProps, and server-side helpers for getServerSideProps prefetching.

trpc/trpc · 67 tokens

service-digital-engagement-channel-configure

Configures and deploys enhanced chat Messaging Channels for Messaging for In-App and Web (MIAW). Use when the user needs to create, deploy, and activate a messaging channel configured with Omni-Channel Flow, Omni-Channel Queue, User, or Agentforce Service Agent routing. Generates MessagingChannel metadata, deploys it…

forcedotcom/sf-skills · 173 tokens

om-system-extension

Extend installed Open Mercato modules through UMES enrichers, interceptors, mutation guards, widgets, menus, entity extensions, events, component/page replacements, and overrides. Use for "extend core", "add field/column/action", "hide page", "intercept API", "UMES", or "rozszerz moduł".

open-mercato/open-mercato · 73 tokens