Agent skill

PR To Green

by pymc-labs in pymc-labs/CausalPy

Bring a pull request to green by syncing with main, resolving conflicts safely, and fixing failing checks with CausalPy conventions.

Apache-2.0Auto-check passedDevelopment

Install PR To Green

skills CLI
$ npx skills add pymc-labs/CausalPy --skill pr-to-green -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pymc-labs/CausalPy pr-to-green --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pymc-labs/CausalPy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/pr-to-green .claude/skills/pr-to-green && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pr-to-green
GitHub stars
1.2k
Token cost
~1.7k tokens
SKILL.md length
916 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

Bring a pull request to green by syncing with main, resolving conflicts safely, and fixing failing checks with CausalPy conventions.

  • Works in 4 steps: Resolve PR metadata from GitHub → Move local repo to the PR branch → Verify branch context before edits → …
  • Tasks that involve Pull requests
  • SKILL.md covers When to use, Preconditions, PR number entrypoint (manual… and Workflow, plus 2 more sections
  • Calls gh, git and uv

What it does

PR To Green is an agent skill from pymc-labs/CausalPy. Bring a pull request to green by syncing with main, resolving conflicts safely, and fixing failing checks with CausalPy conventions.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Pull requests. It works with Git and PyMC. The repository describes itself as: A Python package for causal inference in quasi-experimental settings. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Pull requests

Example prompts

  • “/pr-to-green”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Resolve PR metadata from GitHub
  2. Move local repo to the PR branch
  3. Verify branch context before edits
  4. Continue with the main workflow below using the PR base branch from GitHub metadata (not assumptions about main).

What it can do on your machine

Read from SKILL.md and the folder at commit 7882153. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gh
    • git
    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh, git and uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

PR To Green loads about 1.7k tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 916 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pymc-labs/CausalPy at commit 7882153, republished under its Apache-2.0 licence (© pymc-labs). 916 words, ~1,680 tokens.

Download SKILL.mdSave it as .claude/skills/pr-to-green/SKILL.md (or your agent's skills folder).
name
pr-to-green
description
Bring a pull request to green by syncing with main, resolving conflicts safely, and fixing failing checks with CausalPy conventions.

PR to Green

This skill provides a deterministic maintainer workflow for taking an in-flight PR branch to green.

When to use

  • A PR is behind main and needs sync/rebase
  • There are merge conflicts to resolve intelligently
  • Remote checks are failing (tests, docs, lint, or packaging)
  • You need a concise update for the PR describing what was fixed and what remains

Preconditions

  • Confirm branch and remotes before making git changes
  • Preserve user/unrelated local modifications; never discard unknown work
  • Use CausalPy environment commands (uv is the default; see .agents/skills/python-environment/SKILL.md for the conda fallback):
    • uv run <command> (default), e.g. uv run pytest, uv run make test-patch-cov
    • $CONDA_EXE run -n CausalPy <command> (conda fallback, only when uv is unavailable)
  • For PyMC/PyTensor/matplotlib imports and test commands, request full permissions as needed

PR number entrypoint (manual invocation)

If the user provides a PR number (for example PR #724), do this first:

  1. Resolve PR metadata from GitHub
    • gh pr view <number> to get title, state, head branch, base branch, mergeability, and check summary.
    • gh pr checks <number> to get per-check pass/fail/pending status.
  2. Move local repo to the PR branch
    • gh pr checkout <number> (preferred) so local branch tracks the PR head.
  3. Verify branch context before edits
    • Confirm current branch, tracking status, and whether local uncommitted work exists.
  4. Continue with the main workflow below using the PR base branch from GitHub metadata (not assumptions about main).

Workflow

  1. Triage and early exit

    • Assess PR state from entrypoint metadata: branch divergence, mergeability, and check results.
    • If the PR is up-to-date with its base branch, has no conflicts, and all remote checks pass:
      • Report "PR is green — no action needed" and stop.
    • Otherwise, classify what needs fixing: behind-base, conflicts, failing checks, or a combination.
  2. Sync branch with base

    • Prefer git fetch upstream then git rebase upstream/<base-branch> (or maintainer-preferred merge strategy).
    • If the PR cannot be checked out, report the blocker and ask for maintainer guidance.
    • Resolve conflicts file-by-file with intent preservation.
    • Re-run targeted checks after conflict resolution to detect semantic drift.
  3. Fix failing checks with smallest valid change

    • Lint/type: apply minimal code changes, avoid broad refactors.
    • Tests: patch root cause and add/adjust tests under causalpy/tests/ if behavior changes.
    • Docs/doctest: follow docs placement and glossary/citation conventions.
    • Packaging/release checks: verify version and install/import expectations.
  4. Re-run checks in escalating scope

    • Fast local signal first (targeted tests/lint).
    • Then full gate commands required by project norms.
    • Always run prek run --all-files before final handoff.
    • If fixes introduced new failures, loop back to step 3 with the new failure set. Do not push until a full local pass is achieved or blockers are identified.
  5. Push and verify remote

    • Push fixes to the PR branch (git push).
    • Monitor remote checks via gh pr checks <number> until they complete or a timeout is reached.
    • If remote checks fail on issues not reproducible locally, note the discrepancy explicitly.
  6. Prepare maintainer-ready status update

    • What was failing.
    • What changed to fix it.
    • Which checks now pass (local and remote).
    • Remaining blockers (if any) and exact next steps.

Subagent delegation

Use subagents (via the Task tool) when work is noisy, broad, or high-risk. Each subagent runs in its own context window and returns a condensed result.

Show full SKILL.md (383 more words)Show less
ci-failure-investigator

Trigger when CI logs are long/noisy, failures span multiple jobs, or failure family is unclear.

Handoff (include in Task prompt):

  • PR number and branch name
  • Failed job names and relevant log snippets or gh run view output
  • Ask for: root cause ranking, fix-first order, and minimal patch plan
merge-conflict-analyst

Trigger when rebase/merge produces non-trivial conflicts, intent differs across branches, or conflict count is high.

Handoff (include in Task prompt):

  • Target branch and merge/rebase direction
  • Full conflict list (git diff --name-only --diff-filter=U) and key conflict markers/snippets
  • Ask for: conflict risk map, lowest-risk resolution order, and explicit escalations
Maintainer escalation clause (required)

Do not auto-resolve and continue silently when conflicts are highly complex. Instead, stop and request maintainer input with a brief report.

Escalate by default when:

  • .ipynb conflicts are messy (overlapping cell content plus metadata/output churn)
  • conflict resolution would drop one branch's meaningful behavior
  • conflicts touch core contracts and intent is ambiguous (experiments/models/tests/docs all changed around same behavior)

Escalation report must include:

  • conflicted file list and risk class
  • resolution options (1-2) with trade-offs
  • recommended next step and what decision is needed from maintainer
Scope drift / upstream compatibility escalation (required)

Do not keep patching silently when greening a PR turns into broader compatibility work outside the PR's feature surface. Stop after root-cause identification and ask the maintainer whether to continue in the PR or split the work into a separate branch/PR from main.

Escalate by default when:

  • the failing checks are caused by third-party API or version drift in shared/core code
  • the fix would benefit multiple open PRs or the default branch, not just the current PR
  • the next fix would modify shared integrations beyond the feature the PR is introducing
  • successive CI reruns keep exposing new failure families outside the original PR scope

Scope-drift report must include:

  • the original PR goal and the newly discovered broader issue
  • which files are feature-specific versus shared/core compatibility files
  • options: patch in the PR, split a separate compatibility PR, or pause for maintainer direction
  • the recommended next step and why

CausalPy guardrails

  • Never use destructive git commands unless explicitly requested
  • Do not create ad hoc test scripts; use pytest tests in causalpy/tests/
  • Keep PyMC-heavy tests runtime-controlled via sample_kwargs
  • Keep docs/notebooks in correct locations and formats
  • If checks cannot be run, report exactly what was skipped and why

© pymc-labs, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/pr-to-green of pymc-labs/CausalPy.

Open the folder on GitHubat commit 7882153

Compare with similar skills

PR To Green next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

PR To Green compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PR To Green this skillpymc-labs/CausalPy1.2k—~1.7kAutomated safety check: PassApache-2.0
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Open Code Review CLIalibaba/open-code-review46k—~3.1kAutomated safety check: PassApache-2.0
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0
Pull Request Title and Body Writeropeninterpreter/openinterpreter69k2 repos~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Open Code Review CLI

    alibaba/open-code-review

    Runs the ocr command-line tool to review Git changes, a commit or a branch comparison with an AI model, returning line-level comments and optionally applying fixes.

    46k GitHub stars~3.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Pull Request Title and Body Writer

    openinterpreter/openinterpreter

    Rewrites the title and body of one or more pull requests with gh, leading with why the change was made, then what changed, and describing only the net result.

    69k GitHub starsUsed in 2 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Understand Diff Analysis

    Egonex-AI/Understand-Anything

    Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky.

    86k GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed

More from pymc-labs/CausalPy

All 12 skills in this repo
  • Example Datasets

    pymc-labs/CausalPy

    Load built-in CausalPy example datasets for demos, tutorials, tests, and quick causal-analysis prototypes.

    1.2k GitHub stars~587 tokensUpdated yesterday
    Auto-check passed
  • Review PR

    pymc-labs/CausalPy

    Review CausalPy pull requests end-to-end by classifying PR type, checking branch freshness, mergeability, remote CI, correctness, security, tests, docs, and maintainer concerns.

    1.2k GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Causal Detective

    pymc-labs/CausalPy

    Challenge causal claims through structured threat assessment, counterfactual reasoning, and CausalPy falsification checks.

    1.2k GitHub stars~809 tokensUpdated yesterday
    Auto-check passed
  • Running Placebo Analysis

    pymc-labs/CausalPy

    Performs placebo-in-time sensitivity analysis with hierarchical null model and optional Bayesian assurance.

    1.2k GitHub starsUsed in 1 repo~442 tokens
    Auto-check passed
  • Python Environment

    pymc-labs/CausalPy

    Detect, configure, and use the project's Python environment (uv by default, conda-compatible tool as a fallback).

    1.2k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Feature Exploration

    pymc-labs/CausalPy

    Explore unfamiliar APIs, libraries, or implementation behavior with minimal reproducible examples and documented findings.

    1.2k GitHub stars~442 tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about PR To Green

What does PR To Green do?

Bring a pull request to green by syncing with main, resolving conflicts safely, and fixing failing checks with CausalPy conventions. PR To Green is an agent skill from pymc-labs/CausalPy. Bring a pull request to green by syncing with main, resolving conflicts safely, and fixing failing checks with CausalPy conventions.

When should I use PR To Green?

PR To Green fits situations like: tasks that involve Pull requests.

How do I install PR To Green in Claude Code?

Run `npx skills add pymc-labs/CausalPy --skill pr-to-green -a claude-code`. Or copy the skill folder (.agents/skills/pr-to-green in pymc-labs/CausalPy) into .claude/skills/pr-to-green in your project. Claude Code loads it when a task matches its description.

How do I install PR To Green in Codex?

Run `npx skills add pymc-labs/CausalPy --skill pr-to-green -a codex`. Or copy the skill folder (.agents/skills/pr-to-green in pymc-labs/CausalPy) into .agents/skills/pr-to-green in your project. Codex loads it when a task matches its description.

Can I use PR To Green in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pymc-labs/CausalPy --skill pr-to-green -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pr-to-green, .gemini/skills/pr-to-green, .github/skills/pr-to-green and .opencode/skills/pr-to-green in your project.

What does PR To Green need to run?

Going by SKILL.md and its folder, PR To Green needs the command-line tools its instructions call (gh, git and uv).

Does PR To Green access the network?

SKILL.md contains no URLs. Its commands use gh, git and uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is PR To Green safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does PR To Green use?

PR To Green is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does PR To Green use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to PR To Green?

Skills that share tags, products or a category with PR To Green: Finishing a Development Branch (obra/superpowers, 297k stars), Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars), Open Code Review CLI (alibaba/open-code-review, 46k stars) and Create Pull Request (cline/cline, 70k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PR To Green?

pymc-labs (a GitHub organization) maintains it in pymc-labs/CausalPy, which has 1,201 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 9, 2026.

Source: pymc-labs/CausalPy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.