-
-
Notifications
You must be signed in to change notification settings - Fork 4
AI Toolbox
Run reusable prompt workflows on selected code or text.
The AI Toolbox is a set of reusable prompt workflows for selected code or text. It is useful for small, focused actions that do not need a full autonomous agent workflow.
Refact ships with default toolbox commands such as:
-
/bugs— find likely bugs in the selected code. -
/comment— add explanatory comments. -
/explain— explain what the selected code does. -
/shorter— rewrite the selection more concisely. -
/summarize— summarize the selection in one paragraph. -
/typehints— add type hints where appropriate. -
/typos— fix typos, especially in strings and comments.
The exact list can vary because projects can add, remove, or override toolbox commands.
Use the Toolbox when you already know the relevant selection and want a fast, repeatable transformation or explanation. Use chat or Agent mode when the task needs broader context, multiple files, shell commands, tests, or patch review.
Project toolbox commands live in .refact/toolbox_commands/*.yaml. A command defines its id, description, optional selection size limits, and the messages sent to the model.
schema_version: 1
id: simplify_api
description: Simplify selected API code
selection_needed: [1, 80]
messages:
- role: user
content: |
@file %CURRENT_FILE%:%CURSOR_LINE%
Simplify the selected code while preserving behavior:
```
%CODE_SELECTION%
```Useful variables include %CURRENT_FILE%, %CURSOR_LINE%, and %CODE_SELECTION%. Keep toolbox commands prompt-oriented. Use command-line integrations for external programs and service integrations for long-running processes.
- AI Chat for broader Q&A and agent workflows.
- Context for local context and indexing behavior.
- Agent Tools for multi-step tool use.
Refact on GitHub: https://github.com/JegernOUTT/refact
- Agent Modes
- Agent Tools
- Task Planner & Cards
- Worktrees
- Subagents
- Memory & Knowledge
- Hidden Roles & Plans
- Context Compression
- Scheduler & Cron
- Processes & PTY
- Buddy
- MCP
- Skills, Commands & Hooks
- Marketplace
- Chat System
- Providers
- Caps & Models
- Code Completion (FIM)
- AST
- VecDB
- Exec Runtime
- HTTP API
- Checkpoints & Git
- Voice