home / skills / robzolkos / zolkos-agent-skills / done
This skill resets the repository for the next task by verifying a clean working tree, switching to the default branch, and pulling latest changes.
npx playbooks add skill robzolkos/zolkos-agent-skills --skill doneReview the files below or copy the command above to add this skill to your agents.
---
name: done
description: Reset the working directory for the next task by ensuring no uncommitted changes exist, then switching to the main branch and pulling latest.
disable-model-invocation: true
allowed-tools: Bash(git *)
---
# Done - Reset for next task
You are finishing up the current work and resetting the repo to be ready for the next task.
## Steps
1. **Check for uncommitted changes**: Run `git status --porcelain`. If there is ANY output (staged, unstaged, or untracked files), stop immediately and tell the user:
- List the uncommitted/untracked files
- Tell them to commit or stash their changes before running `/done`
- Do NOT proceed to the next steps
2. **Determine the default branch**: Run `git branch --list master main` to check which exists. Prefer `master` if it exists, otherwise use `main`. If neither exists, tell the user that no master or main branch was found and stop.
3. **Switch to the default branch**: Run `git checkout <branch>` where `<branch>` is the branch determined in step 2.
4. **Pull latest changes**: Run `git pull` to fetch and merge the latest changes from the remote.
5. **Confirm**: Tell the user they are now on the default branch with the latest changes and ready to start the next task.
This skill resets the working directory so the repository is ready for the next task. It enforces a clean working tree, switches to the repository’s default branch (master or main), and pulls the latest remote changes. Use it when you want a predictable starting point for new work.
First it inspects the working tree with git status --porcelain; if any staged, unstaged, or untracked files exist it halts and reports them. Next it detects the default branch by checking for master then main, checks out that branch, and runs git pull to update from the remote. Finally it confirms you are on the default branch with the latest changes.
What happens if I have uncommitted changes?
The skill stops and lists the uncommitted and untracked files. Commit or stash them, then run the skill again.
What if neither master nor main exists?
The skill reports that no master or main branch was found and stops so you can choose the correct branch manually.