Agent skill
typescript-nodenext-apps-maintenance
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/typescript-nodenext-apps-maintenance
SKILL.md
name: nodenext-apps
description: "Audit and repair TypeScript relative import specifiers for NodeNext/Node16 projects by enforcing runtime-valid emitted extensions (.js, .mjs, .cjs). Use when module or moduleResolution is nodenext|node16, when Node ESM/CJS runs fail with extension-related import errors, or when standardizing import specifiers across src and test files."
NodeNext Apps Maintenance
Scope and outcome
Use this skill to detect NodeNext/Node16 TypeScript projects, audit relative imports, and apply safe, deterministic fixes so compiled runtime imports are valid in Node.
Success criteria:
- Project is confirmed to use NodeNext or Node16 semantics.
- Relative imports in compiled TypeScript source use emitted-file extensions.
- Package/bare imports remain unchanged.
- Audit exits cleanly after fixes.
Detection gate (required)
- Inspect
tsconfig.jsonand any build/test tsconfig files (for exampletsconfig.build.json,tsconfig.spec.json). - Continue only if one of these is true:
compilerOptions.moduleisnodenextornode16compilerOptions.moduleResolutionisnodenextornode16
- If neither condition is met, stop and report: this skill is not applicable.
Import rules to enforce
Apply only to relative specifiers in .ts, .tsx, .mts, .cts files:
- Preserve bare/package imports (for example
@nestjs/core,node:fs,undici). - Keep non-relative aliases unchanged (for example TS path aliases like
@app/*). - Rewrite relative specifiers to emitted extensions:
.tsand.tsxtargets ->.js.mtstargets ->.mjs.ctstargets ->.cjs- Extensionless relative imports -> emitted extension based on importing file type.
- Use forward slashes in import specifiers.
Examples:
from './service.js'import '../lib/index.mjs'export * from './adapter.cjs'
Deterministic workflow
- Run audit mode first.
- Review findings and confirm only relative specifiers are targeted.
- Run fix mode.
- Re-run audit mode; require zero findings.
- Run project verification commands (build/tests) and report results.
Commands
Run from repository root:
node skills/typescript/typescript-nodenext-apps-maintenance/scripts/nodenext-audit-imports.js
Fix mode:
node skills/typescript/typescript-nodenext-apps-maintenance/scripts/nodenext-audit-imports.js --fix
Target multiple directories:
node skills/typescript/typescript-nodenext-apps-maintenance/scripts/nodenext-audit-imports.js --dir=src --dir=test --fix
Verification and reporting
- Audit mode must return exit code
1when issues exist; after fixes it should return0. - If build or tests fail after fixes, report failing command and first actionable error.
- If ambiguous imports cannot be safely rewritten, leave them unchanged and report exact file paths.
Reference usage
Use reference.md for Node/TypeScript behavior details and edge cases before applying non-trivial rewrites.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?