github-create-branch
Create a feature branch for a story, checking for conflicts first. Use when the user says 'create a branch', 'start a branch for story X', or 'create feature branch'.
- License 许可
- MIT
- 最近更新
- 2026-05-12
- Stars
- ★ 8
- Forks
- 1
01 前言 Front Matter
- name
- github-create-branch
- description
- Create a feature branch for a story, checking for conflicts first. Use when the user says 'create a branch', 'start a branch for story X', or 'create feature branch'.
03 SKILL.md 正文
GitHub — Create Feature Branch
Goal
Create a feature branch for a story using the configured naming pattern. Always checks if a branch already exists first (conflict layer 2 check).
Prerequisite Check
Check integrations.github in config. If missing: "Run github-connect first."
Step 1: Identify Story
Ask: "Which story is this branch for?" (accept S-ID, JIRA key, or title)
Load the story and extract:
- JIRA key:
{JIRA-KEY} - Story title slug: lowercase, hyphens, max 40 chars
Step 2: Compute Branch Name
Apply the configured branch pattern from config:
branch_name = "feature/{JIRA-KEY}-{slug}"
e.g., "feature/PROJ-42-add-user-authentication"
Step 3: Conflict Check — Branch Already Exists?
git fetch --all --quiet
git branch -a | grep -i "{branch_name}"
If found:
"⚠️ Branch
{branch_name}already exists. This means someone may have already started this story. Runjira-conflict-detectfor a full check before proceeding."
⏸️ STOP if conflict found. Ask: "Are you sure you want to proceed anyway?"
Step 4: Create Branch
Ensure we're on the default branch and up to date:
git checkout {default_branch}
git pull origin {default_branch}
Create the branch:
git checkout -b {branch_name}
Push to remote:
git push -u origin {branch_name}
Step 5: Update Local Story
Add to story frontmatter:
branch: "{branch_name}"
branch_created: "{date}"
branch_created_by: "{user_name}"
Completion
"✅ Branch created:
{branch_name}Pushed to origin.You're now on
{branch_name}. Ready to implement withdev-story."
Ask: "Would you like me to update the JIRA ticket to 'In Progress' as well?"
If yes:
curl -s -X POST \
"{jira_url}/rest/api/3/issue/{JIRA-KEY}/transitions" \
-u "{email}:{api_token}" \
-H "Content-Type: application/json" \
-d '{"transition": {"id": "21"}}'
(Transition ID 21 is the standard "In Progress" transition. If it fails, list available transitions and ask user to pick.)
04 同仓库更多 Skills
jira-sync
Bulk sync all epics and stories from the local backlog to JIRA. Use when the user says 'sync to JIRA', 'push everything to JIRA', or 'create all JIRA tickets'.
jira-create-story
Create a single story ticket in JIRA from a local story file. Use when the user says 'create this story in JIRA' or 'push story to JIRA'.
jira-create-epic
Create an epic in JIRA from a planning artifact. Use when the user says 'create this epic in JIRA' or 'push epic to JIRA'.
jira-connect
Set up and verify JIRA integration. Use when the user says 'connect to JIRA', 'set up JIRA', or 'configure JIRA'.
jira-conflict-detect
Check if a story is already being worked on by another team member. Use before starting any story implementation.
gitlab-create-mr
Create a GitLab Merge Request for the current story branch. Use when the user says 'create an MR', 'open a merge request', or 'ready for review' in a GitLab project.