Agent skill
syncing-tsconfig-paths
Synchronizes tsconfig.json paths from package.json imports field. Ensures TypeScript resolves subpath imports (#imports) correctly during development.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/syncing-tsconfig-paths
SKILL.md
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
importsfield - Conditional imports (objects with browser/default) are skipped with a warning
- This enables TypeScript to resolve
#imports during development before build
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?