From backend-coding-agent
Use when committing, pushing, and raising a PR — stages changed files, writes a Conventional Commits message, pushes to the remote branch, creates a GitHub PR via gh CLI, then posts the PR URL to configured Slack or Teams channels for review. Channel targets are configurable via .commit-push-pr.json or prompted interactively.
How this skill is triggered — by the user, by Claude, or both
Slash command
/backend-coding-agent:commit-push-prsonnetThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
End-to-end flow from staged changes to a reviewable pull request with optional Slack/Teams notifications. Reads `.commit-push-pr.json` for pre-configured channels; when the file is absent or channels are empty, prompts the user interactively.
End-to-end flow from staged changes to a reviewable pull request with optional Slack/Teams notifications. Reads .commit-push-pr.json for pre-configured channels; when the file is absent or channels are empty, prompts the user interactively.
Look for .commit-push-pr.json in the workspace root. If it exists, parse it and use it as the base configuration. If it does not exist, proceed with empty defaults and resolve interactively in later steps.
Config schema:
{
"pr": {
"baseBranch": "main",
"draft": false,
"labels": [],
"assignees": [],
"reviewers": []
},
"notifications": {
"slack": {
"enabled": true,
"channels": ["#engineering-prs"],
"webhookEnvVar": "SLACK_WEBHOOK_URL",
"messageTemplate": "🔍 PR ready for review: *{title}*\n{url}"
},
"teams": {
"enabled": false,
"channels": ["Engineering Reviews"],
"webhookEnvVar": "TEAMS_WEBHOOK_URL",
"messageTemplate": "PR ready for review: {title}\n{url}"
}
}
}
Config resolution order (highest to lowest precedence):
--base develop, --draft)directoryMapping entries in .commit-push-pr.json matched against the current pathpr and notifications blocks in .commit-push-pr.jsonRun each check in order. Stop and report if any fails.
# Verify gh CLI is authenticated
gh auth status
# Check for changes to commit
git status --short
Nothing to commit — working tree is clean. Stage your changes first or verify the correct directory.gh CLI is not authenticated. Run: gh auth loginNo remote origin found. Add a remote: git remote add origin <url>Cannot push from a detached HEAD. Check out a branch first.Show the user a summary of unstaged and untracked files:
git status --short
git diff --stat
Ask which files to stage if not all changes should be committed. Default: stage everything tracked and new non-ignored files.
# Default: stage all changes
git add -A
# Or stage specific files when the user specifies them
git add <file1> <file2> ...
Do not stage files that match:
.env, *.env.*, *.pem, *.key, *secret*, *credential*If any such files are detected in the diff, warn the user and exclude them:
WARNING: Skipping potentially sensitive file(s): .env
If this is intentional, stage them manually with: git add .env
Follow the Conventional Commits specification. Infer type and scope from the staged diff and current branch name.
Format:
<type>(<scope>): <short summary>
[optional body — explain WHY, not what]
[optional footer — Closes #issue, BREAKING CHANGE: ...]
Type selection guide:
| Type | When |
|---|---|
feat | New feature or capability |
fix | Bug fix |
refactor | No behaviour change |
test | Tests only |
docs | Documentation only |
chore | Tooling, deps, config |
perf | Performance improvement |
ci | CI/CD changes |
Rules:
feat/PROJ-123-add-login → Closes PROJ-123)Commit using a HEREDOC to preserve formatting:
git commit -m "$(cat <<'EOF'
<type>(<scope>): <summary>
<body>
<footer>
EOF
)"
Determine the current branch:
git rev-parse --abbrev-ref HEAD
Push with upstream tracking if the remote branch does not yet exist:
git push -u origin <branch>
If the branch already tracks a remote:
git push origin <branch>
On push failure, surface the raw git error and stop. Do not force-push unless the user explicitly requests it and confirms they understand the risk.
Use gh pr create to open the PR. Apply the standard PR body template:
gh pr create \
--title "<type>(<scope>): <summary>" \
--base "<baseBranch>" \
--body "$(cat <<'EOF'
## Summary
[1–3 sentences describing what this PR does and why.]
**Type:** <type>
**Related:** <Closes #issue or n/a>
---
## What Changed
- <bullet>
---
## Why
<motivation>
---
## How to Test
- [ ] Step 1
- [ ] Step 2
---
## Risks and Rollback
**Risk level:** Low | Medium | High
**Rollback:** <rollback steps>
---
## Checklist
- [ ] Tests added or updated
- [ ] Documentation updated if behaviour changed
- [ ] No secrets or credentials in code
- [ ] Breaking changes flagged and communicated
- [ ] Ready for review (not a draft)
EOF
)"
Apply optional flags from config:
--draft if pr.draft: true--label <label> for each entry in pr.labels--assignee <handle> for each entry in pr.assignees--reviewer <handle> for each entry in pr.reviewersCapture the PR URL from the gh pr create output. If the PR already exists (branch already has an open PR), fetch its URL with:
gh pr view --json url -q .url
If .commit-push-pr.json defines enabled notification targets with non-empty channels, skip interactive prompting and proceed directly to Step 8.
Ask the user:
PR created: <url>
Where should I post this PR for review?
1. Slack channel(s)
2. Microsoft Teams channel(s)
3. Both
4. Skip notifications
Enter choice (1/2/3/4):
For Slack (choice 1 or 3):
Enter Slack channel name(s), comma-separated (e.g. #eng-prs, #team-backend):
For Teams (choice 2 or 3):
Enter Teams channel name(s), comma-separated (e.g. Engineering Reviews, Backend Team):
Ask whether to save these choices to .commit-push-pr.json for future runs:
Save these channels to .commit-push-pr.json for future use? (y/n):
If yes, write or update .commit-push-pr.json with the supplied channel names.
Requires the SLACK_WEBHOOK_URL environment variable (or the value of notifications.slack.webhookEnvVar from config).
If the env var is unset:
WARNING: SLACK_WEBHOOK_URL is not set. Skipping Slack notification.
Set it with: export SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...
Otherwise, post using the incoming webhook:
curl -s -X POST "$SLACK_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d '{
"text": "🔍 PR ready for review: *<PR_TITLE>*\n<PR_URL>",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "🔍 *PR ready for review*\n*<PR_URL|PR_TITLE>*\n\nBranch: `BRANCH_NAME` → `BASE_BRANCH`\nAuthor: AUTHOR"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": { "type": "plain_text", "text": "Review PR" },
"url": "PR_URL"
}
]
}
]
}'
The text and blocks[].text.text fields use the messageTemplate from config if provided, with {title} and {url} substituted.
Channels specified in notifications.slack.channels are for human reference in the message (since Slack incoming webhooks target a pre-configured channel). If the team uses the Slack API with a bot token instead, add the channel field to the payload using each entry from the list.
Requires the TEAMS_WEBHOOK_URL environment variable (or the value of notifications.teams.webhookEnvVar from config).
If the env var is unset:
WARNING: TEAMS_WEBHOOK_URL is not set. Skipping Teams notification.
Set it with: export TEAMS_WEBHOOK_URL=https://outlook.office.com/webhook/...
Otherwise, post using the Adaptive Card format:
curl -s -X POST "$TEAMS_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d '{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.4",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "PR ready for review"
},
{
"type": "FactSet",
"facts": [
{ "title": "Title", "value": "PR_TITLE" },
{ "title": "Branch", "value": "BRANCH_NAME → BASE_BRANCH" },
{ "title": "Author", "value": "AUTHOR" }
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Review PR",
"url": "PR_URL"
}
]
}
}
]
}'
Print a final summary to the user:
✓ Committed: <type>(<scope>): <summary>
✓ Pushed: origin/<branch>
✓ PR opened: <PR_URL>
Notifications sent:
Slack: #channel1, #channel2 ✓
Teams: Engineering Reviews ✓ (or ✗ with reason)
If any notification failed (non-2xx response from webhook), report it as a warning — do not fail the skill.
| Situation | Action |
|---|---|
| Nothing to commit | Halt at Step 2 with clear message |
| Push rejected (non-fast-forward) | Halt, show error, suggest git pull --rebase |
gh not installed | Halt, point to https://cli.github.com |
| PR already open | Skip creation, use existing PR URL, continue to notifications |
| Webhook returns non-2xx | Warn and continue — notification failure is non-blocking |
.commit-push-pr.json is malformed JSON | Warn and fall back to plugin defaults |
Create .commit-push-pr.json in the workspace root to pre-configure defaults. All fields are optional.
{
"pr": {
"baseBranch": "main",
"draft": false,
"labels": ["needs-review"],
"assignees": [],
"reviewers": ["@your-team"]
},
"notifications": {
"slack": {
"enabled": true,
"channels": ["#engineering-prs", "#team-backend"],
"webhookEnvVar": "SLACK_WEBHOOK_URL",
"messageTemplate": "🔍 PR ready for review: *{title}*\n{url}"
},
"teams": {
"enabled": false,
"channels": ["Engineering Reviews"],
"webhookEnvVar": "TEAMS_WEBHOOK_URL",
"messageTemplate": "PR ready for review: {title}\n{url}"
}
},
"directoryMapping": {
"services/api": { "pr": { "baseBranch": "develop" } },
"services/frontend": { "notifications": { "slack": { "channels": ["#frontend-prs"] } } }
}
}
Add .commit-push-pr.json to version control so the whole team shares the same channel defaults. Store webhook URLs only in environment variables — never in this file.
npx claudepluginhub gagandeepp/software-agent-teams --plugin backend-coding-agent9plugins reuse this skill
First indexed Jul 24, 2026
Showing the 6 earliest of 9 plugins
Guides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.