Stats
Actions
Tags
How this command is triggered — by the user, by Claude, or both
Slash command
/ue-inspector:ue-refactor file-or-directoryThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
Refactor the specified Unreal Engine C++ code to improve AI-friendliness. ## Target $ARGUMENTS ## Refactoring Process ### Phase 1: Analysis 1. If target is a directory, use Glob to find all `.h` and `.cpp` files 2. Read each file and identify AI-friendliness violations 3. Prioritize issues: Critical > Warning > Info ### Phase 2: Preview (REQUIRED) Before making any changes, present a complete preview of all planned modifications: cpp [original code] cpp [proposed code] ### Phase 3: Confirmation After presenting all changes, ask the user: "Proceed with these refactoring changes? (yes...
Refactor the specified Unreal Engine C++ code to improve AI-friendliness.
$ARGUMENTS
.h and .cpp filesBefore making any changes, present a complete preview of all planned modifications:
## Refactoring Preview
### [filename]
#### Change 1: [Issue Type]
**Before:**
```cpp
[original code]
After:
[proposed code]
Reason: [explanation]
[Additional changes...]
### Phase 3: Confirmation
After presenting all changes, ask the user:
"Proceed with these refactoring changes? (yes/no/select specific changes)"
Wait for user confirmation before applying any edits.
### Phase 4: Apply Changes
Only after user approval:
1. Apply each change using the Edit tool
2. Report each change as it's applied
3. Summarize total changes made
## Refactoring Rules
### Always Apply (Critical Fixes)
- Extract functions exceeding 100 lines into smaller functions
- Reduce nesting using Early Return pattern
- Split files with multiple class definitions
### Apply with Caution (Warnings)
- Add `this->` prefix to member variable access
- Replace unnecessary `auto` with explicit types
- Add parameter names to header declarations
- Extract 50-100 line functions if logically separable
### Suggest Only (Info)
- Add Doxygen comments (show example, let user decide)
- Convert includes to forward declarations
- Add UPROPERTY/UFUNCTION metadata
## Refactoring Patterns
### Early Return Pattern
```cpp
// Before
if (Actor)
{
if (Actor->IsValid())
{
DoSomething();
}
}
// After
if (!Actor) return;
if (!Actor->IsValid()) return;
DoSomething();
// Before
Health += Delta;
// After
this->Health += Delta;
// Before
auto Result = GetPlayerState();
// After
APlayerState* Result = GetPlayerState();
// Before: 80-line function
void ProcessAll()
{
// 30 lines of input processing
// 25 lines of validation
// 25 lines of output generation
}
// After: 3 focused functions
void ProcessAll()
{
ProcessInput();
ValidateData();
GenerateOutput();
}
Follow the user's language preference:
npx claudepluginhub juyeongyi/jylee_claude_marketplace --plugin ue-inspector