Official agent skill

Learn From PR

by dotnet in dotnet/maui

Analyzes a finished pull request that involved an agent to find what slowed or helped it, and recommends specific changes to instruction files, skills and docs.

OfficialMITAuto-check passedAgent Workflows

Install Learn From PR

skills CLI
$ npx skills add dotnet/maui --skill learn-from-pr -a claude-code

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

GitHub CLI
$ gh skill install dotnet/maui learn-from-pr --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/dotnet/maui.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/learn-from-pr .claude/skills/learn-from-pr && 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
learn-from-pr
GitHub stars
23k
Token cost
~2.5k tokens
SKILL.md length
1,078 words
Files
1
Skills in repo
27
Repo updated
First seen
Licence
MIT

At a glance

Analyzes a finished pull request that involved an agent to find what slowed or helped it, and recommends specific changes to instruction files, skills and docs.

  • Works in 6 steps: Gather Data → Fix Location Analysis → Analyze Outcome → …
  • Reviewing a merged PR where the agent needed many attempts
  • SKILL.md covers Inputs, Outputs, Completion Criteria and When to Use, plus 6 more sections
  • Calls gh

What it does

Given a PR or issue number, the agent gathers the diff and metadata with the GitHub CLI, reads the discussion, commit history, code complexity and similar past issues, and asks what would have helped an agent find the fix faster. A key step compares the files the agent attempted with the files the final fix touched. Different files are flagged as a major learning opportunity, with questions about why the agent chose them and what search would have found the right one.

The outcome is then sorted into scenarios: the agent failed, succeeded slowly or succeeded quickly, each with patterns to look for. The output is a structured analysis covering what happened, fix location, failure modes and prioritized recommendations, each with a category, priority, location, specific change and reason. The skill counts as done once at least one concrete recommendation is presented. It is not meant for PRs that are not finalized, trivial PRs or PRs without agent involvement.

When your agent uses it

  • Reviewing a merged PR where the agent needed many attempts
  • Working out why an agent edited the wrong files before the real fix
  • Studying a fast agent success to repeat what worked
  • Turning PR lessons into updates for instruction files and docs

Example prompts

  • “What can we learn from PR 33352? The agent took several attempts before the fix landed.”
  • “Compare the files the agent changed with the files in the final fix for this issue.”
  • “That agent fix landed on the first try, so work out which docs or instructions made that possible.”
  • “Write recommendations for our skills and instruction files based on how the last bug fix went.”

Requirements

  • The GitHub CLI (`gh`)
  • Compatibility (from SKILL.md): Requires GitHub CLI (gh)

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Gather Data
  2. Fix Location Analysis
  3. Analyze Outcome
  4. Find Improvement Locations
  5. Generate Recommendations
  6. Present Findings

What it can do on your machine

Read from SKILL.md and the folder at commit b926f05. 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

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

  • Network

    No URLs in SKILL.md. Its commands use gh, 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.

  • Compatibility

    Requires GitHub CLI (gh)

    From compatibility in the SKILL.md frontmatter.

Context cost

Learn From PR loads about 2.5k tokens when it runs. Until then it costs about 81 tokens; SKILL.md has 1,078 words of instructions outside code blocks.

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

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 dotnet/maui at commit b926f05, republished under its MIT licence (© dotnet). 1,078 words, ~2,463 tokens.

