# Test Targeted

> テスト実行時の絞り込み運用ルール。プロジェクト全体テストではなく修正範囲に絞ったテスト実行を行う。`gradlew test`/`pytest`/`jest`/`go test`等のテストランナーを実行するとき、テスト実行コマンドを組み立てるときに必ず参照する。コミット差分や修正ファイルから対象テストを特定する手順を含む。

- **Type:** Skill
- **Install:** `agentstack add skill-yasunori0418-skills-test-targeted`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [yasunori0418](https://agentstack.voostack.com/s/yasunori0418)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [yasunori0418](https://github.com/yasunori0418)
- **Source:** https://github.com/yasunori0418/skills/tree/main/skills/workflow/test-targeted

## Install

```sh
agentstack add skill-yasunori0418-skills-test-targeted
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# テスト絞り込み実行ルール

特別な指示がない限り、プロジェクト全体テストの一括実行は行わない。直前の作業内容・最新コミット差分・修正ファイルのパスから影響範囲を特定し、対象テストクラスのみに絞って実行する。

## 実行手順

1. `git log` / `git diff` で修正対象のクラス／パッケージを特定する
2. テストランナーの絞り込みオプションで対象を限定する
   - **Gradle**: `--tests "*ClassNameTest"` または `--tests "FQCN"`
   - **pytest**: `pytest path/to/test_file.py::TestClass::test_func` または `-k "expr"`
   - **jest**: `jest path/to/file.test.ts` または `-t "test name pattern"`
   - **go test**: `go test ./pkg/... -run TestName`
   - **cargo test**: `cargo test --test integration_test test_name`
3. 修正がドメイン層ならドメイン層のテストのみ、インフラ層ならインフラ層のテストのみ実行する

## 例外

以下の場合のみ全範囲テストを実行する：

- ユーザーから「全範囲を走らせて」「全部のテストを通して」等の明示指示があったとき
- 大規模リファクタリング・依存関係変更など影響範囲を絞り込めない作業のとき

計画書に「全体テスト」と明示されていても、ユーザーから直接の指示がなければ対象テストに絞る。

## なぜ絞り込むか

- 全範囲テストは実行時間が長く（10分超など）、ローカルリソース起因のノイズ（OOM等）が混入しやすい
- 修正範囲外テストは確認価値が低い
- 失敗時の原因特定も範囲を絞った方が容易

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [yasunori0418](https://github.com/yasunori0418)
- **Source:** [yasunori0418/skills](https://github.com/yasunori0418/skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-yasunori0418-skills-test-targeted
- Seller: https://agentstack.voostack.com/s/yasunori0418
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
