Skip to main content
command

svelte-test-coverage — Claude Code command: what it does and setup

Analyzes test coverage in Svelte and SvelteKit projects, flags untested code paths, and builds a prioritized testing plan.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command svelte/svelte-test-coverage
Open on GitHub

What svelte-test-coverage does

This command assigns Claude Code the role of a Svelte testing specialist. It runs coverage reports across statements, branches, functions, and lines to pinpoint critical untested logic. The inspection reviews component props, event handlers, conditional rendering, and error handling. For SvelteKit routes, it checks load functions, form actions, and authentication flows.

Gaps follow a clear priority matrix. High priority covers checkout, payment flows, authentication, and data mutations. Medium priority targets form validation, while static UI components sit in low priority. The command expects functional test coverage scripts in the target repository, because it cannot evaluate metrics without an executable coverage report.

The resulting plan suggests specific test cases for stores, utilities, and API calls. It also assists in establishing coverage thresholds, generating badges, and preparing steps for CI/CD pipelines.

What it helps with

  • detect untested load functions and form actions in SvelteKit
  • locate missing tests for component props and event handlers
  • prioritize testing for critical payment and authentication flows
  • define coverage thresholds and badges for CI/CD

Example prompts for the agent

  • /svelte:test-coverage
  • Analyze test coverage for my SvelteKit e-commerce site and flag critical gaps
  • /svelte:test-coverage focus on stores and API data transformations

How to install svelte-test-coverage

1claude-code-templates

npx claude-code-templates@latest --command svelte/svelte-test-coverage

2Manually: put the files in place

.claude/commands/svelte-test-coverage.md

Call it with /svelte-test-coverage. For all projects use ~/.claude/commands/

Questions about svelte-test-coverage

How to install svelte-test-coverage in Claude Code?

Run npx claude-code-templates@latest --command svelte/svelte-test-coverage in your terminal. You can also save the template file to .claude/commands/svelte-test-coverage.md directly.

What does svelte-test-coverage analyze?

It reviews statements, branches, and functions across Svelte components, SvelteKit routes, stores, and utilities. It highlights missing error states, event handlers, and data transformations.

How does svelte-test-coverage prioritize missing tests?

Core user flows such as checkout, payment, auth, and data mutations get high priority. UI variations and form validations receive medium priority, leaving static presentational code for low priority.

Source text

svelte-test-coverage.md · MIT
---
description: "Analyze test coverage, identify testing gaps, and provide recommendations for improving test coverage in Svelte/SvelteKit projects."
---

# /svelte:test-coverage

Analyze test coverage, identify testing gaps, and provide recommendations for improving test coverage in Svelte/SvelteKit projects.

## Instructions

You are acting as the Svelte Testing Specialist Agent focused on test coverage analysis. When analyzing coverage:

1. **Coverage Analysis**:
   - Run coverage reports
   - Identify untested files and functions
   - Analyze coverage metrics (statements, branches, functions, lines)
   - Find critical paths without tests

2. **Gap Identification**:
   
   **Component Coverage**:
   - Props not tested
   - Event handlers without tests
   - Conditional rendering paths
   - Error states
   - Edge cases
   
   **Route Coverage**:
   - Untested load functions
   - Form actions without tests
   - Error boundaries
   - Authentication flows
   
   **Business Logic**:
   - Stores without tests
   - Utility functions
   - Data transformations
   - API integrations

3. **Priority Matrix**:
   ```
   High Priority:
   - Core user flows
   - Payment/checkout processes
   - Authentication/authorization
   - Data mutations
   
   Medium Priority:
   - UI component variations
   - Form validations
   - Navigation flows
   
   Low Priority:
   - Static content
   - Simple presentational components
   ```

4. **Coverage Report Actions**:
   - Generate visual coverage reports
   - Create coverage badges
   - Set up coverage thresholds
   - Integrate with CI/CD

5. **Recommendations**:
   - Suggest specific tests to write
   - Identify high-risk untested code
   - Propose testing strategies
   - Estimate effort for coverage improvement

## Example Usage

User: "Analyze test coverage for my e-commerce site"

Assistant will:
- Run coverage analysis
- Identify critical untested paths (checkout, payment)
- Find components with low coverage
- Analyze store and API coverage
- Create prioritized test writing plan
- Suggest coverage threshold targets
- Provide specific test examples for gaps

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

All slash commands for Testing and QA →

From the same set740

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor