home / skills / robzolkos / zolkos-agent-skills / done

done skill

/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 done

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.2 KB
---
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.

Overview

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.

How this skill works

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.

When to use it

  • Before starting a new feature or bugfix to ensure a clean base
  • After finishing work to reset state for the next assignment
  • When preparing the environment for CI or automated tasks
  • Before switching contexts between tasks or branches
  • When you want to ensure your local default branch matches remote

Best practices

  • Commit or stash any local changes before running the skill
  • Use descriptive commit messages so interrupted work is easy to find
  • Verify which default branch (master or main) your project uses
  • Run the skill from the repository root to avoid scope issues
  • Ensure you have network access and correct remote credentials before pulling

Example use cases

  • You finished a feature branch and want to return to main to start the next ticket
  • An automated agent needs a guaranteed clean checkout before running tests
  • You want to sync your local default branch to the latest remote changes before creating a new branch
  • Resetting a repo in a workshop or paired session so all participants start from the same commit

FAQ

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.