[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JZC4X7PC10WR5WW8GR7BGH":3,"skill-same:01M6JZC4X7PC10WR5WW8GR7BGH":131},{"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":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":14,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":63,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":64,"install":65,"resources":78},"01M6JZC4X7PC10WR5WW8GR7BGH","golang-cli",null,"Golang CLI application development. Use when building, modifying, or reviewing a Go CLI tool — especially for command structure, flag handling, configuration layering, version embedding, exit codes, I\u002FO patterns, signal handling, shell completion, argument validation, and CLI unit testing. Also triggers when code uses cobra, viper, or urfave\u002Fcli.","paulohgodinho\u002Fskills","paulohgodinho","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F57510522?v=4","01M6JZBW2QZR573QTV4PN1H6DE","Paulo Godinho","01M6JZBW6QM55GHQB0K3BC6D45",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"cli","golang","golang cli","argument","testing","cobra","embedding","unit","false","structure","edit","write","read","command","projects","Bash","git","code","ai coding agents","go","2026-11-10 10:12:30",false,"---\nname: golang-cli\ndescription: \"Golang CLI application development. Use when building, modifying, or reviewing a Go CLI tool — especially for command structure, flag handling, configuration layering, version embedding, exit codes, I\u002FO patterns, signal handling, shell completion, argument validation, and CLI unit testing. Also triggers when code uses cobra, viper, or urfave\u002Fcli.\"\nuser-invocable: false\nlicense: MIT\ncompatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.0\"\n  openclaw:\n    emoji: \"?\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\n    requires:\n      bins:\n        - go\n    install: []\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent\n---\n\n**Persona:** You are a Go CLI engineer. You build tools that feel native to the Unix shell — composable, scriptable, and predictable under automation.\n\n**Modes:**\n\n- **Build** — creating a new CLI from scratch: follow the project structure, root command setup, flag binding, and version embedding sections sequentially.\n- **Extend** — adding subcommands, flags, or completions to an existing CLI: read the current command tree first, then apply changes consistent with the existing structure.\n- **Review** — auditing an existing CLI for correctness: check the Common Mistakes table, verify `SilenceUsage`\u002F`SilenceErrors`, flag-to-Viper binding, exit codes, and stdout\u002Fstderr discipline.\n\n# Go CLI Best Practices\n\nUse Cobra + Viper as the default stack for Go CLI applications. Cobra provides the command\u002Fsubcommand\u002Fflag structure and Viper handles configuration from files, environment variables, and flags with automatic layering. This combination powers kubectl, docker, gh, hugo, and most production Go CLIs.\n\nWhen using Cobra or Viper, refer to the library's official documentation and code examples for current API signatures. \n\nFor trivial single-purpose tools with no subcommands and few flags, stdlib `flag` is sufficient.\n\n## Quick Reference\n\n| Concern             | Package \u002F Tool                       |\n| ------------------- | ------------------------------------ |\n| Commands & flags    | `github.com\u002Fspf13\u002Fcobra`             |\n| Configuration       | `github.com\u002Fspf13\u002Fviper`             |\n| Flag parsing        | `github.com\u002Fspf13\u002Fpflag` (via Cobra) |\n| Colored output      | `github.com\u002Ffatih\u002Fcolor`             |\n| Table output        | `github.com\u002Folekukonez\u002Ftablewriter`  |\n| Interactive prompts | `github.com\u002Fcharmbracelet\u002Fbubbletea` |\n| Version injection   | `go build -ldflags`                  |\n| Distribution        | `goreleaser`                         |\n\n## Project Structure\n\nOrganize CLI commands in `cmd\u002Fmyapp\u002F` with one file per command. Keep `main.go` minimal — it only calls `Execute()`.\n`main.go` should be minimal — see [assets\u002Fexamples\u002Fmain.go](assets\u002Fexamples\u002Fmain.go).\n\n```\nmyapp\u002F\n├── cmd\u002F\n│   └── myapp\u002F\n│       ├── main.go              # package main, only calls Execute()\n│       ├── root.go              # Root command + Viper init\n│       ├── serve.go             # \"serve\" subcommand\n│       ├── migrate.go           # \"migrate\" subcommand\n│       └── version.go           # \"version\" subcommand\n├── src\u002F\n│   ├── server\u002F                  # HTTP server logic, middleware, handlers\n│   ├── database\u002F                # DB connection, queries, migrations\n│   └── aws\u002F                     # AWS SDK clients and service wrappers\n├── go.mod\n└── go.sum\n```\n\nBusiness logic lives in `src\u002F`, which sits as a sibling to `cmd\u002F`. Each subdirectory groups functionality by concern — `server\u002F` for HTTP handling, `database\u002F` for persistence, `aws\u002F` for cloud service wrappers — keeping implementation details cleanly separated from command wiring.\n\nThis layout is designed for **maximum separation of concerns**: commands only parse flags and delegate to `src\u002F` packages; they never contain business logic themselves. It also **aids AI-assisted development** — focused, single-responsibility packages are easier for an AI agent to reason about, modify, and test in isolation, reducing the risk of unintended side-effects across the codebase.\n\n## Root Command Setup\n\nThe root command initializes Viper configuration and sets up global behavior via `PersistentPreRunE`. See [assets\u002Fexamples\u002Froot.go](assets\u002Fexamples\u002Froot.go).\n\nKey points:\n\n- `SilenceUsage: true` MUST be set — prevents printing the full usage text on every error\n- `SilenceErrors: true` MUST be set — lets you control error output format yourself\n- `PersistentPreRunE` runs before every subcommand, so config is always initialized\n- Logs go to stderr, output goes to stdout\n\n## Subcommands\n\nAdd subcommands by creating separate files in `cmd\u002Fmyapp\u002F` and registering them in `init()`. See [assets\u002Fexamples\u002Fserve.go](assets\u002Fexamples\u002Fserve.go) for a complete subcommand example including command groups.\n\n## Flags\n\nSee [assets\u002Fexamples\u002Fflags.go](assets\u002Fexamples\u002Fflags.go) for all flag patterns:\n\n### Persistent vs Local\n\n- **Persistent** flags are inherited by all subcommands (e.g., `--config`)\n- **Local** flags only apply to the command they're defined on (e.g., `--port`)\n\n### Required Flags\n\nUse `MarkFlagRequired`, `MarkFlagsMutuallyExclusive`, and `MarkFlagsOneRequired` for flag constraints.\n\n### Flag Validation with RegisterFlagCompletionFunc\n\nProvide completion suggestions for flag values.\n\n### Always Bind Flags to Viper\n\nThis ensures `viper.GetInt(\"port\")` returns the flag value, env var `MYAPP_PORT`, or config file value — whichever has highest precedence.\n\n## Argument Validation\n\nCobra provides built-in validators for positional arguments. See [assets\u002Fexamples\u002Fargs.go](assets\u002Fexamples\u002Fargs.go) for both built-in and custom validation examples.\n\n| Validator                   | Description                          |\n| --------------------------- | ------------------------------------ |\n| `cobra.NoArgs`              | Fails if any args provided           |\n| `cobra.ExactArgs(n)`        | Requires exactly n args              |\n| `cobra.MinimumNArgs(n)`     | Requires at least n args             |\n| `cobra.MaximumNArgs(n)`     | Allows at most n args                |\n| `cobra.RangeArgs(min, max)` | Requires between min and max         |\n| `cobra.ExactValidArgs(n)`   | Exactly n args, must be in ValidArgs |\n\n## Configuration with Viper\n\nViper resolves configuration values in this order (highest to lowest precedence):\n\n1. **CLI flags** (explicit user input)\n2. **Environment variables** (deployment config)\n3. **Config file** (persistent settings)\n4. **Defaults** (set in code)\n\nSee [assets\u002Fexamples\u002Fconfig.go](assets\u002Fexamples\u002Fconfig.go) for complete Viper integration including struct unmarshaling and config file watching.\n\n### Example Config File (.myapp.yaml)\n\n```yaml\nport: 8080\nhost: localhost\nlog-level: info\ndatabase:\n  dsn: postgres:\u002F\u002Flocalhost:5432\u002Fmyapp\n  max-conn: 25\n```\n\nWith the setup above, these are all equivalent:\n\n- Flag: `--port 9090`\n- Env var: `MYAPP_PORT=9090`\n- Config file: `port: 9090`\n\n## Exit Codes\n\nExit codes MUST follow Unix conventions:\n\n| Code  | Meaning           | When to Use                               |\n| ----- | ----------------- | ----------------------------------------- |\n| 0     | Success           | Operation completed normally              |\n| 1     | General error     | Runtime failure                           |\n| 2     | Usage error       | Invalid flags or arguments                |\n| 64-78 | BSD sysexits      | Specific error categories                 |\n| 126   | Cannot execute    | Permission denied                         |\n| 127   | Command not found | Missing dependency                        |\n| 128+N | Signal N          | Terminated by signal (e.g., 130 = SIGINT) |\n\nSee [assets\u002Fexamples\u002Fexit_codes.go](assets\u002Fexamples\u002Fexit_codes.go) for a pattern mapping errors to exit codes.\n\n## I\u002FO Patterns\n\nSee [assets\u002Fexamples\u002Foutput.go](assets\u002Fexamples\u002Foutput.go) for all I\u002FO patterns:\n\n- **stdout vs stderr**: NEVER write diagnostic output to stdout — stdout is for program output (pipeable), stderr for logs\u002Ferrors\u002Fdiagnostics\n- **Detecting pipe vs terminal**: check `os.ModeCharDevice` on stdout\n- **Machine-readable output**: support `--output` flag for table\u002Fjson\u002Fplain formats\n- **Colors**: use `fatih\u002Fcolor` which auto-disables when output is not a terminal\n\n## Signal Handling\n\nSignal handling MUST use `signal.NotifyContext` to propagate cancellation through context. See [assets\u002Fexamples\u002Fsignal.go](assets\u002Fexamples\u002Fsignal.go) for graceful HTTP server shutdown.\n\n## Shell Completions\n\nCobra generates completions for bash, zsh, fish, and PowerShell automatically. See [assets\u002Fexamples\u002Fcompletion.go](assets\u002Fexamples\u002Fcompletion.go) for both the completion command and custom flag\u002Fargument completions.\n\n## Testing CLI Commands\n\nTest commands by executing them programmatically and capturing output. See [assets\u002Fexamples\u002Fcli_test.go](assets\u002Fexamples\u002Fcli_test.go).\n\nUse `cmd.OutOrStdout()` and `cmd.ErrOrStderr()` in commands (instead of `os.Stdout` \u002F `os.Stderr`) so output can be captured in tests.\n\n## Common Mistakes\n\n| Mistake | Fix |\n| --- | --- |\n| Writing to `os.Stdout` directly | Tests can't capture output. Use `cmd.OutOrStdout()` which tests can redirect to a buffer |\n| Calling `os.Exit()` inside `RunE` | Cobra's error handling, deferred functions, and cleanup code never run. Return an error, let `main()` decide |\n| Not binding flags to Viper | Flags won't be configurable via env\u002Fconfig. Call `viper.BindPFlag` for every configurable flag |\n| Missing `viper.SetEnvPrefix` | `PORT` collides with other tools. Use a prefix (`MYAPP_PORT`) to namespace env vars |\n| Logging to stdout | Unix pipes chain stdout — logs corrupt the data stream for the next program. Logs go to stderr |\n| Printing usage on every error | Full help text on every error is noise. Set `SilenceUsage: true`, save full usage for `--help` |\n| Config file required | Users without a config file get a crash. Ignore `viper.ConfigFileNotFoundError` — config should be optional |\n| Not using `PersistentPreRunE` | Config initialization must happen before any subcommand. Use root's `PersistentPreRunE` |\n| Hardcoded version string | Version gets out of sync with tags. Inject via `ldflags` at build time from git tags |\n| Not supporting `--output` format | Scripts can't parse human-readable output. Add JSON\u002Ftable\u002Fplain for machine consumption |\n\n## Related Skills\n\n- → See [golang-project-layout](..\u002Fgolang-project-layout\u002FSKILL.md) for project structure and directory layout\n- → See [golang-dependency-injection](..\u002Fgolang-dependency-injection\u002FSKILL.md) for DI approach comparison and wiring\n- → See [golang-design-patterns](..\u002Fgolang-design-patterns\u002FSKILL.md) for architectural patterns\n","**Persona:** You are a Go CLI engineer. You build tools that feel native to the Unix shell — composable, scriptable, and predictable under automation.\n\n**Modes:**\n\n- **Build** — creating a new CLI from scratch: follow the project structure, root command setup, flag binding, and version embedding sections sequentially.\n- **Extend** — adding subcommands, flags, or completions to an existing CLI: read the current command tree first, then apply changes consistent with the existing structure.\n- **Review** — auditing an existing CLI for correctness: check the Common Mistakes table, verify `SilenceUsage`\u002F`SilenceErrors`, flag-to-Viper binding, exit codes, and stdout\u002Fstderr discipline.\n\n# Go CLI Best Practices\n\nUse Cobra + Viper as the default stack for Go CLI applications. Cobra provides the command\u002Fsubcommand\u002Fflag structure and Viper handles configuration from files, environment variables, and flags with automatic layering. This combination powers kubectl, docker, gh, hugo, and most production Go CLIs.\n\nWhen using Cobra or Viper, refer to the library's official documentation and code examples for current API signatures. \n\nFor trivial single-purpose tools with no subcommands and few flags, stdlib `flag` is sufficient.\n\n## Quick Reference\n\n| Concern             | Package \u002F Tool                       |\n| ------------------- | ------------------------------------ |\n| Commands & flags    | `github.com\u002Fspf13\u002Fcobra`             |\n| Configuration       | `github.com\u002Fspf13\u002Fviper`             |\n| Flag parsing        | `github.com\u002Fspf13\u002Fpflag` (via Cobra) |\n| Colored output      | `github.com\u002Ffatih\u002Fcolor`             |\n| Table output        | `github.com\u002Folekukonez\u002Ftablewriter`  |\n| Interactive prompts | `github.com\u002Fcharmbracelet\u002Fbubbletea` |\n| Version injection   | `go build -ldflags`                  |\n| Distribution        | `goreleaser`                         |\n\n## Project Structure\n\nOrganize CLI commands in `cmd\u002Fmyapp\u002F` with one file per command. Keep `main.go` minimal — it only calls `Execute()`.\n`main.go` should be minimal — see [assets\u002Fexamples\u002Fmain.go](assets\u002Fexamples\u002Fmain.go).\n\n```\nmyapp\u002F\n├── cmd\u002F\n│   └── myapp\u002F\n│       ├── main.go              # package main, only calls Execute()\n│       ├── root.go              # Root command + Viper init\n│       ├── serve.go             # \"serve\" subcommand\n│       ├── migrate.go           # \"migrate\" subcommand\n│       └── version.go           # \"version\" subcommand\n├── src\u002F\n│   ├── server\u002F                  # HTTP server logic, middleware, handlers\n│   ├── database\u002F                # DB connection, queries, migrations\n│   └── aws\u002F                     # AWS SDK clients and service wrappers\n├── go.mod\n└── go.sum\n```\n\nBusiness logic lives in `src\u002F`, which sits as a sibling to `cmd\u002F`. Each subdirectory groups functionality by concern — `server\u002F` for HTTP handling, `database\u002F` for persistence, `aws\u002F` for cloud service wrappers — keeping implementation details cleanly separated from command wiring.\n\nThis layout is designed for **maximum separation of concerns**: commands only parse flags and delegate to `src\u002F` packages; they never contain business logic themselves. It also **aids AI-assisted development** — focused, single-responsibility packages are easier for an AI agent to reason about, modify, and test in isolation, reducing the risk of unintended side-effects across the codebase.\n\n## Root Command Setup\n\nThe root command initializes Viper configuration and sets up global behavior via `PersistentPreRunE`. See [assets\u002Fexamples\u002Froot.go](assets\u002Fexamples\u002Froot.go).\n\nKey points:\n\n- `SilenceUsage: true` MUST be set — prevents printing the full usage text on every error\n- `SilenceErrors: true` MUST be set — lets you control error output format yourself\n- `PersistentPreRunE` runs before every subcommand, so config is always initialized\n- Logs go to stderr, output goes to stdout\n\n## Subcommands\n\nAdd subcommands by creating separate files in `cmd\u002Fmyapp\u002F` and registering them in `init()`. See [assets\u002Fexamples\u002Fserve.go](assets\u002Fexamples\u002Fserve.go) for a complete subcommand example including command groups.\n\n## Flags\n\nSee [assets\u002Fexamples\u002Fflags.go](assets\u002Fexamples\u002Fflags.go) for all flag patterns:\n\n### Persistent vs Local\n\n- **Persistent** flags are inherited by all subcommands (e.g., `--config`)\n- **Local** flags only apply to the command they're defined on (e.g., `--port`)\n\n### Required Flags\n\nUse `MarkFlagRequired`, `MarkFlagsMutuallyExclusive`, and `MarkFlagsOneRequired` for flag constraints.\n\n### Flag Validation with RegisterFlagCompletionFunc\n\nProvide completion suggestions for flag values.\n\n### Always Bind Flags to Viper\n\nThis ensures `viper.GetInt(\"port\")` returns the flag value, env var `MYAPP_PORT`, or config file value — whichever has highest precedence.\n\n## Argument Validation\n\nCobra provides built-in validators for positional arguments. See [assets\u002Fexamples\u002Fargs.go](assets\u002Fexamples\u002Fargs.go) for both built-in and custom validation examples.\n\n| Validator                   | Description                          |\n| --------------------------- | ------------------------------------ |\n| `cobra.NoArgs`              | Fails if any args provided           |\n| `cobra.ExactArgs(n)`        | Requires exactly n args              |\n| `cobra.MinimumNArgs(n)`     | Requires at least n args             |\n| `cobra.MaximumNArgs(n)`     | Allows at most n args                |\n| `cobra.RangeArgs(min, max)` | Requires between min and max         |\n| `cobra.ExactValidArgs(n)`   | Exactly n args, must be in ValidArgs |\n\n## Configuration with Viper\n\nViper resolves configuration values in this order (highest to lowest precedence):\n\n1. **CLI flags** (explicit user input)\n2. **Environment variables** (deployment config)\n3. **Config file** (persistent settings)\n4. **Defaults** (set in code)\n\nSee [assets\u002Fexamples\u002Fconfig.go](assets\u002Fexamples\u002Fconfig.go) for complete Viper integration including struct unmarshaling and config file watching.\n\n### Example Config File (.myapp.yaml)\n\n```yaml\nport: 8080\nhost: localhost\nlog-level: info\ndatabase:\n  dsn: postgres:\u002F\u002Flocalhost:5432\u002Fmyapp\n  max-conn: 25\n```\n\nWith the setup above, these are all equivalent:\n\n- Flag: `--port 9090`\n- Env var: `MYAPP_PORT=9090`\n- Config file: `port: 9090`\n\n## Exit Codes\n\nExit codes MUST follow Unix conventions:\n\n| Code  | Meaning           | When to Use                               |\n| ----- | ----------------- | ----------------------------------------- |\n| 0     | Success           | Operation completed normally              |\n| 1     | General error     | Runtime failure                           |\n| 2     | Usage error       | Invalid flags or arguments                |\n| 64-78 | BSD sysexits      | Specific error categories                 |\n| 126   | Cannot execute    | Permission denied                         |\n| 127   | Command not found | Missing dependency                        |\n| 128+N | Signal N          | Terminated by signal (e.g., 130 = SIGINT) |\n\nSee [assets\u002Fexamples\u002Fexit_codes.go](assets\u002Fexamples\u002Fexit_codes.go) for a pattern mapping errors to exit codes.\n\n## I\u002FO Patterns\n\nSee [assets\u002Fexamples\u002Foutput.go](assets\u002Fexamples\u002Foutput.go) for all I\u002FO patterns:\n\n- **stdout vs stderr**: NEVER write diagnostic output to stdout — stdout is for program output (pipeable), stderr for logs\u002Ferrors\u002Fdiagnostics\n- **Detecting pipe vs terminal**: check `os.ModeCharDevice` on stdout\n- **Machine-readable output**: support `--output` flag for table\u002Fjson\u002Fplain formats\n- **Colors**: use `fatih\u002Fcolor` which auto-disables when output is not a terminal\n\n## Signal Handling\n\nSignal handling MUST use `signal.NotifyContext` to propagate cancellation through context. See [assets\u002Fexamples\u002Fsignal.go](assets\u002Fexamples\u002Fsignal.go) for graceful HTTP server shutdown.\n\n## Shell Completions\n\nCobra generates completions for bash, zsh, fish, and PowerShell automatically. See [assets\u002Fexamples\u002Fcompletion.go](assets\u002Fexamples\u002Fcompletion.go) for both the completion command and custom flag\u002Fargument completions.\n\n## Testing CLI Commands\n\nTest commands by executing them programmatically and capturing output. See [assets\u002Fexamples\u002Fcli_test.go](assets\u002Fexamples\u002Fcli_test.go).\n\nUse `cmd.OutOrStdout()` and `cmd.ErrOrStderr()` in commands (instead of `os.Stdout` \u002F `os.Stderr`) so output can be captured in tests.\n\n## Common Mistakes\n\n| Mistake | Fix |\n| --- | --- |\n| Writing to `os.Stdout` directly | Tests can't capture output. Use `cmd.OutOrStdout()` which tests can redirect to a buffer |\n| Calling `os.Exit()` inside `RunE` | Cobra's error handling, deferred functions, and cleanup code never run. Return an error, let `main()` decide |\n| Not binding flags to Viper | Flags won't be configurable via env\u002Fconfig. Call `viper.BindPFlag` for every configurable flag |\n| Missing `viper.SetEnvPrefix` | `PORT` collides with other tools. Use a prefix (`MYAPP_PORT`) to namespace env vars |\n| Logging to stdout | Unix pipes chain stdout — logs corrupt the data stream for the next program. Logs go to stderr |\n| Printing usage on every error | Full help text on every error is noise. Set `SilenceUsage: true`, save full usage for `--help` |\n| Config file required | Users without a config file get a crash. Ignore `viper.ConfigFileNotFoundError` — config should be optional |\n| Not using `PersistentPreRunE` | Config initialization must happen before any subcommand. Use root's `PersistentPreRunE` |\n| Hardcoded version string | Version gets out of sync with tags. Inject via `ldflags` at build time from git tags |\n| Not supporting `--output` format | Scripts can't parse human-readable output. Add JSON\u002Ftable\u002Fplain for machine consumption |\n\n## Related Skills\n\n- → See [golang-project-layout](..\u002Fgolang-project-layout\u002FSKILL.md) for project structure and directory layout\n- → See [golang-dependency-injection](..\u002Fgolang-dependency-injection\u002FSKILL.md) for DI approach comparison and wiring\n- → See [golang-design-patterns](..\u002Fgolang-design-patterns\u002FSKILL.md) for architectural patterns\n",{"name":5,"license":15,"metadata":49,"description":7,"allowed-tools":58,"compatibility":59,"user-invocable":45},{"author":50,"version":51,"openclaw":52},"samber","1.0",{"emoji":53,"install":54,"homepage":55,"requires":56},"?",[],"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills",{"bins":57},[43],"Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent","Designed for Claude Code or similar AI coding agents, and for projects using Golang.","main","f1ec08caf4f3441b371842829bc5b7e2fae2b11a","skills\u002Fgo\u002Fgolang-cli","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho","2026-04-04 09:40:33",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add paulohgodinho\u002Fskills --skill golang-cli",{"tool":71,"command":72},"bunx","bunx skills add paulohgodinho\u002Fskills --skill golang-cli",{"tool":74,"command":75},"pnpm","pnpm dlx skills add paulohgodinho\u002Fskills --skill golang-cli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002FSKILL.md",true,[79,85,89,93,97,101,105,109,113,117,121,125],{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"assets\u002Fexamples\u002Fargs.go","SCRIPT","脚本",1020,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Fargs.go",{"path":86,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":87,"sourceHtmlUrl":88},"assets\u002Fexamples\u002Fcli_test.go",1258,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Fcli_test.go",{"path":90,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":91,"sourceHtmlUrl":92},"assets\u002Fexamples\u002Fcompletion.go",1657,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Fcompletion.go",{"path":94,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":95,"sourceHtmlUrl":96},"assets\u002Fexamples\u002Fconfig.go",1764,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Fconfig.go",{"path":98,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":99,"sourceHtmlUrl":100},"assets\u002Fexamples\u002Fexit_codes.go",494,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Fexit_codes.go",{"path":102,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":103,"sourceHtmlUrl":104},"assets\u002Fexamples\u002Fflags.go",1322,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Fflags.go",{"path":106,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":107,"sourceHtmlUrl":108},"assets\u002Fexamples\u002Fmain.go",120,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Fmain.go",{"path":110,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":111,"sourceHtmlUrl":112},"assets\u002Fexamples\u002Foutput.go",1791,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Foutput.go",{"path":114,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":115,"sourceHtmlUrl":116},"assets\u002Fexamples\u002Froot.go",1803,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Froot.go",{"path":118,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":119,"sourceHtmlUrl":120},"assets\u002Fexamples\u002Fserve.go",735,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Fserve.go",{"path":122,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":123,"sourceHtmlUrl":124},"assets\u002Fexamples\u002Fsignal.go",831,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fassets\u002Fexamples\u002Fsignal.go",{"path":126,"resourceType":127,"resourceTypeDesc":128,"sizeBytes":129,"sourceHtmlUrl":130},"evals\u002Fevals.json","REFERENCE","参考文档",16416,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-cli\u002Fevals\u002Fevals.json",[132,153,170,188,208,228],{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":141,"publishedAt":44},"01M6JZD7VH66ESK96RANN6C5J1","golang-structs-interfaces","Golang struct and interface design patterns — composition, embedding, type assertions, type switches, interface segregation, dependency injection via interfaces, struct field tags, and pointer vs value receivers. Use this skill when designing Go types, defining or implementing interfaces, embedding structs or interfaces, writing type assertions or type switches, adding struct field tags for JSON\u002FYAML\u002FDB serialization, or choosing between pointer and value receivers. Also use when the user asks about \"accept interfaces, return structs\", compile-time interface checks, or composing small interfaces into larger ones.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-structs-interfaces\u002FSKILL.md",[138],{"categoryNo":139,"categoryName":140,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",[25,142,143,144,42,41,145,39,38,36,35,146,147,148,149,32,30,150,151,152],"golang structs interfaces","design","writing","Composition","dependency","design patterns","time","db","types","interface","implementing",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":44},"01M6JZD385E2VQ9MEPJGZK2RH5","golang-project-layout","Provides a guide for setting up Golang project layouts and workspaces. Use this whenever starting a new Go project, organizing an existing codebase, setting up a monorepo with multiple packages, creating CLI tools with multiple main packages, or deciding on directory structure. Apply this for any Go project initialization or restructuring work.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-project-layout\u002FSKILL.md",[],[25,160,161,162,163,24,42,164,41,39,38,165,166,36,35,167,168,60,33,169],"golang project layout","project","layout","directory","packages","monorepo","work","up","workspaces","initialization",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":176,"publishedAt":44},"01M6JZCXBFYKM5A7W8QHBG5SP6","golang-naming","Go (Golang) naming conventions — covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters\u002Fsetters, functional options, acronyms, test functions, and subtest names. Use this skill when writing new Go code, reviewing or refactoring, choosing between naming alternatives (New vs NewTypeName, isConnected vs connected, ErrNotFound vs NotFoundError, StatusReady vs StatusUnknown at iota 0), debating Go package names (utils\u002Fhelpers anti-patterns), or asking about Go naming best practices. Also trigger when the user mentions MixedCaps vs snake_case, ALL_CAPS constants, Get-prefix on getters, or error string casing. Do NOT use for general Go implementation questions that don't involve naming decisions.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002FSKILL.md",[],[25,177,178,144,42,164,41,39,179,38,36,180,181,182,32,183,184,185,186,187],"golang naming","naming","refactoring","anti-patterns","options","get","error","functional","errors","utils","at",{"skillNo":189,"name":190,"nameZh":6,"description":191,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":192,"categories":193,"keywords":200,"publishedAt":44},"01M6JZCRJPW41M4A70HYKEMN19","golang-lint","Provides linting best practices and golangci-lint configuration for Go projects. Covers running linters, configuring .golangci.yml, suppressing warnings with nolint directives, interpreting lint output, and managing linter settings. Use this skill whenever the user runs linters, configures golangci-lint, asks about lint warnings or suppressions, sets up code quality tooling, or asks which linters to enable for a Go project. Also use when the user mentions golangci-lint, go vet, staticcheck, revive, or any Go linting tool.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-linter\u002FSKILL.md",[194,197],{"categoryNo":195,"categoryName":196,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":198,"categoryName":199,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[201,25,202,43,42,41,40,39,38,203,204,205,36,35,34,167,161,32,206,207],"lint","golang lint","coding","linter","brew","linting","which",{"skillNo":209,"name":210,"nameZh":6,"description":211,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":212,"categories":213,"keywords":220,"publishedAt":44},"01M6JZCKDKSZ49ZH7ZS4STSMC7","golang-design-patterns","Idiomatic Golang design patterns — functional options, constructors, error flow and cascading, resource management and lifecycle, graceful shutdown, resilience, architecture, dependency injection, data handling, and streaming. Apply when designing Go APIs, structuring applications, choosing between patterns, making design decisions, architectural choices, or production hardening.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-design-patterns\u002FSKILL.md",[214,215],{"categoryNo":139,"categoryName":140,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":216,"categoryName":217,"taxonomyType":218,"taxonomyTypeDesc":219},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[143,25,147,221,222,223,42,224,41,225,39,38,36,146,226,181,32,183,184,227],"golang design patterns","patterns","architecture","resilience","streaming","shutdown","resource management",{"skillNo":229,"name":230,"nameZh":6,"description":231,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":232,"categories":233,"keywords":235,"publishedAt":44},"01M6JZCE2S3X0WWK38MZSTHH3A","golang-dependency-injection","Comprehensive guide for dependency injection (DI) in Golang. Covers why DI matters (testability, loose coupling, separation of concerns, lifecycle management), manual constructor injection, and DI library comparison (google\u002Fwire, uber-go\u002Fdig, uber-go\u002Ffx). Use this skill when designing service architecture, setting up dependency injection, refactoring tightly coupled code, managing singletons or service factories, or when the user asks about inversion of control, service containers, or wiring dependencies in Go.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-dependency-injection\u002FSKILL.md",[234],{"categoryNo":198,"categoryName":199,"taxonomyType":21,"taxonomyTypeDesc":22},[25,236,146,237,238,239,223,42,41,240,39,179,38,36,167,241,242,32,243,244],"injection","golang dependency injection","dependency injection","MCP","why","context7","query","separation of concerns","wiring"]