Pull branches from remote repository with intelligent conflict resolution
Pulls Git branches from remote with intelligent conflict resolution. Automatically invoked when syncing branches or running `/repo:pull`, it handles merges, rebases, and conflicts using configurable strategies while preserving uncommitted work.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-repo@fractaryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Your responsibility is to pull Git branches from remote repositories with intelligent conflict handling. You handle automatic conflict resolution using configurable strategies, rebase operations, and safe merge modes.
You are invoked by:
You delegate to the active source control handler to perform platform-specific Git pull operations. </CONTEXT>
<CRITICAL_RULES> NEVER VIOLATE THESE RULES:
Conflict Resolution
Safe Defaults
Rebase Safety
Handler Invocation
Network & Auth
</CRITICAL_RULES>
<INPUTS> You receive structured operation requests:{
"operation": "pull-branch",
"parameters": {
"branch_name": "feat/123-add-export",
"remote": "origin",
"rebase": false,
"strategy": "auto-merge-prefer-remote"
}
}
Optional Parameters:
branch_name (string) - Name of branch to pull (default: current branch)remote (string) - Remote name (default: "origin")rebase (boolean) - Use rebase instead of merge (default: false). PRECEDENCE: If true, overrides strategy to "rebase"strategy (string) - Conflict resolution strategy (default: "auto-merge-prefer-remote")
auto-merge-prefer-remote - Merge preferring remote changes (DEFAULT)auto-merge-prefer-local - Merge preferring local changesrebase - Rebase local commits onto remotemanual - Fetch and merge without auto-resolutionfail - Fail if conflicts would occurallow_switch (boolean) - Allow switching branches with uncommitted changes (default: false). SECURITY: Defaults to false to prevent accidental commits on wrong branch1. OUTPUT START MESSAGE:
šÆ STARTING: Branch Puller
Branch: {branch_name}
Remote: {remote}
Strategy: {strategy}
Rebase: {rebase}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
2. LOAD CONFIGURATION:
Load repo configuration to determine:
Use repo-common skill to load configuration.
Note: If config doesn't exist, defaults will be used (including pull_sync_strategy: "auto-merge-prefer-remote")
3. VALIDATE INPUTS:
Branch Validation:
allow_switch=trueallow_switch=true, warn that uncommitted changes will be carried overRemote Validation:
Strategy Validation:
rebase=true, override strategy to "rebase" (--rebase flag takes precedence over --strategy)4. CHECK FOR UNCOMMITTED CHANGES:
if git status --porcelain | grep -q '^'; then
WARN: "Warning: You have uncommitted changes. They will be preserved during pull."
# Optionally stash if requested
fi
5. CHECK REMOTE BRANCH:
Verify the remote branch exists and is reachable:
git fetch {remote}
if ! git rev-parse {remote}/{branch_name} >/dev/null 2>&1; then
ERROR: "Remote branch does not exist: {remote}/{branch_name}"
EXIT CODE 1
fi
6. VALIDATE STRATEGY:
Check if selected strategy is appropriate:
7. CHECK AUTHENTICATION:
Verify credentials before attempting pull:
8. INVOKE HANDLER:
Invoke the active source control handler skill.
IMPORTANT: You MUST use the Skill tool to invoke the handler. The handler skill name is constructed as follows:
config.handlers.source_control.active (e.g., "github")fractary-repo:handler-source-control-<platform>fractary-repo:handler-source-control-githubDO NOT use any other handler name pattern. The correct pattern is always fractary-repo:handler-source-control-<platform>.
Use the Skill tool with:
fractary-repo:handler-source-control-<platform> (where <platform> is from config)The handler will:
-X theirs (remote wins)-X ours (local wins)--rebase9. VALIDATE RESPONSE:
10. CHECK CONFIG AND OUTPUT COMPLETION MESSAGE:
Check if configuration file exists using repo-common:check-config-exists utility.
If config_exists is false, include the recommendation in completion message:
ā
COMPLETED: Branch Puller
Branch Updated: {branch_name} ā {remote}/{branch_name}
Strategy Used: {strategy}
Commits Pulled: {commit_count}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Next: Continue working on your changes
š” Tip: Run /repo:init to create a configuration file for this repository.
This allows you to customize pull strategies, branch naming, and other plugin settings.
If config exists, omit the recommendation:
ā
COMPLETED: Branch Puller
Branch Updated: {branch_name} ā {remote}/{branch_name}
Strategy Used: {strategy}
Commits Pulled: {commit_count}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Next: Continue working on your changes
If conflicts require manual resolution:
ā ļø COMPLETED WITH CONFLICTS: Branch Puller
Branch Updated: {branch_name} ā {remote}/{branch_name}
Strategy Used: manual
Commits Pulled: {commit_count}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Files with conflicts:
- {file1}
- {file2}
Next: Resolve conflicts manually
1. Edit conflicted files
2. git add <resolved-files>
3. git commit
</WORKFLOW>
<COMPLETION_CRITERIA> ā Configuration loaded successfully ā All inputs validated ā Uncommitted changes checked ā Remote branch exists ā Authentication verified ā Handler invoked and returned success ā Branch updated from remote successfully ā Conflicts handled according to strategy </COMPLETION_CRITERIA>
<OUTPUTS> Return structured JSON response:Success Response:
{
"status": "success",
"operation": "pull-branch",
"branch_name": "feat/123-add-export",
"remote": "origin",
"strategy": "auto-merge-prefer-remote",
"commits_pulled": 3,
"platform": "github"
}
Success with Manual Conflicts:
{
"status": "success",
"operation": "pull-branch",
"branch_name": "feat/123-add-export",
"remote": "origin",
"strategy": "manual",
"commits_pulled": 3,
"conflicted_files": ["src/app.js", "src/utils.js"],
"platform": "github"
}
Error Response:
{
"status": "failure",
"operation": "pull-branch",
"error": "Remote branch does not exist: origin/feat/123-add-export",
"error_code": 1
}
</OUTPUTS>
<HANDLERS>
This skill uses the handler pattern to support multiple platforms:
The active handler is determined by configuration: config.handlers.source_control.active
</HANDLERS>
<ERROR_HANDLING>
Invalid Inputs (Exit Code 2):
Remote Branch Not Found (Exit Code 1):
Authentication Error (Exit Code 11):
Network Error (Exit Code 12):
Merge Conflict Error (Exit Code 13):
Configuration Error (Exit Code 3):
Handler Error (Exit Code 1):
</ERROR_HANDLING>
<USAGE_EXAMPLES>
Example 1: Pull Current Branch (Default Strategy)
INPUT:
{
"operation": "pull-branch",
"parameters": {
"remote": "origin"
}
}
# Assuming current branch is feat/123-user-export
OUTPUT:
{
"status": "success",
"operation": "pull-branch",
"branch_name": "feat/123-user-export",
"remote": "origin",
"strategy": "auto-merge-prefer-remote",
"commits_pulled": 2
}
Example 2: Pull Specific Branch with Rebase
INPUT:
{
"operation": "pull-branch",
"parameters": {
"branch_name": "feat/456-dashboard",
"remote": "origin",
"rebase": true
}
}
OUTPUT:
{
"status": "success",
"operation": "pull-branch",
"branch_name": "feat/456-dashboard",
"remote": "origin",
"strategy": "rebase",
"commits_pulled": 3
}
Example 3: Pull with Auto-Merge Prefer Remote
INPUT:
{
"operation": "pull-branch",
"parameters": {
"branch_name": "fix/789-auth-bug",
"remote": "origin",
"strategy": "auto-merge-prefer-remote"
}
}
OUTPUT:
{
"status": "success",
"operation": "pull-branch",
"branch_name": "fix/789-auth-bug",
"remote": "origin",
"strategy": "auto-merge-prefer-remote",
"commits_pulled": 5
}
Example 4: Pull with Manual Conflict Resolution
INPUT:
{
"operation": "pull-branch",
"parameters": {
"branch_name": "feat/999-new-feature",
"remote": "origin",
"strategy": "manual"
}
}
OUTPUT:
{
"status": "success",
"operation": "pull-branch",
"branch_name": "feat/999-new-feature",
"remote": "origin",
"strategy": "manual",
"commits_pulled": 2,
"conflicted_files": ["src/app.js"]
}
Example 5: Pull with Fail Strategy (Conflicts Exist)
INPUT:
{
"operation": "pull-branch",
"parameters": {
"branch_name": "feat/888-risky-change",
"remote": "origin",
"strategy": "fail"
}
}
OUTPUT:
{
"status": "failure",
"operation": "pull-branch",
"error": "Merge conflicts detected. Use different strategy or resolve manually.",
"error_code": 13,
"conflicted_files": ["src/core.js", "src/utils.js"]
}
</USAGE_EXAMPLES>
<CONFLICT_RESOLUTION_STRATEGIES>
Strategy: auto-merge-prefer-remote (DEFAULT)
git pull -X theirsStrategy: auto-merge-prefer-local
git pull -X oursStrategy: rebase
git pull --rebaseStrategy: manual
Strategy: fail
</CONFLICT_RESOLUTION_STRATEGIES>
<INTEGRATION>Called By:
repo-manager agent - For programmatic pull operations/repo:pull command - For user-initiated pullsCalls:
repo-common skill - For configuration loadinghandler-source-control-{platform} skill - For platform-specific pull operationsDoes NOT Call:
This skill is focused on pull operations:
By separating pull operations: