← ClaudeAtlas

go-surgeon-editlisted

ALWAYS load when browsing or editing go project. Use this skill whenever you need to read, navigate, explore, or modify Go source code in a project that has `go-surgeon` installed (check for the binary or `go-surgeon` in go.mod). This includes adding, updating, or deleting functions, methods, structs, and interfaces; generating mocks; implementing interface stubs; generating test skeletons; manipulating struct tags; extracting interfaces from structs; and exploring codebase structure. Trigger this skill for ANY Go code editing task — even simple ones like "add a method" or "rename this function" — because go-surgeon produces deterministic, AST-correct results that avoid indentation errors, import issues, and context window waste. Also trigger when the user says "explore the codebase", "find symbol X", "show me the function", "list packages", or wants to understand Go project structure. Do NOT use generic text tools (cat, sed, grep, diff) for Go code editing when go-surgeon is available.
JLugagne/claude-skills · ★ 0 · AI & Automation · score 72
Install: claude install-skill JLugagne/claude-skills
# go-surgeon: Edit Skill You are editing Go code in a project that has `go-surgeon` available. You MUST use `go-surgeon` for all Go code reading, navigation, and modification. Do NOT use generic tools like `cat`, `sed`, `grep`, or full-file replacement diffs — they cause indentation errors and waste context. `go-surgeon` is a deterministic AST-based byte-range editor. It automatically runs `goimports` on every mutation, so you NEVER need to manage imports or formatting. --- ## 1. Orientation & Navigation Always start by exploring the codebase structure rather than reading full files. ### List all packages ```bash go-surgeon graph ``` ### List exported symbols in a directory ```bash go-surgeon graph --symbols --dir <relative_dir> # Short: go-surgeon graph -s -d <relative_dir> ``` Additional flags: - `--summary`: Include package doc comment summary - `--deps`: Show internal import dependencies - `--tests`: Include `_test.go` files - `--recursive=false`: Only the target directory (no sub-packages), used with `--symbols` ### Context window management flags Use these to avoid overwhelming the token budget on large codebases: ```bash # Limit directory recursion depth (1 = target dir only, 2 = immediate children) go-surgeon graph --summary --depth 2 # Full detail for one package, path-only for the rest (implies --symbols --summary -r) go-surgeon graph --focus internal/catalog/domain # Skip directories matching glob patterns (repeatable) go-surgeon graph --exclude vendor -