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.
npx skills add dyoshikawa/rulesync --skill pull-main -a claude-codeWhat 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
mainand 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-code2Manually: put the files in place
~/.claude/skills/pull-main/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pull-main/
1Skills CLI (Vercel)
npx skills add dyoshikawa/rulesync --skill pull-main -a codex2Manually: put the files in place
.agents/skills/pull-main/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dyoshikawa/rulesync --skill pull-main -a cursor2Manually: put the files in place
.cursor/skills/pull-main/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dyoshikawa/rulesync pull-main2Manually: put the files in place
.github/skills/pull-main/SKILL.md1Skills CLI (Vercel)
npx skills add dyoshikawa/rulesync --skill pull-main -a gemini-cli2Platform CLI
gemini skills install https://github.com/dyoshikawa/rulesync --path .rulesync/skills/pull-mainManually: put the files in place
.devin/skills/pull-main/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dyoshikawa/rulesync --skill pull-main -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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