Agent skill

Convert Internal Package to TypeScript

by TryGhost in TryGhost/Ghost

Moves a legacy internal Ghost package from JavaScript and CommonJS to TypeScript and ESM in three focused commits that keep git file history intact.

MITAuto-check passedDevelopment

Install Convert Internal Package to TypeScript

skills CLI
$ npx skills add TryGhost/Ghost --skill convert-internal-package-to-typescript -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TryGhost/Ghost convert-internal-package-to-typescript --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TryGhost/Ghost.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/convert-internal-package-to-typescript .claude/skills/convert-internal-package-to-typescript && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
convert-internal-package-to-typescript
GitHub stars
55k
Token cost
~1.2k tokens
SKILL.md length
625 words
Files
2 (incl. references)
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Moves a legacy internal Ghost package from JavaScript and CommonJS to TypeScript and ESM in three focused commits that keep git file history intact.

  • Works in 3 steps: Move sources from lib to src → Change file extensions to TypeScript → Convert the implementation to TypeScript…
  • Modernizing a private package in the Ghost monorepo from JavaScript to TypeScript
  • SKILL.md covers Confirm this workflow applies, Preserve lineage with three…, Hold the conversion to… and Verify the result
  • Calls git

What it does

This skill keeps mechanical moves apart from meaningful changes. Before editing, the agent reads `packages/README.md`, finds every import, require, export, runtime asset and path reference, inspects build, test and archive configuration, runs the package's tests for a baseline, and identifies consumers that cannot load ESM output. It stops if the package has an active independent release or a third-party support contract.

The work then lands as three commits, each valid on its own, with rename detection checked after each. First, `git mv` the sources from `lib` to `src`, touching only references that must change. Second, `git mv` the `.js` files to `.ts` with only the minimum config to parse. Third, convert the implementation to TypeScript and ESM under the package contract in `packages/README.md`. A reference file covers history and verification; the excerpt is cut off during the third step.

When your agent uses it

  • Modernizing a private package in the Ghost monorepo from JavaScript to TypeScript
  • Converting a CommonJS internal package to ESM without losing git history
  • Planning commit boundaries for a lib-to-src and JS-to-TS migration

Example prompts

  • “Convert the internal members-events package to TypeScript following the golden path.”
  • “Move packages/mail-queue from lib to src with git mv and keep history readable.”
  • “Check which consumers of this internal package would break if it only shipped ESM.”

Requirements

  • A checkout of the Ghost repository with `packages/README.md`
  • Git

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Move sources from lib to src
  2. Change file extensions to TypeScript
  3. Convert the implementation to TypeScript and ESM

What it can do on your machine

Read from SKILL.md and the folder at commit 7aecaf7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Convert Internal Package to TypeScript loads about 1.2k tokens when it runs, and up to ~2k if it reads all its reference files. Until then it costs about 100 tokens; SKILL.md has 625 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TryGhost/Ghost at commit 7aecaf7, republished under its MIT licence (© TryGhost). 625 words, ~1,247 tokens.

Download SKILL.mdSave it as .claude/skills/convert-internal-package-to-typescript/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
convert-internal-package-to-typescript
description
Convert a legacy internal Ghost workspace package from JavaScript or CommonJS to the repository's TypeScript and ESM golden path while preserving file history and runtime compatibility. Use when modernizing an existing or newly migrated private package, including staged lib-to-src moves, JS-to-TS renames, consumer analysis, and package or archive verification.

Convert an internal package to TypeScript

Modernize an internal package without mixing mechanical moves with semantic changes or obscuring file history. Treat packages/README.md as the authority for the package's lifetime architecture; this skill owns only the conversion workflow.

Confirm this workflow applies

Read packages/README.md completely, then inspect the package, its consumers, and comparable current packages. Confirm that the package is internal-only and can adopt the documented single-build TypeScript and ESM contract.

Before editing:

  1. Find every import, require(), export, runtime asset and path reference.
  2. Inspect package metadata, build and test configuration, release/archive inclusion, and any dynamic module loading.
  3. Run the package's existing tests and representative consumer checks to establish a baseline.
  4. Identify supported consumers that cannot load the golden-path ESM output.

If the package has an active independent release or third-party support contract, or requires a format that conflicts with the golden path, stop and establish its support contract instead of applying this workflow mechanically. Deprecated historical npm versions do not by themselves block conversion.

Read references/history-and-verification.md completely before planning the commits.

