Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

create-tests-extract创建测试摘录

Agent Skill

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

总安装

509

周安装

21

GitHub Stars

公开资料未说明

下载量

166
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:create-tests-extract(创建测试摘录)
来源仓库:https://github.com/ulpi-io/skills
仓库路径:skills/create-tests-extract
安装命令:
npx skills add https://github.com/ulpi-io/skills --skill create-tests-extract
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/ulpi-io/skills --skill create-tests-extract

简介

用于将内联测试提取至独立文件,保持访问权限与覆盖率不变。

  • 优先选择相邻测试模块,保留私有方法的可测试性,减少集成测试依赖。
  • 操作前需完整读取源文件与现有测试,变更生产代码仅以满足模块接线为准。
  • 提取完成后应运行最窄范围的关联测试,验证重构前后行为一致性。
  • create-tests-extract 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Non-negotiable rules:

  1. Read the source file and its inline tests fully before moving anything.
  2. Preserve the original visibility and helper access model.
  3. Prefer adjacent test modules over integration tests when private access matters.
  4. Change production code only as much as module wiring requires.
  5. Run the narrowest relevant tests after extraction.

create-tests-extract

Inputs

  • $request: Source file, module, or cleanup goal

Goal

Move bulky inline tests into adjacent files while keeping:

  • the same effective test coverage
  • the same access to private items where needed
  • a clearer production file

Step 0: Read and classify the test block

Inspect:

  • the production file
  • the inline test module
  • helper functions or fixtures used only by tests
  • whether the tests depend on super::* or private module items

If the file belongs to a Rust crate, use rust for conventions before changing the module layout.

Success criteria: The tests are classified as local-inline, adjacent-module, or true integration candidates.

Step 1: Choose the smallest safe extraction boundary

Prefer:

  • foo.rs + #[cfg(test)] mod foo_tests; + foo_tests.rs
  • or foo/mod.rs + tests.rs for directory modules

Avoid pushing tests into top-level tests/ unless they genuinely should become public-API integration tests.

Success criteria: The new layout preserves the intended visibility model.

Step 2: Extract without semantic drift

When moving the tests:

  • add the minimal #[cfg(test)] mod...; wiring
  • keep use super::*; or equivalent imports when needed
  • preserve test names and attributes
  • move test-only helpers with the suite that needs them

Do not rename tests or restructure production modules unless the extraction requires it.

Success criteria: The moved tests still compile in the same effective context.

Step 3: Verify the moved suite

After extraction:

  • run the narrowest relevant tests
  • check for warnings or visibility regressions
  • verify the production file is materially easier to scan

Success criteria: The new layout passes and preserves behavior.

Guardrails

  • Do not turn private unit tests into public-only integration tests by accident.
  • Do not move tiny, explanatory inline tests that still improve readability where they are.
  • Do not broaden the refactor beyond the requested extraction.
  • Do not drop fixtures or helper coverage just to shorten the production file.

Output Contract

Report:

  1. files created or modified
  2. extraction layout chosen
  3. any tests intentionally left inline
  4. validation run after the move

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.4%
按下载量换算57

Claude

31.97%
按下载量换算53

Cursor

16.81%
按下载量换算28

Gemini CLI

8.93%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills