migrate-codeceptjs-4
Installation
SKILL.md
Migrate CodeceptJS 3.x → 4.x
CodeceptJS 4 is ESM-only and TypeScript-first. There is no compatibility shim for CommonJS — every helper, page object, custom step, and config file must be ESM. This skill drives a project through the upgrade end-to-end.
The authoritative reference is node_modules/codeceptjs/docs/migration-4.md (after npm install codeceptjs@4). Read it once; this skill orchestrates the work and surfaces the parts agents miss.
When to trigger
Detect before acting. Look for any of:
package.jsonlists"codeceptjs": "^3"/"3.x", or has no"type": "module".- Tests, page objects, helpers, or config use
require()/module.exportsagainst CodeceptJS. - Config still references removed helpers (
Nightmare,Protractor,TestCafe,AI,SoftExpectHelper,Mochawesome) or removed plugins (autoLogin,tryTo,retryTo,eachElement,commentStep,fakerTransform,enhancedRetryFailedStep,allure,htmlReporter,wdio,selenoid,screenshotOnFail,pauseOnFail,stepByStepReport). - 3.x APIs:
ai.request, Joi schemas inseeResponseMatchesJsonSchema,restart: 'browser',I.retry(),I.limitTime(), PlaywrightcustomLocators,I.softExpect*/I.flushSoftAssertions. --reporter mochawesomein scripts/CI, ormochawesomeinpackage.json/mocha.reporterOptions.
If none of these hint at 3.x, the project is likely on 4.x already — hand back to codeceptjs-fundamentals.