-
Notifications
You must be signed in to change notification settings - Fork 25
Refactor CLAUDE.md documentation to improve AI code review guidance #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… from Claude Code itself where it is getting lost-ish in our code base
|
Claude finished @theMickster's task —— View job Review SummaryThis PR significantly improves AI guidance documentation by consolidating and restructuring critical rules into a more accessible format. The changes transform the root CLAUDE.md from a comment-focused checklist into comprehensive architectural documentation, while new crate-specific CLAUDE.md files provide focused guidance for complex subsystems. Critical Issues (1)Finding 1: Duplicate crypto rules at .claude/CLAUDE.md:72-74 (copy/paste error from applying formatting suggestion) Previous Review ItemsResolved:
Outstanding from previous reviews:
Good Practices Observed
Action Items
|
|
Great job! No new security vulnerabilities introduced in this pull request |
🔍 SDK Breaking Change Detection ResultsSDK Version:
Breaking change detection completed. View SDK workflow |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #586 +/- ##
==========================================
- Coverage 79.51% 79.46% -0.05%
==========================================
Files 302 302
Lines 32311 32331 +20
==========================================
Hits 25691 25691
- Misses 6620 6640 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments/suggestions on the main claude file. I did not review error-macro / ipc / state / threading since the other reviewers have a better grasp on these.
Also looks like there is a prettier formatting error, but that can be resolved when all other reviewers comments are resolved.
Other than that mostly looks good.
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
.claude/CLAUDE.md
Outdated
| - IMPORTANT: Use constant time equality checks | ||
| - Do not expose low-level / hazmat functions from the crypto crate. | ||
| - Do not expose key material from the crypto crate, use key references in the key store instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Duplicate crypto rules
Lines 72-74 are exact duplicates of lines 69-71. This duplication appears to have occurred when applying quexten's formatting suggestion - the line breaks were added correctly, but the original unformatted text wasn't removed.
| - IMPORTANT: Use constant time equality checks | |
| - Do not expose low-level / hazmat functions from the crypto crate. | |
| - Do not expose key material from the crypto crate, use key references in the key store instead | |
| ### State Management (bitwarden-state) |
This removes the duplicate rules and adds the proper blank line before the next section header.
quexten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for an initial round. I think we can iterate if we find it not focusing enough or focusing too much on some details.
withinfocus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supporting approval after Bernd's review.
dani-garcia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a minor nit that will cause WASM tests to fail if not run on the correct directory.
.claude/CLAUDE.md
Outdated
|
|
||
| **WASM Testing:** | ||
|
|
||
| - `cargo test --target wasm32-unknown-unknown --all-features` - WASM-specific tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command can't be run directly from root, as some crates depend on certain features that aren't available in WASM contexts. We should probably not use --all-features either as that would enable the UniFFI feature of some packages that is also not WASM compatible.
Instead, we have two options:
- We indicate that this command should be run only in the directories of the relevant crates (at the moment that is
bitwarden-error,bitwarden-threading,bitwarden-uuid) - We update the command to only run on the crates with wasm-specific tests:
cargo test --target wasm32-unknown-unknown --features wasm -p bitwarden-error -p bitwarden-threading -p bitwarden-uuid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll update it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to reflect those changes
674cc0d
…d documentation to improve AI code review guidance (bitwarden/sdk-internal#586)

🎟️ Tracking
📔 Objective
The updates to these various markdowns are the culmination of a number of iterations with Claude Code, Copilot and a few teammates to aid in better Claude Code Reviews. A general consensus is that the information that Claude has given thus far in our Rust SDK needs to improve. I attempted to combine many of the thoughts in the
copilot-instructions.mdinto our CLAUDE.md because there was good information in that document.I'm no Rust expert so I will need help in double-checking that the suggestions are valid.
Thanks!