agentleFS
MicrosoftKnown publishermicrosoft/garnet/.github/skills/pr-finalize/SKILL.md

pr-finalize

Skill12k starsChanged 58 days agoMITView on GitHub

Finalizes any PR for merge by verifying title/description match implementation AND performing code review for best practices. Use when asked to "finalize PR", "check PR description", "review commit message", before merging any PR, or when PR implementation changed during review. Do NOT use for extracting lessons or investigating build failures.

1 other project uses a version of this.

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 2 mentionsAug 2026: 4 mentionsSep 2026: 13 mentionsOct 2026: 3 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/garnet repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about microsoft/garnet

The biggest 5 of 48 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 48

Talked about on GitHub, Bluesky and Hacker News (48 times).

On GitHub · 35

30 more on GitHub

On Bluesky · 11

6 more on Bluesky

On Hacker News · 2

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. gustfernandez/skills★ 0same 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 repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    This skill is ANALYSIS ONLY: Never post comments using gh commands.

    line 32
  2. Distinctive:

    Before suggesting changes, evaluate the current description:

    line 76
  3. Distinctive:

    Ask: "Is the existing description better than what my template would produce?"

    line 88
  4. Distinctive:

    If YES: Keep existing, only add missing required elements

    line 90
  5. Distinctive:

    Only full replacement if description is inadequate

    line 98
  6. Distinctive:

    Use this only when the existing description is stale, inaccurate, or missing key information:

    line 185
  7. Very specific:

    After verifying title/description, perform a code review to catch Garnet-specific issues and general best practice violations before merge.

    line 260
  8. Very specific:

    When reviewing code changes in Garnet, focus on:

    line 264
  9. Very specific:

    The pr-finalize skill is ANALYSIS ONLY: Never post comments using gh pr review or gh pr comment.

    line 343

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PR Finalize

Ensures PR title and description accurately reflect the implementation, and performs a code review for Garnet best practices before merge.

Standalone skill — Can be used on any PR.

Two-Phase Workflow

  1. Title & Description Review — Verify PR metadata matches implementation
  2. Code Review — Review code for Garnet-specific best practices and potential issues

🚨 CRITICAL RULES

1. NEVER Approve or Request Changes

AI agents must NEVER use --approve or --request-changes flags.

ActionAllowed?Why
gh pr review --approve❌ NEVERApproval is a human decision
gh pr review --request-changes❌ NEVERBlocking PRs is a human decision

2. NEVER Post Comments Directly

This skill is ANALYSIS ONLY. Never post comments using gh commands.

ActionAllowed?Why
gh pr review --comment❌ NEVERPresent findings to the user instead
gh pr comment❌ NEVERPresent findings to the user instead
Analyze and report findings✅ YESThis is the skill's purpose

Only humans control when comments are posted. Your job is to analyze and present findings.


Phase 1: Title & Description

Core Principle: Preserve Quality

Review existing description BEFORE suggesting changes. Many PR authors write excellent, detailed descriptions. Your job is to:

  1. Evaluate first — Is the existing description good? Better than a template?
  2. Preserve quality — Don't replace a thorough description with a generic template
  3. Enhance, don't replace — Add missing required elements (issue links, test info) without rewriting good content
  4. Only rewrite if needed — When description is stale, inaccurate, or missing key information

Usage

# Get current state (no local checkout required)
gh pr view XXXXX --json title,body
gh pr view XXXXX --json files --jq '.files[].path'

# Review commit messages (helpful for squash/merge commit quality)
gh pr view XXXXX --json commits --jq '.commits[].messageHeadline'

# Review actual code changes
gh pr diff XXXXX

# Optional: if the PR branch is checked out locally
git diff origin/main...HEAD

Evaluation Workflow

Step 1: Review Existing Description Quality

Before suggesting changes, evaluate the current description:

Quality IndicatorLook For
StructureClear sections, headers, organized flow
Technical depthFile-by-file changes, specific code references
ScannabilityEasy to find what changed and where
AccuracyMatches actual diff — not stale or incorrect
CompletenessBreaking changes, performance impact, testing info

Step 2: Compare to Template

