[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79ZD5H3H9BNSYSVF2QZF0GF":3,"skill-same:01M79ZD5H3H9BNSYSVF2QZF0GF":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},"01M79ZD5H3H9BNSYSVF2QZF0GF","go-refactoring",null,"Safe refactoring workflow for Go: behavior-preserving steps, compiler-checked renames, extracting packages, breaking circular dependencies, and strangler migrations — always behind green tests. Use when: \"refactor this\", \"rename across the codebase\", \"extract a package\", \"break this circular dependency\", \"split this god package\", \"migrate callers\", \"clean up without changing behavior\". Not for: choosing the target architecture (go-architecture-review), adopting new language features (go-modernize), performance rewrites (go-performance-review).","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(workflow)\u002Fgo-refactoring\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: go-refactoring\ndescription: >\n  Safe refactoring workflow for Go: behavior-preserving steps,\n  compiler-checked renames, extracting packages, breaking circular\n  dependencies, and strangler migrations — always behind green tests. Use\n  when: \"refactor this\", \"rename across the codebase\", \"extract a package\",\n  \"break this circular dependency\", \"split this god package\", \"migrate\n  callers\", \"clean up without changing behavior\".\n  Not for: choosing the target architecture (go-architecture-review),\n  adopting new language features (go-modernize), performance rewrites\n  (go-performance-review).\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code or similar AI coding agents working on Go projects. Requires the Go toolchain. Requires git. gopls is optional, for semantic rename.\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(gofmt:*) Bash(git:*) Bash(gopls:*)\nmetadata:\n  author: eduardo-sl\n  version: \"1.1.1\"\n---\n\n# Go Refactoring Workflow\n\nA refactor changes structure, never behavior. The definition of done is\nmechanical: same tests pass before and after every step, and every step\nis small enough to revert alone.\n\n## 1. The Loop\n\n1. **Baseline:** `go build .\u002F... && go test .\u002F...` must be green before\n   touching anything. If tests are missing around the target code,\n   write characterization tests FIRST — they pin current behavior,\n   even if that behavior looks wrong.\n2. **One transformation** from the catalog below.\n3. **Verify:** build + tests + `go vet .\u002F...`.\n4. **Commit.** Never mix a refactor commit with a behavior change —\n   reviewers can skim a `refactor:` commit; they must scrutinize a\n   mixed one.\n5. Repeat.\n\nIf step 3 fails and the fix isn't obvious in a minute, revert the step\nrather than debugging a half-applied transformation.\n\n## 2. Renames — Let Tools Do Them\n\n```bash\n# Preferred: gopls (understands types, interfaces, embedding)\ngopls rename -w internal\u002Fservice\u002Fuser.go:#offset newName\n\n# Module path or package import path changes:\n# update go.mod, then rewrite imports mechanically\nfind . -name '*.go' -exec sed -i 's|github.com\u002Facme\u002Fold|github.com\u002Facme\u002Fnew|g' {} +\ngo build .\u002F...   # the compiler is the reviewer\n```\n\nNever rename an exported identifier of a published library without a\ndeprecation cycle: add the new name, mark the old one\n`\u002F\u002F Deprecated: use NewName.`, delete in the next major version.\n\n## 3. Extract Package\n\nMoving code out of a god package, in compiler-checked steps:\n\n1. Create the new package; **move one type and its methods** (`gopls`\n   or cut\u002Fpaste), leaving everything else.\n2. In the old package, add type aliases so nothing breaks:\n   `type User = user.User` (aliases, `=`, not definitions).\n3. Build. Migrate importers to the new path in batches; build each batch.\n4. Delete the aliases when no importer remains.\n\nThis keeps every commit green with an arbitrarily large caller base.\n\n## 4. Break a Circular Dependency\n\nPackages `a → b` and `b → a` won't compile; near-cycles show up as\ngod packages. Three escapes, in order of preference:\n\n1. **Extract the shared core:** both `a` and `b` actually depend on a\n   type — move it to a third package `c` that imports nothing.\n2. **Invert with an interface:** if `store` calls back into `service`,\n   define the callback interface IN `store` (consumer side) and let\n   `service` implement it. The arrow flips at compile time.\n3. **Merge:** if two packages can't be described without each other,\n   they were one package all along.\n\n## 5. Change a Function Signature Safely\n\nFor exported functions with many callers:\n\n```go\n\u002F\u002F Step 1 — add the new form alongside the old\nfunc (s *Service) ProcessCtx(ctx context.Context, id string) error { ... }\n\n\u002F\u002F Step 2 — old form delegates; mark deprecated\n\u002F\u002F Deprecated: use ProcessCtx.\nfunc (s *Service) Process(id string) error {\n    return s.ProcessCtx(context.Background(), id)\n}\n\n\u002F\u002F Step 3 — migrate callers batch by batch, building each batch\n\u002F\u002F Step 4 — delete the old form (same module) or keep until next major (library)\n```\n\nInside a single module, prefer atomic signature changes when the\ncompiler can find every caller for you: change it, then chase the\nbuild errors — that's the compiler enumerating your TODO list.\n\n## 6. Strangler Migration for Subsystems\n\nReplacing a subsystem (old store, legacy client) too big for one PR:\n\n1. Define the consumer-side interface the callers actually need.\n2. Make the OLD implementation satisfy it; wire callers to the interface.\n3. Build the new implementation behind the same interface; test both\n   implementations against one shared conformance test suite.\n4. Switch the wiring in the composition root (one line, one commit,\n   trivially revertible). Feature-flag it if risk warrants.\n5. Delete the old implementation in its own commit.\n\n## 7. What Is NOT a Refactor\n\n- \"While I'm here\" bug fixes — separate commit before or after.\n- Reordering struct fields used with positional literals, changing\n  exported error strings callers match on, changing JSON tags —\n  these are behavior changes wearing refactor clothes.\n- Rewrites without tests. If you can't pin behavior first, you're not\n  refactoring; you're gambling.\n\n## Verification Checklist\n\n1. Baseline build + tests green before the first change\n2. Characterization tests added where coverage was missing\n3. Each commit is one transformation; `refactor:` commits contain no behavior change\n4. Renames done via gopls\u002Fcompiler, not find-and-replace on identifiers\n5. Package extractions used type aliases to stay green mid-flight\n6. No new dependency cycles (`go build .\u002F...` proves it)\n7. Public API changes follow the deprecation cycle\n8. `go vet .\u002F...` and the full test suite pass at every commit, not just the last\n9. git log reads as a sequence of safe, revertible steps\n","# Go Refactoring Workflow\n\nA refactor changes structure, never behavior. The definition of done is\nmechanical: same tests pass before and after every step, and every step\nis small enough to revert alone.\n\n## 1. The Loop\n\n1. **Baseline:** `go build .\u002F... && go test .\u002F...` must be green before\n   touching anything. If tests are missing around the target code,\n   write characterization tests FIRST — they pin current behavior,\n   even if that behavior looks wrong.\n2. **One transformation** from the catalog below.\n3. **Verify:** build + tests + `go vet .\u002F...`.\n4. **Commit.** Never mix a refactor commit with a behavior change —\n   reviewers can skim a `refactor:` commit; they must scrutinize a\n   mixed one.\n5. Repeat.\n\nIf step 3 fails and the fix isn't obvious in a minute, revert the step\nrather than debugging a half-applied transformation.\n\n## 2. Renames — Let Tools Do Them\n\n```bash\n# Preferred: gopls (understands types, interfaces, embedding)\ngopls rename -w internal\u002Fservice\u002Fuser.go:#offset newName\n\n# Module path or package import path changes:\n# update go.mod, then rewrite imports mechanically\nfind . -name '*.go' -exec sed -i 's|github.com\u002Facme\u002Fold|github.com\u002Facme\u002Fnew|g' {} +\ngo build .\u002F...   # the compiler is the reviewer\n```\n\nNever rename an exported identifier of a published library without a\ndeprecation cycle: add the new name, mark the old one\n`\u002F\u002F Deprecated: use NewName.`, delete in the next major version.\n\n## 3. Extract Package\n\nMoving code out of a god package, in compiler-checked steps:\n\n1. Create the new package; **move one type and its methods** (`gopls`\n   or cut\u002Fpaste), leaving everything else.\n2. In the old package, add type aliases so nothing breaks:\n   `type User = user.User` (aliases, `=`, not definitions).\n3. Build. Migrate importers to the new path in batches; build each batch.\n4. Delete the aliases when no importer remains.\n\nThis keeps every commit green with an arbitrarily large caller base.\n\n## 4. Break a Circular Dependency\n\nPackages `a → b` and `b → a` won't compile; near-cycles show up as\ngod packages. Three escapes, in order of preference:\n\n1. **Extract the shared core:** both `a` and `b` actually depend on a\n   type — move it to a third package `c` that imports nothing.\n2. **Invert with an interface:** if `store` calls back into `service`,\n   define the callback interface IN `store` (consumer side) and let\n   `service` implement it. The arrow flips at compile time.\n3. **Merge:** if two packages can't be described without each other,\n   they were one package all along.\n\n## 5. Change a Function Signature Safely\n\nFor exported functions with many callers:\n\n```go\n\u002F\u002F Step 1 — add the new form alongside the old\nfunc (s *Service) ProcessCtx(ctx context.Context, id string) error { ... }\n\n\u002F\u002F Step 2 — old form delegates; mark deprecated\n\u002F\u002F Deprecated: use ProcessCtx.\nfunc (s *Service) Process(id string) error {\n    return s.ProcessCtx(context.Background(), id)\n}\n\n\u002F\u002F Step 3 — migrate callers batch by batch, building each batch\n\u002F\u002F Step 4 — delete the old form (same module) or keep until next major (library)\n```\n\nInside a single module, prefer atomic signature changes when the\ncompiler can find every caller for you: change it, then chase the\nbuild errors — that's the compiler enumerating your TODO list.\n\n## 6. Strangler Migration for Subsystems\n\nReplacing a subsystem (old store, legacy client) too big for one PR:\n\n1. Define the consumer-side interface the callers actually need.\n2. Make the OLD implementation satisfy it; wire callers to the interface.\n3. Build the new implementation behind the same interface; test both\n   implementations against one shared conformance test suite.\n4. Switch the wiring in the composition root (one line, one commit,\n   trivially revertible). Feature-flag it if risk warrants.\n5. Delete the old implementation in its own commit.\n\n## 7. What Is NOT a Refactor\n\n- \"While I'm here\" bug fixes — separate commit before or after.\n- Reordering struct fields used with positional literals, changing\n  exported error strings callers match on, changing JSON tags —\n  these are behavior changes wearing refactor clothes.\n- Rewrites without tests. If you can't pin behavior first, you're not\n  refactoring; you're gambling.\n\n## Verification Checklist\n\n1. Baseline build + tests green before the first change\n2. Characterization tests added where coverage was missing\n3. Each commit is one transformation; `refactor:` commits contain no behavior change\n4. Renames done via gopls\u002Fcompiler, not find-and-replace on identifiers\n5. Package extractions used type aliases to stay green mid-flight\n6. No new dependency cycles (`go build .\u002F...` proves it)\n7. Public API changes follow the deprecation cycle\n8. `go vet .\u002F...` and the full test suite pass at every commit, not just the last\n9. git log reads as a sequence of safe, revertible steps\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","Safe refactoring workflow for Go: behavior-preserving steps, compiler-checked renames, extracting packages, breaking circular dependencies, and strangler migrations — always behind green tests. Use when: \"refactor this\", \"rename across the codebase\", \"extract a package\", \"break this circular dependency\", \"split this god package\", \"migrate callers\", \"clean up without changing behavior\". Not for: choosing the target architecture (go-architecture-review), adopting new language features (go-modernize), performance rewrites (go-performance-review).\n","Read Edit Write Glob Grep Bash(go:*) Bash(gofmt:*) Bash(git:*) Bash(gopls:*)","Designed for Claude Code or similar AI coding agents working on Go projects. Requires the Go toolchain. Requires git. gopls is optional, for semantic rename.",true,"main","19f4d52a98d557f3a645a2cfbbeb5bd54f28831d",".github\u002Fskills\u002Fgo-agent-skills\u002Fskills\u002F(workflow)\u002Fgo-refactoring","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-refactoring",{"tool":45,"command":46},"bunx","bunx skills add kongnakornna\u002Fgolangapi --skill go-refactoring",{"tool":48,"command":49},"pnpm","pnpm dlx skills add kongnakornna\u002Fgolangapi --skill go-refactoring","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgo-agent-skills\u002Fskills\u002F(workflow)\u002Fgo-refactoring\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",[],[]]