@open-code-review/agents 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -1
- package/commands/address.md +117 -0
- package/commands/map.md +20 -4
- package/commands/post.md +14 -3
- package/commands/review.md +25 -10
- package/commands/show.md +1 -1
- package/commands/translate-review-to-single-human.md +116 -0
- package/package.json +1 -1
- package/skills/ocr/SKILL.md +0 -1
- package/skills/ocr/assets/ocr-gitignore +5 -11
- package/skills/ocr/references/map-template.md +21 -0
- package/skills/ocr/references/map-workflow.md +104 -101
- package/skills/ocr/references/session-files.md +22 -45
- package/skills/ocr/references/session-state.md +124 -104
- package/skills/ocr/references/setup-guard.md +20 -0
- package/skills/ocr/references/workflow.md +138 -126
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The skill definitions, reviewer personas, and workflow references that power Open Code Review.
|
|
4
4
|
|
|
5
|
+
> Browse review output and map artifacts in the [Dashboard](../dashboard/README.md) or through your AI assistant's slash commands.
|
|
6
|
+
|
|
5
7
|
## What This Package Contains
|
|
6
8
|
|
|
7
9
|
```
|
|
@@ -24,6 +26,7 @@ agents/
|
|
|
24
26
|
│ └── reviewer-template.md
|
|
25
27
|
├── commands/ # Slash command definitions
|
|
26
28
|
│ ├── review.md
|
|
29
|
+
│ ├── map.md
|
|
27
30
|
│ ├── doctor.md
|
|
28
31
|
│ ├── history.md
|
|
29
32
|
│ ├── show.md
|
|
@@ -33,6 +36,17 @@ agents/
|
|
|
33
36
|
└── plugin.json
|
|
34
37
|
```
|
|
35
38
|
|
|
39
|
+
## Prerequisites
|
|
40
|
+
|
|
41
|
+
All OCR workflows require the CLI for session state management. Before running any review or map command, ensure the CLI is installed:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install -g @open-code-review/cli
|
|
45
|
+
ocr init
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The CLI provides the `ocr state` commands that track workflow progress through each phase. Without it, reviews will fail at phase transitions.
|
|
49
|
+
|
|
36
50
|
## Installation
|
|
37
51
|
|
|
38
52
|
### Via CLI (Recommended)
|
|
@@ -70,13 +84,24 @@ The `SKILL.md` file defines the **Tech Lead** role—the orchestrator that:
|
|
|
70
84
|
|
|
71
85
|
Each reviewer in `references/reviewers/` is a specialized persona. You can customize the built-in reviewers or add your own.
|
|
72
86
|
|
|
87
|
+
### Map Agent Personas
|
|
88
|
+
|
|
89
|
+
The `/ocr:map` command uses a separate set of specialized agents defined in `references/map-personas/`:
|
|
90
|
+
|
|
91
|
+
| Persona | Role |
|
|
92
|
+
|---------|------|
|
|
93
|
+
| **Map Architect** | Analyzes change topology, determines optimal section groupings and review ordering |
|
|
94
|
+
| **Flow Analyst** | Traces upstream/downstream dependencies, groups related changes by data and control flow |
|
|
95
|
+
| **Requirements Mapper** | Maps changes to requirements/specs when provided, identifies coverage gaps |
|
|
96
|
+
|
|
97
|
+
These agents run with configurable redundancy (default: 2) to increase confidence in groupings. See `.ocr/config.yaml` → `code-review-map.agents` for tuning.
|
|
98
|
+
|
|
73
99
|
## Session Structure
|
|
74
100
|
|
|
75
101
|
OCR uses a **round-first architecture** for session storage:
|
|
76
102
|
|
|
77
103
|
```
|
|
78
104
|
.ocr/sessions/{YYYY-MM-DD}-{branch}/
|
|
79
|
-
├── state.json # Workflow state (current_round, phase)
|
|
80
105
|
├── discovered-standards.md # Project context (shared across rounds)
|
|
81
106
|
├── context.md # Change analysis (shared)
|
|
82
107
|
└── rounds/
|
|
@@ -86,10 +111,18 @@ OCR uses a **round-first architecture** for session storage:
|
|
|
86
111
|
│ └── final.md # Synthesized review
|
|
87
112
|
└── round-2/ # Created on re-review
|
|
88
113
|
└── ...
|
|
114
|
+
├── maps/
|
|
115
|
+
│ ├── run-1/
|
|
116
|
+
│ │ ├── map.md # Code Review Map output
|
|
117
|
+
│ │ └── flow-analysis.md # Dependency graph (Mermaid)
|
|
118
|
+
│ └── run-2/ # Created on re-map
|
|
119
|
+
│ └── ...
|
|
89
120
|
```
|
|
90
121
|
|
|
91
122
|
**Multi-round reviews**: Running `/ocr-review` again on an existing session creates a new round (`round-2/`, `round-3/`, etc.) if the previous round is complete. This enables iterative "review → fix → re-review" workflows while preserving history.
|
|
92
123
|
|
|
124
|
+
**Map runs**: Running `/ocr-map` creates map artifacts in `maps/run-{n}/`. Like review rounds, subsequent runs create new directories without modifying previous ones.
|
|
125
|
+
|
|
93
126
|
See `references/session-files.md` for the complete file manifest.
|
|
94
127
|
|
|
95
128
|
## Commands
|
|
@@ -97,6 +130,7 @@ See `references/session-files.md` for the complete file manifest.
|
|
|
97
130
|
| File | Windsurf | Claude Code / Cursor |
|
|
98
131
|
|------|----------|----------------------|
|
|
99
132
|
| `review.md` | `/ocr-review` | `/ocr:review` |
|
|
133
|
+
| `map.md` | `/ocr-map` | `/ocr:map` |
|
|
100
134
|
| `doctor.md` | `/ocr-doctor` | `/ocr:doctor` |
|
|
101
135
|
| `reviewers.md` | `/ocr-reviewers` | `/ocr:reviewers` |
|
|
102
136
|
| `history.md` | `/ocr-history` | `/ocr:history` |
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Address code review feedback — corroborate, validate, and implement changes from a review's final.md.
|
|
3
|
+
name: "OCR: Address Feedback"
|
|
4
|
+
category: Code Review
|
|
5
|
+
tags: [ocr, address, feedback, review]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Usage**
|
|
9
|
+
```
|
|
10
|
+
/ocr-address [path-to-final.md]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Arguments**
|
|
14
|
+
- `path-to-final.md` (optional): Explicit path to a `final.md` review document. If omitted, auto-detects the current session's latest round `final.md`.
|
|
15
|
+
|
|
16
|
+
**Examples**
|
|
17
|
+
```
|
|
18
|
+
/ocr-address # Auto-detect current session's latest final.md
|
|
19
|
+
/ocr-address .ocr/sessions/2026-03-06-feat-auth/rounds/round-1/final.md # Explicit path
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Guardrails**
|
|
23
|
+
|
|
24
|
+
- You are a distinguished software engineer with deep understanding of software architecture and design patterns.
|
|
25
|
+
- Think step by step — favor composition, clear boundaries, minimal scope, and root-cause fixes.
|
|
26
|
+
- Verify every assumption by reading actual code; never guess at behavior.
|
|
27
|
+
- Do NOT blindly accept every piece of feedback. Use your expertise to corroborate each point against the actual implementation before acting.
|
|
28
|
+
- If feedback is incorrect or based on a misunderstanding of the code, say so clearly with evidence.
|
|
29
|
+
- If feedback is valid but the suggested fix is suboptimal, propose a better alternative.
|
|
30
|
+
- Direct cutover rewrites only — remove all deprecated/dead/unused code; leave nothing behind.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Steps
|
|
35
|
+
|
|
36
|
+
### 1. Resolve Inputs
|
|
37
|
+
|
|
38
|
+
Determine the `final.md` to address:
|
|
39
|
+
|
|
40
|
+
1. If the user provided an explicit file path, use it directly.
|
|
41
|
+
2. If no path is provided, auto-detect the current session:
|
|
42
|
+
```bash
|
|
43
|
+
ocr state show
|
|
44
|
+
```
|
|
45
|
+
Parse the output to find the session directory and current round, then construct the path:
|
|
46
|
+
```
|
|
47
|
+
.ocr/sessions/{session-id}/rounds/round-{N}/final.md
|
|
48
|
+
```
|
|
49
|
+
3. Read the `final.md` file in its entirety.
|
|
50
|
+
4. If the file does not exist or cannot be found, stop and inform the user.
|
|
51
|
+
|
|
52
|
+
Also read any available OCR session context for project awareness:
|
|
53
|
+
- `.ocr/sessions/{session-id}/discovered-standards.md` — project standards
|
|
54
|
+
- `.ocr/sessions/{session-id}/context.md` — change analysis and Tech Lead guidance
|
|
55
|
+
|
|
56
|
+
### 2. Parse and Catalog Feedback Items
|
|
57
|
+
|
|
58
|
+
Break the review into discrete, actionable feedback items.
|
|
59
|
+
|
|
60
|
+
For each item, record:
|
|
61
|
+
- The feedback point (what the reviewer is saying)
|
|
62
|
+
- The file(s) and line(s) referenced (if any)
|
|
63
|
+
- Severity/type: blocker, should-fix, suggestion, nitpick, architecture, performance, security, etc.
|
|
64
|
+
- The originating reviewer persona (if identifiable)
|
|
65
|
+
|
|
66
|
+
Present a concise numbered summary of all feedback items to the user before proceeding.
|
|
67
|
+
|
|
68
|
+
### 3. Gather Implementation Context
|
|
69
|
+
|
|
70
|
+
- Read ALL files referenced by the review feedback.
|
|
71
|
+
- Read any additional files needed to understand the surrounding context (callers, consumers, types, tests).
|
|
72
|
+
- Read project standards from `discovered-standards.md` if available.
|
|
73
|
+
- **DO NOT skip any referenced files** — thorough context is critical for accurate corroboration.
|
|
74
|
+
|
|
75
|
+
### 4. Corroborate and Validate Each Feedback Item
|
|
76
|
+
|
|
77
|
+
For each feedback item from Step 2:
|
|
78
|
+
|
|
79
|
+
- **Read the actual code** at the referenced location.
|
|
80
|
+
- **Assess validity**: Is the feedback accurate? Does the code actually exhibit the issue described?
|
|
81
|
+
- **Classify** each item as one of:
|
|
82
|
+
- **Valid — Will Address**: Feedback is correct and should be implemented.
|
|
83
|
+
- **Valid — Alternative Approach**: Feedback identifies a real issue but the suggested fix is suboptimal; propose a better solution.
|
|
84
|
+
- **Invalid — Respectfully Decline**: Feedback is based on a misunderstanding or is incorrect; explain why with code evidence.
|
|
85
|
+
- **Needs Clarification**: Feedback is ambiguous or requires more context to evaluate.
|
|
86
|
+
|
|
87
|
+
Present the corroboration results as a summary table or list, then **immediately proceed** to Step 5. Do NOT wait for user acknowledgment — this workflow runs autonomously.
|
|
88
|
+
|
|
89
|
+
### 5. Address Feedback
|
|
90
|
+
|
|
91
|
+
For all items classified as **Valid — Will Address** or **Valid — Alternative Approach**:
|
|
92
|
+
|
|
93
|
+
- **Spawn sub-agents in parallel** for independent feedback items. Group items that touch the same files or have logical dependencies, and assign independent groups to separate sub-agents.
|
|
94
|
+
- Each sub-agent should:
|
|
95
|
+
- Implement changes following project coding standards and existing patterns
|
|
96
|
+
- Ensure every change is minimal, focused, and does not introduce regressions
|
|
97
|
+
- For **Alternative Approach** items, implement the better solution proposed in Step 4
|
|
98
|
+
- After all sub-agents complete, review the combined changes for consistency and conflicts.
|
|
99
|
+
|
|
100
|
+
### 6. Report and Verify
|
|
101
|
+
|
|
102
|
+
**Report** a completion summary:
|
|
103
|
+
- Total feedback items reviewed
|
|
104
|
+
- Items addressed (with brief description of each change)
|
|
105
|
+
- Items declined (with reasoning)
|
|
106
|
+
- Items needing clarification (if any)
|
|
107
|
+
|
|
108
|
+
**Verify** correctness by running project checks:
|
|
109
|
+
```bash
|
|
110
|
+
# Run type-checking (adapt to project toolchain)
|
|
111
|
+
npx tsc --noEmit
|
|
112
|
+
|
|
113
|
+
# Run tests (adapt to project toolchain)
|
|
114
|
+
npm test
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
If verification fails, fix the issues before reporting completion.
|
package/commands/map.md
CHANGED
|
@@ -49,7 +49,7 @@ The map command is for **extremely large changesets** that would take multiple h
|
|
|
49
49
|
|
|
50
50
|
---
|
|
51
51
|
|
|
52
|
-
##
|
|
52
|
+
## Session State Check (Phase 0)
|
|
53
53
|
|
|
54
54
|
Before starting any map work, verify the current session state:
|
|
55
55
|
|
|
@@ -67,7 +67,13 @@ ls -la .ocr/sessions/$(date +%Y-%m-%d)-* 2>/dev/null
|
|
|
67
67
|
ls -la .ocr/sessions/{id}/map/runs/ 2>/dev/null
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
### Step 3:
|
|
70
|
+
### Step 3: Check current state
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
ocr state show
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 4: Determine action
|
|
71
77
|
|
|
72
78
|
- **If `--fresh` flag**: Delete the map directory and start from run-1
|
|
73
79
|
- **If map exists and complete**: Start new run (run-{n+1})
|
|
@@ -76,7 +82,7 @@ ls -la .ocr/sessions/{id}/map/runs/ 2>/dev/null
|
|
|
76
82
|
|
|
77
83
|
---
|
|
78
84
|
|
|
79
|
-
##
|
|
85
|
+
## CRITICAL: Required Artifacts (Must Create In Order)
|
|
80
86
|
|
|
81
87
|
> **See `references/map-workflow.md` for the complete workflow.**
|
|
82
88
|
|
|
@@ -84,7 +90,6 @@ You MUST create these files sequentially:
|
|
|
84
90
|
|
|
85
91
|
```
|
|
86
92
|
.ocr/sessions/{YYYY-MM-DD}-{branch}/
|
|
87
|
-
├── state.json # Session state (shared with review)
|
|
88
93
|
├── discovered-standards.md # Phase 1: merged project standards (shared)
|
|
89
94
|
├── requirements.md # Phase 1: user requirements (if provided, shared)
|
|
90
95
|
└── map/
|
|
@@ -96,6 +101,17 @@ You MUST create these files sequentially:
|
|
|
96
101
|
└── map.md # Phase 5: final map output
|
|
97
102
|
```
|
|
98
103
|
|
|
104
|
+
State is managed via `ocr state` CLI commands (stored in SQLite at `.ocr/data/ocr.db`).
|
|
105
|
+
|
|
106
|
+
### State Management Commands
|
|
107
|
+
|
|
108
|
+
| Command | When to Use |
|
|
109
|
+
|---------|-------------|
|
|
110
|
+
| `ocr state init --session-id <id> --branch <branch> --workflow-type map --session-dir <path>` | Create a new session |
|
|
111
|
+
| `ocr state transition --phase <phase> --phase-number <N> --current-map-run <N>` | Each phase boundary |
|
|
112
|
+
| `ocr state show` | Check current session state |
|
|
113
|
+
| `ocr state close` | Close the session (if ending) |
|
|
114
|
+
|
|
99
115
|
### Checkpoint Rules
|
|
100
116
|
|
|
101
117
|
1. **Before Phase 2** (Topology): `discovered-standards.md` MUST exist
|
package/commands/post.md
CHANGED
|
@@ -7,11 +7,12 @@ tags: [ocr, github, pr]
|
|
|
7
7
|
|
|
8
8
|
**Usage**
|
|
9
9
|
```
|
|
10
|
-
/ocr-post [session]
|
|
10
|
+
/ocr-post [session] [--human-translated-review <path>]
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
**Arguments**
|
|
14
14
|
- `session` (optional): Session ID to post. Defaults to most recent.
|
|
15
|
+
- `--human-translated-review <path>` (optional): Explicit path to a human-translated review file to post instead of `final.md`.
|
|
15
16
|
|
|
16
17
|
**Prerequisites**
|
|
17
18
|
- GitHub CLI (`gh`) must be installed and authenticated
|
|
@@ -21,9 +22,19 @@ tags: [ocr, github, pr]
|
|
|
21
22
|
|
|
22
23
|
1. Verify `gh` is available and authenticated
|
|
23
24
|
2. Find the PR for current branch
|
|
24
|
-
3. Determine current round from `state
|
|
25
|
-
4.
|
|
25
|
+
3. Determine current round from `ocr state show` -> `current_round` (or enumerate `rounds/` directory)
|
|
26
|
+
4. **Select the review content to post** (in priority order):
|
|
27
|
+
a. If `--human-translated-review <path>` is provided, use that file
|
|
28
|
+
b. Otherwise, check if `rounds/round-{current_round}/final-human.md` exists -- if yes, prefer it
|
|
29
|
+
c. Fall back to `rounds/round-{current_round}/final.md`
|
|
26
30
|
5. Post as PR comment via `gh pr comment`
|
|
27
31
|
|
|
32
|
+
**Convention Over Configuration**
|
|
33
|
+
|
|
34
|
+
When no `--human-translated-review` flag is given, the post command automatically checks for a human-translated review before falling back to the raw synthesized review. This means if you've run `/ocr-translate-review-to-single-human` beforehand, the translated version is picked up without any extra flags.
|
|
35
|
+
|
|
36
|
+
The explicit `--human-translated-review` flag overrides this auto-detection and lets you point to any arbitrary file.
|
|
37
|
+
|
|
28
38
|
**Reference**
|
|
39
|
+
- Run `/ocr-translate-review-to-single-human` to generate a human-voice translation before posting
|
|
29
40
|
- Run `/ocr-doctor` to check GitHub CLI status
|
package/commands/review.md
CHANGED
|
@@ -32,7 +32,7 @@ tags: [ocr, review, code-review]
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Session State Check (Phase 0)
|
|
36
36
|
|
|
37
37
|
Before starting any review work, you MUST verify the current session state:
|
|
38
38
|
|
|
@@ -45,7 +45,11 @@ ls -la .ocr/sessions/$(date +%Y-%m-%d)-* 2>/dev/null
|
|
|
45
45
|
|
|
46
46
|
### Step 2: If session exists, verify state
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Use `ocr state show` to read current session state AND verify actual files match (see `references/session-files.md` for authoritative names):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
ocr state show
|
|
52
|
+
```
|
|
49
53
|
|
|
50
54
|
| Phase | Verify file exists |
|
|
51
55
|
|-------|-------------------|
|
|
@@ -56,19 +60,20 @@ Read `state.json` AND verify actual files match (see `references/session-files.m
|
|
|
56
60
|
| discourse | `.ocr/sessions/{id}/rounds/round-{n}/discourse.md` |
|
|
57
61
|
| synthesis | `.ocr/sessions/{id}/rounds/round-{n}/final.md` |
|
|
58
62
|
|
|
59
|
-
> **Note**: Phase completion is derived from filesystem (file existence), not from
|
|
63
|
+
> **Note**: Phase completion is derived from filesystem (file existence), not from session state. The `current_phase` field indicates which phase is active.
|
|
60
64
|
|
|
61
65
|
### Step 3: Determine action
|
|
62
66
|
|
|
63
67
|
- **If `--fresh` flag**: Delete the session directory and start from Phase 1
|
|
64
|
-
- **If
|
|
65
|
-
- **If
|
|
66
|
-
- **If state
|
|
68
|
+
- **If session exists and status is `closed`**: Start new round (round-{n+1}) — reuse existing `discovered-standards.md` and `context.md`, create new `rounds/round-{n+1}/` directory
|
|
69
|
+
- **If session exists, status is `active`, and files match**: Resume from `current_phase`
|
|
70
|
+
- **If session exists but state and files mismatch**: Report discrepancy and ask user which to trust
|
|
71
|
+
- **If no state in SQLite but session files exist**: Start new round — use `ocr state init` to recreate the session, then start round-{n+1} from Phase 4 (reuse existing standards and context)
|
|
67
72
|
- **If no session exists**: Start fresh from Phase 1
|
|
68
73
|
|
|
69
74
|
---
|
|
70
75
|
|
|
71
|
-
##
|
|
76
|
+
## CRITICAL: Required Artifacts (Must Create In Order)
|
|
72
77
|
|
|
73
78
|
> **See `references/session-files.md` for the authoritative file manifest.**
|
|
74
79
|
|
|
@@ -76,8 +81,7 @@ You MUST create these files sequentially. **Do NOT skip to `final.md`.**
|
|
|
76
81
|
|
|
77
82
|
```
|
|
78
83
|
.ocr/sessions/{YYYY-MM-DD}-{branch}/
|
|
79
|
-
├──
|
|
80
|
-
├── discovered-standards.md # Phase 1: merged project standards
|
|
84
|
+
├── discovered-standards.md # Phase 1: merged project standards
|
|
81
85
|
├── requirements.md # Phase 1: user requirements (if provided)
|
|
82
86
|
├── context.md # Phase 2+3: change summary + Tech Lead guidance
|
|
83
87
|
└── rounds/
|
|
@@ -91,6 +95,17 @@ You MUST create these files sequentially. **Do NOT skip to `final.md`.**
|
|
|
91
95
|
└── final.md # Phase 7: ONLY after all above exist
|
|
92
96
|
```
|
|
93
97
|
|
|
98
|
+
State is managed via `ocr state` CLI commands (stored in SQLite at `.ocr/data/ocr.db`).
|
|
99
|
+
|
|
100
|
+
### State Management Commands
|
|
101
|
+
|
|
102
|
+
| Command | When to Use |
|
|
103
|
+
|---------|-------------|
|
|
104
|
+
| `ocr state init --session-id <id> --branch <branch> --workflow-type review --session-dir <path>` | Phase 1: Create the session |
|
|
105
|
+
| `ocr state transition --phase <phase> --phase-number <N> [--current-round <N>]` | Each phase boundary |
|
|
106
|
+
| `ocr state show` | Check current session state |
|
|
107
|
+
| `ocr state close` | Phase 8: Close the session |
|
|
108
|
+
|
|
94
109
|
### Checkpoint Rules
|
|
95
110
|
|
|
96
111
|
1. **Before Phase 2** (Change Analysis): `discovered-standards.md` MUST exist
|
|
@@ -101,7 +116,7 @@ You MUST create these files sequentially. **Do NOT skip to `final.md`.**
|
|
|
101
116
|
|
|
102
117
|
### Why This Matters
|
|
103
118
|
|
|
104
|
-
The `ocr progress` CLI
|
|
119
|
+
The `ocr progress` CLI reads session state from SQLite for real-time progress display. If you skip phases or don't call `ocr state transition`, the progress display breaks and users see incorrect state.
|
|
105
120
|
|
|
106
121
|
---
|
|
107
122
|
|
package/commands/show.md
CHANGED
|
@@ -16,7 +16,7 @@ tags: [ocr, history, sessions]
|
|
|
16
16
|
**Steps**
|
|
17
17
|
|
|
18
18
|
1. If no session specified, find most recent in `.ocr/sessions/`
|
|
19
|
-
2. Determine current round from `state
|
|
19
|
+
2. Determine current round from `ocr state show` → `current_round` (or enumerate `rounds/` directory)
|
|
20
20
|
3. Read and display `rounds/round-{current_round}/final.md` (synthesized review)
|
|
21
21
|
4. Optionally show individual reviewer files from `rounds/round-{n}/reviews/` if requested
|
|
22
22
|
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Translate a multi-reviewer code review into a single human-voice GitHub PR comment.
|
|
3
|
+
name: "OCR: Translate Review to Single Human"
|
|
4
|
+
category: Code Review
|
|
5
|
+
tags: [ocr, post, github, human-voice]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Usage**
|
|
9
|
+
```
|
|
10
|
+
/ocr-translate-review-to-single-human [session] [--round <N>]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Arguments**
|
|
14
|
+
- `session` (optional): Session ID to translate. Defaults to most recent.
|
|
15
|
+
- `--round <N>` (optional): Round number to translate. Defaults to current round.
|
|
16
|
+
|
|
17
|
+
**Examples**
|
|
18
|
+
```
|
|
19
|
+
/ocr-translate-review-to-single-human # Translate latest round of latest session
|
|
20
|
+
/ocr-translate-review-to-single-human --round 2 # Translate round 2
|
|
21
|
+
/ocr-translate-review-to-single-human 2026-03-06-feat-auth # Translate specific session
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Prerequisites**
|
|
25
|
+
- A completed review round with `final.md` and reviewer outputs in `reviews/*.md`
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Steps
|
|
30
|
+
|
|
31
|
+
1. **Locate the session and round**
|
|
32
|
+
- If no session specified, find the most recent in `.ocr/sessions/`
|
|
33
|
+
- Determine the round number from `ocr state show` -> `current_round`, or use `--round` if provided
|
|
34
|
+
- Verify the round directory exists: `.ocr/sessions/{id}/rounds/round-{N}/`
|
|
35
|
+
|
|
36
|
+
2. **Read the source material**
|
|
37
|
+
- Read `rounds/round-{N}/final.md` for the synthesized review
|
|
38
|
+
- Read ALL individual reviewer outputs in `rounds/round-{N}/reviews/*.md` for raw findings
|
|
39
|
+
|
|
40
|
+
3. **Apply the human voice translation** following the rules below
|
|
41
|
+
|
|
42
|
+
4. **Write the output** to `rounds/round-{N}/final-human.md` in the same round directory
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Translation Rules
|
|
47
|
+
|
|
48
|
+
You are rewriting a multi-reviewer code review into a single PR comment that reads like one real person wrote it after carefully reading through the code. Not an AI. Not a committee. Just a developer who spent time on this and has opinions.
|
|
49
|
+
|
|
50
|
+
### Voice & Tone (Google code review guidelines)
|
|
51
|
+
|
|
52
|
+
- Comment on the CODE, never the developer. "This function could be simplified" not "you wrote this wrong."
|
|
53
|
+
- Always explain WHY something matters. Don't just say "change this" -- say why it's worth changing.
|
|
54
|
+
- Label severity naturally: prefix minor stuff with "Nit:" or "Minor:", flag blockers clearly.
|
|
55
|
+
- When something is good, say so briefly. Don't over-praise, but acknowledge solid work where you see it.
|
|
56
|
+
- Be direct. "This needs a bounds check" is better than "It might be worth considering whether bounds checking could potentially be beneficial."
|
|
57
|
+
|
|
58
|
+
### Writing Style -- Sound Like a Human
|
|
59
|
+
|
|
60
|
+
Your writing must be indistinguishable from a real person's PR review. Follow these rules:
|
|
61
|
+
|
|
62
|
+
**Sentence variety**: Mix short punchy sentences with longer ones. Start some with "So", "Also", "Oh and", "One thing --". Real people don't start every sentence the same way.
|
|
63
|
+
|
|
64
|
+
**Word choice**: Pick unexpected but natural words. Say "this is a bit gnarly" not "this is complex". Say "nice catch" not "good observation". Say "I'd probably" not "I would recommend".
|
|
65
|
+
|
|
66
|
+
**Banned words and phrases** (these are AI tells -- NEVER use them):
|
|
67
|
+
- "comprehensive", "robust", "leverage", "utilize", "furthermore", "additionally"
|
|
68
|
+
- "ensure", "facilitate", "streamline", "encompass", "delve"
|
|
69
|
+
- "it's worth noting", "it should be noted", "upon review"
|
|
70
|
+
|
|
71
|
+
**Structure disruption**: Don't use the classic AI pattern of intro paragraph -> numbered list -> conclusion. Instead, jump right into the review. Maybe start with the most interesting finding, or a quick overall impression. Let the structure feel organic -- group related things but don't over-organize.
|
|
72
|
+
|
|
73
|
+
**Natural imperfections**: Real reviews have personality. Use dashes for asides -- like this -- and parenthetical thoughts (when they fit). An occasional "tbh" or "fwiw" is fine. Contractions are mandatory ("don't", "isn't", "I'd").
|
|
74
|
+
|
|
75
|
+
**Emotional reality**: If something is genuinely concerning, let that come through -- "this worries me a bit because..." If something is clever, say so -- "oh this is a neat approach." If something is tedious but necessary, acknowledge it -- "I know this is annoying but we really need..."
|
|
76
|
+
|
|
77
|
+
### Severity Labels
|
|
78
|
+
|
|
79
|
+
Every technical finding must include a severity label:
|
|
80
|
+
|
|
81
|
+
| Label | Meaning |
|
|
82
|
+
|-------|---------|
|
|
83
|
+
| **Blocker** | Must fix before merge. Bugs, data loss risks, security issues. |
|
|
84
|
+
| **Should-fix** | Strongly recommended. Not a ship-blocker but will cause pain later. |
|
|
85
|
+
| **Suggestion** | Take it or leave it. A better approach exists but current code works. |
|
|
86
|
+
| **Nit** | Style, naming, minor readability. Prefix with "Nit:" naturally in the text. |
|
|
87
|
+
|
|
88
|
+
### Content Rules (NON-NEGOTIABLE)
|
|
89
|
+
|
|
90
|
+
- Preserve EVERY substantive technical finding from the source material. Do not drop, skip, or summarize away any concrete issue.
|
|
91
|
+
- Include specific file paths and line numbers exactly as referenced in the source material.
|
|
92
|
+
- Consolidate duplicates -- if two reviewers flagged the same thing, mention it once.
|
|
93
|
+
- Strip all meta-commentary about "the review process" or "analysis methodology."
|
|
94
|
+
- Use GitHub-flavored markdown.
|
|
95
|
+
|
|
96
|
+
### Absolute Don'ts
|
|
97
|
+
|
|
98
|
+
- Never mention multiple reviewers, AI, agents, automated analysis, or tools.
|
|
99
|
+
- Never use "the team", "our analysis", "upon review", "it was noted that".
|
|
100
|
+
- Never write a formulaic sign-off or summary conclusion paragraph.
|
|
101
|
+
- Never start with "Overall, this is a..." -- that's the number one AI tell.
|
|
102
|
+
- Never mention this translation process or that you're rewriting anything.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Output Format
|
|
107
|
+
|
|
108
|
+
Write ONLY the review comment in GitHub-flavored markdown. Jump straight into the review -- no meta-preamble, no explanation of what you're doing, no wrapper text.
|
|
109
|
+
|
|
110
|
+
The output goes directly into `final-human.md` and will be posted as-is to a GitHub PR.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
**Reference**
|
|
115
|
+
- Use `/ocr-post` to post the translated review to GitHub
|
|
116
|
+
- Use `/ocr-show` to view the original synthesized review
|
package/package.json
CHANGED
package/skills/ocr/SKILL.md
CHANGED
|
@@ -141,7 +141,6 @@ All review artifacts are stored in `.ocr/sessions/{YYYY-MM-DD}-{branch}/`:
|
|
|
141
141
|
|
|
142
142
|
| File | Description |
|
|
143
143
|
|------|-------------|
|
|
144
|
-
| `state.json` | Session state for progress tracking |
|
|
145
144
|
| `discovered-standards.md` | Merged project context (shared) |
|
|
146
145
|
| `requirements.md` | User-provided requirements (shared, if any) |
|
|
147
146
|
| `context.md` | Change summary and Tech Lead guidance (shared) |
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
# OCR
|
|
2
|
-
# Copy this to .ocr/.gitignore to exclude review sessions from git
|
|
3
|
-
|
|
4
|
-
# Exclude all session data by default
|
|
1
|
+
# OCR:START — managed by open-code-review (do not edit this block)
|
|
5
2
|
sessions/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
# Keep the directory structure
|
|
12
|
-
!.gitignore
|
|
3
|
+
data/
|
|
4
|
+
*.db-shm
|
|
5
|
+
*.db-wal
|
|
6
|
+
# OCR:END
|
|
@@ -143,6 +143,17 @@ Template for the final map output (`map.md`). Optimized for reviewer workflow: u
|
|
|
143
143
|
|
|
144
144
|
---
|
|
145
145
|
|
|
146
|
+
## Section Dependencies
|
|
147
|
+
|
|
148
|
+
> How sections connect. Used by the dashboard dependency graph.
|
|
149
|
+
|
|
150
|
+
| From | To | Relationship |
|
|
151
|
+
|------|-----|-------------|
|
|
152
|
+
| 1: {Section Title} | 2: {Section Title} | {3-8 word description of dependency} |
|
|
153
|
+
| 2: {Section Title} | 3: {Section Title} | {3-8 word description of dependency} |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
146
157
|
## File Index
|
|
147
158
|
|
|
148
159
|
| File | Section |
|
|
@@ -200,6 +211,16 @@ Map suggestions to requirements or concerns. Do NOT perform code review — just
|
|
|
200
211
|
**Good**: "Complex pricing conditionals — verify tier logic matches REQ-4"
|
|
201
212
|
**Bad**: "This function has a bug on line 42" (that's code review)
|
|
202
213
|
|
|
214
|
+
### Section Dependencies
|
|
215
|
+
|
|
216
|
+
Populate from cross-file flows identified during flow analysis:
|
|
217
|
+
|
|
218
|
+
- Use `{number}: {Title}` format matching section headings (e.g., `1: Authentication Flow`)
|
|
219
|
+
- Direction follows call/data flow: caller section → callee section
|
|
220
|
+
- Relationship is a 3-8 word description (e.g., "Auth middleware protects routes")
|
|
221
|
+
- Only include meaningful cross-section dependencies — not every possible connection
|
|
222
|
+
- If sections are independent, leave the table body empty (keep headers)
|
|
223
|
+
|
|
203
224
|
### Requirements Coverage Indicators
|
|
204
225
|
|
|
205
226
|
- ✅ Full coverage
|