go-abstraction-discipline

Refactor Go code by removing thin wrappers, single-use helpers, and misplaced constants.

Updated Jun 15, 2026
One-click install
npx skills add https://github.com/tanghuo/th-skill --skill go-abstraction-discipline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-abstraction-discipline
Source: https://github.com/tanghuo/th-skill/tree/main/skills/go-abstraction-discipline
Command: npx skills add https://github.com/tanghuo/th-skill --skill go-abstraction-discipline

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill is designed to streamline Go code by removing unnecessary abstractions, improving readability, and enhancing performance.

Core Features & Use Cases

  • Abstraction Removal: Identify and remove thin wrappers, single-use helpers, and low-value constants.
  • Public API Optimization: Keep public method sets small with contract-strengthening siblings.
  • Layer Placement: Place business checks at the business layer and abstractions on the correct semantic layer.
  • Use Case: Refactor a Go codebase to improve maintainability and performance by applying the principles of semantic ownership and minimal abstraction.

Quick Start

Apply the go-abstraction-discipline skill to the code in 'main.go' to enhance its structure and remove unnecessary abstractions.

Frequently Asked Questions about go-abstraction-discipline

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

FAQPage Schema
How do I identify and remove low-value abstractions in Go code?

To remove low-value abstractions in Go, identify thin wrappers, single-use helpers, and misplaced constants, then refactor by enforcing semantic ownership and minimal abstraction to improve maintainability and performance.

Why does my Go codebase have unnecessary thin wrappers and single-use helpers?

Go codebases develop unnecessary thin wrappers and single-use helpers when abstractions are placed on incorrect semantic layers, reducing readability and performance instead of providing genuine structural value.

When do I need to refactor Go code for abstraction removal?

You need to refactor Go code for abstraction removal when your codebase requires performance improvement and maintainability optimization, specifically targeting low-value constants and misplaced business checks.

Can I optimize my public API size during a Go code refactoring?

Yes, you can optimize your public API during Go code refactoring by keeping public method sets small and strengthening contracts with sibling methods to ensure structural discipline.

Where should business checks and abstractions be placed in a Go project?

Business checks should be placed at the business layer, while abstractions must be positioned on their correct semantic layer to ensure minimal abstraction and proper semantic ownership across the Go codebase.