[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79ZBBJAGYVYKM7845SD0FR7":3,"skill-same:01M79ZBBJAGYVYKM7845SD0FR7":52},{"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":31,"commitSha":32,"skillDirectory":33,"forksCount":14,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":51},"01M79ZBBJAGYVYKM7845SD0FR7","go-troubleshooting",null,"Diagnose runtime problems in Go programs: panics and stack traces, deadlocks, goroutine leaks, memory leaks, OOM kills, race reports, and debugging with delve and pprof. Use when: \"debug this panic\", \"read this stack trace\", \"deadlock\", \"memory leak\", \"goroutine count growing\", \"OOM\", \"program hangs\", \"race detector output\", \"use delve\". Not for: optimizing code that works (go-performance-review), writing new concurrent code (go-concurrency-review), failing test design (go-test-quality).","kongnakornna\u002Fgolangapi","kongnakornna","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10528904?v=4","01M79Z5JQPPV5CWQHXS235Q9MD","Kongnakorn Jantakun","01M79Z5JRHJJJ6PR2DGQS4P985",0,"MIT","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgo-agent-skills\u002Fskills\u002F(safety)\u002Fgo-troubleshooting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: go-troubleshooting\ndescription: >\n  Diagnose runtime problems in Go programs: panics and stack traces,\n  deadlocks, goroutine leaks, memory leaks, OOM kills, race reports, and\n  debugging with delve and pprof. Use when: \"debug this panic\", \"read this\n  stack trace\", \"deadlock\", \"memory leak\", \"goroutine count growing\", \"OOM\",\n  \"program hangs\", \"race detector output\", \"use delve\".\n  Not for: optimizing code that works (go-performance-review), writing new\n  concurrent code (go-concurrency-review), failing test design\n  (go-test-quality).\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code or similar AI coding agents working on Go projects. Requires the Go toolchain. delve is optional, for interactive debugging.\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(gofmt:*) Bash(dlv:*)\nmetadata:\n  author: eduardo-sl\n  version: \"1.1.1\"\n---\n\n# Go Troubleshooting\n\nDiagnosis before fixes. Reproduce, observe, localize, then change code.\nNever \"fix\" a symptom you haven't explained — the bug will move.\n\n## 1. Pick the Procedure by Symptom\n\n| Symptom | Procedure |\n|---|---|\n| Crash with stack trace | §2 Read the panic |\n| Program hangs \u002F requests stall | §3 Dump goroutines, find the block |\n| `fatal error: all goroutines are asleep` | §3 — Go detected total deadlock |\n| Memory grows until OOM | §4 Heap profile diff |\n| Goroutine count grows | §5 Goroutine profile diff |\n| Intermittent corrupt data \u002F weird values | §6 Race detector |\n| Need to inspect state interactively | §7 Delve |\n\n## 2. Reading a Panic\n\n```text\npanic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6bb0e4]\n\ngoroutine 43 [running]:\nmyapp\u002Finternal\u002Fservice.(*UserService).Notify(0x0, {0xc000123456?, ...})\n        \u002Fapp\u002Finternal\u002Fservice\u002Fuser.go:87 +0x24\nmyapp\u002Finternal\u002Fhandler.(*Handler).Create(0xc0001a2000, ...)\n        \u002Fapp\u002Finternal\u002Fhandler\u002Fuser.go:41 +0x1c5\n```\n\nRead it mechanically:\n\n1. First line: what kind of panic. `nil pointer dereference` + `addr=0x0`\n   means a nil receiver, nil field, or nil map\u002Fpointer argument.\n2. Top frame in YOUR code: `user.go:87` — go there.\n3. Receiver value in the frame: `(*UserService).Notify(0x0, ...)` — the\n   `0x0` first argument IS the receiver: the service itself was nil.\n   Trace where it was constructed (or wasn't).\n4. `goroutine 43` — if it's not goroutine 1, find who spawned it and\n   whether a recover boundary should exist there.\n\n## 3. Hangs and Deadlocks\n\nGet a goroutine dump from the hanging process:\n\n```bash\nkill -QUIT \u003Cpid>      # dumps all goroutine stacks to stderr, then exits\n# or, if net\u002Fhttp\u002Fpprof is mounted (see §4):\ncurl 'localhost:6060\u002Fdebug\u002Fpprof\u002Fgoroutine?debug=2'\n```\n\nThen classify the stacks:\n\n- `[semacquire]` on `sync.(*Mutex).Lock` — find which goroutine HOLDS\n  the mutex: look for another stack inside the critical section. Two\n  goroutines each holding one of two locks = lock-order inversion.\n- `[chan send]` \u002F `[chan receive]` — the other side is gone. Find who\n  should be receiving\u002Fsending and why it exited (or was never started).\n- `[select]` with a `ctx.Done()` case missing — blocked call that\n  ignores cancellation.\n- Hundreds of identical stacks — that's a leak (§5), not a deadlock.\n\n## 4. Memory Leaks\n\nMount pprof in long-running services (private port only, never public):\n\n```go\nimport _ \"net\u002Fhttp\u002Fpprof\"\n\ngo func() {\n    log.Println(http.ListenAndServe(\"localhost:6060\", nil))\n}()\n```\n\nDiff heap profiles over time — a leak is growth that never returns:\n\n```bash\ncurl -s localhost:6060\u002Fdebug\u002Fpprof\u002Fheap > heap1.pb.gz\nsleep 300   # let the leak accumulate\ncurl -s localhost:6060\u002Fdebug\u002Fpprof\u002Fheap > heap2.pb.gz\ngo tool pprof -base heap1.pb.gz heap2.pb.gz\n(pprof) top          # biggest positive delta = the leak\n(pprof) list FuncName\n```\n\nUsual suspects: unbounded caches\u002Fmaps without eviction, subslices\npinning large arrays, `time.Ticker` never stopped, response bodies not\nclosed, growing global slices, forgotten goroutines holding buffers.\n\n## 5. Goroutine Leaks\n\n```bash\ncurl -s localhost:6060\u002Fdebug\u002Fpprof\u002Fgoroutine > g1.pb.gz\nsleep 300\ncurl -s localhost:6060\u002Fdebug\u002Fpprof\u002Fgoroutine > g2.pb.gz\ngo tool pprof -base g1.pb.gz g2.pb.gz\n(pprof) top    # the growing stack is your leak site\n```\n\nThe leaking stack tells you which `go` statement never terminates.\nFix the termination path (context, channel close) — patterns in the\nconcurrency skill. In tests, `goleak` (uber-go\u002Fgoleak) fails a test\nthat leaves goroutines behind.\n\n## 6. Race Detector\n\n```bash\ngo test -race .\u002F...        # in CI, always\ngo build -race .\u002Fcmd\u002Fapi   # staging binaries under real traffic\n```\n\nA report shows two stacks: the write and the concurrent read\u002Fwrite,\neach with the goroutine's creation site. The fix is never \"add a\nsleep\" — protect the state (mutex), transfer ownership (channel), or\nmake it immutable. `-race` only reports races that actually executed:\na clean run proves nothing about untested paths.\n\n## 7. Delve\n\n```bash\ndlv test .\u002Finternal\u002Fservice -- -test.run TestTransfer   # debug a test\ndlv attach \u003Cpid>                                        # running process\ndlv core .\u002Fapi core.1234                                # post-mortem\n\n(dlv) break user.go:87\n(dlv) continue\n(dlv) print svc.repo          # inspect exact values\n(dlv) goroutines -t           # all goroutines with stacks\n(dlv) goroutine 43 bt         # switch and backtrace\n```\n\nUse delve when you need actual values or goroutine states, not just\nlocations. For quick localizations, a focused `t.Logf` or `slog.Debug`\nplus one test run is often faster.\n\n## 8. Diagnostic Environment Variables\n\n```bash\nGOTRACEBACK=all .\u002Fapi        # panic dumps ALL goroutines, not just one\nGODEBUG=gctrace=1 .\u002Fapi      # GC cycles: pacing, heap goal, pause times\nGOMEMLIMIT=512MiB .\u002Fapi      # soft memory limit — mitigates OOM while\n                             # you find the real leak\n```\n\n## Verification Checklist\n\n1. Symptom reproduced (or captured via dump\u002Fprofile) before any code change\n2. Root cause explained: you can say WHY the failure happened at that site\n3. Panic fixes address the nil\u002Fbounds source, not a wrapper `recover`\n4. Deadlock fixes establish a single lock order or remove the shared lock\n5. Leak fixes verified: goroutine\u002Fheap profile flat after the fix\n6. `go test -race .\u002F...` passes after concurrency-related fixes\n7. A regression test now fails without the fix\n8. pprof endpoints bound to localhost\u002Fprivate interfaces only\n","# Go Troubleshooting\n\nDiagnosis before fixes. Reproduce, observe, localize, then change code.\nNever \"fix\" a symptom you haven't explained — the bug will move.\n\n## 1. Pick the Procedure by Symptom\n\n| Symptom | Procedure |\n|---|---|\n| Crash with stack trace | §2 Read the panic |\n| Program hangs \u002F requests stall | §3 Dump goroutines, find the block |\n| `fatal error: all goroutines are asleep` | §3 — Go detected total deadlock |\n| Memory grows until OOM | §4 Heap profile diff |\n| Goroutine count grows | §5 Goroutine profile diff |\n| Intermittent corrupt data \u002F weird values | §6 Race detector |\n| Need to inspect state interactively | §7 Delve |\n\n## 2. Reading a Panic\n\n```text\npanic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6bb0e4]\n\ngoroutine 43 [running]:\nmyapp\u002Finternal\u002Fservice.(*UserService).Notify(0x0, {0xc000123456?, ...})\n        \u002Fapp\u002Finternal\u002Fservice\u002Fuser.go:87 +0x24\nmyapp\u002Finternal\u002Fhandler.(*Handler).Create(0xc0001a2000, ...)\n        \u002Fapp\u002Finternal\u002Fhandler\u002Fuser.go:41 +0x1c5\n```\n\nRead it mechanically:\n\n1. First line: what kind of panic. `nil pointer dereference` + `addr=0x0`\n   means a nil receiver, nil field, or nil map\u002Fpointer argument.\n2. Top frame in YOUR code: `user.go:87` — go there.\n3. Receiver value in the frame: `(*UserService).Notify(0x0, ...)` — the\n   `0x0` first argument IS the receiver: the service itself was nil.\n   Trace where it was constructed (or wasn't).\n4. `goroutine 43` — if it's not goroutine 1, find who spawned it and\n   whether a recover boundary should exist there.\n\n## 3. Hangs and Deadlocks\n\nGet a goroutine dump from the hanging process:\n\n```bash\nkill -QUIT \u003Cpid>      # dumps all goroutine stacks to stderr, then exits\n# or, if net\u002Fhttp\u002Fpprof is mounted (see §4):\ncurl 'localhost:6060\u002Fdebug\u002Fpprof\u002Fgoroutine?debug=2'\n```\n\nThen classify the stacks:\n\n- `[semacquire]` on `sync.(*Mutex).Lock` — find which goroutine HOLDS\n  the mutex: look for another stack inside the critical section. Two\n  goroutines each holding one of two locks = lock-order inversion.\n- `[chan send]` \u002F `[chan receive]` — the other side is gone. Find who\n  should be receiving\u002Fsending and why it exited (or was never started).\n- `[select]` with a `ctx.Done()` case missing — blocked call that\n  ignores cancellation.\n- Hundreds of identical stacks — that's a leak (§5), not a deadlock.\n\n## 4. Memory Leaks\n\nMount pprof in long-running services (private port only, never public):\n\n```go\nimport _ \"net\u002Fhttp\u002Fpprof\"\n\ngo func() {\n    log.Println(http.ListenAndServe(\"localhost:6060\", nil))\n}()\n```\n\nDiff heap profiles over time — a leak is growth that never returns:\n\n```bash\ncurl -s localhost:6060\u002Fdebug\u002Fpprof\u002Fheap > heap1.pb.gz\nsleep 300   # let the leak accumulate\ncurl -s localhost:6060\u002Fdebug\u002Fpprof\u002Fheap > heap2.pb.gz\ngo tool pprof -base heap1.pb.gz heap2.pb.gz\n(pprof) top          # biggest positive delta = the leak\n(pprof) list FuncName\n```\n\nUsual suspects: unbounded caches\u002Fmaps without eviction, subslices\npinning large arrays, `time.Ticker` never stopped, response bodies not\nclosed, growing global slices, forgotten goroutines holding buffers.\n\n## 5. Goroutine Leaks\n\n```bash\ncurl -s localhost:6060\u002Fdebug\u002Fpprof\u002Fgoroutine > g1.pb.gz\nsleep 300\ncurl -s localhost:6060\u002Fdebug\u002Fpprof\u002Fgoroutine > g2.pb.gz\ngo tool pprof -base g1.pb.gz g2.pb.gz\n(pprof) top    # the growing stack is your leak site\n```\n\nThe leaking stack tells you which `go` statement never terminates.\nFix the termination path (context, channel close) — patterns in the\nconcurrency skill. In tests, `goleak` (uber-go\u002Fgoleak) fails a test\nthat leaves goroutines behind.\n\n## 6. Race Detector\n\n```bash\ngo test -race .\u002F...        # in CI, always\ngo build -race .\u002Fcmd\u002Fapi   # staging binaries under real traffic\n```\n\nA report shows two stacks: the write and the concurrent read\u002Fwrite,\neach with the goroutine's creation site. The fix is never \"add a\nsleep\" — protect the state (mutex), transfer ownership (channel), or\nmake it immutable. `-race` only reports races that actually executed:\na clean run proves nothing about untested paths.\n\n## 7. Delve\n\n```bash\ndlv test .\u002Finternal\u002Fservice -- -test.run TestTransfer   # debug a test\ndlv attach \u003Cpid>                                        # running process\ndlv core .\u002Fapi core.1234                                # post-mortem\n\n(dlv) break user.go:87\n(dlv) continue\n(dlv) print svc.repo          # inspect exact values\n(dlv) goroutines -t           # all goroutines with stacks\n(dlv) goroutine 43 bt         # switch and backtrace\n```\n\nUse delve when you need actual values or goroutine states, not just\nlocations. For quick localizations, a focused `t.Logf` or `slog.Debug`\nplus one test run is often faster.\n\n## 8. Diagnostic Environment Variables\n\n```bash\nGOTRACEBACK=all .\u002Fapi        # panic dumps ALL goroutines, not just one\nGODEBUG=gctrace=1 .\u002Fapi      # GC cycles: pacing, heap goal, pause times\nGOMEMLIMIT=512MiB .\u002Fapi      # soft memory limit — mitigates OOM while\n                             # you find the real leak\n```\n\n## Verification Checklist\n\n1. Symptom reproduced (or captured via dump\u002Fprofile) before any code change\n2. Root cause explained: you can say WHY the failure happened at that site\n3. Panic fixes address the nil\u002Fbounds source, not a wrapper `recover`\n4. Deadlock fixes establish a single lock order or remove the shared lock\n5. Leak fixes verified: goroutine\u002Fheap profile flat after the fix\n6. `go test -race .\u002F...` passes after concurrency-related fixes\n7. A regression test now fails without the fix\n8. pprof endpoints bound to localhost\u002Fprivate interfaces only\n",{"name":5,"license":15,"metadata":24,"description":27,"allowed-tools":28,"compatibility":29,"user-invocable":30},{"author":25,"version":26},"eduardo-sl","1.1.1","Diagnose runtime problems in Go programs: panics and stack traces, deadlocks, goroutine leaks, memory leaks, OOM kills, race reports, and debugging with delve and pprof. Use when: \"debug this panic\", \"read this stack trace\", \"deadlock\", \"memory leak\", \"goroutine count growing\", \"OOM\", \"program hangs\", \"race detector output\", \"use delve\". Not for: optimizing code that works (go-performance-review), writing new concurrent code (go-concurrency-review), failing test design (go-test-quality).\n","Read Edit Write Glob Grep Bash(go:*) Bash(gofmt:*) Bash(dlv:*)","Designed for Claude Code or similar AI coding agents working on Go projects. Requires the Go toolchain. delve is optional, for interactive debugging.",true,"main","19f4d52a98d557f3a645a2cfbbeb5bd54f28831d",".github\u002Fskills\u002Fgo-agent-skills\u002Fskills\u002F(safety)\u002Fgo-troubleshooting","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi","https:\u002F\u002Fgithub.com\u002Fkongnakornna","http:\u002F\u002Fcmoniot.trueddns.com:52160","Technical Skills and Expertise\r\nLanguages and Frameworks\r\nFrontend: HTML, JavaScript, TypeScript, React, Vue, Angular, Next.js\r\nBackend: Node.js,Python,Golang","2026-10-06 23:01:46",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":30},[41,44,47],{"tool":42,"command":43},"npx","npx skills add kongnakornna\u002Fgolangapi --skill go-troubleshooting",{"tool":45,"command":46},"bunx","bunx skills add kongnakornna\u002Fgolangapi --skill go-troubleshooting",{"tool":48,"command":49},"pnpm","pnpm dlx skills add kongnakornna\u002Fgolangapi --skill go-troubleshooting","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgo-agent-skills\u002Fskills\u002F(safety)\u002Fgo-troubleshooting\u002FSKILL.md",[],[53,61,68,75,82,89],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7A0M9RJJ3383VEFYKABWV15","tb-writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftb-writing-plans\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7A0M4JKY4DEDRP1CBHT00WV","tb-using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftb-using-git-worktrees\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7A0KZ5HRAQAAT2KXR6146Q7","tb-test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftb-test-driven-development\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7A0KW92W3F18E2MRP8H62P2","tb-subagent-driven-development","Use when executing implementation plans with independent tasks in the current session","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftb-subagent-driven-development\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7A0KKYQCHYYRHA5J5BAP24M","tb-scrutinize","Outsider-perspective end-to-end review of a plan, PR, or code change. First questions intent and whether a simpler\u002Fmore elegant approach would achieve the same goal, then traces the actual code path (not just the diff) to verify the change does what it claims. Output is concise, actionable, and every call carries its rationale. Trigger on \u002Ftb-scrutinize and proactively whenever the user asks to review, audit, sanity-check, or get a second opinion on a plan, PR, diff, design doc, or proposed code change.","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftb-scrutinize\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7A0KFDR1V3RW7SW1XNHP82P","tb-requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftb-requesting-code-review\u002FSKILL.md",[],[]]