You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generates review instructions for code review tools (Claude Code Review, CodeRabbit). REVIEW.md is the single source of truth; .coderabbit.yaml is a structured sidecar that translates skip/path rules into CodeRabbit's native format. Target: 60-80 lines (soft cap 100).
231
+
232
+
**Step 1 — Clone enhancements repo** (if not already present from Phase 4):
Extract ONLY diff-enforceable rules — rules that can be checked by looking at a code diff. Discard vague guidance ("should consider...") and retain imperative rules ("Flag X as must-fix", "Never allow Y").
Verify extracted platform rules are still current. If chai-bot is unavailable, skip — include all extracted rules (err on side of inclusion).
250
+
251
+
```
252
+
mcp__chai-bot__ask_persona:
253
+
"I'm generating REVIEW.md for {component} (github.com/openshift/{component}).
254
+
I extracted these enforceable review rules from openshift/enhancements dev-guide.
255
+
Are these still current? Have any been superseded, relaxed, or tightened?
256
+
257
+
1. [Rule 1 from Step 2]
258
+
2. [Rule 2 from Step 2]
259
+
...
260
+
(list top 5-8 most critical rules for the detected repo type)
261
+
262
+
For each rule: confirm current, superseded (by what), or unknown."
263
+
```
264
+
265
+
**Filtering**: Discard rules chai-bot confirms are superseded. Keep confirmed + unverified (err on side of inclusion). DISCARD any claims about repo internals — chai-bot fabricates these.
266
+
267
+
**Step 4 — Collect skip patterns** from Phase 5 discoveries:
Style and naming issues are minor at most for all repo types.
289
+
290
+
**Step 7 — Generate REVIEW.md**:
291
+
-[ ] Use `templates/REVIEW-template.md` for structure
292
+
-[ ] Fill each section from Steps 2-6, stripping template comments from output
293
+
-[ ] Use tool-agnostic severity language ("must fix before merge" / "worth fixing, not blocking" / "suggestion only")
294
+
-[ ] Use glob patterns for skip rules, not prose descriptions
295
+
-[ ] Cite the dev-guide source for each "Always check" rule (parenthetical at end of line)
296
+
-[ ] Include "Verification bar" section — require file:line citations for every comment
297
+
-[ ] Include "Re-review" section — suppress new nits on unchanged code during re-reviews
298
+
-[ ] Validate line count: target 60-80 lines, soft cap 100
299
+
-[ ]**Do NOT** copy CLAUDE.md content — different purposes
300
+
301
+
**Step 8 — Generate/merge .coderabbit.yaml**:
302
+
-[ ] Use `templates/coderabbit-template.yaml` for structure — always set `inheritance: true` (inherits org-wide config from `openshift/coderabbit` which already excludes `vendor/**`, `zz_generated*`, `node_modules/**`)
303
+
-[ ] Only add repo-specific exclusions to `path_filters` — skip patterns already covered by org config (vendor, zz_generated, boilerplate)
304
+
-[ ] Translate "Path-specific rules" subsections to `path_instructions` entries
305
+
-[ ] Set `knowledge_base.filePatterns` to `["REVIEW.md", "AGENTS.md"]` — **NEVER add CLAUDE.md** (auto-detected separately)
306
+
-[ ]`tone_instructions` is optional — only add if the repo has a distinct review culture; org default applies otherwise
307
+
-[ ] If a `.coderabbit.yaml` already exists in the repo, merge: preserve existing settings (profile, auto_review, pre_merge_checks, tools, slop_detection), add/update `knowledge_base`, `path_filters`, and `path_instructions`
-[ ]**Verify specificity**: Repo structure only in components.md (not duplicated in DEVELOPMENT.md), pattern claims backed by code evidence
231
315
-[ ]**Anti-hallucination checks**: Spot-check type fields if applicable, verify branch names in examples match repo, confirm pattern claims reference actual code
232
316
-[ ]**Operator-specific checks** (if operator repo): Verify apply method claims per-controller (`grep -r "client.Apply\|r.Update\|resourceapply" pkg/controller/<name>/`). Verify feature gate claims trace to actual runtime code. Verify image env var names match Makefile/CSV.
317
+
-[ ]**REVIEW.md checks** (if generated): exists at repo root, ≤100 lines (`wc -l REVIEW.md`), skip paths reference real directories (`test -d`), platform citations present (grep for "dev-guide" or "CONVENTIONS"), no content overlap with CLAUDE.md
318
+
-[ ]**.coderabbit.yaml checks** (if generated): valid YAML (`python3 -c "import yaml; yaml.safe_load(open('.coderabbit.yaml'))"`), `filePatterns` contains "REVIEW.md" but NOT "CLAUDE.md", `path_filters` match "Do not report" globs, `path_instructions` match "Path-specific rules"
233
319
-[ ] Verify all domain/*.md files link to actual type definitions
234
320
-[ ] Cross-check with openshift-docs if time permits
235
321
-[ ]**Flag discovery gaps**: At the end of components.md and DEVELOPMENT.md, add a brief "SME Review Recommended" note listing areas where automated discovery may be incomplete — typically: implementation recipes for adding new components, anti-patterns from institutional knowledge, and rationale behind pattern choices. This sets expectations that the docs are a verified foundation, not a complete implementation guide
@@ -272,6 +358,9 @@ Use this checklist during Phase 5 when exploring the codebase. These patterns pr
272
358
| **Naming conventions** | Grep for patterns in env vars, labels, file names, package names | Exact format with examples |
273
359
| **Feature toggles** | Are there feature gates, flags, or config-driven enablement? | Definition → runtime check → wiring chain |
274
360
| **Anti-patterns** | Search for "DO NOT", "NEVER", "MUST", "HACK" in code comments. Study 2-3 existing implementations to identify shared patterns and things they avoid | Numbered "DO NOT" list with brief explanation |
361
+
| **CI enforcement** | `grep -E "^(lint\|fmt\|vet\|check\|verify):" Makefile` | CI-enforced checks → "Do not report" in REVIEW.md |
0 commit comments