@open-code-review/agents 1.5.1 → 1.7.0

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.
Files changed (36) hide show
  1. package/README.md +91 -83
  2. package/commands/create-reviewer.md +66 -0
  3. package/commands/review.md +6 -1
  4. package/commands/sync-reviewers.md +93 -0
  5. package/package.json +1 -1
  6. package/skills/ocr/references/final-template.md +71 -12
  7. package/skills/ocr/references/map-workflow.md +41 -1
  8. package/skills/ocr/references/reviewer-task.md +38 -0
  9. package/skills/ocr/references/reviewers/accessibility.md +50 -0
  10. package/skills/ocr/references/reviewers/ai.md +51 -0
  11. package/skills/ocr/references/reviewers/anders-hejlsberg.md +54 -0
  12. package/skills/ocr/references/reviewers/architect.md +51 -0
  13. package/skills/ocr/references/reviewers/backend.md +50 -0
  14. package/skills/ocr/references/reviewers/data.md +50 -0
  15. package/skills/ocr/references/reviewers/devops.md +50 -0
  16. package/skills/ocr/references/reviewers/docs-writer.md +54 -0
  17. package/skills/ocr/references/reviewers/dx.md +50 -0
  18. package/skills/ocr/references/reviewers/frontend.md +50 -0
  19. package/skills/ocr/references/reviewers/fullstack.md +51 -0
  20. package/skills/ocr/references/reviewers/infrastructure.md +50 -0
  21. package/skills/ocr/references/reviewers/john-ousterhout.md +54 -0
  22. package/skills/ocr/references/reviewers/kamil-mysliwiec.md +54 -0
  23. package/skills/ocr/references/reviewers/kent-beck.md +54 -0
  24. package/skills/ocr/references/reviewers/kent-dodds.md +54 -0
  25. package/skills/ocr/references/reviewers/martin-fowler.md +55 -0
  26. package/skills/ocr/references/reviewers/mobile.md +50 -0
  27. package/skills/ocr/references/reviewers/performance.md +50 -0
  28. package/skills/ocr/references/reviewers/reliability.md +51 -0
  29. package/skills/ocr/references/reviewers/rich-hickey.md +56 -0
  30. package/skills/ocr/references/reviewers/sandi-metz.md +54 -0
  31. package/skills/ocr/references/reviewers/staff-engineer.md +51 -0
  32. package/skills/ocr/references/reviewers/tanner-linsley.md +55 -0
  33. package/skills/ocr/references/reviewers/vladimir-khorikov.md +55 -0
  34. package/skills/ocr/references/session-files.md +15 -5
  35. package/skills/ocr/references/session-state.md +73 -0
  36. package/skills/ocr/references/workflow.md +108 -19
package/README.md CHANGED
@@ -1,8 +1,34 @@
1
1
  # @open-code-review/agents
2
2
 
