agentic/code/frameworks/security-engineering/skills/yarn-release-age-gate/SKILL.md
Configure Yarn's npmMinimalAgeGate (7-day default, 10-day high-sensitivity) for JavaScript projects on Yarn 4.x or later. Includes Corepack detection and lockfile-caveat warning.
npx skillsauth add jmagly/aiwg yarn-release-age-gateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when a user has chosen Yarn (Berry / v2+, current line
v4.x) as their package manager and wants release-age-gate hardening
parallel to what npm-release-age-gate and pnpm-release-age-gate
provide for their respective ecosystems.
yarn --version)package.json exists at repo root.yarnrc.yml exists (or will be created) — Berry's config fileIf Yarn is below v4.0, the skill should refuse to proceed:
npmMinimalAgeGate was introduced in v4.0 and earlier Berry versions
(v2.x, v3.x) silently ignore the setting. Yarn Classic (v1.x) does
not support a release-age gate at all — recommend migration to Berry
or to pnpm/npm.
Add the gate to .yarnrc.yml at repo root:
# Yarn 4.x release-age gate.
# Uses duration shorthand: 7d, 10d, 14d, 30d.
# Defends against newly-published malicious versions.
npmMinimalAgeGate: 7d
# High-sensitivity profile (use for publish-prep or major version bumps):
# npmMinimalAgeGate: 10d
Yarn accepts the value as a duration string (Nd for days, Nh
for hours), which is cleaner than npm's days-as-bare-int and pnpm's
minutes-as-int. Document the chosen value inline.
For CI-only enforcement (e.g., tighter gate in publish workflows than in local dev):
# .yarnrc.yml — apply 10d gate when running on CI, 7d locally
npmMinimalAgeGate:
exclude:
- pattern: "@your-scope/*" # internal packages — gate doesn't apply
default: 7d
override:
- if: "$YARN_ENABLE_STRICT_AGE_GATE"
value: 10d
Environment-conditional values are a Yarn 4 advantage over npm and pnpm (which require workflow-level wrapping).
The gate is checked at resolution time. If yarn.lock was generated
without the gate, the gate applies on the NEXT resolution pass — not
retroactively.
To apply the gate retroactively:
# Force re-resolution
rm yarn.lock
yarn install
This is destructive to existing pins. Coordinate before running.
Check whether the project pins a Yarn version via Corepack:
node -p "require('./package.json').packageManager"
Output like [email protected] means Corepack will use that exact version
in CI. The skill should:
corepack use yarn@stable
# writes packageManager to package.json
Genuine emergency overrides:
# Bypass the gate for a single install (rare)
YARN_NPM_MINIMAL_AGE_GATE=0 yarn add <pkg>
Document every override with reason + sunset date. Add the package
to the .yarnrc.yml exclude list if the bypass needs to persist
across installs.
Add a verification step to the publish/build workflow:
- name: Verify Yarn gate active
run: |
set -euo pipefail
GATE=$(yarn config get npmMinimalAgeGate 2>/dev/null || echo "")
if [ -z "$GATE" ]; then
echo "✗ Yarn npmMinimalAgeGate is unset"
exit 1
fi
echo "✓ Yarn npmMinimalAgeGate = $GATE"
.yarnrc.yml for npmMinimalAgeGatepackage.json packageManager field for Corepack pinyarn.lock was generated AFTER the gate was committedWhen auditing an existing Yarn project, produce a structured report
at .aiwg/security/working/yarn-release-age-audit.md:
# Yarn Release-Age Gate Audit
**Yarn version**: <version> (Corepack pinned: yes/no)
**Gate active**: yes (7d) / yes (10d) / yes (custom: <value>) / no
**Exclude list**: <list of excluded packages>
## Findings
### <severity> — <description>
- File: <path>
- Issue: <what's wrong>
- Fix: <exact change>
## Clean Checks
- ...
## Recommendations
- ...
npm-release-age-gate skill — npm equivalentpnpm-release-age-gate skill — pnpm equivalentbun-release-age-gate skill — Bun equivalentnpm-supply-chain-audit skill — companion auditsupply-chain-hardening-quickstart skill — orchestratornpmMinimalAgeGate: https://yarnpkg.com/configuration/yarnrc#npmMinimalAgeGatedata-ai
Report which research-corpus radar sidecars are overdue for refresh. Computes staleness (days since last refresh vs the cadence window) for every radar, sorted most-overdue-first. Runs via `aiwg corpus radar-status`.
data-ai
Aggregate research-corpus radar sidecars into a corpus or per-cluster freshness report — totals, overdue count, per-cluster / per-GRADE / per-trajectory breakdowns, an overdue table, and per-radar rationale snippets. Runs via `aiwg corpus radar-report`.
testing
Scaffold radar/freshness sidecars for research-corpus REFs. Pulls title/authors from the citation sidecar and GRADE from the analysis doc, defaults the refresh cadence from GRADE and the cluster from a corpus-local map, and stamps documentation/radar/REF-XXX-radar.md. Runs via `aiwg corpus radar-init`.
data-ai
Compute an entity's publication trajectory — per-year paper counts, topic drift, hot-streak detection (≥3 consecutive A-grade years), and career phase. Runs via `aiwg corpus profile-temporal`.