Maintain Code Dependencies
Overview
Use this skill to run dependable dependency-maintenance work from discovery through verification and git handoff. Prefer small, reviewable changes; preserve user work; and keep security fixes moving even when optional upgrades need to wait.
Operating Loop
Establish repo state.
- Run
pwd, git status --short --branch, and inspect the project layout.
- Identify package managers and lockfiles before running update commands.
- Treat uncommitted changes as user work unless you created them. Do not revert unrelated changes.
Inventory dependencies and update signals.
- Read manifest and lockfile pairs together.
- Use ecosystem-native audit/outdated commands where available.
- When the user asks for current releases, advisories, CVEs, or security postings, browse or use official advisory sources because this data changes frequently.
- Separate security fixes, patch/minor upgrades, and major upgrades with breaking-change risk.
Choose an update strategy.
- Prefer the narrowest change that fixes a known advisory.
- For routine maintenance, batch compatible patch/minor updates by ecosystem.
- Ask before broad major-version upgrades if they change frameworks, runtimes, APIs, database migrations, or deployment requirements.
- Keep lockfiles in sync with manifests.
Apply updates.
- Use the package manager already represented by the lockfile.
- Avoid mixing package managers unless the repo already does.
- Capture notable command output: updated packages, advisory IDs, failing tests, and remediation hints.
- If a command fails because dependencies must be downloaded, request network escalation and retry the same package-manager command.
Verify and iterate.
- Run the repo's relevant checks: tests, build, typecheck, lint, formatting, or targeted smoke tests.
- Fix failures caused by the update, then rerun the smallest useful failing check before the broader suite.
- Do not paper over failing tests by weakening assertions unless the behavior change is intentional and explained.
- If unrelated failures pre-exist, document evidence and avoid claiming full verification.
Commit and push when requested.
- Review
git diff and git status --short before staging.
- Stage only files related to the maintenance work.
- Use a direct commit message such as
chore: update npm dependencies or fix: address dependency advisories.
- Push only when the user asked for it or the task clearly includes pushing.
Ecosystem Commands
Use references/ecosystems.md when you need package-manager-specific commands for JavaScript, Python, Ruby, Rust, Go, .NET, Java, or PHP projects.
Reporting
End with a concise maintenance report:
- What changed: package names and notable versions when practical.
- Why: routine update, security advisory, compatibility fix, or requested upgrade.
- Verification: exact checks run and their result.
- Git state: commit hash and push result when applicable, or remaining uncommitted files.
- Residual risk: skipped major upgrades, unresolved advisories, unavailable network/advisory checks, or pre-existing failures.
1---2name: maintain-code-dependencies3description: Operational support for application code dependency maintenance. Use when Codex needs to inspect project libraries or package managers, check for available dependency updates or security advisories, apply safe upgrades, update lockfiles, resolve breakages, run tests/builds/linters, iterate on fixes, summarize risk, and optionally commit or push verified dependency-maintenance changes.4---56# Maintain Code Dependencies78## Overview910Use this skill to run dependable dependency-maintenance work from discovery through verification and git handoff. Prefer small, reviewable changes; preserve user work; and keep security fixes moving even when optional upgrades need to wait.1112## Operating Loop13141. Establish repo state.15 - Run `pwd`, `git status --short --branch`, and inspect the project layout.16 - Identify package managers and lockfiles before running update commands.17 - Treat uncommitted changes as user work unless you created them. Do not revert unrelated changes.18192. Inventory dependencies and update signals.20 - Read manifest and lockfile pairs together.21 - Use ecosystem-native audit/outdated commands where available.22 - When the user asks for current releases, advisories, CVEs, or security postings, browse or use official advisory sources because this data changes frequently.23 - Separate security fixes, patch/minor upgrades, and major upgrades with breaking-change risk.24253. Choose an update strategy.26 - Prefer the narrowest change that fixes a known advisory.27 - For routine maintenance, batch compatible patch/minor updates by ecosystem.28 - Ask before broad major-version upgrades if they change frameworks, runtimes, APIs, database migrations, or deployment requirements.29 - Keep lockfiles in sync with manifests.30314. Apply updates.32 - Use the package manager already represented by the lockfile.33 - Avoid mixing package managers unless the repo already does.34 - Capture notable command output: updated packages, advisory IDs, failing tests, and remediation hints.35 - If a command fails because dependencies must be downloaded, request network escalation and retry the same package-manager command.36375. Verify and iterate.38 - Run the repo's relevant checks: tests, build, typecheck, lint, formatting, or targeted smoke tests.39 - Fix failures caused by the update, then rerun the smallest useful failing check before the broader suite.40 - Do not paper over failing tests by weakening assertions unless the behavior change is intentional and explained.41 - If unrelated failures pre-exist, document evidence and avoid claiming full verification.42436. Commit and push when requested.44 - Review `git diff` and `git status --short` before staging.45 - Stage only files related to the maintenance work.46 - Use a direct commit message such as `chore: update npm dependencies` or `fix: address dependency advisories`.47 - Push only when the user asked for it or the task clearly includes pushing.4849## Ecosystem Commands5051Use [references/ecosystems.md](references/ecosystems.md) when you need package-manager-specific commands for JavaScript, Python, Ruby, Rust, Go, .NET, Java, or PHP projects.5253## Reporting5455End with a concise maintenance report:5657- What changed: package names and notable versions when practical.58- Why: routine update, security advisory, compatibility fix, or requested upgrade.59- Verification: exact checks run and their result.60- Git state: commit hash and push result when applicable, or remaining uncommitted files.61- Residual risk: skipped major upgrades, unresolved advisories, unavailable network/advisory checks, or pre-existing failures.