Skip to content

Migrate a Project to the nexload Way

Use this page when a whole legacy project must move to the nexload-way doctrine in one pass. Existing projects are never migrated implicitly: installing @nexload-sdk/eslint-config does nothing to the doctrine until you set doctrine: true, and this prompt is the explicit opt-in. Paste the prompt below into your coding agent (Claude Code, Codex, Cursor, Copilot, opencode, Pi).

Migrate this whole project to the nexload way in one pass. Follow the steps in order. Make one commit per step.
1. Run `pnpm add -D @nexload-sdk/eslint-config`. In the ESLint config, enable `nexloadConfig({ ..., doctrine: true })`.
2. Run `npx skills add gecut/nexload-sdk --skill nexload-way`. Then paste the text between the markers (not the markers) into the project's AGENTS.md:
--- AGENTS.md block start ---
## Code conventions — MANDATORY
Load the installed `nexload-way` skill before you create, name, move or split a file, module, component or helper, or extract repeated code. Open only the reference its index names.
- File name: `[_]<what>.<role>[.server|.client].<ext>`; `<what>` never repeats the folder name. No `export default` outside framework-mandated files. Branch on unions with `match().exhaustive()`, not `switch`.
- Lint and check messages start with a rule ID (for example `[ST-06]`). Fix the code; never suppress the rule.
- Before reporting done, run `pnpm lint` and `pnpm exec nexload-doctrine verify`. Report any check that did not run as not run.
Install: `npx skills add gecut/nexload-sdk --skill nexload-way` (also at `node_modules/@nexload-sdk/eslint-config/skills/nexload-way/`).
--- AGENTS.md block end ---
Optionally create path-scoped adapters `.cursor/rules/nexload-way.mdc` and `.claude/rules/nexload-way.md` (paths: `src/**`) from the same block text.
3. Run `enola --generate`, then `enola baseline pin`. Note the current commit as <start-commit>.
4. Build a mapping table `current path -> new path -> export symbol`. Use `pnpm exec nexload-doctrine suggest <path> --kind <role>` for each file. Show the table and WAIT for my approval before moving anything.
5. Move files into `src/modules/<feature>/` and `src/shared/{ui,lib}/`. Update every import in the same commit (ST-06).
6. Convert `export default` to named exports. Leave framework mounts as `export { X as default } from "@/modules/..."` (ST-03). Convert `switch` over unions to `match().exhaustive()`; install `ts-pattern` first with `pnpm add ts-pattern`.
7. Extract repeated code per CD-08.
8. Run `pnpm lint`, `pnpm exec nexload-doctrine verify --base <start-commit>`, the test suite and `enola check`. Report every check that printed "not run".
9. Confirm each step is its own commit.
Constraints: no behavior change, no rule suppression. Ask me when a file's role is unclear.
  • pnpm exec nexload-doctrine names <path...> checks file names. suggest <path> --kind <role> prints the correct file name and export symbol. verify [--base <ref>] runs ESLint, the name check and enola check on the whole repository (ESLint and the name check cover changed files only), and prints <tool>: not run (<reason>) for any tool that is missing. An installed ESLint that crashes prints eslint: failed (eslint exit <n>) and fails verify.
  • Without a local install, run node node_modules/@nexload-sdk/eslint-config/skills/nexload-way/scripts/doctrine.mjs verify.
  • See Agent usage for eslint-config for the AGENTS.md block and CLI details, and File & Directory Structure for the role table.