@open-code-review/agents 1.0.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.
- package/README.md +83 -0
- package/commands/doctor.md +37 -0
- package/commands/history.md +32 -0
- package/commands/post.md +28 -0
- package/commands/review.md +100 -0
- package/commands/reviewers.md +30 -0
- package/commands/show.md +24 -0
- package/package.json +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# @open-code-review/agents
|
|
2
|
+
|
|
3
|
+
AI-native skills, commands, and reviewer personas for Open Code Review.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This package contains static assets for AI-powered code review:
|
|
8
|
+
|
|
9
|
+
- **Skills** (`skills/ocr/`) - Core skill definitions and workflow references
|
|
10
|
+
- **Commands** (`commands/`) - Slash command definitions for AI tools
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
### Option 1: CLI (Multi-Tool Support)
|
|
15
|
+
|
|
16
|
+
Works with Claude Code, Cursor, Windsurf, and 10+ other AI tools:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx @open-code-review/cli init
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Option 2: Claude Code Plugin
|
|
23
|
+
|
|
24
|
+
Native Claude Code integration with automatic updates:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Add the marketplace
|
|
28
|
+
/plugin marketplace add open-code-review/open-code-review
|
|
29
|
+
|
|
30
|
+
# Install the plugin
|
|
31
|
+
/plugin install open-code-review
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or test locally:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
claude --plugin-dir ./packages/agents
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Package Structure
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
packages/agents/
|
|
44
|
+
├── .claude-plugin/
|
|
45
|
+
│ └── plugin.json # Claude Code plugin manifest
|
|
46
|
+
├── commands/ # Slash commands (→ /open-code-review:review)
|
|
47
|
+
│ ├── review.md
|
|
48
|
+
│ ├── doctor.md
|
|
49
|
+
│ └── ...
|
|
50
|
+
└── skills/
|
|
51
|
+
└── ocr/ # Main OCR skill
|
|
52
|
+
├── SKILL.md # Core Tech Lead skill
|
|
53
|
+
├── AGENTS.md # AI assistant instructions
|
|
54
|
+
├── references/ # Workflow, reviewers, etc.
|
|
55
|
+
└── assets/ # Templates, config
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Skills (`skills/ocr/`)
|
|
59
|
+
|
|
60
|
+
| File | Description |
|
|
61
|
+
|------|-------------|
|
|
62
|
+
| `SKILL.md` | Core Tech Lead skill definition |
|
|
63
|
+
| `AGENTS.md` | Instructions for AI assistants |
|
|
64
|
+
| `references/workflow.md` | 8-phase review workflow |
|
|
65
|
+
| `references/synthesis.md` | Finding synthesis guide |
|
|
66
|
+
| `references/discourse.md` | Multi-agent discourse rules |
|
|
67
|
+
| `references/reviewers/*.md` | Reviewer persona definitions |
|
|
68
|
+
| `assets/config.yaml` | Configuration template (installed to `.ocr/config.yaml`) |
|
|
69
|
+
|
|
70
|
+
## Commands (`commands/`)
|
|
71
|
+
|
|
72
|
+
| Command | CLI Format | Plugin Format |
|
|
73
|
+
|---------|------------|---------------|
|
|
74
|
+
| `review.md` | `/ocr:review` | `/open-code-review:review` |
|
|
75
|
+
| `doctor.md` | `/ocr:doctor` | `/open-code-review:doctor` |
|
|
76
|
+
| `reviewers.md` | `/ocr:reviewers` | `/open-code-review:reviewers` |
|
|
77
|
+
| `history.md` | `/ocr:history` | `/open-code-review:history` |
|
|
78
|
+
| `show.md` | `/ocr:show` | `/open-code-review:show` |
|
|
79
|
+
| `post.md` | `/ocr:post` | `/open-code-review:post` |
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
MIT
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Check OCR installation and verify all dependencies are available.
|
|
3
|
+
name: "OCR: Doctor"
|
|
4
|
+
category: Code Review
|
|
5
|
+
tags: [ocr, setup, diagnostics]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Usage**
|
|
9
|
+
```
|
|
10
|
+
/ocr-doctor
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Steps**
|
|
14
|
+
|
|
15
|
+
1. **Check OCR Installation**
|
|
16
|
+
- Verify `.ocr/skills/SKILL.md` exists and is readable
|
|
17
|
+
- Verify `references/` directory contains required workflow files
|
|
18
|
+
|
|
19
|
+
2. **Check Git**
|
|
20
|
+
- Verify `git` is available in PATH
|
|
21
|
+
- Verify current directory is a git repository
|
|
22
|
+
|
|
23
|
+
3. **Check GitHub CLI** (optional)
|
|
24
|
+
- Check if `gh` is available
|
|
25
|
+
- If available, verify authentication with `gh auth status`
|
|
26
|
+
|
|
27
|
+
4. **Report Status**
|
|
28
|
+
```
|
|
29
|
+
✓ OCR skill installed
|
|
30
|
+
✓ Git available (version X.X.X)
|
|
31
|
+
✓ GitHub CLI available and authenticated
|
|
32
|
+
|
|
33
|
+
Ready for code review!
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Reference**
|
|
37
|
+
- Run `/ocr-review` to start a code review
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: List past OCR review sessions.
|
|
3
|
+
name: "OCR: History"
|
|
4
|
+
category: Code Review
|
|
5
|
+
tags: [ocr, history, sessions]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Usage**
|
|
9
|
+
```
|
|
10
|
+
/ocr-history
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Steps**
|
|
14
|
+
|
|
15
|
+
1. Read `.ocr/sessions/` directory
|
|
16
|
+
2. List sessions in reverse chronological order
|
|
17
|
+
3. For each session, show:
|
|
18
|
+
- Session ID (date-branch)
|
|
19
|
+
- Branch/target reviewed
|
|
20
|
+
- Number of reviewers
|
|
21
|
+
- Final verdict (if complete)
|
|
22
|
+
|
|
23
|
+
**Output Format**
|
|
24
|
+
```
|
|
25
|
+
| Session | Target | Reviewers | Verdict |
|
|
26
|
+
|----------------------------|---------------|-----------|---------|
|
|
27
|
+
| 2025-01-26-feature-auth | feature/auth | 4 | Approve |
|
|
28
|
+
| 2025-01-25-fix-bug | fix/bug-123 | 2 | Block |
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Reference**
|
|
32
|
+
- Use `/ocr-show <session>` to view a past review
|
package/commands/post.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Post the current OCR review to a GitHub PR.
|
|
3
|
+
name: "OCR: Post"
|
|
4
|
+
category: Code Review
|
|
5
|
+
tags: [ocr, github, pr]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Usage**
|
|
9
|
+
```
|
|
10
|
+
/ocr-post [session]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Arguments**
|
|
14
|
+
- `session` (optional): Session ID to post. Defaults to most recent.
|
|
15
|
+
|
|
16
|
+
**Prerequisites**
|
|
17
|
+
- GitHub CLI (`gh`) must be installed and authenticated
|
|
18
|
+
- Must be on a branch with an open PR
|
|
19
|
+
|
|
20
|
+
**Steps**
|
|
21
|
+
|
|
22
|
+
1. Verify `gh` is available and authenticated
|
|
23
|
+
2. Find the PR for current branch
|
|
24
|
+
3. Read the session's `final.md`
|
|
25
|
+
4. Post as PR comment via `gh pr comment`
|
|
26
|
+
|
|
27
|
+
**Reference**
|
|
28
|
+
- Run `/ocr-doctor` to check GitHub CLI status
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run an AI-powered multi-agent code review on your changes.
|
|
3
|
+
name: "OCR: Review"
|
|
4
|
+
category: Code Review
|
|
5
|
+
tags: [ocr, review, code-review]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Usage**
|
|
9
|
+
```
|
|
10
|
+
/ocr-review [target] [--fresh]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Arguments**
|
|
14
|
+
- `target` (optional): Branch, commit, or file to review. Defaults to staged changes.
|
|
15
|
+
- `--fresh` (optional): Clear any existing session for today's date and start from scratch.
|
|
16
|
+
|
|
17
|
+
**Examples**
|
|
18
|
+
```
|
|
19
|
+
/ocr-review # Review staged changes
|
|
20
|
+
/ocr-review --fresh # Clear today's session and start fresh
|
|
21
|
+
/ocr-review HEAD~3 # Review last 3 commits
|
|
22
|
+
/ocr-review feature/auth # Review branch vs main
|
|
23
|
+
/ocr-review src/api/ # Review specific directory
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Steps**
|
|
27
|
+
|
|
28
|
+
1. **Session State Check** (CRITICAL - do this first!)
|
|
29
|
+
2. Load the OCR skill from `.ocr/skills/SKILL.md`
|
|
30
|
+
3. Execute the 8-phase review workflow defined in `.ocr/skills/references/workflow.md`
|
|
31
|
+
4. Store results in `.ocr/sessions/{date}-{branch}/`
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🔍 Session State Check (Phase 0)
|
|
36
|
+
|
|
37
|
+
Before starting any review work, you MUST verify the current session state:
|
|
38
|
+
|
|
39
|
+
### Step 1: Check for existing session
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Find today's session directory
|
|
43
|
+
ls -la .ocr/sessions/$(date +%Y-%m-%d)-* 2>/dev/null
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Step 2: If session exists, verify state
|
|
47
|
+
|
|
48
|
+
Read `state.json` AND verify actual files match:
|
|
49
|
+
|
|
50
|
+
| Phase | state.json says | Verify file exists |
|
|
51
|
+
|-------|-----------------|-------------------|
|
|
52
|
+
| context | `completed_phases` includes "context" | `.ocr/sessions/{id}/context.md` |
|
|
53
|
+
| requirements | `completed_phases` includes "requirements" | `.ocr/sessions/{id}/discovered-standards.md` |
|
|
54
|
+
| reviews | `completed_phases` includes "reviews" | At least 2 files in `.ocr/sessions/{id}/reviews/` |
|
|
55
|
+
| discourse | `completed_phases` includes "discourse" | `.ocr/sessions/{id}/discourse.md` |
|
|
56
|
+
| synthesis | `completed_phases` includes "synthesis" | `.ocr/sessions/{id}/final.md` |
|
|
57
|
+
|
|
58
|
+
### Step 3: Determine action
|
|
59
|
+
|
|
60
|
+
- **If `--fresh` flag**: Delete the session directory and start from Phase 1
|
|
61
|
+
- **If state.json missing but files exist**: Recreate state.json from file existence
|
|
62
|
+
- **If state.json exists and files match**: Resume from `current_phase`
|
|
63
|
+
- **If state.json and files mismatch**: Report discrepancy and ask user which to trust
|
|
64
|
+
- **If no session exists**: Start fresh from Phase 1
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## ⚠️ CRITICAL: Required Artifacts (Must Create In Order)
|
|
69
|
+
|
|
70
|
+
You MUST create these files sequentially. **Do NOT skip to `final.md`.**
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
.ocr/sessions/{id}/
|
|
74
|
+
├── context.md # Phase 2: WRITE FIRST - change summary
|
|
75
|
+
├── discovered-standards.md # Phase 1: merged project standards
|
|
76
|
+
├── reviews/
|
|
77
|
+
│ ├── principal-1.md # Phase 4: individual reviewer output
|
|
78
|
+
│ ├── principal-2.md # Phase 4: individual reviewer output
|
|
79
|
+
│ ├── quality-1.md # Phase 4: individual reviewer output
|
|
80
|
+
│ └── {reviewer}-{n}.md # Phase 4: individual reviewer output
|
|
81
|
+
├── discourse.md # Phase 6: reviewer cross-discussion
|
|
82
|
+
└── final.md # Phase 7: ONLY after all above exist
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Checkpoint Rules
|
|
86
|
+
|
|
87
|
+
1. **Before Phase 4** (Spawn Reviewers): `context.md` MUST exist
|
|
88
|
+
2. **Before Phase 6** (Discourse): At least 2 files in `reviews/` MUST exist
|
|
89
|
+
3. **Before Phase 7** (Synthesis): `discourse.md` MUST exist
|
|
90
|
+
4. **NEVER** write `final.md` without completing Phases 1-6
|
|
91
|
+
|
|
92
|
+
### Why This Matters
|
|
93
|
+
|
|
94
|
+
The `ocr progress` CLI watches these files to show real-time progress. If you skip files, the progress display breaks and users see incorrect state.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
**Reference**
|
|
99
|
+
- See `.ocr/skills/SKILL.md` for full Tech Lead instructions
|
|
100
|
+
- See `.ocr/skills/references/workflow.md` for detailed workflow phases
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: List all available reviewer personas for code review.
|
|
3
|
+
name: "OCR: Reviewers"
|
|
4
|
+
category: Code Review
|
|
5
|
+
tags: [ocr, reviewers, config]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Usage**
|
|
9
|
+
```
|
|
10
|
+
/ocr-reviewers
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Steps**
|
|
14
|
+
|
|
15
|
+
1. Read `.ocr/skills/references/reviewers/` directory
|
|
16
|
+
2. For each reviewer file, extract name and focus area
|
|
17
|
+
3. Display in table format:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
| Reviewer | Focus |
|
|
21
|
+
|------------|------------------------------------------|
|
|
22
|
+
| Principal | Architecture, patterns, maintainability |
|
|
23
|
+
| Quality | Code style, readability, best practices |
|
|
24
|
+
| Security | Auth, vulnerabilities, data handling |
|
|
25
|
+
| Testing | Test coverage, edge cases, assertions |
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Reference**
|
|
29
|
+
- Reviewer definitions are in `.ocr/skills/references/reviewers/`
|
|
30
|
+
- See `.ocr/skills/assets/reviewer-template.md` to create custom reviewers
|
package/commands/show.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Display a past OCR review session.
|
|
3
|
+
name: "OCR: Show"
|
|
4
|
+
category: Code Review
|
|
5
|
+
tags: [ocr, history, sessions]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Usage**
|
|
9
|
+
```
|
|
10
|
+
/ocr-show [session]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Arguments**
|
|
14
|
+
- `session` (optional): Session ID to display. Defaults to most recent.
|
|
15
|
+
|
|
16
|
+
**Steps**
|
|
17
|
+
|
|
18
|
+
1. If no session specified, find most recent in `.ocr/sessions/`
|
|
19
|
+
2. Read and display `final.md` (synthesized review)
|
|
20
|
+
3. Optionally show individual reviewer files if requested
|
|
21
|
+
|
|
22
|
+
**Reference**
|
|
23
|
+
- Use `/ocr-history` to list all sessions
|
|
24
|
+
- Use `/ocr-post` to post a review to GitHub
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@open-code-review/agents",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AI-native skills, commands, and reviewer personas for Open Code Review",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"ocr",
|
|
8
|
+
"commands"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"code-review",
|
|
12
|
+
"ai",
|
|
13
|
+
"agents",
|
|
14
|
+
"skills",
|
|
15
|
+
"claude",
|
|
16
|
+
"cursor",
|
|
17
|
+
"windsurf"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/spencermarx/open-code-review",
|
|
22
|
+
"directory": "packages/agents"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"author": "Spencer Marx",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
}
|
|
29
|
+
}
|