1 ---
2 name: sdk-branding
3 description: Onde Inference SDK branding rules. Covers copyright headers for every language, brand identity (logo, colors, badges), README structure, and file classification (generated vs hand-written). Apply when creating or editing any SDK source file, README, or documentation.
4 allowed-tools: Read, Write, Edit, Glob, Grep
5 user-invocable: false
6 ---
7
8 # SDK Branding
9
10 Branding rules for the Onde Inference SDK. These apply across all languages and all SDK surfaces: source files, READMEs, package metadata, and CI output.
11
12 ---
13
14 ## Copyright Header
15
16 Every hand-written source file starts with this two-line block. No blank line before it. One blank line after it (before the first import, `package`, or code).
17
18
19 ### Format
20
21 ```
22 // Copyright 2026 Splitfire AB (Onde Inference). All rights reserved.
23 // SPDX-License-Identifier: MIT OR Apache-2.0
24
25 ```
26
27 Use `//` comment syntax for all languages that support it: Dart, Swift, Kotlin, Rust, TypeScript, JavaScript, C, and C++.
28
29 ### Language reference
30
31 **Dart**
32 ```dart
33 // Copyright 2026 Splitfire AB (Onde Inference). All rights reserved.
34 // SPDX-License-Identifier: MIT OR Apache-2.0
35
36 import 'dart:async';
37 ```
38
39 **Swift**
40 ```swift
41 // Copyright 2026 Splitfire AB (Onde Inference). All rights reserved.
42 // SPDX-License-Identifier: MIT OR Apache-2.0
43
44 import Foundation
45 ```
46
47 **Kotlin**
48 ```kotlin
49 // Copyright 2026 Splitfire AB (Onde Inference). All rights reserved.
50 // SPDX-License-Identifier: MIT OR Apache-2.0
51
52 package com.ondeinference
53 ```
54
55 **Rust**
56 ```rust
57 // Copyright 2026 Splitfire AB (Onde Inference). All rights reserved.
58 // SPDX-License-Identifier: MIT OR Apache-2.0
59
60 use std::sync::Arc;
61 ```
62
63 **TypeScript / JavaScript**
64 ```ts
65 // Copyright 2026 Splitfire AB (Onde Inference). All rights reserved.
66 // SPDX-License-Identifier: MIT OR Apache-2.0
67
68 import OndeInferenceModule from "./OndeInferenceModule";
69 ```
70
71 **C / C++**
72 ```cpp
73 // Copyright 2026 Splitfire AB (Onde Inference). All rights reserved.
74 // SPDX-License-Identifier: MIT OR Apache-2.0
75
76 #include <flutter/plugin_registrar.h>
77 ```
78
79 ### Existing file-level comments
80
81 If the file already has a descriptive comment block below the copyright position (e.g. `// OndeInferencePlugin.swift\n// Native iOS plugin...`), prepend the copyright header above it — do not replace it.
82
83 ```swift
84 // Copyright 2026 Splitfire AB (Onde Inference). All rights reserved.
85 // SPDX-License-Identifier: MIT OR Apache-2.0
86
87 // OndeInferencePlugin.swift
88 //
89 // Native iOS plugin for onde_inference.
90 //
91 ```
92
93 When updating hand-written SDK bridge code, keep the header style consistent
94 across the React Native bridge and the Kotlin/Rust bridge. If one side uses an
95 older MIT-only prose header, normalize the touched bridge files to the two-line
96 SPDX header above.
97
98 ---
99
100 ## File Classification
101
102 Apply the header only to hand-written files. Never add it to generated files.
103
104 ### Always add the header
105
106 | File | Notes |
107 |---|---|
108 | `lib/src/engine.dart` | Core SDK logic |
109 | `lib/src/types.dart` | SDK types |
110 | `lib/onde_inference.dart` | Public barrel file |
111 | `test/dart_test.dart` | Hand-written unit tests |
112 | `example/lib/main.dart` | Example app entry point |
113 | `ios/Classes/OndeInferencePlugin.swift` | iOS plugin |
114 | `macos/Classes/OndeInferencePlugin.swift` | macOS plugin |
115 | `android/src/main/kotlin/**/*.kt` | Android plugin |
116 | `src/**/*.ts` / `src/**/*.js` | React Native TypeScript / JavaScript source |
117 | `windows/**/*.cpp` | Windows plugin |
118 | `linux/**/*.cc` / `linux/**/*.h` | Linux plugin |
119 | `src/**/*.rs` | Rust crate source |
120
121 ### Never add the header — generated files
122
123 These files are written by a tool on every codegen run. Adding a header would be overwritten or cause diffs noise.
124
125 | File / Pattern | Generator |
126 |---|---|
127 | `lib/src/frb_generated.dart/**` | `flutter_rust_bridge_codegen` |
128 | `rust/src/frb_generated.rs` | `flutter_rust_bridge_codegen` |
129 | `**/*.freezed.dart` | `build_runner` + `freezed` |
130 | `**/*.g.dart` | `build_runner` |
131 | `example/*/Flutter/GeneratedPluginRegistrant.*` | `flutter pub get` |
132 | `generated/**` (repo root) | `uniffi-bindgen` |
133 | `onde.swift` in `onde-swift` | `uniffi-bindgen` |
134
135 ### Never add the header — platform scaffold
136
137 These files are produced by `flutter create` or Xcode project templates. They are committed to git but were not hand-written by the team.
138
139 | Pattern | Tool |
140 |---|---|
141 | `example/ios/Runner/AppDelegate.swift` | `flutter create` |
142 | `example/ios/Runner/SceneDelegate.swift` | `flutter create` |
143 | `example/ios/RunnerTests/RunnerTests.swift` | `flutter create` |
144 | `example/macos/Runner/AppDelegate.swift` | `flutter create` |
145 | `example/macos/Runner/MainFlutterWindow.swift` | `flutter create` |
146 | `example/macos/RunnerTests/RunnerTests.swift` | `flutter create` |
147 | `example/test/widget_test.dart` | `flutter create` |
148
149 **Rule of thumb:** if the first meaningful line of a file is a Flutter or Xcode framework import with no project-specific logic, it is scaffold — skip it.
150
151 ---
152
153 ## Brand Identity
154
155 ### Logo
156
157 Always reference the logo via the raw GitHub URL so it renders on pub.dev, crates.io, and any mirror.
158
159 ```
160 https://raw.githubusercontent.com/ondeinference/onde/main/assets/onde-inference-logo.svg
161 ```
162
163 Width: `96` for top-level READMEs. Use `72` for secondary pages (example apps, sub-package docs).
164
165 ### Colors
166
167 | Role | Hex |
168 |---|---|
169 | Brand green (foreground, badge color) | `#235843` |
170 | Dark background (badge `labelColor`) | `#17211D` |
171
172 ### Badge row
173
174 Badge policy depends on the README type.
175
176 **Root README (`onde/README.md`)**
177
178 Use the full ecosystem badge wall here. This is the hub page for the whole SDK family.
179
180 ```html
181 <a href="https://crates.io/crates/onde"><img src="https://img.shields.io/crates/v/onde?style=flat-square&color=235843&labelColor=17211D&label=crates.io" alt="crates.io"></a>
182 <a href="https://central.sonatype.com/artifact/com.ondeinference/onde-inference"><img src="https://img.shields.io/maven-central/v/com.ondeinference/onde-inference?style=flat-square&color=235843&labelColor=17211D&label=maven" alt="Maven Central"></a>
183 <a href="https://swiftpackageindex.com/ondeinference/onde-swift"><img src="https://img.shields.io/badge/Swift%20Package%20Index-onde--swift-235843?style=flat-square&labelColor=17211D" alt="Swift Package Index"></a>
184 <a href="https://pub.dev/packages/onde_inference"><img src="https://img.shields.io/pub/v/onde_inference?style=flat-square&color=235843&labelColor=17211D&label=pub.dev" alt="pub.dev"></a>
185 <a href="https://www.npmjs.com/package/@ondeinference/react-native"><img src="https://img.shields.io/npm/v/@ondeinference/react-native?style=flat-square&color=235843&labelColor=17211D&label=npm" alt="npm"></a>
186 <a href="https://ondeinference.com"><img src="https://img.shields.io/badge/ondeinference.com-235843?style=flat-square&labelColor=17211D" alt="Website"></a>
187 <a href="https://apps.apple.com/se/developer/splitfire-ab/id1831430993"><img src="https://img.shields.io/badge/App%20Store-live-235843?style=flat-square&labelColor=17211D" alt="App Store"></a>
188 ```
189
190 **SDK README**
191
192 Use one primary registry badge for that SDK, plus `Website` and `License`. Do not repeat the full ecosystem badge wall on every SDK page.
193
194 **Flutter / Dart SDK:**
195 ```html
196 <a href="https://pub.dev/packages/onde_inference"><img src="https://img.shields.io/pub/v/onde_inference?style=flat-square&color=235843&labelColor=17211D&label=pub.dev" alt="pub.dev"></a>
197 <a href="https://ondeinference.com"><img src="https://img.shields.io/badge/ondeinference.com-235843?style=flat-square&labelColor=17211D" alt="Website"></a>
198 <a href="https://github.com/ondeinference/onde/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-235843?style=flat-square&labelColor=17211D" alt="License"></a>
199 ```
200
201 **Rust SDK:**
202 ```html
203 <a href="https://crates.io/crates/onde"><img src="https://img.shields.io/crates/v/onde?style=flat-square&color=235843&labelColor=17211D&label=crates.io" alt="crates.io"></a>
204 <a href="https://ondeinference.com"><img src="https://img.shields.io/badge/ondeinference.com-235843?style=flat-square&labelColor=17211D" alt="Website"></a>
205 <a href="https://github.com/ondeinference/onde/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-235843?style=flat-square&labelColor=17211D" alt="License"></a>
206 ```
207
208 **Kotlin Multiplatform SDK:**
209 ```html
210 <a href="https://central.sonatype.com/artifact/com.ondeinference/onde-inference"><img src="https://img.shields.io/maven-central/v/com.ondeinference/onde-inference?style=flat-square&color=235843&labelColor=17211D&label=maven" alt="Maven Central"></a>
211 <a href="https://ondeinference.com"><img src="https://img.shields.io/badge/ondeinference.com-235843?style=flat-square&labelColor=17211D" alt="Website"></a>
212 <a href="https://github.com/ondeinference/onde/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-235843?style=flat-square&labelColor=17211D" alt="License"></a>
213 ```
214
215 **React Native SDK:**
216 ```html
217 <a href="https://www.npmjs.com/package/@ondeinference/react-native"><img src="https://img.shields.io/npm/v/@ondeinference/react-native?style=flat-square&color=235843&labelColor=17211D&label=npm" alt="npm"></a>
218 <a href="https://ondeinference.com"><img src="https://img.shields.io/badge/ondeinference.com-235843?style=flat-square&labelColor=17211D" alt="Website"></a>
219 <a href="https://github.com/ondeinference/onde/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-235843?style=flat-square&labelColor=17211D" alt="License"></a>
220 ```
221
222 **Swift SDK:**
223 ```html
224 <a href="https://swiftpackageindex.com/ondeinference/onde-swift"><img src="https://img.shields.io/badge/Swift%20Package%20Index-onde--swift-235843?style=flat-square&labelColor=17211D" alt="Swift Package Index"></a>
225 <a href="https://ondeinference.com"><img src="https://img.shields.io/badge/ondeinference.com-235843?style=flat-square&labelColor=17211D" alt="Website"></a>
226 <a href="https://github.com/ondeinference/onde/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-235843?style=flat-square&labelColor=17211D" alt="License"></a>
227 ```
228
229 ### Cross-SDK nav row
230
231 Every SDK README should include a centered text-link row under the badges. These sibling links matter for discovery, branding, and cross-SDK navigation.
232
233 Use this pattern and adjust the current page's own SDK label if needed:
234
235 ```html
236 <p align="center">
237 <a href="https://github.com/ondeinference/onde">Rust SDK</a> · <a href="https://github.com/ondeinference/onde-swift">Swift SDK</a> · <a href="https://central.sonatype.com/artifact/com.ondeinference/onde-inference">Kotlin Multiplatform SDK</a> · <a href="https://pub.dev/packages/onde_inference">Flutter SDK</a> · <a href="https://www.npmjs.com/package/@ondeinference/react-native">React Native SDK</a> · <a href="https://ondeinference.com">Website</a>
238 </p>
239 ```
240
241 ### Footer
242
243 Every README ends with this line, inside a centered `<p>`:
244
245 ```html
246 <p align="center">
247 <sub>© 2026 <a href="https://ondeinference.com">Onde Inference</a> — MIT License</sub>
248 </p>
249 ```
250
251 Use `— MIT License` on sub-pages (example apps, package-level docs). Omit it on the top-level repo README (it has its own license section).
252
253 ---
254
255 ## README Structure
256
257 ### Top-level SDK README (e.g. `sdk/dart/README.md`)
258
259 1. Centered logo block
260 2. Centered `<h1>` with SDK name
261 3. Centered tagline (`<p><strong>...</strong></p>`)
262 4. Centered badge row with the SDK's primary registry badge, `Website`, and `License`
263 5. Centered cross-SDK nav links (`Rust SDK · Swift SDK · Kotlin Multiplatform SDK · Flutter SDK · React Native SDK · Website`)
264 6. `---` divider
265 7. A direct intro paragraph that explains what runs where and what the user gets
266 8. `## Platform support` — table: Platform | GPU backend | Default model | Notes
267 9. `## Quick start` — install snippet, initialization, then usage sections
268 10. `## Model selection` — table + code examples when relevant
269 11. `## Sampling` — presets table + code when relevant
270 12. `## Error handling` when relevant
271 13. `## Contributing`
272 14. `## License`
273 15. Footer
274
275 ### Example app README
276
277 1. Centered logo block (width `96`)
278 2. Centered `<h1>` with `Example App` in the title
279 3. Centered one-line description (bold) + second line: `No server. No API key. No data leaving the device.`
280 4. Centered badge row for the parent SDK or example context
281 5. `---` divider
282 6. `## What this example shows` — feature table mapping feature → file/function
283 7. `## Running the example` — Prerequisites, Steps, Platform notes table
284 8. `## SDK quick reference` — minimal happy-path snippet (load → stream → unload)
285 9. `## Project structure` — directory tree
286 10. `## Learn more` — links to the package page, ondeinference.com, and GitHub
287 11. Footer
288
289 ### Taglines
290
291 Use these as the default direction, but keep them natural if the page needs slightly different wording. Avoid stiff marketing language and avoid em dashes in prose.
292
293 | Context | Tagline |
294 |---|---|
295 | Rust crate | `Run LLMs on-device, with first-class support for Apple silicon.` |
296 | Flutter SDK | `Run LLMs on-device from Flutter and Dart. Metal on iOS and macOS, CPU everywhere else.` |
297 | Kotlin SDK | `Run LLMs on-device from Kotlin. No cloud, no API key, and no user data leaving the device.` |
298 | React Native SDK | `Run LLMs on-device from React Native. Metal on iOS, CPU on Android, and no user data leaving the device.` |
299 | Swift SDK | `Run LLMs on-device from Swift, with first-class support for Apple silicon.` |
300 | Example app | `A Flutter chat app that runs LLM inference fully on-device.` |
301
302 ---
303
304 ## Package Metadata Branding
305
306 ### `pubspec.yaml`
307
308 ```yaml
309 description: >-
310 On-device LLM inference for Flutter & Dart. Run Qwen 2.5 models locally
311 with Metal on iOS and macOS, CPU on Android and desktop. No cloud, no API key.
312 repository: https://github.com/ondeinference/onde/
313 homepage: https://ondeinference.com
314 issue_tracker: https://github.com/ondeinference/onde/issues
315 ```
316
317 ### `Cargo.toml`
318
319 ```toml
320 description = "On-device inference engine for Apple silicon."
321 license = "MIT"
322 repository = "https://github.com/ondeinference/onde"
323 homepage = "https://ondeinference.com"
324 documentation = "https://docs.rs/onde"
325 keywords = ["inference", "on-device", "chat", "llm", "mistral"]
326 categories = ["science::ml", "api-bindings"]
327 ```
328
329 ---
330
331 ## Version Synchronisation
332
333 The version in `Cargo.toml` and `sdk/dart/pubspec.yaml` must always be identical. When bumping a version, update both files in the same commit. The CI workflows for Swift and Dart both validate that the git tag equals the version in their respective metadata file — a mismatch fails fast.
334
335 ```
336 Cargo.toml version = "X.Y.Z"
337 sdk/dart/pubspec.yaml version: X.Y.Z
338 git tag X.Y.Z
339 ```
340
341 ---
342
343 ## Applying the Copyright Header to an Existing Codebase
344
345 When asked to add copyright headers to a set of files:
346
347 1. Run `find` or `Glob` to list all `.dart`, `.swift`, `.kt`, `.rs`, `.cpp`, `.cc`, `.h` files under the SDK path.
348 2. For each file, read its first line.
349 3. Skip if the first line already starts with `// Copyright`.
350 4. Skip if the first line contains `Generated` or `Do not edit`.
351 5. Skip if the file path matches any generated or scaffold pattern above.
352 6. Prepend the two-line header followed by a blank line.
353 7. If the file begins with an existing file-description comment block, insert the header above that block.
354
355 Do all qualifying files in one pass. Do not ask for confirmation per file.