Agents start guessing when they try to do too much. Hide the full plan, ask for a single instruction, and allow your agent to focus on the present. The agent only ever sees the next step. The plan stays in the tree, not in the prompt.
CLAUDE.md · 487 lines
1. First, check the git status. Confirm a clean tree.
2. Read the existing tests. Note their style.
3. Locate the file containing the function to refactor.
4. Identify single-responsibility violations. Score each.
5. Draft a refactor plan and present to the user.
6. Apply the refactor, splitting concerns into modules.
7. Update the imports across the codebase.
8. Run the test suite. Verify everything stays green.
9. Re-score the codebase against the SRP criteria.
10. Confirm violations resolved. Loop if any remain.
11. Run a multi-agent code review on the diff.
12. Compose a before-vs-after report. Save to disk.
13. ...
→
abtree next
instructScore_SRP
Score the codebase for Single
Responsibility violations. Save
the ranked list to $LOCAL.violations.
Never guess where your agent got stuck. The runtime shows the tree in real time, logging each step. So you can see exactly what ran, what was skipped, and how far it got.
Claude Code, ChatGPT, or any shell-capable agent, the brief is the same. Paste it. The agent understands and walks the tree until the end.
text
Install the npm package @abtree/srp-refactor, then drive the workflow against this repo: abtree --help abtree execution create ./node_modules/@abtree/srp-refactor "Refactor the worst SRP violation in src/"
For the long-form walkthrough — install the CLI, add a tree, drive it from your agent — see Get started.