MCP HubMCP Hub
スキル一覧に戻る

component-tester

sgcarstrends
更新日 Today
44 閲覧
9
1
9
GitHubで表示
テストreactaitesting

について

component-testerスキルは、Reactコンポーネントが作成または変更された際にVitestテストを自動実行し、テストの合格とカバレッジ基準の維持を保証します。カバレッジレポート付きでコンポーネント固有のテストを実行し、テスト結果とカバレッジ指標に関する詳細なフィードバックを提供します。コンポーネント開発中やプルリクエスト前に使用することで、コード品質を維持できます。

クイックインストール

Claude Code

推奨
プラグインコマンド推奨
/plugin add https://github.com/sgcarstrends/sgcarstrends
Git クローン代替
git clone https://github.com/sgcarstrends/sgcarstrends.git ~/.claude/skills/component-tester

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Component Tester Skill

This Skill automatically runs Vitest tests when React components are modified to ensure code quality and test coverage.

When to Activate

  • After creating a new React component
  • When modifying existing component implementation
  • Before creating a pull request with component changes
  • When fixing bugs in components

Actions Performed

  1. Identify Component: Determine which component was created or modified
  2. Run Tests: Execute pnpm test -- <component-path> without watch mode
  3. Check Coverage: Verify test coverage meets project thresholds
  4. Report Results: Provide clear feedback on:
    • Test pass/fail status
    • Coverage percentages (statements, branches, functions, lines)
    • Specific failing tests with error messages
    • Coverage gaps requiring additional tests

Example Usage

// User modifies: src/app/blog/_components/progress-bar.tsx
// Skill automatically runs:
// pnpm test -- src/app/blog/_components/progress-bar

// Output:
// ✓ should render progress bar with correct width
// ✓ should update progress on scroll
// ✓ should hide when not scrolled
// Coverage: 95% statements, 90% branches, 100% functions, 95% lines

Tools Used

  • Read: Examine component files and test files
  • Grep: Locate related test files
  • Bash: Execute pnpm test commands

Test Naming Convention

All tests should follow the "should" convention:

  • ✅ "should render title and children"
  • ✅ "should display empty state when data is empty"
  • ❌ "renders title and children"

Coverage Thresholds

Flag components with coverage below:

  • Statements: 80%
  • Branches: 75%
  • Functions: 80%
  • Lines: 80%

Related Files

  • Test location: __tests__/ directories next to components
  • Test suffix: .test.ts or .test.tsx
  • Configuration: vitest.config.ts in project root

GitHub リポジトリ

sgcarstrends/sgcarstrends
パス: apps/web/.claude/skills/component-tester
apiaws-lambdabackendhonojob-schedulerneon-postgres

関連スキル

content-collections

メタ

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

スキルを見る

evaluating-llms-harness

テスト

This Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.

スキルを見る

sglang

メタ

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

スキルを見る

cloudflare-turnstile

メタ

This skill provides comprehensive guidance for implementing Cloudflare Turnstile as a CAPTCHA-alternative bot protection system. It covers integration for forms, login pages, API endpoints, and frameworks like React/Next.js/Hono, while handling invisible challenges that maintain user experience. Use it when migrating from reCAPTCHA, debugging error codes, or implementing token validation and E2E tests.

スキルを見る