path-alias-validator

Detect and fix path alias usage in TypeScript/JavaScript projects.

333|92|Updated Jun 9, 2025
One-click install
npx skills add https://github.com/shenjingnan/xiaozhi-client --skill path-alias-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: path-alias-validator
Source: https://github.com/shenjingnan/xiaozhi-client/tree/main/.claude/skills/path-alias-validator
Command: npx skills add https://github.com/shenjingnan/xiaozhi-client --skill path-alias-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Path Alias Validator helps teams enforce consistent import paths by detecting and fixing inconsistent or non-aliased imports across code, docs, and configuration files.

Core Features & Use Cases

  • Detection: Finds relative imports that should be replaced with aliases in TypeScript/JavaScript sources and code examples in documentation blocks.
  • Validation: Checks alias mappings across tsconfig.json, vitest.config.ts, tsup.config.ts, and package.json to ensure consistency.
  • Auto-Fix: Proposes and applies automated replacements from relative paths to alias-based imports, improving maintainability.

Quick Start

To scan and repair path aliases in your repo, run the validator and review suggested changes before applying.

Frequently Asked Questions about path-alias-validator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert relative imports to path aliases in a TypeScript project?

To validate path aliases in configuration files, scan tsconfig.json, vitest.config.ts, tsup.config.ts, and package.json to ensure alias mappings remain consistent. This prevents mismatched path configurations across your build and test environments.

How do I validate path alias configurations in tsconfig and vitest?

To validate path aliases in configuration files, scan tsconfig.json, vitest.config.ts, tsup.config.ts, and package.json to ensure alias mappings remain consistent. This prevents mismatched path configurations across your build and test environments.

Can I fix inconsistent path alias usage in documentation code blocks?

Yes, you can fix inconsistent path alias usage in documentation code blocks. The validator detects relative imports that require replacement and suggests automated fixes to align documentation examples with your alias configuration.

What is the best way to enforce consistent import paths and refactor JavaScript code?

The best way to enforce consistent import paths and refactor JavaScript code is to run an automated validation tool. It detects non-aliased imports and proposes refactoring replacements to improve overall maintainability.