golang-dead-code

Community

Safely detect and remove unused Go code to reduce bloat.

AuthorBizShuk
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Go projects accumulate unused functions, variables, types, unreachable code branches, dead stores, and deprecated API calls over time, increasing maintenance burden, binary size, and technical debt. Manually identifying and removing this dead code is error-prone and risks breaking existing functionality.

Core Features & Use Cases

  • 4-Phase Safe Workflow: Follows a strict Detect → Classify → Apply → Verify process that requires user confirmation before any deletion, and runs build/test checks after each batch of changes to catch breakages early.
  • Comprehensive Dead Code Detection: Identifies 4 categories of dead code: unused symbols (via staticcheck), unreachable code/dead stores (via go vet and staticcheck), module-level unreachable code (via deadcode), and deprecated APIs (via grep for deprecation markers).
  • Risk Classification: Automatically categorizes candidates into Safe, Deprecated-in-use, and Risky buckets to avoid removing exported public APIs, code used via reflection/plugins, or code with hidden callers.
  • Use Case: For a Go microservice codebase, use this skill to safely remove unused internal helper functions and deprecated API calls without breaking existing functionality or public interfaces.

Quick Start

Use the golang-dead-code skill to scan the current Go project for all unused code and deprecated APIs, then guide me through safely removing the confirmed low-risk candidates.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: golang-dead-code
Download link: https://github.com/BizShuk/gosdk/archive/main.zip#golang-dead-code

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 537,000+ vetted skills library on demand.