Skip to content

Commit d42b40b

Browse files
committed
Merge branch 'main' into fix/expense-merge-opens-incorrect-chat
2 parents 9ebf64d + 6908b90 commit d42b40b

1,532 files changed

Lines changed: 82518 additions & 27832 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/agents/code-inline-reviewer.md

Lines changed: 34 additions & 1442 deletions
Large diffs are not rendered by default.

.claude/agents/helpdot-inline-reviewer.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ You are **Support Doc Optimizer** — an AI trained to evaluate HelpDot articles
1111

1212
Your job is to scan through changed documentation files and create **inline comments** for specific violations based on the three core criteria below.
1313

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.
15+
1416
## 1. Readability Violations (Create inline comments for)
1517
- Poor sentence clarity, grammar, or scannability issues
1618
- Illogical flow or ordering of sections
@@ -20,6 +22,7 @@ Your job is to scan through changed documentation files and create **inline comm
2022

2123
## 2. AI Readiness Violations (Create inline comments for)
2224
- 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)
2326
- Non-descriptive headings (e.g., "Where to find it" vs "Where to find Statement Matching")
2427
- Vague references like "this," "that," or "it" without clear context
2528
- Missing or incomplete YAML metadata:
@@ -28,11 +31,14 @@ Your job is to scan through changed documentation files and create **inline comm
2831
title: [Full article title]
2932
description: [Concise, benefit-focused summary]
3033
keywords: [feature name, related terms, navigation path, etc.]
34+
internalScope: Audience is [target role]. Covers [main topic]. Does not cover [excluded areas].
3135
---
3236
```
33-
- Missing breadcrumb paths below H1 (Settings > Workspaces > People)
37+
- **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].`
3438
- Wrong heading levels (using ### or deeper instead of # or ##)
3539

40+
**Note:** A breadcrumb path after the H1 heading is **not** required. Do not flag missing breadcrumbs as a violation.
41+
3642
## 3. Expensify Style Compliance Violations (Create inline comments for)
3743
- Voice and tone issues:
3844
- Not casual yet professional
@@ -52,11 +58,13 @@ keywords: [feature name, related terms, navigation path, etc.]
5258

5359
## Instructions
5460

55-
1. **First, get the list of changed files:**
56-
- 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.)
5865

5966
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.
6068
- **Use a hybrid approach** because different violations require different analysis methods:
6169
- **Grep is suitable for pattern-based violations only:**
6270
- Terminology violations ("policy" → "workspace", "user" → "member")
@@ -75,7 +83,7 @@ keywords: [feature name, related terms, navigation path, etc.]
7583

