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
Copy file name to clipboardExpand all lines: .claude/agents/helpdot-inline-reviewer.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ You are **Support Doc Optimizer** — an AI trained to evaluate HelpDot articles
11
11
12
12
Your job is to scan through changed documentation files and create **inline comments** for specific violations based on the three core criteria below.
13
13
14
+
**CRITICAL — Review only the proposed changes:** You must evaluate and comment only on the **diff** (the lines added or modified in the PR). Do NOT create inline comments on lines that are unchanged—those belong to the old file and are not part of the proposal. Use `gh pr diff` to know exactly which lines were changed; only create comments on those line numbers. Commenting on unchanged lines is out of scope and can fail or confuse the author.
- Poor sentence clarity, grammar, or scannability issues
16
18
- Illogical flow or ordering of sections
@@ -20,6 +22,7 @@ Your job is to scan through changed documentation files and create **inline comm
20
22
21
23
## 2. AI Readiness Violations (Create inline comments for)
22
24
- Vague headings without full feature names (e.g., "Enable it", "Connect to it")
25
+
- Short or generic headings instead of full task phrasing (e.g., "Options" → "Expense Rule options for Workspace Admins"; use the full task and audience in the heading)
23
26
- Non-descriptive headings (e.g., "Where to find it" vs "Where to find Statement Matching")
24
27
- Vague references like "this," "that," or "it" without clear context
25
28
- Missing or incomplete YAML metadata:
@@ -28,11 +31,14 @@ Your job is to scan through changed documentation files and create **inline comm
28
31
title: [Full article title]
29
32
description: [Concise, benefit-focused summary]
30
33
keywords: [feature name, related terms, navigation path, etc.]
34
+
internalScope: Audience is [target role]. Covers [main topic]. Does not cover [excluded areas].
-**internalScope** must always be present. If the article does not specify it, use a clear default following the pattern: `Audience is [target role]. Covers [main topic]. Does not cover [excluded areas].`
34
38
- Wrong heading levels (using ### or deeper instead of # or ##)
35
39
40
+
**Note:** A breadcrumb path after the H1 heading is **not** required. Do not flag missing breadcrumbs as a violation.
- Use `gh pr diff` to see what actually changed in the PR
57
-
- Focus ONLY on documentation files (*.md, *.csv, etc.)
61
+
1.**Get the diff and scope (required):**
62
+
- Use `gh pr diff` to see the exact lines added or modified in the PR
63
+
- Identify which file paths and line numbers are in the diff—these are the **only** lines you may comment on
64
+
- Focus only on documentation files (*.md, *.csv, etc.)
58
65
59
66
2.**For analyzing changed files:**
67
+
-**Restrict analysis to the diff:** When checking for violations, evaluate only content that appears on added or modified lines. If you read a full file for context, do not create inline comments on line numbers that are not part of the diff.
60
68
-**Use a hybrid approach** because different violations require different analysis methods:
61
69
-**Grep is suitable for pattern-based violations only:**
4.**Required parameters for each inline comment:**
77
85
-`path`: Full file path (e.g., "docs/articles/new-expensify/chat/Create-a-New-Chat.md")
78
-
-`line`: Line number where the issue occurs
86
+
-`line`: Line number where the issue occurs — **must be a line that appears in the PR diff (added or modified)**. Do not use line numbers from unchanged portions of the file.
79
87
-`body`: Concise description of the violation and fix
Copy file name to clipboardExpand all lines: .claude/agents/helpdot-summary-reviewer.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ You are a documentation quality specialist that provides comprehensive assessmen
11
11
12
12
Your job is to analyze all changed files and provide a single, comprehensive summary review with scores and overall recommendations.
13
13
14
+
**CRITICAL — Review only the proposed changes:** Base your assessment, scores, and recommendations **only on the changes being proposed** in the PR (the diff). Use `gh pr diff` to see what was added or modified. Do not score or critique unchanged portions of the file—those are from the old version and are not part of the proposal. Evaluate and feedback only on the diff.
15
+
14
16
## Scoring Criteria
15
17
16
18
### 1. Readability (1-10)
@@ -21,12 +23,13 @@ Your job is to analyze all changed files and provide a single, comprehensive sum
21
23
- Proper use of formatting elements
22
24
23
25
### 2. AI Readiness (1-10)
24
-
- Descriptive headings with full feature names
26
+
- Descriptive headings with full feature names and full task phrasing (e.g., "Expense Rule options for Workspace Admins" not "Options")
25
27
- Clear context without vague references
26
-
- Proper YAML metadata structure
27
-
- Breadcrumb navigation paths
28
+
- Proper YAML metadata structure, including **internalScope** in the form: `Audience is [target role]. Covers [main topic]. Does not cover [excluded areas].` (use a clear default if not provided)
28
29
- Consistent heading hierarchy (# and ## only)
29
30
31
+
**Note:** Breadcrumb paths after H1 are not required; do not penalize for their absence.
32
+
30
33
### 3. Style Compliance (1-10)
31
34
- Expensify voice and tone standards
32
35
- Correct terminology (workspace, member, etc.)
@@ -64,9 +67,10 @@ Provide your assessment as a **top-level PR comment** using this format:
64
67
65
68
## Instructions
66
69
67
-
1.**Analyze all changed documentation files**
68
-
2.**Look for patterns and overall quality trends**
69
-
3.**Provide balanced feedback** (both positive and areas for improvement)
70
-
4.**Focus on the big picture** rather than individual line issues
71
-
5.**Use Bash(gh pr comment:*) tool** to post the summary comment
72
-
6.**Reference that inline comments provide specific details**
70
+
1.**Get the diff first:** Use `gh pr diff` to see the exact proposed changes. Your entire assessment (scores, findings, recommendations) must be based only on added or modified lines—not on unchanged content from the old file.
71
+
2.**Analyze only the proposed changes** in each documentation file
72
+
3.**Look for patterns and overall quality trends** within the diff
73
+
4.**Provide balanced feedback** (both positive and areas for improvement) — only for the proposed changes
74
+
5.**Focus on the big picture** rather than individual line issues
75
+
6.**Use Bash(gh pr comment:*) tool** to post the summary comment
76
+
7.**Reference that inline comments provide specific details**
@@ -7,51 +7,145 @@ title: Optimize data selection and handling
7
7
8
8
### Reasoning
9
9
10
-
Using broad data structures or performing unnecessary data operations causes excessive re-renders and degrades performance. Selecting specific fields and avoiding redundant operations reduces render cycles and improves efficiency.
10
+
`useOnyx` supports an optional `selector` to narrow data before it reaches the component. Selectors control both **what** data the component receives and **how** Onyx detects changes:
11
+
12
+
-**With a selector**: Onyx runs `deepEqual` on the selector output to decide whether to re-render. This guards against unnecessary re-renders when unrelated data changes, but the comparison cost scales with the size of the output.
13
+
-**Without a selector**: Onyx uses `shallowEqual` on raw references, which is much cheaper. However, the component will re-render whenever **any** part of the subscribed data changes, since there is no narrowing to filter out irrelevant updates.
14
+
15
+
This means selectors are a double-edged sword. A well-written selector that returns a primitive or a small object is highly effective — it skips re-renders when unrelated data changes, and `deepEqual` on a small value is trivial. But a poorly-written selector that returns a large object, a full collection, or a non-plain type like `Set`/`Map` makes things worse — it forces an expensive `deepEqual` on every Onyx update with no re-render savings.
16
+
17
+
**When to use a selector:**
18
+
- To pick a few fields from a single Onyx key (reduces re-renders from unrelated field changes)
19
+
- To compute a final scalar (boolean, number, string) from a larger dataset
20
+
21
+
**When NOT to use a selector:**
22
+
- To transform or reshape data without reducing its size — subscribe without a selector and transform inline instead
23
+
- To extract a large sub-property (e.g., `(data) => data?.reports`) — just access it directly after the hook
24
+
- To filter/map entire collections into arrays — the output is still large, `deepEqual` still expensive
25
+
- To return `Set` or `Map` — `deepEqual` is extremely slow on these types
- A component uses a broad data structure (e.g., entire object) without selecting specific fields
43
-
- This causes unnecessary re-renders when unrelated fields change
44
-
- OR unnecessary data filtering/fetching is performed (excluding necessary data, fetching already available data)
129
+
- A component uses `useOnyx` and either:
130
+
- Subscribes to a broad data structure without selecting specific fields, causing re-renders when unrelated fields change
131
+
- Uses a `selector` whose output is still large or complex (e.g., full collection, large mapped/transformed result, `Set`, `Map`), or returns an intermediate data structure that is further reduced by the component
132
+
- A selector on a collection references other large external datasets (e.g., another Onyx collection passed via closure) and iterates over them on every change to the subscribed collection, compounding the computation cost on unrelated updates
45
133
46
134
**DO NOT flag if:**
47
135
48
-
- Specific fields are already being selected or the data structure is static
49
-
- The filtering is necessary for correct functionality
50
-
- The fetched data is required and cannot be derived from existing data
51
-
- The function requires the entire object for valid operations
136
+
- The selector returns a primitive value (`boolean`, `string`, `number`, `undefined`)
137
+
- The selector returns a small object with only a few fields picked from a single item (not a collection)
138
+
- The selector meaningfully reduces a large dataset to a small result (e.g., a primitive or a few items) by iterating over the subscribed collection itself — the `deepEqual` cost on a small result is negligible
139
+
- The `useOnyx` call is on a single-item key (not a collection), and the selector picks specific fields
140
+
- The data structure is static or the function requires the entire object for valid operations
title: Use the correct loading indicator based on navigation context
4
+
---
5
+
6
+
## [UI-1] Use the correct loading indicator based on navigation context
7
+
8
+
### Reasoning
9
+
10
+
If loading hangs, users need an escape route. When navigation (back button, close) is visible alongside the loader, users can escape - use `ActivityIndicator`. When no navigation is visible, users are trapped - use `FullscreenLoadingIndicator` with `shouldUseGoBackButton={true}` which shows an emergency "Go Back" button after timeout. This prop is being migrated to become default, so set it explicitly for now.
11
+
12
+
### Incorrect
13
+
14
+
```tsx
15
+
// Header and FullscreenLoadingIndicator in SAME return - use ActivityIndicator
16
+
<ScreenWrapper>
17
+
<HeaderWithBackButtontitle="Settings" />
18
+
<FullscreenLoadingIndicator />
19
+
</ScreenWrapper>
20
+
21
+
// No navigation, missing shouldUseGoBackButton - user trapped if loading hangs
22
+
function ValidateLoginPage() {
23
+
return <FullscreenLoadingIndicator />;
24
+
}
25
+
26
+
// ActivityIndicator as sole content without navigation - use FullscreenLoadingIndicator
-`FullscreenLoadingIndicator` and `HeaderWithBackButton` (or other navigation like close button) are **both under the same JSX tree** (not separated by conditionals)
81
+
-`FullscreenLoadingIndicator` without `shouldUseGoBackButton` prop when **no navigation component** (e.g., `HeaderWithBackButton`, close button) **is rendered in the same return statement or conditional branch**
82
+
-`ActivityIndicator` as the **sole/main screen content** (flex:1 container, early return) without any navigation component (e.g., `HeaderWithBackButton`, close button) **in the same return statement or conditional branch**
83
+
84
+
**DO NOT flag if:**
85
+
86
+
**For `FullscreenLoadingIndicator`:**
87
+
- Visibility is controlled by `FullScreenLoaderContext`
88
+
- Navigation visible in different conditional branches (separate return statement) AND has `shouldUseGoBackButton={true}`
89
+
90
+
**For `ActivityIndicator`:**
91
+
- Used within interactive UI elements (buttons, list items, cards) where user can still interact with surrounding navigation
0 commit comments