Skip to content

Commit ef30745

Browse files
committed
Merge branch 'main' into fix/82362
2 parents 0542a87 + 9317075 commit ef30745

4,129 files changed

Lines changed: 278069 additions & 122705 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/deploy-blocker-investigator.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: deploy-blocker-investigator
33
description: Investigates deploy blockers to find the causing PR and recommend resolution.
4-
tools: Glob, Grep, Read, Bash, BashOutput
4+
tools: Glob, Grep, Read, Write, Bash, BashOutput
55
model: inherit
66
---
77

@@ -114,11 +114,9 @@ See Decision Tree below for label actions.
114114

115115
### Step 7: Post comment and update labels
116116

117-
Post your findings (use single quotes for the body to handle special characters):
117+
Write the comment body to a temp file using the Write tool, then post it:
118118
```bash
119-
gh issue comment "$ISSUE_URL" --body '## 🔍 Investigation Summary
120-
...your comment here...
121-
'
119+
gh issue comment "$ISSUE_URL" --body-file /tmp/investigation-summary.md
122120
```
123121

124122
Remove label only if the decision tree warrants it:
@@ -129,6 +127,15 @@ removeDeployBlockerLabel.sh "$ISSUE_URL" DeployBlocker # For Frontend bugs
129127

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

130+
### Step 8: Assign contributors
131+
132+
If the primary causing PR has at least medium confidence, assign its author and approving reviewers to the deploy blocker issue. Only assign contributors from this single PR.
133+
134+
```bash
135+
gh pr view <PR_NUMBER> --json reviews
136+
gh issue edit "$ISSUE_URL" --add-assignee <logins>
137+
```
138+
132139
---
133140

134141
## Decision Tree
@@ -168,7 +175,7 @@ Choose ONE:
168175

169176
## Comment Format
170177

171-
Post ONE comment using this exact format:
178+
Use the Write tool to create `/tmp/investigation-summary.md` with the following markdown structure. Every field and heading must be present.
172179

173180
```markdown
174181
## 🔍 Investigation Summary
@@ -182,6 +189,7 @@ Post ONE comment using this exact format:
182189
Brief explanation of why this recommendation (1-2 sentences).
183190

184191

192+
**Assigned**: @author (PR author), @reviewer (approving reviewer) from highest-confidence causing PR only — omit if no causing PR identified
185193
**Labels**: [Describe any label changes made]
186194

187195
<details>
@@ -201,6 +209,8 @@ Technical explanation of what went wrong in the code.
201209

202210
</details>
203211
```
212+
213+
Then post with: `gh issue comment "$ISSUE_URL" --body-file /tmp/investigation-summary.md`
204214
---
205215

206216
## Constraints
@@ -213,7 +223,7 @@ Technical explanation of what went wrong in the code.
213223
- Make assumptions about code you haven't read
214224
- Recommend DEMOTE for bugs affecting core functionality (auth, payments, data loss)
215225
- Close the issue—only update labels and comment
216-
- Use heredocs, temp files, or shell redirects for comments
226+
- Use heredocs or shell redirects for comments
217227

218228
**DO:**
219229
- Always verify the causing PR touches the affected code before concluding

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

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,25 @@ 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.
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.
1323

1424
**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.
1525

