Thank you for your interest in contributing! This document covers the contribution workflow — git, PRs, and community guidelines.
For setup, architecture, and code standards, see the dedicated documentation files linked at the bottom.
- Code of Conduct
- Getting Started
- Git Workflow
- Reporting Issues
- Fixing a Bug
- Creating a Feature
- Adding a New Component
- Adding Icons
- Code Standards
- Testing
- Security
- Further Reading
- License
Please read and follow our Code of Conduct. We are committed to providing a welcoming and inclusive environment for all contributors.
- Node.js: >=24 <25
- pnpm: 11.x
git clone https://github.com/baloise/design-system.git
cd design-system
nvm use
corepack enable
pnpm install --frozen-lockfileFor full setup instructions, troubleshooting, and dev server details, see DEVELOPMENT.md.
Use descriptive prefixes for branch names:
feat/<name>— new features or componentsfix/<name>— bug fixeschore/<name>— maintenance tasksdocs/<name>— documentation updates
Write clear, descriptive commit messages:
feat: add button component with primary and secondary variants
fix: resolve focus state contrast issue on tag component
docs: update contribution guidelines
-
Create a changeset if your changes affect end users:
pnpm changeset
patch— bug fixes, non-breaking style tweaksminor— new features, new componentsmajor— breaking changes (prop renames, removed elements, behavior changes)
See ARCHITECTURE.md — Changesets and Versioning for how changesets flow into the release pipeline.
-
Open a PR against the
nextbranch- Include a descriptive title
- Reference related issues if applicable
- Ensure all checks pass (
pnpm lint && pnpm format)
-
Address review feedback before merging
Post these as a PR comment to trigger automation:
| Command | Effect |
|---|---|
/update-screenshots |
Regenerates visual regression snapshots and commits them to your branch. Use after intentional visual changes. |
/snapshot |
Publishes a snapshot npm version from your branch so you can test it in a real project before merging. See Snapshot Versions for details. |
/cib |
Post on an issue to auto-create a correctly named branch. The issue must have a type label (✨ feature, 🐛 bug, 🔧 chore, …); other labels such as ready-for-agent are skipped. |
/cib is an issue comment, not a PR comment. The type label chooses the branch prefix: ✨ feature → feat/…, 🐛 bug → fix/…, 🔧 chore → chore/… (also ♻️ refactor, 🧪 test, 💥 breaking change, ⚡️ perf, 🚀 release, 🛡️ lts). Without one of those labels the workflow runs but creates nothing.
Start any contribution (bug fix or feature) by creating a GitHub issue:
- Go to github.com/baloise/design-system/issues
- Click New Issue
- Choose Bug Report or Feature Request
- Provide a clear title and description
- Add labels and assign to a milestone if applicable
Once the issue is created, add a type label (✨ feature, 🐛 bug, 🔧 chore, ♻️ refactor, 🧪 test, 💥 breaking change, ⚡️ perf, 🚀 release, or 🛡️ lts) and comment /cib on that issue to auto-generate a branch:
/cib
This creates a properly named branch (e.g., feat/button-hover-state) and opens a PR automatically. Without a type label the workflow runs but skips the issue.
-
Create an issue describing the bug (see Reporting Issues)
-
Create a branch via the
/cibcomment on the issue -
Write a failing test that reproduces the bug:
- Add a test case in the component's test file
- Verify it fails with the current code
-
Fix the bug to make the test pass
-
Add a changeset:
pnpm changeset
- Choose
patchfor this bug fix
- Choose
-
Finalize your PR:
- Ensure all checks pass:
pnpm lint && pnpm format && pnpm test - Get approval from a core team member
- Merge to
next
- Ensure all checks pass:
-
Create an issue describing the feature (see Reporting Issues)
-
Create a branch via the
/cibcomment on the issue -
Implement the feature following STYLE_GUIDE.md
-
Add visual tests:
- Identify which parts of the UI your feature affects
- Create or update visual regression tests in the component's
.visual.play.tsfile - These automated screenshots verify the feature looks correct
-
Add component tests:
- Write tests covering all critical functionality
- Include both positive scenarios (expected use) and negative scenarios (edge cases, error handling)
- Use Page Objects for component interactions
- See ARCHITECTURE.md — Testing Strategy for patterns
-
Add a changeset:
pnpm changeset
- Choose
minorfor new features ormajorfor breaking changes
- Choose
-
Finalize your PR:
- Ensure all checks pass:
pnpm lint && pnpm format && pnpm test - Get approval from a core team member
- Merge to
next
- Ensure all checks pass:
See ARCHITECTURE.md — New Component Checklist for the full step-by-step checklist.
Key requirements:
- Use
ds-prefix and Shadow DOM - Implement
ComponentInterfaceandLoggable - Write unit, interaction, visual, and accessibility tests
- Add Storybook documentation
Icons are stored in two packages depending on their source and usage:
Source: Streamline Icons (16×16 SVG)
Location: packages/icons/src/assets
Source: Baloise Brand Portal (all colors, all sizes)
Location: packages/brand-icons/src/assets
-
Download the icon(s) from the appropriate source
-
Place the SVG file(s) in the correct
src/assetsdirectory -
Optimize SVG files for web:
pnpm optimize
-
Create a changeset documenting the icon addition:
pnpm changeset
-
Open a PR with a descriptive title (e.g.,
feat: add copy and download UI icons)
See STYLE_GUIDE.md for naming conventions, prop patterns, CSS variable cascade, and what to avoid.
Run these before every PR:
pnpm lint # Check for violations
pnpm format # Auto-fix formatting
pnpm spell # Spell checkSee ARCHITECTURE.md — Testing Strategy for required test types, Page Object patterns, and test file locations.
pnpm test # Unit tests
pnpm play # Playwright UI explorer
pnpm play -- --grep="<name>" # Single testPlease review our Security Policy before reporting vulnerabilities. Do not open public issues for security bugs — use the private advisory process described there.
- DEVELOPMENT.md — Setup, dev servers, building, testing commands
- ARCHITECTURE.md — Workspace structure, component patterns, CSS variables, testing strategy
- STYLE_GUIDE.md — Code standards and naming conventions
- SECURITY.md — Security policy and vulnerability reporting
- CODE_OF_CONDUCT.md — Community standards
By contributing, you agree that your contributions will be licensed under the same license as this project.