extract-learnings
Skill0 starsChanged 21 days agoMITView on GitHub
Extract engineering learnings from PR feedback and save them to general_coding_instructions.md. Use when a PR review cycle is complete or when the user wants to capture team style/preferences/practices.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- buildomator/buildomatortheir own version, first seen Nov 4, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- buildomator/buildomator★ 102same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- address-pr-commentsSkill
- apply-change-to-repo-hierarchySkill
- create-new-taskSkill
- run-coverageSkill
- watch-multiple-pr-statusSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
29 rules. About 0 are common, 18 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
All learnings extracted from PR feedback should be saved to general_coding_instructions.md.
- Very specific: line 19
Read the current file: Read .github/general_coding_instructions.md to understand its structure and existing content.
- Distinctive: line 21
Check for duplicates: Ensure the learning is not already documented.
- Distinctive: line 25
Add the learning: Add the learning to the appropriate section.
- Distinctive: line 33
Look for patterns in feedback across multiple comments
- Very specific: line 39
Use mcp__azure-devops__repo_list_repos_by_project to get repository ID
- Very specific: line 40
Use mcp__azure-devops__repo_list_pull_request_threads to fetch all threads
- Very specific: line 49
IMPORTANT: Use -ShowResolved YES to include ALL comments (resolved and unresolved) for extracting learnings:
- Distinctive: line 66
When Azure DevOps PR threads are too large (>25K tokens), the API response cannot be read directly:
- Distinctive: line 88
All statuses (closed threads can still provide value)
- Distinctive: line 112
If a learning doesn't fit an existing section, propose a new section.
- Distinctive: line 116
Look for these types of learnings in feedback:
- Very specific: line 175
Before adding learnings, check if they already exist in .github/general_coding_instructions.md:
- Distinctive: line 180
Check if the learning is already documented
- Distinctive: line 183
If a learning is already documented, skip it
- Distinctive: line 184
Only add learnings that are:
- Distinctive: line 191
Before modifying any files, present a numbered list of proposed learnings so the user can select which to keep:
- Very specific: line 208
Read the current file: Read .github/general_coding_instructions.md to get the current content
- Very specific: line 210
Add the learning: Use the Edit tool to add the learning to the appropriate section
- Distinctive: line 211
Create new sections if needed: If no existing section fits, add a new section with a clear heading
- Distinctive: line 212
Follow the existing format of the file
- Distinctive: line 213
Use code examples with CORRECT/WRONG patterns where applicable
- Very specific: line 217
After updating general_coding_instructions.md, create a PR to the azure-messaging-ai-context repository with the changes:
- Very specific: line 219
If working in azure-messaging-ai-context repo: Create a branch and PR directly
- Distinctive: line 224
Use this summary template to report changes:
- Distinctive: line 255
Use markdown headers to organize sections
- Very specific: line 256
Use code blocks with language hints (`
c,`powershell) - Distinctive: line 257
Use tables for reference information
- Distinctive: line 258
Use CORRECT/WRONG patterns with comments
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Extract learnings about team style, preferences, and engineering practices from PR review comments, then save them to the project's general_coding_instructions.md file.
Target File: general_coding_instructions.md
All learnings extracted from PR feedback should be saved to general_coding_instructions.md. This file contains team-wide coding conventions, style preferences, and best practices.
File location:
- In azure-messaging-ai-context repo:
.github/general_coding_instructions.md - In higher-level repos:
deps/azure-messaging-ai-context/.github/general_coding_instructions.md
Before Adding Learnings
- Read the current file: Read
.github/general_coding_instructions.mdto understand its structure and existing content. - Check for duplicates: Ensure the learning is not already documented. If it exists, skip it.
- Find the right section: Match the learning to an existing section (e.g., Code Style, Error Handling, Testing) or add a new section if needed.
- Add the learning: Add the learning to the appropriate section.
Workflow
Step 1: Fetch PR Comments
Fetch all comment threads from the PR:
- Focus on reviewer comments that indicate style preferences, corrections, or best practices
- Look for patterns in feedback across multiple comments
For Azure DevOps PRs
URL pattern: https://dev.azure.com/{org}/{project}/_git/{repo}/pullrequest/{id}- Use
mcp__azure-devops__repo_list_repos_by_projectto get repository ID - Use
mcp__azure-devops__repo_list_pull_request_threadsto fetch all threads - For each thread, use
mcp__azure-devops__repo_list_pull_request_thread_commentsif needed
For GitHub PRs
URL pattern: https://github.com/{owner}/{repo}/pull/{number}Use the pre-built parsing script that fetches and filters comments directly.
IMPORTANT: Use -ShowResolved YES to include ALL comments (resolved and unresolved) for extracting learnings:
pwsh -File .github/scripts/parse_github_pr_comments.ps1 -prUrl "https://github.com/owner/repo/pull/123" -outputDir "cmake" -ShowResolved YESThen read the output: Read cmake/extract-learnings/github_pr_comments_parsed.txt
The script automatically:
- Fetches comments via
gh api(requires GitHub CLI authenticated) - With
-ShowResolved YES: Shows ALL comments for learning extraction - With
-ShowResolved NO: Only shows active/unresolved comments - Groups comments by file for easier reading
- Shows active comment count vs resolved count
- Writes output to
cmake/extract-learnings/github_pr_comments_parsed.txtfor easy access
Step 1b: Handle Large Azure DevOps API Responses
When Azure DevOps PR threads are too large (>25K tokens), the API response cannot be read directly:
- Save response to file: Let the API response save to tool-results folder (this happens automatically when response is too large)
- Use the pre-built parsing script at
.github/scripts/parse_pr_threads.ps1 - Run with
-ShowResolved YESto include ALL threads for learning extraction:pwsh -File .github/scripts/parse_pr_threads.ps1 -jsonFile "<path-to-tool-results>" -outputDir "cmake" -ShowResolved YES - Read the output:
Read cmake/pr_threads_parsed.txt
The script automatically filters out:
- Bot comments (MerlinBot, Azure Pipelines)
- PR-level comments without file context
- With
-ShowResolved YES: Includes closed/resolved threads for learning extraction - With
-ShowResolved NO: Only shows active threads
Output is written to cmake/pr_threads_parsed.txt for easy access.
Filtering PR Comments
Include:
- Comments with
threadContext(file-specific feedback) - All statuses (closed threads can still provide value)
- Human reviewers (team members)
Exclude:
- Bot comments (MerlinBot, Azure Pipelines, etc.)
- PR-level comments without file context
- System-generated threads (build status, etc.)
Step 2: Categorize Learnings
Match learnings to existing sections in general_coding_instructions.md:
| Section | Examples |
| Function Naming Conventions | Naming patterns, module prefixes, visibility rules |
| Function Structure Guidelines | Organization, async callbacks, complexity |
| Variable Naming Conventions | Variable naming patterns, special types |
| Result Variable Conventions | Initialization, return patterns |
| Parameter Validation Rules | Validation order, combined checks, logging |
| Goto Usage Rules | Permitted patterns, label naming |
| Indentation and Formatting | Spacing, brace style, alignment |
| If/Else Formatting Rules | Multi-condition, bracing, error chains |
| Additional Conventions | Mockable functions, header order, memory management, pointer casting, error handling, reference counting, async operations, requirements traceability |
If a learning doesn't fit an existing section, propose a new section.
Step 3: Identify Specific Patterns
Look for these types of learnings in feedback:
- Direct Corrections:
- "Use X instead of Y"
- "This should be..."
- "Wrong pattern, correct is..."
- Style Preferences:
- "We prefer..."
- "Team convention is..."
- "Always/Never do..."
- Implicit Patterns:
- Repeated similar corrections across multiple comments
- Consistent feedback about specific constructs
- Comments indicating codebase-wide patterns (e.g., "do this everywhere", "same issue")
- Best Practices:
- Performance recommendations
- Safety/security patterns
- Thread-safety requirements
Learning Prioritization
High Priority (always capture):
- Comments indicating team-wide conventions (e.g., "do this everywhere", "same issue")
- Thread-safety/deadlock patterns
- Memory leak prevention patterns
- Patterns repeated by multiple reviewers
Medium Priority (capture if generalizable):
- Style preferences with clear reasoning
- Performance recommendations
- Test patterns
Step 4: Formulate Learning Statements
Convert raw feedback into actionable learning statements:
From PR Comment:
"const can't size arrays in MSVC, use #define"
Learning Statement:
#### Array Sizes: Use `#define`, Not `const`
MSVC doesn't support VLAs. Use `#define` macros for array sizes:
```c
// WRONG
const uint32_t size = 3;
TYPE items[size]; // Compiler error!
// CORRECT
#define SIZE 3
TYPE items[SIZE];
### Step 5: Check for Duplicates
Before adding learnings, check if they already exist in `.github/general_coding_instructions.md`:
1. **Read the guidelines file**:
- Read `.github/general_coding_instructions.md`
- Understand its structure and existing sections
- Check if the learning is already documented
2. **Duplicate Detection Rules**:
- If a learning is already documented, **skip it**
- Only add learnings that are:
- Team-specific preferences not already in the file
- New conventions established through PR feedback
- Corrections to or clarifications of existing patterns
### Step 6: Present Proposed Changes
Before modifying any files, present a **numbered list** of proposed learnings so the user can select which to keep:
1. **Group learnings by target section** in general_coding_instructions.md
2. **Present each learning as a numbered item**:- [Function Naming] Use snake_case for all internal helpers (Source: PR comment #123)
- [Error Handling] Always log all parameters on validation failure (Source: PR comment #456)
- [Memory Management] Use malloc_2 for array allocations (Source: PR comment #789)
3. **Ask user to respond with**:
- Specific numbers to keep (e.g., "1, 3")
- "keep all" to apply all proposed changes
4. **Only apply the selected learnings**
### Step 7: Update general_coding_instructions.md
After approval:
1. **Read the current file**: Read `.github/general_coding_instructions.md` to get the current content
2. **Find the target section**: Locate the appropriate section for each learning
3. **Add the learning**: Use the `Edit` tool to add the learning to the appropriate section
4. **Create new sections if needed**: If no existing section fits, add a new section with a clear heading
5. Follow the existing format of the file
6. Use code examples with CORRECT/WRONG patterns where applicable
### Step 8: Create PR to azure-messaging-ai-context
After updating `general_coding_instructions.md`, create a PR to the azure-messaging-ai-context repository with the changes:
1. **If working in azure-messaging-ai-context repo**: Create a branch and PR directly
2. **If working in a higher-level repo**: The changes are in `deps/azure-messaging-ai-context/.github/general_coding_instructions.md`. Create a PR to the [Azure/azure-messaging-ai-context](https://github.com/Azure/azure-messaging-ai-context) repository with the updated file.
### Step 9: Summarize Changes
Use this summary template to report changes:
| Category | Found | New | Skipped (dup) |
|----------|-------|-----|---------------|
| Code Style | X | Y | Z |
| Error Handling | X | Y | Z |
| Testing | X | Y | Z |
| Memory Management | X | Y | Z |
**Added to general_coding_instructions.md:** [numbered list with section name and source thread/comment IDs]
**New sections created:** [list of new section names, if any]
**Skipped (already documented):** [list with location in existing section]
Report:
- Number of new learnings added
- Sections updated (and any new sections created)
- Categories covered
## Guidelines
### What Makes a Good Learning
- **Specific**: "Use `#define` for array sizes" not "Be careful with arrays"
- **Actionable**: Shows what TO DO and what NOT to do
- **Generalizable**: Applies beyond the specific PR/file
- **Documented with examples**: Include code snippets when relevant
### Format Conventions
- Use markdown headers to organize sections
- Use code blocks with language hints (```c, ```powershell)
- Use tables for reference information
- Use CORRECT/WRONG patterns with commentsDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

