Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

split-file

Skill by grafana

split-file splits a large Go file into smaller files grouped by logical concern, keeping git log --follow history for each new file. It is for Go developers who need to break up an oversized module.

  • Score 84
  • 5.3k stars
  • AGPL-3.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install split-file

Built from the published package, never by AI.

git clone --depth 1 https://github.com/grafana/mimir /tmp/mimir && mkdir -p ~/.claude/skills && cp -r /tmp/mimir/.claude/skills/split-file ~/.claude/skills/split-file

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install split-file in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

split-file is a skill that splits a large Go file into smaller files grouped by logical concern. It takes a file path as its argument. The assistant first catalogs functions, methods, types, and const and var blocks, then proposes a split with approximate line counts and waits for user approval. It aims for at least four files and keeps the original file for initialization, config, types, and lifecycle.

For each new file, the skill runs a git sequence that forces a rename/rename conflict so the new file carries the original history. It then trims both files with a Python helper, runs goimports and go build, and checks history with git log --follow. A per-declaration hash tool, tools/split-file-verify, checks that each declaration moved intact. It is intended for Go developers who need to break up a file that has grown too large.

Written from the project's SKILL.md and checked against it.

What it can do

  • Analyze and propose splitCatalogs declarations by line number and proposes grouped new files for user approval before changes.
  • Preserve git historyUses a branch and rename sequence so each new file keeps its history under git log --follow.
  • Extract contentUses a Python helper to move line ranges into new files and trim the original file.
  • Fix imports and buildRuns goimports and go build on the affected package and notes aliased imports that need manual fixes.
  • Verify declarationsUses tools/split-file-verify to hash each top-level declaration before and after the split.

What you need

  • Git
  • Go toolchain
  • goimports
  • Python

Try asking

  • Split internal/store/engine.go into focused files, keeping git history
  • Propose a file split for this large Go file and list the new files
  • Verify that every declaration moved intact after the split

Good to know

  • Aims for at least four new files and requires user approval before proceeding.
  • goimports may resolve aliased imports to the wrong package, so the import block needs checking.
  • Test files in _test.go are not split; they work across the package.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .claude/skills/split-file/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md5 KB

Alternatives to split-file

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

split-file: common questions

Does the split keep git history for the new files?

Yes. The skill uses a git sequence that forces a rename/rename conflict, then checks each new file with git log --follow.

Does it split the file without asking first?

No. It proposes the split with file names, contents, and approximate line counts, then waits for user approval.

How can I confirm no code was lost in the split?

The tools/split-file-verify tool hashes every top-level declaration in the original and split files. A diff with no output means the content matches.

How do I install split-file?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is split-file free?

The code is published under the AGPL-3.0 licence. The service it connects to may have its own pricing.

Is split-file safe to use?

It scores 84 of 100. Grades: maintenance A, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to split-file?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

split-file Install

Add to stack

Loading.