rn-agent-kit 0.0.0-stage → 0.2.0

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 (36) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +176 -2
  3. package/dist/cli.js +2916 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/scripts/figma-tokens.js +1284 -0
  6. package/dist/scripts/figma-tokens.js.map +1 -0
  7. package/dist/scripts/validate-jira-tickets.js +169 -0
  8. package/dist/scripts/validate-jira-tickets.js.map +1 -0
  9. package/package.json +64 -4
  10. package/skills/expo-cli/SKILL.md +213 -0
  11. package/skills/figma-to-tokens/SKILL.md +288 -0
  12. package/skills/github-actions-ci/SKILL.md +124 -0
  13. package/skills/maestro-e2e/SKILL.md +256 -0
  14. package/skills/prd-to-jira/SKILL.md +237 -0
  15. package/skills/rn-architecture/SKILL.md +207 -0
  16. package/skills/rn-native-android-ios/SKILL.md +195 -0
  17. package/skills/rn-sdk-integrations/SKILL.md +274 -0
  18. package/skills/rn-typescript-react/SKILL.md +247 -0
  19. package/skills/ticket-to-code/SKILL.md +192 -0
  20. package/templates/config/rn-agent-kit.json +4 -0
  21. package/templates/eslint/eslint.config.snippet.mjs +16 -0
  22. package/templates/eslint/rn-agent-kit-rules.cjs +137 -0
  23. package/templates/jira-ticket.md +78 -0
  24. package/templates/maestro/smoke.yaml +4 -0
  25. package/templates/scaffold/.husky/commit-msg +4 -0
  26. package/templates/scaffold/.husky/pre-commit +4 -0
  27. package/templates/scaffold/.prettierignore +6 -0
  28. package/templates/scaffold/.prettierrc +6 -0
  29. package/templates/scaffold/commitlint.config.cjs +4 -0
  30. package/templates/scaffold/eslint.config.js +22 -0
  31. package/templates/scaffold/jest.config.cjs +9 -0
  32. package/templates/scaffold/tsconfig.json +13 -0
  33. package/templates/workflows/ci.yml +120 -0
  34. package/templates/workflows/e2e-android.yml +158 -0
  35. package/templates/workflows/e2e-ios.yml +134 -0
  36. package/templates/workflows/eas-build.yml +94 -0
