Alison Aquinas logoAlison's LLM Plugins

yarn

Included in pluginci-cdView on GitHub ↗

Files

SKILL.mdagentsreferences

Install

Install the containing plugin
/plugin install ci-cd@llm-skills
Invoke this skill after installation
/ci-cd:yarn
Download yarn-skill.zip
This skill is bundled inside ci-cd. Install the plugin once, then Claude Code can use any of its included skills. Browse the full plugin repository at github.com/alisonaquinas/llm-ci-dev.

SKILL.md


name: yarn description: Manage JavaScript packages with Yarn. Use when tasks mention yarn commands, .yarnrc.yml configuration, Yarn Berry, Yarn Classic, Plug'n'Play, or JavaScript package operations using the yarn binary.

Yarn

Intent Router

RequestReferenceLoad When
Install Yarn, first-time setup, version selectionreferences/install-and-setup.mdYarn needs to be installed or a specific version activated
.yarnrc.yml, nodeLinker, plugins, PnPreferences/configuration.mdYarn configuration files or settings are the topic
CLI commands, workflowsreferences/command-cookbook.mdSpecific yarn commands are needed
Monorepo workspaces, constraints, foreachreferences/workspaces.mdWorkspace or monorepo setup is the topic

Quick Start

# 1. Activate Yarn via Corepack (recommended for Berry)
corepack enable && corepack prepare yarn@stable --activate

# 2. Install all dependencies
yarn

# 3. Add a package
yarn add <pkg>

# 4. Run a script defined in package.json
yarn run <script>

Classic (v1) vs Berry (v3 / v4)

Yarn has two major release lines:

AspectClassic (v1)Berry (v2+)
Config file.yarnrc.yarnrc.yml
Default linkernode_modulesPnP (Plug'n'Play)
Installyarn installyarn install
Version pinyarn globalpackageManager in package.json
Recommended for new projectsNoYes

Switch a project to Berry:

corepack prepare yarn@4 --activate
yarn set version stable

Core Command Tracks

  • Install all deps: yarn install / yarn (shorthand)
  • Add package: yarn add <pkg>, yarn add --dev <pkg>
  • Remove package: yarn remove <pkg>
  • Run script: yarn run <script>, yarn <script> (shorthand in Berry)
  • Upgrade packages: yarn up <pkg>
  • Audit: yarn npm audit
  • Execute binary: yarn dlx <cmd> (like npx)

Safety Guardrails

  • Use --immutable in CI to prevent the lock file from being updated during install.
  • Run yarn npm audit to check for known vulnerabilities before releasing.
  • Plug'n'Play (PnP) mode is stricter than node_modules — phantom dependencies will cause runtime errors; this is intentional and helps surface real issues.
  • When migrating from Classic to Berry, test PnP compatibility for all dependencies; fall back to nodeLinker: node-modules in .yarnrc.yml if needed.
  • Commit .yarn/releases/ and .pnp.cjs (if using PnP) to version control.

Workflow

  1. Activate the correct Yarn version via corepack or check the packageManager field.
  2. Run yarn install to install dependencies.
  3. Add or upgrade packages with yarn add / yarn up.
  4. Run scripts with yarn run <script>.
  5. In CI, run yarn install --immutable.
  6. Publish with yarn npm publish.

Related Skills

  • npm — Node.js built-in package manager; lock file is package-lock.json
  • pnpm — disk-efficient package manager with a content-addressable store
  • ci-architecture — integrating Yarn into CI/CD pipelines

References

← Back to marketplace