Agent skill
sc-commit-push-pr
Commit staged changes, push to remote, and create PRs for GitHub and Azure DevOps
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/sc-commit-push-pr
SKILL.md
sc-commit-push-pr Skill
Orchestrates the commit, push, and PR creation workflow using background agents.
Capabilities
| Command | Description |
|---|---|
/sc-commit-push-pr |
Full pipeline: commit, push, and create PR if needed |
/sc-create-pr |
Create PR from title/body (standalone) |
Agent Delegation
| Step | Agent | Input | Output |
|---|---|---|---|
| Commit & Push | commit-push |
source/destination branches | PR status, URL, or conflict list |
| Create PR | create-pr |
title, body, source, destination | PR info |
Orchestration Logic
/sc-commit-push-pr Flow
-
Stage important files
- Prompt user if unclear which files to stage
- Skip if no changes detected
-
Invoke
commit-pushagent via Agent Runner- Pass source/destination branch parameters
- Parse fenced JSON response
-
Handle response:
- If
pr_exists: true→ Return PR URL to user - If
needs_pr_text: true→ Prompt user for title/body, then invokecreate-pr - If
error.code == "GIT.MERGE_CONFLICT"→ Guide user through conflict resolution
- If
/sc-create-pr Flow
-
Accept title/body from user
- May be provided as arguments or prompted
-
Invoke
create-pragent via Agent Runner- Pass title, body, source, destination
-
Return PR URL to user
Provider Support
- GitHub - Uses
ghCLI for PR operations - Azure DevOps - Uses REST API with
AZURE_DEVOPS_PAT
Provider is auto-detected from git remote on each run.
Configuration
Required: Protected Branches
Create .sc/shared-settings.yaml:
yaml
git:
protected_branches:
- main
- develop
Or let the skill auto-detect from git-flow configuration.
Credentials
Set environment variables:
- GitHub:
GITHUB_TOKEN(orgh auth login) - Azure DevOps:
AZURE_DEVOPS_PAT
Error Handling
| Error Code | Meaning | Recovery |
|---|---|---|
GIT.MERGE_CONFLICT |
Merge conflicts detected | Resolve conflicts, re-run |
GIT.AUTH |
Authentication failure | Check credentials |
PR.CREATE_FAILED |
API error creating PR | Check permissions |
CONFIG.PROTECTED_BRANCH_NOT_SET |
Missing config | Create shared-settings.yaml |
Storage
| Type | Path | Purpose |
|---|---|---|
| Logs | .claude/state/logs/sc-commit-push-pr/ |
Runtime events, preflight results |
| Shared Settings | .sc/shared-settings.yaml |
Protected branch configuration |
| Package Settings | .sc/sc-commit-push-pr/settings.yaml |
Optional preferences |
Related
Didn't find tool you were looking for?