exploring-bitwarden-data

bởi bitwarden

Chỉ đọc khám phá cơ sở dữ liệu phát triển Bitwarden cục bộ — trả lời các câu hỏi kinh doanh từ dữ liệu trực tiếp, xác minh dữ liệu mẫu đã được seed, và kiểm tra cấu trúc schema. Sử dụng…

npx skills add https://github.com/bitwarden/server --skill exploring-bitwarden-data

Explore Bitwarden Database

Read-only access to a local Bitwarden database, across all three dev providers.

Read-only, defense in depth

  1. Database login is read-only at the server — mutations will fail regardless of what you send.
  2. Allowed: SELECT, WITH (CTEs), and INFORMATION_SCHEMA / sys.* introspection.

Cross-provider rules

  • Secrets. Never echo, log, cat, printenv, or hexdump any password env var. Set passwords inline on the command (e.g., SQLCMDPASSWORD="$BW_MSSQL_PASSWORD" sqlcmd ...); never export them.
  • Result presentation. Format <20 rows as a markdown table; summarize larger sets as top-N + count. Always echo the SQL ran. Trim CLI footers ((N rows affected), Query OK) before presenting.
  • Heredoc footgun. Use single-quoted heredoc tags (<<'SQL') — without quotes, bash expands $ inside the SQL before the database CLI sees it, breaking column references.

Provider selection

First arg picks the provider — mssql (default), mysql, or postgresql. Read the matching provider reference before composing SQL.

ProviderEnv prefixCLIReferenceStatus
MSSQLBW_MSSQL_*sqlcmdreferences/providers/mssql.mdReady
MySQLBW_MYSQL_*mysqlreferences/providers/mysql.mdReady
PostgreSQLBW_POSTGRES_*psqlreferences/providers/postgresql.mdReady

The repo is the schema's source of truth

Don't compose SQL from a generic mental model of how a vault schema "probably" looks — and don't expect this skill to inventory the schema for you. The repo already does, and it stays current when this file wouldn't:

  • Tables and columns: SSDT schema under src/Sql/dbo/, or live introspection via references/schema-discovery-queries.md.
  • Enum integer values and lifecycle semantics: the C# enum sources — their XML docs carry meaning no value table can (seat consumption, restore behavior, deprecations).
  • Access-control logic: prefer the canonical functions over hand-rolled joins — [dbo].[UserCipherDetails](@UserId) for "what can user X see", [dbo].[UserCollectionDetails](@UserId) for collection permissions. They encode member status, org enablement, and direct-over-group grant precedence that is easy to rebuild subtly wrong.
  • Where to look: references/sources.md maps every concept named in this skill to its source file.

Grounding rules

Semantics the schema itself cannot tell you — each of these flipped a real eval case that unaided Claude got wrong (evidence in evals/baseline-results.md; that is also the bar for adding a rule here).

  1. Active member = OrganizationUser.Status = 2 (Confirmed). "Active" is genuinely ambiguous — the occupied-seat definition (Status IN (0,1,2), used by the seat-count procs) is a defensible rival reading, so state which one the question needs. Full lifecycle (including Staged and Revoked-with-restore) is documented in OrganizationUserStatusType.cs.
  2. Archive state lives in Cipher.Archives — per-user JSON keyed by UPPERCASE user GUID — not in the ArchivedDate column. ArchivedDate exists on the table but the archive flow never writes it (Cipher_Archive does JSON_MODIFY on Archives); querying it returns zero forever while looking perfectly reasonable. Favorites and Folders use the same per-user JSON shape, so interpolate keys from a UNIQUEIDENTIFIER (SQL Server renders them uppercase; JSON keys are case-sensitive).
  3. Organization.Enabled = 1 is the active flag. Organization.Status is the provider-management lifecycle (Pending/Created/Managed), and Plan is a display string — aggregate and filter on PlanType.

Reference library

ReferenceWhen to read
references/sources.mdFinding the source file for any table, enum, or canonical function
references/schema-discovery-queries.mdLive introspection — list tables, describe columns, find FKs, view bodies
references/providers/mssql.mdMSSQL connection, sqlcmd invocation patterns, dialect notes

Thêm skills từ bitwarden

figma-to-angular
bitwarden
Kỹ năng này chuyển đổi bản thiết kế Figma thành một component Angular được triển khai đầy đủ với các story Storybook trong monorepo Bitwarden Clients. Đầu ra phải khớp với thiết kế về mặt hình ảnh đồng thời tuân thủ tất cả các quy ước codebase.
force-multiplier
bitwarden
Áp dụng một ý định trên nhiều mục tiêu cùng lúc — một loạt kho lưu trữ trong hệ sinh thái Bitwarden, hoặc nhiều dự án trong một monorepo — như N nhất quán,…
analyzing-git-sessions
bitwarden
Phân tích các commit git và thay đổi trong một khung thời gian hoặc phạm vi commit, cung cấp các bản tóm tắt có cấu trúc cho việc xem xét mã, hồi tưởng, nhật ký công việc hoặc phiên làm việc…
coordinating-cross-team-breakdown
bitwarden
Phối hợp đánh giá và phê duyệt giữa các nhóm cho một Bản Phân Tích Kỹ Thuật Bitwarden. Sử dụng khi xác định các nhóm bị ảnh hưởng, xây dựng bảng phê duyệt Phần 3, theo dõi…
assessing-jira-issue-relevance
bitwarden
Sử dụng khi người dùng cung cấp một mã số vấn đề Jira duy nhất và hỏi liệu vấn đề đó có còn liên quan, còn áp dụng, còn đang chờ xử lý, còn là lỗi, đã được sửa, hay có thể…
assessing-test-coverage
bitwarden
Sử dụng khi xác định mức độ bao phủ kiểm thử ĐÃ tồn tại cho một thay đổi cụ thể (một PR, khóa Jira, tài liệu Tech Breakdown, CSV Testmo, các đường dẫn đã thay đổi, hoặc các mục được đặt tên…
retrospecting
bitwarden
Thực hiện phân tích toàn diện các phiên Claude Code, xem xét lịch sử git, nhật ký hội thoại, thay đổi mã nguồn và thu thập phản hồi từ người dùng để tạo ra…
reviewing-incremental-changes
bitwarden
Sử dụng kỹ năng này khi xem lại một PR đã có bình luận hoặc khi phản hồi các thay đổi của nhà phát triển sau lần xem xét ban đầu. Áp dụng khi có các luồng thảo luận trong PR hoặc…