@open-code-review/agents 1.3.0 → 1.3.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 CHANGED
@@ -9,10 +9,12 @@ agents/
9
9
  ├── skills/ocr/ # The OCR skill
10
10
  │ ├── SKILL.md # Tech Lead orchestration logic
11
11
  │ ├── references/
12
- │ │ ├── workflow.md # 8-phase review workflow
13
- │ │ ├── discourse.md # Multi-agent debate rules
14
- │ │ ├── synthesis.md # Finding aggregation guide
15
- │ │ └── reviewers/ # Persona definitions (customizable)
12
+ │ │ ├── workflow.md # 8-phase review workflow
13
+ │ │ ├── session-files.md # Authoritative file manifest
14
+ │ │ ├── session-state.md # State management
15
+ │ │ ├── discourse.md # Multi-agent debate rules
16
+ │ │ ├── final-template.md # Final review template
17
+ │ │ └── reviewers/ # Persona definitions (customizable)
16
18
  │ │ ├── principal.md # Architecture, design patterns
17
19
  │ │ ├── quality.md # Code style, best practices
18
20
  │ │ ├── security.md # Auth, data handling, vulnerabilities
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-code-review/agents",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "AI-native skills, commands, and reviewer personas for Open Code Review",
5
5
  "type": "module",
6
6
  "files": [
@@ -38,6 +38,6 @@ When asked to perform a code review:
38
38
  - `references/workflow.md` - Complete 8-phase workflow
39
39
  - `references/session-files.md` - **Authoritative session file manifest**
40
40
  - `references/session-state.md` - State management and progress tracking
41
- - `references/synthesis.md` - How to synthesize findings
41
+ - `references/final-template.md` - Final review template and synthesis guide
42
42
  - `references/discourse.md` - Multi-agent discourse rules
43
43
  - `references/reviewers/` - Reviewer persona definitions
@@ -1,6 +1,9 @@
1
- # Synthesis Phase
1
+ # Final Review Template & Synthesis Guide
2
2
 
3
- After discourse (or individual reviews if `--quick`), synthesize all findings into a unified final review.
3
+ > **Output file**: `rounds/round-{n}/final.md`
4
+ > **Manifest**: See `references/session-files.md` for authoritative file names
5
+
6
+ This guide describes how to synthesize all findings into a unified final review. Save output to `rounds/round-{n}/final.md`.
4
7
 
5
8
  ## Philosophy: Model Real Engineering Teams
6
9
 
@@ -192,7 +192,7 @@ Must include:
192
192
  - Clarifying Questions section
193
193
  - Individual Reviews table with file references
194
194
 
195
- See `references/synthesis.md` for complete template.
195
+ See `references/final-template.md` for complete template.
196
196
 
197
197
  ## CLI Dependencies
198
198
 
@@ -360,18 +360,36 @@ See `references/context-discovery.md` for detailed algorithm.
360
360
  - Verify rate limiting is implemented
361
361
  ```
362
362
 
363
- 4. Select reviewers:
363
+ 4. **Read reviewer team from config** (REQUIRED):
364
+
365
+ ```bash
366
+ # MUST read default_team from .ocr/config.yaml - do NOT use hardcoded values
367
+ cat .ocr/config.yaml | grep -A10 'default_team:'
368
+ ```
369
+
370
+ Parse the `default_team` section to determine reviewer counts:
371
+ ```yaml
372
+ # Example config - actual values come from .ocr/config.yaml
373
+ default_team:
374
+ principal: 2 # Spawn principal-1, principal-2
375
+ quality: 2 # Spawn quality-1, quality-2
376
+ # security: 1 # Commented = not spawned by default
377
+ testing: 1 # Spawn testing-1
378
+ ```
364
379
 
365
- **Default team** (always spawned):
366
- - Principal (holistic architecture review)
367
- - 2× Quality (code quality review)
380
+ **Reviewer spawning rules**:
381
+ - For each uncommented entry in `default_team`, spawn N instances
382
+ - `principal: 2` spawn `principal-1`, `principal-2`
383
+ - `quality: 2` → spawn `quality-1`, `quality-2`
384
+ - `testing: 1` → spawn `testing-1`
385
+ - Commented entries (e.g., `# security: 1`) are NOT spawned unless auto-detected
368
386
 
369
- **Optional reviewers** (added based on change type or user request):
387
+ **Auto-detection** (adds reviewers beyond config):
370
388
  | Change Type | Additional Reviewers |
371
389
  |-------------|---------------------|
372
390
  | Auth/Security changes | + 1× Security |
373
391
  | API changes | + 1× Security |
374
- | Logic changes | + 1× Testing |
392
+ | Logic changes | + 1× Testing (if not in config) |
375
393
  | User says "add security" | + 1× Security |
376
394
 
377
395
  ---
@@ -380,24 +398,40 @@ See `references/context-discovery.md` for detailed algorithm.
380
398
 
381
399
  **Goal**: Run each reviewer independently with configured redundancy.
382
400
 
401
+ > **⚠️ CRITICAL**: Reviewer counts and types come from `.ocr/config.yaml` `default_team` section.
402
+ > Do NOT use hardcoded defaults. Do NOT skip the `-{n}` suffix in filenames.
403
+ > See `references/session-files.md` for authoritative file naming.
404
+
383
405
  ### Steps
384
406
 
385
407
  1. Load reviewer personas from `references/reviewers/`.
386
408
 
387
- 2. Spawn tasks based on default team + detected needs:
388
- ```
389
- # Default team (always)
390
- Spawn Task: principal-1
391
- Spawn Task: principal-2
392
- Spawn Task: quality-1
393
- Spawn Task: quality-2
409
+ 2. **Parse `default_team` from config** (already read in Phase 3):
394
410
 
395
- # Optional (if auth/API/data changes OR user requested)
396
- Spawn Task: security-1
411
+ For each reviewer type in config, spawn the specified number of instances:
412
+
413
+ ```bash
414
+ # Example: If config says principal: 2, quality: 2, testing: 1
415
+ # You MUST spawn exactly these reviewers with numbered suffixes:
397
416
 
398
- # Optional (if logic changes OR user requested)
399
- Spawn Task: testing-1
417
+ # From default_team.principal: 2
418
+ Create: rounds/round-$CURRENT_ROUND/reviews/principal-1.md
419
+ → Create: rounds/round-$CURRENT_ROUND/reviews/principal-2.md
420
+
421
+ # From default_team.quality: 2
422
+ → Create: rounds/round-$CURRENT_ROUND/reviews/quality-1.md
423
+ → Create: rounds/round-$CURRENT_ROUND/reviews/quality-2.md
424
+
425
+ # From default_team.testing: 1
426
+ → Create: rounds/round-$CURRENT_ROUND/reviews/testing-1.md
427
+
428
+ # Auto-detected (if applicable)
429
+ → Create: rounds/round-$CURRENT_ROUND/reviews/security-1.md
400
430
  ```
431
+
432
+ **File naming pattern**: `{type}-{n}.md` where n starts at 1.
433
+
434
+ Examples: `principal-1.md`, `principal-2.md`, `quality-1.md`, `quality-2.md`, `testing-1.md`
401
435
 
402
436
  3. Each task receives:
403
437
  - Reviewer persona (from `references/reviewers/{name}.md`)
@@ -411,12 +445,38 @@ See `references/context-discovery.md` for detailed algorithm.
411
445
 
412
446
  See `references/reviewer-task.md` for the task template.
413
447
 
414
- ### ✅ Phase 4 Checkpoint
448
+ ### ✅ Phase 4 Checkpoint — MANDATORY VALIDATION
449
+
450
+ **Run this validation command before proceeding:**
451
+
452
+ ```bash
453
+ # Set these based on your current session
454
+ SESSION_DIR=".ocr/sessions/$(ls -1t .ocr/sessions/ | head -1)"
455
+ CURRENT_ROUND=$(ls -1d "$SESSION_DIR/rounds/round-"* 2>/dev/null | wc -l | tr -d ' ')
456
+ REVIEWS_DIR="$SESSION_DIR/rounds/round-$CURRENT_ROUND/reviews"
457
+
458
+ echo "Validating: $REVIEWS_DIR"
459
+ ls -la "$REVIEWS_DIR/"
460
+
461
+ # Verify all files match {type}-{n}.md pattern (principal, quality, security, testing)
462
+ for f in "$REVIEWS_DIR/"*.md; do
463
+ if [[ "$(basename "$f")" =~ ^(principal|quality|security|testing)-[0-9]+\.md$ ]]; then
464
+ echo "✓ $(basename "$f")"
465
+ else
466
+ echo "❌ $(basename "$f") does not match {type}-{n}.md pattern"
467
+ exit 1
468
+ fi
469
+ done
470
+
471
+ REVIEWER_COUNT=$(ls -1 "$REVIEWS_DIR/"*.md 2>/dev/null | wc -l | tr -d ' ')
472
+ echo "✓ Found $REVIEWER_COUNT reviewer files"
473
+ ```
415
474
 
416
475
  **STOP and verify before proceeding:**
417
- - [ ] At least 4 review files exist in `rounds/round-{n}/reviews/` directory
418
- - [ ] Each review file contains findings (even if "no issues found")
419
- - [ ] File naming follows `{type}-{n}.md` pattern (e.g., `principal-1.md`, `quality-2.md`)
476
+ - [ ] Review files exist for EACH entry in `default_team` config
477
+ - [ ] File count matches sum of all `default_team` values
478
+ - [ ] All files use `{type}-{n}.md` pattern
479
+ - [ ] Each review file contains findings
420
480
 
421
481
  ---
422
482
 
@@ -477,7 +537,11 @@ See `references/discourse.md` for detailed instructions.
477
537
 
478
538
  ## Phase 7: Synthesis
479
539
 
480
- **Goal**: Produce final prioritized review.
540
+ **Goal**: Produce final prioritized review and save to **`final.md`**.
541
+
542
+ > **File**: `rounds/round-{n}/final.md`
543
+ > **Template**: See `references/final-template.md` for format
544
+ > **Manifest**: See `references/session-files.md` for authoritative file names
481
545
 
482
546
  ### Steps
483
547
 
@@ -511,14 +575,45 @@ See `references/discourse.md` for detailed instructions.
511
575
 
512
576
  These go in a prominent "Clarifying Questions" section for stakeholder response.
513
577
 
514
- 7. Save to `.ocr/sessions/{id}/rounds/round-{current_round}/final.md`.
578
+ 7. **Write the final review file**:
579
+ ```bash
580
+ # OUTPUT FILE - must be exactly this path:
581
+ FINAL_FILE="$SESSION_DIR/rounds/round-$CURRENT_ROUND/final.md"
582
+ ```
583
+
584
+ Save synthesized review to `$FINAL_FILE`.
585
+
586
+ See `references/final-template.md` for the template format.
515
587
 
516
- See `references/synthesis.md` for template.
588
+ ### Phase 7 Checkpoint — MANDATORY VALIDATION
517
589
 
518
- ### Phase 7 Checkpoint
590
+ **Run this validation command before proceeding:**
591
+
592
+ ```bash
593
+ # Set these based on your current session
594
+ SESSION_DIR=".ocr/sessions/$(ls -1t .ocr/sessions/ | head -1)"
595
+ CURRENT_ROUND=$(ls -1d "$SESSION_DIR/rounds/round-"* 2>/dev/null | wc -l | tr -d ' ')
596
+ FINAL_FILE="$SESSION_DIR/rounds/round-$CURRENT_ROUND/final.md"
597
+
598
+ # Check file exists
599
+ if [ -f "$FINAL_FILE" ]; then
600
+ echo "✓ final.md exists at $FINAL_FILE"
601
+ else
602
+ echo "❌ final.md not found at $FINAL_FILE"
603
+ exit 1
604
+ fi
605
+
606
+ # Check required content
607
+ if grep -q '## Verdict' "$FINAL_FILE"; then
608
+ echo "✓ Contains Verdict section"
609
+ else
610
+ echo "❌ Missing '## Verdict' section"
611
+ exit 1
612
+ fi
613
+ ```
519
614
 
520
615
  **STOP and verify before proceeding:**
521
- - [ ] `rounds/round-{n}/final.md` written to round directory
616
+ - [ ] `rounds/round-{n}/final.md` exists
522
617
  - [ ] Contains prioritized findings (Must Fix, Should Fix, Consider)
523
618
  - [ ] Contains Clarifying Questions section (if any)
524
619
  - [ ] If requirements provided: Contains Requirements Assessment