7684
4. **Required parameters for each inline comment:**
7785
- `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.
7987
- `body`: Concise description of the violation and fix
8088

8189
## Tool Usage Example

.claude/agents/helpdot-summary-reviewer.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ You are a documentation quality specialist that provides comprehensive assessmen
1111

1212
Your job is to analyze all changed files and provide a single, comprehensive summary review with scores and overall recommendations.
1313

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+
1416
## Scoring Criteria
1517

1618
### 1. Readability (1-10)
@@ -21,12 +23,13 @@ Your job is to analyze all changed files and provide a single, comprehensive sum
2123
- Proper use of formatting elements
2224

2325
### 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")
2527
- 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)
2829
- Consistent heading hierarchy (# and ## only)
2930

31+
**Note:** Breadcrumb paths after H1 are not required; do not penalize for their absence.
32+
3033
### 3. Style Compliance (1-10)
3134
- Expensify voice and tone standards
3235
- Correct terminology (workspace, member, etc.)
@@ -64,9 +67,10 @@ Provide your assessment as a **top-level PR comment** using this format:
6467

6568
## Instructions
6669

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**

.claude/scripts/createInlineComment.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ validate_rule() {
2525

2626
[[ -f "$ALLOWED_RULES_FILE" ]] || die "Comment rejected: allowed rules file missing at $ALLOWED_RULES_FILE"
2727

28-
rule=$(echo "$body" | grep -oE '[A-Z]+-[0-9]+' | head -1 || true)
28+
rule=$(echo "$body" | grep -oE '[A-Z]+(-[A-Z]+)*-[0-9]+' | head -1 || true)
2929
[[ -n "$rule" ]] || die "Comment rejected: missing allowed rule reference (e.g. PERF-1)"
3030

3131
if grep -qF "$rule" "$ALLOWED_RULES_FILE"; then

.claude/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
{
2+
"hooks": {
3+
"PostToolUse": [
4+
{
5+
"matcher": "Edit|Write",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "FILE=$(jq -r '.tool_input.file_path') && [ -f \"$FILE\" ] && ./node_modules/.bin/prettier --experimental-cli --write --ignore-unknown \"$FILE\""
10+
}
11+
]
12+
}
13+
]
14+
},
215
"extraKnownMarketplaces": {
316
"callstack-agent-skills": {
417
"source": {
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: coding-standards
3+
description: Provides coding standards for React Native — performance patterns, consistency rules, and clean React architecture. Use when writing, modifying, or reviewing code.
4+
alwaysApply: true
5+
---
6+
7+
# Expensify Coding Standards
8+
9+
Coding standards for the Expensify App. Each standard is a standalone file in `rules/` with reasoning, examples, and applicability conditions.
10+
11+
## Categories
12+
13+
| Category | Prefix | Focus |
14+
|----------|--------|-------|
15+
| Performance | `PERF-*` | Render optimization, memo patterns, useEffect hygiene, data selection |
16+
| Consistency | `CONSISTENCY-*` | Platform checks, magic values, unused props, ESLint discipline |
17+
| Clean React Patterns | `CLEAN-REACT-PATTERNS-*` | Composition, component ownership, state structure |
18+
19+
## Quick Reference
20+
21+
### Performance
22+
- [PERF-1](rules/perf-1-no-spread-in-renderitem.md) — No spread in renderItem
23+
- [PERF-2](rules/perf-2-early-return.md) — Return early before expensive work
24+
- [PERF-3](rules/perf-3-onyx-list-item-provider.md) — Use OnyxListItemProvider in renderItem
25+
- [PERF-5](rules/perf-5-shallow-comparison.md) — Shallow over deep comparisons
26+
- [PERF-6](rules/perf-6-derive-state-from-props.md) — Derive state from props
27+
- [PERF-7](rules/perf-7-reset-via-key-prop.md) — Reset via key prop
28+
- [PERF-8](rules/perf-8-events-in-handlers.md) — Handle events in handlers
29+
- [PERF-9](rules/perf-9-no-useeffect-chains.md) — No useEffect chains
30+
- [PERF-10](rules/perf-10-no-useeffect-parent-comm.md) — No useEffect parent communication
31+
- [PERF-11](rules/perf-11-optimize-data-selection.md) — Optimize data selection
32+
- [PERF-12](rules/perf-12-prevent-memory-leaks.md) — Prevent memory leaks
33+
- [PERF-13](rules/perf-13-hoist-iterator-calls.md) — Hoist iterator-independent calls
34+
- [PERF-14](rules/perf-14-use-sync-external-store.md) — Use useSyncExternalStore
35+
- [PERF-15](rules/perf-15-cleanup-async-effects.md) — Clean up async Effects
36+
- [PERF-16](rules/perf-16-guard-double-init.md) — Guard double initialization
37+
38+
### Consistency
39+
- [CONSISTENCY-1](rules/consistency-1-no-platform-checks.md) — No platform-specific checks in components
40+
- [CONSISTENCY-2](rules/consistency-2-no-magic-values.md) — No magic numbers/strings
41+
- [CONSISTENCY-3](rules/consistency-3-no-code-duplication.md) — No code duplication
42+
- [CONSISTENCY-4](rules/consistency-4-no-unused-props.md) — No unused props
43+
- [CONSISTENCY-5](rules/consistency-5-justify-eslint-disable.md) — Justify ESLint disables
44+
- [CONSISTENCY-6](rules/consistency-6-proper-error-handling.md) — Proper error handling
45+
46+
### Clean React Patterns
47+
- [CLEAN-REACT-PATTERNS-1](rules/clean-react-1-composition-over-config.md) — Composition over configuration
48+
- [CLEAN-REACT-PATTERNS-2](rules/clean-react-2-own-behavior.md) — Components own their behavior
49+
- [CLEAN-REACT-PATTERNS-3](rules/clean-react-3-context-free-contracts.md) — Context-free component contracts
50+
- [CLEAN-REACT-PATTERNS-4](rules/clean-react-4-no-side-effect-spaghetti.md) — No side-effect spaghetti
51+
- [CLEAN-REACT-PATTERNS-5](rules/clean-react-5-narrow-state.md) — Keep state narrow
52+
53+
## Usage
54+
55+
**During development**: When writing or modifying `src/` files, consult the relevant standard files for detailed conditions, examples, and exceptions.
56+
57+
**During review**: The code-inline-reviewer agent loads all standards from this directory. See `.claude/agents/code-inline-reviewer.md`.

0 commit comments

Comments
 (0)