harness/plugins/common/claude/skills/go-modify/SKILL.md
Gopls-validated Go code changes — renames, refactoring, multi-file coordinated changes with reference tracking. Includes pre-edit analysis of file constraints, resource lifecycle checks, and static analysis. Use for any non-trivial Go file edits.
npx skillsauth add popoffvg/dotfiles go-modifyInstall 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.
Modify Go code using gopls MCP tools for analysis and validation.
Use when:
Skip when:
go-understanding skill firstBefore making any changes, read the ENTIRE target file and note:
//go:build integration, //go:build !windows, etc. — your code must respect these// Code generated ... DO NOT EDIT — never edit generated files, edit the generator or template insteadfmt.Errorf wrapping, sentinel errors, custom error types? Match it.context.Context? New functions must follow the same pattern.//nolint:, //lint:ignore — understand why they exist before removing or addingIf your change creates resources, verify cleanup exists:
os.CreateTemp / os.MkdirTemp → defer os.Remove(name) / defer os.RemoveAll(dir)os.Open / os.Create → defer f.Close()sync.WaitGroup → ensure Add/Done/Wait are balancednet.Listener / net.Conn → defer listener.Close()*sql.Rows → defer rows.Close()CLAUDE.md and .claude/rules/ if they existgolangci-lint config (.golangci.yml) for enabled lintersWhen the task is to “cover all reachable methods” or similar:
go_symbol_references, callers/callees, or equivalent) to produce a concrete reachable set.needs verification instead of silently keeping it.Never pause mid-task to ask "shall I proceed?" or similar. When the intent is clear, complete all phases autonomously. Only ask if a destructive ambiguity is discovered (e.g., two symbols with identical names in different packages).
Before modifying any symbol:
mcp gopls go_symbol_references: file="/path/to/file.go" symbol="SymbolName"
Use Edit tool to modify code. Update all references found in step 3.1.
After EVERY edit:
mcp gopls go_diagnostics: files=["/path/to/edited/file.go"]
If diagnostics report errors:
After all edits are complete, before staging:
# Compilation check
go build ./...
# Vet — catches common mistakes (printf args, unreachable code, etc.)
go vet ./...
# Race detector on tests if concurrency is involved
go test -race -count=1 ./affected/package/...
Fix all errors. go vet findings are not optional — they indicate real bugs.
If the project has golangci-lint:
golangci-lint run ./affected/package/...
mcp gopls go_symbol_references — Find all symbol referencesmcp gopls go_diagnostics — Validate changesReport:
go vet / linter resultsEval checklist:
go build ./... pass after all edits were complete?Test inputs:
Can change: pre-edit checklist, gopls validation steps, error recovery instructions, file constraint analysis Cannot change: gopls requirement for multi-file changes, read-before-edit rule, build verification step Min sessions before eval: 5 Runs per experiment: 3
testing
Use when the user asks to create test sets, enumerate scenarios, generate edge cases, or draft a coverage matrix before implementation.
testing
Use when the user asks to review, audit, score, or validate test sets for missed cases before execution or merge.
tools
Test harness plugins in isolation using tmux panes. Runs MCP servers, unit tests, typecheck, and Claude plugin loading. Use when user says "test plugin", "check plugin", "run plugin tests", "validate plugin", or names a specific plugin to test.
development
Guide for designing integration and e2e tests using BDD (Behavior-Driven Development) methodology with Cucumber-style Given/When/Then scenarios. Use when writing or reviewing tests for any service, API, or component. Language-agnostic — covers scenario structure, step notation, assertion principles, async patterns, and common anti-patterns.