@rune-kit/rune 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +357 -0
  3. package/agents/.gitkeep +0 -0
  4. package/agents/architect.md +29 -0
  5. package/agents/asset-creator.md +11 -0
  6. package/agents/audit.md +11 -0
  7. package/agents/autopsy.md +11 -0
  8. package/agents/brainstorm.md +11 -0
  9. package/agents/browser-pilot.md +11 -0
  10. package/agents/coder.md +29 -0
  11. package/agents/completion-gate.md +11 -0
  12. package/agents/constraint-check.md +11 -0
  13. package/agents/context-engine.md +11 -0
  14. package/agents/cook.md +11 -0
  15. package/agents/db.md +11 -0
  16. package/agents/debug.md +11 -0
  17. package/agents/dependency-doctor.md +11 -0
  18. package/agents/deploy.md +11 -0
  19. package/agents/design.md +11 -0
  20. package/agents/docs-seeker.md +11 -0
  21. package/agents/fix.md +11 -0
  22. package/agents/hallucination-guard.md +11 -0
  23. package/agents/incident.md +11 -0
  24. package/agents/integrity-check.md +11 -0
  25. package/agents/journal.md +11 -0
  26. package/agents/launch.md +11 -0
  27. package/agents/logic-guardian.md +11 -0
  28. package/agents/marketing.md +11 -0
  29. package/agents/onboard.md +11 -0
  30. package/agents/perf.md +11 -0
  31. package/agents/plan.md +11 -0
  32. package/agents/preflight.md +11 -0
  33. package/agents/problem-solver.md +11 -0
  34. package/agents/rescue.md +11 -0
  35. package/agents/research.md +11 -0
  36. package/agents/researcher.md +29 -0
  37. package/agents/review-intake.md +11 -0
  38. package/agents/review.md +11 -0
  39. package/agents/reviewer.md +28 -0
  40. package/agents/safeguard.md +11 -0
  41. package/agents/sast.md +11 -0
  42. package/agents/scanner.md +28 -0
  43. package/agents/scope-guard.md +11 -0
  44. package/agents/scout.md +11 -0
  45. package/agents/sentinel.md +11 -0
  46. package/agents/sequential-thinking.md +11 -0
  47. package/agents/session-bridge.md +11 -0
  48. package/agents/skill-forge.md +11 -0
  49. package/agents/skill-router.md +11 -0
  50. package/agents/surgeon.md +11 -0
  51. package/agents/team.md +11 -0
  52. package/agents/test.md +11 -0
  53. package/agents/trend-scout.md +11 -0
  54. package/agents/verification.md +11 -0
  55. package/agents/video-creator.md +11 -0
  56. package/agents/watchdog.md +11 -0
  57. package/agents/worktree.md +11 -0
  58. package/commands/.gitkeep +0 -0
  59. package/commands/rune.md +168 -0
  60. package/compiler/__tests__/openclaw-adapter.test.js +140 -0
  61. package/compiler/__tests__/parser.test.js +55 -0
  62. package/compiler/adapters/antigravity.js +59 -0
  63. package/compiler/adapters/claude.js +37 -0
  64. package/compiler/adapters/cursor.js +67 -0
  65. package/compiler/adapters/generic.js +60 -0
  66. package/compiler/adapters/index.js +45 -0
  67. package/compiler/adapters/openclaw.js +150 -0
  68. package/compiler/adapters/windsurf.js +60 -0
  69. package/compiler/bin/rune.js +288 -0
  70. package/compiler/doctor.js +153 -0
  71. package/compiler/emitter.js +240 -0
  72. package/compiler/parser.js +208 -0
  73. package/compiler/transformer.js +69 -0
  74. package/compiler/transforms/branding.js +27 -0
  75. package/compiler/transforms/cross-references.js +29 -0
  76. package/compiler/transforms/frontmatter.js +38 -0
  77. package/compiler/transforms/hooks.js +68 -0
  78. package/compiler/transforms/subagents.js +36 -0
  79. package/compiler/transforms/tool-names.js +60 -0
  80. package/contexts/dev.md +34 -0
  81. package/contexts/research.md +43 -0
  82. package/contexts/review.md +55 -0
  83. package/extensions/ai-ml/PACK.md +517 -0
  84. package/extensions/analytics/PACK.md +557 -0
  85. package/extensions/backend/PACK.md +678 -0
  86. package/extensions/chrome-ext/PACK.md +995 -0
  87. package/extensions/content/PACK.md +381 -0
  88. package/extensions/devops/PACK.md +520 -0
  89. package/extensions/ecommerce/PACK.md +280 -0
  90. package/extensions/gamedev/PACK.md +393 -0
  91. package/extensions/mobile/PACK.md +273 -0
  92. package/extensions/saas/PACK.md +805 -0
  93. package/extensions/security/PACK.md +536 -0
  94. package/extensions/trading/PACK.md +597 -0
  95. package/extensions/ui/PACK.md +947 -0
  96. package/package.json +47 -0
  97. package/skills/.gitkeep +0 -0
  98. package/skills/adversary/SKILL.md +271 -0
  99. package/skills/asset-creator/SKILL.md +157 -0
  100. package/skills/audit/SKILL.md +466 -0
  101. package/skills/autopsy/SKILL.md +200 -0
  102. package/skills/ba/SKILL.md +279 -0
  103. package/skills/brainstorm/SKILL.md +266 -0
  104. package/skills/browser-pilot/SKILL.md +168 -0
  105. package/skills/completion-gate/SKILL.md +151 -0
  106. package/skills/constraint-check/SKILL.md +165 -0
  107. package/skills/context-engine/SKILL.md +176 -0
  108. package/skills/cook/SKILL.md +636 -0
  109. package/skills/db/SKILL.md +256 -0
  110. package/skills/debug/SKILL.md +240 -0
  111. package/skills/dependency-doctor/SKILL.md +235 -0
  112. package/skills/deploy/SKILL.md +174 -0
  113. package/skills/design/DESIGN-REFERENCE.md +365 -0
  114. package/skills/design/SKILL.md +462 -0
  115. package/skills/doc-processor/SKILL.md +254 -0
  116. package/skills/docs/SKILL.md +336 -0
  117. package/skills/docs-seeker/SKILL.md +166 -0
  118. package/skills/fix/SKILL.md +192 -0
  119. package/skills/git/SKILL.md +285 -0
  120. package/skills/hallucination-guard/SKILL.md +204 -0
  121. package/skills/incident/SKILL.md +241 -0
  122. package/skills/integrity-check/SKILL.md +169 -0
  123. package/skills/journal/SKILL.md +190 -0
  124. package/skills/launch/SKILL.md +330 -0
  125. package/skills/logic-guardian/SKILL.md +240 -0
  126. package/skills/marketing/SKILL.md +229 -0
  127. package/skills/mcp-builder/SKILL.md +311 -0
  128. package/skills/onboard/SKILL.md +298 -0
  129. package/skills/perf/SKILL.md +297 -0
  130. package/skills/plan/SKILL.md +520 -0
  131. package/skills/preflight/SKILL.md +231 -0
  132. package/skills/problem-solver/SKILL.md +284 -0
  133. package/skills/rescue/SKILL.md +434 -0
  134. package/skills/research/SKILL.md +122 -0
  135. package/skills/review/SKILL.md +354 -0
  136. package/skills/review-intake/SKILL.md +222 -0
  137. package/skills/safeguard/SKILL.md +188 -0
  138. package/skills/sast/SKILL.md +190 -0
  139. package/skills/scaffold/SKILL.md +276 -0
  140. package/skills/scope-guard/SKILL.md +150 -0
  141. package/skills/scout/SKILL.md +232 -0
  142. package/skills/sentinel/SKILL.md +320 -0
  143. package/skills/sentinel-env/SKILL.md +226 -0
  144. package/skills/sequential-thinking/SKILL.md +234 -0
  145. package/skills/session-bridge/SKILL.md +287 -0
  146. package/skills/skill-forge/SKILL.md +317 -0
  147. package/skills/skill-router/SKILL.md +267 -0
  148. package/skills/surgeon/SKILL.md +203 -0
  149. package/skills/team/SKILL.md +397 -0
  150. package/skills/test/SKILL.md +271 -0
  151. package/skills/trend-scout/SKILL.md +145 -0
  152. package/skills/verification/SKILL.md +201 -0
  153. package/skills/video-creator/SKILL.md +201 -0
  154. package/skills/watchdog/SKILL.md +166 -0
  155. package/skills/worktree/SKILL.md +140 -0
