project-reset

Reset master repositories to a clean default branch state.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/zcawood-mie/agentz --skill project-reset
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: project-reset
Source: https://github.com/zcawood-mie/agentz/tree/main/skills/project-reset
Command: npx skills add https://github.com/zcawood-mie/agentz --skill project-reset

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures a master repository is returned to its canonical default branch and clean working state, preventing accidental development on the primary branch and making the repo ready for reference, research, or worktree creation.

Core Features & Use Cases

  • Safe branch switching: Validates uncommitted changes before switching and uses project metadata to determine the correct default branch.
  • Submodule-aware updates: Prefers repository-provided scripts (switch-branches.sh, update-packages.sh) when available to handle submodules consistently.
  • Developer stash handling: Lists and selectively applies developer stashes with git stash apply (never pop) and verifies the result.
  • Use Case: Prepare a master repo for research by syncing to upstream, updating submodules, and applying the developer configuration stash while preserving stash history.

Quick Start

Run the project-reset skill to return the current repository to its registry-defined default branch and ensure a clean working state.

Frequently Asked Questions about project-reset

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reset a git repository to its default branch and clean state?

Resetting a git repository to its default branch involves checking for uncommitted changes, consulting project-registry metadata to identify the branch, running git fetch and pull, and applying developer stashes to verify a clean working state.

What is the safest way to switch branches without losing uncommitted changes?

Safe branch switching validates uncommitted changes before switching, uses project metadata to determine the default branch, and applies developer stashes with git stash apply instead of pop to preserve stash history and verify the result.

How do I sync a master repository to upstream with submodules?

To sync a master repository to upstream with submodules, the process prefers repository-provided scripts such as switch-branches.sh and update-packages.sh to handle submodules consistently, then performs git fetch and pull to update the default branch.

Does git stash apply preserve my stash history when preparing a reference repository?

Git stash apply preserves stash history by applying developer configuration stashes without deleting them from the list, allowing the master repository to reach a clean default branch state while keeping stash entries intact for future reference or worktree creation.

Why does my repository reset fail when there are uncommitted changes on the current branch?

Repository resets fail with uncommitted changes because the skill checks for a clean working state before switching to the default branch, preventing accidental development on the primary branch and ensuring no data is lost during the git fetch and pull operations.

When should I use a submodule-aware script to reset my project repository?

Use submodule-aware scripts to reset your project repository when repository-provided scripts such as switch-branches.sh or update-packages.sh exist, ensuring submodules are handled consistently during default branch restoration and upstream syncing operations.