Introduce or refine runtime schema validation at untrusted boundaries so static TypeScript types stay truthful.
How this skill is triggered — by the user, by Claude, or both
Slash command
/schema-boundary-typing:schema-boundary-typingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- The user wants runtime validation and static typing to agree at an API, storage, or parsing boundary.
Required before editing
Helpful if present
unknown until it passes validation.typescript-any-eliminator when replacing any requires runtime boundary validation to make types truthful.type-test-authoring.Run targeted tests for valid and invalid boundary inputs.
Verify invalid payloads produce the expected failure shape: field errors, result-object errors, or thrown boundary errors that match the repository's convention.
Re-run typecheck after deriving or re-exporting the validated type.
Confirm consumers no longer rely on unvalidated unknown or ad hoc casts.
Keep references/boundary-validation-scenarios.md in sync when the repo's error-handling convention, schema library, or transport-to-domain boundary changes.
Smoke test:
type-test-authoring)Before
const payload: User = JSON.parse(raw);
After
const payload = UserSchema.parse(JSON.parse(raw));
Failure shape (custom result wrapper when callers branch on success or failure)
{
ok: false,
errors: [
{ path: ['body', 'email'], message: 'Invalid email address' },
],
}
Before
export function readConfig(value: any) { return value.mode; }
After
export function readConfig(value: unknown) {
return ConfigSchema.parse(value).mode;
}
references/schema-patterns.md - patterns for schema-first validation, derivation, and transport-to-domain boundaries.references/boundary-validation-scenarios.md - compact checklist for success, failure, and error-shape validation at the boundary.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 schema-boundary-typing