@@ -0,0 +1,195 @@
1
+ ---
2
+ name: rn-native-android-ios
3
+ description: >-
4
+ Native Android/iOS for bare React Native CLI and Expo prebuild projects:
5
+ Gradle, Proguard, signing, flavors, Podfile, schemes, xcconfig, capabilities,
6
+ privacy manifest, New Architecture, TurboModules, Hermes, upgrades. Use when
7
+ editing android/ or ios/, fixing native builds, adding modules, or upgrading RN.
8
+ globs: "**/{android,ios}/**/*"
9
+ alwaysApply: false
10
+ ---
11
+
12
+ # rn-native-android-ios
13
+
14
+ Applies to **React Native CLI** and **Expo prebuild** outputs. Cite **React Native docs**, **Android Gradle Plugin**, **Apple Human Interface / Xcode docs**, **Expo prebuild / CNG**, and **Hermes**.
15
+
16
+ ## Golden rule (Expo CNG)
17
+
18
+ If the app is Expo-managed with Continuous Native Generation:
19
+
20
+ - **Do not hand-edit** generated `android/` or `ios/` for durable changes.
21
+ - Encode changes via **config plugins**, `expo-build-properties`, entitlements plugins, or a custom config plugin.
22
+ - Only maintain a long-lived native fork if the team explicitly owns bare workflow.
23
+
24
+ ```text
25
+ ✅ app.config.ts + plugins → prebuild
26
+ ❌ “quick fix” in Podfile that nobody regenerates
27
+ ```
28
+
29
+ ## Android (`android/`)
30
+
31
+ ### Gradle & SDK levels
32
+
33
+ - Set `minSdkVersion`, `targetSdkVersion`, `compileSdkVersion` in `android/build.gradle` or via **expo-build-properties**.
34
+ - Keep AGP / Kotlin / RN versions aligned with the RN release notes for your version.
35
+ - Prefer Version Catalogs / RN template structure; avoid duplicate `google()` repos chaos.
36
+
37
+ ```gradle
38
+ // ✅ Good — single source of truth (example values; use RN template defaults)
39
+ ext {
40
+ minSdkVersion = 24
41
+ targetSdkVersion = 35
42
+ compileSdkVersion = 35
43
+ }
44
+ ```
45
+
46
+ ### Product flavors
47
+
48
+ Use flavors for env (dev/staging/prod) with distinct `applicationIdSuffix` and resources.
49
+
50
+ ```gradle
51
+ // ✅ Good
52
+ productFlavors {
53
+ staging {
54
+ dimension "env"
55
+ applicationIdSuffix ".staging"
56
+ resValue "string", "app_name", "MyApp Staging"
57
+ }
58
+ prod {
59
+ dimension "env"
60
+ // production applicationId
61
+ }
62
+ }
63
+ ```
64
+
65
+ Wire the same idea in Expo via different `android.package` per `APP_ENV` in `app.config.ts`.
66
+
67
+ ### Signing
68
+
69
+ - Release: store keystore outside git; inject via CI secrets / `GRADLE_OPTS` / `signingConfigs`.
70
+ - Never commit `keystore.properties` with passwords.
71
+ - Cite **Android Studio — Sign your app**.
72
+
73
+ ### Proguard / R8
74
+
75
+ - Enable for release; keep rules for RN, Hermes, and libraries (Reanimated, OkHttp, etc.).
76
+ - Test release builds; don’t only run debug.
77
+
78
+ ```proguard
79
+ # Example keeps — follow each library’s RN docs
80
+ -keep class com.facebook.react.** { *; }
81
+ -keep class com.swmansion.reanimated.** { *; }
82
+ ```
83
+
84
+ ### Common Android pitfalls
85
+
86
+ - Missing `usesCleartextTraffic` only when debugging HTTP (prefer HTTPS).
87
+ - Notification / deep link intent-filters missing in `AndroidManifest.xml` (or config plugin).
88
+ - 16 KB page size / Play requirements—track current **Play Console** + RN release notes.
89
+
90
+ ## iOS (`ios/`)
91
+
92
+ ### Podfile
93
+
94
+ - Run `bundle exec pod install` from `ios/` (or `npx pod-install`).
95
+ - Pin CocoaPods via Gemfile when possible.
96
+ - Prefer RN / Expo template Podfile hooks; avoid random `post_install` hacks unless documented.
97
+
98
+ ### Schemes, xcconfig, build configs
99
+
100
+ - Debug / Release (+ Staging) schemes with matching xcconfig.
101
+ - Set `PRODUCT_BUNDLE_IDENTIFIER` per configuration.
102
+ - Capabilities (Push, Associated Domains, Sign in with Apple) via Xcode **Signing & Capabilities** or Expo plugins—not one-off entitlements edits lost on clean prebuild.
103
+
104
+ ### Signing
105
+
106
+ - Use automatic signing for small teams; CI often needs API key + match / EAS credentials.
107
+ - Cite **EAS Submit** / Apple **App Store Connect API**.
108
+
109
+ ### Privacy manifest
110
+
111
+ - Ship `PrivacyInfo.xcprivacy` as required by Apple for APIs (cite **Apple — Privacy manifest files**).
112
+ - Expo modules often ship manifests; audit third-party SDKs on upgrade.
113
+
114
+ ```xml
115
+ <!-- Conceptual — follow Apple’s schema -->
116
+ <key>NSPrivacyAccessedAPITypes</key>
117
+ ```
118
+
119
+ ### Permissions usage strings
120
+
121
+ Set `NSCameraUsageDescription`, etc., via `infoPlist` in app config or `Info.plist`. Missing strings → App Store rejection / crash on access.
122
+
123
+ ## New Architecture (Fabric / TurboModules)
124
+
125
+ Cite **React Native — New Architecture**.
126
+
127
+ - Prefer enabling New Arch on current RN/Expo SDK when library support allows (`newArchEnabled`).
128
+ - Interop layer helps old modules; don’t assume every lib is Fabric-ready—check release notes.
129
+ - Write new native modules as **Turbo Modules** + codegen when targeting New Arch.
130
+
131
+ ```ts
132
+ // ✅ Good — JS spec for codegen (illustrative)
133
+ export interface Spec extends TurboModule {
134
+ multiply(a: number, b: number): number;
135
+ }
136
+ ```
137
+
138
+ ```objc
139
+ // ❌ Bad — forever-only legacy bridge module for greenfield features without migration plan
140
+ ```
141
+
142
+ ## Writing native modules
143
+
144
+ 1. Prefer an existing Expo module or community package.
145
+ 2. Else **Expo Modules API** (`expo-modules-core`) for cross-platform Swift/Kotlin modules—cite **Expo Modules API**.
146
+ 3. Else RN TurboModule / Fabric component with codegen.
147
+ 4. Keep a thin JS facade in `src/shared/lib` or a feature `services/`.
148
+
149
+ Never put business logic only in native if it can live in JS/TS for testability.
150
+
151
+ ## Hermes
152
+
153
+ - Hermes is the default on modern RN/Expo—keep it on unless a vendor forces JSC.
154
+ - Debug Hermes bytecode / sourcemaps via Metro + appropriate symbolication.
155
+ - Cite **React Native — Hermes**.
156
+
157
+ ## Upgrade strategy
158
+
159
+ 1. Read RN / Expo SDK changelog + breaking changes.
160
+ 2. Align Node, JDK, Xcode, Android SDK, CocoaPods.
161
+ 3. Expo: bump SDK → `npx expo install --fix` → `expo-doctor` → clean prebuild → EAS build.
162
+ 4. Bare: upgrade `react-native` via [Upgrade Helper](https://react-native-community.github.io/upgrade-helper/) → diff native templates carefully.
163
+ 5. Upgrade one third-party native module at a time; keep a green binary between steps.
164
+ 6. Smoke-test: cold start, deep link, push, IAP/auth, release build.
165
+
166
+ ```bash
167
+ # ✅ Expo path
168
+ npx expo install expo@latest
169
+ npx expo install --fix
170
+ npx expo-doctor
171
+ eas build --profile development
172
+ ```
173
+
174
+ ## Never do this
175
+
176
+ ```text
177
+ ❌ Edit node_modules native code permanently
178
+ ❌ Commit secrets into gradle / xcconfig
179
+ ❌ Disable New Arch / Hermes “to make error go away” without root-causing
180
+ ❌ Mix Expo CNG with long-lived undocumented Podfile patches
181
+ ❌ Upgrade RN + all native SDKs in one unreviewable mega-PR
182
+ ```
183
+
184
+ ## Common mistakes
185
+
186
+ 1. Hand-editing Expo-generated native projects without plugins.
187
+ 2. Debug works, release crashes—skipped Proguard/R8 keep rules.
188
+ 3. Wrong `minSdk` / deployment target vs library requirements.
189
+ 4. Missing privacy manifest / usage description strings.
190
+ 5. Push entitlements present in Xcode but not in provisioning profile.
191
+ 6. Assuming TurboModule support without checking the library.
192
+ 7. Checking in `Pods/` inconsistently with team policy (prefer lockfile + CI pods).
193
+ 8. Using outdated Upgrade Helper target or skipping AndroidManifest merges.
194
+ 9. Local JDK 11 vs 17 mismatch vs AGP requirements.
195
+ 10. Ignoring official **React Native** / **Expo** upgrade docs in favor of random GitHub issues.
@@ -0,0 +1,274 @@
1
+ ---
2
+ name: rn-sdk-integrations
3
+ description: >-
4
+ Integration checklists for Firebase, Sentry, RevenueCat, Stripe, Google/Apple
5
+ Sign-In, deep links, permissions, secure storage, and maps—Expo vs bare native
6
+ config and pitfalls. Use when adding or debugging third-party SDKs, auth, push,
7
+ payments, analytics, or device permissions in React Native / Expo.
8
+ globs: "**/*.{ts,tsx,js,jsx,json}"
9
+ alwaysApply: false
10
+ ---
11
+
12
+ # rn-sdk-integrations
13
+
14
+ Prefer **current stable** SDKs and official install guides: **Expo docs**, **React Native Firebase**, **Sentry React Native**, **RevenueCat**, **Stripe React Native**, **Google Sign-In**, **Apple**, **React Native Maps**. Always rebuild a **Dev Client / native binary** after adding native modules.
15
+
16
+ ## Universal checklist (every SDK)
17
+
18
+ 1. Read the library’s **Expo** install page if present; else bare RN guide.
19
+ 2. `npx expo install <pkg>` (Expo) to keep SDK-aligned versions.
20
+ 3. Add **config plugins** / native files; run prebuild or edit bare projects.
21
+ 4. Add env keys via EAS secrets / CI—not committed `.env` with prod secrets.
22
+ 5. Gate behind a thin `services/` wrapper + zod-validated config.
23
+ 6. Verify **release** builds (Proguard, bitcode-less, privacy manifests).
24
+ 7. Document required console setup (Firebase project, Stripe mode, etc.).
25
+
26
+ ```ts
27
+ // ✅ Good — single integration boundary
28
+ export const analytics = {
29
+ log(event: string, props?: Record<string, string | number | boolean>) {
30
+ void firebaseAnalytics.logEvent(event, props);
31
+ },
32
+ };
33
+
34
+ // ❌ Bad — call vendor SDK from 40 random screens
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Firebase (Analytics, Crashlytics, Push)
40
+
41
+ Cite **React Native Firebase** and/or **Expo Firebase** guides for your stack.
42
+
43
+ ### Expo
44
+
45
+ - Prefer `@react-native-firebase/*` with config plugins **or** Expo’s documented Firebase path for your SDK—follow the current Expo + RNFirebase plugin docs.
46
+ - Place `google-services.json` / `GoogleService-Info.plist` per Expo RNFirebase plugin instructions (often `GOOGLE_SERVICES_JSON` path in app config).
47
+ - Push: `@react-native-firebase/messaging` + credentials in Firebase / Apple / Play.
48
+ - Rebuild native app; Expo Go is insufficient for RNFirebase.
49
+
50
+ ### Bare
51
+
52
+ - Apply Google Services Gradle plugin; add pods; configure capabilities (Push).
53
+ - Upload dSYMs / Proguard mapping for Crashlytics.
54
+
55
+ ### Pitfalls
56
+
57
+ - Mixing Expo Go with RNFirebase.
58
+ - Wrong `google-services` file per flavor/env.
59
+ - Forgetting APNs key in Firebase for iOS push.
60
+ - Logging PII to Analytics.
61
+
62
+ ---
63
+
64
+ ## Sentry
65
+
66
+ Cite **Sentry — React Native** / **Sentry Expo**.
67
+
68
+ ### Expo
69
+
70
+ ```bash
71
+ npx expo install @sentry/react-native
72
+ npx @sentry/wizard@latest -i reactNative
73
+ ```
74
+
75
+ - Add plugin in `app.config.ts`; set DSN via env / `extra`.
76
+ - Enable source maps upload in EAS (Sentry Expo docs).
77
+
78
+ ### Bare
79
+
80
+ - Run wizard; verify `sentry.properties` not leaking auth tokens in public forks (use CI secrets).
81
+
82
+ ### Pitfalls
83
+
84
+ - No release/dist set → useless stack traces.
85
+ - Capturing `console` noise without scrubbing tokens.
86
+ - Missing native symbol upload for release crashes.
87
+
88
+ ---
89
+
90
+ ## RevenueCat
91
+
92
+ Cite **RevenueCat — React Native** / Expo.
93
+
94
+ ### Expo & bare
95
+
96
+ ```bash
97
+ npx expo install react-native-purchases
98
+ ```
99
+
100
+ - Configure apps + products in RevenueCat + StoreKit / Play Console.
101
+ - Use sandbox Apple / license testers on Play.
102
+ - Expose entitlements via a `purchases` service; don’t scatter `Purchases.*` calls.
103
+
104
+ ### Pitfalls
105
+
106
+ - Testing IAP in Expo Go (needs Dev Client).
107
+ - Bundle ID / applicationId mismatch with store apps.
108
+ - Not restoring purchases on new devices.
109
+ - Trusting client-only entitlement checks for gated backend content—verify server-side when needed.
110
+
111
+ ---
112
+
113
+ ## Stripe
114
+
115
+ Cite **Stripe — React Native SDK** and **PaymentSheet**.
116
+
117
+ ### Expo
118
+
119
+ ```bash
120
+ npx expo install @stripe/stripe-react-native
121
+ ```
122
+
123
+ - Add config plugin; set merchant identifier for Apple Pay.
124
+ - **Never** ship secret keys; only publishable key on device. PaymentIntents from your backend.
125
+
126
+ ```tsx
127
+ // ✅ Good
128
+ <StripeProvider publishableKey={env.stripePublishableKey}>
129
+ <CheckoutScreen />
130
+ </StripeProvider>;
131
+
132
+ // ❌ Bad
133
+ fetch("https://api.stripe.com/v1/charges", { headers: { Authorization: `Bearer sk_live_...` } });
134
+ ```
135
+
136
+ ### Pitfalls
137
+
138
+ - Using Charges API from the client.
139
+ - Forgetting return URL / 3DS handling.
140
+ - Misconfigured Apple Pay merchant ID / Google Pay.
141
+
142
+ ---
143
+
144
+ ## Google Sign-In / Apple Sign-In
145
+
146
+ Cite **@react-native-google-signin/google-signin**, **expo-apple-authentication**, Apple HIG.
147
+
148
+ ### Expo
149
+
150
+ ```bash
151
+ npx expo install @react-native-google-signin/google-signin expo-apple-authentication
152
+ ```
153
+
154
+ - Google: OAuth client IDs (iOS/Android/Web); plugin URL schemes / reversed client id.
155
+ - Apple: enable Sign in with Apple capability; use `expo-apple-authentication` on iOS; follow Android alternatives if needed.
156
+
157
+ ### Pitfalls
158
+
159
+ - Wrong SHA-1 on Firebase/Google Cloud for Android.
160
+ - Missing URL scheme → Google redirect fails.
161
+ - Apple required if you offer other social login (App Store Guideline 4.8)—know the policy.
162
+ - Using web client ID incorrectly as iOS client ID.
163
+
164
+ ---
165
+
166
+ ## Deep links / universal links
167
+
168
+ Cite **Expo Linking**, **React Native Linking**, Apple **Associated Domains**, Android **App Links**.
169
+
170
+ ### Checklist
171
+
172
+ - [ ] App scheme in `app.config.ts` (`scheme: "myapp"`).
173
+ - [ ] HTTPS AASA / `assetlinks.json` for universal / app links.
174
+ - [ ] Intent filters / associated domains via config plugin.
175
+ - [ ] Handle URL with Expo Router `useURL` / linking config.
176
+ - [ ] Test cold start + warm start.
177
+
178
+ ```ts
179
+ // ✅ Good — validate params
180
+ const id = z.string().parse(params.id);
181
+
182
+ // ❌ Bad — trust deep link query blindly in SQL/API path
183
+ ```
184
+
185
+ ### Pitfalls
186
+
187
+ - Only testing custom scheme, not HTTPS links.
188
+ - TeamID / package mismatch in verification files.
189
+ - Expo Router path not matching link path.
190
+
191
+ ---
192
+
193
+ ## Permissions
194
+
195
+ Cite **expo-modules** permission libs (`expo-camera`, `expo-location`, …) and platform settings.
196
+
197
+ | Concern | Expo | Bare |
198
+ | ----------------------------- | -------------------------------------------------- | ---------------------------- |
199
+ | Manifest / Info.plist strings | app config `plugins` + `infoPlist` / `permissions` | AndroidManifest / Info.plist |
200
+ | Runtime prompt | library `requestPermissionAsync` | same |
201
+ | UX | explain before system dialog | same |
202
+
203
+ ```ts
204
+ // ✅ Good
205
+ const { status } = await ImagePicker.requestCameraPermissionsAsync();
206
+ if (status !== "granted") return;
207
+
208
+ // ❌ Bad — open camera without checking; crash or silent failure
209
+ ```
210
+
211
+ ### Pitfalls
212
+
213
+ - Missing usage description → iOS crash.
214
+ - Requesting on launch without context → denials.
215
+ - Not handling “never ask again” on Android.
216
+
217
+ ---
218
+
219
+ ## Secure storage
220
+
221
+ Cite **expo-secure-store**, **react-native-keychain**.
222
+
223
+ ```ts
224
+ import * as SecureStore from "expo-secure-store";
225
+
226
+ // ✅ Good — tokens
227
+ await SecureStore.setItemAsync("session", token, {
228
+ keychainAccessible: SecureStore.WHEN_UNLOCKED,
229
+ });
230
+
231
+ // ❌ Bad — access tokens in AsyncStorage / MMKV without encryption needs assessment
232
+ ```
233
+
234
+ ### Pitfalls
235
+
236
+ - Storing large blobs in Keychain.
237
+ - Assuming SecureStore syncs across devices (it doesn’t like a backend).
238
+ - Logging secrets.
239
+
240
+ ---
241
+
242
+ ## Maps
243
+
244
+ Cite **react-native-maps** / Expo maps guide.
245
+
246
+ ### Expo
247
+
248
+ ```bash
249
+ npx expo install react-native-maps
250
+ ```
251
+
252
+ - Provide Google Maps API keys (Android manifest / iOS as required); restrict keys by app + API.
253
+ - Apple Maps default on iOS unless Google provider configured.
254
+
255
+ ### Pitfalls
256
+
257
+ - Unrestricted API keys in client (still restrict by bundle/package + API).
258
+ - Rendering hundreds of `Marker`s without clustering.
259
+ - Forgetting billing enabled on Google Cloud.
260
+
261
+ ---
262
+
263
+ ## Common mistakes (cross-cutting)
264
+
265
+ 1. Adding a native SDK and expecting **Expo Go** to load it.
266
+ 2. Skipping config plugins / privacy manifests / usage strings.
267
+ 3. Secret keys in the JS bundle.
268
+ 4. No env separation (dev keys in prod builds).
269
+ 5. Not rebuilding after native changes.
270
+ 6. Ignoring Proguard/R8 rules for the SDK.
271
+ 7. Calling vendor APIs directly from UI components.
272
+ 8. Missing release symbolication (Sentry/Crashlytics).
273
+ 9. Deep links without validation.
274
+ 10. Following outdated Medium posts instead of **current official docs**.