AgentSkillsCN

angular-upgrade

采用发现、分阶段执行、兼容性扫描以及PR就绪验证报告的流程,完成Angular工作区的重大版本升级。

SKILL.md
--- frontmatter
name: angular-upgrade
description: Angular workspace major-version upgrade workflow with discovery, staged execution, compatibility scans, and PR-ready verification reporting.
triggers:
  - "upgrade Angular"
  - "migrate Angular app"
  - "run ng update safely"
inputs:
  - "target Angular version (default: latest major)"
  - "mode flag: --dry-run | --execute | --verify-only"
outputs:
  - "discovery, plan, and report artifacts in repo root"
  - "optional package/lockfile updates in execute mode"
safety:
  - "run dry-run first; execute requires clean git tree"
  - "use rollback via git restore/reset on current branch"
commands:
  - "skills/angular-upgrade/scripts/run.sh --dry-run"
  - "skills/angular-upgrade/scripts/run.sh --execute"

When to use / when NOT to use

  • Use when an Angular workspace needs version upgrades and gated verification.
  • Do not use for non-Angular repositories or one-off single-package changes.

Preconditions (tools, versions, repo state)

  • Node + package manager installed (npm, pnpm, or yarn).
  • Angular workspace files available (package.json, ideally angular.json).
  • Clean git working tree before --execute.

Workflow (DISCOVER → PLAN → EXECUTE → VERIFY → REPORT)

  1. DISCOVER: detect package manager, Angular/RxJS/TypeScript/ESLint versions.
  2. PLAN: define major-by-major upgrade path and compatibility hotspots.
  3. EXECUTE (--execute only): run upgrade command (ng update) and install deps.
  4. VERIFY: run lint/test checks (CI-friendly if --ci).
  5. REPORT: summarize findings, outcomes, and rollback guidance.

Exact commands and expected signals

bash
# Discovery + planning only
skills/angular-upgrade/scripts/run.sh --dry-run

# Execute workflow
skills/angular-upgrade/scripts/run.sh --execute --ci

# Re-verify only
skills/angular-upgrade/scripts/run.sh --verify-only --ci

Success: report file generated and verification commands complete with acceptable output. Failure: missing package.json, dirty git tree on execute, or command/tool not found.

If it fails (checklist)

  • Confirm Node and selected package manager are installed.
  • Confirm Angular workspace files exist at repo root.
  • Resolve git dirty state before execute.
  • Run verify-only to isolate lint/test failures.

Final report template

  • Scope: Angular upgrade target and workspace paths.
  • Discovery highlights: versions + compatibility hotspots.
  • Commands run: exact run script mode and key outputs.
  • Verification: lint/test status, CI impact.
  • Next actions: follow-up migrations or manual fixes.
  • Rollback notes: exact git command(s).