Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ jobs:
with:
node-version: '20'
- name: Syntax check
run: node --check *.mjs
run: node --check skill-validator.js
- name: Run tests
run: node --test test/skill-validator.test.mjs
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file.

## [1.3.0] - 2026-03-22

### Added
- Test suite `test/skill-validator.test.mjs` using `node:test` + `node:assert/strict` (15 tests, zero external dependencies)
- Covers: `--help`, `-h`, `--json` schema contract, `--skills-only`, `--commands-only`, `--dir` missing path, `--verbose`, `--quiet`, `--dry-run`, `--no-version-check`, frontmatter validation, syntax error detection
- `commands/` directory now included in npm package (`files` array updated)

### Changed
- Main script renamed from `skill-validator.mjs` to `skill-validator.js` — fixes silent bin deletion on `npm install -g` caused by npm ignoring `.mjs` bin entries; `"type": "module"` in `package.json` ensures ESM semantics are preserved
- `bin` entry updated to `skill-validator.js`
- `scripts.test` added: `node --test test/skill-validator.test.mjs`
- CI workflow updated: syntax check now targets `skill-validator.js`; test step added
- CHANGELOG: merged duplicate `[1.2.0]` entries (Added + Changed sections combined)

## [1.2.0] - 2026-03-17

### Added
Expand All @@ -20,8 +34,6 @@ All notable changes to this project will be documented in this file.
- `isNpx()`: Detects npx execution via `npm_execpath`, `argv[1]`, and `npm list -g` fallback
- `selfUpdate()`: Orchestrates the self-update flow with pre/post version display

## [1.2.0] - 2026-03-17

### Changed
- `checkCommandReferences`: チェック対象をコードフェンスブロック(` ```bash/sh/shell/zsh/console ``` `)内のコマンドと `$ ` プレフィックス行のみに限定
- インラインバッククォート(`` `word` ``)は完全スキップ — 用語囲みをコマンドと誤検知する最大の原因を排除
Expand Down
52 changes: 46 additions & 6 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,28 @@ npx claude-skill-validator
claude-skill-validator

# 詳細出力
node skill-validator.mjs --verbose
claude-skill-validator --verbose

# アップデートチェック付き
node skill-validator.mjs --update-check
claude-skill-validator --update-check

# JSON出力
node skill-validator.mjs --json
claude-skill-validator --json

# skills/ のみ
node skill-validator.mjs --skills-only
claude-skill-validator --skills-only

# commands/ のみ
node skill-validator.mjs --commands-only
claude-skill-validator --commands-only

# 別ディレクトリを指定
node skill-validator.mjs --dir /path/to/.claude
claude-skill-validator --dir /path/to/.claude

# FAILのみ表示
claude-skill-validator --quiet

