git-workflow

Git operations and pull request workflows. Create PRs, rebase branches, resolve conflicts, merge to upstream. Use when ready to create PR or when working with git branches and upstream.

9 stars

Best use case

git-workflow is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Git operations and pull request workflows. Create PRs, rebase branches, resolve conflicts, merge to upstream. Use when ready to create PR or when working with git branches and upstream.

Teams using git-workflow should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/git-workflow/SKILL.md --create-dirs "https://raw.githubusercontent.com/jkomoros/community-patterns/main/.claude/skills/git-workflow/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/git-workflow/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How git-workflow Compares

Feature / Agentgit-workflowStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Git operations and pull request workflows. Create PRs, rebase branches, resolve conflicts, merge to upstream. Use when ready to create PR or when working with git branches and upstream.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Git Workflow

## Committing Work

```bash
cd ~/Code/community-patterns

git add patterns/$GITHUB_USER/pattern.tsx
git commit -m "Add pattern: description"
git push origin main
```

## Getting Updates (Already done in Step 1)

```bash
git fetch upstream
git pull --rebase upstream main
git push origin main
```

## Sharing Work Upstream (Creating Pull Requests)

**IMPORTANT: Wait for user to tell you to create a PR.** Don't push or create
PRs automatically.

**Before creating any PR, you MUST update from main and rebase your branch:**

### Step 0: Update and Rebase Before Creating PR

**Use cached repository type from workspace config:**

```bash
# Read IS_FORK from .claude-workspace (set during Step 2)
IS_FORK=$(grep "^is_fork=" .claude-workspace | cut -d= -f2)

# Determine which remote to use
if [ "$IS_FORK" = "true" ]; then
  echo "Working on fork - will fetch from upstream"
  MAIN_REMOTE="upstream"
else
  echo "Working on main repo - will fetch from origin"
  MAIN_REMOTE="origin"
fi
```

**Then fetch latest main and rebase your branch:**

```bash
# Fetch latest main
git fetch $MAIN_REMOTE

# Rebase current branch on top of main
git rebase $MAIN_REMOTE/main

# If rebase succeeds, push (force-with-lease if on feature branch)
if [ "$(git branch --show-current)" != "main" ]; then
  git push origin $(git branch --show-current) --force-with-lease
else
  git push origin main
fi
```

**If rebase has conflicts:**

1. Show conflict files: `git status`
2. Help resolve conflicts
3. Continue: `git rebase --continue`
4. Then push

**Why this matters:**

- Ensures your PR is based on the latest main
- Avoids merge conflicts during PR review
- Makes PR review easier

---

### If User Has Their Own Fork (Most Common)

When user wants to contribute patterns from their fork to upstream:

**Step 1: Ensure changes are committed and pushed to their fork**

```bash
cd ~/Code/community-patterns
git status  # Verify all changes are committed
git push origin main
```

**Step 2: Update and rebase (see Step 0 above)**

**Step 3: Create pull request to upstream**

```bash
gh pr create \
  --repo jkomoros/community-patterns \
  --title "Add: pattern name" \
  --body "$(cat <<'EOF'
## Summary
- Brief description of the pattern
- Key features
- Use cases

## Testing
- [x] Pattern compiles without errors
- [x] Tested in browser at http://localhost:8000
- [x] All features working as expected

🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
```

### If Working Directly on jkomoros/community-patterns

**CRITICAL: When working directly on the upstream repository, you MUST use
branches and PRs. Direct pushes to main are NOT allowed.**

**Step 1: Create feature branch**

```bash
cd ~/Code/community-patterns
git checkout -b username/feature-name
```

**Step 2: Commit and push branch**

```bash
git add patterns/$GITHUB_USER/
git commit -m "Add: pattern name"
git push origin username/feature-name
```

**Step 3: Update and rebase (see Step 0 above)**

**Step 4: Create pull request**

```bash
gh pr create \
  --title "Add: pattern name" \
  --body "$(cat <<'EOF'
## Summary
- Brief description

## Testing
- [x] Tested and working

🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
```

**Step 5: Merge with rebase (when approved)**

```bash
gh pr merge PR_NUMBER --rebase --delete-branch
```

### Important Notes

- **Always wait for user permission** before creating PRs
- **All PRs are merged with `--rebase`** (NOT `--squash` or `--merge`)
- This preserves individual commit history
- Commit frequently locally, but only create PR when user asks
- PRs will be reviewed before merging to upstream
- After merge, everyone gets your patterns automatically on next update

Related Skills

testing

9
from jkomoros/community-patterns

Test patterns with Playwright browser automation. Navigate to deployed patterns, interact with UI elements, verify functionality. Use when testing patterns after deployment or when debugging pattern behavior in browser.

Superstition Verification Skill

9
from jkomoros/community-patterns

Use this skill to systematically verify superstitions in

strategic-investigation

9
from jkomoros/community-patterns

Proactive recovery using plan mode and subagents. After 1-2 failed attempts, STOP trying variations. Enter plan mode and launch parallel Explore/Plan agents to find idiomatic solutions instead of spinning wheels.

session-startup

9
from jkomoros/community-patterns

Session initialization sequence for community-patterns development. Use at the start of every Claude Code session. Checks for upstream updates, loads workspace configuration, and ensures dev servers are running.

recovery-strategies

9
from jkomoros/community-patterns

Escalation path when stuck on pattern development. Use when encountering TypeScript errors, framework confusion, unexpected behavior, or blocked progress. Five-step recovery: check docs, study examples, strategic investigation (plan mode + subagents), reset and retry, ask user.

pattern-dev

9
from jkomoros/community-patterns

Day-to-day pattern development best practices. Use when actively developing patterns. Covers incremental development, commits, communication guidelines, and general development workflow.

land-branch

9
from jkomoros/community-patterns

Land a feature branch: pull from main, rebase the branch, create a PR, and merge it via rebase with automatic branch deletion. Use when ready to land a completed feature branch.

issue-filing

9
from jkomoros/community-patterns

File framework issues after exhausting other approaches. Document complex problems with multiple failed attempts for framework authors. REQUIRES user permission. Use only after checking docs, community-docs, and trying multiple approaches.

deployment

9
from jkomoros/community-patterns

Deploy and update patterns. Use when deploying new patterns, updating existing deployments, or testing syntax. Includes deployment commands and the first custom pattern celebration.

community-docs

9
from jkomoros/community-patterns

Community superstitions - unverified observations from pattern development. Use when encountering undocumented edge cases or framework quirks not in official docs. Verified knowledge should be upstreamed to labs docs.

claude-permissions-update

9
from jkomoros/community-patterns

Sync auto-approved permissions from all community-patterns directories (including community-patterns-2, -3, etc.) to the shared project settings. Shows new permissions for review before adding.

securing-github-actions-workflows

16
from plurigrid/asi

This skill covers hardening GitHub Actions workflows against supply chain attacks, credential theft, and privilege escalation. It addresses pinning actions to SHA digests, minimizing GITHUB_TOKEN permissions, protecting secrets from exfiltration, preventing script injection in workflow expressions, and implementing required reviewers for workflow changes.