[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M785HBB3TCKJBY61ESV12P93":3,"skill-same:01M785HBB3TCKJBY61ESV12P93":109},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":14,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":62},"01M785HBB3TCKJBY61ESV12P93","golang-troubleshooting",null,"Troubleshoot Golang programs systematically - find and fix the root cause. Use when encountering bugs, crashes, deadlocks, races, or unexpected behavior in Go code. Covers debugging methodology, common Go pitfalls, test-driven debugging, pprof setup and capture, Delve, race detection, GODEBUG tracing, and production debugging. Start here for any 'something is wrong' situation. Not for interpreting profiles or benchmarking (→ See `samber\u002Fcc-skills-golang@golang-benchmark` skill), applying optimization patterns (→ See `samber\u002Fcc-skills-golang@golang-performance` skill), or designing new code (→ See `samber\u002Fcc-skills-golang@golang-safety` skill for defensive coding, `samber\u002Fcc-skills-golang@golang-concurrency` skill for concurrency design).","gn00678465\u002Fapm-go","gn00678465","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F37042723?v=4","01M785CK18TS9AF7G28E00EYXZ","MADAO","01M785CK28RVWVYNVMJNJ48CQ7",0,"MIT","https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: golang-troubleshooting\ndescription: \"Troubleshoot Golang programs systematically - find and fix the root cause. Use when encountering bugs, crashes, deadlocks, races, or unexpected behavior in Go code. Covers debugging methodology, common Go pitfalls, test-driven debugging, pprof setup and capture, Delve, race detection, GODEBUG tracing, and production debugging. Start here for any 'something is wrong' situation. Not for interpreting profiles or benchmarking (→ See `samber\u002Fcc-skills-golang@golang-benchmark` skill), applying optimization patterns (→ See `samber\u002Fcc-skills-golang@golang-performance` skill), or designing new code (→ See `samber\u002Fcc-skills-golang@golang-safety` skill for defensive coding, `samber\u002Fcc-skills-golang@golang-concurrency` skill for concurrency design).\"\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.3.1\"\n  openclaw:\n    emoji: \"🔍\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang\n    requires:\n      bins:\n        - go\n        - dlv\n    install:\n      - kind: go\n        package: github.com\u002Fgo-delve\u002Fdelve\u002Fcmd\u002Fdlv@latest\n        bins: [dlv]\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Bash(dlv:*) Agent WebFetch WebSearch AskUserQuestion\npaths:\n  - \"**\u002F*.go\"\n---\n\n**Persona:** You are a Go systems debugger. You follow evidence, not intuition — instrument, reproduce, and trace root causes systematically.\n\n**Thinking mode:** Reason as thoroughly as possible for debugging and root cause analysis — rushed reasoning leads to symptom fixes, deep thinking finds the actual root cause. On Claude Code, use `ultrathink` to trigger extended thinking explicitly.\n\n**Orchestration mode:** Fan out the five bug-category sub-agents described in Codebase bug hunt mode for a codebase-wide bug hunt. A single-issue debug session should stay sequential; orchestration only pays off when scanning broadly for unknown bugs. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.\n\n**Modes:**\n\n- **Single-issue debug** (default): Follow the sequential Golden Rules — read the error, reproduce, one hypothesis at a time. Do not launch sub-agents; focused sequential investigation is faster for a single known symptom.\n- **Codebase bug hunt** (explicit audit of a large codebase): Launch up to 5 parallel sub-agents, one per bug category (nil\u002Finterface, resources, error handling, races, context\u002Fslice\u002Fmap). Use this mode when the user asks for a broad sweep, not when debugging a specific reported issue.\n\n**Dependencies:**\n\n- dlv: `go install github.com\u002Fgo-delve\u002Fdelve\u002Fcmd\u002Fdlv@latest`\n\n# Go Troubleshooting Guide\n\n**NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.** Symptom fixes create new bugs and waste time. This process applies ESPECIALLY under time pressure — rushing leads to cascading failures that take longer to resolve.\n\nWhen the user reports a bug, crash, performance problem, or unexpected behavior in Go code:\n\n1. **Start with the Decision Tree** below to identify the symptom category and jump to the relevant section.\n2. **Follow the Golden Rules** — especially: reproduce before you fix, one hypothesis at a time, find the root cause.\n3. **Work through the General Debugging Methodology** step by step. Do not skip steps.\n4. **Watch for Red Flags** in your own reasoning. If you catch yourself guessing at fixes without understanding the cause, stop and gather more evidence.\n5. **Escalate tools incrementally.** Start with the simplest diagnostic (`fmt.Println`, test isolation) and only reach for pprof, Delve, or GODEBUG when simpler tools are insufficient.\n6. **Never propose a fix you cannot explain.** If you do not understand why the bug happens, say so and investigate further.\n\n## Quick Decision Tree\n\n```\nWHAT ARE YOU SEEING?\n\n\"Build won't compile\"\n  → go build .\u002F... 2>&1, go vet .\u002F...\n  → See [compilation.md](.\u002Freferences\u002Fcompilation.md)\n\n\"Wrong output \u002F logic bug\"\n  → Write a failing test → Check error handling, nil, off-by-one\n  → See [common-go-bugs.md](.\u002Freferences\u002Fcommon-go-bugs.md), [testing-debug.md](.\u002Freferences\u002Ftesting-debug.md)\n\n\"Random crashes \u002F panics\"\n  → GOTRACEBACK=all .\u002Fapp → go test -race .\u002F...\n  → See [common-go-bugs.md](.\u002Freferences\u002Fcommon-go-bugs.md), [diagnostic-tools.md](.\u002Freferences\u002Fdiagnostic-tools.md)\n\n\"Sometimes works, sometimes fails\"\n  → go test -race .\u002F...\n  → See [concurrency-debug.md](.\u002Freferences\u002Fconcurrency-debug.md), [testing-debug.md](.\u002Freferences\u002Ftesting-debug.md)\n\n\"Program hangs \u002F frozen\"\n  → curl localhost:6060\u002Fdebug\u002Fpprof\u002Fgoroutine?debug=2\n  → See [concurrency-debug.md](.\u002Freferences\u002Fconcurrency-debug.md), [pprof.md](.\u002Freferences\u002Fpprof.md)\n\n\"High CPU usage\"\n  → pprof CPU profiling\n  → See [performance-debug.md](.\u002Freferences\u002Fperformance-debug.md), [pprof.md](.\u002Freferences\u002Fpprof.md)\n\n\"Memory growing over time\"\n  → pprof heap profiling\n  → See [performance-debug.md](.\u002Freferences\u002Fperformance-debug.md), [concurrency-debug.md](.\u002Freferences\u002Fconcurrency-debug.md)\n\n\"Slow \u002F high latency \u002F p99 spikes\"\n  → CPU + mutex + block profiles\n  → See [performance-debug.md](.\u002Freferences\u002Fperformance-debug.md), [diagnostic-tools.md](.\u002Freferences\u002Fdiagnostic-tools.md)\n\n\"Simple bug, easy to reproduce\"\n  → Write a test, add fmt.Println \u002F log.Debug\n  → See [testing-debug.md](.\u002Freferences\u002Ftesting-debug.md)\n```\n\n**Remember:** Read the Error → Reproduce → Measure One Thing → Fix → Verify\n\nMost Go bugs are: missing error checks, nil pointers, forgotten context cancel, unclosed resources, race conditions, or silent error swallowing.\n\n## The Golden Rules\n\n### 1. Read the Error Message First\n\nGo error messages are precise. Read them fully before doing anything else:\n\n- **File and line number** → go directly there\n- **Type mismatch** → check function signatures, interface satisfaction\n- **\"undefined\"** → check imports, exported names, build tags\n- **\"cannot use X as Y\"** → check concrete types vs interfaces\n\n### 2. Reproduce Before You Fix\n\nNEVER debug by guessing — reproduce first. Always:\n\n- Write a failing test that captures the bug\n- Make it deterministic\n- Isolate the minimal failing example\n- Use `git bisect` to find the breaking commit\n\n### 3. If You Don't Measure It, You're Guessing\n\nNever rely on intuition for performance or concurrency bugs:\n\n- **pprof over intuition**\n- **race detector over reasoning**\n- **benchmarks over assumptions**\n\n### 4. One Hypothesis at a Time\n\nChange one thing, measure, confirm. If you change three things at once, you learn nothing.\n\n### 5. Find the Root Cause — No Workarounds\n\nYou MUST understand **why** the bug happens before writing a fix. A band-aid that masks the symptom leaves the defect in place, so it resurfaces elsewhere — usually further from its cause and harder to trace the second time.\n\nWhen you don't understand the issue:\n\n- **Trace the data flow backwards** from the symptom to its origin.\n- **Question your assumptions.** The code you trust might be wrong.\n- **Ask \"why\" five times.** Keep going until you reach the actual root cause.\n- **Perform more troubleshooting checks.** More fmt.Println, more output inspection...\n\n### 6. Research the Codebase, Not Just the Diff\n\nBefore flagging a bug or proposing a fix, trace the data flow and check for upstream handling. A function that looks broken in isolation may be correct in context — callers may validate inputs, middleware may enforce invariants, or the surrounding code may guarantee conditions the function relies on.\n\n1. **Trace callers** — who calls this function and with what values? Call sites can be found with code search tools. → See `samber\u002Fcc-skills-golang@golang-gopls` skill to resolve the actual symbol through interfaces and embedding — it finds indirect call sites and skips unrelated same-named identifiers that plain grep would respectively miss or falsely match.\n2. **Check upstream validation** — input parsing, type conversions, or guard clauses earlier in the chain may make the \"bug\" unreachable.\n3. **Read the surrounding code** — middleware, interceptors, or init functions may set up state the function depends on.\n\n**When the context reduces severity but doesn't eliminate the issue:** still report it at reduced priority with a note explaining which upstream guarantees protect it. Add a brief inline comment (e.g., `\u002F\u002F note: safe because caller validates via parseID() which returns uint`) so the reasoning is documented for future reviewers.\n\n### 7. Start Simple\n\nSometimes `fmt.Println` IS the right tool for local debugging. Escalate tools only when simpler approaches fail. NEVER use `fmt.Println` for production debugging — use `slog`.\n\n## Red Flags: You're Debugging Wrong\n\nIf any of these are happening, stop and return to Step 1:\n\n- **\"Quick fix for now, investigate later\"** — There is no \"later\". Find the root cause.\n- **Multiple simultaneous changes** — One hypothesis at a time.\n- **Proposing fixes without understanding the cause** — \"Maybe if I add a nil check here...\" is guessing, not debugging.\n- **Each fix reveals a new problem** — You're treating symptoms. The real bug is elsewhere.\n- **3+ fix attempts on the same issue** — You have the wrong mental model. Re-read the code, trace the data flow from scratch.\n- **\"It works on my machine\"** — You haven't isolated the environmental difference.\n- **Blaming the framework\u002Fstdlib\u002Fcompiler** — It's almost never a Go bug. Verify your code first.\n\n## Reference Files\n\n- **[General Debugging Methodology](.\u002Freferences\u002Fmethodology.md)** — The systematic 10-step process: define symptoms, isolate reproduction, form one hypothesis, test it, verify the root cause, and defend against regressions. Escalation guide: when to escalate from `fmt.Println` to logging to pprof to Delve, and how to avoid the trap of multiple simultaneous changes.\n\n- **[Common Go Bugs](.\u002Freferences\u002Fcommon-go-bugs.md)** — The bugs that crash Go code: nil pointer dereferences, interface nil gotcha (typed nil ≠ nil), variable shadowing, slice\u002Fmap\u002Fdefer\u002Ferror\u002Fcontext pitfalls, race conditions, JSON unmarshaling surprises, unclosed resources. Each with reproduction patterns and fixes.\n\n- **[Test-Driven Debugging](.\u002Freferences\u002Ftesting-debug.md)** — Why writing a failing test is the first step of debugging. Covers test isolation techniques, table-driven test organization for narrowing failures, useful `go test` flags (`-v`, `-run`, `-count=10` for flaky tests), and debugging flaky tests.\n\n- **[Concurrency Debugging](.\u002Freferences\u002Fconcurrency-debug.md)** — Race conditions, deadlocks, goroutine leaks. When to use the race detector (`-race`), how to read race detector output, patterns that hide races, detecting leaks with `goleak`, analyzing stack dumps for deadlock clues.\n\n- **[Performance Troubleshooting](.\u002Freferences\u002Fperformance-debug.md)** — When your code is slow: CPU profiling workflow, memory analysis (heap vs alloc_objects profiles, finding leaks), lock contention (mutex profile), and I\u002FO blocking (goroutine profile). How to read flamegraphs, identify hot functions, and measure improvement with benchmarks.\n\n- **[pprof Reference](.\u002Freferences\u002Fpprof.md)** — Complete pprof manual. How to enable pprof endpoints in production (with auth), profile types (CPU, heap, goroutine, mutex, block, trace), capturing profiles locally and remotely, interactive analysis commands (`top`, `list`, `web`), and interpreting flamegraphs.\n\n- **[Diagnostic Tools](.\u002Freferences\u002Fdiagnostic-tools.md)** — Auxiliary tools for specific symptoms. GODEBUG environment variables (GC tracing, scheduler tracing), Delve debugger for breakpoint debugging, escape analysis (`go build -gcflags=\"-m\"` to find unintended heap allocations), Go's execution tracer for understanding goroutine scheduling.\n\n- **[Production Debugging](.\u002Freferences\u002Fproduction-debug.md)** — Debugging live production systems without stopping them. Production checklist, structuring logs for searchability, enabling pprof safely (auth, network isolation), capturing profiles from running services, network debugging (tcpdump, netstat), and HTTP request\u002Fresponse inspection.\n\n- **[Compilation Issues](.\u002Freferences\u002Fcompilation.md)** — Build failures: module version conflicts, CGO linking problems, version mismatch between `go.mod` and installed Go version, platform-specific build tags preventing cross-compilation.\n\n- **[Code Review Red Flags](.\u002Freferences\u002Fcode-review-flags.md)** — Patterns to watch during code review that signal potential bugs: unchecked errors, missing nil checks, concurrent map access, goroutines without clear exit, resource leaks from defer in loops.\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-performance` skill for optimization patterns after identifying bottlenecks\n- → See `samber\u002Fcc-skills-golang@golang-observability` skill for metrics, alerting, and Grafana dashboards for Go runtime monitoring\n- → See `samber\u002Fcc-skills@promql-cli` skill for querying Prometheus metrics during production incident investigation\n- → See `samber\u002Fcc-skills-golang@golang-concurrency`, `samber\u002Fcc-skills-golang@golang-safety`, `samber\u002Fcc-skills-golang@golang-error-handling` skills\n","**Persona:** You are a Go systems debugger. You follow evidence, not intuition — instrument, reproduce, and trace root causes systematically.\n\n**Thinking mode:** Reason as thoroughly as possible for debugging and root cause analysis — rushed reasoning leads to symptom fixes, deep thinking finds the actual root cause. On Claude Code, use `ultrathink` to trigger extended thinking explicitly.\n\n**Orchestration mode:** Fan out the five bug-category sub-agents described in Codebase bug hunt mode for a codebase-wide bug hunt. A single-issue debug session should stay sequential; orchestration only pays off when scanning broadly for unknown bugs. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.\n\n**Modes:**\n\n- **Single-issue debug** (default): Follow the sequential Golden Rules — read the error, reproduce, one hypothesis at a time. Do not launch sub-agents; focused sequential investigation is faster for a single known symptom.\n- **Codebase bug hunt** (explicit audit of a large codebase): Launch up to 5 parallel sub-agents, one per bug category (nil\u002Finterface, resources, error handling, races, context\u002Fslice\u002Fmap). Use this mode when the user asks for a broad sweep, not when debugging a specific reported issue.\n\n**Dependencies:**\n\n- dlv: `go install github.com\u002Fgo-delve\u002Fdelve\u002Fcmd\u002Fdlv@latest`\n\n# Go Troubleshooting Guide\n\n**NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.** Symptom fixes create new bugs and waste time. This process applies ESPECIALLY under time pressure — rushing leads to cascading failures that take longer to resolve.\n\nWhen the user reports a bug, crash, performance problem, or unexpected behavior in Go code:\n\n1. **Start with the Decision Tree** below to identify the symptom category and jump to the relevant section.\n2. **Follow the Golden Rules** — especially: reproduce before you fix, one hypothesis at a time, find the root cause.\n3. **Work through the General Debugging Methodology** step by step. Do not skip steps.\n4. **Watch for Red Flags** in your own reasoning. If you catch yourself guessing at fixes without understanding the cause, stop and gather more evidence.\n5. **Escalate tools incrementally.** Start with the simplest diagnostic (`fmt.Println`, test isolation) and only reach for pprof, Delve, or GODEBUG when simpler tools are insufficient.\n6. **Never propose a fix you cannot explain.** If you do not understand why the bug happens, say so and investigate further.\n\n## Quick Decision Tree\n\n```\nWHAT ARE YOU SEEING?\n\n\"Build won't compile\"\n  → go build .\u002F... 2>&1, go vet .\u002F...\n  → See [compilation.md](.\u002Freferences\u002Fcompilation.md)\n\n\"Wrong output \u002F logic bug\"\n  → Write a failing test → Check error handling, nil, off-by-one\n  → See [common-go-bugs.md](.\u002Freferences\u002Fcommon-go-bugs.md), [testing-debug.md](.\u002Freferences\u002Ftesting-debug.md)\n\n\"Random crashes \u002F panics\"\n  → GOTRACEBACK=all .\u002Fapp → go test -race .\u002F...\n  → See [common-go-bugs.md](.\u002Freferences\u002Fcommon-go-bugs.md), [diagnostic-tools.md](.\u002Freferences\u002Fdiagnostic-tools.md)\n\n\"Sometimes works, sometimes fails\"\n  → go test -race .\u002F...\n  → See [concurrency-debug.md](.\u002Freferences\u002Fconcurrency-debug.md), [testing-debug.md](.\u002Freferences\u002Ftesting-debug.md)\n\n\"Program hangs \u002F frozen\"\n  → curl localhost:6060\u002Fdebug\u002Fpprof\u002Fgoroutine?debug=2\n  → See [concurrency-debug.md](.\u002Freferences\u002Fconcurrency-debug.md), [pprof.md](.\u002Freferences\u002Fpprof.md)\n\n\"High CPU usage\"\n  → pprof CPU profiling\n  → See [performance-debug.md](.\u002Freferences\u002Fperformance-debug.md), [pprof.md](.\u002Freferences\u002Fpprof.md)\n\n\"Memory growing over time\"\n  → pprof heap profiling\n  → See [performance-debug.md](.\u002Freferences\u002Fperformance-debug.md), [concurrency-debug.md](.\u002Freferences\u002Fconcurrency-debug.md)\n\n\"Slow \u002F high latency \u002F p99 spikes\"\n  → CPU + mutex + block profiles\n  → See [performance-debug.md](.\u002Freferences\u002Fperformance-debug.md), [diagnostic-tools.md](.\u002Freferences\u002Fdiagnostic-tools.md)\n\n\"Simple bug, easy to reproduce\"\n  → Write a test, add fmt.Println \u002F log.Debug\n  → See [testing-debug.md](.\u002Freferences\u002Ftesting-debug.md)\n```\n\n**Remember:** Read the Error → Reproduce → Measure One Thing → Fix → Verify\n\nMost Go bugs are: missing error checks, nil pointers, forgotten context cancel, unclosed resources, race conditions, or silent error swallowing.\n\n## The Golden Rules\n\n### 1. Read the Error Message First\n\nGo error messages are precise. Read them fully before doing anything else:\n\n- **File and line number** → go directly there\n- **Type mismatch** → check function signatures, interface satisfaction\n- **\"undefined\"** → check imports, exported names, build tags\n- **\"cannot use X as Y\"** → check concrete types vs interfaces\n\n### 2. Reproduce Before You Fix\n\nNEVER debug by guessing — reproduce first. Always:\n\n- Write a failing test that captures the bug\n- Make it deterministic\n- Isolate the minimal failing example\n- Use `git bisect` to find the breaking commit\n\n### 3. If You Don't Measure It, You're Guessing\n\nNever rely on intuition for performance or concurrency bugs:\n\n- **pprof over intuition**\n- **race detector over reasoning**\n- **benchmarks over assumptions**\n\n### 4. One Hypothesis at a Time\n\nChange one thing, measure, confirm. If you change three things at once, you learn nothing.\n\n### 5. Find the Root Cause — No Workarounds\n\nYou MUST understand **why** the bug happens before writing a fix. A band-aid that masks the symptom leaves the defect in place, so it resurfaces elsewhere — usually further from its cause and harder to trace the second time.\n\nWhen you don't understand the issue:\n\n- **Trace the data flow backwards** from the symptom to its origin.\n- **Question your assumptions.** The code you trust might be wrong.\n- **Ask \"why\" five times.** Keep going until you reach the actual root cause.\n- **Perform more troubleshooting checks.** More fmt.Println, more output inspection...\n\n### 6. Research the Codebase, Not Just the Diff\n\nBefore flagging a bug or proposing a fix, trace the data flow and check for upstream handling. A function that looks broken in isolation may be correct in context — callers may validate inputs, middleware may enforce invariants, or the surrounding code may guarantee conditions the function relies on.\n\n1. **Trace callers** — who calls this function and with what values? Call sites can be found with code search tools. → See `samber\u002Fcc-skills-golang@golang-gopls` skill to resolve the actual symbol through interfaces and embedding — it finds indirect call sites and skips unrelated same-named identifiers that plain grep would respectively miss or falsely match.\n2. **Check upstream validation** — input parsing, type conversions, or guard clauses earlier in the chain may make the \"bug\" unreachable.\n3. **Read the surrounding code** — middleware, interceptors, or init functions may set up state the function depends on.\n\n**When the context reduces severity but doesn't eliminate the issue:** still report it at reduced priority with a note explaining which upstream guarantees protect it. Add a brief inline comment (e.g., `\u002F\u002F note: safe because caller validates via parseID() which returns uint`) so the reasoning is documented for future reviewers.\n\n### 7. Start Simple\n\nSometimes `fmt.Println` IS the right tool for local debugging. Escalate tools only when simpler approaches fail. NEVER use `fmt.Println` for production debugging — use `slog`.\n\n## Red Flags: You're Debugging Wrong\n\nIf any of these are happening, stop and return to Step 1:\n\n- **\"Quick fix for now, investigate later\"** — There is no \"later\". Find the root cause.\n- **Multiple simultaneous changes** — One hypothesis at a time.\n- **Proposing fixes without understanding the cause** — \"Maybe if I add a nil check here...\" is guessing, not debugging.\n- **Each fix reveals a new problem** — You're treating symptoms. The real bug is elsewhere.\n- **3+ fix attempts on the same issue** — You have the wrong mental model. Re-read the code, trace the data flow from scratch.\n- **\"It works on my machine\"** — You haven't isolated the environmental difference.\n- **Blaming the framework\u002Fstdlib\u002Fcompiler** — It's almost never a Go bug. Verify your code first.\n\n## Reference Files\n\n- **[General Debugging Methodology](.\u002Freferences\u002Fmethodology.md)** — The systematic 10-step process: define symptoms, isolate reproduction, form one hypothesis, test it, verify the root cause, and defend against regressions. Escalation guide: when to escalate from `fmt.Println` to logging to pprof to Delve, and how to avoid the trap of multiple simultaneous changes.\n\n- **[Common Go Bugs](.\u002Freferences\u002Fcommon-go-bugs.md)** — The bugs that crash Go code: nil pointer dereferences, interface nil gotcha (typed nil ≠ nil), variable shadowing, slice\u002Fmap\u002Fdefer\u002Ferror\u002Fcontext pitfalls, race conditions, JSON unmarshaling surprises, unclosed resources. Each with reproduction patterns and fixes.\n\n- **[Test-Driven Debugging](.\u002Freferences\u002Ftesting-debug.md)** — Why writing a failing test is the first step of debugging. Covers test isolation techniques, table-driven test organization for narrowing failures, useful `go test` flags (`-v`, `-run`, `-count=10` for flaky tests), and debugging flaky tests.\n\n- **[Concurrency Debugging](.\u002Freferences\u002Fconcurrency-debug.md)** — Race conditions, deadlocks, goroutine leaks. When to use the race detector (`-race`), how to read race detector output, patterns that hide races, detecting leaks with `goleak`, analyzing stack dumps for deadlock clues.\n\n- **[Performance Troubleshooting](.\u002Freferences\u002Fperformance-debug.md)** — When your code is slow: CPU profiling workflow, memory analysis (heap vs alloc_objects profiles, finding leaks), lock contention (mutex profile), and I\u002FO blocking (goroutine profile). How to read flamegraphs, identify hot functions, and measure improvement with benchmarks.\n\n- **[pprof Reference](.\u002Freferences\u002Fpprof.md)** — Complete pprof manual. How to enable pprof endpoints in production (with auth), profile types (CPU, heap, goroutine, mutex, block, trace), capturing profiles locally and remotely, interactive analysis commands (`top`, `list`, `web`), and interpreting flamegraphs.\n\n- **[Diagnostic Tools](.\u002Freferences\u002Fdiagnostic-tools.md)** — Auxiliary tools for specific symptoms. GODEBUG environment variables (GC tracing, scheduler tracing), Delve debugger for breakpoint debugging, escape analysis (`go build -gcflags=\"-m\"` to find unintended heap allocations), Go's execution tracer for understanding goroutine scheduling.\n\n- **[Production Debugging](.\u002Freferences\u002Fproduction-debug.md)** — Debugging live production systems without stopping them. Production checklist, structuring logs for searchability, enabling pprof safely (auth, network isolation), capturing profiles from running services, network debugging (tcpdump, netstat), and HTTP request\u002Fresponse inspection.\n\n- **[Compilation Issues](.\u002Freferences\u002Fcompilation.md)** — Build failures: module version conflicts, CGO linking problems, version mismatch between `go.mod` and installed Go version, platform-specific build tags preventing cross-compilation.\n\n- **[Code Review Red Flags](.\u002Freferences\u002Fcode-review-flags.md)** — Patterns to watch during code review that signal potential bugs: unchecked errors, missing nil checks, concurrent map access, goroutines without clear exit, resource leaks from defer in loops.\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-performance` skill for optimization patterns after identifying bottlenecks\n- → See `samber\u002Fcc-skills-golang@golang-observability` skill for metrics, alerting, and Grafana dashboards for Go runtime monitoring\n- → See `samber\u002Fcc-skills@promql-cli` skill for querying Prometheus metrics during production incident investigation\n- → See `samber\u002Fcc-skills-golang@golang-concurrency`, `samber\u002Fcc-skills-golang@golang-safety`, `samber\u002Fcc-skills-golang@golang-error-handling` skills\n",{"name":5,"paths":24,"license":15,"metadata":26,"description":7,"allowed-tools":40,"compatibility":41,"user-invocable":42},[25],"**\u002F*.go",{"author":27,"version":28,"openclaw":29},"samber","1.3.1",{"emoji":30,"install":31,"homepage":37,"requires":38},"🔍",[32],{"bins":33,"kind":35,"package":36},[34],"dlv","go","github.com\u002Fgo-delve\u002Fdelve\u002Fcmd\u002Fdlv@latest","https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":39},[35,34],"Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Bash(dlv:*) Agent WebFetch WebSearch AskUserQuestion","Designed for Claude Code, Codex or similar harness, and for projects using Golang.",true,"main","03de2fd4cce66781f4eba68a6d0613fc2001c30f",".claude\u002Fskills\u002Fgolang-troubleshooting","https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go","https:\u002F\u002Fgithub.com\u002Fgn00678465","まるでだめなおさん","2026-10-30 11:48:16",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":42},[52,55,58],{"tool":53,"command":54},"npx","npx skills add gn00678465\u002Fapm-go --skill golang-troubleshooting",{"tool":56,"command":57},"bunx","bunx skills add gn00678465\u002Fapm-go --skill golang-troubleshooting",{"tool":59,"command":60},"pnpm","pnpm dlx skills add gn00678465\u002Fapm-go --skill golang-troubleshooting","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002FSKILL.md",[63,69,73,77,81,85,89,93,97,101,105],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"evals\u002Fevals.json","REFERENCE","参考文档",46127,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Fevals\u002Fevals.json",{"path":70,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fcode-review-flags.md",1936,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Fcode-review-flags.md",{"path":74,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fcommon-go-bugs.md",26044,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Fcommon-go-bugs.md",{"path":78,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fcompilation.md",647,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Fcompilation.md",{"path":82,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fconcurrency-debug.md",3094,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Fconcurrency-debug.md",{"path":86,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fdiagnostic-tools.md",3714,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Fdiagnostic-tools.md",{"path":90,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fmethodology.md",10261,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Fmethodology.md",{"path":94,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fperformance-debug.md",1514,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Fperformance-debug.md",{"path":98,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fpprof.md",5242,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Fpprof.md",{"path":102,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fproduction-debug.md",3805,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Fproduction-debug.md",{"path":106,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Ftesting-debug.md",3229,"https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-troubleshooting\u002Freferences\u002Ftesting-debug.md",[110,117,124,131,138,145],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M785H2B0N08S730C7NG5JK9W","golang-testing","Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI, or debugging flaky\u002Fslow tests. For testify-specific APIs see `samber\u002Fcc-skills-golang@golang-stretchr-testify`; for measurement methodology see `samber\u002Fcc-skills-golang@golang-benchmark`.","https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-testing\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M785GSK4XRCCMQ4SKAAHE1PN","golang-spf13-cobra","Golang CLI command tree library using spf13\u002Fcobra — cobra.Command, RunE vs Run, PersistentPreRunE hook chain, Args validators (NoArgs, ExactArgs, MatchAll, custom), persistent vs local flags, command groups, ValidArgsFunction, RegisterFlagCompletionFunc, ShellCompDirective, usage\u002Fhelp template customization, man-page and markdown doc generation, and testing with SetArgs\u002FSetOut\u002FSetErr. Apply when using or adopting spf13\u002Fcobra, or when the codebase imports `github.com\u002Fspf13\u002Fcobra`. For configuration layering alongside cobra, see the `samber\u002Fcc-skills-golang@golang-spf13-viper` skill. For general CLI architecture (project layout, exit codes, signal handling, I\u002FO patterns), see `samber\u002Fcc-skills-golang@golang-cli`.","https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-spf13-cobra\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":19},"01M785GGB7M6KKVBGMHDHEABQK","golang-safety","Defensive Golang coding against accidental bugs — nil panics, typed-nil interfaces, `append` backing-array aliasing, silent int64-to-int32 truncation, float `==` comparison, `defer` inside loops, defensive copies of slices and maps, and usable zero values. Use when a Go program panics on a nil map write or nil pointer dereference, when reviewing code for nil-safety, numeric conversion overflow, or resource lifecycle, or when designing a type whose zero value must be safe. Not for designing concurrent access with goroutines, channels, or sync primitives (→ See `samber\u002Fcc-skills-golang@golang-concurrency` skill), not for exploitable vulnerabilities such as injection, weak crypto, or leaked secrets (→ See `samber\u002Fcc-skills-golang@golang-security` skill), and not for debugging an already-failing program (→ See `samber\u002Fcc-skills-golang@golang-troubleshooting` skill).","https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-safety\u002FSKILL.md",[],[],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":19},"01M785G9Z9BP2FFJFVTSCRC2TP","golang-lint","Linting best practices and golangci-lint configuration for Golang projects — running linters, configuring .golangci.yml, suppressing warnings with nolint directives, interpreting lint output, and selecting linters. Use when configuring golangci-lint, asking about lint warnings or nolint suppressions, setting up code quality tooling, or choosing linters. Also use when the user mentions golangci-lint, go vet, staticcheck, or revive. Not for wiring a lint step into a GitHub Actions pipeline (→ See `samber\u002Fcc-skills-golang@golang-continuous-integration` skill).","https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-lint\u002FSKILL.md",[],[],{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":19},"01M785G3EFKSP6AFFXAW2CE6GG","golang-error-handling","Idiomatic Golang error handling — creation, wrapping with %w, errors.Is\u002FAs, errors.Join, custom error types, sentinel errors, panic\u002Frecover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber\u002Foops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber\u002Foops specifics → See `samber\u002Fcc-skills-golang@golang-samber-oops` skill; for slog handler ecosystem → See `samber\u002Fcc-skills-golang@golang-samber-slog` skill.","https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-error-handling\u002FSKILL.md",[],[],{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":19},"01M785FVP5KNN9J0CZNRKSN00W","golang-concurrency","Golang concurrency design — goroutine lifecycle and leak prevention, channels and `select`, channel ownership and direction, `sync.Mutex`\u002F`RWMutex`\u002F`sync.Map`\u002F`sync.Once`\u002Fatomics, `errgroup`, `singleflight`, worker pools, and fan-out\u002Ffan-in pipelines. Use when writing or reviewing concurrent Go code, when choosing between channels and mutexes, when protecting a shared map or counter, or when a goroutine has no clear exit. Not for defensive coding unrelated to concurrency such as nil panics, slice aliasing, or numeric overflow (→ See `samber\u002Fcc-skills-golang@golang-safety` skill), and not for debugging a specific hung, crashing, or racing program after the fact (→ See `samber\u002Fcc-skills-golang@golang-troubleshooting` skill).","https:\u002F\u002Fgithub.com\u002Fgn00678465\u002Fapm-go\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgolang-concurrency\u002FSKILL.md",[],[]]