Go-Redis Release Preparation
redis/go-redis
Prepares a go-redis release locally: picks the next semver, gathers merged PRs, writes the RELEASE-NOTES entry and bumps versions, without publishing.
CLI command tree library for Golang using spf13/cobra — cobra.Command, RunE vs Run, PreRun hooks, Args validators, persistent vs local flags, shell completion, testing via SetArgs.
$ npx skills add context-labs/whip --skill golang-spf13-cobra -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install context-labs/whip golang-spf13-cobra --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/golang-spf13-cobra .claude/skills/golang-spf13-cobra && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "golang-spf13-cobra" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-spf13-cobra into .claude/skills/golang-spf13-cobra/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-spf13-cobra", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/context-labs/whip/tree/main/.agents/skills/golang-spf13-cobraType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add context-labs/whip --skill golang-spf13-cobra -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install context-labs/whip golang-spf13-cobra --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/golang-spf13-cobra .agents/skills/golang-spf13-cobra && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "golang-spf13-cobra" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-spf13-cobra into .agents/skills/golang-spf13-cobra/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-spf13-cobra", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add context-labs/whip --skill golang-spf13-cobra -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install context-labs/whip golang-spf13-cobra --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/golang-spf13-cobra .cursor/skills/golang-spf13-cobra && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "golang-spf13-cobra" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-spf13-cobra into .cursor/skills/golang-spf13-cobra/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-spf13-cobra", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/context-labs/whip.git --path .agents/skills/golang-spf13-cobra--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add context-labs/whip --skill golang-spf13-cobra -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install context-labs/whip golang-spf13-cobra --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/golang-spf13-cobra .gemini/skills/golang-spf13-cobra && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "golang-spf13-cobra" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-spf13-cobra into .gemini/skills/golang-spf13-cobra/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-spf13-cobra", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install context-labs/whip golang-spf13-cobraInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add context-labs/whip --skill golang-spf13-cobra -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/golang-spf13-cobra .github/skills/golang-spf13-cobra && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "golang-spf13-cobra" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-spf13-cobra into .github/skills/golang-spf13-cobra/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-spf13-cobra", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add context-labs/whip --skill golang-spf13-cobra -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install context-labs/whip golang-spf13-cobra --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/golang-spf13-cobra .opencode/skills/golang-spf13-cobra && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "golang-spf13-cobra" agent skill from https://github.com/context-labs/whip/tree/main/.agents/skills/golang-spf13-cobra into .opencode/skills/golang-spf13-cobra/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "golang-spf13-cobra", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
golang-spf13-cobraCLI command tree library for Golang using spf13/cobra — cobra.Command, RunE vs Run, PreRun hooks, Args validators, persistent vs local flags, shell completion, testing via SetArgs.
Golang Spf13 Cobra is an agent skill from context-labs/whip. CLI command tree library for Golang using spf13/cobra — cobra.Command, RunE vs Run, PreRun hooks, Args validators, persistent vs local flags, shell completion, testing via SetArgs. Apply when using/adopting cobra or the codebase imports github.com/spf13/cobra. Config: golang-spf13-viper.
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `evals/evals.json`, `references/commands-and-args.md` and `references/completions.md`). Compatibility notes: Designed for Claude Code, Codex or similar harness, and for projects using Golang.
It sits in Development. It works with Go and GitHub. The repository describes itself as: A fast coding-agent harness in Go. Tool-use loop, bubbletea TUI, provider-routable models with live catalog discovery, MCP support, background subagents. One binary, no runtime… The licence is MIT.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 8876467. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadEditWriteGlobGrepBash(go:*)Bash(golangci-lint:*)Bash(git:*)AgentWebFetch…and 6 more on the same allowed-tools line.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
goFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.compkg.go.devcobra.devFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Designed for Claude Code, Codex or similar harness, and for projects using Golang.
From compatibility in the SKILL.md frontmatter.
Golang Spf13 Cobra loads about 2.5k tokens when it runs, and up to ~7.2k if it reads all its reference files. Until then it costs about 77 tokens; SKILL.md has 954 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from context-labs/whip at commit 8876467, republished under its MIT licence (© context-labs). 954 words, ~2,474 tokens.
.claude/skills/golang-spf13-cobra/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.Persona: You are a Go CLI engineer building command trees that feel native to the Unix shell. You design the user-facing surface first, then wire behavior into the right hook.
Modes:
RunE usage, OutOrStdout(), hook chain ordering, and args validation.Cobra is the de facto standard for Go CLI applications. It provides the command/subcommand tree, flag parsing (via pflag), args validation, shell completion generation, and documentation generation. It does not handle configuration layering — that's viper's job.
Official Resources:
This skill is not exhaustive. Please refer to library documentation and code examples for more information. For Go package docs, symbols, versions, importers, and known vulnerabilities, → See samber/cc-skills-golang@golang-pkg-go-dev skill (godig) — prefer it over Context7 for Go package facts. To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See samber/cc-skills-golang@golang-gopls skill (gopls). Context7 remains a fallback for docs not indexed on pkg.go.dev.
go get github.com/spf13/cobra@latestThese libraries do fundamentally different things and can be used independently.
| Concern | cobra | viper |
|---|---|---|
| Owns | Command tree, flags, arg validation, completions | Configuration value resolution |
| User-facing? | Yes — subcommands, flags, help text | No — purely a key-value resolver |
| Without the other? | Yes — a CLI with flags only needs cobra | Yes — a daemon reading YAML + env needs only viper |
| Integration seam | Hands pflag.Flag to viper via BindPFlag | Treats the cobra flag as the highest-precedence layer |
Use cobra alone when your binary takes flags and args but needs no config file or env resolution. Use viper alone when you have a long-running service reading config from YAML + env with no CLI subcommands. Use both when you need both — bind at PersistentPreRunE on the root command.
→ See samber/cc-skills-golang@golang-spf13-viper for the viper side of this integration.
Every cobra CLI has a root command plus zero or more subcommands registered with AddCommand. The root command name is the binary name.
var rootCmd = &cobra.Command{
Use: "myapp",
Short: "One-line summary",
SilenceUsage: true, // ✓ prevents usage wall on every error
SilenceErrors: true, // ✓ lets you control error output format
}Use AddGroup to label subcommands in help output — register groups before the AddCommand calls that reference them; cobra does not retroactively assign groups.
Cobra commands have five run hooks executed in order:
PersistentPreRunE → PreRunE → RunE → PostRunE → PersistentPostRunEAlways use *E variants — the non-E forms cannot return errors. Key rules:
PersistentPreRunE on the root runs before every subcommand — use it for config init and auth checks.PersistentPreRunE replaces the parent's entirely — call the parent explicitly if you need both.PostRunE runs only if RunE succeeded.For the full lifecycle and inheritance rules, see commands-and-args.md.
Cobra validates positional arguments before RunE runs. Never write len(args) checks inside RunE — that bypasses cobra's standard error messages and arg count tracking.
Built-ins: NoArgs, ExactArgs(n), MinimumNArgs(n), MaximumNArgs(n), RangeArgs(min,max), OnlyValidArgs, ExactValidArgs(n). Compose with MatchAll(v1, v2). Custom validator: func(cmd *cobra.Command, args []string) error.
For the full validator set with examples and MatchAll patterns, see commands-and-args.md.
Cobra delegates flag parsing to pflag. Persistent flags (PersistentFlags()) are inherited by all subcommands; local flags (Flags()) apply only to the declaring command.
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file path") // inherited by all subcommands
serveCmd.Flags().IntVar(&port, "port", 8080, "listen port") // local to serveCmd only
serveCmd.MarkFlagRequired("port")
serveCmd.MarkFlagsMutuallyExclusive("json", "yaml")For pflag types, custom flag values, flag groups, and viper binding, see flags.md.
Cobra generates shell completions automatically. Extend them with:
ValidArgs []string — static positional arg completion.ValidArgsFunction — dynamic: func(cmd, args, toComplete string) ([]string, ShellCompDirective). Return ShellCompDirectiveNoFileComp to suppress file fallback.RegisterFlagCompletionFunc(name, fn) — flag value completion.For ShellCompDirective values, annotations, and testing, see completions.md.
Test commands by executing them programmatically. Never use os.Stdout / os.Stderr directly in command handlers — use cmd.OutOrStdout() / cmd.ErrOrStderr() so tests can redirect output.
func TestServeCmd(t *testing.T) {
buf := new(bytes.Buffer)
rootCmd.SetOut(buf)
rootCmd.SetArgs([]string{"serve", "--port", "9090"})
require.NoError(t, rootCmd.Execute())
assert.Contains(t, buf.String(), "listening on :9090")
}Cobra accumulates flag state across Execute() calls — build a fresh command tree per test. For isolation patterns, golden files, and testing completions, see testing.md.
RunE, never Run — Run cannot return an error; the only escape is os.Exit or panic, bypassing defers.PersistentPreRunE — it runs before every subcommand; the right place for viper binding and auth checks.Args, not inside RunE — Args gives cobra's standard error messages; MatchAll composes validators.cmd.OutOrStdout() / cmd.ErrOrStderr() for all output — direct os.Stdout writes cannot be captured by tests.Execute() calls on the same instance.| Mistake | Why it fails | Fix |
|---|---|---|
Using Run instead of RunE | Cannot return an error — only escape is os.Exit or panic, bypassing defers | Use RunE — return the error, let cobra handle the exit |
Writing len(args) checks in RunE | Bypasses cobra's standard error messages ("accepts 1 arg, received 2") | Declare Args: cobra.ExactArgs(1) on the command |
Writing to os.Stdout directly | Tests cannot capture output — os-level file handles can't be redirected | Use cmd.OutOrStdout() / cmd.ErrOrStderr() |
Child PersistentPreRunE silently drops parent's | Cobra does not chain — the child replaces the parent's hook entirely | Call parent.PersistentPreRunE(cmd, args) from the child's hook |
| Reusing a root command across tests | Cobra accumulates flag state; second Execute() sees flags from the first | Build a fresh command tree per test |
cobra-cli scaffoldersamber/cc-skills-golang@golang-cli skill for general CLI architecture — project layout, exit codes, signal handling, I/O patternssamber/cc-skills-golang@golang-spf13-viper skill for configuration layering alongside cobra (flag → env → file → default precedence)samber/cc-skills-golang@golang-testing skill for general Go testing patternsIf you encounter a bug or unexpected behavior in spf13/cobra, open an issue at https://github.com/spf13/cobra/issues.
© context-labs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 6 other files (references) in .agents/skills/golang-spf13-cobra of context-labs/whip.
Open the folder on GitHubat commit 8876467
We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in context-labs/whip, which our catalogue first saw on October 7, 2026.
Golang Spf13 Cobra next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Golang Spf13 Cobra this skillcontext-labs/whip | 1.1k | 2 repos | ~2.5k | Automated safety check: Pass | MIT | |
| Go-Redis Release Preparationredis/go-redis | 22k | — | ~1.1k | Automated safety check: Pass | BSD-2-Clause | |
| Machinistowainlewis/machinist | 496 | 1 repos | ~761 | Automated safety check: Pass | MIT | |
| Valgocohesivestack/valgo | 508 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Releaseyoanbernabeu/grepai | 1.9k | — | ~918 | Automated safety check: Pass | MIT | |
| Fix Gh Issuebeatlabs/harvester | 135 | — | ~783 | Automated safety check: Pass | Apache-2.0 |
redis/go-redis
Prepares a go-redis release locally: picks the next semver, gathers merged PRs, writes the RELEASE-NOTES entry and bumps versions, without publishing.
owainlewis/machinist
Use Machinist to create, assign, and monitor software tasks.
cohesivestack/valgo
Add, refactor, debug, review, explain, or migrate type-safe validation in consumer Go applications using github.com/cohesivestack/valgo.
yoanbernabeu/grepai
Create a new release for grepai. An agent skill from yoanbernabeu/grepai.
beatlabs/harvester
Fix a single GitHub issue end-to-end using wt. An agent skill from beatlabs/harvester.
ggwhite/go-masker
Release a new version of go-masker: update CHANGELOG.md from git log, create GitHub release.
context-labs/whip
Linting best practices and golangci-lint configuration for Go — running linters, configuring .golangci.yml, nolint suppressions, selecting linters.
context-labs/whip
Golang project layouts and workspaces. An agent skill from context-labs/whip.
context-labs/whip
Golang package/module docs via godig, a pkg.go.dev API client (CLI + MCP) — APIs, symbols, versions, importers, licenses, vulnerabilities.
context-labs/whip
Golang testing with stretchr/testify — assert, require, mock, suite: assertions, mock expectations, argument matchers, suite lifecycle, Eventually, JSONEq.
context-labs/whip
CI/CD with GitHub Actions for Golang — testing, linting, SAST, security scanning, coverage, Dependabot, Renovate, GoReleaser, release pipelines.
context-labs/whip
Golang data structures — slices/maps internals (capacity growth, preallocation, hash buckets), slices/maps packages, container/list/heap/ring, strings.Builder vs bytes.Buffer, generic collections…
Categories
CLI command tree library for Golang using spf13/cobra — cobra.Command, RunE vs Run, PreRun hooks, Args validators, persistent vs local flags, shell completion, testing via SetArgs. Golang Spf13 Cobra is an agent skill from context-labs/whip.Command, RunE vs Run, PreRun hooks, Args validators, persistent vs local flags, shell completion, testing via SetArgs.
Golang Spf13 Cobra fits situations like: development work in your project.
Run `npx skills add context-labs/whip --skill golang-spf13-cobra -a claude-code`. Or copy the skill folder (.agents/skills/golang-spf13-cobra in context-labs/whip) into .claude/skills/golang-spf13-cobra in your project. Claude Code loads it when a task matches its description.
Run `npx skills add context-labs/whip --skill golang-spf13-cobra -a codex`. Or copy the skill folder (.agents/skills/golang-spf13-cobra in context-labs/whip) into .agents/skills/golang-spf13-cobra in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add context-labs/whip --skill golang-spf13-cobra -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/golang-spf13-cobra, .gemini/skills/golang-spf13-cobra, .github/skills/golang-spf13-cobra and .opencode/skills/golang-spf13-cobra in your project.
Going by SKILL.md and its folder, Golang Spf13 Cobra needs the command-line tools its instructions call (go). Its frontmatter pre-approves these tools: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(golangci-lint:*), Bash(git:*), Agent, WebFetch, mcp__context7__resolve-library-id, mcp__context7__query-docs, Bash(godig:*), Bash(gopls:*), LSP, mcp__gopls__*. Compatibility (from SKILL.md): Designed for Claude Code, Codex or similar harness, and for projects using Golang..
SKILL.md names 3 domains. As links in the text: github.com, pkg.go.dev and cobra.dev. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Golang Spf13 Cobra is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.8k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Golang Spf13 Cobra: Go-Redis Release Preparation (redis/go-redis, 22k stars), Machinist (owainlewis/machinist, 496 stars), Valgo (cohesivestack/valgo, 508 stars) and Release (yoanbernabeu/grepai, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
context-labs (a GitHub organization) maintains it in context-labs/whip, which has 1,083 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on October 5, 2026.
Source: context-labs/whip on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.