agentleFS
MicrosoftKnown publishermicrosoft/lage/.agents/skills/dependency-updates/SKILL.md

dependency-updates

Skill817 starsChanged 4 months agoMITView on GitHub

Update dependencies and resolve Dependabot security alerts in Lage's root Yarn workspace and separate docs project. Use when upgrading packages, applying security fixes, checking Yarn quarantine eligibility, deduplicating dependency trees, reviewing resolutions, or reporting remaining vulnerable dependencies.

7 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-updates.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • acquiaSkill

    security-updates

    Use when user asks about fixing security vulnerabilities, composer audit failures, vulnerable Drupal packages, or CVE advisories in a Drupal codebase.

    Also in 3 projects that use this

  • Other versions7 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 7

    1. ImranR98/Obtainium★ 21ksame name
    2. naomiaro/waveform-playlist★ 1.7ksame name
    3. championswimmer/TwoFac★ 130same name
    4. eclipse-enclave/enclave★ 80same name
    5. acquia/acquia-skills★ 10same name
    6. acquia/acquia-skills-private★ 1same name
    7. linchpin/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 8 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Start with the requested package, manifest, lockfile, or advisory.

    line 10
  2. Very specific:

    Keep npmMinimalAgeGate unchanged in each affected project.

    line 13
  3. Distinctive:

    Do not stage, stash, commit, create a branch, or dismiss alerts without authorization.

    line 14
  4. Very specific:

    Use rg for targeted searches.

    line 15
  5. Very specific:

    Read all matching ranges in security_advisory.vulnerabilities, not only the alert's first patched version.

    line 43
  6. Distinctive:

    If the necessary fixed release is too young, leave that dependency unchanged and report the fixed version and earliest eligible UTC date.

    line 46
  7. Distinctive:

    If no fix is published, report that explicitly.

    line 47
  8. Distinctive:

    Keep Yarn's age gate enabled during install as an additional enforcement check.

    line 56
  9. Very specific:

    Verify the resulting versions with yarn info --all --recursive --json '<package-or-family-pattern>'.

    line 79
  10. Distinctive:

    If the patch is unnecessary, remove its file, manifest references, rationale, and any ignore exception introduced solely for it.

    line 96
  11. Distinctive:

    Follow root or docs validation steps below.

    line 102
  12. Very specific:

    If changes span multiple packages, run yarn build from the repository root so dependencies build in order.

    line 109
  13. Very specific:

    When requested, create an untracked temporary Markdown report such as dependabot-alerts.tmp.md.

    line 128
  14. Distinctive:

    Check date, affected manifest, and location of any full JSON snapshot.

    line 130

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dependency updates

Scope and safeguards

  • Start with the requested package, manifest, lockfile, or advisory. Inspect git status --short and preserve user edits and commits made during the session.
  • The root Yarn workspace and docs are separate Yarn projects. Root and workspace package manifests share the root yarn.lock; docs uses docs/package.json and docs/yarn.lock. Install from the owning Yarn project and run validation commands from their documented directories. If both projects are in scope, handle their dependency graphs and lockfiles separately.
  • Read the project's .yarnrc.yml, .nvmrc, manifest engines, resolutions, and rationale, plus affected workspace package requirements. Root and docs Node requirements can differ, and a published package may support older Node versions than the development shell. Preserve each project's supported runtime range unless changing it is authorized.
  • Keep npmMinimalAgeGate unchanged in each affected project. Both currently use an eight-day quarantine, but read their configuration rather than assuming it will stay identical. Do not bypass it with exclusions, direct URLs, or other resolution tricks.
  • Do not stage, stash, commit, create a branch, or dismiss alerts without authorization. Generate Beachball change files only when requested or required by the applicable release workflow.
  • Use rg for targeted searches. Include --no-ignore --follow when inspecting installed dependencies, which may be ignored or symlinked. Resolve dependencies from their actual consumer with createRequire rather than assuming hoisting.

Collect and classify alerts

This is a GitHub repository, so use gh api to get alerts. When an alert snapshot is requested, save only open alerts by default. Run this from the repository root, using an unused temporary filename:

GH_PAGER=cat gh api 'repos/microsoft/lage/dependabot/alerts?state=open&per_page=100' --paginate --slurp > dependabot-alerts.tmp.json

Keep the complete response for each open alert, including advisory details; fetch closed alerts only when explicitly needed. --slurp wraps the pages in an outer array; flatten one level when processing it. Do not combine gh --slurp with gh --jq; pipe to jq instead. This example includes both project lockfiles and retains the manifest so alerts can be routed to the correct project; narrow the filter if only one project was requested:

