xiaozhi-client: Skill for Claude Code

.agents/skills/path-alias-validator/SKILL.md

path-alias-validator is a skill for Claude Code, Codex from shenjingnan/xiaozhi-client. It costs 13 tokens per session (2,767 once invoked), scanned A, original, MIT.

A path-alias checker for the xiaozhi-client project. Path aliases are short import names, such as `@/utils`, that replace long relative paths like `../../utils`.

In plain words
What is it for?
It checks TypeScript and JavaScript imports, MDX code examples, mixed alias and relative usage, and alias settings in TypeScript, test, build, and package configuration files.
Why use it?
It helps keep imports consistent and catches configuration mismatches that can make code or examples fail to resolve. It also reduces confusing chains of relative paths.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is shenjingnan/xiaozhi-client's own configuration. It tells Claude Code and Codex how to work on xiaozhi-client itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything xiaozhi-client configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { LightService } from "../services";.

Reuse

Borrowing it

Nothing to install: this file belongs to shenjingnan/xiaozhi-client. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/.agents/skills/path-alias-validator/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/shenjingnan/xiaozhi-client

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for path-alias-validator

README.md
[![agentmods](https://agentmods.dev/badge/skills/shenjingnan/xiaozhi-client/path-alias-validator.svg)](https://agentmods.dev/skills/shenjingnan/xiaozhi-client/path-alias-validator)
Your own site
<a href="https://agentmods.dev/skills/shenjingnan/xiaozhi-client/path-alias-validator"><img src="https://agentmods.dev/badge/skills/shenjingnan/xiaozhi-client/path-alias-validator.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,767 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.02767
Opus 5 $0.00006 $0.01384
Sonnet 5 $0.00003 $0.00553
Haiku 4.5 $0.00001 $0.00277

Measured 7d ago against content hash 1afb64b71f8d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

path-alias-validator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/path-alias-validator/SKILL.md · 301 lines

How it starts

The opening of the file, as written. The whole thing — 301 lines — stays where its author put it; the contents beside it link to each section on GitHub.

我是路径别名系统检查与修复技能,专门针对 xiaozhi-client 项目的路径别名系统进行检查、验证和优化,同时遵循务实开发理念。

技能使用原则

  • 保持代码质量,但避免过度工程化:维护路径别名的一致性,但不追求过度复杂的设计
  • 实用功能优先,理论完美次之:解决实际的导入问题比完美的路径设计更重要
  • 简单解决方案优于复杂方案:在复杂和简单之间做出合理选择
  • 务实开发指导:评估路径别名设计的必要性,避免过度设计

技能能力

1. 路径别名使用检查

核心能力:检测项目中相对路径的使用情况,并提供别名替换建议。

检测范围
  • 源代码文件:TypeScript/JavaScript 文件中的导入语句
  • 文档文件:MDX 文件代码块中的示例代码
  • 跨目录相对路径../ 格式的导入语句
  • 同级目录引用./ 格式的导入语句
  • 混合使用情况:同一文件中别名和相对路径混用
  • 配置一致性:各配置文件中别名配置的一致性检查
文档场景特殊处理
  • 代码块识别:自动识别 MDX 文件中的 TypeScript/JavaScript 代码块
  • 示例代码检查:检查文档中的代码示例是否遵循路径别名规范
  • 教学一致性:确保文档示例展示最佳实践
  • 语法高亮支持:支持多种编程语言的路径检查
检查规则
// ✅ 推荐的别名使用(xiaozhi-client 项目 @/ 路径别名体系)
import { LightService } from "@/server/services";
import type { HassState } from "@/types";
import { formatDate } from "@/utils";

// ❌ 需要修复的相对路径
import { LightService } from "../services";
import type { HassState } from "../types";
import { formatDate } from "./utils";

2. 别名配置验证

检查项目配置文件中的路径别名设置是否正确和一致。

验证项目
  • tsconfig.json - TypeScript 编译器配置
  • vitest.config.ts - 测试框架配置
  • tsup.config.ts - 构建工具配置
  • package.json - 导入映射配置(如存在)
标准别名映射
// xiaozhi-client 项目完整别名映射(单体架构,统一 @/ 路径别名体系)
{
  "@/types":    ["./src/types"],      // 共享类型定义
  "@/config":   ["./src/config"],     // 配置管理
  "@/mcp-core": ["./src/mcp-core"],   // MCP 协议核心
  "@/endpoint": ["./src/endpoint"],   // 端点处理
  "@/esp32":    ["./src/esp32"],      // ESP32 硬件相关
  "@/cli":      ["./src/cli"],        // CLI 命令行工具
  "@/utils":    ["./src/utils"],      // 通用工具
  "@/server":   ["./src/server"]      // 后端服务(含 handlers、services、routes 等)
}

3. 自动修复建议

为检测到的问题提供具体的修复建议和代码示例。

修复示例
// ❌ 原始代码(相对路径)
import { UserService } from "../services/user";
import type { APIResponse } from "../types/api";
import { formatDate } from "./utils/date";
import { Command } from "./commands/help";

// ✅ 修复后(xiaozhi-client @/ 路径别名体系)
import { UserService } from "@/server/services/user";
import type { APIResponse } from "@/types/api";
import { formatDate } from "@/utils/date";
import { Command } from "@/cli/commands/start";

Read the full file on GitHub · 301 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 301 lines · 13 tokens per session scan A 1afb64b71f8d

Subscribe to this mod's changes

path-alias-validator is a skill published in the GitHub repository shenjingnan/xiaozhi-client (338 stars, last pushed 3d ago), licensed MIT. It adds 13 tokens to every session and 2,767 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens

byted-util-volcengine-detect-retry

An orchestration workflow for Volcengine Cloud Detect, a service that checks websites or network endpoints from test locations.

bytedance/agentkit-samples · 101 tokens