Add canonical shared-rules mechanism to claude-review-toolkit#92
Add canonical shared-rules mechanism to claude-review-toolkit#92marcochavezf wants to merge 1 commit into
Conversation
The code-inline-reviewer agent enforces coding-standards rules from each repo's own committed copy, so a repo-agnostic rule like GEN-04 (commenting why) has already drifted into three different versions across Auth, Web-Expensify, and App. This copies genuinely shared rule files from shared-rules/ into the caller's rules directory at review time, so one canonical copy reaches every repo's real PR review without a per-repo commit to keep in sync.
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e21ca3e8a1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| shell: bash | ||
| run: | | ||
| RULES_DIR="$GITHUB_WORKSPACE/.claude/skills/coding-standards/rules" | ||
| mkdir -p "$RULES_DIR" |
There was a problem hiding this comment.
Preserve the missing-rules-directory failure
For a caller whose checkout or repo layout does not provide .claude/skills/coding-standards/rules, this mkdir -p creates the directory before extractAllowedRules.sh runs, so the documented guard that should fail on a missing caller rules directory is bypassed and the workflow can continue with only the shared GEN-04 rule. Keep the existence check before creating/copying shared files, or fail if the caller directory was absent, so misconfigured repos do not silently lose their repo-specific review rules.
Useful? React with 👍 / 👎.
Details
The
code-inline-revieweragent used by Auth's, Web-Expensify's, and App'sclaude-review.ymlworkflows loads its coding-standards rules from each repo's own committed.claude/skills/coding-standards/rules/directory. A repo-agnostic rule like GEN-04 (commenting why) has already drifted into three different versions: Auth's copy uses curly quotes, Web-Expensify's copy is named differently and uses straight quotes, and App has no GEN-04 at all.This adds a
shared-rules/directory toclaude-review-toolkitholding the canonical version of rules that are genuinely identical across repos (currently just GEN-04). A new "Copy shared coding-standards rules" step inaction.ymlcopies each shared rule file into the caller's.claude/skills/coding-standards/rules/directory asAutoLoadShared-<file>.mdbefore the existing "Extract allowed rules" step runs, so it reaches every caller's real PR review with no per-repo commit to keep in sync. The copy happens fresh in the ephemeral workflow checkout on every run and is never committed to the caller repo.Follow-up PRs in Auth, Web-Expensify, and App will bump their pinned
claude-review-toolkit@<sha>reference to this commit, delete their now-redundant local GEN-04 copy, and updatecode-inline-reviewer.md's docs-link generation to point a shared rule's link at this repo instead of the caller's own repo.Related Issues
https://github.com/Expensify/Expensify/issues/657167
Manual Tests
Simulated the new action step locally: created a test workspace with an existing local rule file, ran the copy loop against
shared-rules/gen-04-commenting-why.md, then ranextractAllowedRules.shagainst the result and confirmed it extracts bothGEN-01(local) andGEN-04(shared) with no duplicates. Confirmed the copied file is byte-identical to Auth's currentgen-04-commenting-why.md(diff against the live Auth file on GitHub shows no differences).Linked PRs
None yet. Auth, Web-Expensify, and App consumer PRs will be linked here once opened, after this PR merges and its commit SHA is known.