/thebous-os:merge-prfrom thebous-os
Merges a GitHub PR to main, transitions the linked Jira or Notion task to in_staging, and posts a notification to Slack.
Ships in thebous-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Select and merge a PR into main, move the linked Jira or Notion task to
in_staging, comment on it, and notify Slack.
If the user specified a PR number or URL when invoking the command, use that.
Otherwise, list the open PRs created by the current user:
gh pr list --author @me --state open --json number,title,headRefName,createdAt \
--template '{{range .}}#{{.number}} | {{.headRefName}} | {{.title}}{{"\n"}}{{end}}'
If the command fails with a TLS/certificate error, use this fallback:
OWNER_REPO=$(git remote get-url origin | sed -E 's#.*[:/]([^/]+/[^/]+)(\.git)?$#\1#')
ME=$(curl -sf -H "Authorization: Bearer $(gh auth token)" https://api.github.com/user | jq -r '.login')
curl -sf -H "Authorization: Bearer $(gh auth token)" \
"https://api.github.com/repos/$OWNER_REPO/pulls?state=open" \
| jq --arg me "$ME" '[.[] | select(.user.login == $me)] | .[] | {number, headRefName: .head.ref, title}'
Show the list to the user and ask which PR they want to merge. Wait for the reply.
gh pr view <NUMBER> --json number,title,headRefName,url,body
TLS fallback:
curl -sf -H "Authorization: Bearer $(gh auth token)" \
"https://api.github.com/repos/$OWNER_REPO/pulls/<NUMBER>" \
| jq '{number, title, headRefName: .head.ref, url: .html_url, body}'
Extract:
headRefName: the PR's branchurl: the PR URLsource "scripts/helpers.sh"
TASK_REF=$(resolve_work_item_ref "<headRefName>" 2>/dev/null || true)
Use the resolution rules from references/task-context.md; merge only needs
the resulting TaskRef and does not fetch task details before the merge.
If resolution returns no reference, continue without task context and make no
provider calls. Otherwise set PROVIDER, EXTERNAL_ID and TASK_URL from
TASK_REF.
Ask the user which merge type they prefer (default: squash):
gh pr merge <NUMBER> --squash --auto
# or --merge or --rebase depending on the choice
TLS fallback:
curl -sf -X PUT -H "Authorization: Bearer $(gh auth token)" \
"https://api.github.com/repos/$OWNER_REPO/pulls/<NUMBER>/merge" \
-d '{"merge_method":"squash"}'
# merge_method: "squash" | "merge" | "rebase" depending on the choice
If the linked provider is Jira, follow references/jira-transition.md with:
<TRANSITION_ID> = $JIRA_IN_STAGING_ID<COMMENT_TEXT> = "🔀 PR #<NUMBER> merged to main: <PR_URL>"If the linked provider is Notion, source scripts/notion.sh and run:
notion_set_status "<EXTERNAL_ID>" "in_staging"
notion_add_comment "<EXTERNAL_ID>" "🔀 PR #<NUMBER> merged to main: <PR_URL>"
Report status and comment separately. If either operation fails, show the semantic error and do not claim that the full provider update succeeded.
source "scripts/helpers.sh"
load_env
MERGED_BY=$(git config user.name 2>/dev/null || echo "unknown")
slack_notify "🔀 PR #<NUMBER> merged to main\n🎫 <$JIRA_BASE_URL/browse/<EXTERNAL_ID>|<EXTERNAL_ID>> → *In Staging*\n👤 $MERGED_BY\n🔗 <PR_URL>"
For Notion, use TASK_URL and notion:<EXTERNAL_ID> in the task link. If no
task is resolved, the Slack message is: 🔀 PR #<NUMBER> merged to main — <PR_TITLE>.
If CONFLUENCE_PARENT_URL is in .env and not empty:
Fetch the files changed in the merged branch:
git diff main...<BRANCH_NAME> --name-only
Extract PARENT_PAGE_ID from CONFLUENCE_PARENT_URL:
source "scripts/helpers.sh"
PARENT_PAGE_ID=$(confluence_page_id "$CONFLUENCE_PARENT_URL")
Use the MCP tool searchConfluenceUsingCql to search for pages mentioning the changed files:
ancestor = <PARENT_PAGE_ID> AND text ~ "<file1>" OR text ~ "<file2>"
If candidates are found, show the user:
📄 These Confluence pages might need updating:
- <title1>: <url1>
- <title2>: <url2>
Do you want to update any of these? (yes/no/list which ones)
For each confirmed page, ask the user what to update and use the MCP tool updateConfluencePage with the modified content.
If no candidates are found or the user declines, proceed silently.
Show the user:
<NUMBER> merged<PROVIDER>:<EXTERNAL_ID> → in_staging (if applicable)<list of updated pages> (if applicable)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pr-merge, jira-transition, notion-status, slack-notification, github-cli
npx claudepluginhub thebous/thebous-os --plugin thebous-os13 skills in this plugin
/address-reviewAssess code review comments against code evidence, fix confirmed issues on your PR after user approval, reply to every comment on GitHub, and update documentation for a linked Jira or Notion task/architecture-first-developmentUse when implementing or refactoring features, bug fixes, handlers, integrations, or domain logic where architecture, maintainability, validation, errors, complexity, I/O, or over-engineering matter/create-jira-taskCreate a Jira task from a user request using the repository's fixed description format with the sections "Descrizione" and "Acceptance Criteria". Use when the user asks to create, open, or draft a new Jira task./create-prUse when the user asks to create or open a pull request, or to merge a branch, after development is complete/create-taskCreate a task in Jira or Notion with the shared Italian description and acceptance-criteria format/jira-git-syncGit → Jira/Notion → Slack → Confluence workflow automation. Use when the user wants to start a task from a Jira or Notion task, create a branch, open/review/merge a PR, or tag a release. Route the request to the matching workflow skill.Other plugins' skills for the same job