# WARNも含めて厳密チェック
claude-skill-validator --strict
```

## 出力例
Expand Down Expand Up @@ -93,6 +99,40 @@ claude-skill-validator --dry-run
2. `package.json` の `repository` フィールド
3. `.git/` ディレクトリの `origin` リモート

## オプション一覧

| オプション | 説明 |
|-----------|------|
| `--dir <path>` | Claude設定ディレクトリ(デフォルト: `~/.claude`) |
| `--skills-only` | `skills/` のみスキャン |
| `--commands-only` | `commands/` のみスキャン |
| `--json` | JSON形式で出力 |
| `--verbose` | PASS含む全結果を表示 |
| `--quiet` | FAILのみ表示(WARN件数はサマリーのみ) |
| `--strict` | frontmatter WARNも表示(デフォルト非表示) |
| `--update-check` | ソースリポジトリからのアップデートチェック |
| `--update` | アップデートを適用(`--update-check` を含む) |
| `--fix` | 修正可能な問題を自動修復(バックアップ付き) |
| `--dry-run` | 修正内容のプレビュー(実際には変更しない) |
| `--self-update` | `claude-skill-validator` 自体を最新版に更新 |
| `--no-version-check` | npm バージョンチェックをスキップ(CI環境向け) |
| `--help`, `-h` | ヘルプを表示 |

## プラグインコマンド(`commands/`)

このパッケージには Claude Code スラッシュコマンドが同梱されています:

| コマンド | ファイル | 機能 |
|---------|---------|------|
| `/skill-validate` | `commands/skill-validate.md` | 全オプション対応の一括スキャン |
| `/skill-validate-fix` | `commands/skill-validate-fix.md` | dry-run → fix → 確認の3ステップフロー |

グローバルインストール後、Claude Code でそのまま使えます:

```bash
npm install -g claude-skill-validator
```

## 動作環境

- Node.js 18+
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,31 @@ claude-skill-validator --dry-run
| `--skills-only` | Scan `skills/` directory only |
| `--commands-only` | Scan `commands/` directory only |
| `--json` | Output results as JSON |
| `--verbose` | Show all checks including PASS |
| `--quiet` | Show FAIL only; WARN count appears in summary |
| `--strict` | Show frontmatter WARN entries (hidden by default) |
| `--update-check` | Check for updates from source repositories |
| `--verbose` | Verbose output |
| `--update` | Apply available updates (implies `--update-check`) |
| `--fix` | Auto-fix fixable issues (creates backups) |
| `--dry-run` | Preview fixes without applying changes |
| `--self-update` | Update `claude-skill-validator` itself to the latest version |
| `--no-version-check` | Skip npm version check (useful in CI) |
| `--help`, `-h` | Show help message |

## Plugin Commands (`commands/`)

This package ships two Claude Code slash commands in `commands/`:

| Command | File | What it does |
|---------|------|-------------|
| `/skill-validate` | `commands/skill-validate.md` | Run a full scan (all options exposed) |
| `/skill-validate-fix` | `commands/skill-validate-fix.md` | Guided dry-run → fix → verify flow |

Install the package globally and the commands become available in Claude Code immediately:

```bash
npm install -g claude-skill-validator
```

## Exit Codes

Expand Down
6 changes: 3 additions & 3 deletions commands/skill-validate-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ description: Auto-fix repairable issues in installed Claude Code skills

### ステップ1: 修正プレビュー(ドライラン)
```
node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --dry-run
node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --dry-run
```
修正内容を確認し、意図しない変更がないかチェックする。

### ステップ2: 自動修復を実行
```
node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --fix
node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --fix
```
自動修正可能な項目(壊れた参照・非推奨ツール・構文エラー等)を修復する。

### ステップ3: 修復結果の確認
```
node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs
node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js
```
修復後に再チェックして全件PASSであることを確認する。

Expand Down
18 changes: 9 additions & 9 deletions commands/skill-validate.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ description: "Validate and repair installed Claude Code skills. Usage: /skill-va
Claude Codeスキルの健全性チェックと自動修復ツール。

使い方:
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs` — 全スキルをチェック
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --fix` — 自動修正可能な項目を修正
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --dry-run` — 修正プレビュー
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --skills-only` — skills/のみチェック
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --commands-only` — commands/のみチェック
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --json` — JSON形式出力
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --verbose` — 詳細出力
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --quiet` — FAILのみ表示
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.mjs --strict` — WARN も表示
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js` — 全スキルをチェック
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --fix` — 自動修正可能な項目を修正
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --dry-run` — 修正プレビュー
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --skills-only` — skills/のみチェック
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --commands-only` — commands/のみチェック
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --json` — JSON形式出力
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --verbose` — 詳細出力
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --quiet` — FAILのみ表示
- `node ${CLAUDE_PLUGIN_ROOT}/skill-validator.js --strict` — WARN も表示

引数$ARGUMENTSがあればオプションとして渡す。
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"name": "claude-skill-validator",
"version": "1.2.0",
"version": "1.3.0",
"description": "Validate and repair Claude Code skills — detect broken references, deprecated tools, syntax errors, and auto-fix issues",
"type": "module",
"bin": {
"claude-skill-validator": "./skill-validator.mjs"
"claude-skill-validator": "./skill-validator.js"
},
"scripts": {
"test": "node --test test/skill-validator.test.mjs"
},
"files": [
"skill-validator.mjs",
"skill-validator.js",
"commands/",
"README.md",
"README.ja.md",
"LICENSE"
Expand Down
File renamed without changes.
Loading
Loading