Precheck

From ayutaz/piper-plus · View interactive version

Precheck is an AI agent skill from the GitHub repository ayutaz/piper-plus. PR 作成前の lint + format + test 一括実行。引数で scope (python/rust/cs/go/js/cpp/all) を指定可能。未指定なら git diff から自動判定。

How to use this skill

Skill file

Pre-commit / Pre-PR チェック

$ARGUMENTS で指定されたスコープに対して、CI が実行するチェックと同等の検査をローカルで実行します。

変更ファイル

!git diff --name-only HEAD 2>/dev/null | head -30

スコープ判定

引数 $ARGUMENTS:

実行ステップ (該当スコープのみ)

Python

# Lint (CI の lint-gates.yml python-lint step と同じく repo 全体。 除外は pyproject.toml の [tool.ruff])
uv run ruff check

# Format check
uv run ruff format --check

# Unit tests (runtime + g2p)
cd src/python_run && uv run pytest tests/ -o addopts="" --tb=short -q && cd ../..

Rust

cd src/rust
cargo fmt --all -- --check
cargo clippy --workspace --all-features -- -D warnings
cargo test -p piper-plus --no-fail-fast
cd ../..

C# (.NET)

dotnet build src/csharp/PiperPlus.sln -c Release --nologo
dotnet format src/csharp/PiperPlus.sln --verify-no-changes --no-restore
dotnet test src/csharp/PiperPlus.sln -c Release --no-build --nologo --verbosity minimal

Go

cd src/go
go vet ./... ./phonemize/...
go test -race -count=1 ./... ./phonemize/...
cd ../..

JavaScript / WASM

cd src/wasm/openjtalk-web
npm run test:npm-package:all
cd ../../..

C++

cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure

報告フォーマット

各ステップ完了後、以下の形式で結果を報告:

## Precheck 結果

| ステップ | 結果 | 詳細 |
|---------|------|------|
| Python ruff check | ✅ / ❌ | (失敗時はエラー要約) |
| Python ruff format | ✅ / ❌ | |
| Python pytest | ✅ / ❌ | (passed/failed/skipped カウント) |
| ... | ... | ... |

失敗時の対応

注意

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.