Token导航 LogoToken导航

Agent Skill · 研究检索

testing-standards(检测标准)

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

testing-standards 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 7,601。

总安装 18,526周安装 659GitHub Stars 1,597下载 8,805核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/maxritter/claude-codepro --skill 'Testing Standards'

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

模拟将测试中的代码与外部依赖项隔离开来。他们不是测试的对象。

当不确定时: 首先编写具有真实依赖关系的测试 识别速度慢的或外部的(API 调用、数据库查询、文件 I/O) 仅模拟最低级别的特定依赖关系 验证测试仍然验证真实行为,而不是模拟存在 每周安装量 – 存储库 maxritter/克劳德-codepro GitHub 之星 1.6K 第一次看到 – 安全审计 Gen Agent Trust Hub 通行证

来源仓库内路径:skills/testing-standards

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/maxritter/claude-codepro --skill 'Testing Stan…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

testing-standards 怎么安装?

在终端执行 npx skills add https://github.com/maxritter/claude-codepro --skill 'Testing Standards'。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

testing-standards 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

testing-standards 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

testing-standards 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

testing-standards 用的人多吗?

公开数据是累计安装 18,526 次,近一周安装 659 次,下载 8,805 次,GitHub 1,597 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

testing-standards 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
testing-standards

检测标准 · 本页

18,5261,597调用外部服务MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Testing Standards

Rule: Test real behavior, not mock behavior. Never pollute production code with test-only methods.

When to use this skill

  • When writing new test files or test cases in any testing framework (Jest, Vitest, pytest, RSpec, Go testing, JUnit)
  • When modifying existing tests that use mocks, stubs, spies, or test doubles
  • When considering whether to add a method or property to a production class that would only be used in tests
  • When test setup involves creating mock objects or configuring mock behavior
  • When deciding between testing with real dependencies versus mocked dependencies
  • When tests are failing and you need to determine if the issue is in the code or in how mocks are configured
  • When implementing fixtures, test data builders, or test utilities
  • During test code reviews to ensure testing best practices are followed
  • When test files contain assertions that check for mock existence (e.g., expect(screen.getByTestId('component-mock')))
  • When refactoring production code and tests need to be updated accordingly
  • When choosing isolation strategies for unit tests versus integration tests

Core Principles

  1. Mocks are isolation tools, not test subjects - Assert on real behavior, not mock existence
  2. Production code stays pure - Test utilities handle test-specific needs
  3. Understand before mocking - Know what side effects you're removing
  4. Complete mocks or none - Partial mocks create silent failures
  5. TDD prevents anti-patterns - Write failing tests first to avoid testing mocks

Anti-Pattern 1: Testing Mock Behavior

Violation:

// ❌ BAD: Asserting on mock existence
test('renders sidebar', () => {
  render(<Page />);
  expect(screen.getByTestId('sidebar-mock')).toBeInTheDocument();
});

Why wrong:

  • Verifies mock works, not component behavior
  • Test passes with mock present regardless of real functionality
  • Provides zero confidence about production behavior

Fix:

// ✅ GOOD: Test real component
test('renders sidebar', () => {
  render(<Page />);  // Use real sidebar
  expect(screen.getByRole('navigation')).toBeInTheDocument();
});

// OR if isolation required: Test Page's behavior, not mock presence
test('renders page with sidebar slot', () => {
  render(<Page />);
  expect(screen.getByTestId('sidebar-container')).toBeInTheDocument();
});

Detection rule:

IF assertion contains '*-mock' OR checks mock.toHaveBeenCalled():
  Ask: "Am I testing real behavior or mock existence?"
  IF testing mock existence → STOP, delete assertion or unmock

Anti-Pattern 2: Test-Only Methods in Production Code

Violation:

// ❌ BAD: Method only called from tests
class Session {
  async destroy() {
    await this._workspaceManager?.destroyWorkspace(this.id);
  }
}

afterEach(() => session.destroy());

