go-concurrency-safety

go-concurrency-safety is a skill for Claude Code, Codex from PlamenTSV/plamen. It costs 40 tokens per session (1,800 once invoked), scanned A, original, MIT.

A Go code review supplement focused on concurrency hazards, such as unpredictable map order, leaked goroutines, unsafe mutex ordering, and missing cancellation or panic handling.

In plain words
What is it for?
Use it while reviewing Go node or client code, especially when map iteration affects hashes or state, or when goroutines, locks, contexts, and panic boundaries are involved.
Why use it?
It catches production bugs that can arise when concurrent code behaves differently across runs or fails to stop and recover safely.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it while reviewing Go node or client code, especially when map iteration affects hashes or state, or when goroutines, locks, contexts, and panic boundaries are involved.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plamentsv/plamen/go-concurrency-safety
Install

Getting it into your agent

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

Any agent
npx skills add PlamenTSV/plamen --skill go-concurrency-safety
Clone the repo
git clone --depth 1 https://github.com/PlamenTSV/plamen

Made for: Claude Code, Codex.

Wrote this? Show the measurements

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

agentmods badge for go-concurrency-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/plamentsv/plamen/go-concurrency-safety/github.svg)](https://agentmods.dev/skills/plamentsv/plamen/go-concurrency-safety)
Your own site
<a href="https://agentmods.dev/skills/plamentsv/plamen/go-concurrency-safety"><img src="https://agentmods.dev/badge/skills/plamentsv/plamen/go-concurrency-safety/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for go-concurrency-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/plamentsv/plamen/go-concurrency-safety"><img src="https://agentmods.dev/badge/skills/plamentsv/plamen/go-concurrency-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,800 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

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

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.01800
Opus 5 $0.00020 $0.00900
Sonnet 5 $0.00008 $0.00360
Haiku 4.5 $0.00004 $0.00180

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

Security

Grade A, and why

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

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

Nothing flagged

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

agents/skills/injectable/l1/go-concurrency-safety/SKILL.md · 145 lines

How it starts

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

Injectable Skill: Go Concurrency Safety

L1 trigger: L1_PATTERN=true AND target language = Go Inject Into: Every L1 depth agent working on Go code, in addition to the main skill Finding prefix: [GO-N] Status: v0.1 draft, Round 4 exemplars pending

When This Skill Activates

Supplement to the main L1 skills when the target is written in Go. It codifies the Go-specific traps that turn otherwise-correct logic into production bugs. These are drawn from the Cosmos-SDK, Geth, Erigon, and CometBFT bug histories.

1. Map Iteration Non-Determinism

Go maps iterate in unspecified order. Production bug class: any consensus computation that ranges over a map[K]V and uses the order in its output will produce different results on different nodes.

Detection:

  • Ast-grep for $_, $_ := range $MAP where $MAP is declared as map[...]...
  • For each hit in a consensus-critical path, check if the iteration result affects any stored state, signed message, or hash input

Fix pattern:

keys := make([]string, 0, len(m))
for k := range m {
    keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
    v := m[k]
    // use (k, v)
}

Alternative: use btree or sort.SliceStable on a converted slice.

Tag: [GO-MAP-ITER:{loc}:{consumer}]

2. Goroutine Leaks

Goroutines that are started but never terminated. Over hours/days, a leak accumulates and eventually OOMs the node.

Common patterns:

  • Goroutine blocked on <-ch where the sender path can return without sending
  • Goroutine blocked on http.Get / network call without context timeout
  • Goroutine in a for loop without a cancellation check
  • Goroutine spawned inside a handler that outlives the handler's parent context

Detection:

  • Ast-grep go $FUNC(...) / go func() { ... }()
  • For each, trace the function body: is there a termination condition? Is it guaranteed to fire?
  • Check every select inside: does it have a case <-ctx.Done()?

Tag: [GO-GOROUTINE-LEAK:{spawn-loc}:{blocked-on}]

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

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

  1. 11d ago First seen · 145 lines · 40 tokens per session scan A 86a325d6516e

Subscribe to this mod's changes

go-concurrency-safety is a skill published in the GitHub repository PlamenTSV/plamen (295 stars, last pushed 3d ago), licensed MIT. It adds 40 tokens to every session and 1,800 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.