/odin-typescript:replace-unsafe-typescript-assertionsfrom ODIN TypeScript
Replaces unsafe TypeScript assertions (any, as) in test files with intent-preserving coercion functions like fromPartial, fromAny, and fromExact. Only modifies test files, not production code.
Ships in ODIN TypeScript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Field | Bound contract |
|---|---|
| Trigger | TypeScript tests use unsafe assertions (value as Type, value as unknown as Type) for partial or intentionally invalid fixtures. |
| Authority | Reversible local: writes only the named test files and their import lines; rollback is version control. Does not modify production files, package manifests, or lockfiles. No remote mutation. |
| Side effect | Eligible assertions are replaced and required imports are added. |
| Done | Every eligible assertion uses the intent-matching coercion function and the project typecheck and test suite both pass. |
Ensure the coercion package exists in the project. Confirm the coercion package (commonly @total-typescript/shoehorn or any package providing fromPartial, fromAny, and fromExact equivalents) resolves in the installed dependency tree. If it does not, stop before editing and report the missing dependency. Done when: the package is confirmed present or the procedure has stopped with the missing-dependency report.
Enumerate type assertions in target test files. Find assertions in .test.ts, .spec.ts, .test.tsx, and .spec.tsx files under the bounded target. Confirm the target contains only test files; exclude production source even when it contains the same assertion shape. Done when: every assertion site is enumerated.
Classify assertion intent and replace with the corresponding intent-preserving coercion function. For each assertion:
value as Type with fromPartial(value) when the fixture intentionally supplies only part of Type and every supplied field must still type-check.value as unknown as Type with fromAny(value) only when the test intentionally supplies an invalid runtime shape.fromExact(value) only when the test needs the complete object to satisfy Type and retaining exactness is the stated intent.Update file imports to include added functions. Add one import containing exactly the functions used. Remove unused names. Merge with an existing import from the package instead of creating a duplicate. Done when: the import line is added or merged with no duplicate.
Run project typecheck and test suite to verify preserved runtime behavior. Run the repository's typecheck command after the bounded edits. If typecheck fails because a classification was wrong, restore that assertion and import change, record it as skipped, and rerun. Do not weaken compiler options or add another assertion to force a pass. Then run the repository's test suite. The tests must pass to prove that intentionally invalid fixtures preserve runtime behavior, not just type-level behavior. Review the diff to confirm only authorized test files and import lines changed. Done when: typecheck passes, the test suite passes, and the diff is confirmed to contain only authorized changes.
A per-file report with assertions replaced, coercion function selected for each, skipped assertions with reasons, the exact typecheck and test commands, and their final results.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
15 skills in this plugin
/eslint-to-biome-migrationUse when migrating a JavaScript or TypeScript project from ESLint, Prettier, Standard, or mixed legacy lint configuration to Biome 2.5./fastify-inject-testingUse when asked to test Fastify applications without network sockets. Not for building the app: use fastify-schema-first-service./fastify-production-hardeningUse when asked to prepare a Fastify service for production load and exposure. Not for building the app: use fastify-schema-first-service./fastify-schema-first-serviceUse when building or extending a Fastify application: routes, plugins, hooks, database wiring. Not for testing: use fastify-inject-testing. Not for hardening: use fastify-production-hardening./multi-tenant-architectureUse when a request concerns multi-tenant scaffolding, tenant isolation, domain wiring, or SaaS architecture on Cloudflare or Vercel. Not for single-tenant apps: use scaffold-nextjs./node-internals-diagnosisUse when Node.js segfaults, addon crashes, leaks, event-loop anomalies, thread-pool saturation, V8 deoptimizations, or binding.gyp failures need diagnosis. Not for code edits or service restarts.npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odin-typescriptOther plugins' skills for the same job