# cuboulder-se-research/move-method-assist architecture

> Architecture diagram of the GitHub repository cuboulder-se-research/move-method-assist, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cuboulder-se-research/move-method-assist
- Repository: https://github.com/cuboulder-se-research/move-method-assist

## Overview

MM-Assist is an IntelliJ plugin that uses language models to identify misplaced Java methods and IntelliJ refactoring machinery to apply moves. Its primary workflow starts with an IDE context action, presents ranked suggestions, and lets the developer execute selected refactorings; the README documents that user path. The repository also contains Python tooling for processing refactoring data and evaluating accuracy. Some runtime connections are not visible in the sampled excerpts, so those links are omitted rather than inferred.

Main entry points: [`src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt`](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt) (Move-method action), [`src/main/kotlin/com/intellij/ml/llm/template/ui/RefactoringSuggestionsPanel.kt`](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/ui/RefactoringSuggestionsPanel.kt) (Suggestion panel), [`src/main/kotlin/com/intellij/ml/llm/template/settings/RefAgentSettingsManager.kt`](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/settings/RefAgentSettingsManager.kt) (Model settings), [`src/main/kotlin/com/intellij/ml/llm/template/prompts/MoveMethodRefactoringPrompt.kt`](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/prompts/MoveMethodRefactoringPrompt.kt) (Move-method prompts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["IDE plugin"]
  node_move_action["Move-method action"]
  node_other_actions["Other refactoring actions"]
  node_suggestion_ui["Suggestion panel"]
  node_settings["Model settings"]
end

subgraph group_llm["LLM suggestions"]
  node_prompting["Move-method prompts"]
  node_general_prompts["Refactoring prompts"]
  node_request_provider["LLM request provider"]
  node_openai_requests["OpenAI requests<br/>[OpenAIRequests.kt]"]
  node_model_services["Model services"]
end

subgraph group_refactor["Refactoring engine"]
  node_factory["Refactoring factories"]
  node_move_factory["Move-method factory"]
  node_move_handler["Move-method handler"]
  node_refactoring_model["Refactoring candidates"]
  node_code_transformer["Code transformation<br/>[CodeTransformer.kt]"]
  node_psi_tools["Java PSI utilities<br/>[PsiUtils.kt]"]
end

subgraph group_observability["Telemetry and logs"]
  node_telemetry["Telemetry data"]
  node_logs["Assistant logs<br/>[AgentLogsWindow.kt]"]
end

subgraph group_analysis["Data analysis"]
  node_analysis_tools["Refactoring analysis"]
  node_move_data_validator["Move-data validation"]
  node_accuracy["Accuracy evaluation"]
end

node_developer(("Developer"))
node_telemetry_files[("Local telemetry files")]

node_developer -->|"triggers"| node_move_action
node_move_action -->|"shows suggestions"| node_suggestion_ui
node_developer -->|"selects and applies"| node_suggestion_ui
node_move_action -->|"uses prompt"| node_prompting
node_move_action -->|"creates candidates"| node_move_factory
node_move_action -->|"reads settings"| node_settings
node_prompting -->|"names action types"| node_move_action
node_request_provider -->|"creates requests"| node_openai_requests
node_settings -->|"selects model"| node_model_services
node_suggestion_ui -->|"applies candidate"| node_code_transformer
node_suggestion_ui -->|"renders candidates"| node_refactoring_model
node_factory -->|"creates refactorings"| node_refactoring_model
node_move_factory -.->|"delegates move"| node_move_handler
node_move_action -.->|"requests suggestions"| node_request_provider
node_move_action -->|"records outcomes"| node_telemetry
node_telemetry -->|"stores locally"| node_telemetry_files
node_developer -->|"opens logs"| node_logs
node_analysis_tools -.->|"includes validator"| node_move_data_validator
node_accuracy -->|"uses move references"| node_move_data_validator

click node_move_action "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt"
click node_other_actions "https://github.com/cuboulder-se-research/move-method-assist/tree/main/src/main/kotlin/com/intellij/ml/llm/template/intentions"
click node_suggestion_ui "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/ui/RefactoringSuggestionsPanel.kt"
click node_settings "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/settings/RefAgentSettingsManager.kt"
click node_prompting "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/prompts/MoveMethodRefactoringPrompt.kt"
click node_general_prompts "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/prompts/SuggestRefactoringPrompt.kt"
click node_request_provider "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/models/LLMRequestProvider.kt"
click node_openai_requests "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/models/openai/OpenAIRequests.kt"
click node_model_services "https://github.com/cuboulder-se-research/move-method-assist/tree/main/src/main/kotlin/com/intellij/ml/llm/template/models"
click node_factory "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/MyRefactoringFactory.kt"
click node_move_factory "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/movemethod/MoveMethodFactory.kt"
click node_move_handler "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/movemethod/MoveInstanceMethodHandlerForPlugin.kt"
click node_refactoring_model "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/AbstractRefactoring.kt"
click node_code_transformer "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/utils/CodeTransformer.kt"
click node_psi_tools "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/utils/PsiUtils.kt"
click node_telemetry "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/telemetry/TelemetryDataObserver.kt"
click node_logs "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/toolwindow/AgentLogsWindow.kt"
click node_analysis_tools "https://github.com/cuboulder-se-research/move-method-assist/tree/main/src/main/python/mm_analyser"
click node_move_data_validator "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/python/mm_analyser/refactoring_miner_processing/filter/ExtractMoveMethodValidator.py"
click node_accuracy "https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/python/mm_analyser/refactoring_miner_processing/compute_accuracy.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_move_action,node_other_actions,node_suggestion_ui,node_settings toneBlue
class node_prompting,node_general_prompts,node_request_provider,node_openai_requests,node_model_services,node_telemetry_files toneAmber
class node_factory,node_move_factory,node_move_handler,node_refactoring_model,node_code_transformer,node_psi_tools toneMint
class node_telemetry,node_logs toneRose
class node_analysis_tools,node_move_data_validator,node_accuracy,node_developer toneIndigo
```

## Components

### IDE plugin

- [Move-method action](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt): `src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt`
- [Other refactoring actions](https://github.com/cuboulder-se-research/move-method-assist/tree/main/src/main/kotlin/com/intellij/ml/llm/template/intentions): `src/main/kotlin/com/intellij/ml/llm/template/intentions`
- [Suggestion panel](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/ui/RefactoringSuggestionsPanel.kt): `src/main/kotlin/com/intellij/ml/llm/template/ui/RefactoringSuggestionsPanel.kt`
- [Model settings](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/settings/RefAgentSettingsManager.kt): `src/main/kotlin/com/intellij/ml/llm/template/settings/RefAgentSettingsManager.kt`

### LLM suggestions

- [Move-method prompts](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/prompts/MoveMethodRefactoringPrompt.kt): `src/main/kotlin/com/intellij/ml/llm/template/prompts/MoveMethodRefactoringPrompt.kt`
- [Refactoring prompts](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/prompts/SuggestRefactoringPrompt.kt): `src/main/kotlin/com/intellij/ml/llm/template/prompts/SuggestRefactoringPrompt.kt`
- [LLM request provider](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/models/LLMRequestProvider.kt): `src/main/kotlin/com/intellij/ml/llm/template/models/LLMRequestProvider.kt`
- [OpenAI requests](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/models/openai/OpenAIRequests.kt): `src/main/kotlin/com/intellij/ml/llm/template/models/openai/OpenAIRequests.kt`
- [Model services](https://github.com/cuboulder-se-research/move-method-assist/tree/main/src/main/kotlin/com/intellij/ml/llm/template/models): `src/main/kotlin/com/intellij/ml/llm/template/models`

### Refactoring engine

- [Refactoring factories](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/MyRefactoringFactory.kt): `src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/MyRefactoringFactory.kt`
- [Move-method factory](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/movemethod/MoveMethodFactory.kt): `src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/movemethod/MoveMethodFactory.kt`
- [Move-method handler](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/movemethod/MoveInstanceMethodHandlerForPlugin.kt): `src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/movemethod/MoveInstanceMethodHandlerForPlugin.kt`
- [Refactoring candidates](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/AbstractRefactoring.kt): `src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/AbstractRefactoring.kt`
- [Code transformation](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/utils/CodeTransformer.kt): `src/main/kotlin/com/intellij/ml/llm/template/utils/CodeTransformer.kt`
- [Java PSI utilities](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/utils/PsiUtils.kt): `src/main/kotlin/com/intellij/ml/llm/template/utils/PsiUtils.kt`

### Telemetry and logs

- [Telemetry data](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/telemetry/TelemetryDataObserver.kt): `src/main/kotlin/com/intellij/ml/llm/template/telemetry/TelemetryDataObserver.kt`
- [Assistant logs](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/kotlin/com/intellij/ml/llm/template/toolwindow/AgentLogsWindow.kt): `src/main/kotlin/com/intellij/ml/llm/template/toolwindow/AgentLogsWindow.kt`

### Data analysis

- [Refactoring analysis](https://github.com/cuboulder-se-research/move-method-assist/tree/main/src/main/python/mm_analyser): `src/main/python/mm_analyser`
- [Move-data validation](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/python/mm_analyser/refactoring_miner_processing/filter/ExtractMoveMethodValidator.py): `src/main/python/mm_analyser/refactoring_miner_processing/filter/ExtractMoveMethodValidator.py`
- [Accuracy evaluation](https://github.com/cuboulder-se-research/move-method-assist/blob/main/src/main/python/mm_analyser/refactoring_miner_processing/compute_accuracy.py): `src/main/python/mm_analyser/refactoring_miner_processing/compute_accuracy.py`

### Other components

- **Developer**
- **Local telemetry files**

## Connections

- Developer → Move-method action: triggers (evidence: `README.md`)
- Move-method action → Suggestion panel: shows suggestions (evidence: `src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt`)
- Developer → Suggestion panel: selects and applies (evidence: `README.md`)
- Move-method action → Move-method prompts: uses prompt (evidence: `src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt`)
- Move-method action → Move-method factory: creates candidates (evidence: `src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt`)
- Move-method action → Model settings: reads settings (evidence: `src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt`)
- Move-method prompts → Move-method action: names action types (evidence: `src/main/kotlin/com/intellij/ml/llm/template/prompts/MoveMethodRefactoringPrompt.kt`)
- LLM request provider → OpenAI requests: creates requests (evidence: `src/main/kotlin/com/intellij/ml/llm/template/models/LLMRequestProvider.kt`)
- Model settings → Model services: selects model (evidence: `src/main/kotlin/com/intellij/ml/llm/template/settings/RefAgentSettingsManager.kt`)
- Suggestion panel → Code transformation: applies candidate (evidence: `src/main/kotlin/com/intellij/ml/llm/template/ui/RefactoringSuggestionsPanel.kt`)
- Suggestion panel → Refactoring candidates: renders candidates (evidence: `src/main/kotlin/com/intellij/ml/llm/template/ui/RefactoringSuggestionsPanel.kt`)
- Refactoring factories → Refactoring candidates: creates refactorings (evidence: `src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/MyRefactoringFactory.kt`)
- Move-method factory → Move-method handler: delegates move (evidence: `src/main/kotlin/com/intellij/ml/llm/template/refactoringobjects/movemethod/MoveMethodFactory.kt`)
- Move-method action → LLM request provider: requests suggestions
- Move-method action → Telemetry data: records outcomes (evidence: `src/main/kotlin/com/intellij/ml/llm/template/intentions/ApplyMoveMethodInteractiveIntention.kt`)
- Telemetry data → Local telemetry files: stores locally (evidence: `README.md`)
- Developer → Assistant logs: opens logs (evidence: `README.md`)
- Refactoring analysis → Move-data validation: includes validator (evidence: `src/main/python/mm_analyser/refactoring_miner_processing/compute_accuracy_emm.py`)
- Accuracy evaluation → Move-data validation: uses move references (evidence: `src/main/python/mm_analyser/refactoring_miner_processing/compute_accuracy.py`)