3
- The skill definitions, reviewer personas, and workflow references that power Open Code Review.
3
+ Skill definitions, reviewer personas, and workflow references that power [Open Code Review](https://github.com/spencermarx/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.
5
+ ## Getting Started
6
+
7
+ All OCR workflows require the CLI for session state management. Install it first:
8
+
9
+ ```bash
10
+ # 1. Install the CLI
11
+ npm install -g @open-code-review/cli
12
+
13
+ # 2. Initialize in your project (copies these assets to .ocr/)
14
+ cd your-project
15
+ ocr init
16
+ ```
17
+
18
+ To update after a package upgrade:
19
+
20
+ ```bash
21
+ ocr update
22
+ ```
23
+
24
+ This updates skills and workflow references while **preserving your `.ocr/config.yaml`** and **all reviewer personas** (both default and custom).
25
+
26
+ ### Via Claude Code Plugin
27
+
28
+ ```bash
29
+ /plugin marketplace add spencermarx/open-code-review
30
+ /plugin install ocr@aclarify
31
+ ```
6
32
 
7
33
  ## What This Package Contains
8
34
 
@@ -17,64 +43,50 @@ agents/
17
43
  │ │ ├── discourse.md # Multi-agent debate rules
18
44
  │ │ ├── final-template.md # Final review template
19
45
  │ │ └── reviewers/ # Persona definitions (customizable)
20
- │ │ ├── principal.md # Architecture, design patterns
21
- │ │ ├── quality.md # Code style, best practices
22
- │ │ ├── security.md # Auth, data handling, vulnerabilities
23
- │ │ └── testing.md # Coverage, edge cases
46
+ │ │ ├── principal.md # Architecture, design patterns
47
+ │ │ ├── quality.md # Code style, best practices
48
+ │ │ ├── security.md # Auth, data handling, vulnerabilities
49
+ │ │ ├── testing.md # Coverage, edge cases
50
+ │ │ ├── martin-fowler.md # Famous engineer persona
51
+ │ │ └── ... # 28 personas total
24
52
  │ └── assets/
25
- │ ├── config.yaml # Default configuration
53
+ │ ├── config.yaml # Default configuration
26
54
  │ └── reviewer-template.md
27
- ├── commands/ # Slash command definitions
55
+ ├── commands/ # Slash command definitions
28
56
  │ ├── review.md
29
57
  │ ├── map.md
30
58
  │ ├── doctor.md
31
59
  │ ├── history.md
32
60
  │ ├── show.md
33
61
  │ ├── reviewers.md
34
- └── post.md
35
- └── .claude-plugin/ # Claude Code plugin manifest
62
+ ├── post.md
63
+ │ ├── address.md
64
+ │ └── translate-review-to-single-human.md
65
+ └── .claude-plugin/ # Claude Code plugin manifest
36
66
  └── plugin.json
37
67
  ```
38
68
 
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
-
50
- ## Installation
51
-
52
- ### Via CLI (Recommended)
53
-
54
- The CLI copies these assets to your project's `.ocr/` directory:
55
-
56
- ```bash
57
- npx @open-code-review/cli init
58
- ```
59
-
60
- To update after a package upgrade:
61
-
62
- ```bash
63
- ocr update
64
- ```
65
-
66
- This updates skills and workflow references while **preserving your `.ocr/config.yaml`** and **all reviewer personas** (both default and custom).
69
+ ## Commands
67
70
 
68
- ### Via Claude Code Plugin
71
+ | File | Windsurf | Claude Code / Cursor |
72
+ |------|----------|----------------------|
73
+ | `review.md` | `/ocr-review` | `/ocr:review` |
74
+ | `map.md` | `/ocr-map` | `/ocr:map` |
75
+ | `post.md` | `/ocr-post` | `/ocr:post` |
76
+ | `doctor.md` | `/ocr-doctor` | `/ocr:doctor` |
77
+ | `reviewers.md` | `/ocr-reviewers` | `/ocr:reviewers` |
78
+ | `history.md` | `/ocr-history` | `/ocr:history` |
79
+ | `show.md` | `/ocr-show` | `/ocr:show` |
80
+ | `address.md` | `/ocr-address` | `/ocr:address` |
81
+ | `create-reviewer.md` | `/ocr-create-reviewer` | `/ocr:create-reviewer` |
82
+ | `sync-reviewers.md` | `/ocr-sync-reviewers` | `/ocr:sync-reviewers` |
83
+ | `translate-review-to-single-human.md` | `/ocr-translate-review-to-single-human` | `/ocr:translate-review-to-single-human` |
69
84
 
70
- ```bash
71
- /plugin marketplace add spencermarx/open-code-review
72
- /plugin install ocr@aclarify
73
- ```
85
+ **Why two formats?** Windsurf requires flat command files with a prefix (`/ocr-command`), while Claude Code and Cursor support subdirectories (`/ocr:command`). Both invoke the same underlying functionality.
74
86
 
75
87
  ## Skill Architecture
76
88
 
77
- The `SKILL.md` file defines the **Tech Lead** role—the orchestrator that:
89
+ The `SKILL.md` file defines the **Tech Lead** role the orchestrator that:
78
90
 
79
91
  1. Discovers project context (config, OpenSpec, reference files)
80
92
  2. Analyzes changes and identifies risk areas
@@ -82,62 +94,58 @@ The `SKILL.md` file defines the **Tech Lead** role—the orchestrator that:
82
94
  4. Facilitates discourse between reviewers
83
95
  5. Synthesizes findings into a unified review
84
96
 
85
- Each reviewer in `references/reviewers/` is a specialized persona. You can customize the built-in reviewers or add your own.
97
+ ### Reviewer Personas
98
+
99
+ 28 personas across four tiers:
100
+
101
+ | Tier | Personas |
102
+ |------|----------|
103
+ | **Generalists** | Principal, Quality, Fullstack, Staff Engineer, Architect |
104
+ | **Specialists** | Security, Testing, Frontend, Backend, Performance, DevOps, Infrastructure, Reliability, Mobile, Data, DX, Docs Writer, Accessibility, AI |
105
+ | **Famous Engineers** | Martin Fowler, Kent Beck, Sandi Metz, Rich Hickey, Kent Dodds, Anders Hejlsberg, John Ousterhout, Kamil Mysliwiec, Tanner Linsley, Vladimir Khorikov |
106
+ | **Custom** | Your own domain-specific reviewers |
107
+
108
+ Famous Engineer personas review through the lens of each engineer's published work and philosophy — e.g., Martin Fowler focuses on refactoring and domain modeling, Kent Beck on test-driven development, Sandi Metz on object-oriented design.
109
+
110
+ **Create custom reviewers** via the `/ocr:create-reviewer` command or by adding `.md` files to `.ocr/skills/references/reviewers/`. See the [reviewer template](skills/ocr/assets/reviewer-template.md).
111
+
112
+ **Ephemeral reviewers** can be added per-review with `--reviewer` — no persistence required. See the `review.md` command spec for details.
86
113
 
87
114
  ### Map Agent Personas
88
115
 
89
- The `/ocr:map` command uses a separate set of specialized agents defined in `references/map-personas/`:
116
+ The `/ocr:map` command uses specialized agents:
90
117
 
91
118
  | Persona | Role |
92
119
  |---------|------|
93
- | **Map Architect** | Analyzes change topology, determines optimal section groupings and review ordering |
120
+ | **Map Architect** | Analyzes change topology, determines section groupings and review ordering |
94
121
  | **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 |
122
+ | **Requirements Mapper** | Maps changes to requirements/specs, identifies coverage gaps |
96
123
 
97
- These agents run with configurable redundancy (default: 2) to increase confidence in groupings. See `.ocr/config.yaml` → `code-review-map.agents` for tuning.
124
+ These run with configurable redundancy (default: 2). See `.ocr/config.yaml` → `code-review-map.agents`.
98
125
 
99
126
  ## Session Structure
100
127
 
101
- OCR uses a **round-first architecture** for session storage:
102
-
103
128
  ```
104
129
  .ocr/sessions/{YYYY-MM-DD}-{branch}/
105
- ├── discovered-standards.md # Project context (shared across rounds)
106
- ├── context.md # Change analysis (shared)
130
+ ├── discovered-standards.md # Project context (shared across rounds)
131
+ ├── context.md # Change analysis (shared)
107
132
  └── rounds/
108
133
  ├── round-1/
109
- │ ├── reviews/ # Individual reviewer outputs
110
- │ ├── discourse.md # Cross-reviewer discussion
111
- └── final.md # Synthesized review
112
- └── round-2/ # Created on re-review
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
- └── ...
134
+ │ ├── reviews/ # Individual reviewer outputs
135
+ ├── principal-1.md
136
+ │ ├── quality-1.md
137
+ │ │ └── ephemeral-1.md # From --reviewer (if used)
138
+ │ ├── discourse.md # Cross-reviewer discussion
139
+ │ └── final.md # Synthesized review
140
+ └── round-2/ # Created on re-review
141
+ ├── map/
142
+ │ └── runs/
143
+ └── run-1/
144
+ ├── map.md # Code Review Map
145
+ │ └── flow-analysis.md # Dependency graph (Mermaid)
120
146
  ```
121
147
 
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.
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
-
126
- See `references/session-files.md` for the complete file manifest.
127
-
128
- ## Commands
129
-
130
- | File | Windsurf | Claude Code / Cursor |
131
- |------|----------|----------------------|
132
- | `review.md` | `/ocr-review` | `/ocr:review` |
133
- | `map.md` | `/ocr-map` | `/ocr:map` |
134
- | `doctor.md` | `/ocr-doctor` | `/ocr:doctor` |
135
- | `reviewers.md` | `/ocr-reviewers` | `/ocr:reviewers` |
136
- | `history.md` | `/ocr-history` | `/ocr:history` |
137
- | `show.md` | `/ocr-show` | `/ocr:show` |
138
- | `post.md` | `/ocr-post` | `/ocr:post` |
139
-
140
- **Why two formats?** Windsurf requires flat command files with a prefix (`/ocr-command`), while Claude Code and Cursor support subdirectories (`/ocr:command`). Both invoke the same underlying functionality.
148
+ Running `/ocr-review` again on an existing session creates a new round if the previous round is complete. See `references/session-files.md` for the complete file manifest.
141
149
 
142
150
  ## License
143
151
 
@@ -0,0 +1,66 @@
1
+ ---
2
+ description: Create a new custom reviewer from a natural language description.
3
+ name: "OCR: Create Reviewer"
4
+ category: Code Review
5
+ tags: [ocr, reviewers, create]
6
+ ---
7
+
8
+ **Usage**
9
+ ```
10
+ /ocr-create-reviewer {name} --focus "{description}"
11
+ ```
12
+
13
+ **Examples**
14
+ ```
15
+ create-reviewer rust-safety --focus "Memory safety, ownership patterns, lifetime management, unsafe block auditing"
16
+ create-reviewer api-design --focus "REST API design, backwards compatibility, versioning, error response consistency"
17
+ create-reviewer graphql --focus "Schema design, resolver efficiency, N+1 queries, type safety"
18
+ ```
19
+
20
+ **What it does**
21
+
22
+ Creates a new reviewer markdown file in `.ocr/skills/references/reviewers/`, following the standard reviewer template structure, and automatically syncs the metadata so the dashboard can see the new reviewer.
23
+
24
+ **Steps**
25
+
26
+ 1. **Parse arguments**: Extract the reviewer name and `--focus` description from the arguments.
27
+ - Normalize the name to a slug: lowercase, hyphens for spaces, alphanumeric + hyphens only
28
+ - Example: "API Design" → `api-design`
29
+
30
+ 2. **Check for duplicates**: Verify `.ocr/skills/references/reviewers/{slug}.md` does NOT already exist.
31
+ - If it exists, report: "Reviewer `{slug}` already exists. Edit the file directly at `.ocr/skills/references/reviewers/{slug}.md`."
32
+ - Stop — do not overwrite.
33
+
34
+ 3. **Read the template** (REQUIRED — this is the source of truth for reviewer structure):
35
+ Read `.ocr/skills/assets/reviewer-template.md`. This file defines the exact sections, ordering, and format every reviewer MUST follow. Do not invent sections or skip sections — adhere to the template.
36
+
37
+ 4. **Read exemplars**: Read 2-3 existing reviewer files from `.ocr/skills/references/reviewers/` as style reference. Good choices:
38
+ - One holistic reviewer (e.g., `architect.md` or `fullstack.md`)
39
+ - One specialist reviewer close to the requested domain (if applicable)
40
+ - Study the tone, section depth, and specificity level
41
+
42
+ 5. **Generate the reviewer file**: Write a complete reviewer markdown file that follows the template structure from step 3:
43
+ - Starts with `# {Display Name} Reviewer` (title case, no "Principal" prefix — all reviewers are senior by default)
44
+ - Contains every section from the template (`## Your Focus Areas`, `## Your Review Approach`, `## What You Look For`, `## Your Output Style`, `## Agency Reminder`)
45
+ - Uses specific, actionable language (not generic advice)
46
+ - Reflects the user's `--focus` description as the primary lens
47
+ - Matches the depth and tone of the exemplars from step 4
48
+
49
+ 6. **Write the file**: Save to `.ocr/skills/references/reviewers/{slug}.md`
50
+
51
+ 7. **Sync metadata**: After writing the file, run the sync-reviewers workflow to update `reviewers-meta.json`.
52
+ Follow the instructions in `.ocr/commands/sync-reviewers.md` — this reads ALL reviewer files (including the one you just created), extracts metadata with semantic understanding, and pipes through the CLI for validated persistence.
53
+
54
+ 8. **Report**: Confirm the new reviewer was created with:
55
+ - Name and slug
56
+ - Focus areas extracted
57
+ - Tier classification (`custom` for user-created reviewers)
58
+ - Total reviewer count after sync
59
+
60
+ **Important**
61
+
62
+ - Do NOT use the `Principal` prefix in the title — all reviewers are assumed to be senior/principal level by default.
63
+ - Follow the exact template structure from the exemplars — consistency matters for the dashboard parser.
64
+ - The `--focus` description is guidance, not a literal copy. Transform it into well-structured focus areas and review checklists.
65
+ - Always run the sync step — the dashboard depends on `reviewers-meta.json` being up to date.
66
+ - The `ocr` CLI path may be provided in the CLI Resolution section above. If so, use that path instead of bare `ocr`.
@@ -7,12 +7,14 @@ tags: [ocr, review, code-review]
7
7
 
8
8
  **Usage**
9
9
  ```
10
- /ocr-review [target] [--fresh]
10
+ /ocr-review [target] [--fresh] [--team <ids>] [--reviewer "<description>"]
11
11
  ```
12
12
 
13
13
  **Arguments**
14
14
  - `target` (optional): Branch, commit, or file to review. Defaults to staged changes.
15
15
  - `--fresh` (optional): Clear any existing session for today's date and start from scratch.
16
+ - `--team` (optional): Override the default reviewer team. Format: `reviewer-id:count,reviewer-id:count`. Example: `--team principal:2,martin-fowler:1`.
17
+ - `--reviewer` (optional, repeatable): Add an ephemeral reviewer described in natural language. The Tech Lead will synthesize a focused reviewer persona from the description. Does not persist. Example: `--reviewer "Focus on error handling in the auth flow"`.
16
18
 
17
19
  **Examples**
18
20
  ```
@@ -21,6 +23,9 @@ tags: [ocr, review, code-review]
21
23
  /ocr-review HEAD~3 # Review last 3 commits
22
24
  /ocr-review feature/auth # Review branch vs main
23
25
  /ocr-review src/api/ # Review specific directory
26
+ /ocr-review --team principal:2,security:1 # Custom team composition
27
+ /ocr-review --reviewer "Review as a junior developer would"
28
+ /ocr-review --team principal:1 --reviewer "Focus on error handling" --reviewer "Check accessibility"
24
29
  ```
25
30
 
26
31
  **Steps**
@@ -0,0 +1,93 @@
1
+ ---
2
+ description: Sync reviewer metadata from markdown files to reviewers-meta.json for the dashboard.
3
+ name: "OCR: Sync Reviewers"
4
+ category: Code Review
5
+ tags: [ocr, reviewers, sync]
6
+ ---
7
+
8
+ **Usage**
9
+ ```
10
+ /ocr:sync-reviewers
11
+ ```
12
+
13
+ **What it does**
14
+
15
+ Reads all reviewer markdown files in `.ocr/skills/references/reviewers/`, extracts structured metadata from each, and pipes the result to the CLI for validated, atomic persistence to `reviewers-meta.json`.
16
+
17
+ **When to run**
18
+
19
+ - After adding or editing a reviewer in `.ocr/skills/references/reviewers/`
20
+ - After changing `default_team` in `.ocr/config.yaml`
21
+
22
+ **Steps**
23
+
24
+ 1. **Read config**: Parse `.ocr/config.yaml` and extract the `default_team` keys (reviewer IDs mapped to weights).
25
+
26
+ 2. **Read all reviewer files**: List every `.md` file in `.ocr/skills/references/reviewers/`. For each file, read its contents and extract:
27
+ - **id**: Filename without `.md` (e.g., `architect`, `martin-fowler`)
28
+ - **name**: From the `# Title` heading — strip trailing "Reviewer", "— Reviewer", etc.
29
+ - **tier**: Classify using the lists below, or `custom` if not recognized
30
+ - **icon**: Assign from the icon table below, defaulting to `brain` for personas and `user` for custom
31
+ - **description**: The opening paragraph that describes what this reviewer does (first substantive non-heading, non-blockquote line)
32
+ - **focus_areas**: Bold items from the `## Your Focus Areas` section (the text before the colon/dash)
33
+ - **is_default**: `true` if the id is a key in `config.yaml`'s `default_team`
34
+ - **is_builtin**: `true` if the id appears in any of the built-in lists below
35
+ - **known_for** (persona only): From `> **Known for**: ...` blockquote
36
+ - **philosophy** (persona only): From `> **Philosophy**: ...` blockquote
37
+
38
+ Use your understanding of the markdown — reviewer files may have minor structural variations. Extract the semantically correct value even if formatting differs slightly from the template.
39
+
40
+ 3. **Build the JSON payload**:
41
+ ```json
42
+ {
43
+ "schema_version": 1,
44
+ "generated_at": "<ISO 8601 timestamp>",
45
+ "reviewers": [<array of reviewer objects>]
46
+ }
47
+ ```
48
+
49
+ 4. **Pipe to CLI for validation and persistence**:
50
+ ```bash
51
+ echo '<json>' | ocr reviewers sync --stdin
52
+ ```
53
+ The CLI validates the schema, checks for duplicate IDs and invalid tiers, and writes `reviewers-meta.json` atomically. If validation fails, fix the JSON and retry.
54
+
55
+ 5. **Report**: Confirm the count and tier breakdown from the CLI output.
56
+
57
+ **Built-in reviewer IDs**
58
+
59
+ Holistic: `architect`, `fullstack`, `reliability`, `staff-engineer`, `principal`
60
+
61
+ Specialist: `frontend`, `backend`, `infrastructure`, `performance`, `accessibility`, `data`, `devops`, `dx`, `mobile`, `security`, `quality`, `testing`, `ai`
62
+
63
+ Persona: `martin-fowler`, `kent-beck`, `john-ousterhout`, `anders-hejlsberg`, `vladimir-khorikov`, `kent-dodds`, `tanner-linsley`, `kamil-mysliwiec`, `sandi-metz`, `rich-hickey`
64
+
65
+ **Icon assignments**
66
+
67
+ | ID | Icon |
68
+ |---|---|
69
+ | architect | blocks |
70
+ | fullstack | layers |
71
+ | reliability | activity |
72
+ | staff-engineer | compass |
73
+ | principal | crown |
74
+ | frontend | layout |
75
+ | backend | server |
76
+ | infrastructure | cloud |
77
+ | performance | gauge |
78
+ | accessibility | accessibility |
79
+ | data | database |
80
+ | devops | rocket |
81
+ | dx | terminal |
82
+ | mobile | smartphone |
83
+ | security | shield-alert |
84
+ | quality | sparkles |
85
+ | testing | test-tubes |
86
+ | ai | bot |
87
+ | *(persona)* | brain |
88
+ | *(custom)* | user |
89
+
90
+ **Notes**
91
+
92
+ - The `ocr` CLI path may be provided in the CLI Resolution section above. If so, use that path instead of bare `ocr`.
93
+ - The CLI's `--stdin` mode is the mechanism that ensures the final `reviewers-meta.json` is valid. Always pipe through it rather than writing the file directly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-code-review/agents",
3
- "version": "1.5.1",
3
+ "version": "1.7.0",
4
4
  "description": "AI-native skills, commands, and reviewer personas for Open Code Review",
5
5
  "type": "module",
6
6
  "files": [
@@ -23,7 +23,8 @@ This synthesis process is designed to mirror how high-performing engineering tea
23
23
 
24
24
  - **Preserve all feedback** — Every finding from every reviewer appears, attributed
25
25
  - **Identify blockers** — Surface anything that should prevent merge
26
- - **Present suggestions** — Non-blocking improvements for author consideration
26
+ - **Categorize should-fix items** — Issues that aren't blocking but should be addressed
27
+ - **Present suggestions** — Lower-priority improvements for author consideration
27
28
  - **Assess requirements** — Evaluate against provided requirements (if any)
28
29
  - **Recommend action** — Clear verdict with rationale
29
30
 
@@ -53,11 +54,49 @@ A finding is a **blocker** if ANY of the following are true:
53
54
 
54
55
  **Any single reviewer can flag a blocker.** This is not subject to consensus—one engineer seeing a security hole is sufficient to block.
55
56
 
56
- ### Step 3: Collect Suggestions
57
+ ### Step 3: Categorize Non-Blocking Findings
57
58
 
58
- All non-blocking feedback is preserved and attributed:
59
+ All non-blocking feedback is categorized into **Should Fix** or **Suggestions**, then preserved and attributed.
60
+
61
+ **Should Fix** — Issues that aren't blocking but should be addressed before or shortly after merge:
62
+
63
+ | Should Fix Criteria | Examples |
64
+ |---------------------|----------|
65
+ | **Code quality issues** | Missing error handling, dead code, untested critical paths |
66
+ | **Potential bugs** | Silent fallthrough, unvalidated input at boundaries, race conditions (non-data-loss) |
67
+ | **Important refactors** | DRY violations with real maintenance cost, tight coupling between modules |
68
+ | **Missing validation** | Input boundaries not enforced, missing null checks on external data |
69
+ | **Functional gaps** | Feature partially implemented, edge case not handled |
70
+
71
+ **Suggestions** — Low-priority improvements for author consideration:
72
+
73
+ | Suggestion Criteria | Examples |
74
+ |---------------------|----------|
75
+ | **Style preferences** | Naming, formatting, early returns vs nested ifs |
76
+ | **Minor refactors** | Extract small helper, reorder parameters, simplify expression |
77
+ | **Documentation** | Add JSDoc, clarify comment, update README |
78
+ | **Testing ideas** | Additional edge cases, snapshot tests, performance benchmarks |
79
+ | **Informational** | Alternative approaches, FYI notes, future considerations |
59
80
 
60
81
  ```markdown
82
+ ## Should Fix
83
+
84
+ ### 1. {Title}
85
+
86
+ **Flagged by**: @principal-1, @quality-1
87
+ **Location**: `path/to/file.ts:42-50`
88
+
89
+ {Description of the issue and why it should be fixed.}
90
+
91
+ ### 2. {Title}
92
+
93
+ **Flagged by**: @quality-2
94
+ **Location**: `path/to/other-file.ts:15`
95
+
96
+ {Description.}
97
+
98
+ ---
99
+
61
100
  ## Suggestions
62
101
 
63
102
  ### Code Quality
@@ -74,7 +113,7 @@ All non-blocking feedback is preserved and attributed:
74
113
  - "Edge case for empty input not covered" — @testing-1
75
114
  ```
76
115
 
77
- **No suggestion is lost.** Even if only one reviewer mentions something, it surfaces.
116
+ **No feedback is lost.** Even if only one reviewer mentions something, it surfaces.
78
117
 
79
118
  ### Step 4: Note Consensus and Dissent
80
119
 
@@ -200,15 +239,35 @@ The Tech Lead determines the verdict based on simple rules:
200
239
 
201
240
  ---
202
241
 
242
+ ## Should Fix
243
+
244
+ {Issues that aren't blocking but should be addressed. Use numbered sub-headings.}
245
+
246
+ ### 1. {Title}
247
+
248
+ **Flagged by**: @principal-1, @quality-1
249
+ **Location**: `path/to/file.ts:42-50`
250
+
251
+ {Description and why it should be fixed.}
252
+
253
+ ### 2. {Title}
254
+
255
+ **Flagged by**: @quality-2
256
+ **Location**: `path/to/other-file.ts:15`
257
+
258
+ {Description.}
259
+
260
+ ---
261
+
203
262
  ## Suggestions
204
263
 
205
- {All non-blocking feedback, preserved and attributed}
264
+ {Lower-priority improvements and informational feedback, preserved and attributed.}
206
265
 
207
266
  ### Code Quality
208
267
  - "Consider extracting the validation logic into a separate function" — @principal-1
209
268
  - "The error messages could be more user-friendly" — @quality-1
210
269
 
211
- ### Performance
270
+ ### Performance
212
271
  - "This query could benefit from an index on `user_id`" — @principal-2
213
272
 
214
273
  ### Testing
@@ -271,12 +330,12 @@ The Tech Lead determines the verdict based on simple rules:
271
330
 
272
331
  Full reviews available in session directory:
273
332
 
274
- | Reviewer | Blockers | Suggestions | File |
275
- |----------|----------|-------------|------|
276
- | @principal-1 | 0 | 3 | `rounds/round-{n}/reviews/principal-1.md` |
277
- | @principal-2 | 0 | 2 | `rounds/round-{n}/reviews/principal-2.md` |
278
- | @quality-1 | 0 | 4 | `rounds/round-{n}/reviews/quality-1.md` |
279
- | @security-1 | 1 | 2 | `rounds/round-{n}/reviews/security-1.md` |
333
+ | Reviewer | Blockers | Should Fix | Suggestions | File |
334
+ |----------|----------|------------|-------------|------|
335
+ | @principal-1 | 0 | 1 | 3 | `rounds/round-{n}/reviews/principal-1.md` |
336
+ | @principal-2 | 0 | 0 | 2 | `rounds/round-{n}/reviews/principal-2.md` |
337
+ | @quality-1 | 0 | 1 | 4 | `rounds/round-{n}/reviews/quality-1.md` |
338
+ | @security-1 | 1 | 0 | 2 | `rounds/round-{n}/reviews/security-1.md` |
280
339
 
281
340
  **Session**: `.ocr/sessions/{session-id}/`
282
341
  **Discourse**: `rounds/round-{n}/discourse.md`
@@ -405,10 +405,49 @@ See `references/map-personas/flow-analyst.md` for persona details.
405
405
  [ "$EXPECTED" -ne "$MAPPED" ] && echo "ERROR: Missing files!"
406
406
  ```
407
407
 
408
- 11. **Save final map**:
408
+ 11. **Pipe structured map data to CLI**:
409
+
410
+ Construct a JSON object with the map's structured data and pipe it to the CLI. The CLI validates, writes `map-meta.json`, and records a `map_completed` orchestration event — all in one command.
411
+
412
+ ```bash
413
+ cat <<'JSON' | ocr state map-complete --stdin
414
+ {
415
+ "schema_version": 1,
416
+ "sections": [
417
+ {
418
+ "section_number": 1,
419
+ "title": "Section Title",
420
+ "description": "Section description",
421
+ "files": [
422
+ {
423
+ "file_path": "src/example.ts",
424
+ "role": "Entry point",
425
+ "lines_added": 10,
426
+ "lines_deleted": 2
427
+ }
428
+ ]
429
+ }
430
+ ],
431
+ "dependencies": [
432
+ {
433
+ "from_section": 2,
434
+ "from_title": "Tests",
435
+ "to_section": 1,
436
+ "to_title": "Core Logic",
437
+ "relationship": "tests"
438
+ }
439
+ ]
440
+ }
441
+ JSON
442
+ ```
443
+
444
+ > The CLI validates the JSON schema, writes `map-meta.json` to the correct run directory, and records the event in SQLite. The orchestrator MUST NOT write `map-meta.json` directly.
445
+
446
+ 12. **Save final map** (presentation artifact):
409
447
  ```
410
448
  .ocr/sessions/{id}/map/runs/run-{n}/map.md
411
449
  ```
450
+ > `map.md` is the human-readable presentation artifact. The dashboard uses `map-meta.json` for structured data; `map.md` is stored as raw markdown for display and chat context.
412
451
 
413
452
  ### Map Output Format
414
453
 
@@ -426,6 +465,7 @@ See `references/map-template.md` for the complete template.
426
465
  - [ ] Section Dependencies table generated
427
466
  - [ ] File Index complete
428
467
  - [ ] Completeness validated (all files appear in tables)
468
+ - [ ] `map-meta.json` piped to CLI via `ocr state map-complete --stdin`
429
469
  - [ ] `map.md` written
430
470
  - [ ] `ocr state transition` called with `--phase "synthesis"`
431
471
 
@@ -157,6 +157,44 @@ This PR adds a new user profile API endpoint that returns user data.
157
157
  Review this code from a security perspective...
158
158
  ```
159
159
 
160
+ ## Ephemeral Reviewer Variant
161
+
162
+ When spawning an ephemeral reviewer (from `--reviewer`), use the same task structure but replace the persona section with a synthesized prompt based on the user's description.
163
+
164
+ **Key differences from library reviewers:**
165
+ - No `.md` file lookup — the persona is synthesized by the Tech Lead from the `--reviewer` value
166
+ - Output file naming: `ephemeral-{n}.md` instead of `{type}-{n}.md`
167
+ - Redundancy is always 1 (ephemeral reviewers are inherently unique)
168
+ - The ephemeral reviewer file MUST include the original description at the top
169
+
170
+ ```markdown
171
+ # Code Review Task: Ephemeral Reviewer
172
+
173
+ ## Your Persona
174
+
175
+ > **User description**: "{the --reviewer value}"
176
+
177
+ {Tech Lead's synthesized persona based on the description. This should expand the user's
178
+ description into a focused reviewer identity with clear guidance on what to look for,
179
+ while maintaining the same structure as library reviewer personas.}
180
+
181
+ ## Project Standards
182
+ {same as library reviewers}
183
+
184
+ ## Tech Lead Guidance
185
+ {same as library reviewers}
186
+
187
+ ## Code to Review
188
+ {same as library reviewers}
189
+
190
+ ## Your Task
191
+ {same as library reviewers — full agency, same output format}
192
+ ```
193
+
194
+ **Output format**: Ephemeral reviewers use the exact same output format as library reviewers (`## Summary`, `## Findings`, `## What's Working Well`, etc.). The only addition is the original description quoted at the top of the review file.
195
+
196
+ ---
197
+
160
198
  ## Reviewer Guidelines
161
199
 
162
200
  ### Be Thorough But Focused