GoFrame Development

Scaffold GoFrame v2 web applications with routing, middleware, and YAML configuration.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/futuretea/x-project --skill goframe-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: GoFrame Development
Source: https://github.com/futuretea/x-project/tree/main/.claude/skills/goframe-development
Command: npx skills add https://github.com/futuretea/x-project --skill goframe-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GoFrame Development helps developers quickly scaffold, structure, and implement production-ready web services using the GoFrame framework by providing concise patterns for routing, middleware, controllers, configuration, and error handling.

Core Features & Use Cases

  • Project scaffolding and structure: Standard layout for controllers, services, models, DAO, resources, and entry points to improve maintainability.
  • Routing and middleware patterns: Group routing, nested groups, and middleware registration examples for CORS, authentication, and logging.
  • Controller and DTO patterns: Object-based controller patterns, request/response structs with validation tags, and standardized error responses for consistent APIs.
  • Configuration and deployment guidance: YAML configuration access patterns and notes for using SQLite locally and PostgreSQL in production.
  • Use Case: Scaffold a user management API with grouped routes, middleware for auth and CORS, validated request structs, and JSON responses.

Quick Start

Create a new Go module, add GoFrame v2, and scaffold a minimal server that binds a root handler returning Hello World on port 8000.

Frequently Asked Questions about GoFrame Development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up group routing and middleware in a GoFrame web application?

Group routing in GoFrame is configured by defining nested route groups and chaining middleware for CORS, authentication, and logging. This pattern isolates route logic and applies consistent request preprocessing across your API endpoints.

What is the standard project structure for a modular GoFrame v2 API?

A standard GoFrame v2 project structure separates controllers, services, models, DAO, and resources. This modular layout isolates business logic from request handling to improve maintainability for production-ready web services.

How do I implement object-based controllers with request validation in GoFrame?

Object-based controllers in GoFrame use request and response structs with validation tags. This pattern automatically validates incoming JSON payloads and returns standardized error responses for consistent API behavior.

Can I use SQLite for local development and PostgreSQL for production in GoFrame?

Yes, GoFrame supports configuring SQLite locally and PostgreSQL in production. You manage these database settings alongside server configurations using YAML files accessed via the g.Cfg component.

Does GoFrame v2 require Go 1.25 or higher for development?

Yes, building GoFrame v2 web applications requires Go 1.25 or higher. This environment prerequisite ensures compatibility with its object-based controller patterns, group routing, and structured JSON responses.

How does error handling work with structured JSON responses in GoFrame?

Error handling in GoFrame uses the gerror package to return detailed errors. These are processed alongside request validation to generate standardized JSON error responses for the client.