go-embedded-spa

go-embedded-spa is a skill for Claude Code, Codex from castle-x/skills-x. It costs 76 tokens per session (1,330 once invoked), scanned A, original, MIT.

An architecture for putting a React, Vue or TypeScript single-page web interface inside a Go program using Go's built-in embedding support. A single-page application is a web interface that updates within one page rather than loading separate pages.

In plain words
What is it for?
Use it to build self-contained Go applications, embed frontend build files, serve them from the Go backend and compile one deployable binary for Linux, macOS or Windows.
Why use it?
It lets the frontend and backend ship as one executable, so deployment does not require a separate Node.js installation or web server such as nginx.

Skill for Claude CodeCodex

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

Good fit Use it to build self-contained Go applications, embed frontend build files, serve them from the Go backend and compile one deployable binary for Linux, macOS or Windows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/castle-x/skills-x/go-embedded-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 castle-x/skills-x --skill go-embedded-spa
Clone the repo
git clone --depth 1 https://github.com/castle-x/skills-x

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 go-embedded-spa

README.md
[![agentmods](https://agentmods.dev/badge/skills/castle-x/skills-x/go-embedded-spa/github.svg)](https://agentmods.dev/skills/castle-x/skills-x/go-embedded-spa)
Your own site
<a href="https://agentmods.dev/skills/castle-x/skills-x/go-embedded-spa"><img src="https://agentmods.dev/badge/skills/castle-x/skills-x/go-embedded-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 go-embedded-spa

Your own site · 80×15
<a href="https://agentmods.dev/skills/castle-x/skills-x/go-embedded-spa"><img src="https://agentmods.dev/badge/skills/castle-x/skills-x/go-embedded-spa.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,330 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.00076 $0.01330
Opus 5 $0.00038 $0.00665
Sonnet 5 $0.00015 $0.00266
Haiku 4.5 $0.00008 $0.00133

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

Security

Grade A, and why

go-embedded-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 10d 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.

skills/go-embedded-spa/SKILL.md · 180 lines

How it starts

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

Go Embedded SPA

Overview

Go Embedded SPA is a technique that embeds frontend SPA (Single Page Application) static resources (React/Vue/TSX) into Go binary files using Go 1.16+ embed package, achieving single-binary full-stack deployment.

Core Benefits

Benefit Description
🎯 Single File Deploy One binary contains both frontend and backend, no nginx needed
🌍 Cross-Platform GOOS/GOARCH easily compiles for Linux/Mac/Windows
📦 Zero Dependencies Target machine needs no Node.js/npm, uses Go standard library only
🚀 Container Friendly Dockerfile only needs COPY + ENTRYPOINT
🔒 Resource Security Static resources compiled into binary, tamper-proof
⚡ Fast Startup No disk I/O for loading static files

Project Structure

project/
├── go.mod
├── Makefile
├── site/                    # Frontend project
│   ├── embed.go             # Go embed directive
│   ├── src/                 # React/Vue source
│   ├── dist/                # Build output (embedded)
│   ├── package.json
│   ├── vite.config.ts
│   └── index.html
├── pkg/
│   └── siteserver/          # Static file server
│       └── siteserver.go
└── cmd/
    └── app/
        └── main.go

Implementation Steps

Step 1: Create embed.go

Create site/embed.go to declare embed directive. See references/embed.md for complete code.

Key points:

  • Use //go:embed all:dist to embed all files including hidden files
  • Use fs.Sub() to remove dist/ prefix

Step 2: Create Static File Server

Create pkg/siteserver/siteserver.go. See references/siteserver.md for complete implementation using Go standard net/http.

Core logic:

  1. Pre-load index.html for SPA fallback
  2. Create http.FileServer from embed.FS
  3. Detect static resources by file extension
  4. Return index.html for SPA routes (no file extension)

Step 3: Application Integration

package main

import (
    "log"
    "net/http"
    
    "your-project/pkg/siteserver"
    "your-project/site"
)

func main() {
    mux := http.NewServeMux()
    
    // 1. Register API routes FIRST
    mux.HandleFunc("/apis/v1/health", healthHandler)
    mux.HandleFunc("/apis/v1/data", dataHandler)
    
    // 2. Wrap with static file server (as fallback)
    handler := siteserver.WrapHandler(mux, site.DistDirFS)
    
    log.Println("Server starting on :8080")
    log.Fatal(http.ListenAndServe(":8080", handler))
}

Read the full file on GitHub · 180 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 180 lines · 76 tokens per session scan A ad5bc055fa57

Subscribe to this mod's changes

go-embedded-spa is a skill published in the GitHub repository castle-x/skills-x (18 stars, last pushed 4mo ago), licensed MIT. It adds 76 tokens to every session and 1,330 once invoked, about $0.0004 per session on Opus 5. 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-30.

Related

Other skills, from other repositories

jeecg-codegen

A JeecgBoot code generator that turns a natural-language request into a CRUD module: code for creating, reading, updating, and deleting records. It produces Java backend code, Vue 3 frontend code, menus, permissions, and database migration SQL.

jeecgboot/skills · 91 tokens

inertia-rails-setup

One-time project initializer for Inertia Rails skills. Detects stack and frontend framework (React/Vue/Svelte) from Gemfile and package.json, offers to install recommended deps (alba-inertia, js-routes, pagy, shadcn), and generates a CLAUDE.md section that configures which skill patterns apply. Use when first…

inertia-rails/skills · 98 tokens

web-meta-framework-nuxt

Nuxt patterns - file-based routing, data fetching (useFetch/useAsyncData), useState, server routes, middleware, auto-imports, layouts, SEO.

agents-inc/skills · 39 tokens

web-meta-framework-sveltekit

SvelteKit full-stack framework - file-based routing, load functions, form actions, server hooks, SSR/SSG, API routes, streaming, progressive enhancement.

agents-inc/skills · 39 tokens

framework-expert

Unified framework expertise bundle. Lazy-loads relevant framework patterns (React, Vue, Angular, Next.js, Node.js, Python, Laravel, Go, Flutter, React Native, TypeScript) based on detected tech stack.

nguyenthienthanh/aura-frog · 48 tokens

nuxt

Skill "nuxt" from ashish7802/awesome-api-skills, covering nuxt skill, ecosystem graph, quick start, production patterns and server api routes.

ashish7802/awesome-api-skills · 0 tokens