Agent skill

Typescript Testing

by shinpr in shinpr/ai-coding-project-boilerplate

リポジトリに即したTypeScriptテスト設計、振る舞いの証明、独立性、モック境界の基準を適用する。ユニットテストの作成・レビュー時に使用。

MITAuto-check passedTesting & QA

Install Typescript Testing

skills CLI
$ npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install shinpr/ai-coding-project-boilerplate typescript-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/shinpr/ai-coding-project-boilerplate.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills-ja/typescript-testing .claude/skills/typescript-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
typescript-testing
GitHub stars
232
Token cost
~1.1k tokens
SKILL.md length
141 words
Files
1
Skills in repo
42
Repo updated
First seen
Licence
MIT

At a glance

リポジトリに即したTypeScriptテスト設計、振る舞いの証明、独立性、モック境界の基準を適用する。ユニットテストの作成・レビュー時に使用。

  • Works in 3 steps: 単体テスト(Unit Tests) → 統合テスト(Integration Tests) → 機能横断検証
  • Testing & QA work in your project
  • SKILL.md covers 前提条件の検出, テストフレームワーク, テストの基本方針 and テストの実装規約, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Typescript Testing is an agent skill from shinpr/ai-coding-project-boilerplate. リポジトリに即したTypeScriptテスト設計、振る舞いの証明、独立性、モック境界の基準を適用する。ユニットテストの作成・レビュー時に使用。

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA. It works with TypeScript and Vitest. The repository describes itself as: Agentic coding TypeScript boilerplate for Claude Code: sub-agent workflows with built-in quality checks and context engineering. The licence is MIT.

When your agent uses it

  • Testing & QA work in your project

Example prompts

  • “/typescript-testing”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. 単体テスト(Unit Tests)
  2. 統合テスト(Integration Tests)
  3. 機能横断検証

What it can do on your machine

Read from SKILL.md and the folder at commit 56913a2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Typescript Testing loads about 1.1k tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 141 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from shinpr/ai-coding-project-boilerplate at commit 56913a2, republished under its MIT licence (© shinpr). 141 words, ~1,064 tokens.

