AgentSkillsCN

fork-dev-branch

采用一致的命名规范,为 GitHub 问题创建与之绑定的开发分支。

SKILL.md
--- frontmatter
name: fork-dev-branch
description: Create a development branch tied to a GitHub issue using a consistent naming convention.

Create a Development Branch

Sets up a new git branch for implementing a GitHub issue. The branch name follows a predictable pattern so anyone on the team can map a branch back to its issue instantly.

Naming Convention

code
issue-<number>
  • <number> is the GitHub issue number (without the #)
  • Examples: issue-42, issue-7, issue-138

Why this format? The issue itself already holds the full context — title, description, labels, discussion. The branch name only needs to point back to it.

Steps

1. Identify the Issue

Find the issue number from the conversation:

  • Look for explicit mentions like "issue #42" or "implement #15"
  • If the number isn't clear, list recent issues: gh issue list --limit 10
  • If still ambiguous, ask the user which issue to target

Confirm the issue exists and is open:

bash
gh issue view <number> --json state,title

If the issue is closed or missing, let the user know and stop.

2. Create the Branch

bash
git checkout -b issue-<number>

Confirm to the user:

code
Created and switched to branch: issue-<number>

Error Handling

ProblemResponse
Issue doesn't existInform user, abort
Issue is closedInform user, abort
Branch name already takenInform user, suggest checking out the existing branch
No issue number providedAsk user to specify one