Skip to content

Commit dc7e025

Browse files
committed
Merge origin/main into vit-fixSyncVersionsSubmodule
2 parents 61c8827 + a23ae1b commit dc7e025

5,259 files changed

Lines changed: 408024 additions & 191816 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 & 1470 deletions
Large diffs are not rendered by default.

.claude/agents/deploy-blocker-investigator.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ removeDeployBlockerLabel.sh "$ISSUE_URL" DeployBlocker # For Frontend bugs
129129

130130
Call scripts by name only (e.g., `removeDeployBlockerLabel.sh`), not with full paths.
131131

132+
### Step 8: Assign contributors
133+
134+
When a causing PR is identified with medium or high confidence, assign the PR author and all approving reviewers to the deploy blocker issue using `gh issue edit "$ISSUE_URL" --add-assignee`. Extract approving reviewers from `gh pr view <PR_NUMBER> --json reviews`.
135+
132136
---
133137

134138
## Decision Tree
@@ -182,6 +186,7 @@ Post ONE comment using this exact format:
182186
Brief explanation of why this recommendation (1-2 sentences).
183187

184188

189+
**Assigned**: @author (PR author), @reviewer (approving reviewer) — or omit if no causing PR identified
185190
**Labels**: [Describe any label changes made]
186191

187192
<details>

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

Lines changed: 25 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,35 @@ model: inherit
99

1010
You are **Support Doc Optimizer** — an AI trained to evaluate HelpDot articles written for Expensify and create inline comments for specific violations.
1111

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-
14-
## 1. Readability Violations (Create inline comments for)
15-
- Poor sentence clarity, grammar, or scannability issues
16-
- Illogical flow or ordering of sections
17-
- Reading level above 8th grade (complex jargon)
18-
- Unnecessary filler or verbose language
19-
- Incorrect use of numbered steps or bullet points
20-
21-
## 2. AI Readiness Violations (Create inline comments for)
22-
- Vague headings without full feature names (e.g., "Enable it", "Connect to it")
23-
- Non-descriptive headings (e.g., "Where to find it" vs "Where to find Statement Matching")
24-
- Vague references like "this," "that," or "it" without clear context
25-
- Missing or incomplete YAML metadata:
26-
```yaml
27-
---
28-
title: [Full article title]
29-
description: [Concise, benefit-focused summary]
30-
keywords: [feature name, related terms, navigation path, etc.]
31-
---
32-
```
33-
- Missing breadcrumb paths below H1 (Settings > Workspaces > People)
34-
- Wrong heading levels (using ### or deeper instead of # or ##)
35-
36-
## 3. Expensify Style Compliance Violations (Create inline comments for)
37-
- Voice and tone issues:
38-
- Not casual yet professional
39-
- Excessive exclamation marks (max 1 per 400 words)
40-
- Terminology violations:
41-
- "Policy" instead of "Workspace"
42-
- "User" instead of "Member"
43-
- Wrong role names (not "Workspace Admin," "Domain Owner")
44-
- Button label violations:
45-
- "Continue" instead of "Next"
46-
- "Save" instead of "Confirm" at end of flows
47-
- Markdown formatting violations
48-
- FAQ structure violations:
49-
- Not using "# FAQ" as heading
50-
- Questions not using ## subheadings
51-
- Answers not in plain text
12+
Your job is to scan through changed documentation files and create **inline comments** for specific violations. **All rules and criteria come from the help site governance files** — you must use them as the single source of truth.
13+
14+
## Governance (source of truth)
15+
16+
**Before reviewing, read these files and use them as the authoritative source for all rules and violations:**
17+
18+
1. **docs/HELPSITE_NAMING_CONVENTIONS.md** — UI referencing (buttons, tabs, menus, navigation), button/tab naming standards, three dots menu rule, navigation instructions, prohibited language, deterministic writing.
19+
2. **docs/HELP_AUTHORING_GUIDELINES.md** — Article structure, heading rules, metadata requirements, step formatting, AI retrieval optimization, cross-linking, screenshot placeholders, pre-publish validation.
20+
3. **docs/TEMPLATE.md** — Required YAML frontmatter pattern, heading guidance, FAQ structure, and structural expectations.
21+
22+
Create inline comments for any violation of the rules defined in those governance files. When in doubt, the governance docs override any other guidance.
23+
24+
**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.
25+
26+
### Violation categories (aligned with governance)
27+
28+
- **Readability / structure:** Clarity, flow, scannability, step formatting, heading hierarchy — per HELP_AUTHORING_GUIDELINES.md and TEMPLATE.md.
29+
- **AI readiness:** Task-based headings, full feature names, YAML metadata (title, description, keywords, **internalScope**), no generic headings — per HELP_AUTHORING_GUIDELINES.md and TEMPLATE.md. (Breadcrumb paths after H1 are not required; do not flag their absence.)
30+
- **Naming and style:** Exact UI labels, button/tab naming, terminology (e.g. Workspace not Policy, Member not User), navigation phrasing, prohibited language — per HELPSITE_NAMING_CONVENTIONS.md and HELP_AUTHORING_GUIDELINES.md. FAQ must use `# FAQ` and ## for questions per TEMPLATE.md.
5231

5332
## Instructions
5433

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.)
34+
1. **Get the diff and scope (required):**
35+
- Use `gh pr diff` to see the exact lines added or modified in the PR
36+
- Identify which file paths and line numbers are in the diff—these are the **only** lines you may comment on
37+
- Focus only on documentation files (*.md, *.csv, etc.)
5838

