Refactor / rename
A mechanical move kept mechanical — so the diff stays cheap to review.
Renames and moves are the easiest agent task to ship — and the easiest to ruin by letting the agent 'improve things slightly' along the way. This template scopes the change to a pure mechanical operation: same signature, same behaviour, new path. The reviewer reads the diff once and moves on.
When to reach for this template.
- The change is mechanical: a rename, a move, an import rewrite.
- You want the function body, the signature, and the test surface to stay byte-identical.
- You'd happily land it as a single 'no behaviour change' commit.
- There's a downstream task (or PR) where the behaviour change actually belongs.
The template.
Drop this into .watchfire/tasks/<n>.yaml, edit the prompt and acceptance_criteria to match your repo, and let the daemon run it.
task_id: refac003
task_number: 3
title: "Move parseInput from lib/parse.ts to lib/input/parse.ts"
prompt: |
Move `parseInput` from `lib/parse.ts` into a
new file `lib/input/parse.ts`. Update every
importer in the repo to use the new path. Keep
the function signature, the function body, and
the exported name byte-identical — this is a
mechanical move, not a rewrite.
If `lib/parse.ts` ends up empty after the move,
delete it. If it still has other exports, leave
it alone.
Do NOT:
- Reformat any unrelated code.
- Change the function body.
- Add or remove tests beyond updating their
imports.
- Touch `tsconfig.json` paths.
acceptance_criteria: |
- `lib/input/parse.ts` exists and exports
`parseInput` with an identical signature.
- No file in the repo imports from the old
`lib/parse.ts` path (verify with grep).
- `npm run test` passes with no test edits
other than import paths.
- `npm run build` and `npm run lint` pass.
- The diff is a pure move + import rewrites —
no unrelated changes.
status: ready
Common pitfalls.
The shapes of failure most often seen on this kind of task — and the way this template hedges against each.
- Folding in 'one tiny cleanup'. Each cleanup turns the review from 'verify the move' into 'audit every line', which is the opposite of cheap.
- Letting the agent reformat unrelated lines. Forbid reformatting in the prompt; otherwise Prettier-on-save will quietly rewrite half the file.
- Forgetting the grep check. If you don't make 'no importer of the old path remains' an acceptance criterion, you'll discover dangling imports a week later.
- Bundling a rename with a behaviour change. If the agent has to think about semantics, it'll think about both — and the review surface doubles.
Related templates.
Update a dependency / migration
One library, one changelog, one diff — not three half-finished upgrades in a trench coat.
Open the template
Add tests for an untested module
Backfill coverage against a named bar — not the agent's idea of 'enough tests'.
Open the template
Investigate and report (no code changes)
Diagnosis only — the artifact is a Markdown report, not a patch.
Open the template
Pair it with a playbook.
These use-case playbooks lean on tasks shaped like this one.
Build your own.
This template is a starting point. Fill in a form to draft your own task in the playground — or read the full task schema to learn every field the daemon understands.
Get started with Watchfire
Install in seconds. Define tasks. Let agents ship code for you.
Download for macOSAvailable for macOS, Linux, and Windows
# Install via Homebrew (macOS)brew tap watchfire-io/tapbrew install --cask watchfire-io/tap/watchfire# Set up your project and gowatchfire initwatchfire task add "Build the login page"watchfire start --allIncludes GUI, CLI, and daemon. Also available via Homebrew.