Provides best practices and guidance for working with Rush monorepos. Use when the user is working in a Rush-based repository, asks about Rush commands (install, update, build, rebuild), needs help with project selection, dependency management, build caching, subspace configuration, or troubleshooting Rush-specific issues.
Provides best practices and guidance for working with Rush monorepos. Use when the user is working in a Rush-based repository, asks about Rush commands (install, update, build, rebuild), needs help with project selection, dependency management, build caching, subspace configuration, or troubleshooting Rush-specific issues.
license
MIT
metadata
{"author":"rushstack","version":"1.0.0"}
Rushstack Best Practices
This skill provides essential best practices for working with Rush monorepos. Following these guidelines ensures efficient dependency management, optimal build performance, and proper command usage.
Important Guidelines
When encountering unclear issues or questions:
Never make assumptions - If unsure about Rush behavior, configuration, or commands
Search official resources first - Check documentation and existing issues before guessing
Provide accurate information - Base responses on verified sources, not assumptions
Ask for clarification - When the problem description is ambiguous or incomplete
Core Principles
Always use Rush commands - Avoid npm/pnpm/yarn directly in a Rush monorepo
Use rushx for single projects - Like npm run, but Rush-aware
rush install vs update - install for CI, update after changes
rush build vs rebuild - build for incremental, rebuild for clean
Projects at 2 levels - Standard: apps/, libraries/, tools/
Selection flags reduce scope - Use --to, --from, --impacted-by
Build cache is automatic - Configure output folders to enable
Subspace for large repos - Isolate dependencies when needed
Project Selection Best Practices
When running commands like install, update, build, rebuild, etc., by default all projects under the entire repository are processed. Use these selection flags to improve efficiency:
--to
Select specified project and all its dependencies.
Build specific project and its dependencies
Ensure complete dependency chain build
rush build --to @my-company/my-project
rush build --to my-project # If project name is unique
rush build --to . # Use current directory's project
--to-except
Select all dependencies of specified project, but not the project itself.
Update project dependencies without processing project itself
Pre-build dependencies
rush build --to-except @my-company/my-project
--from
Select specified project and all its downstream dependencies.
Validate changes' impact on downstream projects
Build all projects affected by specific project
rush build --from @my-company/my-library
--impacted-by
Select projects that might be affected by specified project changes, excluding dependencies.
Quick test of project change impacts
Use when dependency status is already correct
rush build --impacted-by @my-company/my-library
--impacted-by-except
Similar to --impacted-by, but excludes specified project itself.