Token导航 LogoToken导航

Agent Skill · 开发

nullables-test(可空测试)

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

nullables-test 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 19,001。

总安装 303周安装 13GitHub Stars 公开资料未说明下载 106核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/danielbush/skills --skill nullables-test

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

nullables-test 用于辅助测试设计、自动化测试和回归验证。适合让 Agent 编写单元测试、端到端测试或根据日志定位问题。使用时需确认项目测试框架、运行命令和夹具数据,避免误改逻辑。涉及浏览器或外部服务时,应区分本地模拟与生产环境。可结合来源仓库进一步核验功能细节和使用限制。

来源仓库内路径:skills/nullables-test

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

nullables-test 怎么安装?

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

nullables-test 支持哪些 AI 工具?

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

nullables-test 需要什么权限?

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

nullables-test 是免费的吗?

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

nullables-test 用的人多吗?

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

nullables-test 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

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

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

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

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
nullables-test

可空测试 · 本页

303—需要联网未明确通过

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

SKILL.md 原文

Nullables Test

Write tests for code that follows the Nullables pattern. Tests should illustrate how the system works — grounding the codebase's own concepts through concrete examples.

Vocabulary

This skill uses terms from references/vocabulary.md. Key terms: HARDWIRED_INFRA, INJECTED_INFRA, DUAL_FACTORY, NULLABLE, CONFIGURABLE_RESPONSE, OUTPUT_TRACKING, INFRASTRUCTURE_WRAPPER, NULLABLE_CLASS, CREATE_BOUNDARY_RULE, VALUE_OBJECT.

Philosophy

Tests are not just for coverage — they are illustrations of the system. A developer reading the tests should learn:

  • What the class does and why it exists
  • What its key behaviors are, expressed in the system's own vocabulary
  • What OUTSIDE_WORLD interactions it has (visible through CONFIGURABLE_RESPONSE and OUTPUT_TRACKING)
  • How it handles important edge cases

Write the minimum number of tests that ground these concepts. Don't exhaustively test every path — focus on tests that teach a reader about the system. The system being tested has its own domain, its own vocabulary, its own architecture. The tests should reflect that.

Build confidence from the top down. Because nullables give us sociable, narrow, state-based unit tests, we can test exhaustively at higher, more meaningful levels — exercising real behavior through real dependency graphs without mocks or slow I/O. Start at the middle or top of the dependency graph where tests illustrate the most about how the system works. Lower-level tests are fine when they add clarity or catch things the higher-level tests don't reach — drop down as needed, guided by coverage and judgement. The goal is pragmatic confidence, not layer-by-layer exhaustiveness.

Precondition: Is This Class Ready To Test?

Before writing tests, verify the class under test is testable. Walk this checklist:

1. No HARDWIRED_INFRA remaining

Scan the class for any OUTSIDE_WORLD calls used directly (imported and called inline). If found, the class is not ready — the nullables-refactor skill should be applied first.

2. Class has DUAL_FACTORY

The class must have .create() and .createNull(). If not, it's not ready.

3. All INJECTED_INFRA has .createNull()

For each dependency injected through the constructor:

  • Does it have .createNull()?
  • Does .createNull() accept CONFIGURABLE_RESPONSE parameters?
  • If not → that dependency needs to be made nullable first.

This may require recursive refactoring: follow the dependency graph down to the leaves (INFRASTRUCTURE_WRAPPERs). Every node in the chain must have .createNull() for the top-level .createNull() to produce a fully nulled instance.

The chain:

ClassUnderTest.createNull()
  → calls DependencyA.createNull()
    → calls InfraWrapperX.createNull()  ← leaf, has EMBEDDED_STUB
  → calls DependencyB.createNull()
    → calls InfraWrapperY.createNull()  ← leaf, has EMBEDDED_STUB

If any link in this chain is missing .createNull(), flag it. Tell the human which dependency needs work and suggest using nullables-refactor on it.

4. .createNull() actually nulls everything

Create an instance via .createNull() with no arguments. It should:

  • Execute without errors
  • Not make any real OUTSIDE_WORLD calls
  • Return sensible defaults

If .createNull() throws or makes real I/O calls, the EMBEDDED_STUBs or CONFIGURABLE_RESPONSE defaults are incomplete.

Writing Tests

How to instantiate in tests

There are two distinct cases — getting this right matters:

Testing Foo itself (Foo is the class under test)

Use new Foo(...) directly and pass in nulled dependencies with specific CONFIGURABLE_RESPONSE values:

