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 $0.00020 $0.01362
Sonnet 5 $0.00008 $0.00545
Haiku 4.5 $0.00004 $0.00272

Measured 11d ago against content hash 8e73548876fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 11d 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. 11d 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 (278 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. 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

Other skills, from other repositories

content-hash-cache-pattern

Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.

affaan-m/ECC · 30 tokens

python-release

Handle Python SDK release, build, bump, packaging metadata, PyPI client pin, uv.lock, nox/build workflow, and publish verification changes. Use for Python release process work or dependency pin bumps; do not use for ordinary Python feature implementation.

ComposioHQ/composio · 53 tokens

modernization-flow

Workflow for converting, modernizing, upgrading, or re-architecting code (e.g. C++→Java, monolith→microservices), etc.

griddynamics/rosetta · 36 tokens

pneuma-session

Instructions for renaming an active Pneuma session and replacing its default preview with a useful title and summary. A Pneuma session is one work area inside a larger project.

pandazki/pneuma-skills · 127 tokens

session-handoff

Use when the user wants to hand off, transfer, pause, or continue the current session in a new session or with another agent — asks for a "session handoff", a "prompt para a próxima sessão", to "continuar de onde paramos", or invokes /session-handoff; also when context is running low and in-flight work must survive a…

will-pagane/claude-superdev-harness · 91 tokens

Cursor rules for Kotlin development with Ktor integration

Skill "Cursor rules for Kotlin development with Ktor integration" from AmariahAK/atlarix-skills, covering cursor rules for kotlin development with ktor integration, when to use this skill, source, core principles and technology stack.

AmariahAK/atlarix-skills · 9 tokens