diff --git a/README.md b/README.md index 36ec862..c51c2f0 100644 --- a/README.md +++ b/README.md @@ -188,58 +188,58 @@ These skills are designed as **atomic, cross-referencing units**. A skill may re | | Skill | Flags | Error rate gap | Description (tok) | SKILL.md (tok) | Directory (tok) | | --- | --- | --- | --- | --- | --- | --- | -| ⭐️ | βœ… `golang-code-style` | ⚑ πŸ€– βš™οΈ | -40% | 115 | 2,341 | 2,957 | -| ⭐️ | βœ… `golang-data-structures` | ⚑ | -39% | 93 | 2,599 | 6,318 | -| ⭐️ | βœ… `golang-database` | ⚑ βš™οΈ | -38% | 97 | 2,712 | 7,234 | -| ⭐️ | βœ… `golang-design-patterns` | ⚑ βš™οΈ | -37% | 80 | 2,685 | 9,391 | -| ⭐️ | βœ… `golang-documentation` | ⚑ πŸ€– βš™οΈ | -53% | 75 | 3,078 | 11,177 | -| ⭐️ | βœ… `golang-error-handling` | ⚑ πŸ€– βš™οΈ | -26% | 141 | 1,718 | 4,677 | -| ⭐️ | βœ… `golang-how-to` | ⚑ | β€” | 165 | 4,017 | 13,853 | -| ⭐️ | βœ… `golang-modernize` | ⚑ πŸ€– | -61% | 68 | 2,920 | 9,233 | -| ⭐️ | βœ… `golang-naming` | ⚑ βš™οΈ | -23% | 159 | 3,022 | 7,390 | -| ⭐️ | βœ… `golang-refactoring` | ⚑ 🧠 πŸ€– βš™οΈ | β€” | 246 | 3,708 | 20,216 | -| ⭐️ | βœ… `golang-safety` | ⚑ | -58% | 78 | 2,605 | 5,375 | -| ⭐️ | βœ… `golang-testing` | ⚑ 🧠 πŸ€– βš™οΈ | -32% | 115 | 4,234 | 7,341 | -| ⭐️ | βœ… `golang-troubleshooting` | ⚑ 🧠 πŸ€– | -32% | 128 | 2,894 | 16,577 | -| ⭐️ | βœ… `golang-security` | ⚑ 🧠 πŸ€– | -32% | 85 | 3,160 | 21,596 | -| | βœ… `golang-benchmark` | ⚑ 🧠 | -50% | 102 | 3,042 | 30,224 | -| | βœ… `golang-cli` | ⚑ | -43% | 125 | 2,329 | 6,144 | -| | βœ… `golang-concurrency` | ⚑ πŸ€– βš™οΈ | -39% | 72 | 2,180 | 6,810 | -| | βœ… `golang-context` | ⚑ βš™οΈ | -34% | 82 | 1,202 | 4,012 | -| | βœ… `golang-continuous-integration` | ⚑ | -59% | 82 | 3,291 | 12,553 | -| | βœ… `golang-dependency-injection` | ⚑ πŸ€– βš™οΈ | -47% | 178 | 2,994 | 5,265 | -| | βœ… `golang-dependency-management` | ⚑ | -54% | 77 | 2,361 | 5,499 | -| | βœ… `golang-structs-interfaces` | ⚑ βš™οΈ | -35% | 111 | 3,067 | 3,067 | -| | βœ… `golang-lint` | ⚑ πŸ€– | -41% | 98 | 1,853 | 6,181 | -| | βœ… `golang-observability` | ⚑ πŸ€– βš™οΈ | -37% | 164 | 3,096 | 18,583 | -| | βœ… `golang-performance` | ⚑ 🧠 πŸ€– | -39% | 130 | 2,190 | 18,190 | -| | βœ… `golang-gopls` | ⚑ | β€” | 219 | 2,308 | 12,188 | -| | βœ… `golang-pkg-go-dev` | ⚑ | β€” | 230 | 3,428 | 5,242 | -| | βœ… `golang-popular-libraries` | ⚑ | -30% | 51 | 1,044 | 4,438 | -| | βœ… `golang-project-layout` | ⚑ | -38% | 69 | 1,563 | 5,778 | -| | βœ… `golang-stay-updated` | ⚑ | -56% | 44 | 1,801 | 1,801 | +| ⭐️ | βœ… `golang-code-style` | ⚑ πŸ€– βš™οΈ | -40% | 114 | 2,358 | 2,974 | +| ⭐️ | βœ… `golang-data-structures` | ⚑ | -39% | 93 | 2,608 | 6,327 | +| ⭐️ | βœ… `golang-database` | ⚑ βš™οΈ | -38% | 97 | 2,721 | 7,243 | +| ⭐️ | βœ… `golang-design-patterns` | ⚑ βš™οΈ | -37% | 80 | 2,694 | 9,400 | +| ⭐️ | βœ… `golang-documentation` | ⚑ πŸ€– βš™οΈ | -53% | 75 | 3,094 | 11,193 | +| ⭐️ | βœ… `golang-error-handling` | ⚑ πŸ€– βš™οΈ | -26% | 141 | 1,734 | 4,693 | +| ⭐️ | βœ… `golang-how-to` | ⚑ | β€” | 183 | 4,196 | 15,197 | +| ⭐️ | βœ… `golang-modernize` | ⚑ πŸ€– | -61% | 68 | 2,899 | 9,212 | +| ⭐️ | βœ… `golang-naming` | ⚑ βš™οΈ | -23% | 159 | 3,031 | 7,399 | +| ⭐️ | βœ… `golang-refactoring` | ⚑ 🧠 πŸ€– βš™οΈ | β€” | 245 | 3,835 | 20,330 | +| ⭐️ | βœ… `golang-safety` | ⚑ | -58% | 78 | 2,614 | 5,384 | +| ⭐️ | βœ… `golang-testing` | ⚑ 🧠 πŸ€– βš™οΈ | -32% | 115 | 4,270 | 7,377 | +| ⭐️ | βœ… `golang-troubleshooting` | ⚑ 🧠 πŸ€– | -32% | 127 | 2,929 | 16,612 | +| ⭐️ | βœ… `golang-security` | ⚑ 🧠 πŸ€– | -32% | 85 | 3,187 | 21,623 | +| | βœ… `golang-benchmark` | ⚑ 🧠 | -50% | 102 | 3,061 | 30,243 | +| | βœ… `golang-cli` | ⚑ | -43% | 125 | 2,338 | 6,153 | +| | βœ… `golang-concurrency` | ⚑ πŸ€– βš™οΈ | -39% | 72 | 2,199 | 6,829 | +| | βœ… `golang-context` | ⚑ βš™οΈ | -34% | 82 | 1,211 | 4,021 | +| | βœ… `golang-continuous-integration` | ⚑ | -59% | 82 | 3,336 | 12,598 | +| | βœ… `golang-dependency-injection` | ⚑ πŸ€– βš™οΈ | -47% | 178 | 3,016 | 5,287 | +| | βœ… `golang-dependency-management` | ⚑ | -54% | 77 | 2,362 | 5,500 | +| | βœ… `golang-structs-interfaces` | ⚑ βš™οΈ | -35% | 111 | 3,076 | 3,076 | +| | βœ… `golang-lint` | ⚑ πŸ€– | -41% | 98 | 1,877 | 6,295 | +| | βœ… `golang-observability` | ⚑ πŸ€– βš™οΈ | -37% | 163 | 3,118 | 18,605 | +| | βœ… `golang-performance` | ⚑ 🧠 πŸ€– | -39% | 129 | 2,226 | 18,226 | +| | βœ… `golang-gopls` | ⚑ | β€” | 219 | 2,317 | 12,299 | +| | βœ… `golang-pkg-go-dev` | ⚑ | β€” | 230 | 3,423 | 5,237 | +| | βœ… `golang-popular-libraries` | ⚑ | -30% | 51 | 1,074 | 4,543 | +| | βœ… `golang-project-layout` | ⚑ | -38% | 69 | 1,692 | 5,907 | +| | βœ… `golang-stay-updated` | ⚑ | -56% | 44 | 1,802 | 1,802 | **Tools:** | Skill | Flags | Error rate gap | Description (tok) | SKILL.md (tok) | Directory (tok) | | --- | --- | --- | --- | --- | --- | -| βœ… `golang-google-wire` | ⚑ | -16% | 122 | 2,661 | 7,391 | -| βœ… `golang-graphql` | | -16% | 76 | 3,061 | 7,932 | -| βœ… `golang-grpc` | ⚑ | -41% | 70 | 2,332 | 5,148 | -| βœ… `golang-spf13-cobra` | ⚑ | β€” | 176 | 2,571 | 7,342 | -| βœ… `golang-spf13-viper` | ⚑ | β€” | 170 | 2,542 | 7,089 | -| βœ… `golang-swagger` | ⚑ | β€” | 144 | 2,333 | 3,338 | -| βœ… `golang-uber-dig` | ⚑ | -10% | 107 | 2,576 | 6,248 | -| βœ… `golang-uber-fx` | ⚑ | -5% | 118 | 2,816 | 7,051 | -| βœ… `golang-samber-do` | ⚑ | -81% | 71 | 1,877 | 3,392 | -| βœ… `golang-samber-hot` | ⚑ | -54% | 119 | 1,977 | 7,407 | -| βœ… `golang-samber-lo` | ⚑ | -40% | 167 | 2,601 | 10,279 | -| βœ… `golang-samber-mo` | ⚑ 🧠 | -48% | 82 | 2,943 | 11,358 | -| βœ… `golang-samber-oops` | ⚑ | -59% | 70 | 2,535 | 2,847 | -| βœ… `golang-samber-ro` | ⚑ 🧠 | -50% | 154 | 2,952 | 11,168 | -| βœ… `golang-samber-slog` | ⚑ | -19% | 119 | 3,111 | 9,833 | +| βœ… `golang-google-wire` | ⚑ | -16% | 122 | 2,670 | 7,400 | +| βœ… `golang-graphql` | | -16% | 76 | 3,070 | 7,941 | +| βœ… `golang-grpc` | ⚑ | -41% | 70 | 2,341 | 5,157 | +| βœ… `golang-spf13-cobra` | ⚑ | β€” | 176 | 2,580 | 7,351 | +| βœ… `golang-spf13-viper` | ⚑ | β€” | 170 | 2,551 | 7,098 | +| βœ… `golang-swagger` | ⚑ | β€” | 144 | 2,342 | 3,347 | +| βœ… `golang-uber-dig` | ⚑ | -10% | 107 | 2,585 | 6,257 | +| βœ… `golang-uber-fx` | ⚑ | -5% | 118 | 2,825 | 7,060 | +| βœ… `golang-samber-do` | ⚑ | -81% | 71 | 2,145 | 3,660 | +| βœ… `golang-samber-hot` | ⚑ | -54% | 119 | 1,986 | 7,416 | +| βœ… `golang-samber-lo` | ⚑ | -40% | 166 | 2,610 | 10,288 | +| βœ… `golang-samber-mo` | ⚑ 🧠 | -48% | 82 | 2,967 | 11,382 | +| βœ… `golang-samber-oops` | ⚑ | -59% | 70 | 2,544 | 2,856 | +| βœ… `golang-samber-ro` | ⚑ 🧠 | -50% | 153 | 2,976 | 11,192 | +| βœ… `golang-samber-slog` | ⚑ | -19% | 119 | 3,120 | 9,842 | | ❌ `golang-temporal` | | β€” | 0 | 0 | 0 | -| βœ… `golang-stretchr-testify` | ⚑ | -47% | 92 | 1,849 | 2,668 | +| βœ… `golang-stretchr-testify` | ⚑ | -47% | 92 | 1,858 | 2,677 | ## πŸ§ͺ Skill evaluations diff --git a/skills/golang-benchmark/SKILL.md b/skills/golang-benchmark/SKILL.md index 7a3a6f3..d474a8c 100644 --- a/skills/golang-benchmark/SKILL.md +++ b/skills/golang-benchmark/SKILL.md @@ -3,7 +3,7 @@ name: golang-benchmark description: "Golang benchmarking, profiling, and performance measurement. Use when writing, running, or comparing Go benchmarks, profiling hot paths with pprof, interpreting CPU/memory/trace profiles, analyzing results with benchstat, setting up CI benchmark regression detection, or investigating production performance with Prometheus runtime metrics. Also use when the developer needs deep analysis on a specific performance indicator - this skill provides the measurement methodology, while `samber/cc-skills-golang@golang-performance` provides the optimization patterns." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.7" @@ -19,11 +19,13 @@ metadata: package: golang.org/x/perf/cmd/benchstat@latest bins: [benchstat] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(benchstat:*) Bash(benchdiff:*) Bash(cob:*) Bash(gobenchdata:*) Bash(curl:*) mcp__context7__resolve-library-id mcp__context7__query-docs WebSearch AskUserQuestion EnterWorktree ExitWorktree +paths: + - "**/*.go" --- **Persona:** You are a Go performance measurement engineer. You never draw conclusions from a single benchmark run β€” statistical rigor and controlled conditions are prerequisites before any optimization decision. -**Thinking mode:** Use `ultrathink` for benchmark analysis, profile interpretation, and performance comparison tasks. Deep reasoning prevents misinterpreting profiling data and ensures statistically sound conclusions. +**Thinking mode:** Reason as thoroughly as possible for benchmark analysis, profile interpretation, and performance comparison tasks β€” deep reasoning prevents misinterpreting profiling data and ensures statistically sound conclusions. On Claude Code, use `ultrathink` to trigger extended thinking explicitly. **Dependencies:** @@ -113,11 +115,11 @@ go test -bench=BenchmarkEncode -benchmem -count=10 ./pkg/... | tee bench.txt ## Comparing Optimization Variants in Parallel -When several competing optimization hypotheses exist for the same bottleneck, implement each variant in its own isolated worktree (`EnterWorktree`) via a separate sub-agent, so their code changes never collide in the shared working tree. +When several competing optimization hypotheses exist for the same bottleneck, implement each variant in its own isolated worktree via a separate sub-agent, so their code changes never collide in the shared working tree. **Run the benchmarks serially, not concurrently.** Concurrent benchmark runs share the same CPU β€” the noisy-neighbor effect contaminates `ns/op` and reintroduces the exact statistical noise `-count` and `benchstat` exist to eliminate. Implementing in parallel is safe (isolated worktrees, no file contention); measuring in parallel is not (shared hardware, real contention). Run each variant's benchmark one at a time, back in the main tree or sequentially per worktree. -Compare every variant's `benchstat` output against the **same** baseline report, keep the winner, and `ExitWorktree` (remove) the rest. +Compare every variant's `benchstat` output against the **same** baseline report, keep the winner, and remove the worktrees for the rest. ## Documenting Results in Commits diff --git a/skills/golang-cli/SKILL.md b/skills/golang-cli/SKILL.md index d861c04..ba1f858 100644 --- a/skills/golang-cli/SKILL.md +++ b/skills/golang-cli/SKILL.md @@ -3,7 +3,7 @@ name: golang-cli description: "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/O patterns, signal handling, shell completion, argument validation, and CLI unit testing. Also triggers when code uses cobra, viper, or urfave/cli. For cobra-specific APIs β†’ See `samber/cc-skills-golang@golang-spf13-cobra` skill; for viper configuration layering β†’ See `samber/cc-skills-golang@golang-spf13-viper` skill." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.0" @@ -15,6 +15,8 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion +paths: + - "**/*.go" --- **Persona:** You are a Go CLI engineer. You build tools that feel native to the Unix shell β€” composable, scriptable, and predictable under automation. diff --git a/skills/golang-code-style/SKILL.md b/skills/golang-code-style/SKILL.md index f0ece7b..ffc64fc 100644 --- a/skills/golang-code-style/SKILL.md +++ b/skills/golang-code-style/SKILL.md @@ -3,7 +3,7 @@ name: golang-code-style description: "Golang code style conventions β€” line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (β†’ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (β†’ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (β†’ See `samber/cc-skills-golang@golang-documentation` skill)." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.2" @@ -15,9 +15,11 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent +paths: + - "**/*.go" --- -**Orchestration mode:** Use `ultracode` when reviewing code style across a large codebase β€” orchestrate the sub-agents described in the "Parallelizing Code Style Reviews" section, each covering an independent style concern, and merge their findings. +**Orchestration mode:** Fan out the sub-agents described in the "Parallelizing Code Style Reviews" section, each covering an independent style concern, when reviewing code style across a large codebase, and merge their findings. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. > **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-code-style` skill takes precedence. @@ -223,7 +225,7 @@ func Contains[T comparable](slice []T, target T) bool // not []any ## Parallelizing Code Style Reviews -When reviewing code style across a large codebase, use up to 5 parallel sub-agents (via the Agent tool), each targeting an independent style concern (e.g. control flow, function design, variable declarations, string handling, code organization). +When reviewing code style across a large codebase, use up to 5 parallel sub-agents, each targeting an independent style concern (e.g. control flow, function design, variable declarations, string handling, code organization). ## Enforce with Linters diff --git a/skills/golang-concurrency/SKILL.md b/skills/golang-concurrency/SKILL.md index c5325eb..6e862b0 100644 --- a/skills/golang-concurrency/SKILL.md +++ b/skills/golang-concurrency/SKILL.md @@ -3,7 +3,7 @@ name: golang-concurrency description: "Golang concurrency patterns. Use when writing or reviewing concurrent Go code involving goroutines, channels, select, locks, sync primitives, errgroup, singleflight, worker pools, or fan-out/fan-in pipelines. Also triggers when you detect goroutine leaks, race conditions, channel ownership issues, or need to choose between channels and mutexes." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.5" @@ -15,11 +15,13 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion +paths: + - "**/*.go" --- **Persona:** You are a Go concurrency engineer. You assume every goroutine is a liability until proven necessary β€” correctness and leak-freedom come before performance. -**Orchestration mode:** Use `ultracode` for auditing concurrent code across a large codebase β€” orchestrate the five sub-agents described in the "Parallelizing Concurrency Audits" section and consolidate their findings into one report. +**Orchestration mode:** Fan out the five sub-agents described in the "Parallelizing Concurrency Audits" section for auditing concurrent code across a large codebase, and consolidate their findings into one report. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** @@ -99,7 +101,7 @@ For pipeline patterns (fan-out/fan-in, bounded workers, generator chains, Go 1.2 ## Parallelizing Concurrency Audits -When auditing concurrency across a large codebase, use up to 5 parallel sub-agents (Agent tool): +When auditing concurrency across a large codebase, use up to 5 parallel sub-agents: 1. Find all goroutine spawns (`go func`, `go method`) and verify shutdown mechanisms 2. Search for mutable globals and shared state without synchronization diff --git a/skills/golang-context/SKILL.md b/skills/golang-context/SKILL.md index a0a1d02..f8e9e12 100644 --- a/skills/golang-context/SKILL.md +++ b/skills/golang-context/SKILL.md @@ -3,7 +3,7 @@ name: golang-context description: "Idiomatic context.Context usage in Golang β€” propagation through API boundaries, cancellation, timeouts and deadlines, request-scoped values, context.WithoutCancel for background work outliving requests. Apply when designing context propagation across layers, debugging leaked or unexpired contexts, choosing between context.Background/TODO/WithoutCancel, or storing values in context. Not for code that merely accepts ctx as first parameter." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.1" @@ -15,6 +15,8 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent +paths: + - "**/*.go" --- > **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-context` skill takes precedence. diff --git a/skills/golang-continuous-integration/SKILL.md b/skills/golang-continuous-integration/SKILL.md index 9219b68..7b8dad1 100644 --- a/skills/golang-continuous-integration/SKILL.md +++ b/skills/golang-continuous-integration/SKILL.md @@ -3,7 +3,7 @@ name: golang-continuous-integration description: "CI/CD pipeline configuration using GitHub Actions for Golang projects β€” testing, linting, SAST, security scanning, code coverage, Dependabot, Renovate, GoReleaser, code review automation, and release pipelines. Use when setting up or improving Go project CI, configuring GitHub Actions workflows, adding linters or security scanners, automating dependency updates, or adding quality gates." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.3.1" @@ -225,6 +225,8 @@ Add AI agents as PR reviewers alongside traditional static analysis. When loaded > **Cost note:** AI review agents run concurrently per PR. For cost control, remove jobs you don't need or raise the PR trigger filter to specific branches only. +Each subsection below is a generated artifact targeting one specific reviewer β€” the linked asset file runs on a CI runner, not the developer's local harness, so its tool names and permission flags are deliberately literal rather than capability prose. + ### Claude Code `.github/workflows/ai-review.yml` β€” see [claude-code-review.yml](./assets/claude-code-review.yml) diff --git a/skills/golang-data-structures/SKILL.md b/skills/golang-data-structures/SKILL.md index 6264d3f..8bb7b98 100644 --- a/skills/golang-data-structures/SKILL.md +++ b/skills/golang-data-structures/SKILL.md @@ -3,7 +3,7 @@ name: golang-data-structures description: "Golang data structures β€” slices (internals, capacity growth, preallocation, slices package), maps (internals, hash buckets, maps package), arrays, container/list/heap/ring, strings.Builder vs bytes.Buffer, generic collections, pointers (unsafe.Pointer, weak.Pointer), and copy semantics. Use when choosing or optimizing Go data structures, implementing generic containers, using container/ packages, unsafe or weak pointers, or questioning slice/map internals." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.6" @@ -15,6 +15,8 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* mcp__context7__resolve-library-id mcp__context7__query-docs +paths: + - "**/*.go" --- **Persona:** You are a Go engineer who understands data structure internals. You choose the right structure for the job β€” not the most familiar one β€” by reasoning about memory layout, allocation cost, and access patterns. diff --git a/skills/golang-database/SKILL.md b/skills/golang-database/SKILL.md index 9935014..63d2726 100644 --- a/skills/golang-database/SKILL.md +++ b/skills/golang-database/SKILL.md @@ -3,7 +3,7 @@ name: golang-database description: "Comprehensive guide for Go database access β€” parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context propagation, and migration tooling. Use when writing, reviewing, or debugging Golang code that interacts with PostgreSQL, MariaDB, MySQL, or SQLite; for database testing; or for questions about database/sql, sqlx, or pgx. Does NOT generate database schemas or migration SQL." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.1" @@ -15,6 +15,8 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion +paths: + - "**/*.go" --- **Persona:** You are a Go backend engineer who writes safe, explicit, and observable database code. You treat SQL as a first-class language β€” no ORMs, no magic β€” and you catch data integrity issues at the boundary, not deep in the application. diff --git a/skills/golang-dependency-injection/SKILL.md b/skills/golang-dependency-injection/SKILL.md index 040f2a1..30a53e1 100644 --- a/skills/golang-dependency-injection/SKILL.md +++ b/skills/golang-dependency-injection/SKILL.md @@ -3,7 +3,7 @@ name: golang-dependency-injection description: "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/wire, uber-go/dig, uber-go/fx, samber/do). 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. For a specific DI library, β†’ See `samber/cc-skills-golang@golang-google-wire`, `samber/cc-skills-golang@golang-uber-dig`, `samber/cc-skills-golang@golang-uber-fx`, or `samber/cc-skills-golang@golang-samber-do` skills." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.2" @@ -15,11 +15,13 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion +paths: + - "**/*.go" --- **Persona:** You are a Go software architect. You guide teams toward testable, loosely coupled designs β€” you choose the simplest DI approach that solves the problem, and you never over-engineer. -**Orchestration mode:** Use `ultracode` when refactoring a large coupled codebase toward dependency injection β€” orchestrate the three sub-agents described in Refactor mode (global/init discovery, concrete-dependency mapping, service-locator detection) and consolidate into one migration plan. +**Orchestration mode:** Fan out the three sub-agents described in Refactor mode (global/init discovery, concrete-dependency mapping, service-locator detection) when refactoring a large coupled codebase toward dependency injection, and consolidate into one migration plan. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** diff --git a/skills/golang-dependency-management/SKILL.md b/skills/golang-dependency-management/SKILL.md index 54aa5f1..c50fa61 100644 --- a/skills/golang-dependency-management/SKILL.md +++ b/skills/golang-dependency-management/SKILL.md @@ -3,7 +3,7 @@ name: golang-dependency-management description: "Dependency management strategies for Golang projects β€” go.mod management, installing/upgrading packages, Minimal Version Selection, vulnerability scanning, outdated dependency tracking, binary size analysis, Dependabot/Renovate setup, conflict resolution, and go.work workspaces. Use when adding, removing, or upgrading Go dependencies, auditing vulnerabilities, resolving version conflicts, or setting up automated dependency updates." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.4" diff --git a/skills/golang-design-patterns/SKILL.md b/skills/golang-design-patterns/SKILL.md index 991d7af..9f879bc 100644 --- a/skills/golang-design-patterns/SKILL.md +++ b/skills/golang-design-patterns/SKILL.md @@ -3,7 +3,7 @@ name: golang-design-patterns description: "Idiomatic Golang design patterns β€” functional options, constructors, error flow and cascading, resource management and lifecycle, graceful shutdown, resilience, architecture, dependency injection, data handling, streaming, and more. Apply when explicitly choosing between architectural patterns, implementing functional options, designing constructor APIs, setting up graceful shutdown, applying resilience patterns, or asking which idiomatic Go pattern fits a specific problem." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.5" @@ -15,6 +15,8 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion +paths: + - "**/*.go" --- **Persona:** You are a Go architect who values simplicity and explicitness. You apply patterns only when they solve a real problem β€” not to demonstrate sophistication β€” and you push back on premature abstraction. diff --git a/skills/golang-documentation/SKILL.md b/skills/golang-documentation/SKILL.md index f555311..e45a31d 100644 --- a/skills/golang-documentation/SKILL.md +++ b/skills/golang-documentation/SKILL.md @@ -3,7 +3,7 @@ name: golang-documentation description: "Comprehensive documentation guide for Golang projects, covering godoc comments, README, CONTRIBUTING, CHANGELOG, Go Playground, Example tests, API docs, and llms.txt. Use when writing or reviewing doc comments, documentation, adding code examples, setting up doc sites, or discussing documentation best practices. Triggers for both libraries and applications/CLIs." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.6" @@ -15,11 +15,13 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch +paths: + - "**/*.go" --- **Persona:** You are a Go technical writer and API designer. You treat documentation as a first-class deliverable β€” accurate, example-driven, and written for the reader who has never seen this codebase before. -**Orchestration mode:** Use `ultracode` for documenting or auditing documentation across a large codebase β€” orchestrate the sub-agents described in the "Parallelizing Documentation Work" section (one per package, or one per doc layer/file) and merge their output into the final docs. +**Orchestration mode:** Fan out the sub-agents described in the "Parallelizing Documentation Work" section (one per package, or one per doc layer/file) for documenting or auditing documentation across a large codebase, and merge their output into the final docs. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** @@ -92,7 +94,7 @@ A private project might not need a documentation website, llms.txt, Go Playgroun ## Parallelizing Documentation Work -When documenting a large codebase with many packages, use up to 5 parallel sub-agents (via the Agent tool) for independent tasks: +When documenting a large codebase with many packages, use up to 5 parallel sub-agents for independent tasks: - Assign each sub-agent to verify and fix doc comments in a different set of packages - Generate `ExampleXxx` test functions for multiple packages simultaneously diff --git a/skills/golang-error-handling/SKILL.md b/skills/golang-error-handling/SKILL.md index 73976ab..f7c07ef 100644 --- a/skills/golang-error-handling/SKILL.md +++ b/skills/golang-error-handling/SKILL.md @@ -3,7 +3,7 @@ name: golang-error-handling description: "Idiomatic Golang error handling β€” creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics β†’ See `samber/cc-skills-golang@golang-samber-oops` skill; for slog handler ecosystem β†’ See `samber/cc-skills-golang@golang-samber-slog` skill." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.1" @@ -15,11 +15,13 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent +paths: + - "**/*.go" --- **Persona:** You are a Go reliability engineer. You treat every error as an event that must either be handled or propagated with context β€” silent failures and duplicate logs are equally unacceptable. -**Orchestration mode:** Use `ultracode` for auditing error handling across a large codebase β€” orchestrate the five category sub-agents described in the "Parallelizing Error Handling Audits" section (creation, wrapping, single-handling rule, panic/recover, structured logging) and consolidate their findings. +**Orchestration mode:** Fan out the five category sub-agents described in the "Parallelizing Error Handling Audits" section (creation, wrapping, single-handling rule, panic/recover, structured logging) for auditing error handling across a large codebase, and consolidate their findings. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** @@ -61,7 +63,7 @@ This skill guides the creation of robust, idiomatic error handling in Go applica ## Parallelizing Error Handling Audits -When auditing error handling across a large codebase, use up to 5 parallel sub-agents (via the Agent tool) β€” each targets an independent error category: +When auditing error handling across a large codebase, use up to 5 parallel sub-agents β€” each targets an independent error category: - Sub-agent 1: Error creation β€” validate `errors.New`/`fmt.Errorf` usage, low-cardinality messages, custom types - Sub-agent 2: Error wrapping β€” audit `%w` vs `%v`, verify `errors.Is`/`errors.As` patterns diff --git a/skills/golang-google-wire/SKILL.md b/skills/golang-google-wire/SKILL.md index 5afdaa7..1b73e40 100644 --- a/skills/golang-google-wire/SKILL.md +++ b/skills/golang-google-wire/SKILL.md @@ -3,7 +3,7 @@ name: golang-google-wire description: "Compile-time dependency injection in Golang using google/wire β€” wire.NewSet, wire.Build, wire.Bind (interfaceβ†’concrete), wire.Struct, wire.Value, wire.InterfaceValue, wire.FieldsOf, cleanup functions, //go:build wireinject injector files, and generated wire_gen.go. Apply when using or adopting google/wire, when the codebase imports `github.com/google/wire`, or when wiring an application graph at compile time via `wire.Build`. For runtime DI with reflection, see `samber/cc-skills-golang@golang-uber-dig` skill." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.0.6" @@ -20,6 +20,8 @@ metadata: bins: [wire] skill-library-version: "0.7.0" allowed-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(wire:*) Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go architect using wire for compile-time DI. You let the compiler catch missing dependencies, treat `wire_gen.go` as committed source, and re-run `wire ./...` after every graph change. diff --git a/skills/golang-gopls/SKILL.md b/skills/golang-gopls/SKILL.md index c0874a3..97c819d 100644 --- a/skills/golang-gopls/SKILL.md +++ b/skills/golang-gopls/SKILL.md @@ -3,7 +3,7 @@ name: golang-gopls description: "Golang semantic code intelligence via `gopls`, the official Go language server β€” go-to-definition, find references, call/implementation hierarchy, workspace symbol search, package API discovery, diagnostics, safe rename, refactors (extract/inline/fill/rewrite code actions), formatting, and generated tests. Reaches an agent via gopls's own MCP server (`go_*` tools), Claude Code's native `LSP` tool, or the `gopls` CLI. Use when navigating or refactoring Go code β€” jumping to a definition, finding call sites before a rename, understanding a file's or package's dependencies, running diagnostics after an edit, or extracting/inlining/renaming. Not for the published ecosystem β€” packages not in your `go.mod`, versions, licenses, importers β€” β†’ See `samber/cc-skills-golang@golang-pkg-go-dev` skill (`godig`). Not for a whole-tree vulnerability audit β†’ See `samber/cc-skills-golang@golang-security` skill (`govulncheck`)." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents. Requires the gopls binary (go install golang.org/x/tools/gopls@latest) v0.20+ on PATH. +compatibility: Designed for Claude Code, Codex or similar harness. Requires the gopls binary (go install golang.org/x/tools/gopls@latest) v0.20+ on PATH. metadata: author: samber version: "1.0.0" @@ -20,6 +20,8 @@ metadata: bins: [gopls] skill-library-version: "0.22.0" allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go engineer who reaches for semantic code intelligence instead of grep whenever a question is about the resolved build β€” grep finds text, `gopls` finds meaning (types, call graphs, shadowing, implementation relationships). diff --git a/skills/golang-gopls/references/mcp.md b/skills/golang-gopls/references/mcp.md index 9a1b781..f7cef62 100644 --- a/skills/golang-gopls/references/mcp.md +++ b/skills/golang-gopls/references/mcp.md @@ -3,7 +3,7 @@ ## Table of contents - [Starting the server](#starting-the-server) -- [Registering with Claude Code](#registering-with-claude-code) +- [Registering the MCP server](#registering-the-mcp-server) - [MCP tools](#mcp-tools) - [The native `LSP` tool](#the-native-lsp-tool) - [What the MCP server can and cannot do](#what-the-mcp-server-can-and-cannot-do) @@ -18,12 +18,16 @@ gopls mcp Only sees files as they exist **on disk** β€” an edit made through a different tool but not yet saved is invisible to it. This is the right mode for an agent-only workflow with no attached editor. -## Registering with Claude Code +## Registering the MCP server + +The underlying command that starts the server (`gopls mcp`) is harness-agnostic β€” any MCP-capable host can point at it. Claude Code registers it via its own CLI: ```bash claude mcp add gopls -- gopls mcp ``` +Other MCP-capable harnesses (Cursor, Windsurf, and others) each have their own MCP server registration β€” an entry in their respective settings file pointing at `gopls mcp` as the launch command, not a shared config format. + ## MCP tools Eight tools, all keyed by name/path/query rather than cursor position β€” this is the main ergonomic difference from the native `LSP` tool. diff --git a/skills/golang-gopls/references/settings.md b/skills/golang-gopls/references/settings.md index 931faed..1bcf86c 100644 --- a/skills/golang-gopls/references/settings.md +++ b/skills/golang-gopls/references/settings.md @@ -1,6 +1,6 @@ # gopls settings reference -Source: [tip.golang.org/gopls/settings](https://tip.golang.org/gopls/settings). Settings are passed via the LSP client's `initializationOptions` (editor-specific config file/UI) β€” there is no `gopls.json` read from the workspace by default. Full canonical list: `gopls api-json`. Store the settings in CLAUDE.md. +Source: [tip.golang.org/gopls/settings](https://tip.golang.org/gopls/settings). Settings are passed via the LSP client's `initializationOptions` (editor-specific config file/UI) β€” there is no `gopls.json` read from the workspace by default. Full canonical list: `gopls api-json`. Record the chosen settings in the project's agent-config file (CLAUDE.md, AGENTS.md, or equivalent), so future sessions pick them up without rediscovering them. ## Table of contents diff --git a/skills/golang-graphql/SKILL.md b/skills/golang-graphql/SKILL.md index c9952aa..45515cb 100644 --- a/skills/golang-graphql/SKILL.md +++ b/skills/golang-graphql/SKILL.md @@ -3,7 +3,7 @@ name: golang-graphql description: "Implements GraphQL APIs in Golang using gqlgen or graphql-go. Apply when building GraphQL servers, designing schemas, writing resolvers, handling subscriptions, or integrating GraphQL with existing Go HTTP services. Also apply when the codebase imports `github.com/99designs/gqlgen` or `github.com/graph-gophers/graphql-go`." user-invocable: false license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "0.1.1" @@ -16,6 +16,8 @@ metadata: install: [] skill-library-version: "0.17.89" allowed-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(curl:*) Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go GraphQL engineer. You design schemas deliberately, batch database access to prevent N+1, and treat query complexity limits as non-optional in production. diff --git a/skills/golang-grpc/SKILL.md b/skills/golang-grpc/SKILL.md index 9943afe..7b0ba0c 100644 --- a/skills/golang-grpc/SKILL.md +++ b/skills/golang-grpc/SKILL.md @@ -3,7 +3,7 @@ name: golang-grpc description: "Provides gRPC usage guidelines, protobuf organization, and production-ready patterns for Golang microservices. Use when implementing, reviewing, or debugging gRPC servers/clients, writing proto files, setting up interceptors, handling gRPC errors with status codes, configuring TLS/mTLS, testing with bufconn, or working with streaming RPCs." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.7" @@ -19,6 +19,8 @@ metadata: formula: protobuf bins: [protoc] allowed-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(protoc:*) AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go distributed systems engineer. You design gRPC services for correctness and operability β€” proper status codes, deadlines, interceptors, and graceful shutdown matter as much as the happy path. diff --git a/skills/golang-how-to/SKILL.md b/skills/golang-how-to/SKILL.md index 9c1f953..d324e2d 100644 --- a/skills/golang-how-to/SKILL.md +++ b/skills/golang-how-to/SKILL.md @@ -1,9 +1,9 @@ --- name: golang-how-to -description: "Golang skills orchestrator β€” always active on any Golang coding, review, debug, or setup task. Reads the task context and loads the most relevant skills from samber/cc-skills-golang, often multiple at once: writing a gRPC service loads golang-grpc + golang-testing + golang-error-handling; debugging a panic loads golang-troubleshooting + golang-safety; auditing security loads golang-security + golang-lint + golang-safety. Also: disambiguates competing clusters when two skills seem to overlap (performance vs benchmark vs troubleshooting, samber/lo vs mo vs ro, DI cluster, safety vs security), and configures CLAUDE.md or AGENTS.md to force-trigger skills in a project (/golang-how-to configure)." +description: "Golang skills orchestrator β€” always active on any Golang coding, review, debug, or setup task. Reads the task context and loads the most relevant skills from samber/cc-skills-golang, often multiple at once: writing a gRPC service loads golang-grpc + golang-testing + golang-error-handling; debugging a panic loads golang-troubleshooting + golang-safety; auditing security loads golang-security + golang-lint + golang-safety. Also: disambiguates competing clusters when two skills seem to overlap (performance vs benchmark vs troubleshooting, samber/lo vs mo vs ro, DI cluster, safety vs security), and configures the project's agent-config file (CLAUDE.md, AGENTS.md, GEMINI.md, Cursor rules, or Copilot instructions) to force-trigger skills in a project (/golang-how-to configure)." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents. Requires git. +compatibility: Designed for Claude Code, Codex or similar harness. Requires git. metadata: author: samber version: "1.3.0" @@ -23,13 +23,15 @@ allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(git:*) Agent AskUserQue **Persona:** You are a Go skills orchestrator. For every Go task, identify all relevant skills and load them together β€” a task rarely belongs to a single skill. -**Dependencies:** `gopls` β€” `go install golang.org/x/tools/gopls@latest`; the built-in `LSP` tool also needs `ENABLE_LSP_TOOL=1` and a Go language server wired (see [Code navigation with gopls](#code-navigation-with-gopls)). - **Modes:** - **Orchestrate** β€” for any Go coding, review, debug, or setup task, load the primary skill plus all applicable secondary skills simultaneously. - **Disambiguate** β€” when two skills seem to overlap, show the boundary table. See [disambiguation.md](references/disambiguation.md). -- **Configure** β€” write the always-load directive for `golang-how-to` itself, plus an optional `## Required Go skills` block, to the project's `CLAUDE.md` or `AGENTS.md`. Follow [project-config.md](references/project-config.md). +- **Configure** β€” write the always-load directive for `golang-how-to` itself, plus an optional `## Required Go skills` block, to the project's agent-config file. Follow [project-config.md](references/project-config.md). + +**Questions:** In Configure mode, ask the user through the environment's question tool β€” never as plain-text prose. One question at a time, wait for the answer. If the environment has no question tool, ask in prose with the same options. + +**Dependencies:** `gopls` β€” `go install golang.org/x/tools/gopls@latest`; the built-in `LSP` tool also needs `ENABLE_LSP_TOOL=1` and a Go language server wired (see [Code navigation with gopls](#code-navigation-with-gopls)). ## Skill loading @@ -147,7 +149,7 @@ Key clusters and their owners: ## Configure mode -Write an always-load directive for `golang-how-to` itself to a project's `CLAUDE.md` or `AGENTS.md`, and optionally force-trigger specific secondary skills too. +Write an always-load directive for `golang-how-to` itself to the project's agent-config file (CLAUDE.md, AGENTS.md, GEMINI.md, Cursor rules, or Copilot instructions β€” whichever the project's harness reads), and optionally force-trigger specific secondary skills too. `samber/cc-skills-golang@golang-project-layout` writes the always-load directive automatically at project creation, with no user confirmation needed β€” it costs one skill description and never imposes project-specific choices. Running `/golang-how-to configure` writes it too if missing, and additionally lets the user confirm a `## Required Go skills` block for skills that must always apply beyond routing. Follow [project-config.md](references/project-config.md). diff --git a/skills/golang-how-to/assets/cursor-go-skills.mdc b/skills/golang-how-to/assets/cursor-go-skills.mdc new file mode 100644 index 0000000..56f29ce --- /dev/null +++ b/skills/golang-how-to/assets/cursor-go-skills.mdc @@ -0,0 +1,14 @@ +--- +description: Load the Go skills orchestrator before any Go task +alwaysApply: true +--- + +Before any Go coding, review, debugging, troubleshooting, or setup task, load the `samber/cc-skills-golang@golang-how-to` skill first β€” it routes to whichever other Go skills the task needs. + +## Required Go skills + +The following Go skills from `samber/cc-skills-golang` MUST always be applied when working on this project. Load them at the start of every Go-related task, regardless of whether the user explicitly mentions them. + +- `samber/cc-skills-golang@golang-error-handling` +- `samber/cc-skills-golang@golang-security` +- `samber/cc-skills-golang@golang-testing` diff --git a/skills/golang-how-to/references/project-config.md b/skills/golang-how-to/references/project-config.md index ac963c0..d1739bf 100644 --- a/skills/golang-how-to/references/project-config.md +++ b/skills/golang-how-to/references/project-config.md @@ -1,6 +1,6 @@ # Configure mode β€” force-trigger Go skills in a project -This workflow writes two independent things to the project's agent config file: +This workflow writes two independent things to the project's agent-config file(s): 1. An **always-load directive** for `golang-how-to` itself β€” a single sentence, unconditional, no user confirmation needed. 2. An optional `## Required Go skills` block that force-triggers a specific, user-confirmed set of secondary skills. @@ -14,7 +14,7 @@ This workflow writes two independent things to the project's agent config file: ## Always-load directive -Every Go project should carry a one-line directive telling any coding agent β€” Claude Code, Codex, Cursor, Copilot β€” to load the `samber/cc-skills-golang@golang-how-to` orchestrator skill before starting Go work, so it in turn routes to whichever other Go skills the task actually needs. Unlike the `## Required Go skills` block below, this directive needs no `AskUserQuestion` confirmation: it costs one skill description (~100 tokens) and is never wrong, since `golang-how-to` only routes to other skills β€” it does not impose project-specific choices. +Every Go project should carry a one-line directive telling the coding agent to load the `samber/cc-skills-golang@golang-how-to` orchestrator skill before starting Go work, so it in turn routes to whichever other Go skills the task actually needs. Unlike the `## Required Go skills` block below, this directive needs no user confirmation: it costs one skill description (~100 tokens) and is never wrong, since `golang-how-to` only routes to other skills β€” it does not impose project-specific choices. ### Template @@ -42,33 +42,36 @@ grep -n 'load the `samber/cc-skills-golang@golang-how-to` skill first' CLAUDE.md Skip writing if already present. -## Step 1 β€” Detect the project config file +## Step 1 β€” Detect the project config file(s) -Check in this precedence order: +Every harness reads its own agent-config file or directory. None is more "primary" than another β€” detect and write to whichever exist, and write to all of them if more than one does: -``` -1. CLAUDE.md (Claude Code) -2. AGENTS.md (OpenAI Codex, OpenCode, multi-agent) -3. .cursor/rules (Cursor) -4. .github/copilot-instructions.md (GitHub Copilot) -``` +| File / directory | Harness(es) | Format | +| --- | --- | --- | +| `CLAUDE.md` | Claude Code | Markdown, single file, appended to | +| `AGENTS.md` | Codex, OpenCode, and other multi-agent harnesses | Markdown, single file, appended to | +| `GEMINI.md` | Gemini CLI, Antigravity | Markdown, single file, appended to | +| `.cursor/rules/*.mdc` | Cursor | **Directory** of `.mdc` files, each with its own YAML frontmatter β€” not a single markdown file to append to | +| `.github/copilot-instructions.md` | GitHub Copilot | Markdown, single file, appended to | -Use `Glob` to detect which files exist at the project root. If multiple exist, use all of them (different tools read different files). If none exist, ask the user which one to create with `AskUserQuestion`. +Check which of these exist at the project root. If multiple exist, write to all of them β€” different harnesses read different files, and a project may support several. If none exist, ask the user which one(s) to create. ## Step 2 β€” Idempotency check -Before writing, grep each file for the always-load directive and an existing `## Required Go skills` block: +For the markdown files (`CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `.github/copilot-instructions.md`), grep each one for the always-load directive and an existing `## Required Go skills` block before writing: ```bash grep -n 'load the `samber/cc-skills-golang@golang-how-to` skill first' CLAUDE.md grep -n "## Required Go skills" CLAUDE.md ``` -Write the always-load directive if it's missing, regardless of what Step 3 decides. If the `## Required Go skills` block already exists, read it and confirm with the user whether to update it in place (replace the existing list) or skip. +For Cursor, check whether `.cursor/rules/golang-skills.mdc` already exists instead β€” its presence itself is the idempotency signal, since it's a dedicated file rather than a shared section inside a larger document. + +Write the always-load directive if it's missing, regardless of what Step 3 decides. If a `## Required Go skills` block (or, for Cursor, the rule file) already exists, read it and confirm with the user whether to update it in place (replace the existing list) or skip. ## Step 3 β€” Confirm the skill set with the user -Use `AskUserQuestion` to confirm which skills to always load. Present the ⭐️ recommended skills as the default selection. Remind the user of the token budget (each always-loaded skill adds its description tokens to every session β€” the 11 recommended skills add ~1,100 tokens at startup). +Confirm which skills to always load β€” one question, one round of confirmation, not a running back-and-forth. Present the ⭐️ recommended skills as the default selection. Remind the user of the token budget (each always-loaded skill adds its description tokens to every session β€” the 11 recommended skills add ~1,100 tokens at startup). Recommended ⭐️ set for most projects: @@ -97,7 +100,9 @@ Additional skills to suggest based on codebase context: ## Step 4 β€” Write the block -### Template +### Markdown targets (CLAUDE.md, AGENTS.md, GEMINI.md, copilot-instructions.md) + +Template: ```markdown Before any Go coding, review, debugging, troubleshooting, or setup task, load the `samber/cc-skills-golang@golang-how-to` skill first β€” it routes to whichever other Go skills the task needs. @@ -113,27 +118,25 @@ The following Go skills from `samber/cc-skills-golang` MUST always be applied wh Replace the skill list with the confirmed set from Step 3. Use the fully-qualified `samber/cc-skills-golang@` identifier for each skill. If Step 2 found the always-load directive already present elsewhere in the file, don't duplicate it β€” write only the `## Required Go skills` block. -### Insertion point +Insertion point: - If the file is empty: write the block at the top. - If the file has existing content: append after the last section, separated by a blank line. - If a `## Required Go skills` block already exists: replace only the bullet list inside it, preserving surrounding content. -### Edit the file +Edit the file directly, rather than shelling out to a script β€” that keeps the change reviewable as a normal diff. Perform an idempotency check after writing: re-read the file and verify the block appears exactly once. -Use the `Edit` tool (preferred over a bash script) to apply the change. For append operations: +### Cursor target (`.cursor/rules/*.mdc`) -```python -# Conceptually: read the file, find the insertion point, apply Edit -``` +`.cursor/rules` is a directory, not a file β€” each rule lives in its own `.mdc` file with YAML frontmatter (`description`, `globs`, `alwaysApply`). Do not try to append to it as if it were a single markdown document; the append-and-replace logic above does not apply here. -Perform an idempotency check after writing: re-read the file and verify the block appears exactly once. +Create `.cursor/rules/golang-skills.mdc` (create the `.cursor/rules/` directory first if it doesn't exist) using [cursor-go-skills.mdc](../assets/cursor-go-skills.mdc) as the starting template, with `alwaysApply: true` so it always loads β€” matching the unconditional behavior of the markdown targets' always-load directive. Replace the placeholder `## Required Go skills` list with the confirmed set from Step 3, same as the markdown targets. If the file already exists, replace only the bullet list, preserving its frontmatter and surrounding content. ## Step 5 β€” Confirm to the user After writing, summarize: -- Which file(s) were updated +- Which file(s) or rule(s) were updated - Whether the always-load directive for `golang-how-to` was added or was already present - Which skills were added to the always-load list - Approximate startup token cost (number of skills Γ— ~100 tokens per description) diff --git a/skills/golang-lint/SKILL.md b/skills/golang-lint/SKILL.md index f2153ef..6bbd8cf 100644 --- a/skills/golang-lint/SKILL.md +++ b/skills/golang-lint/SKILL.md @@ -3,7 +3,7 @@ name: golang-lint description: "Linting best practices and golangci-lint configuration for Golang projects β€” running linters, configuring .golangci.yml, suppressing warnings with nolint directives, interpreting lint output, and selecting linters. Use when configuring golangci-lint, asking about lint warnings or nolint suppressions, setting up code quality tooling, or choosing linters. Also use when the user mentions golangci-lint, go vet, staticcheck, or revive." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.3.0" @@ -19,11 +19,14 @@ metadata: formula: golangci-lint bins: [golangci-lint] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent +paths: + - "**/*.go" + - ".golangci.yml" --- **Persona:** You are a Go code quality engineer. You treat linting as a first-class part of the development workflow β€” not a post-hoc cleanup step. -**Orchestration mode:** Use `ultracode` when adopting linting on a legacy codebase β€” orchestrate the five sub-agents described in the "Parallelizing Legacy Codebase Cleanup" section (auto-fix, security linters, error handling, style/formatting, code quality) so independent linter categories are fixed concurrently. +**Orchestration mode:** Fan out the five sub-agents described in the "Parallelizing Legacy Codebase Cleanup" section (auto-fix, security linters, error handling, style/formatting, code quality) when adopting linting on a legacy codebase, so independent linter categories are fixed concurrently. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** @@ -141,7 +144,7 @@ The linter name in parentheses tells you which linter flagged it. Use this to: ## Parallelizing Legacy Codebase Cleanup -When adopting linting on a legacy codebase, use up to 5 parallel sub-agents (via the Agent tool) to fix independent linter categories simultaneously: +When adopting linting on a legacy codebase, use up to 5 parallel sub-agents to fix independent linter categories simultaneously: - Sub-agent 1: Run `golangci-lint run --fix ./...` for auto-fixable issues - Sub-agent 2: Fix security linter findings (bodyclose, sqlclosecheck, gosec) diff --git a/skills/golang-modernize/SKILL.md b/skills/golang-modernize/SKILL.md index b269c4b..0e3fd07 100644 --- a/skills/golang-modernize/SKILL.md +++ b/skills/golang-modernize/SKILL.md @@ -3,7 +3,7 @@ name: golang-modernize description: "Modernize Golang code to use recent language features, standard library improvements, and idiomatic patterns. Trigger proactively when writing or reviewing Go code and old-style patterns are detected, or when encountering a deprecation warning. Also use when the user explicitly asks for modernization, a Go version upgrade, or a CI/tooling refresh." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.5" @@ -15,18 +15,22 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch WebSearch AskUserQuestion EnterWorktree ExitWorktree +paths: + - "**/*.go" --- **Persona:** You are a Go modernization engineer. You keep codebases current with the latest Go idioms and standard library improvements β€” you prioritize safety and correctness fixes first, then readability, then gradual improvements. -**Orchestration mode:** Use `ultracode` for a full-codebase modernization scan β€” orchestrate the five sub-agents described in Full-scan mode (deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra) and consolidate results using the migration priority guide. +**Orchestration mode:** Fan out the five sub-agents described in Full-scan mode (deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra) for a full-codebase modernization scan, and consolidate results using the migration priority guide. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** - **Inline mode** (developer is actively coding): suggest only modernizations relevant to the current file or feature; mention other opportunities you noticed but do not touch unrelated files. -- **Full-scan mode** (explicit `/golang-modernize` invocation or CI): use up to 5 parallel sub-agents β€” Agent 1 scans deprecated packages and API replacements, Agent 2 scans language feature opportunities (range-over-int, min/max, any, iterators), Agent 3 scans standard library upgrades (slices, maps, cmp, slog), Agent 4 scans testing patterns (t.Context, b.Loop, synctest), Agent 5 scans tooling and infra (golangci-lint v2, govulncheck, PGO, CI pipeline) β€” then consolidate and prioritize by the migration priority guide. The scan itself is read-only; once consolidated, apply the resulting codebase-wide rewrite in an isolated worktree (`EnterWorktree`) so a sweeping multi-file modernization never touches the developer's main tree until reviewed. +- **Full-scan mode** (explicit `/golang-modernize` invocation or CI): use up to 5 parallel sub-agents β€” Agent 1 scans deprecated packages and API replacements, Agent 2 scans language feature opportunities (range-over-int, min/max, any, iterators), Agent 3 scans standard library upgrades (slices, maps, cmp, slog), Agent 4 scans testing patterns (t.Context, b.Loop, synctest), Agent 5 scans tooling and infra (golangci-lint v2, govulncheck, PGO, CI pipeline) β€” then consolidate and prioritize by the migration priority guide. The scan itself is read-only; once consolidated, apply the resulting codebase-wide rewrite in an isolated worktree so a sweeping multi-file modernization never touches the developer's main tree until reviewed. + +**Questions:** In Inline mode, this skill triggers contextually while the developer is working on something else β€” ask via the environment's question tool, once, whether to suggest the modernization opportunities noticed or skip for now. If the user skips, stop immediately and do not raise modernization again for the rest of the session. # Go Code Modernization Guide @@ -36,8 +40,6 @@ This skill helps you continuously modernize Go codebases by replacing outdated p You MUST NEVER conduct large refactoring if the developer is working on a different task. But TRY TO CONVINCE your human it would improve the code quality. -**Consent check (contextual triggers only):** When this skill triggers while the developer is working on something else (not an explicit `/golang-modernize` invocation), ask once: "I noticed some modernization opportunities β€” want me to suggest them, or skip for now?" If the user says skip (or any equivalent), stop immediately and do not apply or mention any modernization for the rest of the session. Do not ask again in the current session. - ## Workflow When invoked: @@ -50,7 +52,7 @@ When invoked: 6. **Suggest improvements contextually**: - If the developer is actively coding, **only suggest improvements related to the code they are currently working on**. Do not refactor unrelated files. Instead, mention opportunities you noticed and explain why the change would be beneficial β€” but let the developer decide. - If invoked explicitly via `/golang-modernize` or in CI, scan and suggest across the entire codebase. -7. **For large codebases**, parallelize the scan using up to 5 sub-agents (via the Agent tool), each targeting a different modernization category (e.g. deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra). Once scanning is done and changes are ready to apply, do so in an isolated worktree (`EnterWorktree`) β€” a codebase-wide modernization sweep touches many files at once, and isolation keeps the main tree safe to abandon or review before merging. +7. **For large codebases**, parallelize the scan using up to 5 sub-agents, each targeting a different modernization category (e.g. deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra). Once scanning is done and changes are ready to apply, do so in an isolated worktree β€” a codebase-wide modernization sweep touches many files at once, and isolation keeps the main tree safe to abandon or review before merging. 8. **Before suggesting a dependency update**, run `go mod tidy` and the test suite to verify compatibility. Ask the developer to review the dependency's changelog and release notes for breaking changes before proceeding. 9. **If the developer explicitly ignores a suggestion**, write a short memo to `.modernize` in the project root so it is not suggested again. Format: one line per ignored suggestion, with a short description. diff --git a/skills/golang-naming/SKILL.md b/skills/golang-naming/SKILL.md index af83f3f..a34ac24 100644 --- a/skills/golang-naming/SKILL.md +++ b/skills/golang-naming/SKILL.md @@ -3,7 +3,7 @@ name: golang-naming description: "Go (Golang) naming conventions β€” covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters/setters, 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/helpers 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." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.2" @@ -15,6 +15,8 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent +paths: + - "**/*.go" --- > **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-naming` skill takes precedence. diff --git a/skills/golang-observability/SKILL.md b/skills/golang-observability/SKILL.md index 6a97c80..32bac73 100644 --- a/skills/golang-observability/SKILL.md +++ b/skills/golang-observability/SKILL.md @@ -3,7 +3,7 @@ name: golang-observability description: "Golang everyday observability β€” the always-on signals in production. Covers structured logging with slog, Prometheus metrics, OpenTelemetry distributed tracing, continuous profiling with pprof/Pyroscope, server-side RUM event tracking, alerting, and Grafana dashboards. Apply when instrumenting Go services for production monitoring, setting up metrics or alerting, adding OpenTelemetry tracing, correlating logs with traces, migrating legacy loggers (zap/logrus/zerolog) to slog, adding observability to new features, or implementing GDPR/CCPA-compliant tracking with Customer Data Platforms (CDP). Not for temporary deep-dive performance investigation (β†’ See `samber/cc-skills-golang@golang-benchmark` and `samber/cc-skills-golang@golang-performance` skills)." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.2" @@ -15,11 +15,13 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch WebSearch AskUserQuestion +paths: + - "**/*.go" --- **Persona:** You are a Go observability engineer. You treat every unobserved production system as a liability β€” instrument proactively, correlate signals to diagnose, and never consider a feature done until it is observable. -**Orchestration mode:** Use `ultracode` for auditing observability coverage across a codebase β€” orchestrate the five signal-specific sub-agents described in Audit mode (metrics, logging, tracing, profiling, RUM) and merge their coverage findings. +**Orchestration mode:** Fan out the five signal-specific sub-agents described in Audit mode (metrics, logging, tracing, profiling, RUM) for auditing observability coverage across a codebase, and merge their coverage findings. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** diff --git a/skills/golang-performance/SKILL.md b/skills/golang-performance/SKILL.md index e859dd5..a44e840 100644 --- a/skills/golang-performance/SKILL.md +++ b/skills/golang-performance/SKILL.md @@ -3,7 +3,7 @@ name: golang-performance description: "Golang performance optimization patterns and methodology - if X bottleneck, then apply Y. Covers allocation reduction, CPU efficiency, memory layout, GC tuning, pooling, caching, and hot-path optimization. Use when profiling or benchmarks have identified a bottleneck and you need the right optimization pattern to fix it. Also use when performing performance code review to suggest improvements or benchmarks that could help identify quick performance gains. Not for measurement methodology (β†’ See `samber/cc-skills-golang@golang-benchmark` skill) or debugging workflow (β†’ See `samber/cc-skills-golang@golang-troubleshooting` skill)." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.4" @@ -19,13 +19,15 @@ metadata: package: golang.org/x/perf/cmd/benchstat@latest bins: [benchstat] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(benchstat:*) Bash(fieldalignment:*) Bash(staticcheck:*) Bash(curl:*) Bash(fgprof:*) Bash(perf:*) WebSearch AskUserQuestion EnterWorktree ExitWorktree +paths: + - "**/*.go" --- **Persona:** You are a Go performance engineer. You never optimize without profiling first β€” measure, hypothesize, change one thing, re-measure. -**Thinking mode:** Use `ultrathink` for performance optimization. Shallow analysis misidentifies bottlenecks β€” deep reasoning ensures the right optimization is applied to the right problem. +**Thinking mode:** Reason as thoroughly as possible for performance optimization β€” shallow analysis misidentifies bottlenecks and deep reasoning ensures the right optimization is applied to the right problem. On Claude Code, use `ultrathink` to trigger extended thinking explicitly. -**Orchestration mode:** Use `ultracode` for a broad architectural performance review β€” orchestrate the three sub-agents described in Review mode (architecture) (allocation and memory layout, I/O and concurrency, algorithmic complexity and caching). A single hot-path review stays sequential; fan-out only pays off at package/service scope. +**Orchestration mode:** Fan out the three sub-agents described in Review mode (architecture) (allocation and memory layout, I/O and concurrency, algorithmic complexity and caching) for a broad architectural performance review. A single hot-path review stays sequential; fan-out only pays off at package/service scope. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** diff --git a/skills/golang-pkg-go-dev/SKILL.md b/skills/golang-pkg-go-dev/SKILL.md index 9e522a8..d9021de 100644 --- a/skills/golang-pkg-go-dev/SKILL.md +++ b/skills/golang-pkg-go-dev/SKILL.md @@ -3,7 +3,7 @@ name: golang-pkg-go-dev description: "Golang package and module documentation and exploration via `godig`, a pkg.go.dev API client (CLI + MCP server) β€” package docs, API references, symbols, code examples, available versions, importers (who imports a package), licenses, and known vulnerabilities. Read-only, no auth. Use for looking up any Go/Golang library's documentation, API signatures, usage examples, which versions exist, whether a dependency has CVEs, or who imports a package β€” prefer this over Context7 for any Go package or module. Triggers on: how to use a Go library, Go API docs, import usage, code examples, pkg.go.dev. Not for upgrading dependencies (β†’ See `samber/cc-skills-golang@golang-dependency-management` skill) or choosing a library (β†’ See `samber/cc-skills-golang@golang-popular-libraries` skill). Not for local symbols, or for navigating an already-used dependency's resolved source, call sites, or generic instantiations β€” β†’ See `samber/cc-skills-golang@golang-gopls` skill for those." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents. Requires the godig CLI (go install github.com/samber/godig/cmd/godig@latest) or access to a godig MCP server, and internet access to reach the pkg.go.dev API. +compatibility: Designed for Claude Code, Codex or similar harness. Requires the godig CLI (go install github.com/samber/godig/cmd/godig@latest) or access to a godig MCP server, and internet access to reach the pkg.go.dev API. metadata: author: samber version: "1.3.0" @@ -118,7 +118,7 @@ Full `-o md` output for every command: [sample-output.md](references/sample-outp - `--filter` narrows list results server-side with a Go boolean expression β€” see [Filter syntax](#filter-syntax). - `--goos`/`--goarch` set the documentation/symbols build context (e.g. `linux`/`amd64`). - Prefer `symbol doc`/`symbol examples` over the package-wide `package doc`/`package examples` when you only need one symbol β€” far fewer tokens. -- **Parallelize independent lookups** β€” every command is a self-contained, read-only HTTP query, so calls never depend on each other. When a task needs docs, examples, versions, or vulns for **several** symbols, packages, or modules, issue all the calls at once (multiple `godig` invocations in a single turn) rather than one after another β€” wall-clock drops from sum-of-latencies to slowest-single-call. For a large fan-out (documenting many symbols, comparing many candidate libraries, auditing CVEs across a dependency set), dispatch parallel sub-agents (up to 5) via the Agent tool, each running its own `godig` calls and returning a compact summary, so the raw LARGE output never lands in the main context. +- **Parallelize independent lookups** β€” every command is a self-contained, read-only HTTP query, so calls never depend on each other. When a task needs docs, examples, versions, or vulns for **several** symbols, packages, or modules, issue all the calls at once (multiple `godig` invocations in a single turn) rather than one after another β€” wall-clock drops from sum-of-latencies to slowest-single-call. For a large fan-out (documenting many symbols, comparing many candidate libraries, auditing CVEs across a dependency set), dispatch up to 5 parallel sub-agents, each running its own `godig` calls and returning a compact summary, so the raw LARGE output never lands in the main context. - Listing commands auto-paginate (return all results); use `--limit` to cap. ### Filter syntax diff --git a/skills/golang-popular-libraries/SKILL.md b/skills/golang-popular-libraries/SKILL.md index 9a7555c..5d86b0f 100644 --- a/skills/golang-popular-libraries/SKILL.md +++ b/skills/golang-popular-libraries/SKILL.md @@ -3,7 +3,7 @@ name: golang-popular-libraries description: "Recommends production-ready Golang libraries and frameworks. Apply when the user explicitly asks for library suggestions, wants to compare alternatives, needs to choose a library for a specific task, or when a new dependency is being added to the project." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.9" diff --git a/skills/golang-project-layout/SKILL.md b/skills/golang-project-layout/SKILL.md index 2ae4aad..ef9ddef 100644 --- a/skills/golang-project-layout/SKILL.md +++ b/skills/golang-project-layout/SKILL.md @@ -3,7 +3,7 @@ name: golang-project-layout description: "Provides a guide for setting up Golang project layouts and workspaces. Use when starting a new Go project, organizing an existing codebase, setting up a monorepo with multiple packages, creating CLI tools with multiple main packages, deciding between cmd/internal/pkg directory conventions, or discussing package restructuring, package splits, or module splits." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.3.0" @@ -19,6 +19,8 @@ allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(g **Persona:** You are a Go project architect. You right-size structure to the problem β€” a script stays flat, a service gets layers only when justified by actual complexity. +**Questions:** Ask the user through the environment's question tool β€” never as plain-text prose. Architecture preference and DI approach are asked one at a time, in that order, waiting for each answer before proceeding β€” getting either wrong early cascades into every file created afterward. + # Go Project Layout ## Architecture Decision: Ask First @@ -101,8 +103,8 @@ Use `go.work` when developing multiple related modules in a monorepo. See [works When starting a new Go project: -- [ ] **Ask the developer** their preferred software architecture (clean, hexagonal, DDD, flat, etc.) -- [ ] **Ask the developer** their preferred DI approach β€” see `samber/cc-skills-golang@golang-dependency-injection` skill +- [ ] Confirm preferred software architecture (clean, hexagonal, DDD, flat, etc.) +- [ ] Confirm preferred DI approach β€” see `samber/cc-skills-golang@golang-dependency-injection` skill - [ ] Decide project type (CLI, library, service, monorepo) - [ ] Right-size the structure to the project scope - [ ] Choose module name (matches repo URL, lowercase, hyphens) @@ -114,8 +116,8 @@ When starting a new Go project: - [ ] For monorepos: Initialize `go work` and add modules - [ ] Run `gofmt -s -w .` to ensure formatting - [ ] Add `.gitignore` with `/vendor/` and binary patterns -- [ ] Write the always-load directive for `samber/cc-skills-golang@golang-how-to` into `CLAUDE.md`/`AGENTS.md` β€” no user confirmation needed, see that skill's Configure mode +- [ ] Write the always-load directive for `samber/cc-skills-golang@golang-how-to` into the project's agent-config file β€” no user confirmation needed, see that skill's Configure mode ## Related Skills -β†’ See `samber/cc-skills-golang@golang-cli` skill for CLI tool structure and Cobra/Viper patterns. β†’ See `samber/cc-skills-golang@golang-dependency-injection` skill for DI approach comparison and wiring. β†’ See `samber/cc-skills-golang@golang-lint` skill for golangci-lint configuration. β†’ See `samber/cc-skills-golang@golang-continuous-integration` skill for CI/CD pipeline setup. β†’ See `samber/cc-skills-golang@golang-design-patterns` skill for architectural patterns. β†’ See `samber/cc-skills-golang@golang-refactoring` skill for safely moving or splitting existing code into the layout above via type-alias gradual code repair and staged PRs, without a big-bang break. β†’ See `samber/cc-skills-golang@golang-how-to` skill's Configure mode for the always-load directive and optional `## Required Go skills` block written to `CLAUDE.md`/`AGENTS.md`. +β†’ See `samber/cc-skills-golang@golang-cli` skill for CLI tool structure and Cobra/Viper patterns. β†’ See `samber/cc-skills-golang@golang-dependency-injection` skill for DI approach comparison and wiring. β†’ See `samber/cc-skills-golang@golang-lint` skill for golangci-lint configuration. β†’ See `samber/cc-skills-golang@golang-continuous-integration` skill for CI/CD pipeline setup. β†’ See `samber/cc-skills-golang@golang-design-patterns` skill for architectural patterns. β†’ See `samber/cc-skills-golang@golang-refactoring` skill for safely moving or splitting existing code into the layout above via type-alias gradual code repair and staged PRs, without a big-bang break. β†’ See `samber/cc-skills-golang@golang-how-to` skill's Configure mode for the always-load directive and optional `## Required Go skills` block written to the project's agent-config file. diff --git a/skills/golang-refactoring/SKILL.md b/skills/golang-refactoring/SKILL.md index edcb528..32907f2 100644 --- a/skills/golang-refactoring/SKILL.md +++ b/skills/golang-refactoring/SKILL.md @@ -3,7 +3,7 @@ name: golang-refactoring description: "Golang refactoring β€” the safe, at-scale process for restructuring existing Go code: a coverage-adaptive safety net, tool-driven behavior-preserving transforms (gopls Rename/Inline/Extract, `gofmt -r`, `eg`, `gopatch`, `go/analysis` fixers), the Fowler catalog mapped to Go, breaking import cycles, moving types across packages, and a human-in-the-loop workflow of small stacked PRs on a refactoring branch. Apply when code is hard to maintain, a function/type has grown too large, a code smell needs fixing, adding a feature is blocked by the current structure, or the user asks to clean up, refactor, or improve Go code β€” also for renaming at scale, extracting functions/interfaces, moving code between packages, splitting packages, or planning a multi-step refactor. Target styles owned elsewhere β†’ See `samber/cc-skills-golang@golang-naming` (renames), `@golang-project-layout` (splits), `@golang-modernize` (idioms), `@golang-code-style` (control flow), `@golang-design-patterns` (patterns/DI)." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. Requires gopls and git. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. Requires gopls and git. metadata: author: samber version: "1.0.0" @@ -23,13 +23,15 @@ metadata: bins: [benchstat] skill-library-version: "0.20.0" allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Bash(gh:*) Bash(gopls:*) Bash(benchstat:*) LSP mcp__gopls__* Agent AskUserQuestion EnterWorktree ExitWorktree WebFetch WebSearch +paths: + - "**/*.go" --- > **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-refactoring` skill takes precedence. **Persona:** You are a Go refactoring engineer. You never change structure and behavior in the same step β€” you keep a green test net, prefer behavior-preserving tools over hand-edits, and land changes as small, reviewable PRs. -**Thinking mode:** Use `ultrathink` for the planning/ordering step. Mapping blast radius, sequencing PRs to avoid merge conflicts, and deciding where a refactor can safely go parallel all punish shallow reasoning β€” a wrong ordering call surfaces as a broken build or a conflict-riddled merge, not as an obviously wrong plan. +**Thinking mode:** Reason as thoroughly as possible for the planning/ordering step β€” mapping blast radius, sequencing PRs to avoid merge conflicts, and deciding where a refactor can safely go parallel all punish shallow reasoning, since a wrong ordering call surfaces as a broken build or a conflict-riddled merge, not as an obviously wrong plan. On Claude Code, use `ultrathink` to trigger extended thinking explicitly. **Orchestration mode:** Use `ultracode`/Workflows only for a **simple single-pass mechanical sweep** β€” one `gofmt -r`/`eg`/`modernize` fixer applied tree-wide, verified green, with no step depending on another. Do NOT use it for a multi-step refactor needing progressive human review between merges: Workflows run agent-to-agent with no human checkpoint between stages, which is exactly what a staged refactor requires between every merge. @@ -40,6 +42,8 @@ allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(g - **Simple-sweep mode** β€” a single mechanical, behavior-preserving transform applied tree-wide; may use `ultracode`. - **Review mode** β€” reviewing a refactoring PR: verify structural/behavioral separation and behavior preservation before approving. +**Questions:** Sign-off gates in this skill (Plan mode's initial approval, and every mid-refactor checkpoint below) are asked through the environment's question tool, never as plain-text prose the reader might skim past β€” a refactor is exactly the kind of workflow where an unnoticed "assumed yes" is expensive to undo. These are approval gates on irreversible decisions, not casual clarifying questions, so re-stating "ask via the question tool" at each one below is intentional, not boilerplate. + **Dependencies:** `gopls` (primary actuator) β€” `go install golang.org/x/tools/gopls@latest`. Optional: `golangci-lint`, `benchstat`, `deadcode`, `eg`, `gopatch`. Full gopls setup and MCP registration β†’ See `samber/cc-skills-golang@golang-gopls` skill β€” this is the only place this skill explains how to get gopls; every other reference to it in this skill assumes it's already installed. # Go Refactoring β€” Safe Change at Scale diff --git a/skills/golang-refactoring/references/workflow.md b/skills/golang-refactoring/references/workflow.md index c46d4aa..c351a63 100644 --- a/skills/golang-refactoring/references/workflow.md +++ b/skills/golang-refactoring/references/workflow.md @@ -75,8 +75,8 @@ If any answer is yes, the two rows are sequential. Only when every answer is no The shape: 1. Create a long-lived `refactor/` branch off `main`, and seed it with `// REFACTOR(step N): ...` markers for the plan itself β€” see Step 5. -2. For each atomic change in the inventory, in the order established in Step 2, **dispatch it to a sub-agent via the `Agent` tool** rather than executing it directly in the orchestrating session. The sub-agent, scoped to a fresh worktree, does the work: - - Enter a fresh worktree with `EnterWorktree`. +2. For each atomic change in the inventory, in the order established in Step 2, **dispatch it to a sub-agent** rather than executing it directly in the orchestrating session. The sub-agent, scoped to a fresh worktree, does the work: + - Enter a fresh, isolated worktree. - Create a branch for that one change, based on the current tip of `refactor/`. - Apply the single change β€” and nothing else. If the inventory row is turning out larger than **~100–500 lines**, that's a signal it's actually two rows: split it before it grows into a diff nobody can review in one sitting. - Verify: `go build ./... && go vet ./... && go test ./...` (add `-race` or `benchstat`-backed `-bench` per the Risk Stratification table in `SKILL.md`). @@ -146,13 +146,7 @@ grep -rn "REFACTOR(" . ## 7. Human Checkpoints -Pause and get explicit sign-off before proceeding past any of the following, even mid-refactor after the planning gate has already been cleared once: - -- Any cross-package move or package split. -- Any exported-API change or deprecation. -- Any deletion of code, especially anything that might still have external callers you haven't found. -- Introducing a new major version (`/vN`). -- Touching code that has no tests β€” get sign-off on the characterization-test baseline (see [safety-net.md](safety-net.md)) before refactoring it, not after. +The same triggers as `SKILL.md`'s "Pause for human sign-off before" list apply here β€” cross-package moves, exported-API changes, deletions, new major versions, untested code β€” and they're not one-time: get sign-off on each one again if it comes up mid-refactor, even after the planning gate has already been cleared once. For untested code specifically, that means sign-off on the characterization-test baseline (see [safety-net.md](safety-net.md)) before refactoring it, not after. Structural-only PRs are reversible and low-risk by construction (Beck's separation is the whole reason they're safe to move fast on) and can be fast-reviewed. Behavioral PRs β€” anything that changes what the code does, not just how it's shaped β€” get full scrutiny every time, regardless of how small the diff looks. diff --git a/skills/golang-safety/SKILL.md b/skills/golang-safety/SKILL.md index 29dc8c9..ffe4c7d 100644 --- a/skills/golang-safety/SKILL.md +++ b/skills/golang-safety/SKILL.md @@ -3,7 +3,7 @@ name: golang-safety description: "Defensive Golang coding to prevent panics, silent data corruption, and subtle runtime bugs. Use when encountering nil panics, append aliasing, map concurrent access, float comparison pitfalls, or zero-value design questions. Also use when reviewing code for nil-safety, numeric conversion overflow, resource lifecycle issues (defer in loops), or defensive copying of slices and maps." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.1" @@ -15,6 +15,8 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent +paths: + - "**/*.go" --- **Persona:** You are a defensive Go engineer. You treat every untested assumption about nil, capacity, and numeric range as a latent crash waiting to happen. diff --git a/skills/golang-samber-do/SKILL.md b/skills/golang-samber-do/SKILL.md index 101f3e6..a8bbe3a 100644 --- a/skills/golang-samber-do/SKILL.md +++ b/skills/golang-samber-do/SKILL.md @@ -3,7 +3,7 @@ name: golang-samber-do description: "Dependency injection in Golang using samber/do β€” service containers, lifecycle management, scopes, health checks, graceful shutdown, and module organization. Apply when using or adopting samber/do, when the codebase imports github.com/samber/do or github.com/samber/do/v2, or when refactoring manual constructor injection into a DI container." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.5" @@ -16,6 +16,8 @@ metadata: install: [] skill-library-version: "2.0.0" allowed-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__* +paths: + - "**/*.go" --- **Persona:** You are a Go architect setting up dependency injection. You keep the container at the composition root, depend on interfaces not concrete types, and treat provider errors as first-class failures. diff --git a/skills/golang-samber-hot/SKILL.md b/skills/golang-samber-hot/SKILL.md index 4da42a2..ba7d451 100644 --- a/skills/golang-samber-hot/SKILL.md +++ b/skills/golang-samber-hot/SKILL.md @@ -3,7 +3,7 @@ name: golang-samber-hot description: "In-memory caching in Golang using samber/hot β€” eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports github.com/samber/hot, or when the project repeatedly loads the same medium-to-low cardinality resources at high frequency and needs to reduce latency or backend pressure." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.0.6" @@ -16,6 +16,8 @@ metadata: install: [] skill-library-version: "0.13.0" allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go engineer who treats caching as a system design decision. You choose eviction algorithms based on measured access patterns, size caches from working-set data, and always plan for expiration, loader failures, and monitoring. diff --git a/skills/golang-samber-lo/SKILL.md b/skills/golang-samber-lo/SKILL.md index 4d33c7f..3771edf 100644 --- a/skills/golang-samber-lo/SKILL.md +++ b/skills/golang-samber-lo/SKILL.md @@ -3,7 +3,7 @@ name: golang-samber-lo description: "Functional programming helpers for Golang using samber/lo β€” 500+ type-safe generic functions for slices, maps, channels, strings, math, tuples, and concurrency (Map, Filter, Reduce, GroupBy, Chunk, Flatten, Find, Uniq, etc.). Core immutable package (lo), concurrent variants (lo/parallel aka lop), in-place mutations (lo/mutable aka lom), lazy iterators (lo/it aka loi for Go 1.23+), and experimental SIMD (lo/exp/simd). Apply when using or adopting samber/lo, when the codebase imports github.com/samber/lo, or when implementing functional-style data transformations in Go. Not for streaming pipelines (β†’ See `samber/cc-skills-golang@golang-samber-ro` skill)." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.3" @@ -16,6 +16,8 @@ metadata: install: [] skill-library-version: "1.53.0" allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go engineer who prefers declarative collection transforms over manual loops. You reach for `lo` to eliminate boilerplate, but you know when the stdlib is enough and when to upgrade to `lop`, `lom`, or `loi`. diff --git a/skills/golang-samber-mo/SKILL.md b/skills/golang-samber-mo/SKILL.md index e93ec96..571fb1c 100644 --- a/skills/golang-samber-mo/SKILL.md +++ b/skills/golang-samber-mo/SKILL.md @@ -3,7 +3,7 @@ name: golang-samber-mo description: "Monadic types for Golang using samber/mo β€” Option, Result, Either, Future, IO, Task, and State types for type-safe nullable values, error handling, and functional composition with pipeline sub-packages. Apply when using or adopting samber/mo, when the codebase imports `github.com/samber/mo`, or when considering functional programming patterns as a safety design for Golang." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.0.7" @@ -16,11 +16,13 @@ metadata: install: [] skill-library-version: "1.16.0" allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go engineer bringing functional programming safety to Go. You use monads to make impossible states unrepresentable β€” nil checks become type constraints, error handling becomes composable pipelines. -**Thinking mode:** Use `ultrathink` when designing multi-step Option/Result/Either pipelines. Wrong type choice creates unnecessary wrapping/unwrapping that defeats the purpose of monads. +**Thinking mode:** Reason as thoroughly as possible when designing multi-step Option/Result/Either pipelines β€” wrong type choice creates unnecessary wrapping/unwrapping that defeats the purpose of monads. On Claude Code, use `ultrathink` to trigger extended thinking explicitly. # samber/mo β€” Monads and Functional Abstractions for Go diff --git a/skills/golang-samber-oops/SKILL.md b/skills/golang-samber-oops/SKILL.md index de62547..b0b05a3 100644 --- a/skills/golang-samber-oops/SKILL.md +++ b/skills/golang-samber-oops/SKILL.md @@ -3,7 +3,7 @@ name: golang-samber-oops description: "Structured error handling in Golang with samber/oops β€” error builders, stack traces, error codes, error context, error wrapping, error attributes, user-facing vs developer messages, panic recovery, and logger integration. Apply when using or adopting samber/oops, or when the codebase already imports github.com/samber/oops." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.6" @@ -16,6 +16,8 @@ metadata: install: [] skill-library-version: "1.21.0" allowed-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__* +paths: + - "**/*.go" --- **Persona:** You are a Go engineer who treats errors as structured data. Every error carries enough context β€” domain, attributes, trace β€” for an on-call engineer to diagnose the problem without asking the developer. diff --git a/skills/golang-samber-ro/SKILL.md b/skills/golang-samber-ro/SKILL.md index 287b83c..68105d7 100644 --- a/skills/golang-samber-ro/SKILL.md +++ b/skills/golang-samber-ro/SKILL.md @@ -3,7 +3,7 @@ name: golang-samber-ro description: "Reactive streams and event-driven programming in Golang using samber/ro β€” ReactiveX implementation with 150+ type-safe operators, cold/hot observables, 5 subject types (Publish, Behavior, Replay, Async, Unicast), declarative pipelines via Pipe, 40+ plugins (HTTP, cron, fsnotify, JSON, logging), automatic backpressure, error propagation, and Go context integration. Apply when using or adopting samber/ro, when the codebase imports github.com/samber/ro, or when building asynchronous event-driven pipelines, real-time data processing, streams, or reactive architectures in Go. Not for finite slice transforms (β†’ See `samber/cc-skills-golang@golang-samber-lo` skill)." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.3" @@ -16,11 +16,13 @@ metadata: install: [] skill-library-version: "0.3.0" allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go engineer who reaches for reactive streams when data flows asynchronously or infinitely. You use samber/ro to build declarative pipelines instead of manual goroutine/channel wiring, but you know when a simple slice + samber/lo is enough. -**Thinking mode:** Use `ultrathink` when designing advanced reactive pipelines or choosing between cold/hot observables, subjects, and combining operators. Wrong architecture leads to resource leaks or missed events. +**Thinking mode:** Reason as thoroughly as possible when designing advanced reactive pipelines or choosing between cold/hot observables, subjects, and combining operators β€” wrong architecture leads to resource leaks or missed events. On Claude Code, use `ultrathink` to trigger extended thinking explicitly. # samber/ro β€” Reactive Streams for Go diff --git a/skills/golang-samber-slog/SKILL.md b/skills/golang-samber-slog/SKILL.md index eb68620..07eaed2 100644 --- a/skills/golang-samber-slog/SKILL.md +++ b/skills/golang-samber-slog/SKILL.md @@ -3,7 +3,7 @@ name: golang-samber-slog description: "Structured logging extensions for Golang using samber/slog-**** packages β€” multi-handler pipelines (slog-multi), log sampling (slog-sampling), attribute formatting (slog-formatter), HTTP middleware (slog-fiber, slog-gin, slog-chi, slog-echo), and backend routing (slog-datadog, slog-sentry, slog-loki, slog-syslog, slog-logstash, slog-graylog...). Apply when using or adopting slog, or when the codebase already imports any github.com/samber/slog-* package." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.0.7" @@ -48,6 +48,8 @@ metadata: slog-rollbar: "2.7.4" slog-mock: "0.1.0" allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go logging architect. You design log pipelines where every record flows through the right handlers β€” sampling drops noise early, formatters strip PII before records leave the process, and routers send errors to Sentry while info goes to Loki. diff --git a/skills/golang-security/SKILL.md b/skills/golang-security/SKILL.md index fc5cc66..5cfbfbf 100644 --- a/skills/golang-security/SKILL.md +++ b/skills/golang-security/SKILL.md @@ -3,7 +3,7 @@ name: golang-security description: "Security best practices and vulnerability prevention for Golang. Covers injection (SQL, command, XSS), cryptography, filesystem safety, network security, cookies, secrets management, memory safety, and logging. Apply when writing, reviewing, or auditing Go code for security, or when working on any risky code involving crypto, I/O, secrets management, user input handling, or authentication. Includes configuration of security tools." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.10" @@ -19,18 +19,20 @@ metadata: package: golang.org/x/vuln/cmd/govulncheck@latest bins: [govulncheck] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(govulncheck:*) WebSearch AskUserQuestion EnterWorktree ExitWorktree +paths: + - "**/*.go" --- **Persona:** You are a senior Go security engineer. You apply security thinking both when auditing existing code and when writing new code β€” threats are easier to prevent than to fix. -**Thinking mode:** Use `ultrathink` for security audits and vulnerability analysis. Security bugs hide in subtle interactions β€” deep reasoning catches what surface-level review misses. +**Thinking mode:** Reason as thoroughly as possible for security audits and vulnerability analysis β€” security bugs hide in subtle interactions and deep reasoning catches what surface-level review misses. On Claude Code, use `ultrathink` to trigger extended thinking explicitly. -**Orchestration mode:** Use `ultracode` for a full-codebase security audit β€” orchestrate the five vulnerability-domain sub-agents described in Audit mode as a fan-out-then-synthesize workflow. Parallelism covers more attack surface per pass; the synthesis step deduplicates findings and ranks them by severity. +**Orchestration mode:** Fan out the five vulnerability-domain sub-agents described in Audit mode as a fan-out-then-synthesize workflow for a full-codebase security audit. Parallelism covers more attack surface per pass; the synthesis step deduplicates findings and ranks them by severity. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** - **Review mode** β€” reviewing a PR for security issues. Start from the changed files, then trace call sites and data flows into adjacent code β€” a vulnerability may live outside the diff but be triggered by it. Sequential. -- **Audit mode** β€” full codebase security scan. Launch up to 5 parallel sub-agents (via the Agent tool), each covering an independent vulnerability domain: (1) injection patterns, (2) cryptography and secrets, (3) web security and headers, (4) authentication and authorization, (5) concurrency safety and dependency vulnerabilities. Aggregate findings, score with DREAD, and report by severity. A large audit produces many independent findings β€” apply each fix/improvement in its own worktree (`EnterWorktree`), so one fix = one worktree = one focused, reviewable, independently revertible PR, instead of one large mixed-concern change. +- **Audit mode** β€” full codebase security scan. Launch up to 5 parallel sub-agents, each covering an independent vulnerability domain: (1) injection patterns, (2) cryptography and secrets, (3) web security and headers, (4) authentication and authorization, (5) concurrency safety and dependency vulnerabilities. Aggregate findings, score with DREAD, and report by severity. A large audit produces many independent findings β€” apply each fix/improvement in its own isolated worktree, so one fix = one worktree = one focused, reviewable, independently revertible PR, instead of one large mixed-concern change. - **Coding mode** β€” use when writing new code or fixing a reported vulnerability. Follow the skill's sequential guidance. Optionally launch a background agent to grep for common vulnerability patterns in newly written code while the main agent continues implementing the feature. **Dependencies:** diff --git a/skills/golang-spf13-cobra/SKILL.md b/skills/golang-spf13-cobra/SKILL.md index 3df0c10..6a5c02c 100644 --- a/skills/golang-spf13-cobra/SKILL.md +++ b/skills/golang-spf13-cobra/SKILL.md @@ -3,7 +3,7 @@ name: golang-spf13-cobra description: "Golang CLI command tree library using spf13/cobra β€” cobra.Command, RunE vs Run, PersistentPreRunE hook chain, Args validators (NoArgs, ExactArgs, MatchAll, custom), persistent vs local flags, command groups, ValidArgsFunction, RegisterFlagCompletionFunc, ShellCompDirective, usage/help template customization, man-page and markdown doc generation, and testing with SetArgs/SetOut/SetErr. Apply when using or adopting spf13/cobra, or when the codebase imports `github.com/spf13/cobra`. For configuration layering alongside cobra, see the `samber/cc-skills-golang@golang-spf13-viper` skill. For general CLI architecture (project layout, exit codes, signal handling, I/O patterns), see `samber/cc-skills-golang@golang-cli`." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.0.4" @@ -16,6 +16,8 @@ metadata: install: [] skill-library-version: "1.10.2" allowed-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__* +paths: + - "**/*.go" --- **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. diff --git a/skills/golang-spf13-viper/SKILL.md b/skills/golang-spf13-viper/SKILL.md index 8fa37ff..aacc1e2 100644 --- a/skills/golang-spf13-viper/SKILL.md +++ b/skills/golang-spf13-viper/SKILL.md @@ -3,7 +3,7 @@ name: golang-spf13-viper description: "Golang configuration library using spf13/viper β€” layered precedence (flag > env > file > KV > default), BindPFlag/BindPFlags, SetEnvPrefix + SetEnvKeyReplacer + AutomaticEnv, ReadInConfig + ConfigFileNotFoundError, Unmarshal + mapstructure struct tags, Sub for sub-trees, WatchConfig + OnConfigChange for hot reload, viper.New() for test isolation, and remote KV integration. Apply when using or adopting spf13/viper, or when the codebase imports `github.com/spf13/viper`. For CLI command structure alongside viper, see the `samber/cc-skills-golang@golang-spf13-cobra` skill. For general CLI architecture, see `samber/cc-skills-golang@golang-cli`." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.0.4" @@ -16,6 +16,8 @@ metadata: install: [] skill-library-version: "1.21.0" allowed-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__* +paths: + - "**/*.go" --- **Persona:** You are a Go engineer who treats configuration as a layered system. Flag beats env beats file beats default β€” and you bind every key so all four layers stay reachable through one API. diff --git a/skills/golang-stay-updated/SKILL.md b/skills/golang-stay-updated/SKILL.md index 255f4e3..8439ba8 100644 --- a/skills/golang-stay-updated/SKILL.md +++ b/skills/golang-stay-updated/SKILL.md @@ -3,7 +3,7 @@ name: golang-stay-updated description: "Provides resources to stay updated with Golang news, communities and people to follow. Use when seeking Go learning resources, discovering new libraries, finding community channels, or keeping up with Go language changes and releases." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.4" diff --git a/skills/golang-stretchr-testify/SKILL.md b/skills/golang-stretchr-testify/SKILL.md index daade12..f2d48ca 100644 --- a/skills/golang-stretchr-testify/SKILL.md +++ b/skills/golang-stretchr-testify/SKILL.md @@ -3,7 +3,7 @@ name: golang-stretchr-testify description: "Comprehensive guide to stretchr/testify for Golang testing. Covers assert, require, mock, and suite packages in depth. Use when writing tests with testify, creating mocks, setting up test suites, or choosing between assert and require. Covers testify assertions, mock expectations, argument matchers, call verification, suite lifecycle, and advanced patterns like Eventually, JSONEq, and custom matchers. Apply when the codebase imports github.com/stretchr/testify." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.3" @@ -20,6 +20,8 @@ metadata: bins: [gotests] skill-library-version: "1.11.1" allowed-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(gotests:*) AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go engineer who treats tests as executable specifications. You write tests to constrain behavior and make failures self-explanatory β€” not to hit coverage targets. diff --git a/skills/golang-structs-interfaces/SKILL.md b/skills/golang-structs-interfaces/SKILL.md index 3c95f10..f430cc0 100644 --- a/skills/golang-structs-interfaces/SKILL.md +++ b/skills/golang-structs-interfaces/SKILL.md @@ -3,7 +3,7 @@ name: golang-structs-interfaces description: '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/YAML/DB 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.' user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.3" @@ -15,6 +15,8 @@ metadata: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion +paths: + - "**/*.go" --- **Persona:** You are a Go type system designer. You favor small, composable interfaces and concrete return types β€” you design for testability and clarity, not for abstraction's sake. diff --git a/skills/golang-swagger/SKILL.md b/skills/golang-swagger/SKILL.md index e1e69a4..9b545e7 100644 --- a/skills/golang-swagger/SKILL.md +++ b/skills/golang-swagger/SKILL.md @@ -3,7 +3,7 @@ name: golang-swagger description: "Golang OpenAPI/Swagger documentation with swaggo/swag β€” annotation comments (@Summary, @Param, @Success, @Router, @Security), swag init code generation, framework integrations (gin, echo, fiber, chi, net/http), security definitions (Bearer/JWT, OAuth2, API key), and struct tags (swaggertype, enums, example, swaggerignore). Apply when adding or maintaining Swagger/OpenAPI docs in a Go project, or when the codebase imports github.com/swaggo/swag, github.com/swaggo/gin-swagger, github.com/swaggo/echo-swagger, github.com/swaggo/http-swagger, or github.com/swaggo/files." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents. Requires go and swag CLI. +compatibility: Designed for Claude Code, Codex or similar harness. Requires go and swag CLI. metadata: author: samber version: "1.0.4" @@ -20,6 +20,8 @@ metadata: bins: [swag] skill-library-version: "2.0.0-rc5" allowed-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(swag:*) AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* +paths: + - "**/*.go" --- **Persona:** You are a Go API documentation engineer. You treat docs as a contract β€” accurate, complete annotations prevent integration bugs and make the Swagger UI the source of truth for API consumers. diff --git a/skills/golang-testing/SKILL.md b/skills/golang-testing/SKILL.md index 0d1ed13..4a47869 100644 --- a/skills/golang-testing/SKILL.md +++ b/skills/golang-testing/SKILL.md @@ -3,7 +3,7 @@ name: golang-testing description: "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, or debugging flaky/slow tests. For testify-specific APIs see `samber/cc-skills-golang@golang-stretchr-testify`; for measurement methodology see `samber/cc-skills-golang@golang-benchmark`." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.5" @@ -19,13 +19,15 @@ metadata: package: github.com/cweill/gotests/gotests@latest bins: [gotests] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent Bash(gotests:*) AskUserQuestion +paths: + - "**/*.go" --- **Persona:** You are a Go engineer who treats tests as executable specifications. You write tests to constrain behavior, not to hit coverage targets. -**Thinking mode:** Use `ultrathink` for test strategy design and failure analysis. Shallow reasoning misses edge cases and produces brittle tests that pass today but break tomorrow. +**Thinking mode:** Reason as thoroughly as possible for test strategy design and failure analysis β€” shallow reasoning misses edge cases and produces brittle tests that pass today but break tomorrow. On Claude Code, use `ultrathink` to trigger extended thinking explicitly. -**Orchestration mode:** Use `ultracode` for auditing a large test suite β€” orchestrate the three sub-agents described in Audit mode (unit quality and coverage gaps, integration isolation, goroutine/race issues) and merge their findings into one gap report. +**Orchestration mode:** Fan out the three sub-agents described in Audit mode (unit quality and coverage gaps, integration isolation, goroutine/race issues) for auditing a large test suite, and merge their findings into one gap report. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** @@ -142,7 +144,7 @@ func TestCalculatePrice(t *testing.T) { ## Common Pitfall: Assert Scope Leaking into Subtests -Never create a testify `assert`/`require` instance in the parent test function and reuse it inside `t.Run` closures. `assert.New(t)` captures the exact `*testing.T` it was built with, so if that `t` belongs to the parent, every failure raised inside the subtest gets attributed to the *parent* test in `go test` output β€” the failing subtest itself still reports `--- PASS`, silently hiding which case broke. This happens whether or not the subtest calls `t.Parallel()`. +Never create a testify `assert`/`require` instance in the parent test function and reuse it inside `t.Run` closures. `assert.New(t)` captures the exact `*testing.T` it was built with, so if that `t` belongs to the parent, every failure raised inside the subtest gets attributed to the _parent_ test in `go test` output β€” the failing subtest itself still reports `--- PASS`, silently hiding which case broke. This happens whether or not the subtest calls `t.Parallel()`. ```go // WRONG -- `is` is bound to the parent's t diff --git a/skills/golang-troubleshooting/SKILL.md b/skills/golang-troubleshooting/SKILL.md index f8f83af..83180ee 100644 --- a/skills/golang-troubleshooting/SKILL.md +++ b/skills/golang-troubleshooting/SKILL.md @@ -3,7 +3,7 @@ name: golang-troubleshooting description: "Troubleshoot Golang programs systematically - find and fix the root cause. Use when encountering bugs, crashes, deadlocks, or unexpected behavior in Go code. Covers debugging methodology, common Go pitfalls, test-driven debugging, pprof setup and capture, Delve debugger, race detection, GODEBUG tracing, and production debugging. Start here for any 'something is wrong' situation. Not for interpreting profiles or benchmarking (β†’ See `samber/cc-skills-golang@golang-benchmark` skill) or applying optimization patterns (β†’ See `samber/cc-skills-golang@golang-performance` skill)." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.2.3" @@ -19,13 +19,15 @@ metadata: package: github.com/go-delve/delve/cmd/dlv@latest bins: [dlv] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Bash(dlv:*) Agent WebFetch WebSearch AskUserQuestion +paths: + - "**/*.go" --- **Persona:** You are a Go systems debugger. You follow evidence, not intuition β€” instrument, reproduce, and trace root causes systematically. -**Thinking mode:** Use `ultrathink` for debugging and root cause analysis. Rushed reasoning leads to symptom fixes β€” deep thinking finds the actual root cause. +**Thinking mode:** Reason as thoroughly as possible for debugging and root cause analysis β€” rushed reasoning leads to symptom fixes, deep thinking finds the actual root cause. On Claude Code, use `ultrathink` to trigger extended thinking explicitly. -**Orchestration mode:** Use `ultracode` for a codebase-wide bug hunt β€” orchestrate the five bug-category sub-agents described in Codebase bug hunt mode. A single-issue debug session should stay sequential; orchestration only pays off when scanning broadly for unknown bugs. +**Orchestration mode:** Fan out the five bug-category sub-agents described in Codebase bug hunt mode for a codebase-wide bug hunt. A single-issue debug session should stay sequential; orchestration only pays off when scanning broadly for unknown bugs. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly. **Modes:** diff --git a/skills/golang-uber-dig/SKILL.md b/skills/golang-uber-dig/SKILL.md index 9ef809b..84c4af5 100644 --- a/skills/golang-uber-dig/SKILL.md +++ b/skills/golang-uber-dig/SKILL.md @@ -3,7 +3,7 @@ name: golang-uber-dig description: "Implements dependency injection in Golang using uber-go/dig β€” reflection-based container, Provide/Invoke, dig.In/dig.Out parameter and result objects, named values, value groups, optional dependencies, scopes, and Decorate. Apply when using or adopting uber-go/dig, when the codebase imports `go.uber.org/dig`, or when wiring an application graph at startup. For higher-level lifecycle and modules, see `samber/cc-skills-golang@golang-uber-fx` skill." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.3" @@ -16,6 +16,8 @@ metadata: install: [] skill-library-version: "1.19.0" allowed-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__* +paths: + - "**/*.go" --- **Persona:** You are a Go architect wiring an application graph with dig. You keep the container at the composition root, depend on interfaces not concrete types, and treat constructor errors as first-class failures. diff --git a/skills/golang-uber-fx/SKILL.md b/skills/golang-uber-fx/SKILL.md index 44c914b..ee7b3ed 100644 --- a/skills/golang-uber-fx/SKILL.md +++ b/skills/golang-uber-fx/SKILL.md @@ -3,7 +3,7 @@ name: golang-uber-fx description: "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 services with fx.New. For raw DI without lifecycle, see `samber/cc-skills-golang@golang-uber-dig` skill." user-invocable: true license: MIT -compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. +compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.1.3" @@ -16,6 +16,8 @@ metadata: install: [] skill-library-version: "1.24.0" allowed-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__* +paths: + - "**/*.go" --- **Persona:** You are a Go architect building a long-running service with fx. You wire the graph at the composition root, push lifecycle into hooks instead of `init()`, and treat modules as the unit of reuse.