lerna
Skill266 starsChanged 10 months agoApache-2.0View on GitHub
Best practices for Lerna monorepo management, versioning, and publishing
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- cypressSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 7 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 52
Use Lerna for versioning, publishing, and running scripts
- Distinctive: line 56
Run scripts across packages:
- Very specific: line 60
Use --stream for real-time output
- Very specific: line 61
Use --parallel for concurrent execution
- Very specific: line 65
Update versions with lerna version:
- Very specific: line 83
Use --dist-tag for pre-release versions
- Very specific: line 87
Use --since flag for changed packages:
- Distinctive: line 116
Use internal package references:
- Very specific: line 130
Use lerna run with --since for efficient CI
- Very specific: line 132
Use --yes flag for non-interactive publishing
- Distinctive: line 136
Keep packages focused and single-purpose
- Very specific: line 137
Use consistent package naming: @org/package-name
- Distinctive: line 139
Document package APIs and usage
- Distinctive: line 140
Use TypeScript with project references for type checking
- Distinctive: line 142
Consider Nx integration for advanced caching and task execution
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lerna Monorepo Development
You are an expert in Lerna, the fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages.
Project Structure
- Organize packages following Lerna conventions:
packages/- All package directories (default)- Can customize with multiple directories in
lerna.json
- Each package should be self-contained with its own:
package.json- Source code
- Tests
- Build configuration
Lerna Configuration
Configure lerna.json at the root:
{
"$schema": "https://json.schemastore.org/lerna.json",
"version": "independent",
"npmClient": "npm",
"packages": ["packages/*"],
"useWorkspaces": true
}- Choose versioning mode:
"version": "independent"- Each package versioned separately"version": "1.0.0"- Fixed/locked mode, all packages same version
- Enable workspaces integration with
useWorkspaces: true
Workspaces Integration
Configure npm/yarn/pnpm workspaces in root package.json:
{
"workspaces": ["packages/*"],
"private": true
}- Let the package manager handle hoisting and linking
- Use Lerna for versioning, publishing, and running scripts
Task Execution
- Run scripts across packages:
lerna run build- Run build in all packageslerna run test --scope=@org/package- Run in specific packagelerna run lint --since main- Run only in changed packages
- Use
--streamfor real-time output - Use
--parallelfor concurrent execution
Versioning Workflow
- Update versions with
lerna version:lerna version patch- Bump patch versionlerna version minor- Bump minor versionlerna version major- Bump major versionlerna version- Interactive version selection
- Lerna automatically:
- Updates package.json versions
- Updates internal dependency versions
- Creates git tags
- Pushes to remote
Publishing Packages
- Publish with
lerna publish:lerna publish- Publish packages changed since last releaselerna publish from-git- Publish packages tagged in gitlerna publish from-package- Publish packages with unpublished versions
- Configure npm registry in
.npmrcorlerna.json - Use
--dist-tagfor pre-release versions
Change Detection
- Use
--sinceflag for changed packages:lerna run test --since mainlerna changed- List packages changed since last taglerna diff- Show diff since last release
- Leverage affected commands in CI for efficiency
Conventional Commits
Enable conventional commits for automated versioning:
{
"command": {
"version": {
"conventionalCommits": true,
"message": "chore(release): publish"
}
}
}- Commits determine version bumps:
fix:- Patch versionfeat:- Minor versionBREAKING CHANGE:- Major version
- Automatic changelog generation
Dependency Management
- Use internal package references:
{ "dependencies": { "@org/shared-utils": "^1.0.0" } } - Lerna keeps internal dependencies in sync during versioning
- Hoist common dependencies to root with workspaces
CI/CD Integration
- Install dependencies once at root level
- Use
lerna runwith--sincefor efficient CI - Publish from CI with proper npm authentication
- Use
--yesflag for non-interactive publishing
Best Practices
- Keep packages focused and single-purpose
- Use consistent package naming:
@org/package-name - Maintain clear dependency boundaries between packages
- Document package APIs and usage
- Use TypeScript with project references for type checking
- Implement proper testing at package and integration levels
- Consider Nx integration for advanced caching and task execution
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

