[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79ZW9296M2BYRHPG8PMN624":3,"skill-same:01M79ZW9296M2BYRHPG8PMN624":72},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M79ZW9296M2BYRHPG8PMN624","go-declarations",null,"Use when declaring or initializing Go variables, constants, structs, or maps — including var vs :=, reducing scope with if-init, formatting composite literals, designing iota enums, and using any instead of interface{}. Also use when writing a new struct or const block, even if the user doesn't ask about declaration style. Does not cover naming conventions (see go-naming).","kongnakornna\u002Fgolangapi","kongnakornna","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10528904?v=4","01M79Z5JQPPV5CWQHXS235Q9MD","Kongnakorn Jantakun","01M79Z5JRHJJJ6PR2DGQS4P985",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgolang-skills\u002Fskills\u002Fgo-declarations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: go-declarations\ndescription: Use when declaring or initializing Go variables, constants, structs, or maps — including var vs :=, reducing scope with if-init, formatting composite literals, designing iota enums, and using any instead of interface{}. Also use when writing a new struct or const block, even if the user doesn't ask about declaration style. Does not cover naming conventions (see go-naming).\n---\n\n# Go Declarations and Initialization\n\n> Compatibility: Examples may use `any`, which requires Go 1.18+.\n\n## Resource Routing\n\n- `references\u002FSCOPE.md` - Read when deciding between `var`, `:=`, if-init, and narrow variable scope.\n- `references\u002FIOTA.md` - Read when designing constants or enum-like values.\n- `references\u002FINITIALIZATION.md` - Read when initializing structs, maps, zero values, or pointers.\n- `references\u002FLITERALS.md` - Read for composite literal formatting and keyed-field tradeoffs.\n- `references\u002FSTRUCTS.md` - Read when designing or initializing structs.\n- `references\u002FSHADOWING.md` - Read when a declaration may shadow a builtin or outer variable.\n\n## Quick Reference: var vs :=\n\n| Context | Use | Example |\n|---------|-----|---------|\n| Top-level | `var` (always) | `var _s = F()` |\n| Local with value | `:=` | `s := \"foo\"` |\n| Local zero-value (intentional) | `var` | `var filtered []int` |\n| Type differs from expression | `var` with type | `var _e error = F()` |\n\n---\n\n## Group Similar Declarations\n\nGroup related `var`, `const`, `type` in parenthesized blocks. Separate\n**unrelated** declarations into distinct blocks.\n\n```go\n\u002F\u002F Bad\nconst a = 1\nconst b = 2\n\n\u002F\u002F Good\nconst (\n    a = 1\n    b = 2\n)\n```\n\nInside functions, group adjacent vars even if unrelated:\n\n```go\nvar (\n    caller  = c.name\n    format  = \"json\"\n    timeout = 5 * time.Second\n)\n```\n\n---\n\n## Constants and iota\n\nStart enums at one so the zero value represents invalid\u002Funset:\n\n```go\nconst (\n    Add Operation = iota + 1\n    Subtract\n    Multiply\n)\n```\n\nUse zero when the default behavior is desirable (e.g., `LogToStdout`).\n\n---\n\n## Variable Scope\n\nUse if-init to limit scope when the result is only needed for the error check:\n\n```go\nif err := os.WriteFile(name, data, 0644); err != nil {\n    return err\n}\n```\n\nDon't reduce scope if it forces deeper nesting or you need the result outside\nthe `if`. Move constants into functions when only used there.\n\n---\n\n## Initializing Structs\n\n- **Always use field names** (enforced by `go vet`). Exception: test tables\n  with ≤3 fields.\n- **Omit zero-value fields** — let Go set defaults.\n- **Use `var` for zero-value structs**: `var user User` not `user := User{}`\n- **Use `&T{}` over `new(T)`**: `sptr := &T{Name: \"bar\"}`\n\n---\n\n## Composite Literal Formatting\n\nUse field names for external package types. Match closing brace indentation\nwith the opening line. Omit repeated type names in slice\u002Fmap literals\n(`gofmt -s`).\n\n---\n\n## Initializing Maps\n\n| Scenario | Use | Example |\n|----------|-----|---------|\n| Empty, populated later | `make(map[K]V)` | `m := make(map[string]int)` |\n| Nil declaration | `var` | `var m map[string]int` |\n| Fixed entries at init | Literal | `m := map[string]int{\"a\": 1}` |\n\n`make()` visually distinguishes empty-but-initialized from nil. Use size hints\nwhen the count is known.\n\n---\n\n## Raw String Literals\n\nUse backtick strings to avoid hand-escaped characters:\n\n```go\n\u002F\u002F Bad\nwantError := \"unknown name:\\\"test\\\"\"\n\n\u002F\u002F Good\nwantError := `unknown name:\"test\"`\n```\n\nIdeal for regex, SQL, JSON, and multi-line text.\n\n---\n\n## Prefer `any` Over `interface{}`\n\nGo 1.18+: use `any` instead of `interface{}` in all new code.\n\n---\n\n## Avoid Shadowing Built-In Names\n\nNever use predeclared identifiers (`error`, `string`, `len`, `cap`, `append`,\n`copy`, `new`, `make`, `close`, `delete`, `panic`, `recover`, `any`, `true`,\n`false`, `nil`, `iota`) as names. Use `go vet` to detect.\n\n```go\n\u002F\u002F Bad — shadows the builtin\nvar error string\n\n\u002F\u002F Good\nvar errorMessage string\n```\n\n---\n\n## Related Skills\n\n- **Naming conventions**: See [go-naming](..\u002Fgo-naming\u002FSKILL.md) when choosing variable names, constant names, or deciding name length by scope\n- **Data structures**: See [go-data-structures](..\u002Fgo-data-structures\u002FSKILL.md) when choosing between `new` and `make`, or initializing slices and maps\n- **Control flow scoping**: See [go-control-flow](..\u002Fgo-control-flow\u002FSKILL.md) when using if-init, `:=` redeclaration, or avoiding variable shadowing\n- **Capacity hints**: See [go-performance](..\u002Fgo-performance\u002FSKILL.md) when pre-allocating maps or slices with known sizes\n","# Go Declarations and Initialization\n\n> Compatibility: Examples may use `any`, which requires Go 1.18+.\n\n## Resource Routing\n\n- `references\u002FSCOPE.md` - Read when deciding between `var`, `:=`, if-init, and narrow variable scope.\n- `references\u002FIOTA.md` - Read when designing constants or enum-like values.\n- `references\u002FINITIALIZATION.md` - Read when initializing structs, maps, zero values, or pointers.\n- `references\u002FLITERALS.md` - Read for composite literal formatting and keyed-field tradeoffs.\n- `references\u002FSTRUCTS.md` - Read when designing or initializing structs.\n- `references\u002FSHADOWING.md` - Read when a declaration may shadow a builtin or outer variable.\n\n## Quick Reference: var vs :=\n\n| Context | Use | Example |\n|---------|-----|---------|\n| Top-level | `var` (always) | `var _s = F()` |\n| Local with value | `:=` | `s := \"foo\"` |\n| Local zero-value (intentional) | `var` | `var filtered []int` |\n| Type differs from expression | `var` with type | `var _e error = F()` |\n\n---\n\n## Group Similar Declarations\n\nGroup related `var`, `const`, `type` in parenthesized blocks. Separate\n**unrelated** declarations into distinct blocks.\n\n```go\n\u002F\u002F Bad\nconst a = 1\nconst b = 2\n\n\u002F\u002F Good\nconst (\n    a = 1\n    b = 2\n)\n```\n\nInside functions, group adjacent vars even if unrelated:\n\n```go\nvar (\n    caller  = c.name\n    format  = \"json\"\n    timeout = 5 * time.Second\n)\n```\n\n---\n\n## Constants and iota\n\nStart enums at one so the zero value represents invalid\u002Funset:\n\n```go\nconst (\n    Add Operation = iota + 1\n    Subtract\n    Multiply\n)\n```\n\nUse zero when the default behavior is desirable (e.g., `LogToStdout`).\n\n---\n\n## Variable Scope\n\nUse if-init to limit scope when the result is only needed for the error check:\n\n```go\nif err := os.WriteFile(name, data, 0644); err != nil {\n    return err\n}\n```\n\nDon't reduce scope if it forces deeper nesting or you need the result outside\nthe `if`. Move constants into functions when only used there.\n\n---\n\n## Initializing Structs\n\n- **Always use field names** (enforced by `go vet`). Exception: test tables\n  with ≤3 fields.\n- **Omit zero-value fields** — let Go set defaults.\n- **Use `var` for zero-value structs**: `var user User` not `user := User{}`\n- **Use `&T{}` over `new(T)`**: `sptr := &T{Name: \"bar\"}`\n\n---\n\n## Composite Literal Formatting\n\nUse field names for external package types. Match closing brace indentation\nwith the opening line. Omit repeated type names in slice\u002Fmap literals\n(`gofmt -s`).\n\n---\n\n## Initializing Maps\n\n| Scenario | Use | Example |\n|----------|-----|---------|\n| Empty, populated later | `make(map[K]V)` | `m := make(map[string]int)` |\n| Nil declaration | `var` | `var m map[string]int` |\n| Fixed entries at init | Literal | `m := map[string]int{\"a\": 1}` |\n\n`make()` visually distinguishes empty-but-initialized from nil. Use size hints\nwhen the count is known.\n\n---\n\n## Raw String Literals\n\nUse backtick strings to avoid hand-escaped characters:\n\n```go\n\u002F\u002F Bad\nwantError := \"unknown name:\\\"test\\\"\"\n\n\u002F\u002F Good\nwantError := `unknown name:\"test\"`\n```\n\nIdeal for regex, SQL, JSON, and multi-line text.\n\n---\n\n## Prefer `any` Over `interface{}`\n\nGo 1.18+: use `any` instead of `interface{}` in all new code.\n\n---\n\n## Avoid Shadowing Built-In Names\n\nNever use predeclared identifiers (`error`, `string`, `len`, `cap`, `append`,\n`copy`, `new`, `make`, `close`, `delete`, `panic`, `recover`, `any`, `true`,\n`false`, `nil`, `iota`) as names. Use `go vet` to detect.\n\n```go\n\u002F\u002F Bad — shadows the builtin\nvar error string\n\n\u002F\u002F Good\nvar errorMessage string\n```\n\n---\n\n## Related Skills\n\n- **Naming conventions**: See [go-naming](..\u002Fgo-naming\u002FSKILL.md) when choosing variable names, constant names, or deciding name length by scope\n- **Data structures**: See [go-data-structures](..\u002Fgo-data-structures\u002FSKILL.md) when choosing between `new` and `make`, or initializing slices and maps\n- **Control flow scoping**: See [go-control-flow](..\u002Fgo-control-flow\u002FSKILL.md) when using if-init, `:=` redeclaration, or avoiding variable shadowing\n- **Capacity hints**: See [go-performance](..\u002Fgo-performance\u002FSKILL.md) when pre-allocating maps or slices with known sizes\n",{"name":5,"description":7},"main","19f4d52a98d557f3a645a2cfbbeb5bd54f28831d",".github\u002Fskills\u002Fgolang-skills\u002Fskills\u002Fgo-declarations","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":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add kongnakornna\u002Fgolangapi --skill go-declarations",{"tool":38,"command":39},"bunx","bunx skills add kongnakornna\u002Fgolangapi --skill go-declarations",{"tool":41,"command":42},"pnpm","pnpm dlx skills add kongnakornna\u002Fgolangapi --skill go-declarations","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgolang-skills\u002Fskills\u002Fgo-declarations\u002FSKILL.md",true,[46,52,56,60,64,68],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002FINITIALIZATION.md","REFERENCE","参考文档",2621,"https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgolang-skills\u002Fskills\u002Fgo-declarations\u002Freferences\u002FINITIALIZATION.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002FIOTA.md",1946,"https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgolang-skills\u002Fskills\u002Fgo-declarations\u002Freferences\u002FIOTA.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002FLITERALS.md",3846,"https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgolang-skills\u002Fskills\u002Fgo-declarations\u002Freferences\u002FLITERALS.md",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002FSCOPE.md",2554,"https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgolang-skills\u002Fskills\u002Fgo-declarations\u002Freferences\u002FSCOPE.md",{"path":65,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002FSHADOWING.md",691,"https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgolang-skills\u002Fskills\u002Fgo-declarations\u002Freferences\u002FSHADOWING.md",{"path":69,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002FSTRUCTS.md",2496,"https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgolang-skills\u002Fskills\u002Fgo-declarations\u002Freferences\u002FSTRUCTS.md",[73,80,87,94,101,108],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7A0M9RJJ3383VEFYKABWV15","tb-writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fkongnakornna\u002Fgolangapi\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftb-writing-plans\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"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":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"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":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"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":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"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":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"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",[],[]]