Add a couple of points about code style/ordering to the AGENTS.md (#6133)

This commit is contained in:
Doug
2026-09-09 15:47:15 +01:00
committed by GitHub
parent 8401c2612a
commit b652dfe69a
+2
View File
@@ -15,6 +15,8 @@ PRs must follow rules. Prefer Xcode MCP tools over terminal commands.
- Follow [Swift API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/) everywhere, Rust SDK wrappers too (`ID` not `Id`, `URL` not `Url`, `configuration` not `config` or `cfg`).
- File headers live in `IDETemplateMacros.plist`.
- **Import `SwiftUI`, not `UIKit`** — need `UIPasteboard` etc, `SwiftUI` bring it. `SwiftUI` re-export `Foundation` too, so no `import Foundation` beside it.
- **Clean Code** (Robert C. Martin) Newspaper order: headline first, detail down. Stepdown rule: caller above callee, calls point down. Tests: test cases first, helpers below. Swift idiom always win on clash.
- **Member order in type**: properties (stored + computed, public + private) → `init` → functions. `View` types: properties → `init` → views (`body` first) → functions.
### Comments