Download SKILL.mdSave it as .claude/skills/typescript-testing/SKILL.md (or your agent's skills folder).
name
typescript-testing
description
リポジトリに即したTypeScriptテスト設計、振る舞いの証明、独立性、モック境界の基準を適用する。ユニットテストの作成・レビュー時に使用。

TypeScript テストルール

前提条件の検出

フレームワークやコマンドを選択する前に、package.json、ロックファイル、テスト設定、既存テストのimportを確認する。Vitest固有のルールはVitestが設定されている場合にのみ適用する。それ以外は、以下の振る舞い、独立性、エビデンスに関するルールを維持しつつ、リポジトリで設定済みのTypeScriptテストハーネスを使用する。実行可能なハーネスを特定できない場合は、確認したパスと不足しているコマンドまたは設定を報告する。

テストフレームワーク

  • Vitest: リポジトリ設定または既存テストで選択されている場合に使用
  • テストのインポート: import { describe, it, expect, beforeEach, vi } from 'vitest'
  • モックの作成: vi.mock() を使用

テストの基本方針

品質要件
  • リグレッション保護: クリティカルパス、ビジネスロジック、リグレッションが問題になる振る舞いにテストを集中させる。未検証の振る舞いが実害のあるリグレッションリスクを生む場合にテストを追加する
  • 独立性: 各テストは他のテストに依存せず実行可能
  • 再現性: 時刻、乱数、環境値、外部I/Oを制御し、同一の入力から同一の観測可能な結果を得る
  • 可読性: 各テストは1つの振る舞いを名前で示し、setup・action・assertionを分け、その振る舞いで使用する値だけをfixtureに含める
テストの種類と範囲
  1. 単体テスト(Unit Tests)

    • 個々の関数やクラスの動作を検証
    • 外部依存はすべてモック化
    • 最も数が多く、細かい粒度で実施
  2. 統合テスト(Integration Tests)

    • 複数のコンポーネントの連携を検証
    • テスト対象の振る舞いを構成するin-processコンポーネントは実物を使用。外部I/Oはモック範囲の判断を参照
    • 主要な受け入れ基準を実装するフロー、またはin-processコンポーネントの境界をまたぐフローを検証
  3. 機能横断検証

    • 新機能が共有の統合ポイントに及び、その失敗が主要なユーザージャーニーまたは公開契約を壊す、あるいは副次的な観測可能な振る舞いを劣化させる場合は、既存機能の継続性を証明義務とする。その失敗を露出できる最も安い境界で証明する
    • 検証パターン: 既存機能動作 → 新機能有効化 → 既存機能の継続性確認
    • 判定基準: 元の受け入れ基準で指定されたレスポンスフィールドと観測可能な振る舞いを維持する。処理時間のしきい値は、要件またはプロジェクト設定で値と計測方法が定義されている場合にのみ適用する
    • CI/CDでの自動実行を前提とした設計

テストの実装規約

ディレクトリ構造と命名規則
  • テストは対象モジュールと同じ階層の __tests__/ に置く
  • テストファイル: {target-file-name}.test.ts
  • 統合テストファイル: {target-file-name}.int.test.ts
  • テストスイート: 対象の機能や状況を説明する名前
  • テストケース: 期待される動作を説明する名前
テストコードの品質ルール

コミットするテストはすべて有効に保つ。現行の振る舞いを保護するテストは修復する。テストを削除するのは、対象の振る舞いが不要になったことを元の要件または実装契約で確認できる場合に限る。

テスト品質基準

境界値・異常系の網羅

正常系に加え、境界値と異常系を含める。

期待値の直接記述

期待値は実装上の計算から独立させる。契約の値をリテラルとして直接記述するか、独立した正規のfixtureまたは仕様から取得する。テスト対象と同じ定数や計算式から算出した期待値は、両方が誤っていても通過する。モックが入力を供給する場合、実装がそれを変換する箇所では期待値をモックの戻り値と異なる値にする。

結果ベースの検証

呼び出し順序・回数ではなく結果を検証。

意味あるアサーション

各テストは、値が返ったことではなく、利用側が依存するプロパティと、操作後の状態を検証する。

Capability Probeの事後条件

「動作するか」を確かめるprobeが成立するのは、利用側の境界を通り、利用側が必要とするプロパティそのものを検証している場合に限る。

コマンドの終了ステータス、importの成功、オブジェクトの存在は、対象に到達できることを示すので、probeの前提条件として扱い、利用側に必要なプロパティをアサーションに置く。

probeの意図前提条件(単独では不十分)代わりに検証する対象
モジュールが使用可能import が解決する、expect(mod).toBeDefined()利用側のエントリポイント経由でexportされた関数を呼び、その戻り値または効果を検証
コマンドが動作する終了コード0呼び出し側が利用する出力、ファイル、状態変化
設定が適用されている設定ファイルがパースできるその設定が変えるはずの観測可能な振る舞い
migrationが実行されたコマンドが成功を報告した実エンジン経由のqueryがmigration後の形を返すこと
モック範囲の判断

連携がテスト対象となるin-processコンポーネントにはすべて実物を使用する。上位層の振る舞いをテストする場合は、直接依存する外部I/Oを代替する。外部アダプター、query、migration、service契約自体がテスト対象の場合は、実エンジンまたは本番相当のテストインスタンスを使用する。代替する場合も、テスト対象が送るrequestと受け入れるresponseの形を検証し、境界の契約が未検証にならないようにする。

Property-based Testing(fast-check)

Design DocのACにProperty注釈が付与されている場合、fc.assert(fc.property(...)) の形式でfast-checkを使用する。

モックの型安全性

モックには、テスト対象が実際に利用する範囲だけを型付けする(Pick<T, 'usedMethod'>)。インターフェース全体を型付けしないことで、使用していないメソッドの形が変わってもテストは壊れず、利用しているメソッドの変更では壊れる。モックのオブジェクトリテラルはその抽出済み型に対して satisfies で制約し、余分なプロパティや誤った名前をコンパイル時に落とす。

データ層テスト

モックが検証できないもの

モックは呼び出しパターンを検証するため、データ層の以下のプロパティはモックのみのテストでは検出されずに通過する:

  • スキーマの不一致(テーブル名、カラム名、データ型)
  • クエリの正確性(JOIN、フィルタ、集約、グルーピング)
  • データベース制約(NOT NULL、UNIQUE、外部キー)
  • マイグレーション互換性(スキーマ変更によるコードとの不整合)

振り分けルール: 上記のプロパティがテスト対象の場合 — repositoryやデータアクセス実装自体を含む — 下記の優先順位に従って実エンジンに対して検証する。データアクセスがテスト対象ではなく依存先である場合はモックが正しい選択で、データ層からデータを受け取るビジネスロジック(repositoryをモック、serviceをテスト)、エラーハンドリングパス(接続失敗、タイムアウト)、データ層がテスト対象でないユニットテストが該当する。

実データベーステスト(環境依存)

実データベースエンジンに対するデータ層の正確性を検証するオプション:

  • CI環境向けのコンテナ化されたデータベース
  • 高速フィードバック用のインメモリデータベース(注: dialect差異が問題を隠す場合がある)
  • seed data付きの専用テストデータベース

リポジトリの根拠に合う最初の選択肢を使用する:

  1. CI用のデータベースハーネスが設定されている場合は、それを使用する。
  2. それ以外でcontainerを実行できる場合は、同じデータベースエンジンをcontainerで使用する。
  3. 検証対象の振る舞いがdialect非依存の場合にのみin-memory databaseを使用し、未検証となるdialect固有の振る舞いを記録する。
  4. リポジトリですでに専用テストデータベースのprovisioningと分離が行われている場合は、それを使用する。

いずれも利用できず、データ層の正確性がテスト対象である場合は作業を止め、不足している環境前提条件を報告する。モックだけの結果は、query、schema、constraint、migrationの正確性を示すエビデンスにはならない。

AI生成コードとスキーマ認識

生成されたデータアクセスコードは、構文が正しくても存在しないスキーマ要素を参照しうるうえ、モックベースのテストはどちらでもパスする。そのためDesign Docに明示的なスキーマ参照を含め、レビュー時にドキュメント化されたスキーマとデータアクセスコードを照合できるようにする。

© shinpr, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills-ja/typescript-testing of shinpr/ai-coding-project-boilerplate.

Open the folder on GitHubat commit 56913a2

Compare with similar skills

Typescript Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Typescript Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Typescript Testing this skillshinpr/ai-coding-project-boilerplate232—~1.1kAutomated safety check: PassMIT
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
Creating A Packagec15t/c15t1.9k—~913Automated safety check: PassApache-2.0
Svelte Testingspences10/sveltest113—~579Automated safety check: PassMIT
Effect TStellahq/opensession392—~3.7kAutomated safety check: PassMIT
Ha Frontend Testinghome-assistant/frontend5.7k—~1.7kAutomated safety check: PassApache-2.0

Similar skills

  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Scaffold a new workspace package in the c15t monorepo. An agent skill from c15t/c15t.

    1.9k GitHub stars~913 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Svelte Testing

    spences10/sveltest

    Fix and create Svelte 5 tests with vitest-browser-svelte and Playwright.

    113 GitHub stars~579 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Effect TS

    tellahq/opensession

    Write idiomatic Effect v4 TypeScript verified against the pinned effect@4.0.0-rc.112 source.

    392 GitHub stars~3.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Ha Frontend Testing

    home-assistant/frontend

    Home Assistant frontend testing and validation workflow. An agent skill from home-assistant/frontend.

    5.7k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Eslint Vitest Rule Tester

    antfu-collective/eslint-vitest-rule-tester

    Help users test ESLint rules with Vitest, supporting snapshot testing and custom assertions

    142 GitHub stars~1.3k tokensUpdated 28 days ago
    Testing & QAAuto-check passed

More from shinpr/ai-coding-project-boilerplate

All 42 skills in this repo
  • Integration E2E Testing

    shinpr/ai-coding-project-boilerplate

    Selects and designs the smallest integration/E2E test set that proves accepted behavior at an observable boundary.

    232 GitHub stars~2.8k tokensUpdated 3 days ago
    Auto-check passed
  • Skill Optimization

    shinpr/ai-coding-project-boilerplate

    Evaluates and optimizes skill file quality using 9 content patterns and 10 editing principles.

    232 GitHub stars~3.5k tokensUpdated 3 days ago
    Auto-check passed
  • Frontend Technical Spec

    shinpr/ai-coding-project-boilerplate

    Defines React environment, component architecture, state/data flow, build verification, and frontend non-functional criteria from repository evidence.

    232 GitHub stars~1.9k tokensUpdated 3 days ago
    Auto-check: notes
  • Frontend Typescript Rules

    shinpr/ai-coding-project-boilerplate

    Applies React/TypeScript type safety, component design, and state management rules.

    232 GitHub stars~1.7k tokensUpdated 3 days ago
    Auto-check passed
  • Implementation Approach

    shinpr/ai-coding-project-boilerplate

    Selects implementation strategy (vertical slice, horizontal, or hybrid) with risk assessment.

    232 GitHub stars~3.2k tokensUpdated 3 days ago
    Auto-check passed
  • Subagents Orchestration Guide

    shinpr/ai-coding-project-boilerplate

    Coordinates subagents through scale-based planning, approval, implementation, verification, and escalation flows.

    232 GitHub stars~8k tokensUpdated 3 days ago
    Auto-check passed

Categories

Questions about Typescript Testing

What does Typescript Testing do?

リポジトリに即したTypeScriptテスト設計、振る舞いの証明、独立性、モック境界の基準を適用する。ユニットテストの作成・レビュー時に使用。. Typescript Testing is an agent skill from shinpr/ai-coding-project-boilerplate.

When should I use Typescript Testing?

Typescript Testing fits situations like: testing & QA work in your project.

How do I install Typescript Testing in Claude Code?

Run `npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a claude-code`. Or copy the skill folder (.claude/skills-ja/typescript-testing in shinpr/ai-coding-project-boilerplate) into .claude/skills/typescript-testing in your project. Claude Code loads it when a task matches its description.

How do I install Typescript Testing in Codex?

Run `npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a codex`. Or copy the skill folder (.claude/skills-ja/typescript-testing in shinpr/ai-coding-project-boilerplate) into .agents/skills/typescript-testing in your project. Codex loads it when a task matches its description.

Can I use Typescript Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shinpr/ai-coding-project-boilerplate --skill typescript-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/typescript-testing, .gemini/skills/typescript-testing, .github/skills/typescript-testing and .opencode/skills/typescript-testing in your project.

What does Typescript Testing need to run?

SKILL.md names no scripts, command-line tools or credentials: Typescript Testing is instructions for the agent only.

Does Typescript Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Typescript Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Typescript Testing use?

Typescript Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Typescript Testing use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Typescript Testing?

Skills that share tags, products or a category with Typescript Testing: Test Writing Workflow (iOfficeAI/AionUi, 33k stars), Creating A Package (c15t/c15t, 1.9k stars), Svelte Testing (spences10/sveltest, 113 stars) and Effect TS (tellahq/opensession, 392 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Typescript Testing?

shinpr (a GitHub user) maintains it in shinpr/ai-coding-project-boilerplate, which has 232 GitHub stars. The repository holds 42 skills in this directory. The repository was last updated on October 4, 2026.

Source: shinpr/ai-coding-project-boilerplate on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.