---
id: 10054
title: 'chore(ai): add self-review detection to pr-review skill'
state: CLOSED
labels:
  - enhancement
  - ai
assignees:
  - tobiu
createdAt: '2026-04-17T18:33:54Z'
updatedAt: '2026-04-17T18:38:25Z'
githubUrl: 'https://github.com/neomjs/neo/issues/10054'
author: tobiu
commentsCount: 0
parentIssue: null
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy: []
blocking: []
closedAt: '2026-04-17T18:38:25Z'
---
# chore(ai): add self-review detection to pr-review skill

## Problem

When an agent reviews its own PR (authored in the same session), the review reads in third-person congratulatory style ("Great job! Thanks for putting this together! LGTM!"). This is semantically incorrect — the agent is praising its own work.

## Solution

Add a **self-review detection heuristic** to the `pr-review` skill that switches the review tone based on authorship:

### Detection Logic
1. Extract the ticket number from the PR body (`Resolves #N`)
2. Query `query_raw_memories` scoped to the **current session ID** for references to that ticket
3. **Match** → Agent authored this PR in same session → **self-review mode** (first-person, clinical)
4. **No match** → Peer-review mode (third-person, constructive)

### Author Matrix
| 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 |

### File Changes
- `pr-review-guide.md` — Add self-review bullet to Section 1 (Core Philosophy), add detection heuristic to Section 2 (Agent Mandates)
- `pr-review-template.md` — Add alternative self-review opening

Origin Session ID: 144326a4-c1e8-4eee-80e4-b984f3c79ddc

## Timeline

- 2026-04-17T18:33:55Z @tobiu added the `enhancement` label
- 2026-04-17T18:33:55Z @tobiu added the `ai` label
- 2026-04-17T18:34:02Z @tobiu assigned to @tobiu
- 2026-04-17T18:35:20Z @tobiu referenced in commit `6f9afe5` - "chore(ai): add self-review detection to pr-review skill (#10054)

- Section 1: new Self-Review philosophy (first-person, clinical tone)
- Section 2: new step 2 — session-based authorship detection via Memory Core
- Template: dual opening (peer-review vs self-review) with usage note
- Renumbered existing steps 2-4 to 3-5"
- 2026-04-17T18:35:39Z @tobiu cross-referenced by PR #10055
- 2026-04-17T18:38:25Z @tobiu referenced in commit `79ab42d` - "chore(ai): add self-review detection to pr-review skill (#10054) (#10055)

- Section 1: new Self-Review philosophy (first-person, clinical tone)
- Section 2: new step 2 — session-based authorship detection via Memory Core
- Template: dual opening (peer-review vs self-review) with usage note
- Renumbered existing steps 2-4 to 3-5"
- 2026-04-17T18:38:25Z @tobiu closed this issue

