بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ
Keep your code organized as it grows
Move files and rename symbols with every reference updated, in one call. Your agent keeps its tokens for the actual work.
Pre-alpha, and for Linux only.
Why a clean file tree is worth keeping
A tidy tree is easier to work in
Folders that say what lives in them make a project quicker to read for you and quicker to search for an agent. The more your code grows, the more that structure is worth.
Keeping it tidy should not be costly
Moving a file by hand means a search, then a read and an edit for every file that imports it. Done through an agent, all of that goes through its context. With refac it is one call, and the agent keeps its tokens for the actual work.
The rewriting is not guesswork
refac asks each language's own tooling, a language server where there is one, which references point at the thing, and rewrites those. Add --dry-run to see the plan first. After a change your project should inshallah build the way it did before.
Move a file, and every import follows
Here is a move in TypeScript. The import lines in the three files that use it are rewritten by the same call.
refac move --source-path src/utils/format.ts --target-path src/lib/format.ts
- src
- app.ts
- cart
- cart.ts
- lib
- tax.ts
- order
- order.ts
- utils
- date.ts
- format.ts
- src/app.ts
import { money } from "./utils/format"; - src/cart/cart.ts
import { money } from "../utils/format"; - src/order/order.ts
import { money } from "../utils/format";
By hand, typically 9 calls
- 1mv src/utils/format.ts src/lib/format.ts
- 2rg utils/format
- 3read src/app.ts
- 4edit src/app.ts
- 5read src/cart/cart.ts
- 6edit src/cart/cart.ts
- 7read src/order/order.ts
- 8edit src/order/order.ts
- 9tsc --noEmit
With refac, 1 call
1refac move --source-path src/utils/format.ts --target-path src/lib/format.ts
The more files import the one you move, the longer the left column grows. The right one stays a single line.
Made for the agent that has no IDE
refac is a plain command. A language server is started for one command and stopped when it ends, so nothing stays running.
- A skill file, no MCP server
- The repository ships a skill folder,
.agents/skills/refac-cli/. Drop it into your agent setup and it loads only when it is relevant, with no server to run and no standing context. How to get it. - Output an agent can parse
- With
--jsona command prints one document withstatus,operationand the fields of that operation. A failure printsstatusanderroron stderr. - Help in three depths
refac move -his a few lines,refac move --helpis everything about one command, andrefac guideholds the in-depth topics.
{
"status": "ok",
"operation": "move",
"dry_run": true,
"moved_paths": 1,
"edited_files": 3,
"edits": 3,
"files": [
{ "path": "src/app.ts", "edits": 1 },
{ "path": "src/cart/cart.ts", "edits": 1 },
{ "path": "src/order/order.ts", "edits": 1 }
],
"moves": [
{ "from": "src/utils/format.ts", "to": "src/lib/format.ts" }
],
"notes": []
}Seven languages, each with its own tooling
refac asks the tool that already understands your language, so a move follows that language's own rules.
Try it on a branch.
refac is pre-alpha and built for the author's own use first. Commands, output and behavior change when the author needs them to. Run it on a branch, read the diff, and let your own build and tests tell you the rest.
I am Javed. More about me and my work is at javedab.com.