agentleFS
recrsnrecrsn/agent-skills/skills/organize/SKILL.md

organize

Skill1 starsChanged 9 months agoMITView on GitHub

Split large files into manageable chunks following language-specific best practices

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the diff against origin/main, and identify large files that were added or modified in this branch.

    line 7
  2. Distinctive:

    Keep tightly coupled code together — don't split just to hit a line count

    line 22
  3. Distinctive:

    Keep interfaces near dependents, not implementations

    line 51
  4. Very specific:

    Test files mirror source files (foo.go → foo_test.go)

    line 52
  5. Distinctive:

    Only split files touched by the branch diff

    line 56
  6. Distinctive:

    Follow the project's existing naming and directory conventions over the guidelines above

    line 58
  7. Distinctive:

    Do not rename exported symbols — only move them

    line 59
  8. Distinctive:

    Update all imports, references, and re-exports.

    line 60
  9. Distinctive:

    Run the project's linter/formatter if configured

    line 61
  10. Distinctive:

    When in doubt, leave the code together

    line 62

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Check the diff against origin/main, and identify large files that were added or modified in this branch. Run git fetch origin to make sure git context is up-to-date.

Here is the list of files changed in this branch: !git diff --name-only origin/main

For each changed file, read the full file and determine if it should be split based on the language conventions below. Then execute the splits, updating all imports and references across the project.

When to split

  • Files over ~300 lines are candidates; over ~500 should almost always be split
  • Files with multiple unrelated concepts or public exports
  • Keep tightly coupled code together — don't split just to hit a line count
  • Helper/utility functions used by only one caller stay with the caller
  • One major class/component per file (applies across all languages)
  • Group small related types (enums, data classes) together

Language-specific additions

TypeScript / JavaScript / React

  • Colocate component styles and tests alongside the component
  • Redux: ducks pattern — one slice file per domain
  • Shared types/interfaces go in types.ts; barrel exports (index.ts) for directory API

Swift / SwiftUI

  • Previews stay with their view; protocols and default extensions can share a file

Java / Kotlin

  • Inner classes stay with outer class unless large and used externally
  • Kotlin: data classes used by only one file can stay

Python

  • Separate CLI entry points from library code

Go

  • Group by responsibility: types, handlers, middleware
  • Keep interfaces near dependents, not implementations
  • Test files mirror source files (foo.go → foo_test.go)

Rules

  • Only split files touched by the branch diff
  • Preserve external behavior exactly; all existing imports must continue to work
  • Follow the project's existing naming and directory conventions over the guidelines above
  • Do not rename exported symbols — only move them
  • Update all imports, references, and re-exports; verify no circular dependencies
  • Run the project's linter/formatter if configured
  • When in doubt, leave the code together

Report at the end with a brief summary of files split and the rationale.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.