@@ -111,11 +111,10 @@ Skills own workflows; root owns hard policy and routing.
|
111 | 111 | - No `@ts-nocheck`. Lint suppressions only intentional + explained. |
112 | 112 | - External boundaries: prefer `zod` or existing schema helpers. |
113 | 113 | - Runtime branching: discriminated unions/closed codes over freeform strings. Avoid semantic sentinels (`?? 0`, empty object/string). |
114 | | -- If formatter output becomes a jagged staircase, refactor the expression instead of accepting the formatted shape. |
115 | | -- For function calls with config objects, compute complex fields above the call; keep object fields simple. |
116 | | -- Avoid dense inline plumbing: no nested ternaries, long `??` chains, or repeated `params.foo?.bar` inside argument objects. |
117 | | -- Prefer named intermediate values when a value has domain meaning, e.g. `channel`, `parentSessionKey`, `selectedModelRef`, `sourceProvider`. |
118 | | -- Code should read top-down: gather inputs, normalize/resolve, then call helpers. |
| 114 | +- Formatter-friendly shape: when oxfmt explodes an expression vertically, extract named booleans, payloads, or small helpers. Do not change width or use format-ignore for local compactness. |
| 115 | +- Calls should be boring: complex decisions happen above; call args/object fields are names, literals, or simple property reads. |
| 116 | +- Prefer early returns over nested condition pyramids. Split code into gather -> normalize -> decide -> act. |
| 117 | +- Use named intermediates only for domain meaning or readability; avoid temp-variable soup. |
119 | 118 | - Dynamic import: no static+dynamic import for same prod module. Use `*.runtime.ts` lazy boundary. After edits: `pnpm build`; check `[INEFFECTIVE_DYNAMIC_IMPORT]`. |
120 | 119 | - Cycles: keep `pnpm check:import-cycles` + architecture/madge green. |
121 | 120 | - Classes: no prototype mixins/mutations. Prefer inheritance/composition. Tests prefer per-instance stubs. |
|