mit einem Klick
pr-to-green
// Bring a pull request to green by syncing with main, resolving conflicts safely, and fixing failing checks with CausalPy conventions.
// Bring a pull request to green by syncing with main, resolving conflicts safely, and fixing failing checks with CausalPy conventions.
| 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. |
This skill provides a deterministic maintainer workflow for taking an in-flight PR branch to green.
main and needs sync/rebase$CONDA_EXE run -n CausalPy <command>If the user provides a PR number (for example PR #724), do this first:
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.gh pr checkout <number> (preferred) so local branch tracks the PR head.main).Triage and early exit
Sync branch with base
git fetch upstream then git rebase upstream/<base-branch> (or maintainer-preferred merge strategy).Fix failing checks with smallest valid change
causalpy/tests/ if behavior changes.Re-run checks in escalating scope
prek run --all-files before final handoff.Push and verify remote
git push).gh pr checks <number> until they complete or a timeout is reached.Prepare maintainer-ready status update
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.
ci-failure-investigatorTrigger when CI logs are long/noisy, failures span multiple jobs, or failure family is unclear.
Handoff (include in Task prompt):
gh run view outputmerge-conflict-analystTrigger when rebase/merge produces non-trivial conflicts, intent differs across branches, or conflict count is high.
Handoff (include in Task prompt):
git diff --name-only --diff-filter=U) and key conflict markers/snippetsDo 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)Escalation report must include:
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:
Scope-drift report must include:
pytest tests in causalpy/tests/sample_kwargsChoose the appropriate CausalPy experiment class from a causal question, data structure, treatment assignment, and identification assumptions. Use before writing analysis code when the method is not yet settled.
Fit, summarize, plot, and interpret a chosen CausalPy experiment. Use after the causal method has been selected, including when configuring PyMC/sklearn models and scale-aware custom priors.
Review CausalPy pull requests end-to-end by classifying PR type, checking branch freshness, mergeability, remote CI, correctness, security, tests, docs, and maintainer concerns. Use when asked to review a PR, assess a branch before merge, summarize PR risks, or request changes.
Create, evaluate, and triage GitHub issues for CausalPy. Use when filing a bug, proposing an enhancement, analyzing existing issues, or splitting large work into parent-child sub-issues.
Turn issues into PRs, handle commits, and run prek checks consistently.
Perform structured research and turn findings into an implementation plan.