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