When arguments contain both valid paths and semantic descriptions:
Determines refactoring scope by analyzing file paths, semantic queries, and git staging context to identify target files.
/plugin marketplace add fradser/dotclaude/plugin install refactor@frad-dotclauderefactor/references/When arguments contain both valid paths and semantic descriptions:
/refactor src/auth "user validation logic"
Strategy:
src/auth exists)When arguments look like glob patterns:
/refactor src/**/*.test.ts
Strategy:
When semantic query is too broad or returns excessive results:
/refactor "utility functions"
Strategy:
When no arguments provided but git staging area has files:
git diff --cached --name-only
Strategy:
When target scope spans multiple languages:
Strategy:
Authentication/Authorization:
(auth|login|session|token|permission|role|access)
API/Routing:
(route|endpoint|api|handler|controller)
Data Access:
(repository|dao|query|database|model)
UI Components:
(component|widget|view|template)
-i flag) for semantic queriesWhen semantic query targets specific file types:
/refactor "test utilities"
Strategy:
--glob filter for .test.ts, .spec.ts patternsBefore treating arguments as paths:
# Use Glob to check existence
Glob: pattern="path/to/check"
If Glob returns results → valid path If Glob returns empty → treat as semantic query
All paths should be relative to repository root:
Never include in refactoring scope:
node_modules/, .git/, dist/, build/package-lock.json, pnpm-lock.yaml, uv.lock.min.js, .bundle.jsUse Grep --glob exclusions to enforce.