Feature branch

From forcedotcom/salesforcedx-vscode · View interactive version

Feature branch is an AI agent skill from the GitHub repository forcedotcom/salesforcedx-vscode. Create feature branches for all work. Use when creating branches, checking out, or pushing. Prevents accidental pushes to protected branches.

How to use this skill

Skill file

Feature Branch

Never commit to develop or main.

Stack detection

Before pushing, rebasing, or creating a PR, detect whether the current branch belongs to a GitHub stack:

gh pr view --json headRefName,baseRefName,url 2>/dev/null || true
git config --get "branch.$(git branch --show-current).github-pr-base-branch"
gh stack view

A branch is stacked when its existing PR baseRefName, or its stored github-pr-base-branch, is neither develop nor main.

Branch

Resolve ownerPrefix via gus-cli runner identity.

Format: <ownerPrefix>/W-XXXXX-short-description.

Example for Shane McLaughlin (ownerPrefix = sm):

git fetch origin develop
git checkout -b sm/W-XXXXX-short-description origin/develop --no-track
# ... work, commit ...
git push -u origin sm/W-XXXXX-short-description

Never omit --no-track off origin/develop — bare git push could push develop.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.