CtrlK
BlogDocsLog inGet started
Tessl Logo

swift-protocol-di-testing

基于协议的依赖注入(Protocol-based Dependency Injection),通过精简的协议和 Swift 测试框架(Swift Testing)来模拟文件系统、网络和外部 API,编写可测试的 Swift 代码。

64

Quality

76%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./skills/swift-protocol-di-testing/SKILL.md
SKILL.md
Quality
Evals
Security

Quality

Content

85%

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

The body is well-organized and highly actionable, providing complete executable Swift for the entire DI-and-testing pattern in a clear 5-step sequence, with the only real weakness being mild redundancy between the activation and usage trigger sections.

Suggestions

Merge the near-duplicate '何时激活' and '何时使用' sections into a single trigger section to remove redundancy.

Define the symbols referenced only in test snippets (MockFileSystemProvider, testURL, testData, manager.loadData()) or note they are illustrative, so the test examples are fully self-contained.

DimensionReasoningScore

Conciseness

Mostly efficient and it assumes Claude knows what protocols/DI/Swift Testing are, but the '何时激活' and '何时使用' sections are near-duplicates and some framing prose restates the pattern, so it could be tightened.

2 / 3

Actionability

Each pattern ships executable, copy-paste-ready Swift (protocols, default implementations, mocks, default-parameter injection, and Swift Testing `@Test`/`#expect` cases), fully concrete rather than pseudocode.

3 / 3

Workflow Clarity

A clear ordered 5-step sequence (define protocol → default impl → mock → inject via default parameters → write tests) is given; this design pattern is not a destructive/batch operation, so absent validation checkpoints do not cap the score.

3 / 3

Progressive Disclosure

The body is cleanly split into well-labeled sections (何时激活, 核心模式, 最佳实践, 反模式, 何时使用) with no nested references and no monolithic wall of text; the skill is self-contained and easy to navigate.

3 / 3

Total

11

/

12

Passed

Description

67%

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

The description clearly communicates the capability and is narrowly scoped to Swift protocol-based DI for testability, but it lacks an explicit 'Use when' trigger clause and leans on technical jargon over natural user phrasing.

Suggestions

Add an explicit trigger clause, e.g. 'Use when writing Swift code that touches the filesystem, network, or external APIs and needs deterministic, I/O-free tests.'

Include natural user phrasings a developer might say ('unit testing Swift code', 'mocking the filesystem/network in Swift tests') alongside the existing paradigm terms.

DimensionReasoningScore

Specificity

Lists multiple concrete actions — '模拟文件系统、网络和外部 API', '编写可测试的 Swift 代码', '精简的协议' — beyond naming the domain, matching the 'lists multiple specific concrete actions' anchor.

3 / 3

Completeness

The 'what' is clearly stated (mock external dependencies, write testable Swift code), but there is no 'Use when...' clause or equivalent explicit trigger guidance, which caps completeness at 2.

2 / 3

Trigger Term Quality

Relevant domain terms are present ('协议', '依赖注入', 'Swift Testing', '模拟文件系统、网络和外部 API'), but coverage leans on paradigm/framework jargon and misses common natural variations a user would actually say.

2 / 3

Distinctiveness Conflict Risk

The niche is clearly bounded to Swift protocol-based dependency injection for testability, making it unlikely to trigger for or conflict with unrelated skills.

3 / 3

Total

10

/

12

Passed

Validation

93%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation15 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

frontmatter_unknown_keys

Unknown frontmatter key(s) found; consider removing or moving to metadata

Warning

Total

15

/

16

Passed

Repository
xu-xiang/everything-claude-code-zh
Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.