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
`just` loads environment variables from `.ENV` automatically.
25
+
26
+
## Project Structure
27
+
-`Sources/bytesized/`: Swift source files
28
+
-`Content/posts/`: Markdown blog posts
29
+
-`Resources/`: Static assets (CSS, fonts, images)
30
+
-`Output/`: Generated site (not checked in)
31
+
32
+
## Content Writing
33
+
- Use Markdown for all content in the Content/posts directory
34
+
- Include proper metadata with title, date, and path
35
+
36
+
## Code Style Guidelines
37
+
- Swift 6.2+ codebase using the Publish framework
38
+
- Use descriptive variable/function names in camelCase
39
+
- Consistent 4-space indentation
40
+
- Prefer `Struct` to `Enum` for general data structures
41
+
- Group extensions with the type they extend
42
+
- Use Swift's strong type system
43
+
- Organize imports alphabetically: Foundation first, then third-party
44
+
- Keep functions small and focused on a single responsibility
45
+
- Use Swift's error handling with do/try/catch
46
+
- Follow CommonMark for Markdown content
47
+
- Use the `swift-concurrency` skill for Swift concurrency guidance.
48
+
- Always mark @Observable classes with @MainActor.
49
+
- Assume strict Swift concurrency rules are being applied.
50
+
- Prefer Swift-native alternatives to Foundation methods where they exist, such as using replacing("hello", with: "world") with strings rather than replacingOccurrences(of: "hello", with: "world").
51
+
- Prefer modern Foundation API, for example URL.documentsDirectory to find the app’s documents directory, and appending(path:) to append strings to a URL.
52
+
- Never use C-style number formatting such as Text(String(format: "%.2f", abs(myNumber))); always use Text(abs(change), format: .number.precision(.fractionLength(2))) instead.
53
+
- Prefer static member lookup to struct instances where possible, such as .circle rather than Circle(), and .borderedProminent rather than BorderedProminentButtonStyle().
54
+
- Never use old-style Grand Central Dispatch concurrency such as DispatchQueue.main.async(). If behavior like this is needed, always use modern Swift concurrency.
55
+
- Filtering text based on user-input must be done using localizedStandardContains() as opposed to contains().
56
+
- Avoid force unwraps and force try unless it is unrecoverable.
57
+
58
+
## Tools
59
+
- Prefer `ast-grep` for syntax-aware searches; only use `rg` for plain-text matching when needed.
60
+
- Use the `gh` CLI for GitHub operations when available (e.g., creating repos and pushing).
0 commit comments