yarn-release-age-gate
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.
What this skill does
# yarn-release-age-gate
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.
## Triggers
- "yarn release age gate"
- "yarn npmMinimalAgeGate"
- "yarn 4 supply chain"
- "yarn berry hardening"
## Prerequisites
- Yarn 4.0+ (Berry) installed (`yarn --version`)
- `package.json` exists at repo root
- `.yarnrc.yml` exists (or will be created) — Berry's config file
If 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.
## Configuration
Add the gate to `.yarnrc.yml` at repo root:
```yaml
# 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.
## Per-environment override (optional)
For CI-only enforcement (e.g., tighter gate in publish workflows than
in local dev):
```yaml
# .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).
## Lockfile caveat
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:
```bash
# Force re-resolution
rm yarn.lock
yarn install
```
This is destructive to existing pins. Coordinate before running.
## Corepack detection
Check whether the project pins a Yarn version via Corepack:
```bash
node -p "require('./package.json').packageManager"
```
Output like `[email protected]` means Corepack will use that exact version
in CI. The skill should:
1. Confirm pinned version is ≥ v4.0 (else flag — gate is silently ignored on Berry v2/v3)
2. Document the pinned version
3. Suggest a Corepack pin if the project doesn't have one:
```bash
corepack use yarn@stable
# writes packageManager to package.json
```
## Override policy
Genuine emergency overrides:
```bash
# 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.
## CI integration
Add a verification step to the publish/build workflow:
```yaml
- 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"
```
## What to inspect during review
- `.yarnrc.yml` for `npmMinimalAgeGate`
- `package.json` `packageManager` field for Corepack pin
- CI workflow has the verification step above
- `yarn.lock` was generated AFTER the gate was committed
## Output format
When auditing an existing Yarn project, produce a structured report
at `.aiwg/security/working/yarn-release-age-audit.md`:
```markdown
# 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
- ...
```
## See Also
- [`npm-release-age-gate` skill](../npm-release-age-gate/SKILL.md) — npm equivalent
- [`pnpm-release-age-gate` skill](../pnpm-release-age-gate/SKILL.md) — pnpm equivalent
- [`bun-release-age-gate` skill](../bun-release-age-gate/SKILL.md) — Bun equivalent
- [`npm-supply-chain-audit` skill](../npm-supply-chain-audit/SKILL.md) — companion audit
- [`supply-chain-hardening-quickstart` skill](../supply-chain-hardening-quickstart/SKILL.md) — orchestrator
## References
- Yarn `npmMinimalAgeGate`: <https://yarnpkg.com/configuration/yarnrc#npmMinimalAgeGate>
- Yarn Berry (v4) docs: <https://yarnpkg.com/getting-started>
- Corepack: <https://github.com/nodejs/corepack>
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.