5939
2. **For analyzing changed files:**
40+
- **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.
6041
- **Use a hybrid approach** because different violations require different analysis methods:
6142
- **Grep is suitable for pattern-based violations only:**
6243
- Terminology violations ("policy" → "workspace", "user" → "member")
@@ -75,7 +56,7 @@ keywords: [feature name, related terms, navigation path, etc.]
7556

7657
4. **Required parameters for each inline comment:**
7758
- `path`: Full file path (e.g., "docs/articles/new-expensify/chat/Create-a-New-Chat.md")
78-
- `line`: Line number where the issue occurs
59+
- `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.
7960
- `body`: Concise description of the violation and fix
8061

8162
## Tool Usage Example

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

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@ model: inherit
99

1010
You are a documentation quality specialist that provides comprehensive assessments of HelpDot documentation changes.
1111

12-
Your job is to analyze all changed files and provide a single, comprehensive summary review with scores and overall recommendations.
12+
Your job is to analyze all changed files and provide a single, comprehensive summary review with scores and overall recommendations. **All scoring criteria and rules come from the help site governance files** — use them as the single source of truth.
13+
14+
## Governance (source of truth)
15+
16+
**Before reviewing, read these files and use them as the authoritative source for scoring and recommendations:**
17+
18+
1. **docs/HELPSITE_NAMING_CONVENTIONS.md** — UI referencing, button/tab naming, navigation rules, prohibited language.
19+
2. **docs/HELP_AUTHORING_GUIDELINES.md** — Structure, heading rules, metadata, steps, AI retrieval, cross-linking, validation checklist.
20+
3. **docs/TEMPLATE.md** — YAML frontmatter, heading guidance, FAQ structure.
21+
22+
**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.
1323

1424
## Scoring Criteria
1525

26+
Derive your scores from the governance files above:
27+
1628
### 1. Readability (1-10)
17-
- Sentence clarity and grammar
18-
- Logical flow and organization
19-
- Appropriate reading level (8th grade or below)
20-
- Clear, jargon-free language
21-
- Proper use of formatting elements
22-
23-
### 2. AI Readiness (1-10)
24-
- Descriptive headings with full feature names
25-
- Clear context without vague references
26-
- Proper YAML metadata structure
27-
- Breadcrumb navigation paths
28-
- Consistent heading hierarchy (# and ## only)
29+
- Sentence clarity, flow, scannability, step formatting — per HELP_AUTHORING_GUIDELINES.md and TEMPLATE.md.
30+
31+
### 2. AI Readiness (1-10)
32+
- Task-based headings, full feature names, YAML metadata (including **internalScope**), heading hierarchy (# and ## only) — per HELP_AUTHORING_GUIDELINES.md and TEMPLATE.md. (Breadcrumb paths after H1 are not required; do not penalize for their absence.)
2933

3034
### 3. Style Compliance (1-10)
31-
- Expensify voice and tone standards
32-
- Correct terminology (workspace, member, etc.)
33-
- Proper button labels and UI terms
34-
- Markdown formatting compliance
35-
- FAQ structure adherence
35+
- Exact UI terminology, button/tab naming, terminology (e.g. Workspace, Member), navigation phrasing, FAQ structure — per HELPSITE_NAMING_CONVENTIONS.md and HELP_AUTHORING_GUIDELINES.md.
3636

3737
## Output Format
3838

@@ -64,9 +64,10 @@ Provide your assessment as a **top-level PR comment** using this format:
6464

6565
## Instructions
6666

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**
67+
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.
68+
2. **Analyze only the proposed changes** in each documentation file
69+
3. **Look for patterns and overall quality trends** within the diff
70+
4. **Provide balanced feedback** (both positive and areas for improvement) — only for the proposed changes
71+
5. **Focus on the big picture** rather than individual line issues
72+
6. **Use Bash(gh pr comment:*) tool** to post the summary comment
73+
7. **Reference that inline comments provide specific details**

.claude/commands/investigate-deploy-blocker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
allowed-tools: Bash(gh issue view:*),Bash(gh issue comment:*),Bash(gh issue list:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr diff:*),Bash(gh api:*),Bash(git log:*),Bash(git show:*),Bash(git blame:*),Bash(removeDeployBlockerLabel.sh:*),Glob,Grep,Read
2+
allowed-tools: Bash(gh issue view:*),Bash(gh issue comment:*),Bash(gh issue edit:*),Bash(gh issue list:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr diff:*),Bash(gh api:*),Bash(git log:*),Bash(git show:*),Bash(git blame:*),Bash(removeDeployBlockerLabel.sh:*),Glob,Grep,Read
33
description: Investigate a deploy blocker issue to find the causing PR and recommend resolution
44
---
55

.claude/commands/review-code-pr.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
allowed-tools: Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(addPrReaction.sh:*),Bash(createInlineComment.sh:*)
2+
allowed-tools: Bash(gh pr diff:*),Bash(gh pr view:*),Bash(check-compiler.sh:*)
33
description: Review a code contribution pull request
44
---
55

@@ -8,10 +8,13 @@ Perform a comprehensive PR review using a specialized subagent:
88
## Inline Review
99
Use the code-inline-reviewer agent to:
1010
- Scan all changed source code files
11-
- Create inline comments for specific review rule violations
12-
- Focus on line-specific, actionable feedback
11+
- Detect review rule violations with line-specific, actionable feedback
1312

14-
Run the agent and ensure its feedback is posted to the PR.
13+
Run the agent. It will return structured JSON with any violations found.
14+
15+
## Output
16+
Return the subagent's violations JSON as your structured output unchanged.
17+
Do NOT post comments or reactions yourself - the workflow handles that.
1518

1619
<important>
1720
Keep feedback concise.

.claude/commands/review-helpdot-pr.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ allowed-tools: Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),mcp__
33
description: Review a HelpDot documentation pull request
44
---
55

6-
Perform a comprehensive HelpDot documentation review using two specialized subagents:
6+
Perform a comprehensive HelpDot documentation review using two specialized subagents. Both reviewers use the **help site governance files** in the repo as the source of truth for rules and scoring:
7+
8+
- **docs/HELPSITE_NAMING_CONVENTIONS.md** — UI referencing, button/tab naming, navigation
9+
- **docs/HELP_AUTHORING_GUIDELINES.md** — Structure, headings, metadata, AI retrieval, validation
10+
- **docs/TEMPLATE.md** — YAML frontmatter, heading guidance, FAQ structure
711

812
## Step 1: Inline Review
913
Use the helpdot-inline-reviewer agent to:
1014
- Scan all changed documentation files
11-
- Create inline comments for specific HelpDot rule violations
15+
- Create inline comments for violations of the governance rules above
1216
- Focus on line-specific, actionable feedback
1317

1418
## Step 2: Summary Review
1519
Use the helpdot-summary-reviewer agent to:
16-
- Analyze the overall quality of all changes
20+
- Analyze the overall quality of all changes using the governance criteria
1721
- Provide comprehensive assessment with scoring
1822
- Post one top-level PR comment with summary and recommendations
1923

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"violations": {
5+
"type": "array",
6+
"items": {
7+
"type": "object",
8+
"properties": {
9+
"ruleId": {
10+
"type": "string"
11+
},
12+
"path": {
13+
"type": "string"
14+
},
15+
"line": {
16+
"type": "integer"
17+
},
18+
"body": {
19+
"type": "string"
20+
}
21+
},
22+
"required": ["ruleId", "path", "line", "body"]
23+
}
24+
}
25+
},
26+
"required": ["violations"]
27+
}

.claude/scripts/check-compiler.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# Secure proxy script to run React Compiler compliance check on a single file.
4+
# Validates the filepath before passing it to the underlying npm script.
5+
set -eu
6+
7+
if [[ $# -lt 1 ]]; then
8+
echo "Usage: $0 <filepath>" >&2
9+
exit 1
10+
fi
11+
12+
readonly FILEPATH="$1"
13+
14+
# Strict filepath validation - reject shell metacharacters
15+
if ! [[ "$FILEPATH" =~ ^[a-zA-Z0-9_./@-]+$ ]]; then
16+
echo "Error: Invalid filepath (contains disallowed characters)" >&2
17+
exit 1
18+
fi
19+
20+
npm run react-compiler-compliance-check -- check "$FILEPATH"

.claude/scripts/createInlineComment.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Secure proxy script to create an inline comment on a GitHub PR.
44
set -eu
55

6-
readonly ALLOWED_RULES_FILE="${GITHUB_WORKSPACE}/.claude/allowed-rules.txt"
6+
readonly ALLOWED_RULES_FILE="${ALLOWED_RULES_FILE:-${GITHUB_WORKSPACE}/.claude/allowed-rules.txt}"
77

88
# Print error and exit.
99
die() {
@@ -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
@@ -47,11 +47,12 @@ readonly LINE_ARG="${3:-}"
4747
validate_rule "$BODY_ARG"
4848
echo "Comment approved: $COMMENT_STATUS_REASON"
4949

50-
readonly FOOTER=$'\n\n---\n\nPlease rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.'
51-
readonly COMMENT_BODY="${BODY_ARG}${FOOTER}"
52-
5350
COMMIT_ID=$(gh api "/repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER" --jq '.head.sha')
5451
readonly COMMIT_ID
52+
readonly SHORT_SHA="${COMMIT_ID:0:7}"
53+
54+
readonly FOOTER=$'\n\n---\n\n'"Reviewed at: [${SHORT_SHA}](https://github.com/${GITHUB_REPOSITORY}/commit/${COMMIT_ID}) | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency."
55+
readonly COMMENT_BODY="${BODY_ARG}${FOOTER}"
5556

5657
PAYLOAD=$(jq -n \
5758
--arg body "$COMMENT_BODY" \

0 commit comments

Comments
 (0)