You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/code-standards/SKILL.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -303,6 +303,31 @@ A loop that re-queues unresolved items will spin forever when the upstream sourc
303
303
304
304
If `X` does nothing useful without `Y`, and there is no second consumer of `X`, merge them. Splits must pay for themselves in polymorphism, reuse, or test isolation.
305
305
306
+
### 8. Accessing `Option<T>.Value` without checking `Has`
307
+
308
+
`Option<T>.Value` (`Utility/Types/Result.cs`) is `default` — null for reference types — when `Has` is false. A blind read silently propagates an invalid value far from its source.
309
+
310
+
```csharp
311
+
// WRONG — Value is default/null when Has is false
312
+
UserIduserId=UserId.New(raw).Value;
313
+
314
+
// WRONG in production — Unwrap() hides the absence case instead of modeling it
315
+
UserIduserId=UserId.New(raw).Unwrap();
316
+
317
+
// RIGHT — branch on Has when the input may be invalid
318
+
Option<UserId>userId=UserId.New(raw);
319
+
if (!userId.Has) return;
320
+
Use(userId.Value);
321
+
322
+
// RIGHT — a factory that is valid by construction needs no Option at all
323
+
UserIduserId=UserId.NewRandom();
324
+
325
+
// RIGHT in tests only — Unwrap() for known-valid constants; it throws loudly at the source
326
+
UserIduserId=UserId.New(KNOWN_CONSTANT).Unwrap();
327
+
```
328
+
329
+
In production code, handle `None` explicitly (early return, propagation) or use a by-construction-valid factory. `Unwrap()` is a test-only affordance — and in tests, known-valid constants go through `Unwrap()`, never bare `.Value`.
@@ -107,8 +107,10 @@ Drop a `.json` file in the build root folder, launch with `--use-log-matrix "fil
107
107
}
108
108
```
109
109
110
-
-`"override": true` — Only use file values (replaces entire matrix)
111
-
-`"override": false` — Merge with existing matrix values
110
+
Keys must match `CategorySeverityMatrixDto` field names — `JsonUtility` ignores unknown ones. `{ "allOverride": true }` enables every category at every severity in the log file only, and takes precedence over `isOverride`/`debugLogMatrix`. A log captured under `allOverride` contains resolved media stream URLs with signed `sig`/`expire` query params — do not attach it to a public issue.
111
+
112
+
-`"isOverride": true` — Only use file values (replaces entire matrix)
113
+
-`"isOverride": false` — Merge with existing matrix values
0 commit comments