---
title: SplitBrains
url: 'https://www.twelvetone.tv/docs/developer-tools/intellij-plugins/splitbrains'
markdown: 'https://www.twelvetone.tv/docs/developer-tools/intellij-plugins/splitbrains.md'
date: '2026-09-25'
description: 'The SplitBrains plugin for IntelliJ provides advanced refactoring and analysis tools for projects. Splitb'
taxonomy:
  category:
    - docs
  devtype:
    - beta
---

[](#)  [ Home ](https://www.twelvetone.tv/docs/)     [ Developer Tools ](https://www.twelvetone.tv/docs/developer-tools)     [ IntelliJ Plugins ](https://www.twelvetone.tv/docs/developer-tools/intellij-plugins)      SplitBrains    

This product is in *beta state*. 
It is available to registered beta testers only.

The SplitBrains plugin for IntelliJ provides advanced refactoring and analysis tools for projects.

Splitbrains is a refactoring tool for IntelliJ. It allows the developer to declare splitpoints in a project, and then take actions on code that defines, contains, uses, references, or depends on those splitpoints.

Splitbrains also provides tools to assist in the in decoupling of dependencies, such as:

- Separating a codebase into model, view, and controller
- Removing UI dependencies
- Removing database dependencies
- I8N (Internationalization)
- Providing warnings and restrictions to prevent code from appearing in the wrong place 
    # Nomenclature

SplitpointA piece of code that identifies code that should be split from the source. A splitpoint identifies the separation of .TriggerDefines what is considered to be a splitpointSourceThe unit that will be moved, such as file, class, method, or member.TargetThe location where to move the source when it contains a splitpoint.ActionOperations to perform when triggers are met. # Splitbrains Script The Splitbrains Script is a simple JSON file that defines splitpoint triggers, sources, targets, and actions. It lives in the root of a project. See the appendix for examples.# IntelliJ Actions

The follow actions are added to IntelliJ menus, and can be assigned to keyboard shortcuts.

- Analyze
- Run Script
- Show Dependencies
- Create Script 
    # Triggers

CommentA regular expression that occurs in a commentTextA regular expression that occurs in a filePackageA regular expression that matches a package declaration.ImportA class that imports a packageClassA code that is or depends on a classMethodA code that declares or calls a methodFieldA code declares or access a fieldAnnotationAn item annotated with the specified annotation # Source Determines what is moved when a splitpoint is triggered. The only supported value is *File*. Future plans include support for *Package*, *Class*, *Method*, *Field*, and *Property*. # Actions Actions define what to do with the sources when splitpoints are triggered. ## Analyze ## Report ## Move Move the source to the target and change all references. The original code is removed. ## Copy Copy the source to the target. Does not change references. The original code is left intact. ## Copy And Reference Copy the source to the target and change all references. The original code is left intact. Use this if you are OK with duplicate code in different packages. If there are non-refactored libraries that reference the code, this will prevent them from reporting a *Class Not Found Exception*.

## Repackage

Move the source to a new package in the same or different module.

```json
{
    "type" : "repackage",
    "newPackage : "com.some.package"
    "rebase" : ["com.some"],
    "referenceAction": "update|ignore"
    "module" : "new module"
}
```

### rebase

Sources will be placed within the target package. The rebase parameter specifies prefixes of the source package that will be stripped, and then append to the new package. Unmatched packages will be moved into the new package using their entire package name.

If rebase is not defined, all sources will be moved into the new package.

```
newPackage a.b.c
sourcePackage x.y.z.Class
result a.b.c.Class

rebase  = "x.y.z"
newPackage a.b.c
sourcePackage x.y.z.Class
result a.b.c.Class

rebase  = "x.y"
newPackage a.b.c
sourcePackage x.y.z.Class
result a.b.c.z.Class

rebase = ""
newPackage a.b.c
sourcePackage x.y.z.Class
result a.b.c.x.y.z.Class
```

### referenceAction

The action to perform on references to any modified packages. This will affect any files that *import* the package.

updateThe imports will be changed to the new package.ignoreThe imports will remain unchanged.### module

The target module. If unset, the same module as the source will be used.

## Annotate

## Backup

## Modify

## Notify

# Sample Script

```json
{
  "name": "Untitled Splitbrains Script",
  "trigger": {
    "packages": [
      "tv.twelvetone.splitpoint_samples.old_package"
    ]
  },
  "source": "file",
  "action": [
    {
      "type": "report"
    },
    {
      "type": "repackage",
      "newPackage": "tv.twelvetone.splitpoint_samples.new_package"
    },
    {
      "type": "x-backup",
      "toFolder": "splitbrains_copy"
    }
  ],
  "target": {
  }
}
```

# Sample Usage

Trigger on import of com.vaadin.\*
Source is file.
Target is new module - Vaadin Client
This will move all files that depend on Vaadin to a new module.

Next, we can move any com.mysql code to a sql module.

 [ ](https://www.twelvetone.tv/docs/developer-tools/intellij-plugins/intellitidy) [](https://www.twelvetone.tv/docs/developer-tools/intellij-plugins/visual-file)

---

## Navigation

- Parent: [IntelliJ Plugins](https://www.twelvetone.tv/docs/developer-tools/intellij-plugins.md)
- Previous: [IntelliTidy](https://www.twelvetone.tv/docs/developer-tools/intellij-plugins/intellitidy.md)
- Next: [Visual File](https://www.twelvetone.tv/docs/developer-tools/intellij-plugins/visual-file.md)
