go-skill-extractor

go-skill-extractor is an agent for coding agents from muratmirgun/gophers. It costs 106 tokens per session (2,043 once invoked), scanned A, original, MIT.

An analysis agent for Go codebases that finds repeated ways of structuring code and proposes a new written guideline, called a skill. It looks for patterns appearing at least several times across multiple packages and checks existing skills first.

In plain words
What is it for?
Use it to audit a large Go project, especially a monorepo—a repository containing multiple related packages or services—or after a major refactor.
Why use it?
It helps teams turn repeated review comments or conventions into documented guidance without mistaking a one-off helper or project-specific procedure for a general rule.

Agent

Part of the gophers plugin — 26 skills, 4 agents shipped together

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.

agentmods
npx agentmods add agents/muratmirgun/gophers/go-skill-extractor
Clone the repo
git clone --depth 1 https://github.com/muratmirgun/gophers

Or install gophers, the plugin that ships this one along with the rest of its 26 skills, 4 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 go-skill-extractor

README.md
[![agentmods](https://agentmods.dev/badge/agents/muratmirgun/gophers/go-skill-extractor.svg)](https://agentmods.dev/agents/muratmirgun/gophers/go-skill-extractor)
Your own site
<a href="https://agentmods.dev/agents/muratmirgun/gophers/go-skill-extractor"><img src="https://agentmods.dev/badge/agents/muratmirgun/gophers/go-skill-extractor.svg" alt="Measured on agentmods" height="20"></a>
Per session 106 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,043 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00106 $0.02043
Opus 5 $0.00053 $0.01022
Sonnet 5 $0.00021 $0.00409
Haiku 4.5 $0.00011 $0.00204

Measured 4d ago against content hash 5d935152a0e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

go-skill-extractor 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 4d 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/go-skill-extractor.md · 197 lines

How it starts

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

go-skill-extractor

A meta-agent that finds repeated Go patterns in a codebase and proposes them as new gophers skills. It does not create the SKILL.md on disk — it returns a draft proposal markdown the maintainer can iterate on.

When to Dispatch

Dispatch when:

  • A service has grown past 50 packages and the team notices "we always do X"
  • A monthly / quarterly audit on a long-lived monorepo
  • After a large refactor that introduced new internal conventions
  • A reviewer keeps copy-pasting the same nit comment across PRs

Do not dispatch when:

  • The codebase is < 10 packages (not enough signal)
  • The repeated pattern is just a function helper (factor it into a Go helper, not a skill)
  • The pattern is project-specific (e.g., one company's auth flow) — those are runbooks, not skills
  • An existing gophers skill already covers it (check the Skills Catalog first)

Input Contract

Input Format Example
module_root path ./
min_occurrences (optional) integer 3 (default)
min_packages (optional) integer 2 (default)
existing_skills_dir (optional) path ../gophers/skills (defaults to comparing against the Skills Catalog)
domain (optional) comma-separated topic hints errors,logging,http

Process

  1. Enumerate packages.
    go list -f '{{.ImportPath}} {{.Dir}}' ./...
    
  2. Detect candidate patterns. Look for structurally repeated shapes (≥ min_occurrences across ≥ min_packages packages):
    • Error patterns — repeated wrapping shapes, sentinel definitions, custom error types
    • HTTP patterns — middleware ordering, response shapes, request-id propagation
    • Logging patterns — repeated logger field sets, log-and-return mistakes
    • Concurrency patterns — same worker-pool shape, same select-with-context skeleton
    • Init patterns — repeated config loading, repeated DI wiring
    • Testing patterns — repeated fake shapes, repeated httptest harnesses
  3. For each candidate, run negative coverage check. For every existing skill in existing_skills_dir:
    • grep -i <candidate-keyword> skills/*/SKILL.md
    • If any hit, skip the candidate (already covered)
  4. Score candidates by (occurrences × packages × novelty). Return the top 3.
  5. For each surviving candidate, draft a SKILL.md proposal following the gophers template — see Output Contract below.
  6. Cite real file:line locations for every claim (this is not a hypothetical proposal — it must reference actual code).

Read the full file on GitHub · 197 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. 4d ago First seen · 197 lines · 106 tokens per session scan A 5d935152a0e6

Subscribe to this mod's changes

go-skill-extractor is an agent published in the GitHub repository muratmirgun/gophers (8 stars, last pushed 23d ago), licensed MIT. It adds 106 tokens to every session and 2,043 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.