CLI Tools
Command
/refactor
Safely refactor code while maintaining functionality.
> /plugin marketplace add mixedbread-ai/mgrep> /plugin install mgrep@Mixedbread-Grep
Command definition
refactor.mdRefactor
Safely refactor code while maintaining functionality.
Arguments
- `$ARGUMENTS` - Description of what to refactor and why
Steps
1. **Ensure test coverage**
- Run existing tests: `pnpm test`
- If coverage is insufficient, add tests first before refactoring
2. **Plan the refactoring**
- Identify all files that will be affected
- List the changes needed in each file
- Consider breaking large refactors into smaller commits
3. **Make incremental changes**
- Change one thing at a time
- After each change, run: `pnpm typecheck`
- Commit working states frequently
4. **Maintain backward compatibility** (if public API)
- Keep function signatures the same where possible
- If signatures must change, update all call sites
5. **Verify after completion**
- Run full test suite: `pnpm test`
- Run type check: `pnpm typecheck`
- Run lint: `pnpm lint`
6. **Clean up**
- Remove any dead code
- Update imports if file paths changed
- Update documentation if needed
7. **Commit with proper message**
- Use format: `refactor(scope): description`
- Keep refactoring commits separate from feature/fix commits
Stats
4,441
Stars
Quiet
Maintenance
TypeScript
Language
Apache-2.0
License
Last commit
Created
Added
Ships withmgrep
A calm, CLI-native way to semantically grep everything, like code, images, pdfs and more.
4.4k1 skill
Other commands on mgrep.
More commands from other plugins.
cli-anything
CommandBuild a complete, stateful CLI harness for any GUI application.
canvas
CommandSpawn interactive terminal canvases for calendars, documents, and flight booking
debug-logs
CommandAnalyze claudish debug logs from a failed model run. Extracts SSE fixtures, diagnoses failures, adds regression tests.
report-template
CommandSummarize completed work, current risks, and next actions.

