Creates a clean Go API project skeleton with Fiber framework, MongoDB, and S3/R2 support. Includes Docker setup, routing layers, middleware, and standard project structure. Perfect for scaffolding new API projects with production-ready defaults.
Install
npx skillscat add joseluis21/go-api-skills Install via the SkillsCat registry.
SKILL.md
Skeleton API Go Skill
This skill helps you rapidly scaffold new Go API projects with a proven, production-ready structure.
What It Sets Up
A complete Go API project with:
| Component | Tech |
|---|---|
| Framework | Fiber (lightweight, fast HTTP) |
| Database | MongoDB |
| Storage | AWS S3 / Cloudflare R2 |
| Docker | Multi-stage builds, docker-compose |
| Structure | Layered architecture (routes, middleware, services) |
| Validation | Go Playground Validator |
| Logging | Structured logging (slog + JSON) |
| UUID | UUIDv7 generation |
Directory Structure
project-name/
├── cmd/api/main.go # Entry point
├── internal/
│ ├── container/ # Dependency injection
│ ├── routes/ # Public & private routes
│ ├── middleware/ # Request validation, auth, etc.
│ ├── server/ # Server initialization
│ ├── libraries/
│ │ ├── cloudflare/r2_client.go
│ │ └── mongodb/mongodb_client.go
│ └── shared/
│ ├── response/ # HTTP response helpers
│ ├── utils/ # Utilities (MongoDB, R2, UUID, etc.)
│ └── validatorapi/ # Validation helpers
├── .env.example
├── Dockerfile
├── docker-compose.yml
├── go.mod & go.sum
└── README.mdUsage
When asked to "create a new Go API project" or similar, Claude will:
Step 1: Gather Requirements
- Project name
- Go module name (e.g.,
github.com/username/project) - Base features (MongoDB, R2, routes structure)
Step 2: Generate Structure
This skill automates:
- Creating directory structure
- Generating
go.modwith core dependencies - Creating boilerplate files (main.go, server setup, routes)
- Docker and docker-compose files
- Environment template (.env.example)
Step 3: Provide Setup Steps
Clear commands to initialize and run the project:
cd project-name
go mod tidy
docker-compose up -d # If using MongoDB locally
go run ./cmd/api/main.goKey Features Included
1. Layered Architecture
- Clean separation: routes → middleware → handlers → services
- Easy to test and maintain
2. Dependency Injection (container.go)
- Centralized container for all dependencies
- Pass services cleanly through the app
3. Shared Response Format
- Consistent JSON responses
- Error handling with proper HTTP status codes
4. Validation
- Input validation middleware
- Built-in request validation helpers
5. Logging
- Structured, JSON-based logging (slog)
- Debug, info, error levels
6. Database & Storage Setup
- MongoDB client initialization
- R2/S3 client initialization
- Ready-to-use utility functions
Implementation Details
The skill will generate:
- main.go: Loads .env, initializes MongoDB, R2, sets up server
- server.go: Fiber server with routes and middleware registration
- container.go: Dependency container pattern
- routes files: Separated public and private routes
- middleware/validator.go: Request validation middleware
- Dockerfile: Multi-stage build (builder + runtime Alpine)
- docker-compose.yml: Local MongoDB setup
- .env.example: Template for environment variables
Customization Points
Once generated, you can easily:
- Add more routes (edit
internal/routes/) - Add middleware (edit
internal/middleware/) - Change database operations (edit internal services)
- Modify Docker settings (edit Dockerfile & docker-compose.yml)
Next Steps After Generation
- Replace placeholder names in files (project name, module name)
- Update README.md with your specific API endpoints
- Add domain-specific handlers in
internal/routes/ - Create service layer for business logic
- Implement actual database models in MongoDB