@@ -0,0 +1,273 @@
1
+ ---
2
+ name: "@rune/mobile"
3
+ description: Mobile development patterns — React Native, Flutter, app store preparation, and native bridge integration.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.1.0"
7
+ layer: L4
8
+ price: "$15"
9
+ target: Mobile developers
10
+ ---
11
+
12
+ # @rune/mobile
13
+
14
+ ## Purpose
15
+
16
+ Mobile development has platform-specific pitfalls that web developers hit repeatedly: navigation stacks that leak memory, FlatList rendering that drops frames, state management that triggers unnecessary re-renders, native module bridges that crash on type mismatches, and app store rejections for metadata violations. This pack provides patterns for both React Native and Flutter — detect the framework, audit the codebase for mobile-specific anti-patterns, and emit fixes that pass platform review.
17
+
18
+ ## Triggers
19
+
20
+ - Auto-trigger: when `react-native`, `expo`, `flutter`, `android/`, `ios/`, `app.json` (Expo) detected
21
+ - `/rune react-native` — audit React Native architecture and performance
22
+ - `/rune flutter` — audit Flutter architecture and state management
23
+ - `/rune app-store-prep` — prepare app store submission
24
+ - `/rune native-bridge` — audit or create native module bridges
25
+ - Called by `cook` (L1) when mobile task detected
26
+ - Called by `team` (L1) when porting web to mobile
27
+
28
+ ## Skills Included
29
+
30
+ ### react-native
31
+
32
+ React Native patterns — navigation, state management, native modules, performance optimization, Expo vs bare workflow decisions.
33
+
34
+ #### Workflow
35
+
36
+ **Step 1 — Detect React Native setup**
37
+ Use Grep to find framework markers: `react-native` in package.json, `expo` config, navigation library (`@react-navigation`, `expo-router`), state management (`zustand`, `redux`, `jotai`), and native module usage. Read `app.json`/`app.config.js` for Expo configuration.
38
+
39
+ **Step 2 — Audit performance patterns**
40
+ Check for: FlatList without `keyExtractor` or with inline `renderItem` (re-renders), images without caching (`FastImage` or `expo-image`), heavy re-renders from context (missing `useMemo`/`useCallback`), navigation listeners not cleaned up, large JS bundle without lazy loading (`React.lazy` + `Suspense`).
41
+
42
+ **Step 3 — Emit optimized patterns**
43
+ For each issue, emit the fix: memoized FlatList item components, proper image caching setup, navigation with typed routes, optimized state selectors, and Hermes engine configuration.
44
+
45
+ #### Example
46
+
47
+ ```tsx
48
+ // BEFORE: FlatList anti-patterns — re-renders every item on any state change
49
+ <FlatList
50
+ data={items}
51
+ renderItem={({ item }) => <ItemCard item={item} onPress={() => nav.navigate('Detail', { id: item.id })} />}
52
+ />
53
+
54
+ // AFTER: memoized components, stable callbacks, proper key extraction
55
+ const MemoizedCard = React.memo(({ item, onPress }) => (
56
+ <ItemCard item={item} onPress={onPress} />
57
+ ));
58
+
59
+ const renderItem = useCallback(({ item }) => (
60
+ <MemoizedCard item={item} onPress={() => nav.navigate('Detail', { id: item.id })} />
61
+ ), [nav]);
62
+
63
+ <FlatList
64
+ data={items}
65
+ renderItem={renderItem}
66
+ keyExtractor={item => item.id}
67
+ getItemLayout={(_, index) => ({ length: ITEM_HEIGHT, offset: ITEM_HEIGHT * index, index })}
68
+ maxToRenderPerBatch={10}
69
+ windowSize={5}
70
+ />
71
+ ```
72
+
73
+ ---
74
+
75
+ ### flutter
76
+
77
+ Flutter patterns — widget composition, state management (Riverpod, BLoC), platform channels, adaptive layouts.
78
+
79
+ #### Workflow
80
+
81
+ **Step 1 — Detect Flutter architecture**
82
+ Use Grep to find state management (`riverpod`, `flutter_bloc`, `provider`, `get_it`), routing (`go_router`, `auto_route`), and platform channel usage. Read `pubspec.yaml` for dependencies and `lib/` structure for architecture pattern (feature-first, layer-first).
83
+
84
+ **Step 2 — Audit widget tree and state**
85
+ Check for: `setState` in complex widgets (should use state management), deeply nested widget trees (extract widgets), `BuildContext` passed through many layers (use InheritedWidget or Riverpod), missing `const` constructors (unnecessary rebuilds), platform-specific code without adaptive checks.
86
+
87
+ **Step 3 — Emit refactored patterns**
88
+ For each issue, emit: extracted widget with const constructor, Riverpod provider for state, proper error handling with `AsyncValue`, and adaptive layout using `LayoutBuilder` + breakpoints.
89
+
90
+ #### Example
91
+
92
+ ```dart
93
+ // BEFORE: setState in complex widget, no separation
94
+ class HomeScreen extends StatefulWidget { ... }
95
+ class _HomeScreenState extends State<HomeScreen> {
96
+ List<Item> items = [];
97
+ bool loading = true;
98
+
99
+ @override
100
+ void initState() {
101
+ super.initState();
102
+ fetchItems().then((data) => setState(() { items = data; loading = false; }));
103
+ }
104
+ }
105
+
106
+ // AFTER: Riverpod with AsyncValue, separated concerns
107
+ @riverpod
108
+ Future<List<Item>> items(Ref ref) async {
109
+ final repo = ref.watch(itemRepositoryProvider);
110
+ return repo.fetchAll();
111
+ }
112
+
113
+ class HomeScreen extends ConsumerWidget {
114
+ const HomeScreen({super.key});
115
+
116
+ @override
117
+ Widget build(BuildContext context, WidgetRef ref) {
118
+ final itemsAsync = ref.watch(itemsProvider);
119
+ return itemsAsync.when(
120
+ data: (items) => ItemList(items: items),
121
+ loading: () => const ShimmerList(),
122
+ error: (err, stack) => ErrorView(message: err.toString(), onRetry: () => ref.invalidate(itemsProvider)),
123
+ );
124
+ }
125
+ }
126
+ ```
127
+
128
+ ---
129
+
130
+ ### app-store-prep
131
+
132
+ App store submission preparation — screenshots, metadata, privacy policy, review guidelines compliance, TestFlight/internal testing.
133
+
134
+ #### Workflow
135
+
136
+ **Step 1 — Audit submission readiness**
137
+ Check for: app icon (1024x1024 for iOS, adaptive for Android), splash screen, privacy policy URL in app config, required permissions with usage descriptions (`NSCameraUsageDescription`, etc.), minimum SDK versions, and build configuration (release signing).
138
+
139
+ **Step 2 — Generate metadata**
140
+ From README and app config, generate: app title (30 chars max), subtitle (30 chars), description (4000 chars), keywords (100 chars), category selection, age rating questionnaire answers, and screenshot specifications per device size.
141
+
142
+ **Step 3 — Emit submission checklist**
143
+ Output a structured checklist covering both platforms: Apple App Store (TestFlight build, privacy declarations, review notes) and Google Play (internal testing track, data safety form, content rating questionnaire).
144
+
145
+ #### Example
146
+
147
+ ```markdown
148
+ ## App Store Submission Checklist
149
+
150
+ ### iOS (Apple App Store Connect)
151
+ - [ ] App icon: 1024x1024 PNG, no alpha, no rounded corners
152
+ - [ ] Screenshots: 6.7" (1290x2796), 6.5" (1242x2688), 5.5" (1242x2208)
153
+ - [ ] Privacy policy URL: https://example.com/privacy
154
+ - [ ] NSCameraUsageDescription: "Used to scan QR codes for quick login"
155
+ - [ ] NSLocationWhenInUseUsageDescription: "Used to show nearby stores"
156
+ - [ ] TestFlight build uploaded and tested
157
+ - [ ] Export compliance: Uses HTTPS only (no custom encryption) → select "No"
158
+
159
+ ### Android (Google Play Console)
160
+ - [ ] Adaptive icon: foreground (108dp) + background layer
161
+ - [ ] Feature graphic: 1024x500 PNG
162
+ - [ ] Data safety form: camera (optional), location (optional)
163
+ - [ ] Content rating: IARC questionnaire completed
164
+ - [ ] Internal testing track: at least 1 build tested
165
+ - [ ] Signing: upload key + app signing by Google Play enabled
166
+ ```
167
+
168
+ ---
169
+
170
+ ### native-bridge
171
+
172
+ Native bridge patterns — platform-specific code, native module creation, Swift/Kotlin interop, background tasks.
173
+
174
+ #### Workflow
175
+
176
+ **Step 1 — Detect bridge requirements**
177
+ Use Grep to find platform-specific code: `Platform.OS`, `Platform.select`, `NativeModules`, `MethodChannel`, Turbo Modules (`TurboModule`), or Expo modules (`expo-modules-core`). Read existing native code in `ios/` and `android/` directories.
178
+
179
+ **Step 2 — Audit bridge safety**
180
+ Check for: type mismatches between JS/Dart and native (string expected, int sent), missing error handling on native side, synchronous bridge calls blocking UI thread, missing null checks on platform-specific returns, and hardcoded platform assumptions.
181
+
182
+ **Step 3 — Emit type-safe bridge**
183
+ For React Native: emit Turbo Module with codegen types or Expo Module with TypeScript interface. For Flutter: emit MethodChannel with proper error handling, type-safe serialization, and platform-specific implementations for both iOS (Swift) and Android (Kotlin).
184
+
185
+ #### Example
186
+
187
+ ```typescript
188
+ // React Native — Expo Module (type-safe, modern approach)
189
+ // modules/haptics/index.ts
190
+ import { NativeModule, requireNativeModule } from 'expo-modules-core';
191
+
192
+ interface HapticsModule extends NativeModule {
193
+ impact(style: 'light' | 'medium' | 'heavy'): void;
194
+ notification(type: 'success' | 'warning' | 'error'): void;
195
+ }
196
+
197
+ const HapticsNative = requireNativeModule<HapticsModule>('Haptics');
198
+
199
+ export function impact(style: 'light' | 'medium' | 'heavy' = 'medium') {
200
+ HapticsNative.impact(style);
201
+ }
202
+
203
+ // modules/haptics/ios/HapticsModule.swift
204
+ import ExpoModulesCore
205
+ import UIKit
206
+
207
+ public class HapticsModule: Module {
208
+ public func definition() -> ModuleDefinition {
209
+ Name("Haptics")
210
+ Function("impact") { (style: String) in
211
+ let generator: UIImpactFeedbackGenerator
212
+ switch style {
213
+ case "light": generator = UIImpactFeedbackGenerator(style: .light)
214
+ case "heavy": generator = UIImpactFeedbackGenerator(style: .heavy)
215
+ default: generator = UIImpactFeedbackGenerator(style: .medium)
216
+ }
217
+ generator.impactOccurred()
218
+ }
219
+ }
220
+ }
221
+ ```
222
+
223
+ ---
224
+
225
+ ## Connections
226
+
227
+ ```
228
+ Calls → browser-pilot (L3): device testing and screenshot automation
229
+ Calls → asset-creator (L3): generate app icons and splash screens
230
+ Called By ← cook (L1): when mobile task detected
231
+ Called By ← team (L1): when porting web to mobile
232
+ Called By ← launch (L1): app store submission flow
233
+ ```
234
+
235
+ ## Tech Stack Support
236
+
237
+ | Framework | State Management | Navigation | Build |
238
+ |-----------|-----------------|------------|-------|
239
+ | React Native (bare) | Zustand / Redux | React Navigation v7 | Metro + Gradle/Xcode |
240
+ | Expo (managed) | Zustand | Expo Router v4 | EAS Build |
241
+ | Flutter | Riverpod / BLoC | GoRouter | Flutter CLI |
242
+
243
+ ## Constraints
244
+
245
+ 1. MUST test on both iOS and Android — never assume cross-platform behavior is identical.
246
+ 2. MUST NOT ship with debug configurations (Flipper, dev menu, debug signing) in production builds.
247
+ 3. MUST include usage descriptions for every permission requested — empty descriptions cause instant rejection.
248
+ 4. MUST use platform-adaptive components (Material on Android, Cupertino on iOS) or declare a unified design system.
249
+ 5. MUST handle offline gracefully — mobile apps lose connectivity; show cached data or clear offline state.
250
+
251
+ ## Sharp Edges
252
+
253
+ | Failure Mode | Severity | Mitigation |
254
+ |---|---|---|
255
+ | FlatList optimization causes blank cells on fast scroll (windowSize too small) | HIGH | Default windowSize=5, test with 1000+ items before declaring optimized |
256
+ | Native bridge type mismatch crashes app instead of returning error | CRITICAL | Always wrap native calls in try-catch; validate types before bridge call |
257
+ | Expo managed workflow limits native module access | MEDIUM | Detect Expo vs bare in Step 1; suggest `expo prebuild` for native module needs |
258
+ | App store rejection for missing privacy declaration | HIGH | Cross-reference every permission in Info.plist/AndroidManifest with usage description |
259
+ | Flutter hot reload masks state bugs that appear in release mode | MEDIUM | Test with `flutter run --release` before declaring state management correct |
260
+ | Screenshots generated at wrong device size fail store review | LOW | Use exact pixel dimensions from current App Store/Play Store requirements |
261
+
262
+ ## Done When
263
+
264
+ - React Native/Flutter codebase audited for performance anti-patterns with specific fixes
265
+ - FlatList/ListView optimized with memoization, key extraction, and window sizing
266
+ - State management uses proper patterns (no `setState` in complex widgets)
267
+ - App store metadata generated with correct dimensions, descriptions, and permissions
268
+ - Native bridge typed and error-handled for both platforms
269
+ - Structured report emitted for each skill invoked
270
+
271
+ ## Cost Profile
272
+
273
+ ~8,000–16,000 tokens per full pack run (all 4 skills). Individual skill: ~2,000–4,000 tokens. Sonnet default. Use haiku for config detection; escalate to sonnet for code generation and platform-specific patterns.