Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    git branch

    1

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

    Free

    Security 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.

    How to use

    Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scanned

    Verified clean 2 days ago

    • Free to download with an account

    Requires

    Git

    Listed2 days ago

    What's inside

    Frequently Asked Questions