write-go-servicelisted
Install: claude install-skill a-novel-kit/stack
# Go — Backend Services (clean architecture)
This skill governs Go in the a-novel backend services: repos shaped as
`cmd/` + `internal/{config,lib,dao,core,handlers,models}` + (optionally) `pkg/`. Aim for coherent,
idiomatic, minimal code that strictly respects the layered architecture.
**This skill is layered on `write-go`.** Everything there — read-before-edit, the
`pnpm format:go`/`pnpm lint:go` discipline, dependency policy, naming of packages/files/variables,
constructors, error sentinels and `%w` wrapping, context rules, time-capture-once, secrets
hygiene, the layer-relative span-reporting rule — applies here unchanged; this skill adds the
**service-architecture-specific** rules on top. Load `write-go` and `write-go-tests` (and
`document-code` when documenting) alongside it. For shared libraries under `a-novel-kit` (`golib`,
`jwt`, …) load `write-go-kit` instead of this skill.
**Before touching any layer**, read its sibling files, the interfaces it depends on, and the
interfaces it exposes. These services are deliberately consistent — copy the established pattern
exactly; coherence outranks preference.
---
## After every edit
Run the base loop from `write-go` (`pnpm generate:go` when interfaces/proto changed →
`pnpm format:go` → `pnpm lint:go`), then:
1. **`write-go-tests`** — tests for every file touched; run `a-novel test --type=go -y` (or raw
`go test` on the one package being iterated), the narrowest target that covers the change.
Reserve the full `a-no