Skip to content

Commit e4938b5

Browse files
committed
Merge branch 'main' into ios/PM-23500/sourcery-usage
# Conflicts: # docs/architecture/mobile-clients/ios/index.md
2 parents a292135 + 65d5ff3 commit e4938b5

File tree

123 files changed

+5843
-3500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+5843
-3500
lines changed

.claude/CLAUDE.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Bitwarden Contributing Docs - Claude Code Configuration
2+
3+
- **OFTEN** prefer editing existing files over creating new ones
4+
- **ALWAYS** follow the established patterns for frontmatter, conditional content, and structure
5+
- **ALWAYS** validate code and diagram syntax
6+
7+
## Repository structure
8+
9+
- **docs/** - Documentation content organized into three main sections:
10+
- **getting-started/** - Setup instructions for various Bitwarden projects (clients, server,
11+
mobile, SDK)
12+
- **contributing/** - Contribution guidelines including code style, pull requests, testing, and
13+
database migrations
14+
- **architecture/** - Technical architecture documentation, ADRs (Architecture Decision Records),
15+
and deep dives into specific features
16+
- **src/** - Docusaurus custom components and React code
17+
- **static/** - Static assets like images
18+
- **scripts/** - Build and development scripts
19+
20+
## Key technologies
21+
22+
- **Docusaurus** - Static site generator
23+
- **React** - UI framework
24+
- **TypeScript**
25+
- **Node.js**
26+
27+
## Development commands
28+
29+
```bash
30+
npm ci # Install dependencies
31+
npm start # Start local dev server with SSL (requires .env setup)
32+
npm start:insecure # Start without SSL
33+
npm run build # Generate static site
34+
npm run prettier # Format code
35+
npm run lint # Check code formatting
36+
npm run spellcheck # Run cspell on Markdown files
37+
npm run typecheck # Run TypeScript type checking
38+
```
39+
40+
## Documentation writing guidelines
41+
42+
### Style guide
43+
44+
- Use numbered paragraphs for instructions/procedures, starting with action-oriented verbs ("click",
45+
"type", "restart")
46+
- Headings should start with capitalization but following words are not capitalized
47+
- Use code blocks for all commands (not inline)
48+
- Keep paragraphs concise and to-the-point
49+
- Add custom words to `custom-words.txt` if needed for spellchecking
50+
- Include trailing commas for multi-line lists
51+
- Do not use code regions
52+
- Follow language-specific guidelines for code examples in `docs/contributing/code-style/`
53+
- Diagrams should use [Mermaid](https://mermaid.js.org/)
54+
- Large code examples should be in `<details>` blocks
55+
56+
### Conditional content
57+
58+
The site serves both internal Bitwarden employees and external community contributors. Use these
59+
tags to target specific audiences:
60+
61+
```md
62+
<Community>
63+
Content for community contributors only
64+
</Community>
65+
66+
<Bitwarden>
67+
Content for Bitwarden employees only
68+
</Bitwarden>
69+
```
70+
71+
To hide pages from navigation, use frontmatter:
72+
73+
```yml
74+
---
75+
sidebar_custom_props:
76+
access: bitwarden # or community
77+
---
78+
```
79+
80+
## Code review and ownership
81+
82+
Tech leads generally review all documentation changes. See [.github/CODEOWNERS](.github/CODEOWNERS)
83+
for full ownership details.
84+
85+
## Pull request strategy
86+
87+
- Prefer small, incremental PRs
88+
- Merge directly to `main`
89+
- Avoid using long-lived feature branches and keep content changes relatively small and iterative
90+
91+
## Working with this repository
92+
93+
### When editing documentation
94+
95+
1. Always follow the style guide (numbered instructions, code blocks, brevity)
96+
2. Consider if content should be conditional using `<Community>` or `<Bitwarden>` tags
97+
3. Run `npm run spellcheck` before committing
98+
4. Ensure proper frontmatter is set (sidebar position, access restrictions, etc.)
99+
5. Reference the appropriate section (getting-started, contributing, or architecture)
100+
101+
### When adding new files
102+
103+
1. Place in the appropriate docs subdirectory
104+
2. Include frontmatter with at least `sidebar_position`
105+
3. Add any technical terms to `custom-words.txt`
106+
4. Update sidebars.js if needed for navigation structure
107+
108+
### Architecture documentation
109+
110+
- ADRs go in `docs/architecture/adr/` with format `####-title.md`
111+
- Follow existing ADR structure (Status, Context, Decision, Consequences)
112+
113+
## Testing before committing
114+
115+
1. Run `npm run spellcheck` to catch typos
116+
2. Run `npm run lint` to ensure formatting is correct
117+
3. Run `npm start` to preview changes locally
118+
4. Verify conditional content displays correctly by switching between Community/Bitwarden modes in
119+
the dropdown
120+
121+
For most changes you can rely on making a draft pull request and testing it live with a branch
122+
deployment.

.claude/prompts/review-code.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Please review this pull request with a focus on documentation content, clarity, and overall quality.
2+
3+
Ensure that the documentation is accurate, well-structured, and easy to understand.
4+
5+
Check for grammar, spelling, and formatting problems.
6+
7+
Verify that any code examples are correct and follow best practices.
8+
9+
Assess whether the documentation meets the needs of its intended audience.
10+
11+
Suggest improvements where necessary and provide detailed feedback using inline comments for
12+
specific feedback.
13+
14+
When reviewing subsequent commits:
15+
16+
- Track status of previously identified findings (fixed/unfixed/reopened)
17+
- Identify NEW problems introduced since last review
18+
- Note if changes introduced any new findings
19+
20+
IMPORTANT: Be comprehensive about findings and improvements. For good practices, be brief - just
21+
note what was done well without explaining why or praising excessively.

.github/CODEOWNERS

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,29 @@
44
#
55
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
66

7-
# Leads for all reviews of documentation.
7+
# Leads for all reviews of documentation
88
* @bitwarden/tech-leads
99

1010
# Unowned files
1111
package.json
1212
package-lock.json
1313

14-
# Architecture department for architecture content.
14+
# Architecture department for architecture content
1515
docs/architecture @bitwarden/dept-architecture
1616

17+
# Architecture and AppSec for security concepts
18+
docs/architecture/security @bitwarden/team-appsec @bitwarden/dept-architecture
19+
1720
# Shared workflows ownership
1821
.github/workflows/build.yml @bitwarden/dept-bre @bitwarden/tech-leads
22+
23+
# Docker-related files
24+
**/Dockerfile @bitwarden/team-appsec @bitwarden/dept-bre
25+
**/*.dockerignore @bitwarden/team-appsec @bitwarden/dept-bre
26+
**/entrypoint.sh @bitwarden/team-appsec @bitwarden/dept-bre
27+
**/docker-compose.yml @bitwarden/team-appsec @bitwarden/dept-bre
28+
29+
# Claude related files
30+
.claude/ @bitwarden/team-ai-sme
31+
.github/workflows/respond.yml @bitwarden/team-ai-sme
32+
.github/workflows/review-code.yml @bitwarden/team-ai-sme

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ jobs:
1616

