Use language-specific patterns to discover all code files:
Analyzes project codebases to identify all source files, categorize them by language and purpose, and generate comprehensive scope summaries.
/plugin marketplace add fradser/dotclaude/plugin install refactor@frad-dotclauderefactor-project/references/Use language-specific patterns to discover all code files:
JavaScript/TypeScript:
**/*.{ts,tsx,js,jsx,mjs,cjs}
Python:
**/*.py
Go:
**/*.go
Swift:
**/*.swift
Multi-language projects: Combine patterns or run multiple Glob searches.
ALWAYS exclude these directories:
node_modules/, .pnpm/, bower_components/.git/, .svn/, .hg/dist/, build/, out/, .next/, .nuxt/vendor/, venv/, .venv/, __pycache__/target/ (Rust), bin/, obj/ (C#)coverage/, .nyc_output/ALWAYS exclude these files:
package-lock.json, pnpm-lock.yaml, yarn.lock, Gemfile.lock, Cargo.lock, go.sum, uv.lock*.min.js, *.bundle.js, *.d.ts (unless project uses them as source)*.png, *.jpg, *.pdf, *.woff, *.ttf// @generated or similar markersConfiguration files (include selectively):
.eslintrc.js, jest.config.ts (executable code).json, .yaml, .toml config files (unless code-like)After discovery, categorize files for summary:
By Language:
TypeScript: 45 files
Python: 12 files
Go: 8 files
By Purpose:
Source code: 52 files
Tests: 13 files
By Directory:
src/: 30 files
lib/: 15 files
tests/: 13 files
scripts/: 7 files
Generate a high-level overview:
src/
├── components/ (15 files)
├── services/ (8 files)
├── utils/ (7 files)
└── types/ (5 files)
tests/ (13 files)
scripts/ (7 files)
Detect project type by inspecting key files:
Next.js:
next.config.js existspages/ or app/ directorypackage.json contains "next"React:
package.json contains "react".tsx/.jsx files presentPython:
pyproject.toml, setup.py, requirements.txtuv.lock for uv-based projectsGo:
go.mod existsSwift:
.xcodeproj or Package.swiftInclude framework information in scope summary.
Project-wide Refactoring Scope:
Files to refactor: <total count>
Languages detected:
- <language1>: <count> files
- <language2>: <count> files
Frameworks detected:
- <framework1>
- <framework2>
Main directories:
- <dir1>/: <count> files
- <dir2>/: <count> files
Proceeding with project-wide refactoring automatically.
Project-wide Refactoring Scope:
Files to refactor: 65
Languages detected:
- TypeScript: 45 files
- Python: 12 files
- Shell: 8 files
Frameworks detected:
- Next.js
- React
Main directories:
- src/: 35 files
- lib/: 10 files
- scripts/: 8 files
- tests/: 12 files
Proceeding with project-wide refactoring automatically.
For monorepos with multiple packages:
Strategy:
packages/, apps/)Example:
Monorepo detected with 3 packages:
- packages/core/: 25 files
- packages/ui/: 18 files
- apps/web/: 22 files
When project contains both source and generated files:
Detection:
// @generated, # generated by, or similar markers__generated__/, .graphql/)Strategy:
When test files outnumber source files:
Strategy:
Example:
Files to refactor: 85
- Source code: 32 files
- Tests: 53 files (62% of project)
If discovered files < 5:
Strategy:
If discovered files > 500:
Strategy:
Before displaying scope summary:
If uncommitted changes detected:
⚠️ Warning: Uncommitted changes detected in working tree.
Project-wide refactoring will modify files across the entire codebase.
Recommend committing or stashing changes first.
Continue automatically in 3 seconds, or Ctrl+C to cancel...
Wait 3 seconds, then proceed automatically.
If not in a git repository:
❌ Error: Not in a git repository.
Project-wide refactoring requires git for safety (rollback capability).
Initialize git first: git init
Exit without refactoring.