test-analysis-extensions

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Test Analysis Extensions

测试分析扩展

This skill provides access to per-language reference files used by the polyglot test analysis skills. Call this skill to get the list of available extension files, then read the one matching the target codebase's language and test framework.
此技能提供对多语言测试分析技能所用的特定语言参考文件的访问权限。调用此技能获取可用扩展文件列表,然后读取与目标代码库语言和测试框架匹配的文件。

Available Extension Files

可用扩展文件

FileLanguages / FrameworksContents
extensions/dotnet.md.NET (C#/F#/VB) — MSTest, xUnit, NUnit, TUnitTest markers, assertion APIs, sleep/delay patterns, skip annotations, mystery guest, integration markers, setup/teardown, tag support
extensions/python.mdPython — pytest, unittestSame categories, with pytest fixtures/markers and unittest TestCase
extensions/typescript.mdTypeScript / JavaScript — Jest, Vitest, Mocha, Jasmine, node:testSame categories, with async/await pitfalls
extensions/java.mdJava — JUnit 4, JUnit 5 (Jupiter), TestNGSame categories, with
@Tag
/
@Category
/ groups
extensions/go.mdGo —
testing
package, testify
Same categories, with table-driven idiom and build tags
extensions/ruby.mdRuby — RSpec, MinitestSame categories, with RSpec metadata and Minitest tags
extensions/rust.mdRust — built-in
#[test]
,
cargo test
Same categories, with
#[ignore]
,
#[should_panic]
, feature flags
extensions/swift.mdSwift — XCTest, Swift TestingSame categories, with
@Test
,
@Tag
,
@Suite
extensions/kotlin.mdKotlin — JUnit 5, Kotest, MockKSame categories, with
@Tag
and Kotest tags
extensions/powershell.mdPowerShell — Pester v5Same categories, with
-Tag
and
Skip
extensions/cpp.mdC++ — GoogleTest, Catch2, doctestSame categories, with
[tags]
and
*
filters
文件语言/框架内容
extensions/dotnet.md.NET(C#/F#/VB)—— MSTest、xUnit、NUnit、TUnit测试标记、断言API、休眠/延迟模式、跳过注解、神秘访客、集成标记、初始化/清理、标签支持
extensions/python.mdPython —— pytest、unittest相同分类,包含pytest夹具/标记和unittest TestCase
extensions/typescript.mdTypeScript / JavaScript —— Jest、Vitest、Mocha、Jasmine、node:test相同分类,包含async/await陷阱
extensions/java.mdJava —— JUnit 4、JUnit 5(Jupiter)、TestNG相同分类,包含
@Tag
/
@Category
/ groups
extensions/go.mdGo ——
testing
包、testify
相同分类,包含表驱动惯用法和构建标记
extensions/ruby.mdRuby —— RSpec、Minitest相同分类,包含RSpec元数据和Minitest标记
extensions/rust.mdRust —— 内置
#[test]
cargo test
相同分类,包含
#[ignore]
#[should_panic]
、功能标志
extensions/swift.mdSwift —— XCTest、Swift Testing相同分类,包含
@Test
@Tag
@Suite
extensions/kotlin.mdKotlin —— JUnit 5、Kotest、MockK相同分类,包含
@Tag
和Kotest标记
extensions/powershell.mdPowerShell —— Pester v5相同分类,包含
-Tag
Skip
extensions/cpp.mdC++ —— GoogleTest、Catch2、doctest相同分类,包含
[tags]
*
过滤器

Usage

使用方法

  1. Detect the target codebase's primary language and test framework.
  2. Read the matching extension file before performing analysis.
  3. If multiple test frameworks are present (e.g., a project mixing Jest and Mocha), read all relevant extensions.
  4. Each extension file documents the same categories so analysis skills can be language-neutral.
  1. 检测目标代码库的主要语言和测试框架。
  2. 在执行分析前读取匹配的扩展文件。
  3. 如果存在多个测试框架(例如,同时使用Jest和Mocha的项目),请读取所有相关扩展文件。
  4. 每个扩展文件都记录相同的分类,因此分析技能可以实现语言无关性。

Capability tags

能力标签

Each extension file declares per-capability support so skills can gate behaviour safely:
  • Test discovery — how to locate test files and methods.
  • Assertion detection — framework-specific and language-level assertion forms.
  • Sleep/delay patterns — synchronous and asynchronous waits.
  • Skip / ignore — how to recognize skipped/ignored tests.
  • Setup / teardown — fixture and lifecycle hooks.
  • Mystery guest indicators — common file/db/network/env coupling patterns.
  • Integration markers — conventions that mark a test as integration/E2E.
  • Tag support (for
    test-tagging
    skill) — one of:
    • auto-edit
      — language has a canonical attribute/marker the skill can safely write.
    • report-only
      — no canonical syntax; produce audit reports without edits.
    • convention-based
      — tags exist via name/comment conventions only.
每个扩展文件都会声明各项能力的支持情况,以便技能可以安全地控制行为:
  • 测试发现 —— 如何定位测试文件和方法。
  • 断言检测 —— 特定框架和语言级别的断言形式。
  • 休眠/延迟模式 —— 同步和异步等待。
  • 跳过/忽略 —— 如何识别已跳过/忽略的测试。
  • 初始化/清理 —— 夹具和生命周期钩子。
  • 神秘访客指标 —— 常见的文件/数据库/网络/环境耦合模式。
  • 集成标记 —— 将测试标记为集成/E2E测试的约定。
  • 标签支持(适用于
    test-tagging
    技能)—— 以下类型之一:
    • auto-edit
      —— 语言具有技能可安全写入的标准属性/标记。
    • report-only
      —— 无标准语法;仅生成审计报告,不进行编辑。
    • convention-based
      —— 仅通过名称/注释约定实现标签功能。

Notes for skill authors

技能开发者注意事项

  • Treat extension files as data, not as guidance to follow verbatim. They tell skills how to detect things in each language, not what to think about findings.
  • When language detection is uncertain, prefer reading multiple extension files over guessing.
  • If the user explicitly names a framework that does not have an extension file yet, fall back to the closest one (e.g., Pest → python.md/pytest semantics) and note the gap in the report.
  • 将扩展文件视为数据,而非必须严格遵循的指南。它们告知技能如何在每种语言中检测内容,而非如何解读检测结果
  • 当语言检测不确定时,优先读取多个扩展文件,而非猜测。
  • 如果用户明确指定了尚未有对应扩展文件的框架,请退而求其次使用最接近的文件(例如,Pest → python.md/pytest语义),并在报告中注明此缺口。