[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F57AXY73TR16QA55TQQTG0":3,"skill-same:01M7F57AXY73TR16QA55TQQTG0":43},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M7F57AXY73TR16QA55TQQTG0","go-style",null,"Modern Go idioms for every Go file: which standard-library and language features to use instead of the older pattern, gated by the Go version in go.mod.","workflowaiorg\u002Fworkflow","workflowaiorg","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F344728430?v=4","01M7F5606QN4BXN2KJNCJPCKAZ","01M7F5607RE7Y5NNRN60FW9NJ3",0,"MIT","https:\u002F\u002Fgithub.com\u002Fworkflowaiorg\u002Fworkflow\u002Fblob\u002Fmain\u002Finternal\u002Fcomponent\u002Fbackend\u002Fbase\u002Fskills\u002Fgo-style\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: go-style\ndescription: \"Modern Go idioms for every Go file: which standard-library and language features to use instead of the older pattern, gated by the Go version in go.mod.\"\n---\n\n# Skill: Go style\n\nModels write Go the way most of their training data is written: `interface{}`, `sort.Slice`,\n`for i := 0; i \u003C n; i++`. This skill lists the modern replacements, and which Go version each\nneeds.\n\nThe rules are JetBrains' [Modern Go Guidelines](https:\u002F\u002Fgithub.com\u002FJetBrains\u002Fgo-modern-guidelines)\n(Apache-2.0), copied from **v0.1.1, commit `155dc7c`**: licensed under the\n[Apache License 2.0](https:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0), and adapted here, reworded and\nwithout the parts that do not apply.\n\n## When this skill applies\n\nWriting, changing or reviewing any `.go` file. How code is layered is the api-design skill's, how\nerrors travel the error-handling skill's, how tests are built the testing skill's: this one says\nwhich idiom to write it in.\n\n## How to use the tables\n\n1. **Read the `go` line in `go.mod`.**\n2. **Use every rule at or below that version** in the code you write or change, even when the code\n   around it uses the older pattern.\n3. **Never use a rule above it.** It does not compile, or the API does not exist yet.\n4. **Skip a rule only** when it would change behaviour or plainly does not fit, and say why in the\n   MR.\n\nRewriting existing code only to modernise it is a change of its own, never a side effect of\nanother one.\n\n## Go 1.25 and older\n\n| Go | Rule |\n|---|---|\n| 1.0 | `time.Since(start)`, not `time.Now().Sub(start)` |\n| 1.8 | `time.Until(deadline)`, not `deadline.Sub(time.Now())` |\n| 1.13 | `errors.Is(err, target)`, not `err == target` — wrapped errors must still match |\n| 1.18 | `any`, not `interface{}` |\n| 1.18 | `strings.Cut` \u002F `bytes.Cut`, not `Index` plus manual slicing |\n| 1.18 | `strings.Clone` to copy a string without keeping its backing memory alive |\n| 1.19 | `fmt.Appendf` when appending formatted text to a `[]byte`, not `append(b, fmt.Sprintf(…)...)` |\n| 1.19 | Typed atomics — `atomic.Bool`, `atomic.Int64`, `atomic.Pointer[T]` — not the `atomic.AddInt64` functions |\n| 1.20 | `bytes.Clone` to copy a byte slice |\n| 1.20 | `strings.CutPrefix` \u002F `CutSuffix` when you need the trimmed string *and* whether it matched |\n| 1.20 | `errors.Join` to combine several errors so `errors.Is` still sees each of them |\n| 1.20 | `context.WithCancelCause` and `context.Cause` when a cancellation should carry its reason |\n| 1.21 | Built-in `min` and `max`, not hand-written comparisons |\n| 1.21 | `clear(m)` to empty a map, `clear(s)` to zero a slice |\n| 1.21 | `slices.Contains`, not a search loop |\n| 1.21 | `slices.Index` \u002F `slices.IndexFunc` to find an element's position |\n| 1.21 | `slices.Sort` for ordered values; `slices.SortFunc` with `cmp.Compare`, not `sort.Slice` — and `slices.SortStableFunc` where `sort.SliceStable` was, because `SortFunc` is not stable |\n| 1.21 | `slices.Max` \u002F `slices.Min`, not a loop |\n| 1.21 | `slices.Reverse`, not a swap loop |\n| 1.21 | `slices.Compact` to drop consecutive duplicates |\n| 1.21 | `slices.Clip` to drop unused capacity; `slices.Clone` to copy a slice |\n| 1.21 | `maps.Clone` \u002F `maps.Copy`, not a copy loop; `maps.DeleteFunc` to delete by predicate |\n| 1.21 | `sync.OnceFunc` \u002F `sync.OnceValue`, not `sync.Once` plus a wrapper closure or a cached variable |\n| 1.21 | `context.AfterFunc` to run cleanup when a context is cancelled |\n| 1.21 | `context.WithTimeoutCause` \u002F `WithDeadlineCause` when a caller needs to know why it timed out |\n| 1.22 | `for i := range n`, not `for i := 0; i \u003C n; i++` |\n| 1.22 | No `v := v` copies before a closure or `&v` — every iteration has its own variable |\n| 1.22 | `cmp.Or(a, b, c)` for the first non-zero value, not an `if` chain |\n| 1.22 | `reflect.TypeFor[T]()`, not `reflect.TypeOf((*T)(nil)).Elem()` |\n| 1.22 | Method-aware `http.ServeMux` patterns and `r.PathValue` — only where plain `net\u002Fhttp` is used; routes here are Gin |\n| 1.23 | `maps.Keys` \u002F `maps.Values` as iterators, not a loop that collects them |\n| 1.23 | `slices.Collect` to build a slice from an iterator; `slices.Sorted` to collect and sort in one step |\n| 1.23 | `time.Tick` where it fits — an unreferenced ticker is garbage-collected without `Stop` |\n| 1.24 | `t.Context()` for a context that lives as long as the test — it is already cancelled when `t.Cleanup` runs, so never pass it to cleanup |\n| 1.24 | `omitzero` on bool, number, struct and `time.Time` JSON fields; `omitempty` stays for strings, slices and maps |\n| 1.24 | `for b.Loop()` in benchmarks — a benchmark that sizes its fixtures from `b.N` needs reworking, not a mechanical swap |\n| 1.24 | `strings.SplitSeq` \u002F `FieldsSeq` (and the `bytes` versions) when you only range over the parts |\n| 1.25 | `wg.Go(func() { … })`, not `wg.Add(1)` plus `go func() { defer wg.Done() … }()` |\n\n## Go 1.26 and newer\n\n| Go | Rule |\n|---|---|\n| 1.26 | `new(value)` for a pointer to a value, not a `ptr()` helper or a temporary variable |\n| 1.26 | `errors.AsType[T](err)`, not `errors.As` with a pre-declared target |\n| 1.27 | Generic methods on the type, not package-level generic helpers, when the operation belongs to the type |\n| 1.27 | `encoding\u002Fjson\u002Fv2` for new JSON code; existing `encoding\u002Fjson` code stays unless the Issue is the migration |\n| 1.27 | Promoted field names directly in a struct literal, not the embedded struct built explicitly |\n| 1.27 | `strings.CutLast` \u002F `bytes.CutLast`, not `LastIndex` plus manual slicing |\n| 1.27 | The standard library `uuid` package, not a third-party one |\n| 1.27 | `URL.Clone` and `Values.Clone`, not a manual copy |\n\n## When Go is upgraded\n\nIn the change that raises the `go` line in `go.mod`:\n\n1. Raise the `golang:` image tag in `docker-compose.yaml` with it. The stack starts without it,\n   since `GOTOOLCHAIN: auto` lets the image fetch the newer Go, but only after downloading it.\n2. Move the rows the new version unlocks into the first table.\n3. Compare upstream's latest release against the pin above, and add its new rules.\n\n## Definition of done\n\n- [ ] New and changed Go code uses every rule at or below the `go.mod` version that fits it\n- [ ] No rule above the `go.mod` version is used\n- [ ] A rule that fits but was skipped is explained in the MR\n","# Skill: Go style\n\nModels write Go the way most of their training data is written: `interface{}`, `sort.Slice`,\n`for i := 0; i \u003C n; i++`. This skill lists the modern replacements, and which Go version each\nneeds.\n\nThe rules are JetBrains' [Modern Go Guidelines](https:\u002F\u002Fgithub.com\u002FJetBrains\u002Fgo-modern-guidelines)\n(Apache-2.0), copied from **v0.1.1, commit `155dc7c`**: licensed under the\n[Apache License 2.0](https:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0), and adapted here, reworded and\nwithout the parts that do not apply.\n\n## When this skill applies\n\nWriting, changing or reviewing any `.go` file. How code is layered is the api-design skill's, how\nerrors travel the error-handling skill's, how tests are built the testing skill's: this one says\nwhich idiom to write it in.\n\n## How to use the tables\n\n1. **Read the `go` line in `go.mod`.**\n2. **Use every rule at or below that version** in the code you write or change, even when the code\n   around it uses the older pattern.\n3. **Never use a rule above it.** It does not compile, or the API does not exist yet.\n4. **Skip a rule only** when it would change behaviour or plainly does not fit, and say why in the\n   MR.\n\nRewriting existing code only to modernise it is a change of its own, never a side effect of\nanother one.\n\n## Go 1.25 and older\n\n| Go | Rule |\n|---|---|\n| 1.0 | `time.Since(start)`, not `time.Now().Sub(start)` |\n| 1.8 | `time.Until(deadline)`, not `deadline.Sub(time.Now())` |\n| 1.13 | `errors.Is(err, target)`, not `err == target` — wrapped errors must still match |\n| 1.18 | `any`, not `interface{}` |\n| 1.18 | `strings.Cut` \u002F `bytes.Cut`, not `Index` plus manual slicing |\n| 1.18 | `strings.Clone` to copy a string without keeping its backing memory alive |\n| 1.19 | `fmt.Appendf` when appending formatted text to a `[]byte`, not `append(b, fmt.Sprintf(…)...)` |\n| 1.19 | Typed atomics — `atomic.Bool`, `atomic.Int64`, `atomic.Pointer[T]` — not the `atomic.AddInt64` functions |\n| 1.20 | `bytes.Clone` to copy a byte slice |\n| 1.20 | `strings.CutPrefix` \u002F `CutSuffix` when you need the trimmed string *and* whether it matched |\n| 1.20 | `errors.Join` to combine several errors so `errors.Is` still sees each of them |\n| 1.20 | `context.WithCancelCause` and `context.Cause` when a cancellation should carry its reason |\n| 1.21 | Built-in `min` and `max`, not hand-written comparisons |\n| 1.21 | `clear(m)` to empty a map, `clear(s)` to zero a slice |\n| 1.21 | `slices.Contains`, not a search loop |\n| 1.21 | `slices.Index` \u002F `slices.IndexFunc` to find an element's position |\n| 1.21 | `slices.Sort` for ordered values; `slices.SortFunc` with `cmp.Compare`, not `sort.Slice` — and `slices.SortStableFunc` where `sort.SliceStable` was, because `SortFunc` is not stable |\n| 1.21 | `slices.Max` \u002F `slices.Min`, not a loop |\n| 1.21 | `slices.Reverse`, not a swap loop |\n| 1.21 | `slices.Compact` to drop consecutive duplicates |\n| 1.21 | `slices.Clip` to drop unused capacity; `slices.Clone` to copy a slice |\n| 1.21 | `maps.Clone` \u002F `maps.Copy`, not a copy loop; `maps.DeleteFunc` to delete by predicate |\n| 1.21 | `sync.OnceFunc` \u002F `sync.OnceValue`, not `sync.Once` plus a wrapper closure or a cached variable |\n| 1.21 | `context.AfterFunc` to run cleanup when a context is cancelled |\n| 1.21 | `context.WithTimeoutCause` \u002F `WithDeadlineCause` when a caller needs to know why it timed out |\n| 1.22 | `for i := range n`, not `for i := 0; i \u003C n; i++` |\n| 1.22 | No `v := v` copies before a closure or `&v` — every iteration has its own variable |\n| 1.22 | `cmp.Or(a, b, c)` for the first non-zero value, not an `if` chain |\n| 1.22 | `reflect.TypeFor[T]()`, not `reflect.TypeOf((*T)(nil)).Elem()` |\n| 1.22 | Method-aware `http.ServeMux` patterns and `r.PathValue` — only where plain `net\u002Fhttp` is used; routes here are Gin |\n| 1.23 | `maps.Keys` \u002F `maps.Values` as iterators, not a loop that collects them |\n| 1.23 | `slices.Collect` to build a slice from an iterator; `slices.Sorted` to collect and sort in one step |\n| 1.23 | `time.Tick` where it fits — an unreferenced ticker is garbage-collected without `Stop` |\n| 1.24 | `t.Context()` for a context that lives as long as the test — it is already cancelled when `t.Cleanup` runs, so never pass it to cleanup |\n| 1.24 | `omitzero` on bool, number, struct and `time.Time` JSON fields; `omitempty` stays for strings, slices and maps |\n| 1.24 | `for b.Loop()` in benchmarks — a benchmark that sizes its fixtures from `b.N` needs reworking, not a mechanical swap |\n| 1.24 | `strings.SplitSeq` \u002F `FieldsSeq` (and the `bytes` versions) when you only range over the parts |\n| 1.25 | `wg.Go(func() { … })`, not `wg.Add(1)` plus `go func() { defer wg.Done() … }()` |\n\n## Go 1.26 and newer\n\n| Go | Rule |\n|---|---|\n| 1.26 | `new(value)` for a pointer to a value, not a `ptr()` helper or a temporary variable |\n| 1.26 | `errors.AsType[T](err)`, not `errors.As` with a pre-declared target |\n| 1.27 | Generic methods on the type, not package-level generic helpers, when the operation belongs to the type |\n| 1.27 | `encoding\u002Fjson\u002Fv2` for new JSON code; existing `encoding\u002Fjson` code stays unless the Issue is the migration |\n| 1.27 | Promoted field names directly in a struct literal, not the embedded struct built explicitly |\n| 1.27 | `strings.CutLast` \u002F `bytes.CutLast`, not `LastIndex` plus manual slicing |\n| 1.27 | The standard library `uuid` package, not a third-party one |\n| 1.27 | `URL.Clone` and `Values.Clone`, not a manual copy |\n\n## When Go is upgraded\n\nIn the change that raises the `go` line in `go.mod`:\n\n1. Raise the `golang:` image tag in `docker-compose.yaml` with it. The stack starts without it,\n   since `GOTOOLCHAIN: auto` lets the image fetch the newer Go, but only after downloading it.\n2. Move the rows the new version unlocks into the first table.\n3. Compare upstream's latest release against the pin above, and add its new rules.\n\n## Definition of done\n\n- [ ] New and changed Go code uses every rule at or below the `go.mod` version that fits it\n- [ ] No rule above the `go.mod` version is used\n- [ ] A rule that fits but was skipped is explained in the MR\n",{"name":5,"description":7},"main","68fb57dd74de5ed76dcfaff357932684f77650e6","internal\u002Fcomponent\u002Fbackend\u002Fbase\u002Fskills\u002Fgo-style","https:\u002F\u002Fgithub.com\u002Fworkflowaiorg\u002Fworkflow","https:\u002F\u002Fgithub.com\u002Fworkflowaiorg","2026-11-13 17:41:05",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add workflowaiorg\u002Fworkflow --skill go-style",{"tool":35,"command":36},"bunx","bunx skills add workflowaiorg\u002Fworkflow --skill go-style",{"tool":38,"command":39},"pnpm","pnpm dlx skills add workflowaiorg\u002Fworkflow --skill go-style","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fworkflowaiorg\u002Fworkflow\u002Fblob\u002Fmain\u002Finternal\u002Fcomponent\u002Fbackend\u002Fbase\u002Fskills\u002Fgo-style\u002FSKILL.md",true,[],[44,51,58,65,72,77],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":50,"publishedAt":18},"01M7F58YP2QA8F89599TDWEY0Y","notes","Where notes go.","https:\u002F\u002Fgithub.com\u002Fworkflowaiorg\u002Fworkflow\u002Fblob\u002Fmain\u002Finternal\u002Frender\u002Ftestdata\u002Fsync\u002Fwant\u002F.opencode\u002Fskills\u002Fnotes\u002FSKILL.md",[],[],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M7F58X62078DBFA7YZH0M9VP","naming","How things are named, including the sample's tables.","https:\u002F\u002Fgithub.com\u002Fworkflowaiorg\u002Fworkflow\u002Fblob\u002Fmain\u002Finternal\u002Frender\u002Ftestdata\u002Fsync\u002Fwant\u002F.opencode\u002Fskills\u002Fnaming\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7F58VXX28G09AJCA667GHBS","local","A skill only this project has.","https:\u002F\u002Fgithub.com\u002Fworkflowaiorg\u002Fworkflow\u002Fblob\u002Fmain\u002Finternal\u002Frender\u002Ftestdata\u002Fsync\u002Fwant\u002F.opencode\u002Fskills\u002Flocal\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M7F58TQ8XVBD6SDV0S4T6E77","hello","Greets sample's developers.","https:\u002F\u002Fgithub.com\u002Fworkflowaiorg\u002Fworkflow\u002Fblob\u002Fmain\u002Finternal\u002Frender\u002Ftestdata\u002Fsync\u002Fwant\u002F.opencode\u002Fskills\u002Fhello\u002FSKILL.md",[],[],{"skillNo":73,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M7F58R379TW8C6VY572RK11F","https:\u002F\u002Fgithub.com\u002Fworkflowaiorg\u002Fworkflow\u002Fblob\u002Fmain\u002Finternal\u002Frender\u002Ftestdata\u002Fsync\u002Fwant\u002F.github\u002Fskills\u002Fnotes\u002FSKILL.md",[],[],{"skillNo":78,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7F58PNRREJ4KPY496M2XHSY","https:\u002F\u002Fgithub.com\u002Fworkflowaiorg\u002Fworkflow\u002Fblob\u002Fmain\u002Finternal\u002Frender\u002Ftestdata\u002Fsync\u002Fwant\u002F.github\u002Fskills\u002Fnaming\u002FSKILL.md",[],[]]