From Refactor
Interprets arguments (paths, semantic queries, glob patterns) to determine the target scope for refactoring, handling mixed arguments, ambiguous queries, and staged changes.
How this command is triggered — by the user, by Claude, or both
Slash command
/refactor:scope-determinationrefactor/references/The summary Claude sees in its command listing — used to decide when to auto-load this command
# Scope Determination Advanced Strategies
## Edge Cases and Complex Scenarios
### Mixed Path and Semantic Arguments
When arguments contain both valid paths and semantic descriptions:
**Strategy**:
1. Identify valid paths first (`src/auth` exists)
2. Treat remaining arguments as semantic query ("user validation logic")
3. Search within valid path scope if paths are directories
4. Combine path-based and semantic results into single target scope
### Glob Pattern Arguments
When arguments look like glob patterns:
**Strategy**:
1. Expand the pattern with glob matching
2. Treat all matc...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.
4plugins reuse this command
First indexed Mar 23, 2026
npx claudepluginhub daisycatts/dotclaude --plugin refactor/scope-determinationInterprets arguments (paths, semantic queries, glob patterns) to determine the target scope for refactoring, handling mixed arguments, ambiguous queries, and staged changes.
/refactor-guidedGuides safe, incremental code refactoring with test verification at each step. Accepts a target file, directory, or description of the refactoring to perform.
/sc-refactorPlans and executes behavior-preserving code refactorings. Automatically detects whether to analyze code for opportunities or perform a specific refactoring (extract, rename, simplify) with pre/post test verification.
/refactorSafely refactors codebases using patterns like extract, inline, move, rename; runs impact analysis, verifies test coverage, applies atomic git commits with post-change verification and metrics report.
/refactorStages all changes, analyzes the diff, and creates a refactoring commit with conventional commit format (refactor(scope): description). Accepts optional description; auto-generates from diff if omitted. Runs post-commit skill for changelog and version bump.