Ask: "Is the existing description better than what my template would produce?"

  • If YES: Keep existing, only add missing required elements
  • If NO: Suggest improvements or replacement

Step 3: Produce Output

  • Recommended PR title (if change needed)
  • Assessment of existing description
  • Specific additions needed (e.g., "Add issue link", "Mention breaking change")
  • Only full replacement if description is inadequate

Title Requirements

The title becomes the commit message headline. Make it searchable and informative.

RequirementGoodBad
Component prefix (if specific)[Cluster] Fix gossip protocol timeoutFix timeout
Describes behavior, not issue[RESP] ZADD: Support GT/LT flagsFix #123
Captures the "what"[Tsavorite] Reduce lock contention in RMWFix perf bug
Notes breaking change if applicable(breaking)(omitted)
No noise prefixes[Storage] Fix...[PR agent] Fix...

Title Formula

[Component] What changed (breaking if applicable)

Component prefixes (use when change is scoped):

  • [RESP] — RESP command parsing/dispatch (libs/server/Resp/)
  • [Storage] — Storage session/functions (libs/server/Storage/)
  • [Tsavorite] — Tsavorite engine (libs/storage/Tsavorite/)
  • [Cluster] — Cluster/replication/sharding (libs/cluster/)
  • [Objects] — Object types: Hash, List, Set, SortedSet (libs/server/Objects/)
  • [API] — Garnet API surface (libs/server/API/)
  • [Network] — Networking/TLS (libs/common/Networking/)
  • [Config] — Configuration/options (libs/host/Configuration/)
  • [Tests] — Test-only changes
  • [Docs] — Documentation-only changes
  • Omit prefix for cross-cutting changes

Examples:

  • [RESP] ZADD: Support GT/LT flags for conditional updates
  • [Tsavorite] Reduce epoch protection overhead in hot-path RMW
  • [Cluster] Fix replication lag during key migration
  • Add multi-database support for standalone mode

Description Requirements

PR description should:

  1. Link to the GitHub Issue
  2. Describe what changed and why
  3. Match the actual implementation
### Description of Change

[Must match actual implementation]

### Issues Fixed

Fixes #XXXXX

Content for Future Agents

The title and description become the commit message. Future agents searching git history will use this to understand:

  • What changed and why
  • What patterns to follow or avoid
  • How this change affects related code

Required Elements for Agent Success

ElementPurposeExample
Component in titleScoped search[Tsavorite] ...
Root cause (bug fixes)Understand failure mode"Epoch was not released on error path"
Description of changeWhat code does now"Added GT/LT flag parsing in ZADD handler"
Key types/interfacesAPI surface awarenessIGarnetApi, StorageSession, CustomRawStringFunctions
What NOT to doPrevent repeat mistakes"Don't allocate on RMW hot path"

Recommended Elements

ElementWhen to Include
Root causeBug fixes — explain why the bug occurred
Key technical detailsComplex changes — list affected types and interfaces
What NOT to doWhen failed approaches were attempted
Edge casesWhen behavior differs across scenarios
Performance impactWhen change affects hot paths or memory allocation
Breaking changesWhen API or behavior changes affect consumers
Migration guideWhen users/extensions need to update

Description Template (for Inadequate Descriptions)

Use this only when the existing description is stale, inaccurate, or missing key information:

### Root Cause

[Why the bug occurred — be specific about the code path]

### Description of Change

[What the code now does]

**Key changes:**
- [Change 1]
- [Change 2]

### Key Technical Details

**Affected types/interfaces:**
- `TypeA` — [What it does]
- `TypeB` — [What it does]

### What NOT to Do (for future agents)

- ❌ **Don't [approach 1]** — [Why it fails]
- ❌ **Don't [approach 2]** — [Why it's wrong]

### Edge Cases

| Scenario | Risk | Mitigation |
|----------|------|------------|
| [Case 1] | Low/Medium/High | [How to handle] |

### Issues Fixed

Fixes #XXXXX

Quality Comparison Examples

Good Existing Description (KEEP)

## Changes

### `libs/server/Resp/Objects/SortedSetCommands.cs`
- Added GT/LT flag parsing in ZADD command handler
- Flag validation against NX (mutually exclusive)

