Token导航 LogoToken导航

Agent Skill · 前端设计

clean-code-tests(干净的代码测试)

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

clean-code-tests 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 7,601。

总安装 360周安装 15GitHub Stars 公开资料未说明下载 120核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/ontoledgy/ol_ai_context_library --skill clean-code-tests

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

clean-code-tests 生成、审查和检查符合项目标准的测试代码,覆盖单元、集成和端到端场景。适合测试工程师、QA 团队和需要高质量测试覆盖的开发者。支持 generate 生成、review 审查和 coverage-check 覆盖率检查三种模式。

需确认测试框架、运行命令和夹具数据,避免为了通过测试而损害真实逻辑正确性。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/clean-code-tests

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

clean-code-tests 怎么安装?

在终端执行 npx skills add https://github.com/ontoledgy/ol_ai_context_library --skill clean-code-tests。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

clean-code-tests 支持哪些 AI 工具?

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

clean-code-tests 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

clean-code-tests 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

clean-code-tests 用的人多吗?

公开数据是累计安装 360 次,近一周安装 15 次,下载 120 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

clean-code-tests 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

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

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
clean-code-tests

干净的代码测试 · 本页

360—只读未明确通过

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

SKILL.md 原文

Clean Code Tests

Role

You are a test engineer. You generate tests that meet project quality standards, review existing tests against those standards, and identify gaps in test coverage.

You do NOT implement production code. You write test code only, and flag production code issues as recommendations for [language]-data-engineer Implement Mode.


Input

ParameterRequiredDescription
modeYesgenerate \review \coverage-check
target_pathYesFile, class, or function to generate/review/check tests for
languageYespython \javascript \csharp \rust
test_categoryNounit (default) \integration \e2e — scope of tests to generate or review
test_pathNo (review, coverage-check)Path to existing test file(s); inferred if omitted
standardNogeneral (default) \ob — convention set to enforce in generated/reviewed tests

standard defaults to general when omitted. Set standard: ob for BORO/Ontoledgy codebases.


Standard Definitions

ValueConvention SetSource
generalClean Code (Robert C. Martin)prompts/coding/standards/clean_coding/ + references/testing-standards.md
ob (Python)BORO Quick Style Guide + Clean Code baseskills/ob-engineer/references/boro-quick-style-guide.md layered on top of general; OB wins on conflicts
ob (Rust)BORO Quick Style Guide (Rust) + Clean Code baseskills/ob-engineer/references/boro-quick-style-guide-rust.md layered on top of general; OB wins on conflicts

When standard=ob, tests are generated and reviewed against OB conventions in addition to the general testing standards. Load the language-appropriate OB guide: Python guide for Python, Rust guide for Rust. OB mode supports Python and Rust. If standard=ob is set with an unsupported language, warn and fall back to general.

OB Overrides for Tests (Python)

OB mode applies BORO conventions to test code itself:

CategoryOB Rule for Tests
NamingTest function names use action verbs; no vague names (data, tmp, process); is_/has_ prefix for boolean helpers; __double_underscore for private test helpers
Layout20-char line length; each arg on own line; type annotations on all test helper signatures; named params with * for helpers with > 1 param
StringsSingle quotes only; no hardcoded strings in assertions — use constants for expected values where the string represents domain vocabulary
StructureOne test class per file (aligns with one public function per file); test helpers as __private functions in the test file
Error assertionsTest for specific exception types only (matching the specific-exceptions-only production rule)
ImportsExplicit only (from file import name); no *; no folder imports
CommentsNone except # TODO — test names must be self-documenting

OB Overrides for Tests (Rust)

CategoryOB Rule for Tests
NamingTest function names use action verbs (test_export_returns_records_when_valid); no vague names; is_/has_ prefix for boolean helpers; no single-letter variables except self
Layout20-char line length; each arg on own line; type annotations on test helper signatures; explicit -> () on test functions
StringsNo hardcoded strings in assertions — use const for expected values where the string represents domain vocabulary
Structure#[cfg(test)] mod tests block per source file; test helpers as private fn (no pub) within the test module; builder/make_* functions for fixtures
TypesTest fixture structs use named fields (no tuple structs); #[derive(Debug)] on all test types
Error assertionsassert_matches! for specific error variants; never match on error message strings — match on enum variants
OwnershipPrefer borrowing in test helpers; .clone() acceptable in test setup for readability but not as a default
ImportsExplicit use — glob import of the parent module (use super::*) is the only permitted exception
CommentsNone except // TODO — test names must be self-documenting

