skills/go-api-docs/SKILL.md
API documentation with OpenAPI/Swagger generated from code annotations, plus service-level README conventions. Trigger: When documenting API endpoints, generating Swagger specs, or writing service documentation.
npx skillsauth add 333-333-333/agents go-api-docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Pattern | Rule |
|---------|------|
| Swagger from annotations | Use swaggo/swag to generate OpenAPI from Go comments |
| Spec lives with service | Each service generates its own docs/swagger.json |
| Proto is self-documenting | gRPC services use protobuf comments as docs |
| README per service | Each service has a README with setup, architecture, API summary |
| Keep specs in sync | Regenerate on every API change — add to CI |
See assets/swagger_main.go
See assets/swagger_handler.go
See assets/swagger_ui.go
Protobuf files are self-documenting. Use comments:
See assets/caregiver.proto
See assets/README_TEMPLATE.md
# Install swag CLI
go install github.com/swaggo/swag/cmd/swag@latest
# Generate docs
swag init -g cmd/server/main.go -o docs
# Dependencies
go get github.com/swaggo/gin-swagger
go get github.com/swaggo/files
go get github.com/swaggo/swag
# View docs
open http://localhost:8080/swagger/index.html
# Makefile target
.PHONY: swagger
swagger:
swag init -g cmd/server/main.go -o docs
| Don't | Do | |----------|-------| | Manually write OpenAPI YAML | Generate from code annotations | | Swagger in production | Disable Swagger UI in production | | Outdated README | Regenerate swagger on API changes, keep README current | | No docs for events | Document published/consumed events in README | | Undocumented protobuf | Add comments to every service, rpc, and message |
testing
Review Flutter components and screens for UX/UI compliance. Trigger: When user invokes /ux-review command or requests UX audit.
development
TypeScript strict patterns and best practices. Trigger: When implementing or refactoring TypeScript in .ts/.tsx (types, interfaces, generics, const maps, type guards, removing any, tightening unknown).
testing
Testing philosophy and strategy for every feature: test pyramid, mandatory levels per change type, completion checklist, and skill delegation. Trigger: When planning tests for a feature, reviewing test coverage, defining acceptance criteria, or asking what tests a change needs.
development
Terraform security practices: sensitive variables, secret management, state protection, .gitignore patterns, and CI/CD credential handling. Trigger: When handling secrets in Terraform, configuring state backends, reviewing .gitignore for Terraform, or setting up CI/CD pipelines for infrastructure.