### `libs/server/Objects/SortedSet/SortedSetObjectImpl.cs`
- Implemented conditional update logic in SortedSetAdd
- GT: only update if new score > current; LT: only if new score < current

### `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs`
- Passed flags through ObjectInput to the object implementation

## Tests Added
- `RespSortedSetTests.ZAddWithGTFlag` — verifies GT-only updates
- `RespSortedSetTests.ZAddWithLTFlag` — verifies LT-only updates
- `RespSortedSetTests.ZAddGTNXMutuallyExclusive` — verifies error on GT+NX

Verdict: Excellent — file-by-file breakdown, specific changes, tests listed. Keep it.

Poor Existing Description (REWRITE)

Fixed the issue mentioned in #456

Verdict: Inadequate — no detail on what changed. Use template.


Phase 2: Code Review

After verifying title/description, perform a code review to catch Garnet-specific issues and general best practice violations before merge.

Review Focus Areas

When reviewing code changes in Garnet, focus on:

  1. Performance and memory safety
    • Unnecessary heap allocations on hot paths (prefer Span<T>, SpanByte, stack allocation)
    • Missing [MethodImpl(MethodImplOptions.AggressiveInlining)] on hot-path methods
    • Missing [MethodImpl(MethodImplOptions.NoInlining)] on cold/exception-throwing methods
    • Blocking calls or unnecessary copies in RESP command handlers
  2. Epoch management
    • LightEpoch acquired but not released on error paths
    • Epoch ownership — only dispose if owned
    • Shared epochs in parallel test scenarios
  3. RESP protocol correctness
    • Argument parsing via parseState.GetArgSliceByRef(i) returning ref PinnedSpanByte
    • Correct RESP response format (using RespWriteUtils helpers)
    • Proper SendAndReset() calls to flush response buffer
    • Command dispatch wired in ProcessBasicCommands/ProcessArrayCommands
  4. Thread safety and concurrency
    • Proper lock usage (TryWriteLock() in spin loops, not CloseLock())
    • Safe concurrent access to shared state
    • Session-local vs shared state boundaries
  5. Test quality
    • TestBase inheritance on test fixtures
    • TestUtils.OnTearDown() called in [TearDown] (checks for leaked epochs)
    • TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true) in [SetUp]
    • Both StackExchange.Redis and LightClient coverage where applicable
  6. Code conventions
    • File header: // Copyright (c) Microsoft Corporation. / // Licensed under the MIT license.
    • TreatWarningsAsErrors — no new warnings introduced
    • XML doc comments on public methods
    • Consistent naming (camelCase private fields, PascalCase constants/statics)
  7. Breaking changes and API surface
    • Changes to IGarnetApi / IGarnetReadApi / IGarnetAdvancedApi
    • Changes to custom extension base classes (CustomRawStringFunctions, CustomObjectBase, etc.)
    • Configuration option changes in GarnetServerOptions

How to Review

# Get the PR diff
gh pr diff XXXXX

# Review specific files
gh pr diff XXXXX -- path/to/file.cs

# Check CI status
gh pr view XXXXX --json statusCheckRollup

Output Format

## Code Review Findings

### 🔴 Critical Issues

**[Issue Title]**
- **File:** [path/to/file.cs]
- **Problem:** [Description]
- **Recommendation:** [Code fix or approach]

### 🟡 Suggestions

- [Suggestion 1]
- [Suggestion 2]

### ✅ Looks Good

- [Positive observation 1]
- [Positive observation 2]

🚨 CRITICAL: Do NOT Post Comments Directly

The pr-finalize skill is ANALYSIS ONLY. Never post comments using gh pr review or gh pr comment.

ActionAllowed?Why
gh pr review --comment❌ NEVERPresent findings to the user instead
gh pr comment❌ NEVERPresent findings to the user instead
Analyze and report findings✅ YESThis is the skill's purpose

Workflow:

  1. This skill: Analyze PR, produce findings in your response
  2. User asks to post: User decides whether and how to share feedback

The user controls when comments are posted. Your job is to analyze and present findings.


Complete Example

See references/complete-example.md for a full agent-optimized PR description showing all elements above applied to a real Garnet change.

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.