modularize-go-package

modularize-go-package is a skill for Claude Code, Codex from jmrplens/gitlab-mcp-server. It costs 65 tokens per session (3,688 once invoked), scanned A, original, MIT.

A workflow for splitting one large Go package into smaller packages organised by area of responsibility. A package is a folder of related Go code that can be used by other code.

In plain words
What is it for?
Use it to move domain-specific files, update imports and type names, create registration functions, and break up packages containing many files.
Why use it?
It makes a large codebase easier to navigate and change while checking compilation and tests after each group of moves.

Skill for Claude CodeCodex

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 skills/jmrplens/gitlab-mcp-server/modularize-go-package
Any agent
npx skills add jmrplens/gitlab-mcp-server --skill modularize-go-package
Clone the repo
git clone --depth 1 https://github.com/jmrplens/gitlab-mcp-server

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 modularize-go-package

README.md
[![agentmods](https://agentmods.dev/badge/skills/jmrplens/gitlab-mcp-server/modularize-go-package.svg)](https://agentmods.dev/skills/jmrplens/gitlab-mcp-server/modularize-go-package)
Your own site
<a href="https://agentmods.dev/skills/jmrplens/gitlab-mcp-server/modularize-go-package"><img src="https://agentmods.dev/badge/skills/jmrplens/gitlab-mcp-server/modularize-go-package.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,688 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.00065 $0.03688
Opus 5 $0.00032 $0.01844
Sonnet 5 $0.00013 $0.00738
Haiku 4.5 $0.00006 $0.00369

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

Security

Grade A, and why

modularize-go-package 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 5d 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.

.github/skills/modularize-go-package/SKILL.md · 346 lines

How it starts

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

Modularize Go Package

Primary Directive

Transform a monolithic Go package into a modular structure with domain-specific sub-packages and a shared utilities package. Every step must maintain compilation and test integrity.

Execution Model

This skill operates in atomic migration batches. Each batch moves one domain to its own sub-package. Between batches, the project must compile and all tests must pass. Never move to the next batch until the current one is verified.

Prerequisites

Before invoking this skill, ensure:

  1. Clean git working directory (git status shows no uncommitted changes)
  2. All tests pass: go test ./internal/... -count=1
  3. All code compiles: go build ./...
  4. You have identified the source package and its domain files

Input Parameters

  • ${sourcePackage} — The monolithic package to modularize (e.g., internal/tools)
  • ${utilPackage} — Name for the shared utilities package (e.g., internal/toolutil)
  • ${domains} — Comma-separated list of domains to extract (e.g., branches,commits,issues)

Process

Step 1: Inventory Analysis

Scan the source package and classify every file:

Category Files Action
Shared utilities errors.go, pagination.go, logging.go, markdown.go, text.go, metatool.go, string_or_int.go, fileutils.go, time_helpers.go Extract to ${utilPackage}
Shared constants Annotation variables, format constants Extract to ${utilPackage}
Domain handlers branches.go, commits.go, etc. Move to ${sourcePackage}/{domain}/
Domain tests branches_test.go, commits_test.go, etc. Move with their domain
Test helpers helpers_test.go Extract to ${utilPackage} as testutil
Catalog wiring action_specs.go, catalog aggregation Keep runtime surfaces catalog-backed; do not add package-level meta registration as the final path
Package doc (doc comment in any file) Create ${sourcePackage}/doc.go

Read the full file on GitHub · 346 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. 5d ago First seen · 346 lines · 65 tokens per session scan A 3b2e69ea525f

Subscribe to this mod's changes

modularize-go-package is a skill published in the GitHub repository jmrplens/gitlab-mcp-server (33 stars, last pushed today), licensed MIT. It adds 65 tokens to every session and 3,688 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

goai

GoAI is a Go SDK for AI applications. One unified API across 25+ LLM providers. Inspired by the Vercel AI SDK, adapted to Go idioms (generics, interfaces, channels).

zendev-sh/goai · 0 tokens

test-with-gt

Write Go test code using the gt library. Use when writing tests, creating test files, or when the user asks to add tests for Go code.

gollem-dev/gollem · 35 tokens

go-code-review

Use when reviewing Go code or checking code against community style standards. Also use proactively before submitting a Go PR or when reviewing any Go code changes, even if the user doesn't explicitly request a style review. Does not cover language-specific syntax — delegates to specialized skills.

cxuu/golang-skills · 56 tokens

go-concurrency

Use when writing concurrent Go code — goroutines, channels, mutexes, or thread-safety guarantees. Also use when parallelizing work, fixing data races, or protecting shared state, even if the user doesn't explicitly mention concurrency primitives. Does not cover context.Context patterns (see go-context).

cxuu/golang-skills · 62 tokens

go-defensive

Use when hardening Go code at API boundaries — copying slices/maps, verifying interface compliance, using defer for cleanup, time.Time/time.Duration, or avoiding mutable globals. Also use when reviewing for robustness concerns like missing cleanup or unsafe crypto usage, even if the user doesn't mention "defensive…

cxuu/golang-skills · 76 tokens

go-error-handling

Use when writing Go code that returns, wraps, or handles errors — choosing between sentinel errors, custom types, and fmt.Errorf (%w vs %v), structuring error flow, or deciding whether to log or return. Also use when propagating errors across package boundaries or using errors.Is/As, even if the user doesn't ask about…

cxuu/golang-skills · 88 tokens