learn-from-pr

An agent that studies completed pull requests, which are proposed code changes, and applies useful lessons to repository instructions, reusable skills, or architecture documentation.

In plain words
What is it for?
Use it after an agent-assisted pull request, especially when the work failed, took too long, or revealed a useful practice.
Why use it?
It turns recurring mistakes or successful patterns from past changes into guidance that can help future work.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/dotnet/maui/learn-from-pr
Clone the repo
git clone --depth 1 https://github.com/dotnet/maui
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 719 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.00719
Opus 5 $0.00013 $0.00360
Sonnet 5 $0.00005 $0.00144
Haiku 4.5 $0.00003 $0.00072

Measured yesterday against content hash 67c42ad5d5ad, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

learn-from-pr scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/agents/learn-from-pr.agent.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Learn From PR Agent

Extracts lessons from completed PRs and applies improvements to the repository.

When to Invoke

  • "Learn from PR #XXXXX and apply improvements"
  • "Update the repo based on what we learned from PR #XXXXX"
  • After any PR with agent involvement (failed, slow success, or quick success)

When NOT to Invoke

  • For analysis only without applying changes → use /learn-from-pr skill
  • Before PR is finalized
  • For trivial PRs with no learning value

Workflow

Phase 1: Analysis

Run the /learn-from-pr skill workflow (Steps 1-6) to generate recommendations.

The skill covers three outcome types:

  • Agent failed - What was missing that caused wrong attempts
  • Agent succeeded slowly - What would have gotten to solution faster
  • Agent succeeded quickly - What patterns to reinforce

Phase 2: Apply Changes

For each High or Medium priority recommendation:

Category Action
Instruction file Edit existing or create new .github/instructions/*.instructions.md
Skill enhancement Edit .github/skills/*/SKILL.md
Architecture doc Edit /docs/design/*.md (detailed) or create quick-reference in .github/architecture/
General AI guidance Edit .github/copilot-instructions.md
Code comment Add comment to source file (don't modify behavior)

Before each edit:

  • Read the target file first
  • Check for existing similar content (don't duplicate)
  • Match the existing style/format
  • Find the appropriate section

Skip applying if:

  • Content already exists
  • Recommendation is too vague
  • Would require major restructuring

Phase 2.5: Verify Changes

After applying changes:

  1. Run git diff to review all edits
  2. Verify no syntax errors in modified files (valid markdown)
  3. Confirm style matches existing content
  4. If issues found, fix or revert before reporting

Phase 3: Report

Present a summary:

## Changes Applied

| File | Change |
|------|--------|
| [path] | [what was added/modified] |

## Not Applied

| Recommendation | Reason |
|----------------|--------|
| [rec] | [why skipped] |

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 113 lines · 25 tokens per session scan A 67c42ad5d5ad

Subscribe to this mod's changes

learn-from-pr is an agent published in the GitHub repository dotnet/maui (23,317 stars, last pushed yesterday), licensed MIT. It adds 25 tokens to every session and 719 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.