add-cobra-version

add-cobra-version is a skill for Claude Code from cboone/agent-harness-plugins. It costs 176 tokens per session (3,078 once invoked), scanned A, original, MIT.

A version command for a Go command-line program built with Cobra, a Go library for defining command-line commands.

In plain words
What is it for?
Adding version, commit hash, build date, and Go runtime details, then connecting those values to the program's build settings and release files.
Why use it?
It gives users and support teams a consistent way to see which build they are running and where it came from.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the add-cobra-version plugin — 1 skill shipped together

Good fit Adding version, commit hash, build date, and Go runtime details, then connecting those values to the program's build settings and release files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cboone/agent-harness-plugins/add-cobra-version
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cboone/agent-harness-plugins --skill add-cobra-version
Clone the repo
git clone --depth 1 https://github.com/cboone/agent-harness-plugins

Made for: Claude Code.

Or install add-cobra-version, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-cobra-version

README.md
[![agentmods](https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/add-cobra-version.svg)](https://agentmods.dev/skills/cboone/agent-harness-plugins/add-cobra-version)
Your own site
<a href="https://agentmods.dev/skills/cboone/agent-harness-plugins/add-cobra-version"><img src="https://agentmods.dev/badge/skills/cboone/agent-harness-plugins/add-cobra-version.svg" alt="Measured on agentmods" height="20"></a>
Per session 176 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,078 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00176 $0.03078
Opus 5 $0.00088 $0.01539
Sonnet 5 $0.00035 $0.00616
Haiku 4.5 $0.00018 $0.00308

Measured 7d ago against content hash eda0f4c3ebde, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

add-cobra-version scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/add-cobra-version/skills/add-cobra-version/SKILL.md · 219 lines

How it starts

The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add Cobra Version

Add a version subcommand with version, commit hash, build date, and Go runtime version to an existing Cobra-based Go CLI, and coordinate the matching ldflags wiring across main.go, cmd/root.go, .goreleaser.yml, and the Makefile.

Workflow

1. Verify the Project

Confirm the current directory is a Go CLI project with Cobra using the main.go plus cmd package layout this skill updates:

  • go.mod exists. If not, abort with a message that this skill requires an existing Go module.
  • A Cobra root command exists in package cmd. Check cmd/root.go first (the canonical location used by scaffold-go-cli); if absent, inspect cmd/*.go for a package-level variable assigned to &cobra.Command{.
  • Record the root command variable identifier from that declaration, for example rootCmd, cliCmd, or command. Use this identifier everywhere the templates refer to the root command.
  • If Cobra commands exist only outside package cmd, abort with a message that this skill expects a cmd package root command that main.go runs via cmd.Execute().
  • Read go.mod to extract the module path; needed when reasoning about ldflags -X targets.

2. Detect Current Version State

Determine which of three states the project is in. The state controls how aggressive the changes need to be.

  1. No version wiring: no package-level version declaration exists, either as var version ... or as a version entry in a top-level var ( ... ) block.
  2. Basic version only: a package-level version = "dev" (or similar) declaration exists, typically in main.go or cmd/root.go, but package-level commit or date declarations are missing.
  3. Full version info already present: version, commit, and date package-level variables all exist, whether as single-line var declarations or entries in a top-level var ( ... ) block.

Detection commands:

# Find direct single-line declarations across the project.
grep -rnE '^[[:space:]]*var[[:space:]]+version([[:space:]=]|$)' --include='*.go' .
grep -rnE '^[[:space:]]*var[[:space:]]+commit([[:space:]=]|$)' --include='*.go' .
grep -rnE '^[[:space:]]*var[[:space:]]+date([[:space:]=]|$)' --include='*.go' .

# Also find identifiers inside top-level var (...) blocks.
grep -rnE '^[[:space:]]*version[[:space:]]*=' --include='*.go' .
grep -rnE '^[[:space:]]*commit[[:space:]]*=' --include='*.go' .
grep -rnE '^[[:space:]]*date[[:space:]]*=' --include='*.go' .

Read the full file on GitHub · 219 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 219 lines · 176 tokens per session scan A eda0f4c3ebde

Subscribe to this mod's changes

add-cobra-version is a skill published in the GitHub repository cboone/agent-harness-plugins (2 stars, last pushed 1mo ago), licensed MIT. It adds 176 tokens to every session and 3,078 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

google-go-style

Use when writing, reviewing, or refactoring Go code; when handling errors (fmt.Errorf, %w, sentinel, errors.Is, errors.As); when deciding between panic, error return, and log.Fatal; when writing tests (table-driven, t.Helper, t.Fatal vs t.Error, goroutines); when designing API surface (option struct, variadic options…

cicdteam/google-go-style · 110 tokens

golang-testing

Go testing best practices including table-driven tests, test helpers, benchmarking, race detection, coverage analysis, and integration testing patterns. Use when writing or improving Go tests.

affaan-m/ECC · 37 tokens

golang-patterns

Go-specific design patterns and best practices including functional options, small interfaces, dependency injection, concurrency patterns, error handling, and package organization. Use when working with Go code to apply idiomatic Go patterns.

affaan-m/ECC · 45 tokens

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for…

JanDeDobbeleer/oh-my-posh · 80 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

samber/cc-skills-golang · 115 tokens

golang-uber-fx

Golang application framework using uber-go/fx — fx.New, fx.Provide, fx.Invoke, fx.Module, fx.Lifecycle hooks, fx.Annotate (name/group/As), fx.Decorate, fx.Supply, fx.Replace, fx.WithLogger, and signal-aware Run(). Apply when using or adopting uber-go/fx, when the codebase imports go.uber.org/fx, or when wiring…

samber/cc-skills-golang · 122 tokens