# Common Tasks

> Dependency management, package creation, and troubleshooting commands for the Trezor Suite monorepo. Use when managing dependencies or debugging build issues.

- Skill: `trezor/common-tasks` (Agent Skill)
- Install (CLI): `npx get-skill add trezor/common-tasks`
- Raw SKILL.md: https://api.skillmd.com/api/skills/trezor/common-tasks/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: trezor (https://skillmd.com/u/trezor)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/trezor/common-tasks

---


# Common Tasks

## Managing npm dependencies via yarn

Prefer existing dependencies. Add a new npm dependency only when no suitable dependency is already available in the repo.

```bash
yarn workspace @trezor/package-name add dependency-name
```

After adding or updating a dependency, run:

```bash
yarn dedupe
yarn requirements:verify
```

Review all changes made by `yarn dedupe` before keeping them.
Do not bypass `.yarnrc.yml` `npmMinimalAgeGate`.
If a blocked version is required to fix a bug, add a targeted exception to `npmPreapprovedPackages`.

Keep Nix pins in sync in the same PR:

- `react-native` or `expo`: `.nix/android.nix` must include `compileSdk`, `buildTools` and `ndkVersion` from `node_modules/react-native/gradle/libs.versions.toml`.
- `electron` or `.nvmrc`: `flake.nix` and `shell.nix`.
- `@playwright/test`: `playwright-web-flake` in `flake.nix`.

## Monorepo Package Management

```bash
yarn generate-package      # Create new package
yarn update-submodules     # Update trezor-common submodule (see git-and-commit-guidelines)
```

## Troubleshooting

```bash
# Reset environment if builds fail
rm -rf node_modules .yarn/cache
yarn --mode=skip-build
yarn build:essential

# Clear NX cache
yarn nx reset

# Restart development server
pkill -f "webpack-dev-server"
yarn suite:dev
```