Preserve lineage with three focused commits

Keep each commit independently valid and verify rename detection before moving on. Avoid formatting or opportunistic cleanup in the mechanical commits.

1. Move sources from lib to src

Use git mv to move the source tree. Update only references that must change for the new path, such as test imports, build inputs and package metadata. Do not change module syntax, file extensions or implementation in this commit.

Use the subject Moved <package> sources from lib to src when that accurately describes the change.

2. Change file extensions to TypeScript

Use git mv for .js to .ts renames. Add only the minimum configuration and syntax adjustments needed for the renamed sources to parse and for this commit to remain coherent. Preserve behavior and defer meaningful typing and ESM conversion to the next commit.

Use the subject Changed <package> file extensions to TypeScript.

3. Convert the implementation to TypeScript and ESM

Apply the package contract from packages/README.md: shared config packages, minimal package-local config, ESM metadata and exports, standard scripts, and a single compiled output unless a verified consumer requires an exception. Replace the package's migration status with ghostPackage.goldenPath: compliant only after every mechanical golden-path check passes.

Use the subject Converted <package> to TypeScript.

Show full SKILL.md (243 more words)Show less

Hold the conversion to production standards

  • Model real input, output and registry shapes; do not replace missing types with any.
  • Use unknown only at genuine untrusted boundaries and narrow it promptly.
  • Do not use broad casts, non-null assertions, @ts-ignore, or lint disables merely to silence the compiler.
  • Preserve the package's runtime API unless an API change is explicitly in scope and all consumers are updated.
  • Use explicit .ts extensions for relative TypeScript imports under the repository's NodeNext configuration.
  • Replace dynamic CommonJS discovery with explicit typed registries when ESM cannot express the old loading pattern safely.
  • Ensure JSON and other runtime assets are emitted and available from build/.
  • Avoid top-level await so supported CommonJS consumers can use Node's require(esm) interoperability.
  • Do not weaken shared TypeScript, ESLint or Vitest rules to make the conversion pass.

Verify the result

Run the build, tests and lint commands required by packages/README.md. Also:

  • exercise representative consumers using their real import or require() path;
  • test raw source resolution and compiled output where both are used;
  • inspect the packed package or Ghost release component when exports, runtime assets or archive inclusion changed;
  • run the repository build when the workspace build graph changed;
  • run git diff --summary for each mechanical commit and git log --follow on representative files to confirm the lineage remains readable.

The modernization PR may be rebase-merged when these commits are independently valid and intentionally ordered. This does not change the merge-commit requirement for a preceding subtree history import.

© TryGhost, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/convert-internal-package-to-typescript of TryGhost/Ghost.

  • SKILL.md
  • references/history-and-verification.md

Open the folder on GitHubat commit 7aecaf7

Compare with similar skills

Convert Internal Package to TypeScript next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Convert Internal Package to TypeScript compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Convert Internal Package to TypeScript this skillTryGhost/Ghost55k—~1.2kAutomated safety check: PassMIT
jscpd Code Migration Trackerkucherenko/jscpd6.3k—~5kAutomated safety check: PassMIT
Markbind Typescript MigrationMarkBind/markbind158—~2kAutomated safety check: PassMIT
Check npmgrafana/skills278—~1.3kAutomated safety check: WarnApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Skyvern Version BumpSkyvern-AI/skyvern23k—~1kAutomated safety check: NotesAGPL-3.0

Similar skills

  • Measures a code port between languages or frameworks with jscpd's function-level comparison, porting tests before code and tracking what is left unmatched.

    6.3k GitHub stars~5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Complete guide for migrating JavaScript files to TypeScript in the MarkBind project, including the two-commit strategy, import/export syntax conversion, and best practices.

    158 GitHub stars~2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Check npm

    grafana/skills

    Official

    Audit a JavaScript/TypeScript repo's npm, yarn, or pnpm configuration for supply-chain hardening: tool version, lifecycle scripts, unsafe dependency protocols, and minimum release age ≥3 days.

    278 GitHub stars~1.3k tokensUpdated yesterday
    DevOps & CloudAuto-check: warnings
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Skyvern Version Bump

    Skyvern-AI/skyvern

    Walks through a Skyvern open-source release bump: update the version, rebuild the Python and TypeScript SDKs with Fern, commit, and open a pull request.

    23k GitHub stars~1k tokensUpdated today
    DevelopmentAuto-check: notes
  • ast-grep Codemod Reference

    warp-drive-data/warp-drive

    Reference for writing and debugging TypeScript and JavaScript codemods with @ast-grep/napi: parsing, node queries, meta-variables, rule objects and editing.

    3.2k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed

