Claude Code Plugins

Community-maintained marketplace

Feedback

syncing-tsconfig-paths

@mattnigh/skills_collection
0
0

Synchronizes tsconfig.json paths from package.json imports field. Ensures TypeScript resolves subpath imports (#imports) correctly during development.

Install Skill

Shared

Installs to .agents/skills, used by Codex, Amp, Warp, Cursor, OpenCode, and more.

CodexAmp
Warp
CursorOpenCode
Cline
Gemini CLI
GitHub Copilot
Personal

Available across projects.

$npx skills-installer add @mattnigh/skills_collection/jasonkuhrt__kitz__claude__skills__syncing-tsconfig-paths__SKILL.md --client shared
Project

Writes to .agents/skills.

$npx skills-installer add @mattnigh/skills_collection/jasonkuhrt__kitz__claude__skills__syncing-tsconfig-paths__SKILL.md -p --client shared
Note: Review the skill instructions before using it.

SKILL.md

name syncing-tsconfig-paths
description Synchronizes tsconfig.json paths from package.json imports field. Ensures TypeScript resolves subpath imports (#imports) correctly during development.

Syncing TSConfig Paths

Keep tsconfig paths in sync with package.json subpath imports.

Steps

Syncing

pnpm exec tsx .claude/skills/syncing-tsconfig-paths/scripts/sync-tsconfig-paths.ts

Auditing

Run with --check flag to verify without modifying:

pnpm exec tsx .claude/skills/syncing-tsconfig-paths/scripts/sync-tsconfig-paths.ts --check

Reference

The script transforms package.json imports to tsconfig paths:

// package.json
{
  "imports": {
    "#pkg": "./build/_.js",
    "#foo": "./build/foo.js"
  }
}

Becomes:

// tsconfig.json
{
  "compilerOptions": {
    "paths": {
      "#pkg": ["./src/_.ts"],
      "#foo": ["./src/foo.ts"]
    }
  }
}

Key transformation: ./build/./src/ (extension stays .js - TypeScript with nodenext resolves to .ts)

Notes

  • Run after modifying any package's imports field
  • Conditional imports (objects with browser/default) are skipped with a warning
  • This enables TypeScript to resolve # imports during development before build