go-api
Scaffold a new Go HTTP API service with its local development stack and observability. Use when the user asks to create a new Go API service or project.
от Integralist★ 31 звезда на GitHub
Установить go-api в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Go API Service
Scaffold a production-ready Go API service: the handlers → service → repository layout, config, structured logging, middleware, metrics, and tracing, plus a Makefile that runs it locally with MySQL, Redis, and a Grafana observability stack. All generated Go follows conventions-go and its service architecture; the templates here are the files to generate, not a second set of rules.
- Ask for the service name and module path: a kebab-case name such as
user-service, and a module path such asgithub.com/myorg/myservice. Derive{SERVICE_NAME}(kebab-case),{SERVICE_NAME_SNAKE},{SERVICE_NAME_PASCAL}, and{MODULE_PATH}from them. Done when all four placeholders have values. - Generate the project in the layout below, resolving every placeholder.
Use the templates where one exists; write the other packages to the
contracts below, so they fit the templates that call them. Give every
package a
doc.goand a shortREADME.md, as conventions-go requires. Done when every file in the layout exists and no{…}placeholder is left. - Initialise and check it. Create
go.modas go-mod.md describes, then runmake fmt,make lint-all, andmake test. Done when all three pass.
Parallel scaffold. The placeholder map is fixed, so instantiating the
templates is a
verified-pattern fan-out: generate one
representative package (internal/api) first and confirm the substitutions
and layout with the user, then have subagents instantiate the rest in
parallel, following the shared completion and retry protocol.
Layout
{SERVICE_NAME}/
├── cmd/api/main.go
├── internal/
│ ├── api/ config/ contextx/ deps/ env/ errorsx/ httpx/
│ └── logx/ metrics/ middleware/ mysql/ redis/ traces/
├── docs/
│ ├── projects/completed/
│ ├── projects/README.md
│ └── architecture.md
├── e2e/
├── local/
│ ├── config/ mysql/ observability/
├── scripts/
├── go.mod go.sum Makefile AGENTS.md README.md
Packages that shadow a standard-library name take an x suffix: logx,
httpx, errorsx, contextx, timex.
Templates
cmd/apiandinternal/api: internal-api.mdinternal/config: internal-config.mdinternal/logx: internal-logx.mdinternal/middleware: internal-middleware.mdgo.mod: go-mod.mdMakefile: makefile.mdlocal/config: config-local.mdlocal/mysql: docker-compose-mysql.mdlocal/observability: docker-compose-obs.md
Contracts for packages without a template
The templates call these, so write each package to match:
contextx:WithComponent(ctx, name) context.Context,RoutePatternContextKey,RoutePatternFromContext(ctx) (string, bool).deps:Dependencies{MySQLFailed, RedisFailed bool}.env:type Environment string, andAll []Environmentholdinglocal,dev,stg, andprd.errorsx: domain sentinels such asErrNotFound, andNewProblem(title, detail)for RFC 7807 responses.httpx:WriteJSON(ctx, logger, w, status, v).metrics:New(registry, component, logger) *Metrics,StoreCreate(*Store),StartServer(ctx, logger, host, port) *http.Server,RegisterGauge,Count,RequestsTotal,RequestDuration,RequestSize,ResponseSize, andWithHealthCheckMetrics.mysql:New(ctx, config.MySQL, logger) (*sql.DB, error), reading the password fromMYSQL_PASSWORDso it stays out of the config file.redis:NewClient(ctx, logger, *config.Config) (*redis.Client, error).traces:New(ctx, serviceName) (shutdown func(context.Context) error, tracer, error),WithSpan(ctx, tracer, name, fn),AddAttributesToCurrentSpan, andGetTraceID(ctx) string.
Running locally
make tools-install # first-time setup
make run # API + MySQL + Redis + observability
make test # unit tests
make test-integration # end-to-end tests against the running stack
make lint-all # every linter
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- templates/config-local.md
- templates/docker-compose-mysql.md
- templates/docker-compose-obs.md
- templates/go-mod.md
- templates/internal-api.md
- templates/internal-config.md
- templates/internal-logx.md
- templates/internal-middleware.md
- templates/makefile.md
FAQ
Что делает скилл go-api?
Scaffold a new Go HTTP API service with its local development stack and observability. Use when the user asks to create a new Go API service or project.
Как установить скилл go-api?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл go-api запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…