jq '[.[][] | select(.state == "open" and (.dependency.manifest_path == "yarn.lock" or .dependency.manifest_path == "docs/yarn.lock")) | {number, manifest: .dependency.manifest_path, package: .dependency.package.name, severity: .security_advisory.severity, vulnerable: .security_vulnerability.vulnerable_version_range, fixed: .security_vulnerability.first_patched_version.identifier, ghsa: .security_advisory.ghsa_id}]' dependabot-alerts.tmp.json

Compare alerts with the current local dependency graph, not just GitHub's default-branch status. From the affected project, inspect exact versions and dependency descriptors. For example:

yarn info --all --recursive --json 'some-dep' 'other-dep'

Run graph queries from the repository root for root workspace dependencies, or from docs for docs dependencies. Parse the JSON lines for repeatable version and deduplication assertions. Do not assume a Yarn lockfile parser is installed. Use yarn why or nearby lockfile entries to identify the owning dependency.

Classify each alert as vulnerable locally, fixed locally, removed from the local tree, quarantined, or lacking a published fix. An open GitHub alert does not prove that the local branch is still vulnerable. Conversely, an unused vulnerable dependency is not fixed merely because its execution path is disabled.

Respect release quarantine

  1. Read all matching ranges in security_advisory.vulnerabilities, not only the alert's first patched version. Different major versions can have different fixes.
  2. Query npm registry metadata for the candidate release's publication timestamp, engines, dependency ranges, and peer requirements. A null first-patched field is not conclusive: inspect newer releases and upstream advisories, without assuming every newer version fixes the issue.
  3. Calculate eligibility as the publication timestamp plus the configured quarantine duration. Use exact UTC timestamps and a freshly checked current time; do not reuse dates from an old report.
  4. If the necessary fixed release is too young, leave that dependency unchanged and report the fixed version and earliest eligible UTC date. Continue with unrelated eligible fixes.
  5. If no fix is published, report that explicitly. Do not downgrade outside an advisory range or substitute a different package without compatibility evidence and appropriate scope approval.

