nullable-new-params

Converts newly added optional TypeScript parameters to required nullable values in diffs.

Updated May 15, 2026
One-click install
npx skills add https://github.com/danielbere1973/promoar --skill nullable-new-params-danielbere1973
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nullable-new-params
Source: https://github.com/danielbere1973/promoar/tree/main/.agents/skills/nullable-new-params
Command: npx skills add https://github.com/danielbere1973/promoar --skill nullable-new-params-danielbere1973

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? New optional parameters and type members (foo?: T) in internal TypeScript code let callers silently omit values, hiding whether absence was intentional. This Skill enforces a convention where internal APIs use required nullable fields (name: T | null) so every call site makes an explicit choice, while keeping public APIs backwards-compatible. ## Core Features & Use Cases - Diff Scanning: Runs a Bun script that parses git diff output and flags newly added optional members, parameters, and optional methods in TypeScript files. - Public vs Internal Classification: Guides you to check package entrypoints and docs before changing a signature, preserving backwards compatibility for exported APIs. - Refactoring Workflow: Provides step-by-step instructions to convert ?: to T | null, update all call sites to pass null explicitly, and fix truthy checks that mishandle falsy values like 0 or ''. - Use Case: During code review of a Remotion monorepo PR, run the scanner to find a newly added frozenFrame?: number | null prop, convert it to frozenFrame: number | null, and update every caller to pass an explicit value. ## Quick Start Ask the AI to scan your current diff for newly added optional parameters and convert the internal ones to required nullable values with explicit null at every call site.

Frequently Asked Questions about nullable-new-params

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find newly added optional parameters in a git diff?▼

Run the included Bun script against your diff, for example with `bun scripts/find-new-optional-params.ts origin/main...HEAD` or `--cached` for staged changes. It parses added lines in TypeScript files and reports each optional member or parameter with file and line number.

Should new TypeScript parameters be optional or nullable?▼

For internal APIs, prefer required nullable fields like `name: T | null` so every caller explicitly passes a value or null. Keep `?:` optional only for exported or documented public APIs where requiring the value would be a breaking change.

How do I keep public API changes backwards compatible when adding fields?▼

Keep the new field optional in the public type, then resolve a concrete internal value at the boundary with `const internal = publicValue ?? null`. Downstream internal types stay required nullable, so external consumers are unaffected.

Why use null instead of undefined for absent values in TypeScript?▼

Using null as the absence sentinel makes the choice explicit at every call site and avoids ambiguity with omitted properties. Checks like `value !== null` also avoid treating valid falsy values such as 0, empty string, or false as absent.

What are the limitations of the optional parameter scanner?▼

The scanner only inspects added lines in TypeScript files within a git diff and relies on regex patterns, so it may miss unusual syntax or flag false positives. It also cannot decide whether an API is public; you must verify package entrypoints and docs manually.