AGENT SKILL

vitest

Plan and write Vitest tests for changed code. Analyses git diff, checks existing tests, produces a concrete test plan using flat test structure (no describe/it blocks). Use when adding tests for new/changed code, improving Vitest coverage, or asking what to test after a change.

License 许可
GPL-3.0
所属仓库
Artawower/kaizen
最近更新
2026-11-10
Stars
★ 2
Forks
0

01 前言 Front Matter

name
vitest
description
Plan and write Vitest tests for changed code. Analyses git diff, checks existing tests, produces a concrete test plan using flat test structure (no describe/it blocks). Use when adding tests for new/changed code, improving Vitest coverage, or asking what to test after a change.

03 SKILL.md 正文

Vitest Test Planning

Trigger

Use this skill when the user asks to write or plan tests for code changes visible in git diff.

Conventions (non-negotiable)

  • Framework: Vitest
  • Structure: flat — use test('EntityName does X', ...) only. No describe, no it.
  • Method: black-box — test only via public signatures; never expose internals or make private things public for the sake of testing.
  • Never modify implementation to make it testable.

Process

  1. Run git diff HEAD (or use arguments if provided) to identify changed code.
  2. Read changed files to understand public interfaces.
  3. Check existing tests to avoid duplication and understand current coverage.
  4. Produce a test plan with concrete test(...) names and what each asserts.

Test plan format

## Test plan: <filename or feature>

### New tests
- test('UserService creates a user with valid data') → asserts returned user has correct fields
- test('UserService throws on duplicate email') → expects specific error type/message
- test('UserService.getById returns null for unknown id') → edge case

### Existing tests to update
- test('...') → reason for update

### Coverage gaps found (no action required from AI)
- ...

Quality criteria

  • Every test must be purposeful — no coverage for coverage's sake.
  • Each test asserts one clear behaviour.
  • Edge cases (null, empty, boundary values, error paths) must be included where meaningful.

Output

Respond in the user's language.

04 同仓库更多 Skills

Artawower
Artawower/kaizen

yt-analyze

Fetch YouTrack task + comments via MCP, critically analyze relevance and requirements, produce concise summary of what to implement, and build an implementation plan mapped to codebase. Trigger - YouTrack issue ID or request to "analyze task", "plan task", "break down YT issue".

Skill与智能体开发
★ 2
Artawower
Artawower/kaizen

youtrack-task

Analyzes a YouTrack issue, reviews comments and attachments, and proposes or creates actionable subtasks. Use when the user gives a YouTrack issue ID and wants synthesis, decomposition, or follow-up tasks.

★ 2
Artawower
Artawower/kaizen

youtrack-search

Searches YouTrack from natural language or native query syntax and returns a concise report with the most relevant issues. Use when the user wants to find issues, triage work, or translate a plain-language query into YouTrack search.

★ 2
Artawower
Artawower/kaizen

writing-for-agents

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

内容创作者写作与文案
★ 2
Artawower
Artawower/kaizen

write-a-prd

Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.

产品经理
★ 2
Artawower
Artawower/kaizen

skill-reviewer

Analyzes pi skills — both remote (URL/GitHub) and local (installed on disk). Fetches the skill, runs a security audit, summarizes what it does and which problems it solves, then polls multiple AI models for a multi-model consensus rating. Use this skill whenever the user shares a link to a skill and wants to know if it's safe and worth installing, asks to review or evaluate a skill from GitHub, asks to audit an already installed local skill, says something like 'check this skill', 'review my skills', 'should I install this', 'audit this skill', or wants a second opinion on a skill's quality. Also triggers on 'проанализируй скилл', 'проверь скилл по ссылке', 'оцени скилл', 'проверь локальный скилл' — works in both English and Russian.

Skill与智能体开发
★ 2