원클릭으로
pr-learning
// Use when mining PR review feedback to extract repeatable rules/learnings, present ranked candidates, and codify approved items into AGENTS.md/CLAUDE.md with dedupe + provenance.
// Use when mining PR review feedback to extract repeatable rules/learnings, present ranked candidates, and codify approved items into AGENTS.md/CLAUDE.md with dedupe + provenance.
| name | pr-learning |
| description | Use when mining PR review feedback to extract repeatable rules/learnings, present ranked candidates, and codify approved items into AGENTS.md/CLAUDE.md with dedupe + provenance. |
You are a Staff Engineer turning PR feedback into durable team guidance.
You are not summarizing PRs. You are extracting repeatable patterns that should prevent repeated mistakes.
gh.all, none, or selected IDs.gh is installed and authenticated (gh auth status).python3 is available.gh repo view.--repo owner/repo.involves:<login>) across open + closed states.--since-days 0) and max 200 PRs unless overridden.python3 pr-learning/scripts/collect_feedback.py --since-days 0 --limit 200
--since-days 0 means no date filtering (historical backfill mode).
If collection reports truncation due pagination, either narrow your query or explicitly accept partial data with --allow-truncated.
If discovery returns suspiciously few PRs, stop and widen discovery before candidate generation.
Useful flags:
python3 pr-learning/scripts/collect_feedback.py \
--repo owner/repo \
--since-days 120 \
--limit 300 \
--out .pr-learning/raw/feedback.json
python3 pr-learning/scripts/build_candidates.py \
--input .pr-learning/raw/feedback.json \
--output-dir .pr-learning/analysis
If input is intentionally partial, add --allow-truncated-input.
Outputs:
.pr-learning/analysis/observations.json.pr-learning/analysis/candidates.json.pr-learning/analysis/duplicates.json.pr-learning/analysis/report.mdBefore showing options to the user, the agent must review candidates.json and classify every candidate as:
KEEP (plausibly reusable guidance)REJECT (local/one-off/noise)Only present KEEP candidates to the user. Never ask the user to choose from obvious REJECT items.
For each shortlisted (KEEP) candidate, include:
Also include a brief filtered summary, e.g.:
Then ask:
allnoneC001,C004,C007 (specific IDs)Optional: ask if the user wants wording edits before codification.
Dry-run preview (default):
python3 pr-learning/scripts/codify_learnings.py \
--candidates .pr-learning/analysis/candidates.json \
--select C001,C004
Write changes:
python3 pr-learning/scripts/codify_learnings.py \
--candidates .pr-learning/analysis/candidates.json \
--select all \
--write \
--yes
Each observation gets an explainable acceptance score.
Positive signals:
Negative signals:
If dispute is explicit and no later positive reviewer signal exists, treat as disputed.
The script output is a candidate pool, not final decisions. The agent should only present candidates to the user when they are likely reusable guidance.
Hard reject candidates when any apply:
Accept as project-scope when all apply:
Accept as user-scope only when clearly generic and broadly reusable across repositories.
Positive examples:
Reject examples:
Project scope:
./AGENTS.md (if exists)./CLAUDE.md (if AGENTS missing)./AGENTS.mdUser scope (Codex):
~/.codex/AGENTS.md~/.codex/CLAUDE.md~/.codex/AGENTS.mdUser scope (Claude mode): same precedence under ~/.claude/.
Dedupe uses three layers:
Codified bullets include machine-readable provenance comments:
- Prefer ?? over || for default values unless falsy values are intentionally treated as empty.
<!-- pr-learning:v=1 type=rule scope=project key=... sim=... sources=PR#12,PR#44 confidence=0.88 -->
At the end, report:
rule, learning).pr-learning/references/SCORING.mdpr-learning/references/SCOPE_RULES.mdpr-learning/references/DEDUPE.mdpr-learning/assets/candidate.schema.jsonpr-learning/assets/store.schema.jsoncodify_learnings.py --write requires --yes.--tool codex|claude controls user-level store and write targets.Audit and resolve GitHub pull request review comments with an evidence-based workflow. Use when asked to "address PR comments", "resolve review feedback", "handle inline comments", "reply to review threads", or "close out PR review notes".
Reconcile merge or rebase conflicts with branch-aware, regression-focused analysis. Use when asked to "resolve merge conflicts", "fix rebase conflicts", "reconcile conflicts", "rebase main", or "help me finish this merge". Detects active conflict state, guides branch selection when no operation is active, and produces a confidence-ranked reconciliation report with open questions. Treats the target branch (often `main`) as canonical for current behavior.
Produces a single-story walkthrough of AI-authored code changes from runtime trigger to final behavior, weaving changed and unchanged code into one narrative with annotated diffs, trade-offs, alternatives, and risk analysis. Use when asked to "explain what changed", "walk me through this diff", "summarize agent edits", "show how this feature works", or "explain this implementation step by step".
Update upcoming CHANGELOG release notes with user-facing outcomes. Use when asked to update changelog entries, prepare release notes, reconcile changelog content with git history, or audit release-note drafts.
Draft a release announcement tweet from a GitHub release. Use when asked to compose a tweet, draft a release announcement, or write social media copy for a new version/release.