Query metadata from the affected project directory with npm view --json <package>@<version> (or an equivalent command that respects the project's configured registry and scope mappings), rather than hardcoding registry.npmjs.org. Parse the JSON to inspect time[version], engines, dependencies, and peerDependencies. For example:

npm view --json '<package>@<version>'
npm view --json '<package>' time

Keep Yarn's age gate enabled during install as an additional enforcement check.

Choose the smallest supported upgrade

First, if a quarantine-eligible fixed version satisfies the existing dependency ranges, update that dependency directly within those ranges. For a transitive dependency, refresh its lockfile resolution without adding an override or upgrading its parent unnecessarily.

If the fix is out of range, prefer upgrading the owning package (or a higher parent) to a supported release that naturally includes the fixed dependency. Before overriding a transitive major version, inspect the consumer's actual API calls, upstream migration notes, runtime requirements, and a focused behavior check.

Use a targeted resolution only when needed. Put root workspace resolutions in the root manifest and docs resolutions in the docs manifest. Scope each to the relevant parent or descriptor and explain it in the existing rationale.resolutions object. Remove obsolete resolutions and rationale when their purpose disappears; retain unrelated compatibility pins.

Example scenarios and decisions:

  • Scenario: A transitive security fix requires a new major version, but a newer parent release already supports it. Decision: Upgrade the parent rather than force an unsupported transitive version through a resolution; validate the affected integration.
  • Scenario: A framework publishes coordinated packages that must stay on matching versions, and its newer release raises runtime requirements. Decision: Upgrade the related packages together within the requested release line, check quarantine eligibility, and align the affected project's runtime configuration and CI without changing unrelated projects.
  • Scenario: A vulnerable dependency is used only by an opt-in feature that this project does not enable. Decision: Update the dependency for security, but do not assume a yarn patch is needed. Inspect the actual usage and API changes, and validate the feature-specific path if compatibility changes are necessary; the default build does not cover it.
  • Scenario: A toolchain pulls in a dependency that appears unnecessary for this project's workflow. Decision: Suppress it only after confirming that installation, builds, and supported workflows do not require it. Treat suppression as an intentional dependency change, not a substitute for a security fix or a way around quarantine.

Check for newly duplicated dependency trees

Review the lockfile diff after each update for packages that previously shared a resolved version but now have multiple versions, especially related package families that bring duplicate transitive trees. Trace the new versions to their consumers and compare requested ranges, exact pins, existing resolutions, and peer requirements.

First try yarn dedupe from the owning Yarn project to consolidate compatible versions within existing ranges, without adding resolutions. Both lockfiles are generally kept deduplicated, so a lockfile-wide dedupe is usually safe when needed. Use yarn dedupe '<package-or-family-pattern>' when a narrower operation is useful. Review the resulting lockfile diff for unexpected changes and check release quarantine eligibility. Remove or update stale resolutions that unnecessarily retain an older tree. If an exact upstream pin prevents consolidation, use a narrowly scoped resolution only with compatibility evidence and a rationale, while respecting release quarantine.

Verify the resulting versions with yarn info --all --recursive --json '<package-or-family-pattern>'. Distinguish real duplicate versions from Yarn virtual instances for different peer contexts. Do not force incompatible major versions or peer requirements onto a single version merely to shrink the lockfile; explain any newly duplicated trees that must remain.

Patch devDependencies only when necessary

yarn patch is acceptable only for devDependencies and their exclusively development-only transitive dependencies. Never patch a runtime dependency, including a package also reachable through dependencies. For the root workspace, check paths across all workspaces, including dependencies shipped in published packages or bundles; a root devDependency declaration alone does not establish development-only usage. Apply the same restriction to the docs dependency graph. Do not reclassify a dependency merely to permit a patch. For runtime dependencies, use an upstream fix or supported upgrade, or report the blocker.

Even for eligible development dependencies, use Yarn's patch workflow only for a demonstrated incompatibility that cannot be handled by the selected supported upgrade:

yarn patch <dev-package>@npm:<installed-version>
# Edit only the necessary files in the extracted directory.
yarn patch-commit -s <extracted-directory>
yarn install

Use apply_patch for manual edits to the extracted files. Here patch-commit -s saves the Yarn patch; it is not a Git commit or staging operation. Store patches under the affected project's .yarn/patches, ensure Git does not ignore them, and avoid redundant direct-dependency and resolution patch references. Validate the specific changed execution path.

If the patch is unnecessary, remove its file, manifest references, rationale, and any ignore exception introduced solely for it; regenerate the lockfile while keeping the requested security pin.

Install and validate

  1. Preserve the existing lockfile and run yarn install in the affected project. Do not delete the lockfile by default: full regeneration can introduce unrelated churn or quarantine failures.
  2. Immediately run the cheapest check that can disprove the compatibility assumption, using the affected project's own tests or build commands. Do not apply Docusaurus-specific checks to root workspace packages. Do not retry a user-cancelled check without considering the user's latest direction; report it as unverified when appropriate.
  3. Follow root or docs validation steps below. (Files will be automatically formatted with Prettier on commit.)
  4. Inspect the final diff and resolved graph. Verify that targeted vulnerable versions and unnecessary patches are gone, intended pins remain, and the quarantine setting is unchanged. Record pre-existing warnings separately from regressions.

Root-workspace validation

For root tooling or workspace package changes, run the affected package's focused tests, types, and lint checks using its existing scripts. Run package-specific commands from packages/<name> (or the relevant workspace directory). Root yarn test runs through Lage and does not accept Jest options; pass test filters to the package's own test command instead.

If changes span multiple packages, run yarn build from the repository root so dependencies build in order. Verify supported runtime and published dependency contracts, not only the active development Node version. The root yarn ci gate covers the workspace, not the separate docs build.

Docs-only validation

For docs dependency updates, run both yarn build and the E2E_TEST dev compilation check below, from docs only. The production build covers TypeScript checking, production bundling, static generation, broken links, and local-search indexing. Fix relevant migration issues without expanding into unrelated cleanup.

The production build does not validate the development-server path, so also run Docusaurus's E2E_TEST compilation check. Use a valid, available port, such as 3001 after checking that it is free; choose another unused port if necessary.

yarn build
E2E_TEST=true yarn start --no-open --host 127.0.0.1 --port 3001

This checks dev compilation, not HTTP serving, HMR, or every middleware behavior. Add a request or other focused check when those are the affected risks. Do not claim the command passed unless it actually completed successfully.

On macOS, Docusaurus can log an AppleScript browser-opening failure before successfully using its fallback launcher. This does not indicate a compilation failure. Use --no-open for validation or DOCUSAURUS_BROWSER=edge to bypass automatic Chromium tab-reuse scripting when diagnosing that behavior.

Report the outcome

When requested, create an untracked temporary Markdown report such as dependabot-alerts.tmp.md. Cover only the requested scope; if both projects are included, group findings by yarn.lock and docs/yarn.lock. Include:

  • Check date, affected manifest, and location of any full JSON snapshot.
  • Alert links and numbers, package, severity, current version, and fixed version.
  • Separate sections for still vulnerable locally and addressed locally, including removed dependencies.
  • Exact quarantine eligibility dates or an explicit no-published-fix status.
  • Compatibility caveats and validation commands that passed, failed, or were not run.

Do not silently treat an earlier snapshot as current. GitHub's status can lag local fixes until the updated default branch is scanned. Leave temporary reports and raw JSON out of commits unless the user explicitly requests them, and never claim an alert was closed merely because a local update passed.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.