By BizShuk
Go development toolkit for github.com/bizshuk/gosdk — bundles 9 Go-focused skills (code-quality, dead-code, dev, gosdk, mvc, naming, network, performance-tuning, zap→slog) and the assertive `golang-refactor` agent that auto-invokes eight specialized skills to actively rewrite code breaking SOLID, MVC, naming, error handling, context propagation, or performance conventions (not just report). Triggers: refactor, review, audit, clean up, restructure, improve.
Use when reviewing Go code, generating new Go code, refactoring existing Go codebases, or creating any new Go file/package. Triggers on requests like "review this Go code", "refactor this Go file", "is this Go idiomatic", "apply SOLID". Keywords - simplicity, scalability, SOLID, package structure, error handling, context propagation, dependency injection.
Use when the user asks to detect or remove dead code in a Go project — unused functions/vars/types/consts, unreachable branches, dead stores, deprecated APIs. Keywords - staticcheck, deadcode, unparam, U1000.
Use when writing Go code in a gosdk-based project — building a CLI with cobra, configuring apps with viper, adding database connections (SQLite, MySQL, or PostgreSQL via gorm), structured logging with slog, test setup with testify, escape analysis for hot paths, or selecting between stdlib and third-party libraries.
Use when developing, reviewing, or refactoring Go applications that utilize the github.com/bizshuk/gosdk library for configuration management, HTTP routing, logging, or data processing.
Use when implementing features or refactoring in Go projects that follow MVC layering (handler/service/repository/model), or when code violates layer boundaries (handler doing DB access, business logic in service, fat models). Keywords - layer rules, interface placement, constructor injection, error wrapping, context propagation. Distinct from golang-code-quality which focuses on SOLID and code-level patterns.
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Go 語言通用開發工具包 (Shared SDK),提供設定管理、HTTP 服務骨架、程式碼產生器、版本管理、通用通知、編碼轉換等可重用模組,作為 Go 專案的基礎函式庫使用。
本 repo 同時是 Claude Code plugin:除了作為 Go 函式庫被 import,也可安裝為 Claude Code plugin 取得 9 個 Go 專用 skills 與 golang-refactor agent。安裝方式見最下方 Claude Code Plugin.
統一管理應用程式設定來源,支援 .env、YAML、JSON 及 embed.FS 四種格式,透過 Viper 實現階層式設定合併。各格式採用雙檔案載入模式:固定讀取 base 檔案(.env、config.yaml、settings.json),再合併同名 .local 覆寫檔(.env.local、config.local.yaml、settings.local.json),不再依賴 PROFILE 環境變數。同時支援 APP_ 前綴環境變數自動綁定。DB 連線另由獨立的 db 套件負責(見下一節),不在 config/ 範圍。
領域流程 (Domain Flow):
config.Default()(可加 WithAppName("myapp") 等 option)啟動設定載入;搜尋目錄固定為 .、./conf、~/.config/<appName>EnvConfig.Load() 讀取 .env → .env.local 並合併至全域 ViperYamlConfig.Load() 讀取 config.yaml → config.local.yaml 並合併至全域 ViperJsonConfig.Load() 讀取 settings.json → settings.local.json 並合併至全域 ViperAPP_ 前綴環境變數自動綁定(viper.AutomaticEnv())viper.GetString() 或 viper.Unmarshal() 取得設定值核心實體 (Key Entities): Config 介面, EnvConfig, YamlConfig, JsonConfig, FSConfig
相關處理器 (Related Handlers): config.Default(), GetAppConfigDir(), WithAppName(), WithDefaultValue(), NewEnvConfig(), NewYamlConfig(), NewJsonConfig(), NewFSConfig()
每種儲存型態是一個獨立的 service:有自己的型別、自己的全域 singleton、自己的扁平 viper key (例如 SQLITE_PATH、MYSQL_DSN、POSTGRES_DSN)。micro-service 概念下,一個 process 內不應該存在兩個同型態的 service;InitSQLite() / InitMySQL() / InitPostgres() 在第二次呼叫時會回傳 error,守護 singleton 不變性。
領域流程 (Domain Flow):
config.Default() 載入設定後,呼叫端用 viper.IsSet("SQLITE_PATH") / viper.IsSet("MYSQL_DSN") / viper.IsSet("POSTGRES_DSN") 判斷是否啟用該儲存db.InitSQLite() / db.InitMySQL() / db.InitPostgres() 從 viper 讀取設定、開啟連線、設為 singletondb.DefaultSQLite.DB() / db.DefaultMySQL.DB() / db.DefaultPostgres.DB() 取得 *gorm.DBdb.DefaultSQLite.Close() / db.DefaultMySQL.Close() / db.DefaultPostgres.Close() 釋放連線核心實體 (Key Entities): Service 介面, SQLite struct, MySQL struct, Postgres struct, DefaultSQLite / DefaultMySQL / DefaultPostgres singleton
相關處理器 (Related Handlers): db.InitSQLite(), db.InitMySQL(), db.InitPostgres(), db.DefaultSQLite.DB(), db.DefaultSQLite.Close(), db.DefaultMySQL.DB(), db.DefaultMySQL.Close(), db.DefaultPostgres.DB(), db.DefaultPostgres.Close()
基於 Gin 框架提供 HTTP 服務骨架,包含預設路由註冊、health check 端點、ping/pong 端點、stats 資訊端點,以及 Correlation ID 請求追蹤與 Helmet 安全性標頭中介層。設計為可嵌入其他 Go 專案的服務基礎模組。
領域流程 (Domain Flow):
main() 依序執行:config.Default() → log.Init() → 資料庫連線 → HTTPServer()HTTPServer() 建立 gin.Default() 引擎,掛載 mw.CorrelationID() 與 mw.Helmet() 中介層router.Default(s) 註冊 /stats 路由,回傳版本、Profile、設定檔路徑及 Correlation IDrouter.HealthRouterGroup(s) 透過 gin-healthcheck 套件提供 /healthz 端點router.PingRouterGroup(s) 提供 /ping/ 端點,回應 {"message": "pong"}server.host:server.port 設定值(預設 :8080)核心實體 (Key Entities): Stats 結構, CorrelationHeader 常數
相關處理器 (Related Handlers): HTTPServer(), router.Default(), StatsHandler(), HealthRouterGroup(), PingRouterGroup(), mw.CorrelationID(), mw.GetCorrelationID(), mw.Helmet()
提供兩個 CLI 工具:stringer 為增強版常數列舉產生器,從 Go AST 解析常數定義並自動產生 String()、List()、ValueList()、Map()、ValueMap() 五個方法;gotmpl 為模板渲染引擎,透過 Cobra CLI 讀取 YAML 設定,搭配 gomplate 函式庫渲染嵌入的 Go 模板。
領域流程 (Domain Flow) — stringer:
-type、-output、-trimprefix、-linecomment、-tags 等參數Generator.ParsePackage() 使用 golang.org/x/tools/go/packages 載入目標套件語法樹File.GenDecl() 遍歷 AST 常數宣告,收集符合目標型別的 Value 清單Generator.Generate() 根據連續序列數量選擇 buildOneRun / buildMultipleRuns / buildMap 策略產生 String() 方法GeneratorEx.generate() 額外呼叫 buildListFn / buildValueListFn / buildMapFn / buildValueMapFn 產生四個輔助函式Generator.Format() 格式化並輸出至指定檔案領域流程 (Domain Flow) — gotmpl:
--config 參數,透過 Viper 讀取 YAML 設定TemplateLoader 結構TemplateLoader.Load() 從 embed.FS 載入 .tmpl 模板gomplate.CreateFuncs 提供進階模板函式進行渲染,輸出至 stdout核心實體 (Key Entities): Generator, GeneratorEx, File, Package, Value, TemplateLoader
相關處理器 (Related Handlers): Generator.ParsePackage(), Generator.Generate(), GeneratorEx.generate(), SplitIntoRuns(), File.GenDecl(), TemplateLoader.Load()
提供 versioning CLI 工具,用於管理專案的語義版本號(Semantic Versioning)。從 version 檔案讀取與寫入版本資訊,支援 major、minor、patch 三個子命令分別遞增對應的版本號碼。設計為 CI/CD 流程中的版本自動化工具。
領域流程 (Domain Flow):
npx claudepluginhub bizshuk/gosdkComprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.
Develop, test, build, and deploy Godot 4.x games with Claude Code. Includes GdUnit4 testing, web/desktop exports, CI/CD pipelines, and deployment to Vercel/GitHub Pages/itch.io.
Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review
Lazy senior dev mode. Forces the simplest, shortest solution that actually works: YAGNI, stdlib first, no unrequested abstractions.
Comprehensive PR review agents specializing in comments, tests, error handling, type design, code quality, and code simplification
A growing collection of Claude-compatible academic workflow bundles. Covers scientific figures, manuscript writing and polishing, reviewer assessment, citation retrieval, data availability, paper reading, literature search, response letters, paper-to-PPTX conversion, and evidence-grounded Chinese invention patent drafting. Rules are organized as reusable skill folders with explicit workflows and quality checks.