---
number: 10055
title: 'chore(ai): add self-review detection to pr-review skill (#10054)'
author: tobiu
state: MERGED
createdAt: '2026-04-17T18:35:37Z'
updatedAt: '2026-04-17T18:38:27Z'
closedAt: '2026-04-17T18:38:23Z'
mergedAt: '2026-04-17T18:38:23Z'
head: agent/10054-pr-review-self-detection
base: dev
url: 'https://github.com/neomjs/neo/pull/10055'
---
## Summary

Adds a **self-review detection heuristic** to the pr-review skill so agents use first-person clinical tone when reviewing their own PRs instead of third-person congratulatory language.

## Problem

When an agent authors a PR and then reviews it in the same session, the review reads as self-congratulation:
> "Thanks for putting this together! Great approach... LGTM!"

This sounds off when the reviewer and the author are the same entity.

## Detection Heuristic

The detection uses the **Memory Core session ID** as the discriminator:

1. After `get_conversation`, extract ticket number from PR body (`Resolves #N`)
2. Query `query_raw_memories(query: '#N')` scoped to current session ID
3. **Match** → self-review mode (first-person, clinical)
4. **No match** → peer-review mode (third-person, constructive)

This correctly handles all four author/reviewer combinations:
| Author | Reviewer | Session Match | Mode |
|---|---|---|---|
| Agent (session A) | Same agent (session A) | ✅ | **Self-review** |
| Agent (session A) | Different agent (session B) | ❌ | Peer-review |
| Human | Agent | ❌ | Peer-review |
| External contributor | Agent | ❌ | Peer-review |

## Changes

### pr-review-guide.md
- Section 1: New `Self-Review (same session)` philosophy bullet
- Section 2: New step 2 `Self-Review Detection` with session-based authorship check
- Renumbered existing steps 2→3, 3→4, 4→5

### pr-review-template.md
- Dual opening block: peer-review (friendly) vs self-review (clinical)
- Usage note: "Use exactly one opening based on detection result"

Resolves #10054

## Comments

### `@tobiu` commented on 2026-04-17T18:36:00Z

**Input from Claude Opus 4.6 (Antigravity):**

> ❋ # PR Review Summary
> 
> **Status:** Approved
> 
> **Self-Review Opening:** Self-review of #10054. This implementation chose a session-based Memory Core heuristic over a simple GitHub login comparison because the login is shared infrastructure (human and agent both operate as `tobiu`). The session ID is the true identity discriminator.
> 
> ---
> 
> ### 📊 Evaluation Metrics
> *   **`[ARCH_ALIGNMENT]`**: 90 - Uses the existing Memory Core query infrastructure (`query_raw_memories`) rather than inventing new detection mechanisms. No new tools or code needed.
> *   **`[CONTENT_COMPLETENESS]`**: 90 - Both the guide and template are updated. The detection heuristic is documented with clear step-by-step instructions.
> *   **`[EXECUTION_QUALITY]`**: 85 - Clean diff. One minor concern: the detection relies on `Resolves #N` being present in the PR body. If an agent omits the ticket reference, detection falls back to peer-review mode (safe default, but worth noting).
> *   **`[PRODUCTIVITY]`**: 100 - Matches ticket scope exactly.
> *   **`[IMPACT]`**: 50 - Improves review quality but is a tone/style enhancement, not a functional change.
> *   **`[COMPLEXITY]`**: 15 - Two markdown file edits.
> *   **`[EFFORT_PROFILE]`**: Quick Win - Minimal complexity for a meaningful reduction in uncanny-valley self-congratulation.
> 
> ---
> 
> ### 🕸️ Context & Graph Linking
> *   **Target Epic / Issue ID:** Resolves #10054
> *   **Related Graph Nodes:** `pr-review` skill, Memory Core `query_raw_memories`, `ticket-intake` skill (#10051/#10053)
> 
> ---
> 
> ### 🧠 Graph Ingestion Notes
> 
> *   **`[KB_GAP]`**: N/A
> *   **`[TOOLING_GAP]`**: N/A
> *   **`[RETROSPECTIVE]`**: The session-based identity pattern (Memory Core session ID as the agent fingerprint) has broader applicability beyond PR reviews. Any workflow that needs "did I do this?" authorship detection can reuse this heuristic. This is the first time we've formally distinguished agent identity from GitHub account identity in a protocol document.
> 
> ---
> 
> ### 📋 Required Actions
> 
> None. Ready to merge.

---

