skills/c8y-client-migration-analysis/SKILL.md
# Skill: @c8y/client Migration Analysis Methodology ## Purpose This skill describes the **correct, step-by-step process** for auditing a Cumulocity Angular codebase when preparing a Web SDK version upgrade. Following this order avoids incorrect assumptions, wasted searches, and inaccurate effort estimates. --- ## Step 1 — Read the Breaking Changelogs First **Always start here before touching any source code.** Read both skill files in full before analyzing the codebase: 1. `skills/c8y-cli
npx skillsauth add cumulocity-iot/cumulocity-skills skills/c8y-client-migration-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill describes the correct, step-by-step process for auditing a Cumulocity Angular codebase when preparing a Web SDK version upgrade. Following this order avoids incorrect assumptions, wasted searches, and inaccurate effort estimates.
Always start here before touching any source code.
Read both skill files in full before analyzing the codebase:
skills/c8y-client-breaking-changelog/SKILL.md — REST API behavioural changes (e.g. default parameter changes, removed fields, enforced constraints)skills/websdk-breaking-changelog/SKILL.md — Web SDK / @c8y/ngx-components breaking changes (renamed imports, removed modules, Angular version changes)skills/websdk-1023-upgrade/SKILL.md)Why first? Default values, endpoint behaviour, and response shapes change between versions. If you read the source code before knowing the changelog, you will misread what the current code intends vs what it produces. For example:
MeasurementService.list({ pageSize: 1 })withoutrevertreturns the oldest measurement in SDK 1021 but the newest in SDK 1023 — the code looks identical in both cases but behaves differently. Reading the changelog first prevents misdiagnosing this as a bug that needs a fix when it is actually a fix the upgrade itself delivers.
Find every file in the codebase that imports a @c8y/client service class. Do not search for method call strings (e.g. inventoryService.list) — this is fragile and misses aliased instances. Instead, search for import statements.
Run separate searches for each service class name in import statements:
query: "from '@c8y/client'" (broad — then filter by what is destructured)
Or search per service:
InventoryService|InventoryBinaryService|MeasurementService|OperationService|AlarmService|EventService|UserService|UserGroupService|ApplicationService|IdentityService|TenantService|TenantOptionsService|FetchClient
Restrict to src/**/*.ts (exclude node_modules).
For each service, note every file that imports it. This is your audit scope. Mark files where the service is injected in the constructor vs only type-imported — only constructor injections lead to actual HTTP calls.
For each file in the import map, read the source and record:
| Column | What to capture |
|--------|----------------|
| Method | The exact method called (e.g. list, detail, create, update, delete) |
| Filter/params | The exact filter object or arguments passed |
| REST endpoint | Derived from skills/c8y-client-api/SKILL.md |
| Downstream usage | What properties of the response are accessed — critical for determining whether a default-change breaking change actually bites |
Key check at this step: For every
InventoryService.list()andInventoryService.detail()call, note whetherchildDevices,childAssets, orchildAdditionsare accessed on the result. Only those calls needwithChildren: trueexplicitly after the Sept 2025 breaking change.
If a service is injected but no methods are called in a file (common after refactoring), mark it as a dead import — it is a cleanup item, not a migration risk.
Go through each breaking change entry from Step 1 and ask:
Common mistake: Assuming the pre-upgrade default is the "correct" or "intended" behaviour. Always verify by reading the changelog entry carefully. A code pattern that looks buggy under the old default may be intentionally auto-fixed by the new default, or vice versa.
For each entry, one of four outcomes applies:
| Outcome | Meaning | |---------|---------| | Not applicable | The service/method is not imported in this codebase at all | | ✅ OK | Method is used, but the specific change (field, param, default) doesn't affect the actual call or downstream usage | | ⚠️ INFO | Method is used and behaviour changes, but the change is benign or auto-beneficial — document it, no code fix required | | 🔴 Action required | Method is used, behaviour changes, and existing code will break or silently regress — estimate and schedule a fix |
Do not mark a call as ✅ OK without stating why. Common reasons:
detail() call is ✅ OK for withChildren change → because the code only accesses non-child fragments on the result (c8y_Firmware, c8y_IsBinary, etc.)list() call is ✅ OK for text restriction → because the filter uses fragmentType/type/query, not textAlways name the specific rationale, so it can be reviewed later.
Structure the findings as:
Expected = (O + 4M + P) / 6 where O = optimistic, M = most likely, P = pessimistic (all in hours).
| Pitfall | Correct approach |
|---------|-----------------|
| Searching for inventoryService.list( to find call sites | Search for import ... InventoryService instead — then read the files |
| Assuming a default value is stable across versions | Read the breaking changelog entry; defaults do change |
| Marking detail() calls as needing withChildren:true across the board | Only add withChildren:true if child refs (childDevices, childAssets, childAdditions) are accessed downstream |
| Treating a pre-existing bug as something the upgrade breaks | Distinguish: (a) code is currently broken and upgrade fixes it, (b) code works currently and upgrade breaks it |
| Claiming a breaking change has no impact without searching | Always search for the affected service/property name before concluding "not applicable" |
| Writing the audit before reading all changelog entries | Read changelog first (Step 1), then audit — never in parallel |
tools
Scaffold a new Cumulocity application using the @c8y/websdk Angular schematic without human interaction. Covers Angular CLI installation, app generation, schematic setup, AI tools configuration, dev server, and build commands. Triggers: new app, scaffold, create application, ng add websdk, setup cumulocity app, new cumulocity project.
tools
Step-by-step guide to migrate a Cumulocity Web SDK application to a target version. Detects breaking changes with the ui-breaking-changes-cli, scaffolds a reference app at the target version with the new-app skill, compares key configuration files (app.ts, bootstrap.ts, angular.json, etc.), and finishes with a code-quality-analysis review. Triggers: migrate app, upgrade version, breaking changes, sdk upgrade, migrate cumulocity, upgrade websdk.
development
Complete guide to internationalizing a Cumulocity Web SDK application. Covers all approaches to annotating and translating text (gettext, translate pipe, translate directive, TranslateService), extracting strings, creating and updating .po files, overriding existing translations, and adding brand-new languages. Triggers: i18n, internationalization, add language, translate, translation, localization, l10n, new language, po file, gettext, TranslateService, language switcher.
development
Analyze Angular / Cumulocity Web SDK code for anti-patterns, bugs, and quality issues. Use when reviewing components, services, or modules for code quality, maintainability, performance, and correctness. Covers TypeScript best practices, Angular idioms, C8Y SDK usage patterns, and project-specific conventions. Triggers: code review, anti-pattern, quality check, refactor suggestion, style guide, bug analysis.