Search

PythonReactSEOPDF
GitHub Skill

tdd-scenario-generator

TDDサイクルを加速させるため、実装前に網羅的なテストシナリオとエッジケースを生成します。

masakinihirota☆ 0 Repository stars0 Repository forks

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

View source ↗Guides

Skill instructions

TDD Scenario Generator Skill

このスキルは、TDD駆動開発.md に基づき、新機能やバグ修正の開始時に「失敗するテスト(RED)」を定義するための網羅的なシナリオを生成します。

シナリオ生成のガイドライン

1. 正常系 (Happy Path)
  • 最も一般的、あるいは期待される入力に対する挙動。
  • Propsのデフォルト値での表示。
2. 異常系・入力バリデーション (Error Handling)
  • 境界値: 最大文字数、最小文字数、0や負の数。
  • 不正な形式: 無効なURL、メールアドレス、特殊文字の混入。
  • 未定義/null: RequiredなPropsが欠落している場合のフォールバック。
3. 操作・インタラクション
  • クリック、入力変更、送信。
  • ローディング中、成功時、エラー時の各状態遷移。
4. アクセシビリティ (a11y)
  • vitest-axe: toHaveNoViolations のアサーションを各状態ごとに含める。
  • ARIA属性: 適切な役割(Role)やラベル(aria-label)が機能しているか。
5. コンテキスト・環境
  • ダークモード/ライトモードでの視認性。
  • 未ログイン状態(認証必須機能の場合)。
  • データの空状態(Empty state)。

出力形式の例

テストケース名(日本語)と、Arrange/Act/Assert(AAA)の概要を提示します。

describe("ComponentName", () => {
    it("名前と説明を正しく表示し、アクセシビリティ違反がないこと", async () => { ... });
    it("タイトルが100文字を超える場合にエラーが表示されること", async () => { ... });
    it("APIエラー時にトースト通知が表示されること", async () => { ... });
    it("キーボード操作でボタンが活性化し、onClickが呼ばれること", async () => { ... });
});

フィードバックのガイドライン

  • コード生成(GREENフェーズ)に移る前に、ユーザーに「これらのシナリオで網羅されていますか?」と確認します。
  • ユーザーの追加要望があれば、そのシナリオをテストコードに反映させます。

Examples

Read the usage examples in the source repository.

View source ↗

Source history

Indexed on
2026-01-20
Index updated
2026-01-26
Branch
main

Index and sync dates describe this directory. View the source repository for code history.

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!