test-implement

GitHub

用于实施前端测试的 Skill,支持 React/TypeScript 的单元测试、集成测试及浏览器 E2E 测试。依据配置运行器、模拟层和现有框架生成或补全测试骨架,遵循 AAA 结构、独立性及用户视角命名原则。

skills/test-implement/SKILL.md shinpr/claude-code-workflows

触发场景

创建前端单元测试 创建集成测试 创建浏览器 E2E 测试 补全生成的测试骨架

安装

npx skills add shinpr/claude-code-workflows --skill test-implement -g -y
更多选项

不安装直接使用

npx skills use shinpr/claude-code-workflows@test-implement

指定 Agent (Claude Code)

npx skills add shinpr/claude-code-workflows --skill test-implement -a claude-code -g -y

安装 repo 全部 skill

npx skills add shinpr/claude-code-workflows --all -g -y

预览 repo 内 skill

npx skills add shinpr/claude-code-workflows --list

SKILL.md

Frontmatter
{
    "name": "test-implement",
    "description": "Implements React\/TypeScript unit, integration, and browser E2E tests with the repository's configured runner, mocks, setup, and browser harness. Use when creating or completing frontend tests and generated test skeletons."
}

Test Implementation Patterns

Reference Selection

Test Type Reference When to Use
Unit / Integration references/frontend.md Implementing React component tests with the repository's configured runner and network mocking layer
E2E references/e2e.md Implementing browser-level E2E tests in the existing harness, or Playwright when the approved work introduces a harness

Common Principles

AAA Structure

All tests follow Arrange-Act-Assert:

  • Arrange: Set up preconditions and inputs
  • Act: Execute the behavior under test
  • Assert: Verify the expected outcome

Test Independence

  • Each test runs independently without depending on other tests
  • No shared mutable state between tests
  • Deterministic execution — no random or time dependencies without mocking

Naming

  • Test names describe expected behavior from user perspective
  • One test verifies one behavior

版本历史

  • 56ab6c1 当前 2026-07-19 22:47

    优化技能指引,使其更具项目感知能力,从具体工具栈(RTL+Vitest+MSW)调整为更通用的配置化描述,提升适配性。

  • 66e3b29 2026-07-05 12:02

同 Skill 集合

dev-skills/skills/ai-development-guide/SKILL.md
dev-skills/skills/coding-principles/SKILL.md
dev-skills/skills/documentation-criteria/SKILL.md
dev-skills/skills/external-resource-context/SKILL.md
dev-skills/skills/frontend-ai-guide/SKILL.md
dev-skills/skills/implementation-approach/SKILL.md
dev-skills/skills/integration-e2e-testing/SKILL.md
dev-skills/skills/llm-friendly-context/SKILL.md
dev-skills/skills/test-implement/SKILL.md
dev-skills/skills/testing-principles/SKILL.md
dev-skills/skills/typescript-rules/SKILL.md
dev-workflows-frontend/skills/ai-development-guide/SKILL.md
dev-workflows-frontend/skills/coding-principles/SKILL.md
dev-workflows-frontend/skills/documentation-criteria/SKILL.md
dev-workflows-frontend/skills/external-resource-context/SKILL.md
dev-workflows-frontend/skills/frontend-ai-guide/SKILL.md
dev-workflows-frontend/skills/implementation-approach/SKILL.md
dev-workflows-frontend/skills/integration-e2e-testing/SKILL.md
dev-workflows-frontend/skills/llm-friendly-context/SKILL.md
dev-workflows-frontend/skills/recipe-diagnose/SKILL.md
dev-workflows-frontend/skills/recipe-front-adjust/SKILL.md
dev-workflows-frontend/skills/recipe-front-build/SKILL.md
dev-workflows-frontend/skills/recipe-front-design/SKILL.md
dev-workflows-frontend/skills/recipe-front-plan/SKILL.md
dev-workflows-frontend/skills/recipe-front-review/SKILL.md
dev-workflows-frontend/skills/recipe-task/SKILL.md
dev-workflows-frontend/skills/recipe-update-doc/SKILL.md
dev-workflows-frontend/skills/subagents-orchestration-guide/SKILL.md
dev-workflows-frontend/skills/task-analyzer/SKILL.md
dev-workflows-frontend/skills/test-implement/SKILL.md
dev-workflows-frontend/skills/testing-principles/SKILL.md
dev-workflows-frontend/skills/typescript-rules/SKILL.md
dev-workflows-fullstack/skills/ai-development-guide/SKILL.md
dev-workflows-fullstack/skills/coding-principles/SKILL.md
dev-workflows-fullstack/skills/documentation-criteria/SKILL.md
dev-workflows-fullstack/skills/external-resource-context/SKILL.md
dev-workflows-fullstack/skills/frontend-ai-guide/SKILL.md
dev-workflows-fullstack/skills/implementation-approach/SKILL.md
dev-workflows-fullstack/skills/integration-e2e-testing/SKILL.md
dev-workflows-fullstack/skills/llm-friendly-context/SKILL.md
dev-workflows-fullstack/skills/recipe-add-integration-tests/SKILL.md
dev-workflows-fullstack/skills/recipe-build/SKILL.md
dev-workflows-fullstack/skills/recipe-design/SKILL.md
dev-workflows-fullstack/skills/recipe-diagnose/SKILL.md
dev-workflows-fullstack/skills/recipe-front-adjust/SKILL.md
dev-workflows-fullstack/skills/recipe-front-build/SKILL.md
dev-workflows-fullstack/skills/recipe-front-design/SKILL.md
dev-workflows-fullstack/skills/recipe-front-plan/SKILL.md
dev-workflows-fullstack/skills/recipe-front-review/SKILL.md
dev-workflows-fullstack/skills/recipe-fullstack-build/SKILL.md

元信息

文件数
0
版本
d439b50
Hash
3d036da4
收录时间
2026-07-05 12:02

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-01 10:49
浙ICP备14020137号-1 $访客地图$