update-nuget-packages
Use when updating NuGet package dependencies in a .NET solution or project. Runs test baselines when tests exist, updates every referenced package to the latest version project by project, and validates and repairs the final result.
- License 许可
- GPL-3.0
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- update-nuget-packages
- description
- Use when updating NuGet package dependencies in a .NET solution or project. Runs test baselines when tests exist, updates every referenced package to the latest version project by project, and validates and repairs the final result.
02 资源文件 1
- 脚本update_nuget_packages.sh5.7 KB
03 SKILL.md 正文
Update NuGet Packages
Run skills/update-nuget-packages/update_nuget_packages.sh <target> to perform the entire workflow (baseline, per-project package updates, restore, final validation, and a summary report). Follow the steps below only when the script is unavailable, fails, or the situation requires manual intervention.
Script Usage
skills/update-nuget-packages/update_nuget_packages.sh <target> [--skip-baseline] [--skip-tests] [--dry-run]
<target>: path to a.sln,.slnx, or.csprojfile.--skip-baseline: skip the pre-update test baseline.--skip-tests: skip all test runs (baseline and final validation).--dry-run: list packages that would be updated without changing files.
Exit codes: 0 success; 1 usage error; 2 baseline failed (no changes made); 3 a package update failed and could not be resolved safely; 4 final validation or restore failed.
Pick the target per section 1 below when it is ambiguous, then pass it to the script. If the script exits with 3 or 4, apply the repair guidance in sections 3 and 4, then rerun the script.
1. Discover The Target
- Inspect the repository root for
.sln,.slnx, and.csprojfiles. - If exactly one solution exists, use it as the target and enumerate its projects with
dotnet sln <solution> list. - If no solution exists and exactly one project exists, use that project as the target.
- If multiple solutions or standalone projects make the target ambiguous, ask which target to update; do not guess.
- Exclude generated,
bin, andobjpaths. - Preserve the current working tree. Do not discard unrelated changes.
2. Establish The Test Baseline
- Determine whether tests exist before running tests. Treat a project as a test project when its project file references a test SDK or test framework, or when it contains test source files.
- If tests exist, run
dotnet test <solution-or-project>for the complete target before changing package references. - If the baseline fails, record the command and distinct diagnostics, report that the baseline is failing, and stop. Do not attribute those failures to package updates.
- If no tests exist, explicitly record that the test steps were skipped.
3. Update Every Project
- Process solution projects sequentially, one project at a time. For a single-project target, process only that project.
- Read each project's
.csprojand collect every explicitPackageReferenceIncludevalue. Ignore project references, framework references, and package references excluded by a false condition. - For each collected package ID, run
dotnet add <project> package <package-id>without--version; the default is the latest version available from the configured NuGet sources. - Run each package command from the repository root, preserve the project's existing package source configuration, and wait for success before continuing.
- If a package update fails, capture the diagnostic, repair only the relevant project/configuration issue, and rerun that command. Stop and report if the failure cannot be resolved safely.
- Account for central package management (
Directory.Packages.props) and verify that each command actually changed or confirmed the effective package version; do not duplicate version declarations. - Review the diff after each project and retain intentional project-file and lock-file changes only.
4. Validate And Repair
- After all package updates complete, if tests exist, run
dotnet test <solution-or-project>for the complete target again. - If final tests fail, capture the test output and invoke the LLM to fix the affected production code or tests as appropriate; do not weaken or delete tests merely to make them pass.
- Re-run the complete target test after every LLM fix until it passes or a safe repair is not possible.
- Check the final diff for unintended changes, package downgrades, duplicate references, leaked credentials, and generated artifacts.
- Report the target, projects processed, packages updated, test commands and outcomes, repairs made, and any unresolved blockers.
- Update any relevant documentation files (README.md, SECURITY.md, ARCHITECTURE.md, docs/, or any other project-specific documentation files) to reflect the package version changes.
04 同仓库更多 Skills
ui-design-review
Use when designing, building, reviewing, or repairing user interfaces, or when UI work must be verified before delivery. Covers accessibility, touch and interaction, performance, style selection, layout and responsive behaviour, typography and colour, animation, forms and feedback, navigation, and charts, with a prioritised rule set, a native and mobile pre-delivery checklist, and a browser-driven audit procedure that reports evidence-ranked findings.
release-verification
Use after a release, publication, or deployment to verify the delivered artefact and observe the affected surfaces until the observation window is clean. Covers release identity, surface evidence, finding classification, observation cadence, and partial-verification reporting.
pr-babysit
Use when monitoring a pull request or review cycle until it is ready to merge. Covers check observation, unresolved review threads, verification prior to resolution, and evidence-based completion.
supply-chain-security
Use when assessing software supply chain exposure from dependency manifests, lockfiles, SBOMs, VEX records, licence declarations, package names, or CVE identifiers. Covers dependency and transitive risk, SBOM validation against the NTIA minimum elements in CycloneDX and SPDX, VEX status interpretation, licence compliance, typosquatting and dependency confusion, and CVE triage through CVSS 4.0, EPSS, SSVC 2.1, and the CISA KEV catalogue. Produces a prioritised, SLA-bound remediation assessment.
secure-code-review
Use when performing a security-focused code review of a pull request, diff, file, or module, or when code touching authentication, authorisation, cryptography, input handling, deserialisation, file handling, or logging requires verification. Performs a structured review against OWASP ASVS 4.0.3 requirements and the CWE Top 25 (2024), producing findings mapped to ASVS controls and CWE identifiers with severity ratings and specific remediation guidance.
secrets-management
Use when examining secret handling, credential exposure, vault or cloud secrets manager integration, environment-file hygiene, rotation policy, or credential access for agents and CI/CD pipelines. Performs a structured secrets management assessment against the OWASP Secrets Management Cheat Sheet and NIST SP 800-57 Part 1 Rev 5, covering detection tooling, exposure routes, rotation automation, and centralised storage, without ever reproducing a secret value.