golang-web

golang-web is a skill for Claude Code, Codex from majiayu000/spellbook. It costs 41 tokens per session (2,723 once invoked), scanned C, original, MIT.

An architecture guide for building web applications, APIs, and small services in Go, a programming language known for compiled server software.

In plain words
What is it for?
Use it when starting or reorganizing a Go web project, API, or service and deciding how its code and dependencies should fit together.
Why use it?
It provides consistent choices for project structure, dependency wiring, errors, interfaces, and connections to language-model APIs.

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 go build -o bin/$(APP_NAME) ./cmd/$(APP_NAME).

Good fit Use it when starting or reorganizing a Go web project, API, or service and deciding how its code and dependencies should fit together.

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/majiayu000/spellbook
agentmods
npx agentmods add skills/majiayu000/spellbook/golang-web

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 golang-web

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/spellbook/golang-web"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/golang-web.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,723 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00041 $0.02723
Opus 5.5 $0.00016 $0.01089
Sonnet 5.5 $0.00008 $0.00545
Haiku 4.5 $0.00004 $0.00272

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

Security

Grade C, and why

golang-web scanned grade C 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 3mo 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf bin/
skills/golang-web/SKILL.md · 470 lines

How it starts

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

Go Web Architecture

Core Principles

  • Standard layout — Follow cmd/internal/pkg convention
  • Explicit dependencies — Wire dependencies in main.go, no globals
  • Interface-driven — Define interfaces where you use them, not where you implement
  • Error wrapping — Wrap errors with context, use error codes
  • No backwards compatibility — Delete, don't deprecate. Change directly
  • LiteLLM for LLM APIs — Use LiteLLM proxy for all LLM integrations

No Backwards Compatibility

Delete unused code. Change directly. No compatibility layers.

// ❌ BAD: Deprecated function kept around
// Deprecated: Use NewUserService instead
func CreateUserService() *UserService { ... }

// ❌ BAD: Alias for renamed types
type OldName = NewName // "for backwards compatibility"

// ❌ BAD: Unused parameters
func Process(_ context.Context, data Data) { ... }

// ✅ GOOD: Just delete and update all usages
func NewUserService(repo UserRepository) *UserService { ... }

LiteLLM for LLM APIs

Use LiteLLM proxy. Don't call provider APIs directly.

// adapters/llm/client.go
package llm

import (
    "github.com/sashabaranov/go-openai"
)

// Connect to LiteLLM proxy using OpenAI-compatible SDK
func NewClient(cfg Config) *openai.Client {
    config := openai.DefaultConfig(cfg.APIKey)
    config.BaseURL = cfg.BaseURL // LiteLLM proxy URL
    return openai.NewClientWithConfig(config)
}

Quick Start

1. Initialize Project

mkdir myapp && cd myapp
go mod init github.com/yourname/myapp

# Install core dependencies
go get github.com/gin-gonic/gin
go get github.com/spf13/viper
go get github.com/sirupsen/logrus
go get gorm.io/gorm

2. Apply Tech Stack

Layer Recommendation
HTTP Framework Gin / Chi / Echo
Configuration Viper
Logging Logrus / Zap / Slog
Database ORM GORM / sqlx / sqlc
Validation go-playground/validator
Testing testify / go test

Version Strategy

Read the full file on GitHub · 470 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. 3mo ago First seen · 470 lines · 41 tokens per session scan C 8e73548876fd

Subscribe to this mod's changes

golang-web is a skill published in the GitHub repository majiayu000/spellbook (301 stars, last pushed today), licensed MIT. It adds 41 tokens to every session and 2,723 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

golang-web compared with skills from other repositories

golang-web next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
golang-webmajiayu000/spellbookSkill301todayMITC41Claude Code, Codex
python-releaseComposioHQ/composioSkill31ktodayMITA53Claude Code, Codex
cao-session-managementawslabs/cli-agent-orchestratorSkill1.8ktodayApache-2.0B83Claude Code
agent-deckasheshgoplani/agent-deckSkill1.3ktodayMITA63Claude Code, Codex
output-dev-code-stylegrowthxai/outputSkill445todayApache-2.0A50Claude Code
fast-resumeangristan/fast-resumeSkill198todayMITA50Claude Code, Codex
notebook.fix_logginggpsaggese/helpersSkill158todayApache-2.0A10Claude Code