go-api-development — скилл для Claude Code: разработка Go API
Скилл помогает проектировать и писать REST API на Go со стандартной библиотекой. Пригодится для настройки маршрутов, валидации, обработки ошибок и тестов.
npx skills add Mindrally/skills --skill go-api-development -a claude-codeЧто делает go-api-development
Скилл задаёт рекомендации для REST API на Go: маршрутизацию через http.ServeMux, обработку методов и статусов HTTP, JSON-ответы и проверку входных данных. Он также описывает middleware для логирования, аутентификации и ограничения частоты запросов.
При работе над API агенту предлагается сначала набросать структуру и поток данных. Рекомендации охватывают контекст запросов, синхронизацию общего состояния, защиту входных данных и тесты обработчиков. Здесь есть практическое требование: ориентир — Go 1.22 или новее, поскольку скилл опирается на новый ServeMux.
Скилл предназначен для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. Он задаёт подход к реализации, а не добавляет готовые обработчики или зависимости в проект.
Какие задачи решает
- спроектировать маршруты и поток данных Go API
- обработать ошибки API в JSON с подходящими HTTP-статусами
- проверить тела запросов и параметры маршрута
- добавить middleware для логирования и аутентификации
- написать тесты для обработчиков и бизнес-логики
Примеры запросов агенту
- Спроектируй REST API для этого проекта на Go и опиши маршруты и поток данных.
- Добавь обработчик создания ресурса с валидацией входных данных и JSON-ответом об ошибке.
- Покрой HTTP-обработчики табличными тестами и проверь коды ответов.
Как установить go-api-development
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill go-api-development -a claude-code2Вручную: положить файлы
~/.claude/skills/go-api-development/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/go-api-development/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill go-api-development -a codex2Вручную: положить файлы
.agents/skills/go-api-development/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill go-api-development -a cursor2Вручную: положить файлы
.cursor/skills/go-api-development/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills go-api-development2Вручную: положить файлы
.github/skills/go-api-development/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill go-api-development -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path go-api-developmentВручную: положить файлы
.devin/skills/go-api-development/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill go-api-development -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о go-api-development
Как установить go-api-development в Claude Code?
Выполните npx skills add Mindrally/skills --skill go-api-development -a claude-code. Файл скилла появится по пути ~/.claude/skills/go-api-development/SKILL.md.
Что делает go-api-development?
Скилл направляет агента при разработке Go API: от маршрутизации и валидации до обработки ошибок, безопасности и тестирования.
Какая версия Go нужна для go-api-development?
Рекомендации рассчитаны на Go 1.22 или новее и используют http.ServeMux, появившийся в Go 1.22.
Исходный текст
SKILL.md · Apache-2.0
--- name: go-api-development description: Go API development guidelines using the standard library (1.22+) with best practices for RESTful API design, error handling, and security metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Go API Development with Standard Library ## Core Principles - Always use the latest stable version of Go (1.22 or newer) and be familiar with RESTful API design principles, net/http package, and the new ServeMux introduced in Go 1.22 - Follow the user's requirements carefully and to the letter - First think step-by-step - describe your plan for the API structure, endpoints, and data flow in pseudocode, written out in great detail - Write correct, up-to-date, bug-free, fully functional, secure, and efficient Go code for APIs - Leave NO todos, placeholders, or missing pieces in the API implementation - Always prioritize security, scalability, and maintainability in your API designs ## API Development Guidelines ### Routing and HTTP Handling - Use the new `http.ServeMux` introduced in Go 1.22 for routing - Implement proper HTTP method handling (GET, POST, PUT, DELETE, PATCH) - Use appropriate HTTP status codes for responses - Implement proper content-type handling for requests and responses ### Error Handling - Implement proper error handling, including custom error types when beneficial - Return appropriate HTTP status codes with error responses - Use structured error responses in JSON format - Log errors appropriately for debugging and monitoring ### Input Validation - Implement input validation for API endpoints - Validate request bodies, query parameters, and path parameters - Return clear validation error messages to clients - Sanitize inputs to prevent injection attacks ### JSON Handling - Use `encoding/json` for JSON serialization/deserialization - Implement proper struct tags for JSON field mapping - Handle JSON parsing errors gracefully - Use appropriate JSON formatting for responses ### Concurrency - Leverage Go's built-in concurrency features when appropriate for API performance - Use goroutines for concurrent operations where beneficial - Implement proper synchronization for shared state - Use context for request cancellation and timeouts ### Middleware - Implement middleware for cross-cutting concerns (logging, authentication, rate limiting) - Use middleware chaining for composable request processing - Implement CORS handling where needed - Add request/response logging middleware ### Security - Implement authentication and authorization where appropriate - Use HTTPS in production - Implement rate limiting to prevent abuse - Validate and sanitize all user inputs - Use secure defaults for cookies and sessions ### Logging - Use standard library logging with structured output - Log appropriate information for debugging and monitoring - Avoid logging sensitive information - Use log levels appropriately ### Testing - Write unit tests for handlers and business logic - Implement integration tests for API endpoints - Use table-driven tests where appropriate - Mock external dependencies in tests
© Mindrally · Apache-2.0 · Mindrally/skills