Inject Ambient Inputs

Use when writing or refactoring logic that reads ambient state — the clock (now/today), randomness, environment variables, a DB/HTTP handle, the filesystem, the current user. Ambient reads are the main reason otherwise pure logic becomes un-unit-testable; pass them in as parameters and split the pure decision from the I/O so tests need no mocking machinery. Triggers on "Date.now", "new Date()", "hard to test", "mock the clock", "fake timers", "random in tests", "reads env", "make this testable", "pure function".

iamakbarsha1 0625cdf 3.8 KB Updated

File contents

iamakbarsha1/whetstone/tree/main/skills/inject-ambient-inputs commit 0625cdf2d6

Frequently asked questions

npx skillmds@latest add iamakbarsha1/inject-ambient-inputs