angular-version-upgrade
Use this skill when the user asks to "upgrade Angular", "update Angular version", "ng update", "migrate Angular X to Y", "update dependencies", or when performing any Angular major version upgrade. Provides the complete methodology for safely upgrading Angular through multiple major versions, including dependency ordering, third-party library compatibility, and build verification protocols. Encodes RULE 6 (duplicate selectors) and RULE 8 (ng update schematics).
SKILL.md
| Name | angular-version-upgrade |
| Description | Use this skill when the user asks to "upgrade Angular", "update Angular version", "ng update", "migrate Angular X to Y", "update dependencies", or when performing any Angular major version upgrade. Provides the complete methodology for safely upgrading Angular through multiple major versions, including dependency ordering, third-party library compatibility, and build verification protocols. Encodes RULE 6 (duplicate selectors) and RULE 8 (ng update schematics). |
name: Angular Version Upgrade description: Use this skill when the user asks to "upgrade Angular", "update Angular version", "ng update", "migrate Angular X to Y", "update dependencies", or when performing any Angular major version upgrade. Provides the complete methodology for safely upgrading Angular through multiple major versions, including dependency ordering, third-party library compatibility, and build verification protocols. Encodes RULE 6 (duplicate selectors) and RULE 8 (ng update schematics). version: 1.0.0
Angular Version Upgrade
Purpose
Guide Angular major version upgrades through a safe, incremental process that avoids the common pitfalls discovered during real upgrades. This skill encodes the methodology for upgrading through 12+ major versions with minimal rework.
Core Principles
- One major version at a time — Never skip versions. Run
ng updatefor each major version sequentially. - Build verification after every bump —
yarn build:devmust succeed before proceeding. - Never skip ng update schematics (RULE 8) — Schematics handle hundreds of mechanical changes. Skipping them caused 243 components to break silently.
- Scan for monorepo collisions (RULE 6) — Duplicate component selectors across apps cause NG0912 errors in Angular 19+.
Pre-Upgrade Checklist
Before starting any version upgrade:
- Clean git state — Commit or stash all changes
- Run
list_projects— Understand workspace structure, identify all apps - Run
get_best_practices— Get version-specific standards for the TARGET version - Create baseline tests — See
angular-upgrade-testingskill - Audit for duplicate selectors (RULE 6):
# Find all component selectors across both apps grep -r "selector:" --include="*.ts" src/ projects/ | grep -oP "'[^']+'" | sort | uniq -d
Upgrade Protocol
Step 1: Run ng update with schematics (RULE 8)
npx ng update @angular/core@{TARGET} @angular/cli@{TARGET}
CRITICAL: Let schematics run. They handle:
- TypeScript compatibility updates
- API deprecation replacements
- Module system changes (e.g.,
standalone: falsein Angular 19) - Import path updates
If schematics fail, read the error and fix the specific issue — do NOT bypass with --force.
Step 2: Update third-party libraries
Consult references/dependency-upgrade-order.md for the correct order. Key rule: update Angular packages first, then third-party libraries that depend on Angular.
Step 3: Build verification
yarn build:dev # Build ALL apps in the monorepo
yarn lint # Check for linting errors
yarn test # Run test suite
All three must pass before proceeding to the next version.
Step 4: Commit
git commit -m "Upgrade Angular {FROM} → {TO}"
Step 5: Repeat for next version
Critical Version Checkpoints
Consult references/version-compatibility-matrix.md for full details.
| Version | Critical Change | Action Required |
|---|---|---|
| 12 | TSLint removed | Migrate to ESLint before upgrading past 12 |
| 16 | ngcc removed | ALL libraries must be Ivy-compatible. Rebuild local .tgz packages |
| 17 | Node 20 required | nvm use 20 before upgrading |
| 17 | New control flow | Optional: ng generate @angular/core:control-flow |
| 19 | Standalone default | Schematics add standalone: false to module-based components |
| 19 | Stable Signals | Optional: ng generate @angular/core:signals for bulk migration |
Monorepo Collision Protocol (RULE 6)
Before upgrading to Angular 19+:
-
Find duplicate selectors:
grep -rh "selector:" --include="*.ts" src/app projects/penalty-inform/src | \ grep -oP "'[a-z][-a-z0-9]*'" | sort | uniq -d -
For each duplicate: Convert to standalone component in a shared location, import from single source.
-
Verify DI: Standalone components may need explicit providers:
@Component({ standalone: true, imports: [CommonModule], providers: [SomeService] // If needed })
Local Package Strategy
For local .tgz packages (soft-ngx, trunks-ui):
Before Angular 16 (ngcc removal)
- Obtain source code
- Rebuild with
partialcompilation mode - OR migrate functionality into the monorepo
Recommended: Monorepo Migration
Instead of maintaining separate .tgz files:
- Create
projects/soft-ngx/directory - Move source code into monorepo
- Update path aliases in tsconfig.json
- Remove .tgz from dependencies
Escalation: When ng update Fails
- Read the full error message
- Check
references/breaking-changes-catalog.mdfor known issues - Search Angular docs:
mcp__angular-cli__search_documentation - Try
--forceflag ONLY after understanding what it skips - If a peer dependency blocks the upgrade, update that dependency first
References
references/version-compatibility-matrix.md— Angular/Node/TS/RxJS version matrixreferences/dependency-upgrade-order.md— Correct order for updating dependenciesreferences/breaking-changes-catalog.md— Known breaking changes by version