Version: 2.0 Effective Date: 2025-12-27 Status: Active
A.R.C. CLI uses a PR-number-based branching convention to ensure clear traceability between branches, pull requests, and feature specifications.
{PR_NUMBER}-{feature-name}
Components:
{PR_NUMBER}: The GitHub Pull Request number (3 digits, zero-padded){feature-name}: Short, kebab-case description of the feature
007-state-management
008-config-system
009-provider-interface
010-kubernetes-provider
Before creating a new feature branch, check what the next PR number will be:
# List all PRs to see the highest number
gh pr list --state all --limit 50
# Or check the last merged PR
git log --oneline | head -5Example Output:
#6 001 initial setup
#5 001 initial setup
#4 001 initial setup ← Last merged
#3 001 initial setup
#2 001 initial setup
#1 001 initial setup
Next PR will be: #7
# Create and switch to new branch
git checkout -b 007-state-management
# Or from specific base
git checkout -b 007-state-management mainMatch the branch name to the spec directory:
mkdir -p specs/002-state-managementNote: Spec directory uses feature sequence (002), branch uses PR number (007)
# Make changes
git add .
git commit -m "Implement state management foundation"
# Push branch
git push origin 007-state-management# Using GitHub CLI
gh pr create \
--title "002: State Management" \
--body "Implements state management system. See specs/002-state-management/" \
--base main
# Or via GitHub UI
# The PR will automatically get number #7Once PR is created, update the spec files:
**Feature ID**: 002-state-management
**Branch**: `007-state-management`
**PR**: #7- Feature Sequence: Sequential numbering of features (001, 002, 003...)
- PR Number: Actual GitHub PR number (may include failed/closed PRs)
Example:
Feature 001 → Branch: 001-initial-setup → PR #1-6 (multiple attempts)
Feature 002 → Branch: 007-state-management → PR #7 (first attempt succeeded)
Feature 003 → Branch: 008-config-system → PR #8
Feature 004 → Branch: 012-provider-interface → PR #9-11 (failed), #12 (succeeded)
Directory Structure:
specs/
├── 001-initial-setup/ # Feature sequence
├── 002-state-management/ # Feature sequence
├── 003-config-system/ # Feature sequence
└── 004-provider-interface/ # Feature sequence
git branches:
├── 001-initial-setup # Merged via PR #4
├── 007-state-management # Next PR will be #7
├── 008-config-system # Hypothetical future PR #8
└── 012-provider-interface # Hypothetical future PR #12
- Branch name directly references PR number
- Easy to find PR from branch name:
gh pr view 007 - Clear history of which PRs were merged
- PR numbers are auto-assigned by GitHub (unique)
- No need to coordinate branch names across developers
- Chronological PR numbering shows development timeline
- Easy to see which features came first
- Branch name matches GitHub's PR URL structure
- Works well with automated workflows
{feature-sequence}-{feature-name}
001-initial-setup
002-state-management
003-config-system
{pr-number}-{feature-name}
007-state-management
008-config-system
009-provider-interface
For existing branches:
- Keep the old name (001-initial-setup is fine if already merged)
- No need to rename merged branches
For new branches:
- Use PR-number-based naming starting now
- First new branch will be
007-{feature-name}
If a PR fails and needs to be reopened:
# First attempt (failed)
git checkout -b 007-state-management
gh pr create # Creates PR #7
# PR closed without merge
# Second attempt
git checkout -b 008-state-management # New PR number
gh pr create # Creates PR #8
# PR merged successfullySpec references both:
**Feature ID**: 002-state-management
**Branches**:
- `007-state-management` (PR #7 - closed)
- `008-state-management` (PR #8 - merged)For urgent fixes outside the feature process:
# Check next PR number (e.g., #15)
git checkout -b 015-hotfix-security-issue
# Still follows same conventionFor experiments that may not result in PR:
# Use `exp/` prefix
git checkout -b exp/try-new-library
# When ready to PR, rename to PR-number format
git branch -m 016-new-library-integrationCreate a helper script to automate branch creation:
#!/bin/bash
# scripts/new-branch.sh
# Check if gh is installed
if ! command -v gh &> /dev/null
then
echo "GitHub CLI (gh) could not be found. Please install it to use this script."
exit
fi
# Get next PR number
NEXT_PR=$(gh pr list --state all --json number --jq 'max_by(.number).number + 1')
# Prompt for feature name
read -p "Feature name (kebab-case): " FEATURE_NAME
# Create branch
BRANCH_NAME="${NEXT_PR}-${FEATURE_NAME}"
git checkout -b "$BRANCH_NAME"
echo "✅ Created branch: $BRANCH_NAME"
echo "Next: Create specs directory and start implementation"Usage:
./scripts/new-branch.sh
# Feature name (kebab-case): state-management
# ✅ Created branch: 007-state-management# Step 1: Check next PR number
gh pr list --state all --limit 5
# Last PR was #6
# Step 2: Create branch
git checkout -b 007-state-management
# Step 3: Create spec directory
mkdir -p specs/002-state-management
# Step 4: Implement feature
# ... work ...
# Step 5: Create PR
gh pr create --title "002: State Management"
# PR #7 created
# Step 6: Update spec
# Edit specs/002-state-management/spec.md:
# **Branch**: `007-state-management`
# **PR**: #7# Assuming PR #7 was merged
# Step 1: Check next PR number
gh pr list --state all --limit 5
# Last PR was #7
# Step 2: Create branch
git checkout -b 008-config-system
# Step 3: Create spec directory
mkdir -p specs/003-config-system
# ... continue workflow ...# Check next PR number
gh pr list --state all --json number --jq 'max_by(.number).number + 1'
# Create new branch (replace XXX and feature-name)
git checkout -b XXX-feature-name
# View PR by number
gh pr view 007
# List all branches with PR pattern
git branch -a | grep -E '^[0-9]{3}-'Convention Owner: @arc-framework/maintainers Last Updated: 2025-12-27 Next Review: 2025-03-20