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
-**For large files (>5000 lines):** Use the Grep tool with Search Patterns from each rule's Review Metadata to locate potential violations. Focus on changed portions shown in the diff.
42
42
-**For smaller files:** You may read the full file using the Read tool
43
43
-**If a Read fails with token limit error:** Immediately switch to using Grep with targeted patterns for the rules you're checking
44
-
- For each rule: evaluate the Condition and "DO NOT flag" exceptions. Mark the rule as checked on the checklist. A single rule **can produce multiple violations** — flag each separately.
45
-
5.**For each violation found, immediately create an inline comment** using the available GitHub inline comment tool. Do not batch — create the comment as soon as you confirm a violation.
46
-
6.**Required parameters for each inline comment:**
47
-
-`path`: Full file path (e.g., "src/components/ReportActionsList.tsx")
44
+
3.**Search strategy for large files:** Use the search patterns defined in each rule's "Search patterns" field to efficiently locate potential violations with Grep.
45
+
4.**Return your findings as structured JSON output.** Your response must be a JSON object matching this schema:
-`ruleId`: The rule ID (e.g., `PERF-1`, `CONSISTENCY-2`)
50
+
-`path`: Full file path (e.g., `src/components/ReportActionsList.tsx`)
48
51
-`line`: Line number where the issue occurs
49
-
-`body`: Concise and actionable description of the violation and fix, following the below Comment Format
50
-
7.**Each comment must reference exactly one Rule ID.**
51
-
8.**Output must consist exclusively of calls to createInlineComment.sh in the required format.** No other text, Markdown, or prose is allowed.
52
-
9.**If no violations are found, add a reaction to the PR**:
53
-
Add a +1 reaction to the PR using the `addPrReaction` script (available in PATH from `.claude/scripts/`). The script takes ONLY the PR number as argument - it always adds a "+1" reaction, so do NOT pass any reaction type or emoji.
54
-
10.**Add reaction if and only if**:
55
-
- You examined EVERY changed line in EVERY changed file (via diff + targeted grep/read)
56
-
- You checked EVERY changed file against ALL rules
57
-
- You found ZERO violations matching the exact rule criteria
58
-
- You verified no false negatives by checking each rule systematically
59
-
If you found even ONE violation or have ANY uncertainty do NOT add the reaction - create inline comments instead.
60
-
11.**DO NOT invent new rules, stylistic preferences, or commentary outside the listed rules.**
61
-
12.**DO NOT describe what you are doing, create comments with a summary, explanations, extra content, comments on rules that are NOT violated or ANYTHING ELSE.**
62
-
Only inline comments regarding rules violations are allowed. If no violations are found, add a reaction instead of creating any comment.
63
-
EXCEPTION: If you believe something MIGHT be a Rule violation but are uncertain, err on the side of creating an inline comment with your concern rather than skipping it.
64
-
13.**Reality check before posting**: Before creating each inline comment, re-read the specific code one more time and confirm the violation is real. If upon re-reading you realize the code is actually correct, **do NOT post the comment** — silently skip it and move on. Never post a comment that flags a violation and then concludes it is not actually a problem.
65
-
66
-
## Tool Usage Example
67
-
68
-
For each violation, call the createInlineComment.sh script like this:
69
-
70
-
```bash
71
-
createInlineComment.sh 'src/components/ReportActionsList.tsx''<Body of the comment according to the Comment Format>' 128
72
-
```
73
-
74
-
**IMPORTANT**: Always use single quotes around the body argument to properly handle special characters and quotes.
75
-
76
-
If ZERO violations are found, use the Bash tool to add a reaction to the PR body:
77
-
78
-
```bash
79
-
addPrReaction.sh <PR_NUMBER>
80
-
```
81
-
82
-
**IMPORTANT**: Always use the `addPrReaction.sh` script (available in PATH from `.claude/scripts/`) instead of calling `gh api` directly.
52
+
-`body`: Concise and actionable description of the violation and fix, formatted per the Comment Format below
53
+
5.**Each violation must reference exactly one Rule ID.**
54
+
6.**If no violations are found, return an empty violations array:**`{ "violations": [] }`
55
+
7.**Do NOT post comments, call scripts, or add reactions.** Only return the structured JSON.
56
+
8.**DO NOT invent new rules, stylistic preferences, or commentary outside the listed rules.**
57
+
9.**DO NOT describe what you are doing or add extra content.**
58
+
EXCEPTION: If you believe something MIGHT be a Rule violation but are uncertain, err on the side of including it in the violations array rather than skipping it.
59
+
10.**Reality check before posting**: Before creating each inline comment, re-read the specific code one more time and confirm the violation is real. If upon re-reading you realize the code is actually correct, **do NOT post the comment** — silently skip it and move on. Never post a comment that flags a violation and then concludes it is not actually a problem.
83
60
84
61
## Comment Format
85
62
86
-
Build the docs link by mapping the ruleId to its rule filename:
63
+
Use this format for the `body` field of each violation:
**CRITICAL**: You must actually call the createInlineComment.sh script for each violation. Don't just describe what you found - create the actual inline comments!
0 commit comments