Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计未展示

test-standards-enforcer测试标准执行者

Agent Skill

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

总安装

441

周安装

18

GitHub Stars

公开资料未说明

下载量

143
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add yonatangross/skillforge-claude-plugin --skill "test-standards-enforcer"

简介

确保技能开发符合预设质量标准和规范。

  • 自动检测代码风格和文档完整性问题。
  • 提供改进建议以提升技能可维护性。test-standards-enforcer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 通过 npx 从 skillforge-claude-plugin 仓库安装。
  • 适用于团队协作中的代码一致性管理。

SKILL.md

Enforce 2026 testing best practices with BLOCKING validation.

Validation Rules

BLOCKING Rules (exit 1)

RuleCheckExample Violation
Test LocationTests must be in tests/ or __tests__/src/utils/helper.test.ts
AAA PatternTests must have Arrange/Act/Assert structureNo clear sections
Descriptive NamesTest names must describe behaviortest('test1')
No Shared StateTests must not share mutable statelet globalVar = [] without reset
Coverage ThresholdCoverage must be ≥ 80%75% coverage

File Location Rules

ALLOWED:
  tests/unit/user.test.ts
  tests/integration/api.test.ts
  __tests__/components/Button.test.tsx
  app/tests/test_users.py
  tests/conftest.py

BLOCKED:
  src/utils/helper.test.ts      # Tests in src/
  components/Button.test.tsx    # Tests outside test dir
  app/routers/test_routes.py    # Tests mixed with source

Naming Conventions

TypeScript/JavaScript:

// GOOD - Descriptive, behavior-focused
test('should return empty array when no items exist', () => {})
test('throws ValidationError when email is invalid', () => {})
it('renders loading spinner while fetching', () => {})

// BLOCKED - Too short, not descriptive
test('test1', () => {})
test('works', () => {})
it('test', () => {})

Python:

# GOOD - snake_case, descriptive
def test_should_return_user_when_id_exists():
def test_raises_not_found_when_user_missing():

# BLOCKED - Not descriptive, wrong case
def testUser():      # camelCase
def test_1():        # Not descriptive

AAA Pattern (Required)

Every test must follow Arrange-Act-Assert:

TypeScript Example

describe('calculateDiscount', () => {
  test('should apply 10% discount for orders over $100', () => {
    // Arrange
    const order = createOrder({ total: 150 });
    const calculator = new DiscountCalculator();

    // Act
    const discount = calculator.calculate(order);

    // Assert
    expect(discount).toBe(15);
  });
});

Python Example

class TestCalculateDiscount:
    def test_applies_10_percent_discount_over_threshold(self):
        # Arrange
        order = Order(total=150)
        calculator = DiscountCalculator()

        # Act
        discount = calculator.calculate(order)

        # Assert
        assert discount == 15

Test Isolation (Required)

Tests must not share mutable state:

// BLOCKED - Shared mutable state
let items = [];

test('adds item', () => {
  items.push('a');
  expect(items).toHaveLength(1);
});

test('removes item', () => {
  // FAILS - items already has 'a' from previous test
  expect(items).toHaveLength(0);
});

// GOOD - Reset state in beforeEach
describe('ItemList', () => {
  let items: string[];

  beforeEach(() => {
    items = []; // Fresh state each test
  });

  test('adds item', () => {
    items.push('a');
    expect(items).toHaveLength(1);
  });

  test('starts empty', () => {
    expect(items).toHaveLength(0); // Works!
  });
});

Coverage Requirements

AreaMinimumTarget
Overall80%90%
Business Logic90%100%
Critical Paths95%100%
New Code100%100%

Running Coverage

TypeScript (Vitest/Jest):

npm test -- --coverage
npx vitest --coverage

Python (pytest):

pytest --cov=app --cov-report=json

Parameterized Tests

Use parameterized tests for multiple similar cases:

TypeScript

describe('isValidEmail', () => {
  test.each([
    ['user@example.com', true],
    ['invalid', false],
    ['@missing.com', false],
    ['user@domain.co.uk', true],
    ['user+tag@example.com', true],
  ])('isValidEmail(%s) returns %s', (email, expected) => {
    expect(isValidEmail(email)).toBe(expected);
  });
});

Python

import pytest

class TestIsValidEmail:
    @pytest.mark.parametrize("email,expected", [
        ("user@example.com", True),
        ("invalid", False),
        ("@missing.com", False),
        ("user@domain.co.uk", True),
    ])
    def test_email_validation(self, email: str, expected: bool):
        assert is_valid_email(email) == expected

Fixture Best Practices (Python)

import pytest

# Function scope (default) - Fresh each test
@pytest.fixture
def db_session():
    session = create_session()
    yield session
    session.rollback()

# Module scope - Shared across file
@pytest.fixture(scope="module")
def expensive_model():
    return load_ml_model()  # Only loads once per file

# Session scope - Shared across all tests
@pytest.fixture(scope="session")
def db_engine():
    engine = create_engine(TEST_DB_URL)
    yield engine
    engine.dispose()

Common Violations

1. Test in Wrong Location

BLOCKED: Test file must be in tests/ directory
  File: src/utils/helpers.test.ts
  Move to: tests/utils/helpers.test.ts

2. Missing AAA Structure

BLOCKED: Test pattern violations detected
  - Tests should follow AAA pattern (Arrange/Act/Assert)
  - Add comments or clear separation between sections

3. Shared Mutable State

BLOCKED: Test pattern violations detected
  - Shared mutable state detected. Use beforeEach to reset state.

4. Coverage Below Threshold

BLOCKED: Coverage 75.2% is below threshold 80%

Actions required:
  1. Add tests for uncovered code
  2. Run: npm test -- --coverage
  3. Ensure coverage >= 80% before proceeding

Related Skills

  • integration-testing - Component interaction tests
  • e2e-testing - End-to-end with Playwright
  • msw-mocking - Network mocking
  • test-data-management - Fixtures and factories

Capability Details

aaa-pattern

Keywords: AAA, arrange act assert, test structure, test pattern Solves:

  • Enforce Arrange-Act-Assert pattern
  • Ensure clear test structure
  • Improve test readability

test-naming

Keywords: test name, test naming, descriptive test, test description Solves:

  • Enforce descriptive test names
  • Block generic test names like test1
  • Improve test documentation

test-location

Keywords: test location, test directory, tests folder, where tests Solves:

  • Validate test file placement
  • Block tests mixed with source
  • Enforce test directory structure

coverage-threshold

Keywords: coverage, test coverage, code coverage, 80%, threshold Solves:

  • Enforce minimum 80% coverage
  • Block merges with low coverage
  • Maintain quality standards

test-isolation

Keywords: test isolation, shared state, independent tests, flaky Solves:

  • Detect shared mutable state
  • Ensure test independence
  • Prevent flaky tests

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Claude Code

27.16%
按下载量换算39

OpenCode

23.56%
按下载量换算34

Antigravity

18.07%
按下载量换算26

Gemini CLI

11.71%
按下载量换算17

windsurf

8.52%
按下载量换算12

trae

4.01%
按下载量换算6

安全审计

暂无安全审计结果可展示。

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills