Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

branch-workflow

verified

Patterns for branch naming, validation, and lifecycle management. Used by git-pr-manager agent.

View on GitHub

Marketplace

alphaagent-team

the-answerai/alphaagent-team

Plugin

aai-core

workflow

Repository

the-answerai/alphaagent-team

plugins/aai-core/skills/branch-workflow/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/the-answerai/alphaagent-team/blob/main/plugins/aai-core/skills/branch-workflow/SKILL.md -a claude-code --skill branch-workflow

Installation paths:

Claude
.claude/skills/branch-workflow/
Powered by add-skill CLI

Instructions

# Branch Workflow Patterns

Reference patterns for branch naming, validation, and protection.

## Branch Naming Convention

```
{type}/{ticket-id}-{description}
```

### Branch Types
| Type | Description | Example |
|------|-------------|---------|
| `feature` | New functionality | `feature/AUTH-123-oauth-login` |
| `fix` | Bug fixes | `fix/AUTH-456-token-expiry` |
| `chore` | Maintenance tasks | `chore/DEP-789-update-deps` |
| `docs` | Documentation | `docs/README-updates` |
| `refactor` | Code restructure | `refactor/API-101-cleanup` |
| `test` | Test additions | `test/AUTH-202-unit-tests` |

### Description Guidelines
- Use lowercase with hyphens
- Keep short but descriptive
- No spaces or special characters

## Protected Branches

These branches are PROTECTED - never commit directly:

| Branch | Purpose |
|--------|---------|
| `main` | Production code |
| `master` | Production code (legacy) |
| `production` | Production deployment |
| `staging` | Pre-production testing |
| `develop` | Development integration |

## Branch Validation

### Check Current Branch
```bash
git branch --show-current
```

### Validate Not Protected
```javascript
const PROTECTED = ['main', 'master', 'production', 'staging', 'develop'];
const current = getCurrentBranch();
if (PROTECTED.includes(current.toLowerCase())) {
  throw new Error(`Cannot operate on protected branch: ${current}`);
}
```

### Extract Ticket ID
```javascript
// Pattern: type/TICKET-123-description
const match = branchName.match(/^[a-z]+\/([A-Z]+-\d+)/);
const ticketId = match ? match[1] : null;
```

## PR Target Rules

| Source Branch | Target Branch |
|---------------|---------------|
| `feature/*` | `staging` or `develop` |
| `fix/*` | `staging` or `develop` |
| `chore/*` | `staging` or `develop` |
| `staging` | `production` or `main` |

**NEVER target main/master directly from feature branches.**

## Branch Lifecycle

1. **Create**: Branch from staging/develop
2. **Develop**: Make changes, commit frequently
3. **Pu

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2837 chars