ring:detecting-goroutine-leaks

ring:detecting-goroutine-leaks is a skill for Cursor from LerianStudio/ring. It costs 109 tokens per session (1,145 once invoked), scanned A, original, Apache-2.0.

A Go-focused workflow for finding goroutine leaks, where background tasks keep running after they should have stopped.

In plain words
What is it for?
Use it after implementing or reviewing Go code that starts goroutines, especially when a memory or shutdown leak is suspected.
Why use it?
It checks concurrent code and tests so leaked goroutines can be found and fixed before they waste resources or cause unreliable behavior.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin.

Part of the ring-dev-team plugin — 35 skills, 24 agents shipped together

Good fit Use it after implementing or reviewing Go code that starts goroutines, especially when a memory or shutdown leak is suspected.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lerianstudio/ring/detecting-goroutine-leaks
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 LerianStudio/ring --skill detecting-goroutine-leaks
Clone the repo
git clone --depth 1 https://github.com/LerianStudio/ring

Made for: Cursor.

Or install ring-dev-team, the plugin that ships this one along with the rest of its 35 skills, 24 agents.

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 ring:detecting-goroutine-leaks

README.md
[![agentmods](https://agentmods.dev/badge/skills/lerianstudio/ring/detecting-goroutine-leaks/github.svg)](https://agentmods.dev/skills/lerianstudio/ring/detecting-goroutine-leaks)
Your own site
<a href="https://agentmods.dev/skills/lerianstudio/ring/detecting-goroutine-leaks"><img src="https://agentmods.dev/badge/skills/lerianstudio/ring/detecting-goroutine-leaks/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 ring:detecting-goroutine-leaks

Your own site · 80×15
<a href="https://agentmods.dev/skills/lerianstudio/ring/detecting-goroutine-leaks"><img src="https://agentmods.dev/badge/skills/lerianstudio/ring/detecting-goroutine-leaks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 109 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,145 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.00109 $0.01145
Opus 5.5 $0.00044 $0.00458
Sonnet 5.5 $0.00022 $0.00229
Haiku 4.5 $0.00011 $0.00114

Measured 1mo ago against content hash df9cb081ac3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ring:detecting-goroutine-leaks 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 1mo 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.

dev-team/skills/detecting-goroutine-leaks/SKILL.md · 153 lines

How it starts

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

Goroutine Leak Testing

When to use

  • Code contains goroutine patterns (go func(), go methodCall())
  • After implementation or during code review
  • Suspected memory leak in production
  • Need to verify goroutine-heavy code doesn't leak

Skip when

  • Codebase contains no goroutine usage
  • Not a Go project
  • Task is documentation-only, configuration-only, or non-code
  • Changes do not touch any concurrent code paths

Sequence

Runs before: ring:reviewing-code Runs after: ring:implementing-tasks

Complementary: ring:backend-go

Standards: WebFetch https://raw.githubusercontent.com/LerianStudio/ring/main/dev-team/docs/standards/golang/architecture.md → "Goroutine Leak Detection" section.

Step 1: Detect Goroutine Patterns

# Find goroutine patterns (excluding tests, go.mod, go.sum)
grep -rn "go func()\|go [a-zA-Z_][a-zA-Z0-9_]*\.\|go [a-zA-Z_][a-zA-Z0-9_]*(" \
  --include="*.go" \
  {target_path} \
  | grep -v "_test.go" \
  | grep -v "go.mod\|go.sum\|golang.org"

Goroutine patterns:

  • go func() — anonymous goroutine
  • go methodCall( — direct call
  • go obj.Method( — method call
  • for ... := range ch — channel consumer

Exclude: go.mod/go.sum, golang.org imports, comments, string literals.

Step 2: Verify goleak Coverage

# Package-level
grep -rn "goleak.VerifyTestMain" --include="*_test.go" {target_path}

# Per-test
grep -rn "goleak.VerifyNone" --include="*_test.go" {target_path}

Requirements:

  • Every package with goroutines → goleak.VerifyTestMain(m) in TestMain
  • Critical goroutines → defer goleak.VerifyNone(t) per-test

Step 3: Run goleak

go test -v ./... -run TestMain 2>&1 | grep -E "goleak|leak|goroutine|PASS|FAIL"

Leak output looks like:

goleak.go:89: found unexpected goroutines:
    [Goroutine 7 in state chan receive, with myapp/internal/worker.(*Worker).run on top of the stack:]

Step 4: Dispatch Fix (if leaks found)

Task:
  subagent_type: "ring:backend-go"
  description: "Fix goroutine leak in {package_path}"
  prompt: |
    Fix goroutine leak and add goleak regression test.

    Package: {package_path}
    File: {file}:{line}
    Leak output:
    {goleak_output}

    Standards: Load architecture.md via WebFetch → Goroutine Leak Detection section.

    Requirements:
    1. Fix leak — ensure proper shutdown (context cancellation, close channels, cancel goroutines)
    2. Add goleak.VerifyTestMain(m) to TestMain in package
    3. Add specific test proving no leak occurs

    Pattern templates:
    ```go
    // Worker with proper shutdown
    type Worker struct { done chan struct{} }
    func (w *Worker) Start(ctx context.Context) {
      go func() {
        for {
          select {
          case <-ctx.Done(): return  // MUST honor context
          case <-w.done: return
          case item := <-w.queue: w.process(item)
          }
        }
      }()
    }

Read the full file on GitHub · 153 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. 1mo ago First seen · 153 lines · 109 tokens per session scan A df9cb081ac3f

Subscribe to this mod's changes

ring:detecting-goroutine-leaks is a skill published in the GitHub repository LerianStudio/ring (218 stars, last pushed yesterday), licensed Apache-2.0. It adds 109 tokens to every session and 1,145 once invoked, about $0.0004 per session on Opus 5.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-09-03.

Related

Other skills, from other repositories

debug

Systematic bug investigation with a five-phase framework: reproduce, narrow, diagnose, fix, verify. Supports automated regression bisect via --regression flag. Produces a structured debug report with root cause analysis, regression test, and CQ/Q self-evaluations.

greglas75/zuvo · 55 tokens

qa

Use to verify that code works correctly — browser-based testing with Playwright, native app testing with computer use, CLI testing, API testing, or root-cause debugging. Supports --quick, --standard, --thorough modes. Triggers on /qa.

garagon/nanostack · 54 tokens

pasteurize

Diagnose and fix a hard bug. Build a reliable reproduction, name the cause, add a regression test, and apply the minimum fix. Use when the user reports a bug, a failure, a flaky test, a performance regression, an error, or a wrong result whose cause is unknown. Use when the user pastes a symptom, a stack trace, or…

paulnsorensen/easy-cheese · 127 tokens

antidote

Stop AI agents from patching symptoms. Use this skill when coding, reviewing, refactoring, auditing, committing fixes, or adding guards, validation, workarounds, or 20+ lines without deleting code.

Avtr99/antidote · 47 tokens

mutation-test

Mutation testing with two engines. Uses the project's NATIVE mutation runner (StrykerJS / Infection / mutmut / PIT / cargo-mutants) when one is configured — installing it on explicit consent when it is not — for a reproducible, comparable score; and an LLM-guided engine for the mutation classes native mutators cannot…

greglas75/zuvo · 210 tokens

write-tests

Write tests for existing production code. Processes ONE file at a time through a full pipeline: analyze, inventory (frozen BEFORE writing), write, executable coverage gate, verify, blind coverage audit, adversarial review, log. Uses CodeSift for discovery and analysis when available. Modes: [path] (specific target)…

greglas75/zuvo · 87 tokens