Why wrong:

  • Pollutes production API with test-specific code
  • Risk of accidental production calls
  • Violates YAGNI (You Aren't Gonna Need It)
  • Confuses class responsibilities

Fix:

// ✅ GOOD: Test utilities handle cleanup
// Session class has no destroy() method

// In test-utils.ts
export async function cleanupSession(session: Session) {
  const workspace = session.getWorkspaceInfo();
  if (workspace) {
    await workspaceManager.destroyWorkspace(workspace.id);
  }
}

// In tests
afterEach(() => cleanupSession(session));

Detection rule:

BEFORE adding method to production class:
  1. Search codebase: Is this method only called from test files?
  2. Ask: Does this class own this resource's lifecycle?

  IF only used in tests OR class doesn't own lifecycle:
    STOP - Create test utility function instead

Anti-Pattern 3: Mocking Without Understanding Dependencies

Violation:

// ❌ BAD: Mock removes side effect test depends on
test('detects duplicate server', () => {
  vi.mock('ToolCatalog', () => ({
    discoverAndCacheTools: vi.fn().mockResolvedValue(undefined)
  }));

  await addServer(config);
  await addServer(config);  // Should throw but won't - config never written!
});

Why wrong:

  • Mocked method writes config that duplicate detection needs
  • Over-mocking "to be safe" breaks test logic
  • Test passes/fails for wrong reasons

Fix:

// ✅ GOOD: Mock only external/slow operations
test('detects duplicate server', () => {
  vi.mock('MCPServerManager'); // Mock slow server startup only

  await addServer(config);  // Config written ✓
  await addServer(config);  // Duplicate detected ✓
});

Decision process:

BEFORE mocking:
  1. List method's side effects (DB writes, file I/O, API calls, state changes)
  2. Identify what test actually needs (duplicate detection needs config write)
  3. Mock ONLY external/slow operations, preserve test dependencies

  IF unsure what test needs:
    Run with real implementation FIRST
    Observe required behavior
    THEN mock minimally at lowest level

  Red flags indicating wrong approach:
    - "Mock this to be safe"
    - "Might be slow, better mock"
    - Can't explain why mocking
    - Mock setup longer than test

Anti-Pattern 4: Incomplete Mock Data Structures

Violation:

// ❌ BAD: Only fields you think you need
const mockResponse = {
  status: 'success',
  data: { userId: '123', name: 'Alice' }
  // Missing: metadata field
};

// Later: Silent failure when code accesses response.metadata.requestId

Why wrong:

  • Partial mocks hide structural assumptions
  • Downstream code may depend on omitted fields
  • Tests pass, production fails
  • False confidence in test coverage

Fix:

// ✅ GOOD: Complete structure matching real API
const mockResponse = {
  status: 'success',
  data: { userId: '123', name: 'Alice' },
  metadata: { requestId: 'req-789', timestamp: 1234567890 }
};

Mandatory process:

BEFORE creating mock data:
  1. Check API documentation or real response examples
  2. Include ALL fields from actual structure
  3. Use realistic values (not null/undefined unless API returns them)
  4. Verify mock matches real schema completely

  IF uncertain about structure:
    - Examine real API response
    - Include all documented fields
    - Add comment linking to API docs

Anti-Pattern 5: Tests as Afterthought

Violation:

Implementation complete → No tests → "Ready for review"

Why wrong:

  • Testing is part of implementation, not optional
  • Violates TDD workflow
  • Cannot claim completion without tests

Fix - TDD cycle:

1. Write failing test (RED)
2. Implement minimal code (GREEN)
3. Refactor
4. THEN claim complete

When Mocks Signal Deeper Issues

Warning signs:

  • Mock setup > 50% of test code
  • Mocking everything to make test pass
  • Mocks missing methods real components have
  • Test breaks when mock implementation changes
  • Can't explain why each mock is needed

Question to ask: "Should this be an integration test with real components?"

Complex mocks often indicate integration tests would be simpler and more valuable.

How TDD Prevents These Anti-Patterns

TDD workflow naturally avoids anti-patterns:

  1. Write test first → Forces clarity on what you're testing
  2. Watch it fail → Confirms test verifies real behavior, not mocks
  3. Minimal implementation → Prevents test-only methods
  4. Real dependencies first → See actual needs before mocking

Key insight: If you're testing mock behavior, you violated TDD by adding mocks before seeing test fail against real code.

Detection Checklist

Before finalizing any test, verify:

  • No assertions on mock existence (*-mock test IDs, toHaveBeenCalled without behavior verification)
  • No methods in production classes only called from test files
  • Understand what each mock removes (side effects, dependencies, behavior)
  • Mock data structures complete (all fields from real API/response)
  • Tests written before or during implementation (not after)
  • Mock setup < 50% of test code (if more, consider integration test)
  • Can explain necessity of each mock

Quick Reference

Anti-PatternDetection SignalFix
Testing mock behaviorAssertions on *-mock elements or mock callsTest real component or remove mock
Test-only methodsMethod only in test file searchesMove to test utilities
Blind mockingCan't explain mock purposeUnderstand dependencies, mock minimally
Incomplete mocksMissing fields from real structureInclude all documented fields
Tests afterthoughtImplementation before testsFollow TDD: test first
Over-complex mocksSetup > 50% of testUse integration test

Red Flags - Stop and Reconsider

When you encounter these, stop and reassess your approach:

  • Assertions check for *-mock test IDs
  • Methods only called in test files
  • Mock setup > 50% of test code
  • Test fails when you remove mock
  • Can't explain why mock is needed
  • Mocking "just to be safe"
  • Mock missing methods real component has

Summary

Mocks isolate code under test from external dependencies. They are not the subject of tests.

When uncertain:

  1. Write test with real dependencies first
  2. Identify what's slow or external (API calls, DB queries, file I/O)
  3. Mock only that specific dependency at lowest level
  4. Verify test still validates real behavior, not mock presence

平台分布

Claude Code

26.47%
按下载量换算2,331

OpenCode

21.91%
按下载量换算1,929

Cursor

16.4%
按下载量换算1,444

Codex

11.87%
按下载量换算1,045

Gemini CLI

8.66%
按下载量换算763

windsurf

3.4%
按下载量换算299

安全审计

Gen Agent Trust Hub

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills