golang-dev

Generates cobra CLI scaffolding with viper configs and gorm database connections for Go/gosdk projects.

Updated Aug 9, 2022
One-click install
npx skills add https://github.com/BizShuk/gosdk --skill golang-dev-bizshuk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-dev
Source: https://github.com/BizShuk/gosdk/tree/main/skills/golang-dev
Command: npx skills add https://github.com/BizShuk/gosdk --skill golang-dev-bizshuk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the guesswork and inconsistency of building Go applications with the gosdk framework, providing standardized patterns for common development tasks so you can focus on business logic instead of boilerplate setup.

Core Features & Use Cases

  • CLI Scaffolding: Provides cobra-based command-line interface patterns, including root/subcommand structure, flag binding, and gosdk metric hooks for tracking CLI invocations.
  • Configuration & Database Setup: Guides viper-based configuration loading using gosdk's config.Default(), plus singleton database connection setup for SQLite, MySQL, and PostgreSQL via gorm.
  • Build, Test & Optimization: Includes standardized build and test commands, escape analysis guidance for optimizing memory-sensitive hot paths, and recommendations for logging, linting, and mocking libraries. Use Case: For a Go microservice built with gosdk, use this Skill to quickly scaffold a production-ready CLI with proper config loading, database connections, and structured logging without writing repetitive boilerplate code.

Quick Start

Use the golang-dev skill to scaffold a new cobra-based CLI for your gosdk project with proper viper config loading and metric tracking enabled.

Frequently Asked Questions about golang-dev

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

FAQPage Schema
How do I scaffold a cobra CLI with viper configuration in a Go project?

To scaffold a cobra CLI with viper configuration, establish a root and subcommand structure, bind flags, and load config via viper using default settings to eliminate repetitive boilerplate setup in Go microservices.

What is the best way to set up gorm database connections for Go microservices?

The best way to set up gorm database connections is using singleton patterns for SQLite, MySQL, and PostgreSQL, ensuring production-ready database access without writing repetitive boilerplate code for each Go service.

How does escape analysis help with Go memory optimization in hot paths?

Escape analysis helps with Go memory optimization by identifying variable allocations that escape to the heap, allowing developers to refactor memory-sensitive hot paths and reduce garbage collection overhead in performance-critical code.

Can I use gosdk conventions for standardizing Go build and test workflows?

You can use gosdk conventions to standardize Go build and test workflows by enforcing standard library preferences, applying consistent build commands, and integrating recommended linting and mocking libraries for production-ready code.

Does gosdk provide patterns for integrating metric tracking in cobra commands?

Yes, gosdk provides patterns for integrating metric tracking in cobra commands by attaching metric hooks to the CLI structure, allowing you to track command-line tool invocations directly within your Go microservices.