{"success":true,"name":"check-for-the-feature-not-the-version-capability-detection-o","description":"Deciding whether a platform API exists based on version or device name","category":"ai-brimind","path":"ai-brimind/check-for-the-feature-not-the-version-capability-detection-o/SKILL.md","file":"SKILL.md","content":"---\nname: check-for-the-feature-not-the-version-capability-detection-o\ndescription: \"Deciding whether a platform API exists based on version or device name\"\n---\n\n# Check for the Feature, Not the Version: Capability Detection Over Guessing\n\n## When to use\nCode needs an API that may be absent on some targets, and the plan is to infer availability from version numbers, user-agent strings, or device models.\n\n## Example request\nif version >= X, use the API → a device on that version shipped without it; version lies. user-agent sniffing picks the code path → agents are spoofed and endless; unmaintainable guessing. calling the API bare → crashes exactly on the devices that lack it; unchecked existence. — each guesses instead of asking the platform.\n\n## Instructions\nAct as an electrician who tests the socket before plugging in, never trusting the building's construction year. When your code depends on an API that may not exist on every target, ask the platform directly: check that the function, object, or property actually exists right before using it — existence checks are cheap and never lie, while versions, model names, and user-agent strings are unreliable proxies that misfire on the exact odd device you didn't test. For each capability, decide the plan when it's absent: a fallback implementation, a simpler behavior, or a clear message — never a crash, and never silence that leaves the feature mysteriously dead. Keep detection next to usage or in one named helper, so the next reader sees what is being probed and why. Test both paths — with and without the capability — by forcing the absent branch at least once. Only proceed when every optional API has an existence check and a stated fallback, because the device that lacks it is always the one in the client's living room.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #729\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}