# dep-upgrader

`dep-upgrader` is a polyglot Agent Skill and executable Bash TUI maintenance suite for mixed Next.js/pnpm and .NET/Avalonia workspaces.

## Highlights

- discovers Node, Next.js, .NET, NuGet, and Avalonia projects;
- migrates npm workspaces to pnpm;
- enforces a seven-day dependency minimum age for every Node workspace;
- deletes discovered `.next` and `node_modules` directories before reinstalling;
- updates npm and NuGet dependencies with capability detection and fallbacks;
- audits, hardens, deduplicates, consolidates, builds, tests, and formats projects;
- integrates Syncpack, Knip, Dependency Cruiser, OSV-Scanner, Trivy, Publint, ATTW, Changesets, JSCPD, Renovate, and Stryker.NET;
- generates reports, backups, previews, and rollback instructions;
- analyzes configuration and reusable Next.js/Avalonia UI candidates without blindly moving files.

## Run

```bash
chmod +x scripts/dep-upgrader.sh
./scripts/dep-upgrader.sh --root /path/to/workspace
```

Preview the complete pipeline:

```bash
./scripts/dep-upgrader.sh \
  --root /path/to/workspace \
  --non-interactive \
  --module all \
  --mode semver-safe \
  --quality-profile full \
  --dry-run
```

Apply dependency changes non-interactively:

```bash
./scripts/dep-upgrader.sh \
  --root /path/to/workspace \
  --non-interactive \
  --module deps \
  --mode latest \
  --audit report \
  --harden strict \
  --yes
```

## Prerequisites

- Bash 4.3 or newer
- Node.js
- pnpm, Corepack, or npm for local pnpm bootstrap
- optional .NET SDK for .NET and Avalonia projects
- optional OSV-Scanner and Trivy for native deep security scans

Target-workspace reports, backups, and optional tools are stored under `.maintenance`. The runner does not install global tools.

## Validation

```bash
bash scripts/smoke-test.sh
```

The regression test verifies Bash syntax, `.next` and `node_modules` cleanup, npm-to-pnpm migration, the seven-day release-age policy, non-recursive `pnpm dlx` usage, backup creation, dry-run behavior, Renovate generation, and Changesets generation.
