Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Yarn

$ yarn Official Med Risk
Yarn · Code & DevOps · BSD-2-Clause · macos / linux / windows

Popular JavaScript/TypeScript package manager spanning Yarn Classic (v1) and Yarn Berry (v2–v4) with Plug'n'Play and workspace constraints. Supports --json inspection and --immutable/--frozen-lockfile CI safety, though v1 and Berry differ substantially in CLI flags.

FCRS-1.0 Score
80 /100
Good
Medium Confidence
Zero-Friction Install
brew install yarn
CLI vs MCP Decision CLI Only

Local JS/TS workspace and yarn.lock manager tightly integrated with project repos via Corepack.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

Supports --json (NDJSON) and YARN_ENABLE_COLORS=0 / --no-progress, but breaking flag differences between Yarn 1.x and Berry (2.x–4.x) frequently trip agents.

  • Supports --json on info / audit (Berry) and list (v1)
  • CLI flags diverge between v1 (--frozen-lockfile) and Berry (--immutable)
Trust & Safety 19 / 25

--immutable / --frozen-lockfile guards lockfiles, while postinstall build scripts require --mode=skip-build (Berry) or --ignore-scripts (v1) on untrusted repos.

  • Deterministic lockfile enforcement flags
Setup & Portability 13 / 15

Managed per-repo via Corepack (packageManager field) or installed via Homebrew/npm across macOS, Linux, and Windows.

  • Cross-platform via Corepack, Homebrew, and npm
Utility & Efficiency 13 / 15

Strong monorepo workspace tooling (yarn workspaces foreach), zero-installs, and fast lockfile resolution.

  • Mature monorepo workspace orchestration
Maintenance & Lineage 9 / 10

Actively maintained under yarnpkg/berry (BSD-2-Clause).

  • Official yarnpkg/berry repository
Docs & Verifiability 8 / 10

Well-structured Berry CLI docs at yarnpkg.com/cli, though search results often mix legacy v1 and v4 syntax.

  • Official documentation at yarnpkg.com/cli

Security, Auth & Guardrails

Auth Modes
No Auth Config File Env API Key
Credential Storage

Reads registry tokens from ~/.yarnrc.yml, ~/.npmrc, or YARN_NPM_AUTH_TOKEN environment variables.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

BSD-2-Clause open-source CLI; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Yarn (yarn) Agent Rules
- Always run `yarn --version` first: v1 uses `--frozen-lockfile`, whereas Berry (v2+) uses `--immutable`.
- Set `YARN_ENABLE_COLORS=0` on Berry and avoid running `yarn npm publish` without user confirmation.

Agent-Ready Command Recipes

Safe Read-Only Queries

Check active Yarn major version
yarn --version

Identifies whether the project runs Yarn Classic (1.x) or Berry (2.x–4.x) before choosing flags.

Inspect package dependencies as JSON (Berry)
yarn info --json

Outputs resolved workspace package dependencies in newline-delimited JSON on Yarn Berry.

Controlled Writes & Previews

Install dependencies strictly from lockfile (Berry)
YARN_ENABLE_COLORS=0 yarn install --immutable

Installs exact dependencies in yarn.lock without modifying the lockfile or emitting color codes.

Strengths for Agents

  • + --immutable and yarn workspaces foreach make Berry monorepo checks predictable.
  • + Outputs NDJSON on inspection commands (yarn info --json, yarn npm audit --json).

Caveats & Pitfalls

  • ! Yarn v1 (Classic) and Yarn v2–v4 (Berry) have incompatible flags (--frozen-lockfile vs --immutable, yarn audit vs yarn npm audit).
  • ! Plug'n'Play (PnP) setups can break tools expecting physical node_modules unless nodeLinker: node-modules is configured.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI