Claude-skill-registry github-workflow-best-practices
Master GitHub workflows including branching strategies, commit standards, PR processes, issue triage, sprint management, and git worktree usage. Activate when planning GitHub workflows, managing sprints, or establishing team conventions.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/github-workflow-best-practices" ~/.claude/skills/majiayu000-claude-skill-registry-github-workflow-best-practices && rm -rf "$T"
skills/data/github-workflow-best-practices/SKILL.mdGitHub Workflow Best Practices
Master professional GitHub workflows that scale from solo projects to large teams. This skill covers branching strategies, commit conventions, PR processes, issue management, sprint execution, and advanced git worktree patterns.
Branching Strategy
Branch Naming Conventions
Follow a consistent naming pattern that communicates intent:
<type>/<issue-number>-<brief-description> Examples: feature/123-user-authentication bugfix/456-login-redirect hotfix/789-security-patch chore/update-dependencies docs/api-documentation
Branch Types:
- New functionalityfeature/
- Bug fixesbugfix/
- Urgent production fixeshotfix/
- Maintenance tasks (dependencies, config)chore/
- Documentation updatesdocs/
- Code refactoring without behavior changerefactor/
- Test additions or updatestest/
Branch Lifecycle
Main Branches:
(ormain
) - Production-ready codemaster
- Integration branch for features (optional)develop
Feature Branch Flow:
1. Create branch from main 2. Develop and commit 3. Push to remote 4. Create PR 5. Code review 6. Merge to main 7. Delete branch 8. Clean up local/remote
Protection Rules:
- Require PR reviews before merge
- Require status checks to pass
- Require branches to be up to date
- Restrict force pushes
- Restrict deletions
See Branching Strategy Details for advanced patterns.
Commit Message Standards
Conventional Commits Format
Use the conventional commits specification for clarity and automation:
<type>(<scope>): <subject> <body> <footer>
Example:
feat(auth): add OAuth2 integration Implement OAuth2 authentication flow with Google and GitHub providers. Includes token refresh logic and session management. Closes #123
Commit Types
| Type | Description | Example |
|---|---|---|
| New feature | |
| Bug fix | |
| Documentation | |
| Formatting, no code change | |
| Code restructure | |
| Performance improvement | |
| Test additions/updates | |
| Maintenance | |
| CI/CD changes | |
| Build system changes | |
Commit Best Practices
Good Commits:
- ✅ Atomic (one logical change)
- ✅ Clear subject (< 50 chars)
- ✅ Imperative mood ("add feature" not "added feature")
- ✅ Detailed body when needed
- ✅ Reference issues/PRs
Bad Commits:
- ❌ "fix stuff"
- ❌ "WIP"
- ❌ Multiple unrelated changes
- ❌ Missing context
See Commit Message Examples for good patterns.
Pull Request Workflow
PR Creation
Before Creating PR:
- Ensure branch is up to date with main
- Run tests locally
- Run linter/formatter
- Review your own changes
- Write descriptive title and description
PR Title Format:
<type>(<scope>): <brief description> Examples: feat(auth): implement 2FA authentication fix(api): resolve rate limiting issue docs(contributing): add PR guidelines
PR Description Template:
## Summary Brief description of what this PR does. ## Changes - Change 1 - Change 2 - Change 3 ## Testing - [ ] Unit tests pass - [ ] Integration tests pass - [ ] Manual testing completed ## Screenshots (if applicable) [Include screenshots for UI changes] ## Related Issues Closes #123 Relates to #456 ## Checklist - [ ] Code follows style guidelines - [ ] Self-review completed - [ ] Documentation updated - [ ] Tests added/updated
PR Review Process
As Author:
- Respond to all comments
- Make requested changes
- Re-request review after updates
- Resolve conversations when addressed
- Keep PR updated with main
As Reviewer:
- Review within 24 hours
- Check code quality, security, performance
- Ask questions for clarity
- Suggest improvements
- Approve when ready or request changes
Review Levels:
- 💬 Comment: Suggestion, not blocking
- 🔄 Request Changes: Must be addressed
- ✅ Approve: Ready to merge
See PR Workflow Details for comprehensive process.
Issue Triage Workflow
Issue Labels
Status Labels:
- Needs triagestatus: new
- Confirmed and prioritizedstatus: accepted
- Being worked onstatus: in-progress
- Cannot proceedstatus: blocked
- Deferredstatus: on-hold
Type Labels:
- Something brokentype: bug
- New functionalitytype: feature
- Improvement to existing featuretype: enhancement
- Docs updatetype: documentation
- Support requesttype: question
Priority Labels:
- Production down, security issuepriority: critical
- Major functionality brokenpriority: high
- Normal prioritypriority: medium
- Nice to havepriority: low
Size Labels:
- < 1 hoursize: XS
- 1-4 hourssize: S
- 1 daysize: M
- 2-3 dayssize: L
- 1+ weeksize: XL
Triage Process
Daily Triage (5-10 minutes):
- Review new issues
- Validate bug reports
- Add labels (type, priority, size)
- Assign to milestone/sprint
- Close duplicates
- Convert questions to discussions
Weekly Review (30 minutes):
- Review blocked/on-hold issues
- Update stale issues
- Close resolved issues
- Reprioritize backlog
Sprint Planning & Execution
Sprint Planning
Pre-Sprint Preparation:
- Groom backlog
- Estimate issues (size labels)
- Identify dependencies
- Check team capacity
Sprint Planning Meeting:
- Review sprint goal
- Select high-priority issues
- Break down large issues
- Assign issues to team members
- Confirm commitment
Sprint Artifacts:
- Sprint board (GitHub Projects)
- Sprint milestone
- Sprint goal documentation
Sprint Execution
Daily Standup Questions:
- What did I complete yesterday?
- What will I work on today?
- Any blockers?
Sprint Board Columns:
To Do → In Progress → In Review → Done
Mid-Sprint Adjustments:
- Add urgent issues (swap out equal size)
- Remove blocked issues
- Rebalance workload
End-of-Sprint Activities:
- Demo completed work
- Retrospective (what went well, what to improve)
- Close sprint milestone
- Archive sprint board
- Plan next sprint
Sprint Automation with GitHub CLI
Fetch Sprint Issues:
gh issue list --milestone "Sprint 23" --json number,title,labels
Bulk Update:
gh issue edit 123 --add-label "status: in-progress"
Create Sprint Report:
gh issue list --milestone "Sprint 23" --state closed --json number,title,closedAt
Git Worktree Patterns
When to Use Worktrees
Use Worktrees For:
- Working on multiple branches simultaneously
- Code review while preserving current work
- Parallel bug fix while developing feature
- Running different branches side-by-side
Advantages:
- No stashing required
- No branch switching
- Multiple dev servers running
- Compare branches easily
Worktree Commands
Create Worktree:
# Create worktree for existing branch git worktree add ../project-feature-123 feature/123-user-auth # Create worktree with new branch git worktree add -b feature/456-new-feature ../project-feature-456
List Worktrees:
git worktree list
Remove Worktree:
# Remove worktree directory rm -rf ../project-feature-123 # Prune reference git worktree prune
Worktree Organization
Directory Structure:
~/projects/ myapp/ # Main worktree myapp-feature-123/ # Feature branch worktree myapp-bugfix-456/ # Bugfix branch worktree myapp-review-789/ # Review worktree
Naming Convention:
<project>-<branch-type>-<issue-number> Examples: myapp-feature-123 myapp-bugfix-456 myapp-hotfix-789
Worktree Workflows
Parallel Development:
# Main feature development cd ~/projects/myapp-feature-123 npm run dev # Switch to review PR cd ~/projects/myapp-review-456 git pull origin feature/456-other-feature npm run dev -- --port 3001
Quick Bug Fix During Feature Work:
# Continue feature work in main worktree # Create worktree for urgent bug fix git worktree add ../myapp-hotfix-789 -b hotfix/789-critical-bug cd ../myapp-hotfix-789 # Fix bug, commit, push, create PR # Return to feature work without disruption
Agency Plugin Integration
Create Worktree for Issue:
/gh-worktree-issue 123
This command:
- Creates worktree directory
- Creates/checks out branch
- Sets up tracking
- Opens in new window (optional)
GitHub CLI Integration
Essential gh Commands
Issues:
# List issues gh issue list --assignee @me --state open # View issue gh issue view 123 # Create issue gh issue create --title "Bug: Login fails" --body "Description" # Update issue gh issue edit 123 --add-label "priority: high"
Pull Requests:
# Create PR gh pr create --title "feat: add feature" --body "Description" # List PRs gh pr list --author @me # View PR gh pr view 456 # Review PR gh pr review 456 --approve # Merge PR gh pr merge 456 --squash
Workflows:
# List workflows gh workflow list # View workflow runs gh run list --workflow=test.yml # View run logs gh run view 123456
Automation Scripts
Daily Issue Check:
#!/bin/bash echo "🎯 Your assigned issues:" gh issue list --assignee @me --state open echo "\n📝 PRs awaiting your review:" gh pr list --search "review-requested:@me"
Sprint Progress:
#!/bin/bash MILESTONE="Sprint 23" TOTAL=$(gh issue list --milestone "$MILESTONE" --json number | jq length) DONE=$(gh issue list --milestone "$MILESTONE" --state closed --json number | jq length) echo "Sprint Progress: $DONE / $TOTAL completed"
Best Practices Summary
Branching:
- Use descriptive branch names with issue numbers
- Keep branches short-lived (< 1 week)
- Delete merged branches
- Protect main branch
Commits:
- Follow conventional commits format
- Write clear, atomic commits
- Reference issues in commit messages
- Use imperative mood
Pull Requests:
- Keep PRs small and focused
- Write descriptive titles and descriptions
- Respond to reviews promptly
- Keep PRs up to date with main
Issues:
- Triage daily
- Use consistent labels
- Keep issues updated
- Close resolved issues
Sprints:
- Plan thoroughly
- Track progress daily
- Adjust as needed
- Retrospect and improve
Worktrees:
- Use for parallel work
- Organize with naming convention
- Clean up after merging
- Leverage for reviews
Quick Reference
Branch:
<type>/<number>-<description>
Commit: <type>(<scope>): <subject>
PR Title: Same as commit format
Issue Labels: type:, priority:, status:, size:
Worktree: git worktree add <path> <branch>
Related Skills
- Orchestrator and multi-agent workflowsagency-workflow-patterns
- What to look for in reviewscode-review-standards
- Test requirements and standardstesting-strategy
Remember: Consistency in workflows reduces cognitive load and enables automation. Choose conventions that work for your team and stick to them.