# Split a file that outgrew its module boundary

A file that accumulated several responsibilities, split along them with the exports unchanged.

Category: Refactors and cleanup
Source: https://letsship.ai/use-cases/split-an-oversized-file
Published: 2026-08-25

## Goal

Split an oversized file along its responsibilities without changing its public exports.

## Acceptance criteria

- The public exports are unchanged
- Each new file has one responsibility
- Existing tests pass without modification
- Every resulting file is under the project's size limit

## What lands as proof

An unchanged export surface and an unmodified test suite, which prove this was a move rather than a rewrite.

## Prompt

Copy this to an agent to open the ticket:

```text
Create a Linear issue in my team and assign it to the SHIP agent.

Title: Split {file}

Description: Split an oversized file along its responsibilities without changing its public exports.

Acceptance criteria:
- The public exports are unchanged
- Each new file has one responsibility
- Existing tests pass without modification
- Every resulting file is under the project's size limit

Before you create the issue, list this repository's largest source files and replace {file} with one that has several responsibilities.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: split an oversized file along its responsibilities without changing its public exports. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.

### How do I know the work is done?

The pull request carries the evidence, not only the diff. Here that means same exports, same tests, files under the agreed limit, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

None is required before the run starts. Every claim this ticket makes can be checked by machine, so the agent works straight through and a person reviews the finished pull request like any other.