16-
## 1. Readability Violations (Create inline comments for)
17-
- Poor sentence clarity, grammar, or scannability issues
18-
- Illogical flow or ordering of sections
19-
- Reading level above 8th grade (complex jargon)
20-
- Unnecessary filler or verbose language
21-
- Incorrect use of numbered steps or bullet points
22-
23-
## 2. AI Readiness Violations (Create inline comments for)
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)
26-
- Non-descriptive headings (e.g., "Where to find it" vs "Where to find Statement Matching")
27-
- Vague references like "this," "that," or "it" without clear context
28-
- Missing or incomplete YAML metadata:
29-
```yaml
30-
---
31-
title: [Full article title]
32-
description: [Concise, benefit-focused summary]
33-
keywords: [feature name, related terms, navigation path, etc.]
34-
internalScope: Audience is [target role]. Covers [main topic]. Does not cover [excluded areas].
35-
---
36-
```
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].`
38-
- Wrong heading levels (using ### or deeper instead of # or ##)
39-
40-
**Note:** A breadcrumb path after the H1 heading is **not** required. Do not flag missing breadcrumbs as a violation.
41-
42-
## 3. Expensify Style Compliance Violations (Create inline comments for)
43-
- Voice and tone issues:
44-
- Not casual yet professional
45-
- Excessive exclamation marks (max 1 per 400 words)
46-
- Terminology violations:
47-
- "Policy" instead of "Workspace"
48-
- "User" instead of "Member"
49-
- Wrong role names (not "Workspace Admin," "Domain Owner")
50-
- Button label violations:
51-
- "Continue" instead of "Next"
52-
- "Save" instead of "Confirm" at end of flows
53-
- Markdown formatting violations
54-
- FAQ structure violations:
55-
- Not using "# FAQ" as heading
56-
- Questions not using ## subheadings
57-
- Answers not in plain text
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.
5831

5932
## Instructions
6033

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

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +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.
1321

1422
**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.
1523

1624
## Scoring Criteria
1725

18-
### 1. Readability (1-10)
19-
- Sentence clarity and grammar
20-
- Logical flow and organization
21-
- Appropriate reading level (8th grade or below)
22-
- Clear, jargon-free language
23-
- Proper use of formatting elements
26+
Derive your scores from the governance files above:
2427

25-
### 2. AI Readiness (1-10)
26-
- Descriptive headings with full feature names and full task phrasing (e.g., "Expense Rule options for Workspace Admins" not "Options")
27-
- Clear context without vague references
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)
29-
- Consistent heading hierarchy (# and ## only)
28+
### 1. Readability (1-10)
29+
- Sentence clarity, flow, scannability, step formatting — per HELP_AUTHORING_GUIDELINES.md and TEMPLATE.md.
3030

31-
**Note:** Breadcrumb paths after H1 are not required; do not penalize for their absence.
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.)
3233

3334
### 3. Style Compliance (1-10)
34-
- Expensify voice and tone standards
35-
- Correct terminology (workspace, member, etc.)
36-
- Proper button labels and UI terms
37-
- Markdown formatting compliance
38-
- 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.
3936

4037
## Output Format
4138

.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,Write
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
allowed-tools: Bash(gh pr diff:*),Bash(gh pr view:*)
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

.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

.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: 5 additions & 4 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() {
@@ -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" \

.claude/settings.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,21 @@
3838
"mcp__playwright__browser_wait_for",
3939
"mcp__playwright__browser_close",
4040
"mcp__playwright__browser_evaluate",
41-
"mcp__playwright__browser_handle_dialog"
41+
"mcp__playwright__browser_handle_dialog",
42+
"mcp__sentry__find_organizations",
43+
"mcp__sentry__find_projects",
44+
"mcp__sentry__find_releases",
45+
"mcp__sentry__find_teams",
46+
"mcp__sentry__get_doc",
47+
"mcp__sentry__get_event_attachment",
48+
"mcp__sentry__get_issue_details",
49+
"mcp__sentry__get_issue_tag_values",
50+
"mcp__sentry__get_trace_details",
51+
"mcp__sentry__search_docs",
52+
"mcp__sentry__search_events",
53+
"mcp__sentry__search_issue_events",
54+
"mcp__sentry__search_issues",
55+
"mcp__sentry__whoami"
4256
]
4357
},
4458
"enabledPlugins": {

.claude/skills/coding-standards/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Coding standards for the Expensify App. Each standard is a standalone file in `r
4444
- [CONSISTENCY-6](rules/consistency-6-proper-error-handling.md) — Proper error handling
4545

4646
### Clean React Patterns
47+
- [CLEAN-REACT-PATTERNS-0](rules/clean-react-0-compiler.md) — React Compiler compliance
4748
- [CLEAN-REACT-PATTERNS-1](rules/clean-react-1-composition-over-config.md) — Composition over configuration
4849
- [CLEAN-REACT-PATTERNS-2](rules/clean-react-2-own-behavior.md) — Components own their behavior
4950
- [CLEAN-REACT-PATTERNS-3](rules/clean-react-3-context-free-contracts.md) — Context-free component contracts

0 commit comments

Comments
 (0)