More from TryGhost/Ghost

  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    55k GitHub stars~3.8k tokensUpdated today
    Auto-check passed
  • Adds a private developer-experiments feature flag to Ghost, covering the backend registration, the Labs settings toggle and the test snapshot updates.

    55k GitHub stars~486 tokensUpdated today
    Auto-check passed
  • Guidance for running the Tinybird tb CLI: choosing local, branch or cloud workflows, building and deploying, loading data, handling tokens and secrets, and CI/CD.

    55k GitHub stars~388 tokensUpdated today
    Auto-check passed
  • Ghost Commit Workflow

    TryGhost/Ghost

    Guides the agent through making a focused git commit in the Ghost repository: inspect state, stage only relevant files, follow the contributing rules, then verify.

    55k GitHub stars~286 tokensUpdated today
    Auto-check passed
  • Rules for writing Tinybird datasources, pipes, endpoints and materialized views, with SQL constraints, optimization habits and deduplication patterns.

    55k GitHub stars~417 tokensUpdated today
    Auto-check passed
  • Admin7 Feature Flags

    TryGhost/Ghost

    Add, consume, review, or remove Admin 7 milestone flags using Ghost's existing Labs conventions.

    55k GitHub stars~169 tokensUpdated today
    Auto-check passed

Categories

Questions about Convert Internal Package to TypeScript

What does Convert Internal Package to TypeScript do?

Moves a legacy internal Ghost package from JavaScript and CommonJS to TypeScript and ESM in three focused commits that keep git file history intact. This skill keeps mechanical moves apart from meaningful changes.md`, finds every import, require, export, runtime asset and path reference, inspects build, test and archive configuration, runs the package's tests for a baseline, and identifies consumers that cannot load ESM output.

When should I use Convert Internal Package to TypeScript?

Convert Internal Package to TypeScript fits situations like: modernizing a private package in the Ghost monorepo from JavaScript to TypeScript; converting a CommonJS internal package to ESM without losing git history; planning commit boundaries for a lib-to-src and JS-to-TS migration.

How do I install Convert Internal Package to TypeScript in Claude Code?

Run `npx skills add TryGhost/Ghost --skill convert-internal-package-to-typescript -a claude-code`. Or copy the skill folder (.agents/skills/convert-internal-package-to-typescript in TryGhost/Ghost) into .claude/skills/convert-internal-package-to-typescript in your project. Claude Code loads it when a task matches its description.

How do I install Convert Internal Package to TypeScript in Codex?

Run `npx skills add TryGhost/Ghost --skill convert-internal-package-to-typescript -a codex`. Or copy the skill folder (.agents/skills/convert-internal-package-to-typescript in TryGhost/Ghost) into .agents/skills/convert-internal-package-to-typescript in your project. Codex loads it when a task matches its description.

Can I use Convert Internal Package to TypeScript in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TryGhost/Ghost --skill convert-internal-package-to-typescript -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/convert-internal-package-to-typescript, .gemini/skills/convert-internal-package-to-typescript, .github/skills/convert-internal-package-to-typescript and .opencode/skills/convert-internal-package-to-typescript in your project.

What does Convert Internal Package to TypeScript need to run?

Going by SKILL.md and its folder, Convert Internal Package to TypeScript needs the command-line tools its instructions call (git). Our summary lists: A checkout of the Ghost repository with `packages/README.md`; Git.

Does Convert Internal Package to TypeScript access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Convert Internal Package to TypeScript safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Convert Internal Package to TypeScript use?

Convert Internal Package to TypeScript is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Convert Internal Package to TypeScript use?

About 1.2k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 739 tokens, read only when the agent opens those files.

What are the alternatives to Convert Internal Package to TypeScript?

Skills that share tags, products or a category with Convert Internal Package to TypeScript: jscpd Code Migration Tracker (kucherenko/jscpd, 6.3k stars), Markbind Typescript Migration (MarkBind/markbind, 158 stars), Check npm (grafana/skills, 278 stars) and Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Convert Internal Package to TypeScript?

TryGhost (a GitHub organization) maintains it in TryGhost/Ghost, which has 55,493 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 7, 2026.

Source: TryGhost/Ghost on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.