Get the FREE Ultimate OpenClaw Setup Guide →

done

npx machina-cli add skill robzolkos/zolkos-agent-skills/done --openclaw
Files (1)
SKILL.md
1.2 KB

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.

Source

git clone https://github.com/robzolkos/zolkos-agent-skills/blob/master/skills/done/SKILL.mdView on GitHub

Overview

This skill resets your workspace by ensuring no uncommitted changes exist, then switches to the repository's default branch (master or main) and pulls the latest commits. It ensures you start the next task from a clean, up-to-date codebase.

How This Skill Works

It first checks for uncommitted changes using git status --porcelain and stops if any output is shown. Then it lists master and main to decide the default branch, checks out that branch, and runs git pull to fetch and merge remote changes.

When to Use It

  • Preparing for a new task after finishing the current one to avoid conflicts
  • Starting a feature work in a clean working tree with the latest code
  • Collaborating in a team to ensure you have the most recent changes from the default branch
  • Automating task resets in a script to standardize environments
  • Verifying the repository is on the correct branch before running builds or tests

Quick Start

  1. Step 1: Run git status --porcelain to verify a clean working tree
  2. Step 2: Detect the default branch with git branch --list master main and choose master if present
  3. Step 3: Checkout the default branch and run git pull, then you're ready for the next task

Best Practices

  • Always run git status --porcelain first to confirm a clean working tree
  • Do not proceed if there are uncommitted or untracked files; require commit or stash
  • Automatically detect default branch by preferring master, then main
  • After switching branches, run git pull to ensure you have the latest changes
  • Confirm you are on the default branch and that the workspace is ready before starting the next task

Example Use Cases

  • A developer finishes a feature and runs the reset to begin a bugfix with the latest master/main
  • A CI bot uses this to prepare a fresh workspace for the next job in a pipeline
  • A teammate runs the command when starting a new ticket to pull the freshest code
  • A mentor scripts onboarding to keep templates up-to-date on the default branch
  • A multi-repo workflow standardizes resets before running tests

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers