Forks GitHub repo, syncs fork with upstream, adds inheritance: true to .coderabbit.yaml, pushes branch, and opens fix PR. Use for CodeRabbit config compliance after scanning.
From teamsnpx claudepluginhub openshift-eng/ai-helpers --plugin teamsThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
This skill handles the complete workflow of opening a pull request to add inheritance: true to a repository's .coderabbit.yaml file. It always operates via a personal fork to avoid needing direct push access to upstream repos.
Use this skill as Step 6 of the /teams:coderabbit-inheritance-scanner command, after the user has confirmed they want to open PRs. Call it once per non-compliant repo that does not already have an open fix PR.
Do NOT call this skill in --dry-run mode. Instead, display the actions that would be taken for each repo.
gh CLI authenticated with repo scopeworkflow scope is needed if the upstream repo contains GitHub Actions workflow files (for gh repo sync). If missing, the skill will skip the repo with a warning.For each repo that needs a fix PR, run the following. The variables REPO (e.g., openshift/api), DEFAULT_BRANCH (e.g., master or main), and CFGFILE (e.g., .coderabbit.yaml) must be set.
# Derive names
REPO_NAME="${REPO##*/}"
GH_USER=$(gh api user --jq '.login')
WORKDIR="/tmp/cr-fix-workdir/${REPO_NAME}"
BRANCH_NAME="add-coderabbit-inheritance"
echo "Processing: ${REPO}"
# Step 1: Fork the repo (idempotent - safe to call if fork exists)
gh repo fork "${REPO}" --clone=false 2>&1 || true
sleep 2
# Step 2: Sync the fork's default branch with upstream
SYNC_OUTPUT=$(gh repo sync "${GH_USER}/${REPO_NAME}" --source "${REPO}" --branch "${DEFAULT_BRANCH}" 2>&1)
SYNC_EXIT=$?
if [ $SYNC_EXIT -ne 0 ]; then
if echo "$SYNC_OUTPUT" | grep -q "workflow"; then
echo "SKIP|${REPO}|Fork sync failed: workflow scope required. Run: gh auth refresh -h github.com -s workflow"
# Continue to next repo in the calling loop
return 1 2>/dev/null || continue
fi
echo "SKIP|${REPO}|Fork sync failed: ${SYNC_OUTPUT}"
return 1 2>/dev/null || continue
fi
# Step 3: Delete any stale branch from a previous run
gh api -X DELETE "repos/${GH_USER}/${REPO_NAME}/git/refs/heads/${BRANCH_NAME}" 2>/dev/null || true
sleep 1
# Step 4: Clone the fork and create the fix branch
rm -rf "${WORKDIR}"
if ! gh repo clone "${GH_USER}/${REPO_NAME}" "${WORKDIR}" -- -b "${DEFAULT_BRANCH}" --depth 1 2>&1; then
echo "ERROR|${REPO}|Clone failed"
return 1 2>/dev/null || continue
fi
cd "${WORKDIR}" || { echo "ERROR|${REPO}|cd into workdir failed"; return 1 2>/dev/null || continue; }
git checkout -b "${BRANCH_NAME}" 2>&1 || { echo "ERROR|${REPO}|Branch creation failed"; cd /tmp; return 1 2>/dev/null || continue; }
# Step 5: Add inheritance: true to the config file
if [ ! -f "${CFGFILE}" ]; then
echo "ERROR|${REPO}|Config file ${CFGFILE} not found in cloned repo"
cd /tmp
return 1 2>/dev/null || continue
fi
if ! grep -qE '^\s*inheritance:\s*(true|false)\b' "${CFGFILE}"; then
# Prepend inheritance: true as the first line
printf 'inheritance: true\n' | cat - "${CFGFILE}" > "${CFGFILE}.tmp" && mv "${CFGFILE}.tmp" "${CFGFILE}"
else
# Replace existing inheritance: false with true
sed -i.bak 's/^\(\s*\)inheritance:\s*false/\1inheritance: true/' "${CFGFILE}" && rm -f "${CFGFILE}.bak"
fi
# Step 6: Commit and push
git add "${CFGFILE}"
git commit -m "$(cat <<'COMMITEOF'
Add inheritance: true to .coderabbit.yaml
Ensures this repo inherits the org-wide CodeRabbit review rules
defined in https://github.com/openshift/coderabbit
COMMITEOF
)" 2>&1
git push origin "${BRANCH_NAME}" 2>&1
# Step 7: Create the PR from fork to upstream
PR_URL=$(gh pr create \
--repo "${REPO}" \
--head "${GH_USER}:${BRANCH_NAME}" \
--base "${DEFAULT_BRANCH}" \
--title "Add CodeRabbit inheritance for org-wide rules" \
--body "$(cat <<'BODYEOF'
Adds `inheritance: true` to `.coderabbit.yaml` so this repo inherits the org-wide review rules from [openshift/coderabbit](https://github.com/openshift/coderabbit).
Without this setting, the repo's custom `.coderabbit.yaml` overrides the org-level configuration entirely, meaning org-wide review instructions and path-based rules are not applied.
BODYEOF
)" 2>&1)
cd /tmp
if echo "$PR_URL" | grep -q "https://github.com"; then
echo "OK|${REPO}|${PR_URL}"
else
echo "ERROR|${REPO}|PR creation failed: ${PR_URL}"
fi
sleep 1
Pipe-separated fields per line:
STATUS|org/repo|detail
Where STATUS is one of:
OK - PR created successfully; detail is the PR URLSKIP - Repo was skipped; detail is the reason (e.g., missing workflow scope)ERROR - An error occurred; detail is the error messageWhen --dry-run is active, do NOT execute this skill. Instead, for each repo that would get a PR, display:
[DRY RUN] openshift/<repo>:
1. Fork openshift/<repo> (or use existing fork)
2. Sync fork's <default_branch> with upstream
3. Create branch: add-coderabbit-inheritance
4. Prepend "inheritance: true" to <config_file>
5. Push branch to fork
6. Open PR: "Add CodeRabbit inheritance for org-wide rules"
From: <user>:add-coderabbit-inheritance -> openshift/<repo>:<default_branch>
gh repo fork will not fail if the fork already exists.sed -i requires a backup extension; the .bak file is cleaned up.WORKDIR under /tmp/cr-fix-workdir/ is cleaned up before each clone to ensure fresh state.