mk:typescript — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited mk:typescript (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<!-- Improvements over source skills:
any types already enforced)-->
Strict TypeScript patterns for type safety, null handling, and modern best practices.
Auto-activate on: .ts, .tsx, .js, .jsx files, type errors, ESLint issues, "fix types", "add types", "TypeScript help"
Explicit: /mk:typescript [concern]
Do NOT invoke for: Vue-specific patterns (use mk:vue), visual design (use mk:frontend-design)
Operates in Phase 3 (Build GREEN). Output supports the developer agent.
npx tsc --noEmit must pass with zero errorsany — use unknown + type guards (security-rules.md)type assertion — use unknown + type guards (security-rules.md)=== null || === undefinedstrict: true, noUncheckedIndexedAccess: truetype imports: import type { X } from 'y'| Don't | Do Instead |
|---|---|
as any or as unknown as X | Proper type narrowing with guards |
if (value) for null check | if (value !== null && value !== undefined) |
export default | export const X / export function X |
Object type | Record<string, unknown> |
| Implicit return types | Explicit return type annotations |
enum (runtime overhead) | as const satisfies or union types |
## TypeScript: {concern}
**Files:** {list of .ts/.tsx files modified}
**Config:** {tsconfig changes if any}
### Changes Applied
{numbered list of type improvements}
### Verification
{tsc --noEmit output — must show 0 errors}| Reference | When to load | Content |
|---|---|---|
| [strict-patterns.md](./references/strict-patterns.md) | Type safety work | Null handling, discriminated unions, type guards, utility types |
| [review-checklist.md](./references/review-checklist.md) | When reviewing TypeScript code | Prioritized checklist: CRITICAL (security), HIGH (type safety, async, errors), MEDIUM (React, perf) |
| Failure | Recovery |
|---|---|
tsc --noEmit fails after changes | Fix errors before proceeding — never ship with type errors |
| No tsconfig.json found | Suggest creating one with strict config |
| Third-party types missing | npm install @types/{package} |
value as User tells TS to trust you, not validate; a malformed API response passes the cast and crashes at runtime; use a type guard or Zod parse at the boundary instead.moduleResolution: bundler (Vite/esbuild default) allows extensionless imports that Node.js --esm rejects at runtime; flip to nodenext for backend code or keep dual configs per target.arr[0] is string | undefined not string; code that was type-correct before will error until every indexed access is null-guarded.declare module 'express' block in any .d.ts in the project augments Express's types globally; two libraries doing this with conflicting shapes cause TS2300 duplicate identifier errors that appear far from the source.type UserId = \user_\${string}\` is not assignable from string; passing a plain string where UserId` is expected fails even though values look identical at runtime; always brand at the input boundary with a parse function.const enum inside a library published as .js is inlined at compile time but not consumable by projects that don't re-compile the source; use as const satisfies patterns for exported enums.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.