skills/clean-unused-code/SKILL.md
Find and remove unused code in projects. This skill should be used when cleaning up dead code, removing unreachable functions, or optimizing codebase by eliminating unused code. Currently supports Golang projects.
npx skillsauth add bizshuk/llm_plugin clean-unused-codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides workflows for finding and removing unused code in projects. It uses static analysis tools to identify unreachable functions and dead code.
Use this skill when:
| Language | Tool | Install Command |
| -------- | ---------- | --------------------------------------------------- |
| golang | deadcode | go install golang.org/x/tools/cmd/deadcode@latest |
Install the deadcode tool:
go install golang.org/x/tools/cmd/deadcode@latest
Run deadcode from the project root:
deadcode ./...
For projects with test dependencies, include tests:
deadcode -test ./...
The output format is:
<file>:<line>:<column>: unreachable func: <function_name>
Example output:
internal/utils/helper.go:45:1: unreachable func: unusedHelper
pkg/service/old.go:12:1: unreachable func: deprecatedMethod
For each unreachable function:
go build ./... to verify no build errorsAfter removing functions, clean up unused imports:
goimports -w .
Or use gopls organize imports functionality.
[!WARNING]
deadcodemay not detect functions called via:
- Reflection (
reflect.ValueOf().MethodByName())- Interface implementations used through dependency injection
- CGo bindings
- Plugin systems
Do NOT remove functions if:
_test.go files (use -test flag)After cleaning, verify the project:
# Build check
go build ./...
# Test check
go test ./...
# Run deadcode again to confirm
deadcode ./...
tools
運用 codebase MCP 審查 Merge Request,包含邏輯重複、潛在問題、測試覆蓋率與命名一致性檢查
tools
Explore niche markets, generate viral content ideas, write scripts, plan 30-day calendars, monetization, and automation.
development
Scan workspace for potential security risks including exposed passwords, API keys, tokens, and other sensitive data
data-ai
Project metadata update