typescript-migration
Esta skill debe usarse cuando el usuario pide "migra este proyecto a TypeScript", "convierte de JS a TS", "agrega TypeScript a este proyecto", "migrate to TypeScript", "add types to this codebase", "quiero tipado estatico en este proyecto", o menciona querer convertir un proyecto JavaScript existente a TypeScript de forma incremental. Ejecuta un pipeline autonomo de 5 fases (auditar proyecto, instalar tooling y renombrar archivos, extraer tipos compartidos, tipar chunks en paralelo, consolidar con strict progresivo y gate de build final) aislado en un worktree dedicado. No la uses para proyectos nuevos iniciados directamente en TypeScript ni para agregar tipos a un solo archivo.
What this skill does
# TypeScript Migration Skill
This skill migrates an existing JavaScript project to TypeScript autonomously. It is a MIGRATION
workflow — the JS code already exists and works; the goal is to add type safety incrementally,
validate each step, and end with a project that compiles under strict mode (or the highest strict
level achievable without behavior changes).
The whole pipeline runs inside a dedicated worktree. There is exactly one human gate: the merge.
## Why a worktree
The pipeline installs packages, writes tsconfig files, renames files with `git mv`, and edits
type annotations across the entire project. Running this on the user's working branch mixes
unreviewed automated changes with their work. A dedicated worktree isolates everything; the diff
at merge time is the review surface. Every sub-agent runs inside the worktree, not the parent
checkout.
## The pipeline
Run these steps in order. Steps 1–4 are yours (the orchestrator); step 5 hands off to the
Workflow that drives the five specialized sub-agents.
### Step 1 — Scope and validate
1. Identify the target: the user may name a project directory or assume the current working directory.
2. Verify it is a JavaScript project: look for `package.json` and at least one `.js` or `.jsx` file
under `src/` or the project root.
3. Check whether a `tsconfig.json` already exists. If TypeScript is already fully set up, tell the
user and stop — this skill is for initial migrations, not ongoing type hardening.
4. Confirm the project has a package manager lockfile (`package-lock.json`, `yarn.lock`, or
`pnpm-lock.yaml`). If not, warn the user before proceeding.
### Step 2 — Enter the worktree
Create and enter a dedicated worktree under `.claude/worktrees/` (this path is gitignored). Use
the `EnterWorktree` tool — never `cd`. Name it for the project, e.g. `ts-migration-<project-name>`.
Everything after this point happens inside the worktree.
### Step 3 — Confirm scope with the user (optional)
If the project has more than 50 JS files, briefly summarize what the auditor will discover and ask
whether to proceed. For smaller projects, proceed directly.
### Step 4 — Note the entry point
Read `package.json` to capture the `main`, `module`, or `scripts.start` entry point. Pass it to
the Workflow as context for the consolidator's final build check.
### Step 5 — Launch the Workflow
Call the Workflow tool with the bundled script. This skill's instruction to call Workflow is the
explicit opt-in; the pipeline must run deterministically (sequential phases, parallel chunks, strict
progression), which is exactly what a Workflow gives you over prose orchestration.
```
Workflow({
scriptPath: "${CLAUDE_PLUGIN_ROOT}/skills/typescript-migration/workflow.js",
args: {
projectRoot: "<absolute path to the project inside the worktree>",
entryPoint: "<value of main/module from package.json, or null>"
}
})
```
Do NOT set `isolation: 'worktree'` on anything — you are already inside the dedicated worktree
and want every sub-agent to operate in it, not spawn its own.
### Step 6 — Hand off for merge
Lead with the merge verdict, not the strict level reached.
- If `mergeable` is false, say so up front. Report the `strictLevelReached`, the `residualErrors`
that blocked further progress, and what the user would need to fix manually to go further.
Do not present the worktree as ready to merge.
- If `mergeable` is true, report: strict level reached, files migrated, shared types created,
any cross-chunk errors resolved, and any `@types` packages installed. Then present the worktree
for review and merge.
The merge is the user's sign-off — do not merge automatically.
## What the Workflow orchestrates
| Phase | Agent | Role |
|-------|-------|------|
| Audit | `migration-auditor` | Detect project type, map dep graph, plan chunks, select fixture |
| Setup | `migration-setup` | Install tooling, apply tsconfig, git mv all JS files, verify base compile |
| Extract | `shared-types-extractor` | Define cross-chunk interfaces in src/types/ before typers start |
| Type | `typer` (N parallel) | Add types to each chunk's files, scoped compile gate per chunk |
| Consolidate | `migration-consolidator` | Fix cross-chunk errors, enable strict progressively, final build gate |
Why phases are barriered: Audit must complete before Setup (fixture selection depends on it).
Setup must complete before Extract and Type (files must exist as .ts before they can be typed).
Extract must complete before Type (shared interfaces must exist before parallel typers import them).
Type must complete before Consolidate (all files must be typed before the whole-project build is meaningful).
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.