Null hardened feature overrides

From ychampion/cskill-agents · View interactive version

Null hardened feature overrides is an AI agent skill from the GitHub repository ychampion/cskill-agents. Validate remote numeric override maps defensively so null, non-finite, or negative flag payloads never corrupt runtime thresholds.

How to use this skill

Skill file

SKILL: Null-Hardened Feature Overrides

Domain: remote-bridge

Trigger: Apply when remote feature flags or runtime override maps can influence thresholds, but the flag service may return null or malformed values.

Source Pattern: Distilled from reviewed remote override and transport-boundary patterns.

Core Method

Treat remote override values as untrusted input rather than configuration you can index directly. Validate the flag payload type, require finite positive numbers, and fall back to the hardcoded default when the override is null, missing, non-object, or otherwise malformed. Preserve hard opt-outs, such as Infinity for tools that self-bound their output, before consulting the remote override layer.

Key Rules

Example Application

If a growth experiment can adjust persistence thresholds per tool, validate the experiment payload before using it; malformed data should simply leave getPersistenceThreshold and getPerMessageBudgetLimit on their safe defaults rather than crashing the result-storage path.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.