Download SKILL.mdSave it as .claude/skills/learn-from-pr/SKILL.md (or your agent's skills folder).
name
learn-from-pr
description
Analyzes a completed PR to extract lessons learned from agent behavior. Use after any PR with agent involvement - whether the agent failed, succeeded slowly, or succeeded quickly. Identifies patterns to reinforce or fix, and generates actionable recommendations for instruction files, skills, and documentation.
compatibility
Requires GitHub CLI (gh)
metadata.author
dotnet-maui
metadata.version
1.0

Learn From PR

Extracts lessons learned from a completed PR to improve repository documentation and agent capabilities.

Inputs

InputRequiredSource
PR number or Issue numberYesUser provides (e.g., "PR #33352" or "issue 33352")

Outputs

  1. Learning Analysis - Structured markdown with:

    • What happened (problem, attempts, solution)
    • Fix location analysis (attempted vs actual)
    • Failure modes identified
    • Prioritized recommendations
  2. Actionable Recommendations - Each with:

    • Category, Priority, Location, Specific Change, Why It Helps

Completion Criteria

The skill is complete when you have:

  • Gathered PR diff and metadata
  • Analyzed fix location (attempted vs actual)
  • Identified failure modes
  • Generated at least one concrete recommendation
  • Presented findings to user

When to Use

  • After agent failed to find the right fix
  • After agent succeeded but took many attempts
  • After agent succeeded quickly (to understand what worked)
  • When asked "what can we learn from PR #XXXXX?"

When NOT to Use

  • Before PR is finalized (use pr-finalize first)
  • For trivial PRs (typo fixes, simple changes)
  • When no agent was involved (nothing to analyze)

Workflow

Step 1: Gather Data
bash
# Required: Get PR info
gh pr view XXXXX --json title,body,files
gh pr diff XXXXX

Analyze the PR to extract learning:

  1. PR discussion - Comments reveal what was tried
  2. Commit history - Multiple commits may show iteration
  3. Code complexity - Non-obvious fixes suggest learning opportunities
  4. Similar past issues - Search for related bugs

Focus on: "What would have helped an agent find this fix faster?"

Step 2: Fix Location Analysis

Critical question: Did agent attempts target the same files as the final fix?

bash
# Where did final fix go?
gh pr view XXXXX --json files --jq '.files[].path' | grep -v test
ScenarioImplication
Same filesAgent found right location
Different filesMajor learning opportunity - document why

If different files: Answer these questions:

  • Why did agent think that was the right file?
  • What search would have found the correct file?
Step 3: Analyze Outcome

Determine which scenario applies and look for the relevant patterns:

Scenario A: Agent Failed
PatternIndicator
Wrong file entirelyAll attempts in File A, fix in File B
Tunnel visionOnly looked at file mentioned in error
Trusted issue titleIssue said "crash in X" so only looked at X
Pattern not generalizedFixed one instance, missed others
Didn't search codebaseNever found similar code patterns
Missing platform knowledgeDidn't know iOS/Android/Windows specifics
Wrong abstraction layerFixed handler when problem was in core
Misread error messageError pointed to symptom, not cause
Incomplete contextDidn't read enough surrounding code
Over-engineeredComplex fix when simple one existed
Scenario B: Agent Succeeded Slowly (many attempts)
PatternIndicator
Correct file, wrong approachFound right file but tried wrong fixes first
Needed multiple iterationsEach attempt got closer but wasn't quite right
Discovery was slowEventually found it but search was inefficient
Missing domain knowledgeHad to learn something that could be documented

Key question: What would have gotten agent to the solution faster?

Scenario C: Agent Succeeded Quickly
PatternIndicator
Good search strategyFound right file immediately
Understood the patternRecognized similar issues from past
Documentation helpedExisting docs pointed to solution
Simple, minimal fixDidn't over-engineer

Key question: What made this work? Should we reinforce this pattern?

Step 4: Find Improvement Locations
bash
# Discover where agent guidance lives
find .github/instructions -name "*.instructions.md" 2>/dev/null
find .github/skills -name "SKILL.md" 2>/dev/null
ls docs/design/ 2>/dev/null
ls .github/copilot-instructions.md 2>/dev/null
LocationWhen to Add Here
.github/instructions/*.instructions.mdDomain-specific AI guidance (testing patterns, platform rules)
.github/skills/*/SKILL.mdSkill needs new step, checklist, or improved workflow
/docs/design/*.mdDetailed architectural documentation
.github/copilot-instructions.mdGeneral AI workflow guidance
Code commentsNon-obvious code behavior
Step 5: Generate Recommendations

For each recommendation, provide:

  1. Category: Instruction file / Skill / Architecture doc / Inline comment / Linting issue
  2. Priority: High (prevents class of bugs) / Medium (helps discovery) / Low (nice to have)
  3. Location: Exact file path
  4. Specific Change: Exact text to add
  5. Why It Helps: Which failure mode it prevents

Prioritization factors:

  • How common is this pattern?
  • Would future agents definitely hit this again?
  • How hard is it to implement?

Pattern-to-Improvement Mapping (Failures/Slow Success):

PatternLikely Improvement
Wrong file entirelyCheck /docs/design/ for component relationships
Tunnel visionInstruction file: "Always search for pattern across codebase"
Missing platform knowledgePlatform-specific instruction file
Wrong abstraction layerReference /docs/design/HandlerResolution.md
Misread error messageCode comment explaining the real cause
Over-engineeredSkill enhancement: "Try simplest fix first"

Pattern-to-Improvement Mapping (Quick Success - reinforce):

PatternImprovement
Good search strategyDocument the search pattern that worked in skills
Documentation helpedNote which docs were valuable, ensure they stay updated
Recognized patternAdd to instruction files as known pattern
Show full SKILL.md (378 more words)Show less
Step 6: Present Findings

Present your analysis covering:

  • What happened and what made it hard
  • Where agent looked vs actual fix location
  • Which patterns applied and evidence
  • Prioritized recommendations with full details (category, priority, location, exact change, why it helps)

Error Handling

SituationAction
PR not foundAsk user to verify PR number
No agent involvement evidentAsk user if they still want analysis
Can't determine failure modeState "insufficient data" and what's missing

Constraints

  • Analysis only - Don't apply changes (use learn-from-pr agent for that)
  • Actionable recommendations - Every recommendation must have specific file path and text
  • Don't duplicate - Check existing docs before recommending new ones
  • Focus on high-value learning - Skip trivial observations
  • Respect PR scope - Don't recommend improvements unrelated to the PR's learnings

Examples

Example: Wrong File Entirely

PR #33352 - TraitCollectionDidChange crash on MacCatalyst

What happened:

  • Issue title: "ObjectDisposedException in ShellSectionRootRenderer"
  • Agent made 11 attempts, ALL in ShellSectionRootRenderer.cs
  • Actual fix was in PageViewController.cs

Failure Mode: Trusted issue title instead of searching for pattern.

Recommendation:

  • Category: Instruction File
  • Location: .github/instructions/ios-debugging.instructions.md
  • Change: "When fixing iOS crashes, search for the PATTERN across all files, not just the file named in the error"
  • Why: Prevents tunnel vision on named file
Example: Slow Success

PR #34567 - CollectionView scroll position not preserved

What happened:

  • Agent took 5 attempts to find fix
  • First 3 attempts were in wrong layer (handler vs core)
  • Eventually found it after reading more context
  • Final fix was simple once the right layer was identified

Pattern: Wrong abstraction layer - fixed handler when problem was in core.

Recommendation:

  • Category: Architecture Doc
  • Location: .github/architecture/handler-vs-core.md
  • Change: Document layer responsibilities - handlers map properties, core handles behavior
  • Why: Helps agent identify correct layer faster
Example: Quick Success

PR #35678 - Button disabled state not updating

What happened:

  • Agent found fix in 1 attempt
  • Searched for "IsEnabled" pattern across codebase immediately
  • Found similar past fix in another control and applied same approach
  • Simple, minimal change

Pattern: Good search strategy - recognized pattern from similar code.

Recommendation:

  • Category: Skill Enhancement
  • Location: .github/skills/try-fix/SKILL.md
  • Change: Add to search strategy: "Search for same property pattern in other controls"
  • Why: Reinforces successful discovery technique

Integration

  • pr-finalize → Use first to verify PR is ready
  • learn-from-pr skill → Analysis only (this skill)
  • learn-from-pr agent → Analysis + apply changes

For automated application of recommendations, use the learn-from-pr agent instead.

© dotnet, MIT. 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 .github/skills/learn-from-pr of dotnet/maui.

Open the folder on GitHubat commit b926f05

Compare with similar skills

Learn From PR 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.

Learn From PR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Learn From PR this skilldotnet/maui23k—~2.5kAutomated safety check: PassMIT
GitHub Agents Md MaintainerOpenHands/extensions158—~3kAutomated safety check: PassMIT
Openiap Workflowshyodotdev/openiap154—~2kAutomated safety check: PassMIT
Mariadb Operator PR Reviewmariadb-operator/mariadb-operator1k—~3.3kAutomated safety check: PassApache-2.0
Commit And PR389ds/389-ds-base294—~1kAutomated safety check: PassCustom licence
Code Reviewsortie-ai/sortie196—~2.9kAutomated safety check: PassMIT

Similar skills

  • GitHub Agents Md Maintainer

    OpenHands/extensions

    Create an automation that keeps AGENTS.md current in one or more GitHub repositories.

    158 GitHub stars~3k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Openiap Workflows

    hyodotdev/openiap

    A skill your agent uses for OpenIAP monorepo work that should follow the repository's shared agent workflows, including review-pr, audit-code, audit-security, audit-iapkit, compile-knowledge…

    154 GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Mariadb Operator PR Review

    mariadb-operator/mariadb-operator

    Perform a structured maintainer-style PR review for the mariadb-operator repository.

    1k GitHub stars~3.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Commit And PR

    389ds/389-ds-base

    Commit and open a PR the 389-ds-base way — "Issue NNNN - summary" subject, Bug Description/Fix Description body, Fixes:/Relates: trailer, AI-attribution trailer, and squash-merge etiquette.

    294 GitHub stars~1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Code Review

    sortie-ai/sortie

    Reviews pull requests in this repository for the defect classes a mechanical checklist misses: documentation that outlived the code it describes, reaction and retry state that leaks or clobbers a…

    196 GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Review Changes

    timothywarner-org/claude-code

    Review uncommitted local changes in the current git working tree for bugs, smells, missing tests, and CLAUDE.md voice violations.

    224 GitHub stars~506 tokensUpdated 2 mo ago
    DevelopmentAuto-check passed

More from dotnet/maui

All 27 skills in this repo
  • Mines local Copilot CLI session logs for dotnet/maui to rank costly or failing runs, tag recurring failure modes, propose repo edits and emit guard evals.

    23k GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Official

    Reviews the tests added in a pull request for fix coverage, quality, edge cases and test type, and recommends lighter test types where they would do.

    23k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Official

    Produces evidence-backed ship-readiness verdicts for .NET MAUI Servicing Releases and Previews, and drafts public-safe release handoff pages from the result.

    23k GitHub stars~15k tokensUpdated today
    Auto-check passed
  • Official

    Interprets pinned managed benchmark evidence for a dotnet/maui pull request and writes a narrative for the performance review workflow, without running or publishing anything.

    23k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • PR Finalize

    dotnet/maui

    Official

    Checks that a pull request's title and description match its implementation and reviews the code for best practices before merge, without posting anything.

    23k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • Official

    Adds MAUI-specific guardrails on top of the maestro-cli skill and Maestro MCP tools for darc, BAR, and channel or feed lookups in dotnet/maui.

    23k GitHub stars~10k tokensUpdated today
    Auto-check passed

Works with

Questions about Learn From PR

What does Learn From PR do?

Analyzes a finished pull request that involved an agent to find what slowed or helped it, and recommends specific changes to instruction files, skills and docs. Given a PR or issue number, the agent gathers the diff and metadata with the GitHub CLI, reads the discussion, commit history, code complexity and similar past issues, and asks what would have helped an agent find the fix faster. A key step compares the files the agent attempted with the files the final fix touched.

When should I use Learn From PR?

Learn From PR fits situations like: reviewing a merged PR where the agent needed many attempts; working out why an agent edited the wrong files before the real fix; studying a fast agent success to repeat what worked; turning PR lessons into updates for instruction files and docs.

How do I install Learn From PR in Claude Code?

Run `npx skills add dotnet/maui --skill learn-from-pr -a claude-code`. Or copy the skill folder (.github/skills/learn-from-pr in dotnet/maui) into .claude/skills/learn-from-pr in your project. Claude Code loads it when a task matches its description.

How do I install Learn From PR in Codex?

Run `npx skills add dotnet/maui --skill learn-from-pr -a codex`. Or copy the skill folder (.github/skills/learn-from-pr in dotnet/maui) into .agents/skills/learn-from-pr in your project. Codex loads it when a task matches its description.

Can I use Learn From PR 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 dotnet/maui --skill learn-from-pr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/learn-from-pr, .gemini/skills/learn-from-pr, .github/skills/learn-from-pr and .opencode/skills/learn-from-pr in your project.

What does Learn From PR need to run?

Going by SKILL.md and its folder, Learn From PR needs the command-line tools its instructions call (gh). Our summary lists: The GitHub CLI (`gh`). Compatibility (from SKILL.md): Requires GitHub CLI (gh).

Does Learn From PR access the network?

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

Is Learn From PR 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 Learn From PR use?

Learn From PR is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Learn From PR use?

About 2.5k tokens (SKILL.md is roughly 9.9k 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 Learn From PR?

Skills that share tags, products or a category with Learn From PR: GitHub Agents Md Maintainer (OpenHands/extensions, 158 stars), Openiap Workflows (hyodotdev/openiap, 154 stars), Mariadb Operator PR Review (mariadb-operator/mariadb-operator, 1k stars) and Commit And PR (389ds/389-ds-base, 294 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Learn From PR?

dotnet (a GitHub organization, an official publisher) maintains it in dotnet/maui, which has 23,321 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 8, 2026.

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