From type-test-authoring
Write compile-time type tests that protect public TypeScript APIs, inference behavior, and negative cases.
How this skill is triggered — by the user, by Claude, or both
Slash command
/type-test-authoring:type-test-authoringThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- The user wants to protect generic helpers, utility types, or public APIs with compile-time tests.
tsd, dtslint, expectTypeOf, or @ts-expect-error fixtures.Required before editing
Helpful if present
expectTypeOf, expectAssignable, or @ts-expect-error fixtures.@ts-expect-error in dedicated typecheck files.If the repository has no established type-test convention:
*.test-d.ts or *.type-test.ts file when the contract needs to stay out of runtime code.@ts-expect-error only when the regression is tiny and close to the API that owns it.tsc --noEmit or equivalent.@ts-expect-error or explicit non-assignability checks.@ts-ignore where a negative assertion should use @ts-expect-error or an existing helper.typescript-any-eliminator or schema-boundary-typing) has made the target type surface truthful.Run the existing type-test command or the nearest equivalent fixture-based typecheck.
Confirm negative cases fail for the intended reason rather than from unrelated compiler noise.
Re-run adjacent runtime tests when the same API surface also changed at runtime.
Use references/type-test-scenarios.md to choose inline assertions versus fixture/bootstrap patterns, and update it when the local type-test shape changes.
Smoke test:
test-driven-development)expectTypeOf
expectTypeOf(parseUser({ id: 1 })).toEqualTypeOf<User>();
// @ts-expect-error wrong shape
parseUser({ id: "1" });
@ts-expect-error fixture
acceptsString("ok");
// @ts-expect-error numbers are rejected
acceptsString(123);
references/assertion-patterns.md - common positive and negative assertion patterns for compile-time type testing.references/type-test-scenarios.md - scenario checklist for choosing the lightest durable type-test structure.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub matt-riley/lucky-hat --plugin type-test-authoring