Back to Skills

component-tester

sgcarstrends
Updated Today
18 views
9
1
9
View on GitHub
Testingreactaitesting

About

The component-tester skill automatically runs Vitest tests for React components when they're created or modified, ensuring tests pass and coverage thresholds are maintained. It executes component-specific tests with coverage reporting and provides detailed feedback on test results and coverage metrics. Use this during component development or before pull requests to maintain code quality.

Documentation

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

Quick Install

/plugin add https://github.com/sgcarstrends/sgcarstrends/tree/main/component-tester

Copy and paste this command in Claude Code to install this skill

GitHub 仓库

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

Related Skills

sglang

Meta

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.

View skill

evaluating-llms-harness

Testing

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.

View skill

llamaguard

Other

LlamaGuard is Meta's 7-8B parameter model for moderating LLM inputs and outputs across six safety categories like violence and hate speech. It offers 94-95% accuracy and can be deployed using vLLM, Hugging Face, or Amazon SageMaker. Use this skill to easily integrate content filtering and safety guardrails into your AI applications.

View skill

langchain

Meta

LangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.

View skill