[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6X6H80TXWPSPS2PHX0TGRD8":3,"skill-same:01M6X6H80TXWPSPS2PHX0TGRD8":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":54,"ownerDescription":56,"updatedAt":57,"install":58,"resources":71},"01M6X6H80TXWPSPS2PHX0TGRD8","dependency-upgrade",null,"Use when upgrading dependencies — 'update framework X', 'bump runtime version', or 'upgrade packages'. Covers changelog review, breaking-change detection, and verification. Stack-agnostic.","event4u-app\u002Fagent-config","event4u-app","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F199339632?v=4","01M6X5TWBNCQCE1VDKT4E9KF7N","event4u.app","01M6X5TWF4HRM266RG2Q5VVH1X",19,"MIT","https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config\u002Fblob\u002Fmain\u002Fsrc\u002Fskills\u002Fdependency-upgrade\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"upgrade","dependency upgrade","dependency","version","when","change detection","runtime","dependencies","changelog review","bump","review","use","upgrade packages","stack","framework","changelog","verification","update","packages","change","2026-11-10 10:12:30",false,"---\nmodel_tier: medium\nname: dependency-upgrade\ndescription: \"Use when upgrading dependencies — 'update framework X', 'bump runtime version', or 'upgrade packages'. Covers changelog review, breaking-change detection, and verification. Stack-agnostic.\"\ndomain: engineering\nworkspaces:\n  - engineering\npacks:\n  - engineering-base\n---\n\n# dependency-upgrade\n\n## When to use\n\nUse this skill when upgrading project dependencies on any stack — Composer (PHP), npm \u002F pnpm \u002F yarn (JS\u002FTS), pip \u002F poetry \u002F uv (Python), go.mod (Go), Cargo (Rust), or any other language-level package manager.\n\nDo NOT use when:\n- Installing new dependencies for the first time\n- Routine code changes unrelated to package versions\n\n## Procedure: Upgrade a dependency\n\n### 1. Assess\n\nBefore upgrading:\n\n- **Read the changelog** for every version between current and target.\n- **Identify breaking changes** — look for \"BREAKING\", \"BC break\", major version bumps.\n- **Check deprecation notices** — code using deprecated APIs needs updating.\n- **Review upgrade guides** — many packages provide migration docs.\n- **Check runtime version requirements** — does the new version need a newer PHP \u002F Node \u002F Python \u002F Go \u002F Rust toolchain?\n\n### 1b. Find where the version is DECLARED, before naming a file to edit\n\n```\nNEVER NAME AN EDIT SITE BEFORE ASKING WHERE THE VERSION IS DECLARED.\nIN A CATALOG WORKSPACE THE MEMBER MANIFEST IS THE WRONG FILE:\nTHE VERSION IS ONE ROOT LINE WITH N REFERENTS.\n```\n\nA member `package.json` is the declaration site in an ordinary repository and\n**not** in a workspace using a catalog. There, the member reads `catalog:` and\nthe range lives once in the workspace definition — editing the member either\ndoes nothing or silently diverges from the catalog.\n\nAsk in this order, and stop at the first that answers:\n\n1. **A catalog entry for this dependency** — `pnpm-workspace.yaml` `catalogs:` \u002F\n   `catalog:`, or the equivalent in another manager's workspace definition. If\n   the member's range starts with `catalog:`, this is the edit site. Name the\n   catalog (`default` included) in the guidance, not the member.\n2. **A root-level pin** — `overrides` \u002F `resolutions` \u002F `pnpm.overrides`. A\n   member edit under one of these is overridden at install time.\n3. **The member manifest** — the ordinary case, and only after 1 and 2 are\n   silent.\n\n### 2. Plan\n\nCategorize changes needed:\n\n| Category | Action |\n|---|---|\n| No breaking changes | Upgrade directly |\n| Deprecation warnings | Upgrade, then fix deprecations |\n| Breaking changes (small) | Fix code, then upgrade |\n| Breaking changes (large) | Create a roadmap, upgrade in steps |\n| Peer dependency conflicts | Resolve conflicts before upgrading |\n\n### 3. Execute\n\n#### Composer (PHP)\n\n```bash\n# Check outdated packages\ncomposer outdated\n\n# Upgrade a specific package\ncomposer update vendor\u002Fpackage\n\n# Upgrade with version constraint change\ncomposer require vendor\u002Fpackage:^3.0\n\n# Dry-run to see what would change\ncomposer update vendor\u002Fpackage --dry-run\n```\n\n#### npm (JavaScript\u002FTypeScript)\n\n```bash\n# Check outdated packages\nnpm outdated\n\n# Upgrade a specific package\nnpm update package-name\n\n# Upgrade to a new major version\nnpm install package-name@latest\n\n# Check for vulnerabilities\nnpm audit\n```\n\n#### pip \u002F poetry \u002F uv (Python)\n\n```bash\n# Check outdated packages\npip list --outdated         # pip\npoetry show --outdated       # poetry\nuv pip list --outdated       # uv\n\n# Upgrade a specific package (same shape for composer require \u002F npm install pkg@latest)\npip install --upgrade package-name\npoetry update package-name\nuv pip install --upgrade package-name\n\n# Check for vulnerabilities\npip-audit                    # via pip-audit\nsafety check                 # via safety\n```\n\n#### go.mod (Go)\n\n```bash\n# List available updates\ngo list -u -m all\n\n# Upgrade a specific module\ngo get example.com\u002Fpkg@latest\ngo get example.com\u002Fpkg@v1.2.3\n\n# Tidy after upgrade\ngo mod tidy\n\n# Check for known vulnerabilities\ngovulncheck .\u002F...\n```\n\n#### Cargo (Rust)\n\n```bash\n# Check outdated\ncargo outdated               # requires cargo-outdated\n\n# Upgrade\ncargo update -p crate-name\ncargo add crate-name@1.2     # edition-aware add\n\n# Audit\ncargo audit                  # requires cargo-audit\n```\n\n### 4. Verify\n\nAfter upgrading, run the project's full verification pipeline. The exact commands depend on the stack — resolve via the project's `Taskfile.yml`, `package.json scripts`, `composer.json scripts`, `Makefile`, or the `quality-tools` skill.\n\n| Stack | Type-check | Lint \u002F autofix | Tests |\n|---|---|---|---|\n| PHP \u002F Laravel | `vendor\u002Fbin\u002Fphpstan analyse` | `vendor\u002Fbin\u002Frector process` + `vendor\u002Fbin\u002Fecs check --fix` | `php artisan test` (or `vendor\u002Fbin\u002Fpest`) |\n| TypeScript | `tsc --noEmit` | `eslint --fix` + `prettier --write` | `pnpm test` (or `vitest run`, `jest`) |\n| Python | `mypy` \u002F `pyright` | `ruff check --fix` + `ruff format` | `pytest` |\n| Go | `go vet .\u002F...` | `golangci-lint run --fix` | `go test .\u002F...` |\n| Rust | `cargo check` | `cargo clippy --fix` + `cargo fmt` | `cargo test` |\n\nRe-run the type-checker after any auto-fixer that can rewrite types (Rector for PHP, `eslint --fix` for TS).\n\n### 5. Document\n\n- Note the upgrade in the commit message: `chore: upgrade vendor\u002Fpackage from 2.x to 3.x`\n- If breaking changes required code modifications, describe them in the PR body.\n\n## Multi-package upgrades\n\nWhen upgrading multiple packages:\n\n- **Upgrade one at a time** — easier to identify which upgrade broke something.\n- **Exception:** Tightly coupled packages can be upgraded together (e.g., `laravel\u002Fframework` + `laravel\u002F*`; `@nestjs\u002Fcore` + `@nestjs\u002F*`; `react` + `react-dom`; `next` + `@next\u002F*`).\n- **Run tests after each upgrade** — don't batch upgrades and test once at the end.\n\n## Common pitfalls\n\n| Pitfall | Prevention |\n|---|---|\n| Trusting `composer update` blindly | Use `--dry-run` first, review changes |\n| Ignoring deprecation warnings | Fix deprecations before they become errors |\n| Lock file conflicts | Coordinate upgrades with the team |\n\n## Version constraint guidelines\n\n| Constraint | Meaning | When to use |\n|---|---|---|\n| `^2.0` | `>=2.0.0 \u003C3.0.0` | Default — allows minor + patch updates |\n| `~2.1` | `>=2.1.0 \u003C2.2.0` | Strict — allows only patch updates |\n| `2.1.*` | `>=2.1.0 \u003C2.2.0` | Same as `~2.1` |\n| `>=2.0 \u003C2.5` | Explicit range | When you know specific versions work |\n| `dev-main` | Latest commit | **Never in production** — only for development |\n\n## Security upgrades\n\nFor security patches:\n\n- **Prioritize** — fast-track security upgrades.\n- **Check `composer audit`** \u002F `npm audit` regularly.\n- **Patch versions** (e.g., 2.1.3 → 2.1.4) are usually safe to apply immediately.\n- **Still run tests** — even security patches can break things.\n\n## Vulnerability scanning when adding packages\n\nBefore adding a **new** dependency (not just upgrading), run a security audit:\n\n### Composer (PHP)\n\n```bash\n# Known vulnerabilities in installed packages\ncomposer audit\n\n# After adding a new package, re-check\ncomposer require vendor\u002Fnew-package\ncomposer audit\n```\n\n### npm (JavaScript)\n\n```bash\n# Check before install\nnpm audit\n\n# After adding, re-check\nnpm install new-package\nnpm audit\n```\n\n### What to check for new packages\n\n| Check | How | Why |\n|---|---|---|\n| **Known CVEs** | `composer audit` \u002F `npm audit` | Direct vulnerabilities |\n| **Maintenance status** | GitHub: last commit, open issues | Abandoned packages are a risk |\n| **Dependency tree** | `composer show -t vendor\u002Fpkg` \u002F `npm ls new-package` | Transitive dependencies may conflict |\n| **License compatibility** | `composer licenses` \u002F check `package.json` | Legal compliance |\n| **Bundle size** (npm) | `npx bundlephobia new-package` | Impact on frontend bundle |\n\n### Conflict detection\n\nWhen `composer require` or `npm install` fails with conflicts:\n\n1. **Read the error** — which versions conflict?\n2. **Check if other packages need updating** — `composer why vendor\u002Fconflicting-pkg`.\n3. **Use `--dry-run`** first — `composer require vendor\u002Fpkg --dry-run`.\n4. **Never use `--ignore-platform-reqs`** in production — only for investigation.\n\n## Post-update malware & behavior audit\n\nCVE scanning (above) catches *known-vulnerable* versions. It does **not** catch a **compromised update**: a trusted package with a legitimate history ships a normal-looking version bump that quietly adds data-exfiltration or other harmful behavior. This is how the biggest supply-chain attacks landed — event-stream (wallet stealer as a new transitive dep), ua-parser-js (`preinstall` miner + credential stealer), @solana\u002Fweb3.js (key exfil hidden inside expected network calls), chalk\u002Fdebug + 16 (browser crypto-drainer), the self-propagating Shai-Hulud worm (added a `.github\u002Fworkflows` + secret-scanning `postinstall`), xz-utils (backdoor in the released tarball, not the git repo). Routine updates slip through because the version looks normal and install runs scripts across the whole transitive tree silently — this is the exact [`lethal-trifecta-guard`](..\u002F..\u002Frules\u002Flethal-trifecta-guard.md) egress shape.\n\n**Run this audit during\u002Fafter any add or upgrade, then surface findings to the user and hold pending confirmation** (per [`active-remediation`](..\u002F..\u002Frules\u002Factive-remediation.md) — a live supply-chain risk is surfaced, never silently accepted):\n\n1. **Install without running scripts first** — `npm install --ignore-scripts` (npm v12 defaults to this), `composer install --no-scripts`, `pip install --only-binary :all:` (wheels only — no sdist build code) — so install-time code (the #1 RCE vector) cannot run before inspection.\n2. **Diff the version delta old→new** — the `scripts` block (any newly-added `pre\u002Fpost\u002Finstall` hook), the dependency tree (any **new transitive dependency**), and — where feasible — the published tarball vs the git source (xz hid in the tarball).\n3. **Capability \u002F behavior diff** — did the new version add a capability its job doesn't need: network egress (`fetch`\u002F`net`\u002F`dns`\u002F`http`), `child_process`\u002Fshell, env\u002Fsecret\u002Fcredential reads, filesystem writes, obfuscated\u002Fminified blobs, a `.github\u002Fworkflows` file? Use `socket` \u002F `guarddog \u003Ceco> scan \u003Cpkg>@\u003Cver>` if available; else read the delta.\n4. **Purpose-vs-behavior legitimacy check** — a Slack\u002FHTTP client legitimately makes network calls; a date\u002Fstring\u002Fcolor util does not. For each new capability ask: *does the package's stated purpose require this?* A network\u002Fsecret capability with no purpose justification — or a **new outbound endpoint** even in a package that already uses the network — is high-risk.\n5. **Provenance + advisory feeds** — `npm audit signatures` (flag a dep that *had* provenance and lost it — a hallmark of a token-theft publish); `osv-scanner --lockfile=…` and the GitHub Advisory \u002F Socket \u002F Snyk malware feeds against the newly-resolved versions.\n6. **Release age and agent-config paths** — a fixing version younger than three days (a default, not a measured threshold) is `fix-fresh`: run steps 1–5 before installing it, not after. Any change to an agent, editor, git-hook or CI config path in a dependency update's diff stops the update — e.g. `.claude\u002F`, `.augment\u002F`, `.cursor\u002F`, `.gemini\u002F`, `.windsurf\u002F`, `.codex\u002F`, `.vscode\u002F`, `.husky\u002F`, `.github\u002Fworkflows\u002F`, `.mcp.json`, an `AGENTS.md` \u002F `CLAUDE.md` \u002F `.cursorrules`-style instruction file — or to an install script; an unlisted path of that class stops it too. Own analysis: a session-start hook is a persistence point running with the developer's credentials, hence a stop, not a warning.\n\n**Surface to the user** any: new install script · new transitive dep · new network endpoint \u002F secret read · obfuscated blob · lost provenance · advisory\u002Fmalware hit — with the version delta and the purpose-vs-behavior verdict, and hold the update until they decide. Never auto-accept a bump that introduced an unexplained capability.\n\n## Security fix — one finding carried to a verified PR\n\nEntered from `\u002Faudit deps fix \u003Cid>` or a finding the user names. The goal is a\nfix the owner can merge, not a plan: smallest change, right place, proven by the\nsource that reported it.\n\n1. **Plan and route** — `agent-config audit:deps fix \u003Cid>` prints the route\n   (routing table below), the branch and PR title, the smallest fixing change,\n   and for a runtime every pinning file with its edit plus an ops checklist. It\n   claims the finding: a second session sees the open fix and joins it instead\n   of starting another.\n\n   | Situation | Route |\n   |---|---|\n   | the current branch introduced the dependency, or the user says \"here\" | this branch, its own `fix(security): …` commit |\n   | an open bot PR already moves this dependency | complete that PR |\n   | trunk, clean tree | a new `security\u002F…` branch in this checkout |\n   | a feature branch is in progress | a separate worktree from fresh trunk, its own branch and PR — the fix travels alone; if the feature changes the same lockfile, offer it a rebase after the merge |\n\n   Choosing \"separate worktree\" in the offer **is** the explicit ask\n   `using-git-worktrees` requires; register it (`agent-config worktree:cleanup\n   register \u003Cpath> --purpose=security-fix`) so its removal after the merge is\n   not forgotten.\n2. **Build the smallest fix** — inside the current constraint first\n   (`npm update \u003Cpkg> --ignore-scripts`, an `overrides` entry for a\n   transitive fix, `composer update vendor\u002Fpkg --no-scripts --no-plugins`); a constraint change only\n   when the fixing version is outside it; a new major only with a stated\n   compatibility analysis; never `npm audit fix --force`. A runtime fix changes\n   every file that pins it in one commit. Run the post-update audit above,\n   including step 6.\n3. **Prove it** — `agent-config audit:deps verify \u003Cid>`: the source that reported\n   the finding must stop reporting it on this branch. `fix-failed` means the hole\n   is still open — say so; `unverifiable` means the source did not answer — say\n   that too. Then the project's tests and static checks. A fix that leaves the\n   advisory open or breaks a test is reported as exactly that, never as done.\n4. **Open the PR** — `agent-config audit:deps pr-body \u003Cid> --tests=passed`\n   prints the body; its After field is what `verify` recorded; a library adds\n   `--release=\u003Ccurrent version>` for the patch-release draft. Security fixes are\n   never mixed with unrelated work. Stop before tag and publish. The entry\n   command authorizes only the local fix: before the first push or PR, show\n   branch, title and body and wait for this-turn confirmation\n   (`non-destructive-by-default`). On a public remote the body names the\n   advisory id and fixed version, never an exploit path, until merged.\n5. **Hand over** — watch CI with `agent-config ci:settle \u003Cpr>`, fix what the fix\n   broke, report \"ready to merge\". Merge is the owner's, or `\u002Fpr:merge` under the\n   owner's instruction; under `worktrees.cleanup: auto` the merge removes the fix\n   worktree. Afterwards `agent-config audit:deps track` follows it from\n   `fixed-in-trunk` to `fixed-released` to `fixed-deployed`; \"merged but not\n   deployed\" after 24 h stays in the session notice.\n6. **No fix exists** — offer a mitigation (a configuration change, a disabled\n   feature, a pinned-back version where that is safe) and record it with\n   `agent-config audit:deps mitigate \u003Cid> --note=\"…\"`; it stays open and reopens\n   the moment a refresh reports a fix.\n\n## Output format\n\n1. Updated dependency with version constraint change\n2. Breaking changes addressed with code modifications\n3. Test results confirming compatibility\n4. Post-update audit result: capability delta old→new, purpose-vs-behavior verdict, provenance\u002Fadvisory status — and any finding surfaced to the user for confirmation\n5. For a security fix: the route taken, the source's own re-check (`fixed-in-branch` \u002F `fix-failed` \u002F `unverifiable`), and the PR or the reason there is none\n\n## Auto-trigger keywords\n\n- dependency upgrade\n- package update\n- breaking changes\n- changelog review\n- malicious package\n- supply chain\n- compromised update\n\n## Gotcha\n\n- **A trusted package is not a safe version.** Every attack listed above shipped as a *legitimate* package's normal-looking bump. Run the post-update behavior audit, not just `audit` for CVEs.\n- **`audit` (CVE) ≠ malware scan.** `npm\u002Fcomposer audit` only knows *published* vulnerabilities; a fresh compromised version has no CVE yet. The capability\u002Fbehavior diff + purpose-vs-behavior check is what catches zero-hour malware.\n- Don't upgrade multiple major versions at once — one major version per upgrade cycle.\n- The model tends to skip reading the CHANGELOG — breaking changes hide in minor releases too.\n- Always run the full test suite after upgrading, not just the affected tests.\n- Lock file conflicts after upgrade are expected — re-run the package manager's update (`composer update`, `npm update`, `poetry update`).\n\n## Do NOT\n\n- Do NOT manually edit `composer.lock` or `package-lock.json`.\n- Do NOT upgrade to `dev-*` versions in production branches.\n- Do NOT ignore failing tests after an upgrade — fix or revert.\n","# dependency-upgrade\n\n## When to use\n\nUse this skill when upgrading project dependencies on any stack — Composer (PHP), npm \u002F pnpm \u002F yarn (JS\u002FTS), pip \u002F poetry \u002F uv (Python), go.mod (Go), Cargo (Rust), or any other language-level package manager.\n\nDo NOT use when:\n- Installing new dependencies for the first time\n- Routine code changes unrelated to package versions\n\n## Procedure: Upgrade a dependency\n\n### 1. Assess\n\nBefore upgrading:\n\n- **Read the changelog** for every version between current and target.\n- **Identify breaking changes** — look for \"BREAKING\", \"BC break\", major version bumps.\n- **Check deprecation notices** — code using deprecated APIs needs updating.\n- **Review upgrade guides** — many packages provide migration docs.\n- **Check runtime version requirements** — does the new version need a newer PHP \u002F Node \u002F Python \u002F Go \u002F Rust toolchain?\n\n### 1b. Find where the version is DECLARED, before naming a file to edit\n\n```\nNEVER NAME AN EDIT SITE BEFORE ASKING WHERE THE VERSION IS DECLARED.\nIN A CATALOG WORKSPACE THE MEMBER MANIFEST IS THE WRONG FILE:\nTHE VERSION IS ONE ROOT LINE WITH N REFERENTS.\n```\n\nA member `package.json` is the declaration site in an ordinary repository and\n**not** in a workspace using a catalog. There, the member reads `catalog:` and\nthe range lives once in the workspace definition — editing the member either\ndoes nothing or silently diverges from the catalog.\n\nAsk in this order, and stop at the first that answers:\n\n1. **A catalog entry for this dependency** — `pnpm-workspace.yaml` `catalogs:` \u002F\n   `catalog:`, or the equivalent in another manager's workspace definition. If\n   the member's range starts with `catalog:`, this is the edit site. Name the\n   catalog (`default` included) in the guidance, not the member.\n2. **A root-level pin** — `overrides` \u002F `resolutions` \u002F `pnpm.overrides`. A\n   member edit under one of these is overridden at install time.\n3. **The member manifest** — the ordinary case, and only after 1 and 2 are\n   silent.\n\n### 2. Plan\n\nCategorize changes needed:\n\n| Category | Action |\n|---|---|\n| No breaking changes | Upgrade directly |\n| Deprecation warnings | Upgrade, then fix deprecations |\n| Breaking changes (small) | Fix code, then upgrade |\n| Breaking changes (large) | Create a roadmap, upgrade in steps |\n| Peer dependency conflicts | Resolve conflicts before upgrading |\n\n### 3. Execute\n\n#### Composer (PHP)\n\n```bash\n# Check outdated packages\ncomposer outdated\n\n# Upgrade a specific package\ncomposer update vendor\u002Fpackage\n\n# Upgrade with version constraint change\ncomposer require vendor\u002Fpackage:^3.0\n\n# Dry-run to see what would change\ncomposer update vendor\u002Fpackage --dry-run\n```\n\n#### npm (JavaScript\u002FTypeScript)\n\n```bash\n# Check outdated packages\nnpm outdated\n\n# Upgrade a specific package\nnpm update package-name\n\n# Upgrade to a new major version\nnpm install package-name@latest\n\n# Check for vulnerabilities\nnpm audit\n```\n\n#### pip \u002F poetry \u002F uv (Python)\n\n```bash\n# Check outdated packages\npip list --outdated         # pip\npoetry show --outdated       # poetry\nuv pip list --outdated       # uv\n\n# Upgrade a specific package (same shape for composer require \u002F npm install pkg@latest)\npip install --upgrade package-name\npoetry update package-name\nuv pip install --upgrade package-name\n\n# Check for vulnerabilities\npip-audit                    # via pip-audit\nsafety check                 # via safety\n```\n\n#### go.mod (Go)\n\n```bash\n# List available updates\ngo list -u -m all\n\n# Upgrade a specific module\ngo get example.com\u002Fpkg@latest\ngo get example.com\u002Fpkg@v1.2.3\n\n# Tidy after upgrade\ngo mod tidy\n\n# Check for known vulnerabilities\ngovulncheck .\u002F...\n```\n\n#### Cargo (Rust)\n\n```bash\n# Check outdated\ncargo outdated               # requires cargo-outdated\n\n# Upgrade\ncargo update -p crate-name\ncargo add crate-name@1.2     # edition-aware add\n\n# Audit\ncargo audit                  # requires cargo-audit\n```\n\n### 4. Verify\n\nAfter upgrading, run the project's full verification pipeline. The exact commands depend on the stack — resolve via the project's `Taskfile.yml`, `package.json scripts`, `composer.json scripts`, `Makefile`, or the `quality-tools` skill.\n\n| Stack | Type-check | Lint \u002F autofix | Tests |\n|---|---|---|---|\n| PHP \u002F Laravel | `vendor\u002Fbin\u002Fphpstan analyse` | `vendor\u002Fbin\u002Frector process` + `vendor\u002Fbin\u002Fecs check --fix` | `php artisan test` (or `vendor\u002Fbin\u002Fpest`) |\n| TypeScript | `tsc --noEmit` | `eslint --fix` + `prettier --write` | `pnpm test` (or `vitest run`, `jest`) |\n| Python | `mypy` \u002F `pyright` | `ruff check --fix` + `ruff format` | `pytest` |\n| Go | `go vet .\u002F...` | `golangci-lint run --fix` | `go test .\u002F...` |\n| Rust | `cargo check` | `cargo clippy --fix` + `cargo fmt` | `cargo test` |\n\nRe-run the type-checker after any auto-fixer that can rewrite types (Rector for PHP, `eslint --fix` for TS).\n\n### 5. Document\n\n- Note the upgrade in the commit message: `chore: upgrade vendor\u002Fpackage from 2.x to 3.x`\n- If breaking changes required code modifications, describe them in the PR body.\n\n## Multi-package upgrades\n\nWhen upgrading multiple packages:\n\n- **Upgrade one at a time** — easier to identify which upgrade broke something.\n- **Exception:** Tightly coupled packages can be upgraded together (e.g., `laravel\u002Fframework` + `laravel\u002F*`; `@nestjs\u002Fcore` + `@nestjs\u002F*`; `react` + `react-dom`; `next` + `@next\u002F*`).\n- **Run tests after each upgrade** — don't batch upgrades and test once at the end.\n\n## Common pitfalls\n\n| Pitfall | Prevention |\n|---|---|\n| Trusting `composer update` blindly | Use `--dry-run` first, review changes |\n| Ignoring deprecation warnings | Fix deprecations before they become errors |\n| Lock file conflicts | Coordinate upgrades with the team |\n\n## Version constraint guidelines\n\n| Constraint | Meaning | When to use |\n|---|---|---|\n| `^2.0` | `>=2.0.0 \u003C3.0.0` | Default — allows minor + patch updates |\n| `~2.1` | `>=2.1.0 \u003C2.2.0` | Strict — allows only patch updates |\n| `2.1.*` | `>=2.1.0 \u003C2.2.0` | Same as `~2.1` |\n| `>=2.0 \u003C2.5` | Explicit range | When you know specific versions work |\n| `dev-main` | Latest commit | **Never in production** — only for development |\n\n## Security upgrades\n\nFor security patches:\n\n- **Prioritize** — fast-track security upgrades.\n- **Check `composer audit`** \u002F `npm audit` regularly.\n- **Patch versions** (e.g., 2.1.3 → 2.1.4) are usually safe to apply immediately.\n- **Still run tests** — even security patches can break things.\n\n## Vulnerability scanning when adding packages\n\nBefore adding a **new** dependency (not just upgrading), run a security audit:\n\n### Composer (PHP)\n\n```bash\n# Known vulnerabilities in installed packages\ncomposer audit\n\n# After adding a new package, re-check\ncomposer require vendor\u002Fnew-package\ncomposer audit\n```\n\n### npm (JavaScript)\n\n```bash\n# Check before install\nnpm audit\n\n# After adding, re-check\nnpm install new-package\nnpm audit\n```\n\n### What to check for new packages\n\n| Check | How | Why |\n|---|---|---|\n| **Known CVEs** | `composer audit` \u002F `npm audit` | Direct vulnerabilities |\n| **Maintenance status** | GitHub: last commit, open issues | Abandoned packages are a risk |\n| **Dependency tree** | `composer show -t vendor\u002Fpkg` \u002F `npm ls new-package` | Transitive dependencies may conflict |\n| **License compatibility** | `composer licenses` \u002F check `package.json` | Legal compliance |\n| **Bundle size** (npm) | `npx bundlephobia new-package` | Impact on frontend bundle |\n\n### Conflict detection\n\nWhen `composer require` or `npm install` fails with conflicts:\n\n1. **Read the error** — which versions conflict?\n2. **Check if other packages need updating** — `composer why vendor\u002Fconflicting-pkg`.\n3. **Use `--dry-run`** first — `composer require vendor\u002Fpkg --dry-run`.\n4. **Never use `--ignore-platform-reqs`** in production — only for investigation.\n\n## Post-update malware & behavior audit\n\nCVE scanning (above) catches *known-vulnerable* versions. It does **not** catch a **compromised update**: a trusted package with a legitimate history ships a normal-looking version bump that quietly adds data-exfiltration or other harmful behavior. This is how the biggest supply-chain attacks landed — event-stream (wallet stealer as a new transitive dep), ua-parser-js (`preinstall` miner + credential stealer), @solana\u002Fweb3.js (key exfil hidden inside expected network calls), chalk\u002Fdebug + 16 (browser crypto-drainer), the self-propagating Shai-Hulud worm (added a `.github\u002Fworkflows` + secret-scanning `postinstall`), xz-utils (backdoor in the released tarball, not the git repo). Routine updates slip through because the version looks normal and install runs scripts across the whole transitive tree silently — this is the exact [`lethal-trifecta-guard`](..\u002F..\u002Frules\u002Flethal-trifecta-guard.md) egress shape.\n\n**Run this audit during\u002Fafter any add or upgrade, then surface findings to the user and hold pending confirmation** (per [`active-remediation`](..\u002F..\u002Frules\u002Factive-remediation.md) — a live supply-chain risk is surfaced, never silently accepted):\n\n1. **Install without running scripts first** — `npm install --ignore-scripts` (npm v12 defaults to this), `composer install --no-scripts`, `pip install --only-binary :all:` (wheels only — no sdist build code) — so install-time code (the #1 RCE vector) cannot run before inspection.\n2. **Diff the version delta old→new** — the `scripts` block (any newly-added `pre\u002Fpost\u002Finstall` hook), the dependency tree (any **new transitive dependency**), and — where feasible — the published tarball vs the git source (xz hid in the tarball).\n3. **Capability \u002F behavior diff** — did the new version add a capability its job doesn't need: network egress (`fetch`\u002F`net`\u002F`dns`\u002F`http`), `child_process`\u002Fshell, env\u002Fsecret\u002Fcredential reads, filesystem writes, obfuscated\u002Fminified blobs, a `.github\u002Fworkflows` file? Use `socket` \u002F `guarddog \u003Ceco> scan \u003Cpkg>@\u003Cver>` if available; else read the delta.\n4. **Purpose-vs-behavior legitimacy check** — a Slack\u002FHTTP client legitimately makes network calls; a date\u002Fstring\u002Fcolor util does not. For each new capability ask: *does the package's stated purpose require this?* A network\u002Fsecret capability with no purpose justification — or a **new outbound endpoint** even in a package that already uses the network — is high-risk.\n5. **Provenance + advisory feeds** — `npm audit signatures` (flag a dep that *had* provenance and lost it — a hallmark of a token-theft publish); `osv-scanner --lockfile=…` and the GitHub Advisory \u002F Socket \u002F Snyk malware feeds against the newly-resolved versions.\n6. **Release age and agent-config paths** — a fixing version younger than three days (a default, not a measured threshold) is `fix-fresh`: run steps 1–5 before installing it, not after. Any change to an agent, editor, git-hook or CI config path in a dependency update's diff stops the update — e.g. `.claude\u002F`, `.augment\u002F`, `.cursor\u002F`, `.gemini\u002F`, `.windsurf\u002F`, `.codex\u002F`, `.vscode\u002F`, `.husky\u002F`, `.github\u002Fworkflows\u002F`, `.mcp.json`, an `AGENTS.md` \u002F `CLAUDE.md` \u002F `.cursorrules`-style instruction file — or to an install script; an unlisted path of that class stops it too. Own analysis: a session-start hook is a persistence point running with the developer's credentials, hence a stop, not a warning.\n\n**Surface to the user** any: new install script · new transitive dep · new network endpoint \u002F secret read · obfuscated blob · lost provenance · advisory\u002Fmalware hit — with the version delta and the purpose-vs-behavior verdict, and hold the update until they decide. Never auto-accept a bump that introduced an unexplained capability.\n\n## Security fix — one finding carried to a verified PR\n\nEntered from `\u002Faudit deps fix \u003Cid>` or a finding the user names. The goal is a\nfix the owner can merge, not a plan: smallest change, right place, proven by the\nsource that reported it.\n\n1. **Plan and route** — `agent-config audit:deps fix \u003Cid>` prints the route\n   (routing table below), the branch and PR title, the smallest fixing change,\n   and for a runtime every pinning file with its edit plus an ops checklist. It\n   claims the finding: a second session sees the open fix and joins it instead\n   of starting another.\n\n   | Situation | Route |\n   |---|---|\n   | the current branch introduced the dependency, or the user says \"here\" | this branch, its own `fix(security): …` commit |\n   | an open bot PR already moves this dependency | complete that PR |\n   | trunk, clean tree | a new `security\u002F…` branch in this checkout |\n   | a feature branch is in progress | a separate worktree from fresh trunk, its own branch and PR — the fix travels alone; if the feature changes the same lockfile, offer it a rebase after the merge |\n\n   Choosing \"separate worktree\" in the offer **is** the explicit ask\n   `using-git-worktrees` requires; register it (`agent-config worktree:cleanup\n   register \u003Cpath> --purpose=security-fix`) so its removal after the merge is\n   not forgotten.\n2. **Build the smallest fix** — inside the current constraint first\n   (`npm update \u003Cpkg> --ignore-scripts`, an `overrides` entry for a\n   transitive fix, `composer update vendor\u002Fpkg --no-scripts --no-plugins`); a constraint change only\n   when the fixing version is outside it; a new major only with a stated\n   compatibility analysis; never `npm audit fix --force`. A runtime fix changes\n   every file that pins it in one commit. Run the post-update audit above,\n   including step 6.\n3. **Prove it** — `agent-config audit:deps verify \u003Cid>`: the source that reported\n   the finding must stop reporting it on this branch. `fix-failed` means the hole\n   is still open — say so; `unverifiable` means the source did not answer — say\n   that too. Then the project's tests and static checks. A fix that leaves the\n   advisory open or breaks a test is reported as exactly that, never as done.\n4. **Open the PR** — `agent-config audit:deps pr-body \u003Cid> --tests=passed`\n   prints the body; its After field is what `verify` recorded; a library adds\n   `--release=\u003Ccurrent version>` for the patch-release draft. Security fixes are\n   never mixed with unrelated work. Stop before tag and publish. The entry\n   command authorizes only the local fix: before the first push or PR, show\n   branch, title and body and wait for this-turn confirmation\n   (`non-destructive-by-default`). On a public remote the body names the\n   advisory id and fixed version, never an exploit path, until merged.\n5. **Hand over** — watch CI with `agent-config ci:settle \u003Cpr>`, fix what the fix\n   broke, report \"ready to merge\". Merge is the owner's, or `\u002Fpr:merge` under the\n   owner's instruction; under `worktrees.cleanup: auto` the merge removes the fix\n   worktree. Afterwards `agent-config audit:deps track` follows it from\n   `fixed-in-trunk` to `fixed-released` to `fixed-deployed`; \"merged but not\n   deployed\" after 24 h stays in the session notice.\n6. **No fix exists** — offer a mitigation (a configuration change, a disabled\n   feature, a pinned-back version where that is safe) and record it with\n   `agent-config audit:deps mitigate \u003Cid> --note=\"…\"`; it stays open and reopens\n   the moment a refresh reports a fix.\n\n## Output format\n\n1. Updated dependency with version constraint change\n2. Breaking changes addressed with code modifications\n3. Test results confirming compatibility\n4. Post-update audit result: capability delta old→new, purpose-vs-behavior verdict, provenance\u002Fadvisory status — and any finding surfaced to the user for confirmation\n5. For a security fix: the route taken, the source's own re-check (`fixed-in-branch` \u002F `fix-failed` \u002F `unverifiable`), and the PR or the reason there is none\n\n## Auto-trigger keywords\n\n- dependency upgrade\n- package update\n- breaking changes\n- changelog review\n- malicious package\n- supply chain\n- compromised update\n\n## Gotcha\n\n- **A trusted package is not a safe version.** Every attack listed above shipped as a *legitimate* package's normal-looking bump. Run the post-update behavior audit, not just `audit` for CVEs.\n- **`audit` (CVE) ≠ malware scan.** `npm\u002Fcomposer audit` only knows *published* vulnerabilities; a fresh compromised version has no CVE yet. The capability\u002Fbehavior diff + purpose-vs-behavior check is what catches zero-hour malware.\n- Don't upgrade multiple major versions at once — one major version per upgrade cycle.\n- The model tends to skip reading the CHANGELOG — breaking changes hide in minor releases too.\n- Always run the full test suite after upgrading, not just the affected tests.\n- Lock file conflicts after upgrade are expected — re-run the package manager's update (`composer update`, `npm update`, `poetry update`).\n\n## Do NOT\n\n- Do NOT manually edit `composer.lock` or `package-lock.json`.\n- Do NOT upgrade to `dev-*` versions in production branches.\n- Do NOT ignore failing tests after an upgrade — fix or revert.\n",{"name":5,"packs":44,"domain":46,"model_tier":47,"workspaces":48,"description":7},[45],"engineering-base","engineering","medium",[46],"main","12bd765ce1d800501d45dfb8232102793af01290","src\u002Fskills\u002Fdependency-upgrade",1,"https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config","https:\u002F\u002Fevent4u.app","https:\u002F\u002Fgithub.com\u002Fevent4u-app","Your events in your hand","2026-11-14 02:29:41",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add event4u-app\u002Fagent-config --skill dependency-upgrade",{"tool":64,"command":65},"bunx","bunx skills add event4u-app\u002Fagent-config --skill dependency-upgrade",{"tool":67,"command":68},"pnpm","pnpm dlx skills add event4u-app\u002Fagent-config --skill dependency-upgrade","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config\u002Fblob\u002Fmain\u002Fsrc\u002Fskills\u002Fdependency-upgrade\u002FSKILL.md",true,[72],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"evals\u002Ftriggers.json","REFERENCE","参考文档",2679,"https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config\u002Fblob\u002Fmain\u002Fsrc\u002Fskills\u002Fdependency-upgrade\u002Fevals\u002Ftriggers.json",[79,92,104,114,125,134],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":39},"01M6X84PK96XBPENXH66JCTSD1","unknown-key-fixture","Declares a key the schema does not know.","https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config\u002Fblob\u002Fmain\u002Ftests\u002Fscripts\u002Ffixtures\u002Fbody-portable\u002Funknown-key\u002FSKILL.md",[],[86,87,88,89,90,91],"unknown key fixture","Unknown key","fixture","unknown","schema","package",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":39},"01M6X84HW7NAHZ7GZMQ9RXK1XJ","portable-fixture","Declares only semantics the MCP-lite carrier transports whole.","https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config\u002Fblob\u002Fmain\u002Ftests\u002Fscripts\u002Ffixtures\u002Fbody-portable\u002Fportable\u002FSKILL.md",[],[88,99,100,101,102,91,103],"portable","portable fixture","engineer","only","MCP",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":39},"01M6X84F29FE0RGGZ1ZTFGZTX2","non-portable-fixture","Declares a runtime semantic the carrier drops.","https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config\u002Fblob\u002Fmain\u002Ftests\u002Fscripts\u002Ffixtures\u002Fbody-portable\u002Fnon-portable\u002FSKILL.md",[],[100,111,99,88,112,113,25,91],"non portable fixture","semantic","high",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":39},"01M6X848F706PT9MDCX75JKJ6B","candidate-zero-width","A candidate whose prose carries an invisible joiner.","https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-scout-candidates\u002Fzero-width-injection\u002FSKILL.md",[],[121,122,123,124],"candidate zero width","candidate","ZeRO","prose",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":39},"01M6X841SSC2T31VDF41SA6DG1","candidate-disclosure-suppression","A candidate whose prose tells the agent to withhold from the user.","https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-scout-candidates\u002Fdisclosure-suppression\u002FSKILL.md",[],[132,122,124,133],"candidate disclosure suppression","user",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":39},"01M6X83TFS5AGPBPVTQNWP0BB3","candidate-dangerous-frontmatter","A candidate claiming an unscoped tool grant and a permission bypass.","https:\u002F\u002Fgithub.com\u002Fevent4u-app\u002Fagent-config\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskill-scout-candidates\u002Fdangerous-frontmatter\u002FSKILL.md",[],[141,122,142,143,144,145],"candidate dangerous frontmatter","frontmatter","shell","permission","tool"]