// Testing Foo — use `new` so you control each dependency's configuration
const bar = Bar.createNull({ response: specificValue });
const client = HttpClient.createNull({ status: 404 });
const foo = new Foo(bar, client);

This gives you fine-grained control over each dependency. You can configure exactly the scenario you want to test. Foo.createNull() would bundle its own defaults, which may not expose the granularity you need.

Foo as a dependency (testing something that uses Foo)

Use Foo.createNull() — its bundled defaults keep the test focused on the actual class under test:

// Testing AppService which depends on Foo
// We don't care about Foo's internals here
const appService = new AppService(Foo.createNull());

Foo.createNull() exists to make Foo a convenient, safe dependency in other tests. It provides sensible defaults so the test reader doesn't get distracted by Foo's configuration.

What to test

For each class, write tests that illustrate its key behaviors:

For INFRASTRUCTURE_WRAPPERs (leaf nodes)
  • Test .createNull() works: creating a NULLABLE instance should succeed with defaults
  • Test CONFIGURABLE_RESPONSE: configure a specific response and verify the wrapper returns it
  • Test OUTPUT_TRACKING: if the wrapper has trackX(), verify it records interactions
  • Test error paths: configure error responses via CONFIGURABLE_RESPONSE to verify error handling

These tests verify the wrapper's contract — that the EMBEDDED_STUB faithfully represents what the real system does at the behavior level.

For NULLABLE_CLASSes (orchestrators)
  • Test the core behavior: what does this class *do*? Instantiate with new and pass nulled deps, call its methods, verify the result. The test should read like a description of the class's purpose.
  • Test with CONFIGURABLE_RESPONSE: configure specific dependency responses to test how the class handles different inputs from the outside world
  • Test OUTPUT_TRACKING on dependencies: verify the class makes the right calls to its dependencies (what was written, in what order) — use trackers, not mocks
  • Test edge cases that matter to the domain: not every edge case, just the ones that illuminate how the system handles its key scenarios
For VALUE_OBJECTs
  • Test .create() and .createTestInstance()
  • Test any transformation methods
  • Keep it simple — these are usually straightforward
For PURE code
  • Test with plain inputs and outputs
  • No nullable machinery needed

Example

describe('ReportGenerator', () => {
  // ReportGenerator is the class under test — use `new` with nulled deps
  // so we can configure each dependency's responses for the test scenario

  it('generates a report from a template and data', () => {
    const fileStore = FileStore.createNull({
      templates: { 'Sales.html': '<h1>{{title}}</h1>{{rows}}' },
    });
    const webhook = WebhookClient.createNull();
    const generator = new ReportGenerator(fileStore, webhook);

    const result = generator.generate({
      title: 'Sales',
      rows: [{ label: 'Q1', value: 100 }],
    });

    expect(result).toContain('<h1>Sales</h1>');
  });

  it('notifies the webhook after writing the report', () => {
    const fileStore = FileStore.createNull();
    const webhook = WebhookClient.createNull();
    const tracker = webhook.trackNotifications();
    const generator = new ReportGenerator(fileStore, webhook);

    generator.generate({ title: 'Sales', rows: [] });

    // State-based: what was sent, not how
    expect(tracker.data).toEqual([
      { title: 'Sales', path: './output/Sales-report.html' },
    ]);
  });
});

What NOT to do

  • Don't use mocks, spies, or stubs — use .createNull() with CONFIGURABLE_RESPONSE instead
  • Don't test implementation details — test behaviors and outcomes
  • Don't write exhaustive tests — write illustrative ones that teach a reader about the system
  • Don't use .create() in unit tests — .create() is for narrow integration tests that verify real OUTSIDE_WORLD behavior, run separately
  • Don't add tests for things that can't fail — if the code is PURE and trivial, a test adds noise not signal
  • Don't use Foo.createNull() when testing Foo itself — use new Foo(deps.createNull(...)) for fine-grained control

Integration Tests (Sparingly)

For INFRASTRUCTURE_WRAPPERs only, write a small number of narrow integration tests using .create():

  • Verify the real wrapper talks to the real external system correctly
  • Verify the EMBEDDED_STUB's behavior matches reality
  • These go in a separate test directory/command (they're slow, need real services)
  • Keep them few — they exist to validate the contract, not to test business logic

Output

Present the tests with brief commentary explaining what each test illustrates about the system. Group tests by the class they're testing. If any precondition check fails, report what's blocking and what needs to happen first.

平台分布

Codex

35.85%
按下载量换算38

Claude

26.47%
按下载量换算28

Cursor

18.7%
按下载量换算20

Gemini CLI

8.99%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills