.claude/skills/github/SKILL.md
GitHub workflow patterns for branch management, commits, and pull requests. Covers gitflow, branch naming conventions, commit messages, and PR creation. Use this skill for any Git/GitHub operations following project conventions.
npx skillsauth add NextSpark-js/nextspark githubInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Git and GitHub workflow patterns with configurable conventions.
┌─────────────────────────────────────────────────────────────────┐
│ GITHUB WORKFLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Claude │────►│ github.json │────►│ gh CLI │ │
│ │ Session │ │ (config) │ │ (commands) │ │
│ └─────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Task │ │ Gitflow │ │ GitHub │ │
│ │ Manager │◄───►│ Branches │────►│ Remote │ │
│ │ (ClickUp) │ │ │ │ │ │
│ └─────────────┘ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
| File | Purpose |
|------|---------|
| .claude/config/github.json | Git workflow, branches, commits, PRs |
| .claude/config/team.json | Team members, roles, permissions |
| .claude/config/workspace.json | Task manager integration |
The issue key format comes from the task manager configured in .claude/config/workspace.json:
// Read task manager provider
const workspace = await Read('.claude/config/workspace.json')
const provider = workspace.taskManager.provider // "clickup", "jira", etc.
// Issue key formats by provider:
// - ClickUp: "CU-abc123" or task ID
// - Jira: "PROJECT-123"
// - GitHub Issues: "#123"
feature/* ──► develop ──► qa ──► main
│
hotfix/* ─────┴─────────────────► main
| Branch | Purpose | Protected By |
|--------|---------|--------------|
| main | Production | qa |
| qa | QA/Staging | develop |
| develop | Integration | feature branches |
{
"gitflow": {
"environments": ["develop", "qa", "main"],
"featureBranch": {
"baseBranch": "main",
"targetBranch": "develop"
},
"hotfixBranch": {
"baseBranch": "main",
"targetBranch": "main",
"skipEnvironments": true
},
"promotionFlow": {
"develop": "qa",
"qa": "main"
}
}
}
Step 1: Read Configuration
const github = await Read('.claude/config/github.json')
const team = await Read('.claude/config/team.json')
// Resolve active user: git config → CLAUDE_USER env → single-member auto
const gitName = exec('git config user.name')
const gitEmail = exec('git config user.email')
let activeUser = team.members.find(m => m.name === gitName || m.email === gitEmail)
if (!activeUser) {
const envUser = process.env.CLAUDE_USER
if (envUser) activeUser = team.members.find(m => m.name === envUser)
}
if (!activeUser && team.members.length === 1) activeUser = team.members[0]
const initials = activeUser.initials // "pc"
const branchType = "feature" // or "bugfix", "hotfix", "chore"
const typeConfig = github.branches.types[branchType]
const baseBranch = typeConfig.base // "main"
Step 2: Get Issue Key
// From active session or ask user
const issueKey = session.taskId || await AskUser("Issue key?")
Step 3: Build Branch Name
Pattern: {type}/{issue-key}-{description}-{initials}
# Example
git checkout main
git pull origin main
git checkout -b feature/CU-abc123-add-user-auth-pc
| Component | Required | Example |
|-----------|----------|---------|
| Type | Yes | feature, bugfix, hotfix, chore |
| Issue Key | Yes* | CU-abc123, PROJ-456 |
| Description | Yes | add-user-auth (max 4-5 words, hyphens) |
| Initials | Yes | pc (from team config) |
*If commits.requireIssueKey is false, can be omitted.
feature/CU-abc123-add-user-authentication-pc
bugfix/CU-def456-fix-login-validation-jd
hotfix/CU-ghi789-critical-security-patch-pc
chore/CU-jkl012-update-dependencies-jd
feature/add-auth # Missing issue key and initials
CU-abc123-new-feature # Missing type prefix
feature/CU-abc123_add_auth_pc # Underscores instead of hyphens
Pattern: [{issue-key}] {description}
Step 1: Stage Changes
git add .
# Or specific files
git add src/components/Login.tsx
Step 2: Create Commit
git commit -m "[CU-abc123] Add user authentication form"
| Prefix | Use When | |--------|----------| | Add | New feature or file | | Fix | Bug fix | | Update | Modifying existing functionality | | Refactor | Code restructuring without behavior change | | Remove | Deleting code or features | | Improve | Performance or UX enhancements | | Implement | Completing a feature |
[CU-abc123] Add login form validation
[CU-abc123] Fix password reset flow
[CU-abc123] Update user profile API endpoint
[CU-abc123] Refactor authentication middleware
IMPORTANT: Commits should be LOCAL ONLY unless user explicitly requests push.
# Local commit (default)
git commit -m "[CU-abc123] Add feature"
# Push only when requested
git push origin feature/CU-abc123-add-feature-pc
Step 1: Push Branch
git push -u origin feature/CU-abc123-add-user-auth-pc
Step 2: Select Reviewer
// Read team from config
const team = await Read('.claude/config/team.json')
const reviewers = team.members.filter(m => m.permissions.canReview)
// Present options to user
const reviewer = await AskUser({
question: "Who should review this PR?",
options: reviewers.map(m => ({ label: m.name, value: m.ids.github }))
})
Step 3: Create PR
gh pr create \
--title "[CU-abc123] Add user authentication" \
--body "## Description
Add user authentication form with validation.
## Changes
- Add LoginForm component
- Add validation schema
- Add auth API endpoint
## Testing
- [ ] Test valid login
- [ ] Test invalid credentials
- [ ] Test password reset
## Related Issues
- CU-abc123" \
--base develop \
--reviewer "capellopablo"
Step 4: Share PR Link
PR_URL=$(gh pr view --json url -q .url)
echo "Pull Request created: $PR_URL"
Pattern: [{issue-key}] {description}
| Valid | Invalid |
|-------|---------|
| [CU-abc123] Add user auth | CU-abc123 - Add auth |
| [PROJ-456] Fix login bug | [proj-456] fix login |
| Branch Type | Base Branch | |-------------|-------------| | feature/* | develop | | bugfix/* | develop | | hotfix/* | main | | chore/* | develop |
develop ──► qa ──► main
Step 1: Create Promotion PR
# From develop to qa
gh pr create \
--title "Promote develop to qa" \
--body "Environment promotion" \
--base qa \
--head develop
# From qa to main
gh pr create \
--title "Promote qa to main" \
--body "Environment promotion" \
--base main \
--head qa
Step 2: Merge After Approval
gh pr merge --squash
# List branches
git branch -a
# Switch branch
git checkout develop
# Delete local branch
git branch -d feature/CU-abc123-old-feature-pc
# Delete remote branch
git push origin --delete feature/CU-abc123-old-feature-pc
# Check PR status
gh pr status
# View PR details
gh pr view
# Add reviewers
gh pr edit --add-reviewer "username1,username2"
# Merge PR
gh pr merge --squash
# Close PR without merging
gh pr close
# View recent commits
git log --oneline -10
# Amend last commit (only if not pushed)
git commit --amend -m "[CU-abc123] Updated message"
# Undo last commit (keep changes)
git reset --soft HEAD~1
┌─────────────────────────────────────────────────────────────────┐
│ WHAT DO YOU NEED TO DO? │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Start new work? │
│ └─► Create branch from main │
│ └─► git checkout -b {type}/{issue}-{desc}-{initials} │
│ │
│ Save progress? │
│ └─► Commit locally │
│ └─► git commit -m "[{issue}] {description}" │
│ │
│ Ready for review? │
│ └─► Push & create PR │
│ └─► git push -u origin {branch} │
│ └─► gh pr create --base develop │
│ │
│ Urgent fix needed? │
│ └─► Create hotfix branch from main │
│ └─► git checkout -b hotfix/{issue}-{desc}-{initials} │
│ └─► PR directly to main │
│ │
│ Promote to next env? │
│ └─► Create promotion PR │
│ └─► gh pr create --base {next-env} --head {current-env} │
│ │
└─────────────────────────────────────────────────────────────────┘
git checkout main && git pull[{issue}] {description}development
Zod validation patterns for this Next.js application. Covers schema definition, API validation, form integration, error formatting, and type inference. Use this skill when implementing validation for APIs, forms, or entity schemas.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
testing
Test coverage metrics and registry system for this Next.js application. Covers FEATURE_REGISTRY, FLOW_REGISTRY, TAGS_REGISTRY, and coverage metrics interpretation. Use this skill when evaluating test coverage, identifying gaps, or planning testing priorities.
development
TanStack Query (React Query) patterns for data fetching in this Next.js application. Covers useQuery, useMutation, optimistic updates, cache invalidation, and anti-patterns. Use this skill when implementing data fetching or state management with server data.