From ace0e41589dfb5b89241bdfc065da31d515e3afe Mon Sep 17 00:00:00 2001 From: Mick Letofsky Date: Mon, 27 Oct 2025 18:34:33 +0100 Subject: [PATCH] Implement reusable Claude code review workflow (#2064) --- .claude/CLAUDE.md | 12 ++++++++++++ .claude/prompts/review-code.md | 27 +++++++++++++++++++++++++++ .github/workflows/respond.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/review-code.yml | 20 ++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 .claude/CLAUDE.md create mode 100644 .claude/prompts/review-code.md create mode 100644 .github/workflows/respond.yml create mode 100644 .github/workflows/review-code.yml diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 100644 index 000000000..78ef59b8b --- /dev/null +++ b/.claude/CLAUDE.md @@ -0,0 +1,12 @@ +# Bitwarden iOS Password Manager & Authenticator Apps + +## References + +- [iOS Architecture](./../Docs/Architecture.md) +- [Architectural Decision Records (ADRs)](https://contributing.bitwarden.com/architecture/adr/) +- [Contributing Guidelines](https://contributing.bitwarden.com/contributing/) +- [Accessibility](https://contributing.bitwarden.com/contributing/accessibility/) +- [Setup Guide](https://contributing.bitwarden.com/getting-started/mobile/ios/) +- [Code Style](https://contributing.bitwarden.com/contributing/code-style/swift) +- [Security Whitepaper](https://bitwarden.com/help/bitwarden-security-white-paper/) +- [Security Definitions](https://contributing.bitwarden.com/architecture/security/definitions) diff --git a/.claude/prompts/review-code.md b/.claude/prompts/review-code.md new file mode 100644 index 000000000..93b97cfad --- /dev/null +++ b/.claude/prompts/review-code.md @@ -0,0 +1,27 @@ +Please review this pull request with a focus on: + +- Code quality and best practices +- Potential bugs or issues +- Security implications +- Performance considerations + +Note: The PR branch is already checked out in the current working directory. + +Provide a comprehensive review including: + +- Summary of changes since last review +- Critical issues found (be thorough) +- Suggested improvements (be thorough) +- Good practices observed (be concise - list only the most notable items without elaboration) +- Action items for the author +- Leverage collapsible
sections where appropriate for lengthy explanations or code + snippets to enhance human readability + +When reviewing subsequent commits: + +- Track status of previously identified issues (fixed/unfixed/reopened) +- Identify NEW problems introduced since last review +- Note if fixes introduced new issues + +IMPORTANT: Be comprehensive about issues and improvements. For good practices, be brief - just note +what was done well without explaining why or praising excessively. diff --git a/.github/workflows/respond.yml b/.github/workflows/respond.yml new file mode 100644 index 000000000..d940ceee7 --- /dev/null +++ b/.github/workflows/respond.yml @@ -0,0 +1,28 @@ +name: Respond + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +permissions: {} + +jobs: + respond: + name: Respond + uses: bitwarden/gh-actions/.github/workflows/_respond.yml@main + secrets: + AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} + permissions: + actions: read + contents: write + id-token: write + issues: write + pull-requests: write diff --git a/.github/workflows/review-code.yml b/.github/workflows/review-code.yml new file mode 100644 index 000000000..46309af38 --- /dev/null +++ b/.github/workflows/review-code.yml @@ -0,0 +1,20 @@ +name: Code Review + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +permissions: {} + +jobs: + review: + name: Review + uses: bitwarden/gh-actions/.github/workflows/_review-code.yml@main + secrets: + AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} + permissions: + contents: read + id-token: write + pull-requests: write