Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    git branch

    1

    Automated Git branch selection and repository state validation to prevent upstream conflicts and history rewrites.

    Free

    1 useSecurity scanned
    git branch

    git branch

    Example session with this skill installed

    I need to add a new dark mode toggle to the settings page. Check the repo and set up the branch.

    • Read your context and instructions
    • Compiled the git branch

    I have analyzed the repository state. A new branch feat/dark-mode-toggle has been created based on origin/main. No conflicting PRs or worktrees were found.

    Git Branch Selection Report

    CategoryStatusDetails
    ActionCreated new branchfeat/dark-mode-toggle
    Baseorigin/mainSynced via git fetch --prune
    Current StateCleanNo dirty files or detached HEAD
    Upstream PRsNoneNo active PRs found for settings work
    Risk CheckPassedNo squash-merged branch conflicts detected

    Next steps

    • Begin implementing the DarkModeToggle component in src/components/Settings.
    • Add the necessary state logic to the ThemeContext.
    • Commit changes to the new branch once the toggle is functional.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Developers often lose time rewriting history because they started coding on the wrong branch. This skill enforces a rigorous Git workflow by analyzing the repository state, PR status, and worktrees before the first line of code is written. It prevents common mistakes like committing to the default branch, adding feature code to unrelated fix branches, or working on squash-merged stubs.

    What it does

    • State validation runs pruning fetches and checks for dirty trees or detached HEAD states.
    • Branch routing determines if a task requires a new feature branch or an update to an unmerged PR.
    • Risk assessment identifies squash-merged branches that appear active but are actually closed.
    • Naming enforcement pulls the repo's default branch name and follows existing remote naming conventions.
    • Safety checks prevents accidental stashing, rebasing, or force-pushing without explicit consent.

    How it works

    1. Sync and Inspect triggers a prune fetch and inspects local branches, upstreams, and active worktrees.
    2. Context analysis checks for existing PRs via GitHub CLI to see if the current task belongs to an open thread.
    3. Branch selection creates a new branch from the correct base or stays on the current active feature branch.
    4. Resolution reporting provides a concise summary of the chosen path and any mitigated risks.

    Frameworks & tools

    This skill requires git and works best when gh (GitHub CLI) is available for PR status checks.

    Why this beats prompting it yourself

    Manual branching is prone to "stale head" errors where you branch off an outdated main. This skill automates the fetch-and-check cycle, ensuring every task starts from the actual origin state while avoiding the trap of squash-merged local branches.

    Use cases

    • Start a new feature off the correct, up-to-date default branch.
    • Identify when a bug fix should be added to an existing unmerged PR.
    • Prevent commits to branches that have already been squash-merged upstream.
    • Navigate complex repos with multiple active worktrees and detached HEADs.

    Known limitations

    Requires a local Git environment. Cannot perform stashes, rebases, or force-pushes without direct user confirmation.

    Requires local git environment. Cannot auto-resolve merge conflicts. Will not perform destructive actions like force-push or stash without explicit user permission.

    How to use

    1. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    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

    1 use

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    • Free with an Agensi account

    Requires

    Git

    Permissions

    Terminal / Shell
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    This skill automates the pre-coding workflow by verifying repository states, checking for open PRs, and ensuring you are on the correct branch, effectively preventing accidental commits to default branches or outdated codebases.

    The skill requires a local installation of `git` and highly recommends the GitHub CLI (`gh`) to enable advanced features like Pull Request status checks and remote branch validation.

    Yes, it is designed to recognize squash-merged branches that may still appear active locally, preventing you from building on top of code that has already been integrated and deleted upstream.

    Absolutely. The skill is designed to manage complex environments, including detached HEAD states and active worktrees, ensuring your task begins in the correct context regardless of your current setup.

    For security and data integrity, the skill will never perform destructive actions like stashing, rebasing, or force-pushing without your explicit manual confirmation.

    New in DevOps & Cloud