Skip to content
Back to skills

Test

ASecurity

Test code conventions. Modify tests only for genuine spec or architecture changes—never trivialize, skip, or align expected values to a buggy implementation. Avoid implementation branches that depend on specific test data values. Use when writing or modifying test code, or when tests are failing.

  • 3 stars
  • 0 votes
  • 0 copies
  • 10 views
  • Added May 27, 2026
data-aiapi

Works with

  • api

Security analysis

A100/100

Scanned November 28, 2026

npx -y skills add ncaq/konoka --skill test --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ncaq-test/badge)](https://www.skillsdirectory.com/skills/ncaq-test)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: test
description: Test code conventions. Modify tests only for genuine spec or architecture changes—never trivialize, skip, or align expected values to a buggy implementation. Avoid implementation branches that depend on specific test data values. Use when writing or modifying test code, or when tests are failing.
user-invocable: false
---

# テスト

## テストが保証していることを保つ

テストは仕様を表し、実装の正しさを検証するものです。
実装にバグがあってテストが失敗している場合は、実装を修正してください。
テストコードを変更するときは、そのテストが何を保証していて、
変更後も同じ保証が維持されるかを確かめます。

以下のような変更は、テストの意味を失わせるので行いません。

- アサーションを`assert(true)`や`1 == 1`のような恒真式に置き換えてテストを通す。
- 失敗するテストをskipやignoreやxfailに変更して、パスしたことにする。
- 期待値を、実装のバグを含んだ出力に合わせて書き換える。
- 一部のケースだけを抜き出して、エッジケースを暗黙に削除する。

判断に迷う場合はユーザに確認してください。
特にテストの期待値を変更するときは、仕様の理解が合っているかを事前に確認するのが安全です。

## テストコードを変更してよい場合

以下のような場合はテストの変更が妥当です。
変更するときは、その変更が正しい理由をコミットメッセージや差分の説明に書いてください。

- テストを追加または修正するタスクとして依頼されている。
- テストコードに構文エラーやタイポのような明らかな誤りがある。
- 仕様自体が変わり、新しい仕様に合わせてテストの期待値や入力を更新する必要がある。
- アーキテクチャの変更やリファクタリングで、テスト対象のAPIやモックの構造や初期化の方法が変わり、
  テストを新しい構造に合わせて書き直す必要がある。
- 旧仕様の名残で、実装と仕様であるテストの意図が乖離している。
  この場合はユーザに確認した上でテストを更新します。

アーキテクチャを変更するときに旧テストをそのまま通そうとすると、
リファクタリングそのものが歪むことがあります。
新しい構造に合ったテストへ書き直す方が健全な場合は、書き直して構いません。
書き直したテストは以下を満たすようにします。

- 新しい仕様の振る舞いを過不足なく表現している。
- エラー系やエッジケースも引き継いでいて、カバレッジが意図せず落ちていない。
- リファクタリング後の実装の挙動を写しただけのテストになっていない。

## テストデータに依存した条件分岐は避ける

テストで使われている具体的なデータ値を、実装コードで特別扱いしないでください。
具体的なデータ値とは、テストで使われる変数名やテーブル名などのことです。

テストデータが変更されると実装が機能しなくなり、
特定のデータ名に対する特別な処理が明示的な仕様ではなく暗黙の仕様になり、
実際の運用環境では機能しない可能性があるためです。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data-ai →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.