- Home
- Skills
- Code Quality & Review
- Worktree Task
Worktree Task
Execute coding tasks in isolated git worktrees to keep your main branch clean and experiments safe.
Free
Worktree Task
Example session with this skill installed
Try refactoring the AuthController to use the new UserService, but do it in a separate worktree so I don't lose my current progress on the login UI.
- Read your context and instructions
- Compiled the worktree task
I have completed the refactor in an isolated worktree. The main directory remains untouched.
Task Report: AuthController Refactor
I initialized a new worktree at ../api-service-wt-20250522-1430 on branch wt/20250522-1430. The following changes were implemented and tested.
| Metric | Result |
|---|---|
| Files Changed | src/controllers/AuthController.ts, src/services/UserService.ts |
| Lines Added | 42 |
| Lines Removed | 18 |
| Test Suite | npm test |
| Test Results | 12 Passed, 0 Failed |
Changes Summary
- Injected
UserServiceintoAuthControllerconstructor. - Replaced direct database calls in
loginandregistermethods with service calls. - Updated unit tests in
AuthController.test.tsto mock the new service dependency. - Verified that all authentication middleware remains compatible with the new structure.
Next steps
- Keep: Run
git merge wt/20250522-1430to bring these changes into your current branch. - Discard: I will remove the worktree and delete the temporary branch.
- Continue: Tell me what else needs to be adjusted within this isolated environment.
Connects securely to your tools. The creator never sees your data.
About this skill
Running experimental refactors or risky migrations directly in your working directory leads to broken states and lost productivity. This skill automates the creation of isolated git worktrees to execute tasks on separate branches without touching your current files.
What it does
- Isolated execution creates a temporary directory and branch for every task.
- Environment validation checks git status and branch state before starting work.
- Automated testing identifies and runs test suites within the worktree to validate changes.
- Impact reporting calculates exact line counts and file diffs against the base branch.
- Workflow cleanup handles the merging or deletion of worktrees based on your feedback.
How it works
- Initialize the skill by providing a coding task or refactor request.
- Setup involves the agent creating a new worktree at
../<repo>-wt-<id>on a fresh branch. - Execution occurs strictly within the worktree folder, including all commits and test runs.
- Review the generated report containing diff stats and test results.
- Finalize by choosing to merge the work, discard the branch, or continue iterating.
Frameworks & tools
This skill works with any git-based project. It automatically detects test configurations in package.json, pyproject.toml, Makefile, and README files to ensure code quality.
Why this beats prompting it yourself
Standard prompts often hallucinate paths or accidentally modify your local HEAD when trying to switch branches. This skill enforces strict directory isolation and automated cleanup logic that prevents your primary workspace from becoming inconsistent during complex tasks.
Use cases
- Risky refactors where you want to see the impact before committing to the change.
- Parallel prototyping to compare two different implementation patterns side-by-side.
- Dependency upgrades to verify breaking changes without breaking your main dev environment.
- Bug reproduction on a clean branch while keeping your current work-in-progress stashed or active.
Known limitations
Requires an initialized git repository. Uncommitted changes in the main directory are not automatically synced to the worktree.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 7 days ago
- Free with an Agensi account
- Software
Git
Permissions
What's inside
Frequently Asked Questions
New in Code Quality & Review
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.