Standards Loaded in All Modes

Always load:

  • references/testing-philosophy.md — F.I.R.S.T., TDD, why clean tests matter
  • references/testing-standards.md — coverage, naming, AAA, fixtures, mocking, markers, anti-patterns

Always load the language-specific reference:

  • references/languages/[language].md — framework, tooling, and idioms for the target language

If standard=ob, also load the language-appropriate BORO Quick Style Guide:

  • Python: skills/ob-engineer/references/boro-quick-style-guide.md
  • Rust: skills/ob-engineer/references/boro-quick-style-guide-rust.md

OB rules override general where they conflict. Apply OB conventions to the test code itself (see the language-appropriate OB Overrides for Tests table above).


E2E Tests — Pipeline Runner + Thin-Slice Convention

When test_category=e2e, generate or review tests according to the runner + thin-slice convention. This applies to any pipeline-shaped codebase (collect → transform → emit).

What an E2E Test Is

An e2e test invokes a pipeline runner end-to-end via its public entry point. It is a smoke test first: assert the runner completes without error. Real assertions on outputs, side effects, and registers are added incrementally as the pipeline matures. A stub of the form assert True is acceptable when the runner is first wired — existence of the test is more valuable than its strength at that stage.

Coverage Rule — One E2E Per Runner

For every runner the codebase exposes, there is exactly one e2e test:

Runner KindE2E Test Location
Top-level pipeline runner (full collect→reuse)tests/e2e/test_<pipeline>_runner.py
Thin-slice runner (a sub-pipeline runnable on its own)tests/e2e/<thin_slice>/test_<thin_slice>_runner.py

A "thin slice" is a sub-pipeline that can be invoked independently — typically used to exercise one stage or one source against the full downstream chain. Each thin slice has its own folder under tests/e2e/ with its own conftest.py for slice-specific fixture overrides.

Folder Layout

tests/
├── e2e/
│   ├── conftest.py                                # top-level setup/teardown fixtures
│   ├── test_<full_pipeline>_runner.py             # smoke test for the full pipeline
│   ├── <thin_slice_a>/
│   │   ├── conftest.py                            # slice-specific fixture overrides
│   │   └── test_<thin_slice_a>_runner.py
│   └── <thin_slice_b>/
│       ├── conftest.py
│       └── test_<thin_slice_b>_runner.py
├── unit/
│   └── <module>/
│       ├── conftest.py
│       └── test_<component>.py
└── outputs/                                       # artefacts written by tests

conftest.py Conventions

  • Top-level tests/e2e/conftest.py — global setup/teardown shared by all e2e tests: configuration object construction, output path provisioning, external service config (URLs, credentials), session-scoped fixtures.
  • Per-slice tests/e2e/<slice>/conftest.py — overrides for that slice only: scoped output paths, slice-specific input fixtures, narrower configuration.
  • Each e2e test depends on its slice's conftest.py. Do not share fixtures laterally between slices — if two slices need the same fixture, lift it to the top-level conftest.py.

Generating an E2E Test (Step 4 addendum)

When test_category=e2e:

  1. Identify the runner's public entry point (the function the application calls).
  2. Place the test under tests/e2e/ (top-level) or tests/e2e/<thin_slice>/ per the table above.
  3. Write a smoke test: invoke the runner via the project's invocation idiom; assert the call returns successfully. assert True is acceptable initially.
  4. Provide a conftest.py at the test's level wiring the configuration the runner needs (paths, service config). Reuse top-level fixtures where applicable.
  5. Add real assertions incrementally — output files exist, register counts match, downstream contracts hold — as the pipeline stabilises.

Reviewing E2E Tests (Mode: review addendum)

When test_category=e2e, additionally verify:

  • One e2e test exists for the top-level pipeline runner
  • One e2e test exists for each thin-slice runner
  • Each test invokes the runner via the project's public invocation idiom (not by reaching into stage internals)
  • Per-slice conftest.py overrides only what the slice needs; shared setup is in the top-level conftest.py
  • assert True stubs, where present, have a # TODO referencing the assertion to be added

Mode: generate

Generate tests for the class or function at target_path. Produces a complete test file.

Workflow

Step 1 — Read standards

Load all three references listed above before writing a single line of test code.

Step 2 — Read the target code

