agentsclimarketplace

Agent js to ts migration

Skill Nika-HISK/agent-js-to-ts-migration

JavaScript to TypeScript migration best practices for developers converting existing JS codebases. This skill should be used when renaming .js files to .ts, adding type annotations, fixing TypeScript compiler errors, enabling strict mode, converting CommonJS to ESM, typing async code, writing type guards, or setting up the TypeScript toolchain.From its SKILL.md

Install
npx -y skills add Nika-HISK/agent-js-to-ts-migration

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.6 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

JavaScript to TypeScript Migration

Comprehensive migration guide for converting JavaScript codebases to TypeScript. Contains 34 rules across 10 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Setting up TypeScript in an existing JavaScript project
  • Renaming .js files to .ts and fixing resulting errors
  • Adding type annotations to functions, classes, and objects
  • Enabling and incrementally fixing strict mode
  • Converting require() / module.exports to ES Module import/export
  • Typing Promise return values and async error handling
  • Writing type guards for API responses and external data
  • Installing @types packages or writing declaration files
  • Reviewing migrated code for remaining any types or type holes

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Setup & ConfigurationCRITICALsetup-
2Type AnnotationsCRITICALtypes-
3Conversion PatternsHIGHconvert-
4Strict ModeHIGHstrict-
5Module SystemHIGHmodules-
6Classes & InterfacesMEDIUM-HIGHclasses-
7Async & PromisesMEDIUM-HIGHasync-
8GenericsMEDIUMgenerics-
9Type Guards & NarrowingMEDIUMguards-
10Third-party TypesLOW-MEDIUMlibs-

Quick Reference

1. Setup & Configuration (CRITICAL)

  • setup-tsconfig-base - Start with a migration-ready tsconfig, not a minimal one
  • setup-incremental-migration - Migrate file-by-file using allowJs, not all at once
  • setup-toolchain - Use tsx, tsc, and proper build scripts consistently
  • setup-eslint-typescript - Configure typescript-eslint to catch migration anti-patterns

2. Type Annotations (CRITICAL)

  • types-avoid-any - Replace any with proper types or unknown at boundaries
  • types-explicit-return-types - Always annotate function return types
  • types-object-shapes - Define interfaces and type aliases for every object shape
  • types-array-typing - Type arrays, Maps, Sets, and tuples explicitly

3. Conversion Patterns (HIGH)

  • convert-require-to-import - Replace CommonJS require with ESM import/export
  • convert-prototypes-to-classes - Convert prototype-based code to typed classes
  • convert-callbacks-to-typed-async - Replace callbacks with typed async/await
  • convert-dynamic-objects - Type dynamic object dictionaries with Record<K,V> or Map

4. Strict Mode (HIGH)

  • strict-enable-strict - Enable strict mode incrementally per file, not globally
  • strict-null-checks - Handle null and undefined explicitly with strictNullChecks
  • strict-no-implicit-any - Fix noImplicitAny errors with real types, not suppressions
  • strict-property-initialization - Ensure class properties are initialized properly

5. Module System (HIGH)

  • modules-esm-imports - Use consistent ESM import/export syntax throughout
  • modules-barrel-files - Type barrel index files with explicit named exports
  • modules-path-aliases - Configure path aliases to eliminate deep relative imports

6. Classes & Interfaces (MEDIUM-HIGH)

  • classes-use-interfaces - Define interfaces to decouple consumers from implementations
  • classes-access-modifiers - Use private/readonly/protected to enforce encapsulation
  • classes-abstract-base - Use abstract classes for shared typed behavior

7. Async & Promises (MEDIUM-HIGH)

  • async-type-promises - Always annotate Promise<T> return types on async functions
  • async-error-types - Narrow caught errors before use — don't cast to any
  • async-generics-in-async - Write generic async utilities without losing type safety

8. Generics (MEDIUM)

  • generics-reusable-functions - Make utility functions generic instead of using any
  • generics-constrained-generics - Use extends to constrain type parameters
  • generics-utility-types - Use Partial, Pick, Omit, Record instead of redefining types

9. Type Guards & Narrowing (MEDIUM)

  • guards-custom-type-guards - Write type predicates for unknown/union narrowing
  • guards-discriminated-unions - Model multi-state values as discriminated unions
  • guards-assertion-functions - Use assertion functions to enforce invariants

10. Third-party Types (LOW-MEDIUM)

  • libs-install-types - Install @types packages for every untyped dependency
  • libs-declaration-files - Write .d.ts ambient declarations for untyped libraries
  • libs-module-augmentation - Augment existing types to add runtime-added properties

How to Use

Read individual rule files for detailed explanations and before/after code examples:

rules/setup-tsconfig-base.md
rules/types-avoid-any.md
rules/convert-require-to-import.md
rules/_sections.md

Each rule file contains:

  • The rule name and impact level
  • Explanation of why it matters during migration
  • Incorrect JavaScript or poorly-typed TypeScript example
  • Correct TypeScript example with full types
  • Reference link to official documentation

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Installation

npx skills add yourusername/agent-js-to-ts-migration

What ships with it: 40 files

79.2 KB alongside SKILL.md, 1 of them executable

scripts/

Keep looking

Skills are one crate of 326,499. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.