Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计提醒

ln-743-test-infrastructureln 743 测试基础设施

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

6,561

周安装

268

GitHub Stars

437

下载量

2,123
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ln-743-test-infrastructure(ln 743 测试基础设施)
来源仓库:https://github.com/levnikolaevich/claude-code-skills
仓库路径:skills/ln-743-test-infrastructure
安装命令:
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-743-test-infrastructure
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-743-test-infrastructure

简介

用于辅助测试设计、自动化测试、用例整理和回归验证。

  • 适合编写单元测试、端到端测试或根据日志定位问题。
  • 需确认项目测试框架、运行命令和夹具数据后使用。
  • 涉及浏览器或外部服务时,应区分本地模拟与生产环境。
  • 避免为通过测试而修改真实业务逻辑。ln-743-test-infrastructure 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If shared/ is missing, fetch files via WebFetch from https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.

ln-743-test-infrastructure

Type: L3 Worker Category: 7XX Project Bootstrap

Sets up testing frameworks, coverage tools, and sample tests for projects.


Purpose & Scope

Does:

  • Detects project stack to choose appropriate test framework
  • Creates test configuration files
  • Sets up coverage reporting with thresholds
  • Creates sample tests demonstrating patterns
  • Verifies test suite runs successfully

Does NOT:

  • Configure linters (ln-741 does this)
  • Set up pre-commit hooks (ln-742 does this)
  • Write actual application tests (developers do this)

Supported Stacks

TechnologyTest FrameworkCoverage ToolConfig File
TypeScript/ReactVitestv8/Istanbulvitest.config.ts
.NETxUnitCoverlet*.Tests.csproj
Pythonpytestpytest-covpytest.ini or pyproject.toml

Phase 1: Check Existing Tests

Before creating test infrastructure, check what exists.

Files to Check:

StackTest Indicators
TypeScriptvitest.config.*, jest.config.*, *.test.ts, *.spec.ts
.NET*.Tests.csproj, *.IntegrationTests.csproj
Pythonpytest.ini, conftest.py, tests/, test_*.py

Decision Logic:

  1. If complete test setup exists: SKIP (inform user)
  2. If partial setup: ASK to extend or replace
  3. If no tests: CREATE from templates

Phase 2: Create Test Configuration

TypeScript/React (Vitest)

Create vitest.config.ts:

  • Use v8 coverage provider (faster than Istanbul)
  • Configure jsdom environment for React
  • Set coverage thresholds (80% minimum)
  • Create setup file for testing-library

Dependencies:

npm install -D vitest @vitest/coverage-v8 @testing-library/react @testing-library/jest-dom jsdom

.NET (xUnit)

Create test project:

dotnet new xunit -n {Project}.Tests
dotnet sln add tests/{Project}.Tests

Dependencies (in.csproj):

  • Microsoft.NET.Test.Sdk
  • xunit
  • xunit.runner.visualstudio
  • Moq
  • FluentAssertions
  • coverlet.collector

Python (pytest)

Add to pyproject.toml or create pytest.ini:

  • Configure test discovery paths
  • Set coverage thresholds (80% minimum)
  • Configure coverage reporting

Dependencies:

pip install pytest pytest-cov pytest-asyncio
# OR with uv:
uv add --dev pytest pytest-cov pytest-asyncio

Phase 3: Create Test Directory Structure

TypeScript

src/
├── components/
│   ├── Button.tsx
│   └── Button.test.tsx  # Co-located tests
├── test/
│   └── setup.ts         # Test setup file

.NET

tests/
├── {Project}.Tests/
│   ├── Controllers/
│   │   └── SampleControllerTests.cs
│   ├── Services/
│   └── {Project}.Tests.csproj
└── {Project}.IntegrationTests/  # Optional

Python

tests/
├── conftest.py          # Shared fixtures (from conftest_template.py)
├── unit/
│   └── test_sample.py
└── integration/         # Optional

For FastAPI/async projects, generate conftest.py from conftest_template.py with shared async HTTP client fixture. Adapt the app import path to match the project.


Phase 4: Create Sample Tests

Create one sample test per stack demonstrating:

  • AAA pattern (Arrange-Act-Assert)
  • Test naming conventions
  • Basic assertions
  • Framework-specific patterns

TypeScript Sample Test

Shows:

  • render() from testing-library
  • screen queries
  • Jest-dom matchers

.NET Sample Test

Shows:

  • [Fact] attribute
  • Moq for mocking
  • FluentAssertions syntax

Python Sample Test

Shows:

  • pytest fixtures
  • assert statements
  • parametrized tests (optional)

Phase 5: Verify Test Run

After setup, verify tests work.

TypeScript:

npm test
npm run test:coverage

Expected: Sample test passes, coverage report generated

.NET:

dotnet test
dotnet test --collect:"XPlat Code Coverage"

Expected: Sample test passes, coverage collected

Python:

pytest
pytest --cov=src --cov-report=term-missing

Expected: Sample test passes, coverage report shown

On Failure: Check test configuration, dependencies, verify sample test syntax.


Coverage Requirements

MetricMinimumTarget
Lines70%80%
Branches70%80%
Functions70%80%
Statements70%80%

Configure CI to fail if coverage drops below thresholds.


Critical Rules

RULE 1: Coverage thresholds MUST be configured. No exceptions.
RULE 2: Sample tests MUST pass. Don't create broken examples.
RULE 3: Use AAA pattern (Arrange-Act-Assert) in all sample tests.
RULE 4: Co-locate unit tests with source (TypeScript) or use tests/ directory (.NET, Python).

Monitor (2.1.98+): When test verification after scaffold expected >30s, use Monitor. Fallback: Bash(run_in_background=true).

Definition of Done

  • Test framework installed and configured
  • Coverage tool configured with 80% threshold
  • Test directory structure created
  • Sample test created and passing
  • npm test / dotnet test / pytest runs successfully
  • Coverage report generates
  • User informed of:

- How to run tests - Where to add new tests - Coverage requirements


Reference Files

FilePurpose
vitest_template.tsVitest config template
vitest_setup_template.tsTest setup file
react_test_template.tsxReact component test
xunit_csproj_template.xml.NET test project
xunit_test_template.csxUnit test example
pytest_config_template.tomlpytest config
pytest_test_template.pypytest test example
conftest_template.pyShared async fixtures (FastAPI)
testing_guide.mdTesting best practices

Error Handling

ErrorCauseResolution
Vitest not foundNot installednpm install -D vitest
jsdom errorsMissing dependencynpm install -D jsdom
xUnit discovery failsSDK version mismatchUpdate Microsoft.NET.Test.Sdk
pytest not foundNot in PATHpip install pytest
Coverage 0%Wrong source pathCheck coverage.include config

Version: 3.0.0 Last Updated: 2026-03-18

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.55%
按下载量换算649

Gemini CLI

22.71%
按下载量换算482

Codex

19.13%
按下载量换算406

OpenCode

12.6%
按下载量换算267

Antigravity

8.26%
按下载量换算175

windsurf

3.43%
按下载量换算73

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills