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.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,3 +23,37 @@ swift run BuildTool lint
23
23
```
24
24
25
25
Use `--fix` to auto-fix where possible.
26
+
27
+
## Specification Document
28
+
29
+
The _Specification Document_ (or simply "the specification" or "the spec") specifies much of the behaviour of this codebase. It lives in the `specification` repository. If you need to consult it and you haven't been told where to find a local copy, ask.
30
+
31
+
- The specification is structured as a list of specification points, each with an identifier such as `OD1`. Some specification points have subpoints, e.g. `REC2a`, which in turn can have subpoints like `REC2a1`. In the specification's Markdown source, the start of specification point `OD1` is represented by `` `(OD1)` ``.
32
+
- The LiveObjects functionality is referred to in the specification simply as "Objects". The LiveObjects-specific spec points are in a separate file, `specifications/objects-features.md`.
33
+
- If you are given a task that requires knowledge of the specification, you must consult it before proceeding. Never guess its contents.
34
+
- If the specification is unclear, mention this.
35
+
36
+
## Swift style
37
+
38
+
- Satisfy SwiftLint's `explicit_acl` rule (all declarations must specify access control level keywords explicitly).
39
+
- When writing an `extension` of a type, prefer placing the access level on the extension declaration rather than on each individual member.
40
+
- This does not apply to test code.
41
+
- When the type being initialised can be inferred, use the implicit `.init(…)` form instead of writing the type name explicitly.
42
+
- When the enum type can be inferred, use the implicit `.caseName` form instead of writing the type name explicitly.
43
+
- When writing `JSONValue` or `WireValue` types, use the literal syntax enabled by their `ExpressibleBy*Literal` conformances where possible.
44
+
- When writing a JSON string, use Swift raw string literals instead of escaping double quotes.
45
+
- When importing these modules in library (non-test) code:
- Use the Swift Testing framework (`import Testing`), not XCTest.
4
+
- Do not use `fatalError` in response to a test expectation failure; use Swift Testing's `#require` macro instead.
5
+
- Only add labels to test cases or suites when the label differs from the name of the suite `struct` or test method.
6
+
- Follow the guidelines under "Attributing tests to a spec point" in `CONTRIBUTING.md` to tag unit tests with the relevant specification points. Follow the exact comment format described there. Pay particular attention to the difference between `@spec` and `@specPartial`, and do not write `@spec` multiple times for the same specification point.
7
+
- Add comments explaining when some piece of test data is not important for the scenario being tested.
0 commit comments