go-modify

Perform gopls-assisted multi-file Go code modifications with pre-edit validation.

2|1|Updated Apr 10, 2023
One-click install
npx skills add https://github.com/popoffvg/dotfiles --skill go-modify
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-modify
Source: https://github.com/popoffvg/dotfiles/tree/main/skills/go-modify
Command: npx skills add https://github.com/popoffvg/dotfiles --skill go-modify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables safe, multi-file Go code modifications by leveraging gopls MCP for analysis and validation, including pre-edit checks and static analysis.

Core Features & Use Cases

  • Pre-edit analysis: reads target files to confirm build tags, code-generation markers, and context propagation patterns before edits.
  • Cross-file refactoring support: renames symbols and updates references across multiple packages with reference tracking.
  • Validation & safety: runs gopls MCP diagnostics and enforces project rules to prevent breaking changes.

Quick Start

Provide the target changes and run the pre-edit analysis, then apply coordinated edits across all affected files.

Frequently Asked Questions about go-modify

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

FAQPage Schema
How do I safely rename Go symbols across multiple packages?

To safely rename Go symbols across multiple packages, you need reference tracking and pre-edit validation to update all references without breaking imports. This requires static analysis checks to ensure types and contexts remain correct across affected files.

What is gopls-assisted multi-file Go refactoring?

Gopls-assisted multi-file Go refactoring is a process that uses the gopls language server for static analysis and diagnostics to apply coordinated code modifications. It validates build tags, imports, and contexts before applying edits to guarantee safe changes.

How do I refactor Go code that touches multiple build-tagged files?

Refactoring Go code across build-tagged files requires reading target files first to confirm build tags and code-generation markers. You then apply coordinated edits while tracking references to ensure context propagation patterns and imports remain valid.

Does gopls MCP validation prevent breaking changes during Go refactoring?

Yes, gopls MCP validation prevents breaking changes during Go refactoring by running diagnostics and enforcing project rules before edits are applied. It checks imports, types, and contexts to ensure structural integrity across all modified files.

Can I use static analysis for Go code modification without breaking references?

You can use static analysis for Go code modification without breaking references by running pre-edit checks that track symbol usage across packages. This validates context propagation and confirms code-generation markers before applying complex edits.