Skip to main content
skill CX Codex

pull-main — Claude Code skill: what it does, how to install

Switches to the main branch, pulls latest changes with pruning, and summarizes updates. Useful for keeping local repositories in sync before new work.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dyoshikawa/rulesync --skill pull-main -a claude-code
Open on GitHub

What pull-main does

This skill streamlines standard branch maintenance. The agent starts by running git branch --show-current to check your location. If you work on another branch, it runs git switch main to move you back to the base branch.

Next, it executes git pull --prune against origin/main. This retrieves new commits while clearing out deleted remote branch references in one step. Once finished, the skill reports whether a branch switch happened, how many commits arrived, and which stale refs were pruned.

If your repository still uses master as its primary branch, git switch main will fail immediately.

What it helps with

  • switch directly to main and pull updates from remote
  • clean up deleted remote-tracking references with git pull --prune
  • review a concise summary of pulled commits and pruned branches

Example prompts for the agent

  • Pull the latest main
  • Sync main with remote
  • Update main and prune remote branches

How to install pull-main

1Skills CLI (Vercel)

npx skills add dyoshikawa/rulesync --skill pull-main -a claude-code

2Manually: put the files in place

~/.claude/skills/pull-main/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pull-main/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about pull-main

How to install pull-main in Claude Code?

Run npx skills add dyoshikawa/rulesync --skill pull-main -a claude-code in your terminal. This creates the skill file at ~/.claude/skills/pull-main/SKILL.md.

What does pull-main do?

It inspects your active branch, switches to main, executes git pull --prune, and outputs a summary of fast-forward or merge updates.

What happens if the repository defaults to master instead of main?

The workflow specifically calls git switch main. If no branch named main exists locally, Git raises an error and stops the sequence.

Source text

SKILL.md · MIT
---
name: pull-main
description: >-
  Switch to main branch and pull latest changes with prune. Use when the user
  wants to pull latest main, update main, or sync main with remote.
targets:
  - "*"
---

# Pull Main

Switch to the `main` branch and pull the latest changes from `origin/main` while pruning stale remote-tracking references.

## Step 1: Inspect Current State

Check the current branch:

```bash
git branch --show-current
```

If already on `main`, note it for the final report.

## Step 2: Switch to Main

Switch to the `main` branch:

```bash
git switch main
```

## Step 3: Pull with Prune

Pull the latest changes from `origin/main` with `--prune` to remove stale remote-tracking branches:

```bash
git pull --prune
```

## Step 4: Report Result

Summarize the operation:

- Whether a branch switch occurred
- Number of commits pulled (fast-forward or merge)
- Any stale remote-tracking branches that were pruned

© dyoshikawa · MIT · dyoshikawa/rulesync

Similar skills

All skills for Git and GitHub →

From the same set36

resolve-scrap-issues This skill walks the newest GitHub issues labeled maintainer-scrap, validates each one, then either closes it or opens a single pull request that fixes the rest. CX Codex +1 ★ 1,557repo stars research-tool-updates Audits upstream releases of supported AI coding assistants, detects gaps in rulesync feature coverage, and scouts new tools with file configs. CX Codex +1 ★ 1,557repo stars release-dry-run This skill reviews changes since the latest release tag and recommends a MAJOR, MINOR, or PATCH bump. Use it to assess a release before changing the version. CX Codex +1 ★ 1,557repo stars rebase-latest-main A skill that walks the agent through fetching origin/main, rebasing the current branch and resolving conflicts. Handy when your branch has drifted behind main. CX Codex +1 ★ 1,557repo stars prs-awaiting-maintainer Finds open pull requests with passing checks that are waiting on a maintainer. Use it to list PRs ready for review, another review, or a merge decision. CX Codex +1 ★ 1,557repo stars prs-awaiting-author Lists open pull requests where the next move belongs to the author: failing CI, unaddressed review comments, or a maintainer question waiting on a reply. CX Codex +1 ★ 1,557repo stars post-issue-comment This skill reads a GitHub issue, drafts a concise English reply, and posts it. Use it when the response needs to reflect the existing discussion. CX Codex +1 ★ 1,557repo stars porting-another-repository Reads a feature in your current repo and the target repo's conventions, then writes a porting plan into tmp/ as files you apply yourself. CX Codex +1 ★ 1,557repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor