Логотип Dependency Upgrade

Dependency Upgrade

Організація
navikt
dependency-upgrade

Oppgrader direkte avhengigheter i Go-, npm-, Gradle- og .NET-prosjekter med repoets låste pakkehåndterer, sjekk hver ny versjon mot pakkeregisteret, kjør bygg og tester, hold tilbake verktøypinner og major-hopp på database og infrastruktur med mindre du ber om dem, sett opp Dependabot-grupper i .github/dependabot.yml, og finn og fjern ubrukte avhengigheter

Add to TypingMind

Огляд

Видавецьnavikt
Репозиторійcopilot
Назва навичкиdependency-upgrade
Зірки
60
Форки
16
Файли в пакеті
1
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 1

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: navikt. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Dependency Upgrade у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/navikt/copilot/tree/main/skills/dependency-upgrade
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/navikt/copilot.git /tmp/copilot
mkdir -p .claude/skills
cp -r /tmp/copilot/skills/dependency-upgrade .claude/skills/dependency-upgrade
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Dependency Upgrade в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Dependency Upgrade, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Dependency Upgrade не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Dependency upgrade

A recipe for upgrading a repo's direct dependencies that a small local model can follow without inventing versions. It is built from what went right and wrong in the nais/examples runs (navikt/mlx-workspace reports/2026-10-14-nais-examples-upgrade and reports/2026-10-15-recipe-ab): lockfile-backed dependency bumps with tests went green across Go, npm, Gradle and .NET, while unguarded runs invented tool pins, image tags and CI versions, rewrote lockfiles with the wrong package manager major, and bumped Postgres across majors.

The rule behind every step: only change what something in the repo will check.

When to Use

  • "Upgrade the dependencies", "bump everything", "update npm packages"
  • A Dependabot or Renovate backlog you want to clear in one pass
  • "Set up Dependabot groups", "tidy dependabot.yml": see Dependabot groups
  • "Find unused dependencies and remove them": see Remove unused dependencies

When NOT to Use

  • Framework migrations that require code changes: use jackson-3-migration for Jackson 2→3, and plan Spring Boot 3→4 with nav-plan until a dedicated skill exists (#2029)
  • A project with no lockfile or no test command: report that it has no lockfile/tests and skip it

1. Find each project and its ecosystem

List every project directory (a monorepo has several). Skip any project directory that lacks either a lockfile or a build/test command, and list it as skipped in the report. For each eligible project, record:

EcosystemLockfileUpgrade commandVerify
Gogo.sumlist direct updates with go list -m -u -f '{{if and (not .Indirect) .Update}}{{.Path}}@{{.Update.Version}}{{end}}' all, then go get <module>@<version> && go mod tidy (without -u, so only required transitive dependencies move)go build ./... && go test ./...
npm/pnpm/yarnpackage-lock.json / pnpm-lock.yaml / yarn.lockthe repo's pinned manager: npm update, pnpm update, or for Yarn an explicit verified same-major target (yarn upgrade <pkg>@<version> on Yarn 1, yarn up <pkg>@<version> on Yarn Berry); majors one package at a time<pm> run build (if defined) and <pm> test
Gradlegradle/libs.versions.toml or gradle.lockfileedit the catalog / build file versions after step 4 lookup; if gradle.lockfile or dependency-locks/ is present, run ./gradlew dependencies --write-locks before verifying./gradlew build
.NETpackages.lock.jsondotnet list package --outdated, then dotnet add package <id> --version <v>dotnet build && dotnet test

2. Check the package manager version before installing (stop on mismatch)

Never run the machine's global package manager blindly; a global pnpm = "latest" in mise will rewrite a pnpm 9/10 lockfile to pnpm 11 and break CI. Run this check in each project directory before any install or update command:

bash
# JS projects: compare repo pin (stripping any Corepack +sha... suffix) and lockfile format against PATH
pin=$(jq -r '.packageManager // empty' package.json ../package.json ../../package.json 2>/dev/null | head -n1 | cut -d+ -f1)
pnpm_lock=$(awk '/^lockfileVersion:/ { gsub(/['\''"]/, "", $2); print $2; exit }' pnpm-lock.yaml 2>/dev/null)
npm_lock=$(jq -r '.lockfileVersion // empty' package-lock.json 2>/dev/null)
active_pnpm=$(pnpm --version 2>/dev/null)
active_npm=$(npm --version 2>/dev/null)
active_yarn=$(yarn --version 2>/dev/null)
echo "packageManager=${pin:-none} pnpm-lock=${pnpm_lock:-none} npm-lock=${npm_lock:-none} pnpm=${active_pnpm:-none} npm=${active_npm:-none} yarn=${active_yarn:-none}"
mise ls --current 2>/dev/null || true
  • If packageManager is set in package.json (or a parent workspace package.json) (pnpm@<v>, npm@<v>, or yarn@<v> after stripping any +sha... suffix): dispatch to that declared manager and exact version — corepack pnpm ... / npx -y pnpm@<v> ... for pnpm@..., npx -y npm@<v> ... for npm@..., or corepack yarn ... for yarn@... — and verify <launcher> --version matches <v> before installing or updating.
  • If pnpm-lock.yaml is present without packageManager: match the lockfile major (lockfileVersion: '6.0' → npx -y pnpm@8, lockfileVersion: '9.0' → npx -y pnpm@9 or pnpm@10). If pnpm --version on PATH is a newer major (such as 11.x from a mise latest override) and you cannot run the matching major via corepack or npx, stop immediately on that project and report: Stopped: repo lockfile requires pnpm <expected>, but active pnpm is <actual>.
  • If package-lock.json is present without packageManager: match lockfileVersion (1 → npx -y npm@6, 2 → npx -y npm@8, 3 → npm >=9) so a newer npm on PATH does not rewrite format 1/2 to 3. If a compatible npm cannot be selected and verified with --version, stop immediately on that project and report: Stopped: package-lock.json lockfileVersion <v> is incompatible with active npm <actual>.
  • Never change lockfileVersion in pnpm-lock.yaml or package-lock.json, and never edit packageManager in package.json.
  • Gradle: always run ./gradlew, never a global gradle.
  • Go and .NET: compare go version against the go line in go.mod, and dotnet --version against global.json (if present) or <TargetFramework> in .csproj. Stop if the active toolchain cannot build the target version.

3. Upgrade direct dependencies only

  • Do not edit transitive versions by hand; let the package manager and lockfile resolve them.
  • Upgrade one project at a time, run its verify command, and only then move to the next project.

4. Verify every new version exists and is stable

Every version you write by hand — in gradle/libs.versions.toml, build.gradle.kts, package.json, .csproj, go.mod, or in a pinned file the user explicitly asked to bump — must be checked against the upstream registry before you keep the edit:

bash
# npm / pnpm / yarn: must print "<version>"
npm view "<pkg>@<version>" version

# Go module proxy: must print "<module> <version>"
go list -m "<module>@<version>"

# Maven Central / Gradle: check the POM directly (<group-path> replaces '.' with '/'); for Gradle plugins try https://plugins.gradle.org/m2/ too, or verify via ./gradlew dependencies --configuration compileClasspath
curl -sfI "https://repo1.maven.org/maven2/<group-path>/<artifact>/<version>/<artifact>-<version>.pom" >/dev/null

# NuGet / .NET: package id and version in lowercase; must exit 0
curl -sf "https://api.nuget.org/v3-flatcontainer/<id-lowercase>/index.json" \
  | jq -e --arg v "<version-lowercase>" '.versions | index($v) != null'

# Container image tag (only when the user explicitly asked to bump an image)
docker buildx imagetools inspect "<image>:<tag>" >/dev/null

# GitHub Action tag (only when the user explicitly asked to bump a workflow action): resolve commit SHA and keep `@<sha> # <tag>` pinning when the workflow already pins by SHA
gh api "repos/<owner>/<repo>/commits/<tag>" --jq '.sha'

# Tool pin in mise / .tool-versions (only when the user explicitly asked to bump a tool)
mise ls-remote "<tool>" | grep -Fx "<version>"
  • If the lookup command fails or returns empty, the version does not exist: revert it immediately and record it in the report. Never guess a version number.
  • Reject any pre-release (-alpha, -beta, -rc, -M1, -SNAPSHOT, -next, -canary, -preview) unless the current version in the repo is already a pre-release.

5. Hold back by default

Leave these untouched unless the user asked for them by name, and list them in the report as held back:

  • Database and infrastructure majors: postgres, redis, kafka, elasticsearch, opensearch, mongodb, rabbitmq images, migration containers, Helm charts, or drivers/testcontainers whose major is tied to a server version (for example postgres:16 → 18). Keep the current major; only apply patch bumps within the same major if requested.
  • Tool pins: .tool-versions, mise.toml, .mise.toml, .nvmrc, .node-version, .python-version, global.json, gradle-wrapper.properties, and packageManager in package.json.
  • Container image tags in Dockerfile* and docker-compose*.yml / compose*.yml.
  • CI action versions in .github/workflows/ and .github/actions/.
  • nais manifests (.nais/, nais.yaml, nais.yml).
  • Breaking major bumps: if a major dependency bump fails build or tests after one small fix attempt, revert that package and keep the rest.

If the user explicitly asks to bump any held-back item, you must run the corresponding registry/tag check in step 4 before writing the new version.

6. Build, test and audit diff after each project

  1. Run the project's verify command from step 1.
  2. If tests fail: fix only if the upgrade caused it and the fix is small; otherwise revert that package and record it as held back. Never delete, skip or weaken a test to get green.
  3. Run git diff --name-only before finishing each project and verify that no held-back file (Dockerfile*, docker-compose*.yml, compose*.yml, .tool-versions, mise.toml, .mise.toml, .nvmrc, .node-version, .python-version, global.json, gradle-wrapper.properties, .github/workflows/*, .github/actions/*, .nais/*, nais.yaml, nais.yml) and no lockfileVersion or packageManager field changed unrequested. Revert any unintended edit immediately.

7. Report

End with one table per project:

PackageFromToStatus
github.com/foo/barv1.2.0v1.4.1upgraded
postgres (Dockerfile / compose / testcontainers)16—held: DB major, not requested
pnpm (packageManager / mise.toml)9.15.0—held: tool pin, not requested
eslint8.57.0—held: 9.x broke config, tests red after one fix

Follow the tables with each project's verify command and exit status, plus any package-manager version mismatch or mise latest override spotted in step 2.

Dependabot groups

Write or tidy .github/dependabot.yml with navikt/copilot's own file as the pattern. Use only options listed in the Dependabot options reference.

  • One updates entry per ecosystem and directory. Give every directory with a manifest or lockfile its own entry. A Gradle multi-project build needs only one entry, at the root. Add one github-actions entry for / with a group matching "*".

  • Schedule: interval: "weekly", day: "monday", time: "06:00", timezone: "Europe/Oslo". Set open-pull-requests-limit (5, the default, fits most repos).

  • Groups per entry. A dependency goes into the first group it matches, so put the Nav group first: @navikt/* and @nais/* for npm, no.nav* for Maven and Gradle.

    • npm and Maven (also bundler, composer, mix, pip): then one group with dependency-type: "development" and one with dependency-type: "production".
    • Gradle, Go, NuGet and Actions do not support dependency-type: after the Nav group, add one group with patterns: ["*"].
    • update-types (patch, minor, major) can split majors into their own group.
  • Do not add reviewers. GitHub removed the option in May 2025; use CODEOWNERS to assign reviewers.

  • Security updates. They are driven by alerts, so cooldown and open-pull-requests-limit do not apply to them (they have their own limit of 10). A group without applies-to covers version updates only. Whether security PRs are grouped depends on the repo's "Grouped security updates" setting. ignore does apply to security updates, so never use dependency-name: "*" unless that is the intent.

  • GitHub Packages for npm: take the scope from .npmrc. At Nav that is usually @nais on npm.pkg.github.com; @navikt is on npmjs. Never add a scope that .npmrc does not route to npm.pkg.github.com. Add one registries entry per scope (scope takes one value) and list it under the npm entry's registries.

    yaml
    registries:
      npm-github:
        type: npm-registry
        url: https://npm.pkg.github.com
        scope: "@nais"
        token: ${{ secrets.READER_TOKEN }}
  • GitHub Packages for Gradle and Maven: add one maven-repository entry per GitHub Packages repo that the build declares, copied from repositories {} or pom.xml. Never add one the build does not declare.

    yaml
      rapids-and-rivers:
        type: maven-repository
        url: https://maven.pkg.github.com/navikt/rapids-and-rivers
        username: x-access-token
        password: ${{ secrets.READER_TOKEN }}

    READER_TOKEN must exist as a Dependabot secret; say so in the report.

  • Keep existing ignore entries and their comments. Use cooldown or multi-ecosystem-groups only when the user asks.

Check before finishing:

bash
# The YAML parses
yq '.' .github/dependabot.yml >/dev/null || ruby -ryaml -e 'YAML.load_file(".github/dependabot.yml")'
# Directories with a manifest or lockfile ...
find . -name node_modules -prune -o \( -name go.sum -o -name package-lock.json -o -name pnpm-lock.yaml \
  -o -name yarn.lock -o -name libs.versions.toml -o -name 'build.gradle*' -o -name gradle.lockfile \
  -o -name pom.xml -o -name '*.csproj' -o -name packages.lock.json \) -print \
  | xargs -n1 dirname | sed 's#/gradle$##; s#^\.##; s#^$#/#' | sort -u
# ... must each appear here
grep -E '^\s*directory:' .github/dependabot.yml

Workspace members that share a root lockfile, and subprojects of a Gradle multi-project build, are covered by the root entry.

Remove unused dependencies

Find candidates with tooling, confirm each one by hand, then remove in small batches.

EcosystemFind candidatesRemove
npm/pnpm/yarnnpx -y knip --dependencies --no-exit-code from the repo root; never add knip to package.json<pm> remove <pkg> with the manager from step 2
Gogo mod tidy -diff (Go 1.23+) to previewgo mod tidy; also go mod vendor if vendor/ exists
Gradleonly implementation, api and testImplementation lines; never runtimeOnly, *-starter-*, *-engine, *-launcher, kapt/ksp or plugins. Prefer ./gradlew buildHealth if com.autonomousapps.dependency-analysis is already applied, and act only on its "unused" advice. Otherwise search src/ for the artifact's real package root (for example jar tf on the cached jar), not the Maven groupdelete the line in the build file or version catalog
.NETsearch *.cs for the namespaces of each PackageReference; skip Microsoft.NET.Test.Sdk, test runners, coverlet.* and *.Analyzersdotnet remove package <id>

Before removing a candidate, search the whole repo for its name, not only source imports:

  • Config files: *.config.*, postcss.config.*, .eslintrc*, .prettierrc*, .storybook/, tsconfig*.json, test setup files, next.config.*, the prettier, eslintConfig, browserslist and jest fields in package.json, application*.yml, logback*.xml.
  • Scripts and deploy: scripts in package.json, mise.toml, Makefile, .github/workflows/, Dockerfile*, .nais/.
  • Runtime and reflection use: Spring auto-configuration, JDBC drivers, ServiceLoader, logging backends, compiler and Gradle plugins, @types/* for a package still in use, peer dependencies of a package you keep.

If a CI script, Dockerfile or runtime config uses it, keep it: tools often flag these as unused. Remove one dependency or a small related batch, run the verify command from step 1, and revert the batch if it fails. Report each candidate as removed, kept (with the reason) or reverted.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Dependency Upgrade?

Oppgrader direkte avhengigheter i Go-, npm-, Gradle- og .NET-prosjekter med repoets låste pakkehåndterer, sjekk hver ny versjon mot pakkeregisteret, kjør bygg og tester, hold tilbake verktøypinner og major-hopp på database og infrastruktur med mindre du ber om dem, sett opp Dependabot-grupper i .github/dependabot.yml, og finn og fjern ubrukte avhengigheter

Навіщо використовувати Dependency Upgrade у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Dependency Upgrade — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Dependency Upgrade у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/navikt/copilot/tree/main/skills/dependency-upgrade. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Dependency Upgrade?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Dependency Upgrade?

Зі скількома забажаєте. У TypingMind ви можете використовувати Dependency Upgrade із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Dependency Upgrade?

Так. На GitHub цю навичку публікує navikt за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