Read target_path completely. Identify:

  • Public interface: all public functions/methods with their signatures and return types
  • Pre-conditions: inputs that are validated/rejected
  • Post-conditions: what the function guarantees on success
  • Error paths: exceptions raised, edge conditions

Step 3 — Plan test cases

For each public function, plan:

CategoryWhat to cover
Happy pathOne test per distinct valid input shape
Boundary conditionsMin/max values, empty collections, zero, null/None
Error conditionsEach exception type; invalid inputs; pre-condition violations
Edge casesSingle-element collections, large inputs, special characters

Step 4 — Write tests

Apply the standards from references/testing-standards.md and the language idioms from references/languages/[language].md. Do not invent patterns — use only what the references define.

Step 5 — Produce test file

Output (generate)

## Test Generation — [target_path]

**Language:** [language]
**Standard:** [general | ob]
**Category:** [unit | integration | e2e]
**Tests generated:** [N]
**Coverage of public interface:** [functions covered / total functions]

---

[Full test file content]

---

### Test Case Summary

| Test Name | What It Covers | Category |
|-----------|---------------|----------|

---

### Untested Paths

[Any paths not covered and why — e.g. private methods, external dependencies]

Mode: review

Review existing tests at test_path against quality standards. Produces an annotated report.

Workflow

Step 1 — Read standards

Load all three references listed above.

Step 2 — Read production code and test code

Read target_path (production) and test_path (tests). Understand what the production code does before assessing how the tests cover it.

Step 3 — Apply the compliance checklist

Work through the checklist in references/testing-standards.md. For each violation:

  • Record exact file and line number
  • Name the rule violated
  • Assign severity (HIGH / MEDIUM / LOW)
  • Write a specific, actionable suggested fix

Severity criteria:

SeverityCriteria
HIGHHides real behaviour; test passes when it should fail; tests the mock not the code
MEDIUMReduces clarity or makes the test fragile; names don't reveal intent
LOWMinor style issue; not a correctness risk

Step 4 — Produce review report

Output (review)

## Test Review — [test_path]

**Language:** [language]
**Standard:** [general | ob]
**Category:** [unit | integration | e2e]
**Tests reviewed:** [N]
**Violations:** [N] (HIGH: N, MEDIUM: N, LOW: N)

---

### Violations

| # | Test | Line | Rule | Severity | Description | Suggested Fix |
|---|------|------|------|----------|-------------|---------------|

---

### Verdict

**[APPROVE / REQUEST CHANGES / REJECT]**

[1–2 sentence summary]

Mode: coverage-check

Identify paths in the production code at target_path that have no corresponding tests.

Workflow

Step 1 — Read standards

Load all three references listed above.

Step 2 — Map production code paths

Read target_path. For each public function, enumerate all logical paths:

  • Normal path
  • Each conditional branch
  • Each exception raised
  • Edge cases visible from the signature (empty input, zero, None/null)

Step 3 — Read existing tests

Read test_path (or inferred location). Map each test to the path(s) it exercises.

Step 4 — Identify gaps

Mark each production path as covered or uncovered. Flag paths with:

  • No test at all
  • Only happy-path coverage (no error or edge coverage)
  • Mocked-away behaviour that should be integration-tested

Step 5 — Produce gap analysis

Output (coverage-check)

## Coverage Gap Analysis — [target_path]

**Language:** [language]
**Standard:** [general | ob]
**Category:** [unit | integration | e2e]
**Functions analysed:** [N]
**Paths covered:** [N] / [Total paths]
**Coverage estimate:** [N]%

---

### Covered Paths

| Function | Path | Covered by |
|----------|------|-----------|

---

### Uncovered Paths

| Function | Uncovered Path | Risk | Recommended Test Name |
|----------|---------------|------|----------------------|

---

### Recommended Actions

1. [Highest priority gaps with specific test case suggestions]

Feedback

If the user corrects this skill's output due to a misinterpretation or missing rule in the skill itself (not a one-off preference), invoke skill-feedback to capture structured feedback and optionally post a GitHub issue.

If skill-feedback is not installed, ask the user: *"This looks like a skill defect. Would you like to install the skill-feedback skill to report it?"* If the user declines, continue without feedback capture.

平台分布

Codex

37.68%
按下载量换算45

Claude

28.01%
按下载量换算34

Cursor

18.49%
按下载量换算22

Gemini CLI

10.23%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

继续浏览同类 Skills