1717
steps:
1818
- name: Check out repo
19-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
with:
21+
persist-credentials: false
2022

2123
- name: Set up Node
22-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
24+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2325
with:
2426
cache: "npm"
2527
cache-dependency-path: "**/package-lock.json"

.github/workflows/label.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313

1414
steps:
1515
- name: Label pull request
16-
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
16+
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
1717
with:
1818
sync-labels: true # Remove labels if matches are removed

.github/workflows/lint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ jobs:
1616

1717
steps:
1818
- name: Check out repo
19-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
with:
21+
persist-credentials: false
2022

2123
- name: Set up Node
22-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
24+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2325
with:
2426
cache: "npm"
2527
cache-dependency-path: "**/package-lock.json"

.github/workflows/respond.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Respond
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
permissions: {}
14+
15+
jobs:
16+
respond:
17+
name: Respond
18+
uses: bitwarden/gh-actions/.github/workflows/_respond.yml@main
19+
secrets:
20+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
21+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
22+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
23+
permissions:
24+
actions: read
25+
contents: write
26+
id-token: write
27+
issues: write
28+
pull-requests: write

.github/workflows/review-code.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
7+
permissions: {}
8+
9+
jobs:
10+
review:
11+
name: Review
12+
uses: bitwarden/gh-actions/.github/workflows/_review-code.yml@main
13+
secrets:
14+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
15+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
16+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
17+
permissions:
18+
actions: read
19+
contents: read
20+
id-token: write
21+
pull-requests: write
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Review PR comment
2+
3+
on:
4+
pull_request_review_comment:
5+
types: [created]
6+
pull_request_review:
7+
types: [submitted]
8+
9+
permissions: {}
10+
11+
jobs:
12+
review:
13+
name: Review
14+
if: |
15+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
16+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
17+
runs-on: ubuntu-24.04
18+
permissions:
19+
contents: read
20+
id-token: write
21+
pull-requests: write
22+
23+
steps:
24+
- name: Check out repo
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
with:
27+
fetch-depth: 1
28+
persist-credentials: false
29+
30+
- name: Review with Claude Code
31+
uses: anthropics/claude-code-action@a5528eec7426a4f0c9c1ac96018daa53ebd05bc4 # v1.0.7
32+
with:
33+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
34+
claude_args:
35+
'--allowed-tools "Bash(gh search:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr
36+
view:*),Bash(gh pr list:*)"'

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ documentation is available at https://contributing.bitwarden.com/.
1111
npm ci
1212
```
1313

14-
## Local Development
14+
## Local development
1515

1616
```bash
1717
npm start
@@ -71,7 +71,7 @@ We use `cspell` for spellchecking. It will run as a pre-commit hook and in the C
7171
Spellchecking ignores single and multi-line code snippets. If required, you can add custom words
7272
(e.g. proper nouns and technical terms) to `custom-words.txt`.
7373

74-
### Conditional Content
74+
### Conditional content
7575

7676
The Contributing Docs site is used both for internal and external contributors. To this end we've
7777
facilitated a mean to conditionally show content for either group. This is primarily to keep the

0 commit comments

Comments
 (0)