@luciq/react-native 19.4.0 → 19.6.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.
- package/.claude/agents/codebase-analyzer.md +33 -0
- package/.claude/agents/codebase-locator.md +42 -0
- package/.claude/agents/codebase-pattern-finder.md +40 -0
- package/.claude/commands/apply-pr-reviews.md +253 -0
- package/.claude/commands/create-jira-workitem.md +27 -0
- package/.claude/commands/create-pr.md +138 -0
- package/.claude/commands/create-public-release-notes.md +145 -0
- package/.claude/commands/create-rca.md +286 -0
- package/.claude/commands/debug-sdk.md +66 -0
- package/.claude/commands/describe-pr.md +40 -0
- package/.claude/commands/new-api.md +60 -0
- package/.claude/commands/new-feature.md +75 -0
- package/.claude/commands/pr-review.md +85 -0
- package/.claude/commands/research-codebase.md +41 -0
- package/.claude/commands/review.md +73 -0
- package/.claude/memory/MEMORY.md +1 -0
- package/.claude/memory/feedback_pr_title_format.md +10 -0
- package/.claude/rules/react-native-typescript.md +46 -0
- package/CHANGELOG.md +12 -0
- package/CLAUDE.md +125 -0
- package/android/native.gradle +1 -1
- package/android/src/main/java/ai/luciq/reactlibrary/LuciqScreenLoadingFrameTracker.java +88 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqAPMModule.java +184 -10
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativeModule.java +5 -3
- package/dist/components/LuciqCaptureScreenLoading.d.ts +8 -0
- package/dist/components/LuciqCaptureScreenLoading.js +154 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/modules/APM.d.ts +19 -0
- package/dist/modules/APM.js +38 -0
- package/dist/modules/Luciq.d.ts +1 -1
- package/dist/modules/Luciq.js +169 -11
- package/dist/modules/apm/ScreenLoadingManager.d.ts +99 -0
- package/dist/modules/apm/ScreenLoadingManager.js +296 -0
- package/dist/native/NativeAPM.d.ts +9 -0
- package/dist/native/NativeLuciq.d.ts +1 -1
- package/dist/utils/LuciqUtils.d.ts +25 -0
- package/dist/utils/LuciqUtils.js +44 -0
- package/dist/utils/RouteMatcher.d.ts +30 -0
- package/dist/utils/RouteMatcher.js +67 -0
- package/ios/RNLuciq/LuciqAPMBridge.m +82 -0
- package/ios/RNLuciq/LuciqReactBridge.m +1 -1
- package/ios/RNLuciq/LuciqScreenLoadingFrameTracker.h +11 -0
- package/ios/RNLuciq/LuciqScreenLoadingFrameTracker.m +121 -0
- package/ios/RNLuciq/Util/LCQAPM+PrivateAPIs.h +14 -0
- package/ios/native.rb +1 -1
- package/package.json +4 -1
- package/scripts/get-github-app-token.sh +70 -0
- package/scripts/notify-github.sh +17 -8
- package/src/components/LuciqCaptureScreenLoading.tsx +210 -0
- package/src/index.ts +4 -0
- package/src/modules/APM.ts +42 -0
- package/src/modules/Luciq.ts +197 -11
- package/src/modules/apm/ScreenLoadingManager.ts +364 -0
- package/src/native/NativeAPM.ts +22 -0
- package/src/native/NativeLuciq.ts +1 -1
- package/src/utils/LuciqUtils.ts +49 -0
- package/src/utils/RouteMatcher.ts +83 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate a Root Cause Analysis (RCA) document from PR and Jira ticket information
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
You are tasked with creating a comprehensive Root Cause Analysis (RCA) document. Follow these steps:
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
- `prUrls` (optional): One or more GitHub PR URLs related to the incident/fix, comma-separated
|
|
10
|
+
- Single PR: `prUrls=https://github.com/luciqai/luciq-reactnative-sdk/pull/45`
|
|
11
|
+
- Multiple PRs: `prUrls=https://github.com/luciqai/luciq-reactnative-sdk/pull/45,https://github.com/Instabug/ios/pull/6534`
|
|
12
|
+
|
|
13
|
+
- `taskUrl` (required): The Jira task/incident URL
|
|
14
|
+
- Example: `taskUrl=https://instabug.atlassian.net/browse/MOB-21429`
|
|
15
|
+
|
|
16
|
+
## 0. Prerequisites Check
|
|
17
|
+
|
|
18
|
+
**IMPORTANT**: This command requires GitHub CLI (`gh`) and Jira CLI (`jira`). Check if they are installed:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
gh --version 2>/dev/null || echo "GH_CLI_NOT_INSTALLED"
|
|
22
|
+
jira version 2>/dev/null || echo "JIRA_CLI_NOT_INSTALLED"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### GitHub CLI Setup
|
|
26
|
+
|
|
27
|
+
If GitHub CLI is not installed:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
GitHub CLI Required
|
|
31
|
+
========================
|
|
32
|
+
1. Install: brew install gh
|
|
33
|
+
2. Authenticate: gh auth login
|
|
34
|
+
For more info: https://cli.github.com/
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Jira CLI Setup
|
|
38
|
+
|
|
39
|
+
If Jira CLI is not installed:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Jira CLI Required
|
|
43
|
+
========================
|
|
44
|
+
1. Install: brew install ankitpokhrel/jira-cli/jira-cli
|
|
45
|
+
2. Initialize: jira init
|
|
46
|
+
3. Server URL: https://instabug.atlassian.net
|
|
47
|
+
4. Auth type: API Token
|
|
48
|
+
5. Generate token: https://id.atlassian.com/manage-profile/security/api-tokens
|
|
49
|
+
For more info: https://github.com/ankitpokhrel/jira-cli
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Only proceed if both CLIs are installed and authenticated.**
|
|
53
|
+
|
|
54
|
+
## 1. Gather PR Information (if prUrls provided)
|
|
55
|
+
|
|
56
|
+
### Step 1.1: Parse PR URLs
|
|
57
|
+
|
|
58
|
+
Split `prUrls` by comma. For each PR URL, extract owner, repo, and PR number.
|
|
59
|
+
|
|
60
|
+
### Step 1.2: Fetch Details for Each PR
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
gh pr view <pr_number> --repo <owner>/<repo> --json number,title,body,author,createdAt,mergedAt,state,commits,changedFiles,additions,deletions
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Step 1.3: Analyze Changes for Each PR
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
gh pr diff <pr_number> --repo <owner>/<repo> --name-only
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Step 1.4: Document All PRs
|
|
73
|
+
|
|
74
|
+
For each PR, document:
|
|
75
|
+
|
|
76
|
+
- PR number and title
|
|
77
|
+
- Files changed
|
|
78
|
+
- Nature of the fix/change
|
|
79
|
+
- Author and reviewers
|
|
80
|
+
- Merge date
|
|
81
|
+
|
|
82
|
+
Consolidate to identify common files, fix sequence, and overall scope.
|
|
83
|
+
|
|
84
|
+
## 2. Gather Jira Information
|
|
85
|
+
|
|
86
|
+
### Step 2.1: Extract Task ID
|
|
87
|
+
|
|
88
|
+
From `taskUrl`, extract the task ID (e.g., `MOB-21429` from the URL).
|
|
89
|
+
|
|
90
|
+
### Step 2.2: Fetch Jira Ticket Details
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
jira issue view <TASK_ID> --plain
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Extract: summary, description, status, priority, reporter, assignee, created date, labels, components, comments.
|
|
97
|
+
|
|
98
|
+
### Step 2.3: Fetch Related Issues
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
jira issue view <TASK_ID> --comments
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Document key events and timeline from comments.
|
|
105
|
+
|
|
106
|
+
## 3. Generate RCA Document
|
|
107
|
+
|
|
108
|
+
### Step 3.1: Ask Clarifying Questions
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
To complete the RCA, please provide the following details:
|
|
112
|
+
|
|
113
|
+
1. **Root Cause**: What was the actual technical root cause?
|
|
114
|
+
2. **Data Loss**: Was there any data loss? If yes, what data?
|
|
115
|
+
3. **Security Impact**: Was there any security breach or exposure?
|
|
116
|
+
4. **Affected Products**: Which SDK products were affected? (APM, Crash Reporting, Bug Reporting, Session Replay, Surveys, Replies, Feature Requests, Network Logger)
|
|
117
|
+
5. **Customer Impact**: How many customers were affected? What was the user experience impact?
|
|
118
|
+
6. **Actions Taken**: What immediate actions were taken to resolve the issue?
|
|
119
|
+
7. **Engaged People**: Who was involved in investigating and fixing the issue?
|
|
120
|
+
8. **Future Improvements**: What preventive measures will be implemented?
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Step 3.2: Generate RCA from Template
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
# Root Cause Analysis (RCA)
|
|
127
|
+
|
|
128
|
+
**RCA Link**: [JIRA_TASK_ID](JIRA_TASK_URL)
|
|
129
|
+
**Date**: [Current Date]
|
|
130
|
+
**Author**: [User Name or Team]
|
|
131
|
+
**Related PRs**:
|
|
132
|
+
|
|
133
|
+
- [PR_TITLE_1](PR_URL_1)
|
|
134
|
+
- [PR_TITLE_2](PR_URL_2)
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## What Happened
|
|
139
|
+
|
|
140
|
+
[Clear description of the incident: what, when, how discovered, initial symptoms]
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Why This Happened
|
|
145
|
+
|
|
146
|
+
[Root cause in technical terms: what failed, why safeguards missed it, contributing factors, specific code/commits]
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Features Affected
|
|
151
|
+
|
|
152
|
+
[List SDK features/modules impacted with brief description of impact]
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Was There Any Data Loss
|
|
157
|
+
|
|
158
|
+
- [ ] Yes
|
|
159
|
+
- [ ] No
|
|
160
|
+
|
|
161
|
+
[If yes: what data, volume/timeframe, recoverability, recovery steps]
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Impact on Customers
|
|
166
|
+
|
|
167
|
+
[Number affected, severity, UX degradation, escalations, duration]
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Security Breach
|
|
172
|
+
|
|
173
|
+
- [ ] Yes
|
|
174
|
+
- [ ] No
|
|
175
|
+
|
|
176
|
+
[If yes: nature, data exposed, securing steps, disclosure requirements]
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Affected Products
|
|
181
|
+
|
|
182
|
+
- [ ] APM (App Performance Monitoring)
|
|
183
|
+
- [ ] Bug Reporting
|
|
184
|
+
- [ ] Crash Reporting
|
|
185
|
+
- [ ] Session Replay
|
|
186
|
+
- [ ] Surveys
|
|
187
|
+
- [ ] Replies
|
|
188
|
+
- [ ] Feature Requests
|
|
189
|
+
- [ ] Core SDK
|
|
190
|
+
- [ ] Network Logger
|
|
191
|
+
- [ ] Navigation/Screen Tracking
|
|
192
|
+
- [ ] CLI (Source Map Upload)
|
|
193
|
+
- [ ] Expo Plugin
|
|
194
|
+
- [ ] Other: [Specify]
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Actions Taken
|
|
199
|
+
|
|
200
|
+
| Timestamp | Action | Owner |
|
|
201
|
+
| --------- | -------------- | -------- |
|
|
202
|
+
| [Time 1] | [Action taken] | [Person] |
|
|
203
|
+
| [Time 2] | [Action taken] | [Person] |
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Engaged People
|
|
208
|
+
|
|
209
|
+
| Name | Role | Contribution |
|
|
210
|
+
| -------- | ------ | --------------- |
|
|
211
|
+
| [Name 1] | [Role] | [What they did] |
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Future Improvements
|
|
216
|
+
|
|
217
|
+
| Improvement | Priority | Owner | Target Date | JIRA Ticket |
|
|
218
|
+
| --------------- | ----------------- | ------- | ----------- | ----------- |
|
|
219
|
+
| [Improvement 1] | [High/Medium/Low] | [Owner] | [Date] | [MOB-XXXXX] |
|
|
220
|
+
|
|
221
|
+
### Preventive Categories:
|
|
222
|
+
|
|
223
|
+
- [ ] Code Review Process Enhancement
|
|
224
|
+
- [ ] Testing Coverage Improvement
|
|
225
|
+
- [ ] Monitoring/Alerting Enhancement
|
|
226
|
+
- [ ] Documentation Update
|
|
227
|
+
- [ ] Process Change
|
|
228
|
+
- [ ] Tooling Improvement
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Lessons Learned
|
|
233
|
+
|
|
234
|
+
1. [Lesson 1]
|
|
235
|
+
2. [Lesson 2]
|
|
236
|
+
3. [Lesson 3]
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Appendix
|
|
241
|
+
|
|
242
|
+
### Timeline
|
|
243
|
+
|
|
244
|
+
[Detailed timeline]
|
|
245
|
+
|
|
246
|
+
### Technical Details
|
|
247
|
+
|
|
248
|
+
[Stack traces, logs, etc.]
|
|
249
|
+
|
|
250
|
+
### References
|
|
251
|
+
|
|
252
|
+
- JIRA: [JIRA_URL]
|
|
253
|
+
- PRs: [PR links with descriptions]
|
|
254
|
+
- Related Documentation: [Links]
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Step 3.3: Present RCA to User
|
|
258
|
+
|
|
259
|
+
Present the generated RCA and ask for corrections, additions, or updates.
|
|
260
|
+
|
|
261
|
+
## 4. Output Options
|
|
262
|
+
|
|
263
|
+
Ask the user:
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
How would you like to save this RCA?
|
|
267
|
+
1. Display in terminal (copy manually)
|
|
268
|
+
2. Save to a file (specify path)
|
|
269
|
+
3. Both
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Default save location:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
cat > ./RCA-<TASK_ID>-$(date +%Y%m%d).md << 'EOF'
|
|
276
|
+
<RCA_CONTENT>
|
|
277
|
+
EOF
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Examples
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
/create-rca taskUrl=https://instabug.atlassian.net/browse/MOB-21429
|
|
284
|
+
/create-rca taskUrl=https://instabug.atlassian.net/browse/MOB-21429 prUrls=https://github.com/luciqai/luciq-reactnative-sdk/pull/45
|
|
285
|
+
/create-rca taskUrl=https://instabug.atlassian.net/browse/MOB-21429 prUrls=https://github.com/luciqai/luciq-reactnative-sdk/pull/45,https://github.com/Instabug/ios/pull/6534
|
|
286
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Troubleshoot common Luciq React Native SDK issues
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Debug SDK
|
|
6
|
+
|
|
7
|
+
Troubleshoot common issues with the Luciq React Native SDK.
|
|
8
|
+
|
|
9
|
+
## Common Issues
|
|
10
|
+
|
|
11
|
+
### SDK Not Initializing
|
|
12
|
+
|
|
13
|
+
1. Verify `Luciq.init()` is called before any other SDK method
|
|
14
|
+
2. Check the app token is correct
|
|
15
|
+
3. Check platform-specific setup (iOS Info.plist, Android manifest)
|
|
16
|
+
4. Enable verbose logging to see initialization output
|
|
17
|
+
|
|
18
|
+
### Crashes Not Captured
|
|
19
|
+
|
|
20
|
+
1. Verify `CrashReporting` is enabled
|
|
21
|
+
2. Check that the global error handler is properly set up
|
|
22
|
+
3. Ensure both JS and native crash handlers are registered
|
|
23
|
+
4. Check if the crash is on the native side vs JS side
|
|
24
|
+
|
|
25
|
+
### Network Requests Not Logged
|
|
26
|
+
|
|
27
|
+
1. Check network interception mode (JavaScript vs Native)
|
|
28
|
+
2. For JS mode: verify XhrNetworkInterceptor is wrapping fetch/XMLHttpRequest
|
|
29
|
+
3. Check that network logging is enabled in SDK settings
|
|
30
|
+
4. Verify request filtering regex isn't excluding the requests
|
|
31
|
+
|
|
32
|
+
### Screen Tracking Not Working
|
|
33
|
+
|
|
34
|
+
1. Verify navigation integration is set up correctly
|
|
35
|
+
2. Check which navigation library is being used (React Navigation v4/v6, react-native-navigation v7)
|
|
36
|
+
3. Verify `reportScreenChange` is being called
|
|
37
|
+
4. Check route names match expected patterns
|
|
38
|
+
|
|
39
|
+
### Build Failures After SDK Update
|
|
40
|
+
|
|
41
|
+
1. For iOS: `cd ios && pod install`
|
|
42
|
+
2. For Android: Clean build `cd android && ./gradlew clean`
|
|
43
|
+
3. Clear Metro cache: `npx react-native start --reset-cache`
|
|
44
|
+
4. Clear node_modules: `rm -rf node_modules && yarn install`
|
|
45
|
+
|
|
46
|
+
### Source Map Upload Issues
|
|
47
|
+
|
|
48
|
+
1. Check `ios/sourcemaps.sh` has execute permissions
|
|
49
|
+
2. Verify `android/sourcemaps.gradle` is properly included
|
|
50
|
+
3. Run CLI manually: `npx luciq upload-sourcemaps`
|
|
51
|
+
|
|
52
|
+
## Diagnostic Commands
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Check TypeScript compilation
|
|
56
|
+
yarn build:lib
|
|
57
|
+
|
|
58
|
+
# Run tests to verify SDK integrity
|
|
59
|
+
yarn test
|
|
60
|
+
|
|
61
|
+
# Check for lint issues
|
|
62
|
+
yarn lint
|
|
63
|
+
|
|
64
|
+
# Check formatting
|
|
65
|
+
yarn format
|
|
66
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate comprehensive PR descriptions following the repository template
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Generate PR Description
|
|
6
|
+
|
|
7
|
+
Generate a PR description using the repository's `.github/pull_request_template.md`.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. **Read the PR template:**
|
|
12
|
+
- Read `.github/pull_request_template.md`
|
|
13
|
+
- If not found, inform the user and wait for instructions
|
|
14
|
+
|
|
15
|
+
2. **Identify the PR:**
|
|
16
|
+
- Check if the current branch has an associated PR: `gh pr view --json url,number,title,state 2>/dev/null`
|
|
17
|
+
- If no PR exists, create one with `gh pr create --fill`
|
|
18
|
+
|
|
19
|
+
3. **Gather PR information:**
|
|
20
|
+
- Get the full diff: `gh pr diff {number}`
|
|
21
|
+
- Get commit history: `gh pr view {number} --json commits`
|
|
22
|
+
- Get base branch: `gh pr view {number} --json baseRefName`
|
|
23
|
+
- Get metadata: `gh pr view {number} --json url,title,number,state`
|
|
24
|
+
|
|
25
|
+
4. **Analyze changes thoroughly:**
|
|
26
|
+
- Read the entire diff
|
|
27
|
+
- Read referenced files not shown in the diff for context
|
|
28
|
+
- Identify user-facing vs internal changes
|
|
29
|
+
- Look for breaking changes
|
|
30
|
+
|
|
31
|
+
5. **Generate the description:**
|
|
32
|
+
- Fill each template section based on analysis
|
|
33
|
+
- Be specific about problems solved and changes made
|
|
34
|
+
- Check appropriate type-of-change boxes
|
|
35
|
+
- Address all checklist items
|
|
36
|
+
|
|
37
|
+
6. **Update the PR:**
|
|
38
|
+
- Show the user the generated description
|
|
39
|
+
- Update the PR: `gh pr edit {number} --body "<description>"`
|
|
40
|
+
- Confirm the update was successful
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Add a new public API method to an existing SDK feature
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# New API Method
|
|
6
|
+
|
|
7
|
+
Add a new public API method to an existing feature module.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
- `module` (required): Target module (e.g., `BugReporting`, `APM`, `CrashReporting`, `Luciq`)
|
|
12
|
+
- `method` (required): Method name and signature description
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
### 1. Define Native Interface
|
|
17
|
+
|
|
18
|
+
Add the method to the native interface in `src/native/Native<Module>.ts`:
|
|
19
|
+
|
|
20
|
+
- Define parameter types and return type
|
|
21
|
+
- Follow existing method patterns in the same file
|
|
22
|
+
|
|
23
|
+
### 2. Add Module Method
|
|
24
|
+
|
|
25
|
+
Add the method to the module in `src/modules/<Module>.ts`:
|
|
26
|
+
|
|
27
|
+
- Export function calling through to the native module
|
|
28
|
+
- Match the style of existing methods in the same module
|
|
29
|
+
|
|
30
|
+
### 3. Create Models (if needed)
|
|
31
|
+
|
|
32
|
+
Add any new models to `src/models/` or enums to `src/utils/Enums.ts`
|
|
33
|
+
|
|
34
|
+
### 4. Update Exports (if needed)
|
|
35
|
+
|
|
36
|
+
If new models were added, export them in `src/index.ts`
|
|
37
|
+
|
|
38
|
+
### 5. Write Tests
|
|
39
|
+
|
|
40
|
+
Add tests to `test/modules/<Module>.spec.ts`:
|
|
41
|
+
|
|
42
|
+
- Test the method calls through to the native module correctly
|
|
43
|
+
- Test parameter passing
|
|
44
|
+
- Test error handling
|
|
45
|
+
- Update mock in `test/mocks/` if new native methods were added
|
|
46
|
+
|
|
47
|
+
### 6. Verify
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
yarn build:lib
|
|
51
|
+
yarn test
|
|
52
|
+
yarn lint
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Best Practices
|
|
56
|
+
|
|
57
|
+
- Parameter naming should be consistent with existing SDK conventions
|
|
58
|
+
- Include `@deprecated` JSDoc tag if replacing an existing method
|
|
59
|
+
- Null/undefined parameters should have sensible defaults on the native side
|
|
60
|
+
- Callbacks should follow existing callback patterns (NativeEventEmitter)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Scaffold a new SDK feature module following established patterns
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# New Feature Module
|
|
6
|
+
|
|
7
|
+
Scaffold a new feature module in the Luciq React Native SDK following established patterns.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
- `name` (required): Feature name (e.g., `Surveys`, `FeatureRequests`)
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
### 1. Plan the Module
|
|
16
|
+
|
|
17
|
+
- Determine the public API surface
|
|
18
|
+
- Identify required native module methods
|
|
19
|
+
- List models needed
|
|
20
|
+
|
|
21
|
+
### 2. Create Native Interface
|
|
22
|
+
|
|
23
|
+
Create `src/native/Native<FeatureName>.ts`:
|
|
24
|
+
|
|
25
|
+
- Define the typed interface for the native module
|
|
26
|
+
- Follow existing patterns from other native interface files (e.g., `NativeAPM.ts`, `NativeBugReporting.ts`)
|
|
27
|
+
|
|
28
|
+
### 3. Create Module
|
|
29
|
+
|
|
30
|
+
Create `src/modules/<FeatureName>.ts`:
|
|
31
|
+
|
|
32
|
+
- Export functions that call through to the native module
|
|
33
|
+
- Follow the pattern of existing modules (e.g., `BugReporting`, `APM`)
|
|
34
|
+
- Add proper error handling
|
|
35
|
+
- Use `NativeEventEmitter` for native-to-JS callbacks if needed
|
|
36
|
+
|
|
37
|
+
### 4. Create Models
|
|
38
|
+
|
|
39
|
+
Create any needed models in `src/models/`:
|
|
40
|
+
|
|
41
|
+
- Follow existing model patterns
|
|
42
|
+
- Include proper TypeScript types and enums in `src/utils/Enums.ts`
|
|
43
|
+
|
|
44
|
+
### 5. Export Public API
|
|
45
|
+
|
|
46
|
+
Update `src/index.ts`:
|
|
47
|
+
|
|
48
|
+
- Export the new module namespace
|
|
49
|
+
- Export any new models and types
|
|
50
|
+
|
|
51
|
+
### 6. Write Tests
|
|
52
|
+
|
|
53
|
+
Create `test/modules/<FeatureName>.spec.ts`:
|
|
54
|
+
|
|
55
|
+
- Add native module mock in `test/mocks/`
|
|
56
|
+
- Register mock in `test/setup.ts`
|
|
57
|
+
- Test each public method
|
|
58
|
+
- Test error handling paths
|
|
59
|
+
|
|
60
|
+
### 7. Build and Test
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
yarn build:lib
|
|
64
|
+
yarn test
|
|
65
|
+
yarn lint
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Checklist
|
|
69
|
+
|
|
70
|
+
- [ ] Native interface defined in `src/native/`
|
|
71
|
+
- [ ] Module created with exported functions
|
|
72
|
+
- [ ] Models and enums created if needed
|
|
73
|
+
- [ ] Public exports updated in `src/index.ts`
|
|
74
|
+
- [ ] Tests written and passing
|
|
75
|
+
- [ ] Lint passes
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Comprehensive PR code review with parallel analysis agents
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# PR Code Review
|
|
6
|
+
|
|
7
|
+
Perform a thorough code review of the current branch's changes.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
### 1. Gather Changes
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Get the base branch
|
|
15
|
+
git log --oneline -1 origin/master
|
|
16
|
+
|
|
17
|
+
# Get all changed files
|
|
18
|
+
git diff origin/master...HEAD --name-only
|
|
19
|
+
|
|
20
|
+
# Get the full diff
|
|
21
|
+
git diff origin/master...HEAD
|
|
22
|
+
|
|
23
|
+
# Get commit history
|
|
24
|
+
git log origin/master...HEAD --oneline
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. Context Gathering
|
|
28
|
+
|
|
29
|
+
For each changed file, read surrounding context:
|
|
30
|
+
|
|
31
|
+
- Other methods in the same module
|
|
32
|
+
- Related test files
|
|
33
|
+
- Native bridge interfaces if native module code changed
|
|
34
|
+
- Public exports if API surface changed
|
|
35
|
+
|
|
36
|
+
### 3. Review Categories
|
|
37
|
+
|
|
38
|
+
Analyze changes across these dimensions in parallel:
|
|
39
|
+
|
|
40
|
+
**a. Logical Errors**
|
|
41
|
+
|
|
42
|
+
- Off-by-one errors, null handling, missing edge cases
|
|
43
|
+
- Incorrect native module data mapping
|
|
44
|
+
- Missing await on Promises
|
|
45
|
+
|
|
46
|
+
**b. TypeScript/React Native Standards**
|
|
47
|
+
|
|
48
|
+
- TypeScript strict mode compliance
|
|
49
|
+
- Proper use of `import type` for type-only imports
|
|
50
|
+
- Correct use of NativeModules and NativeEventEmitter
|
|
51
|
+
- Proper async/await patterns
|
|
52
|
+
|
|
53
|
+
**c. Native Bridge Safety**
|
|
54
|
+
|
|
55
|
+
- NativeModule interfaces are consistent with native implementations
|
|
56
|
+
- Error handling around native calls
|
|
57
|
+
- Data serialization correctness between JS and native
|
|
58
|
+
|
|
59
|
+
**d. Test Coverage**
|
|
60
|
+
|
|
61
|
+
- New code has tests
|
|
62
|
+
- Tests cover error paths
|
|
63
|
+
- Mocks are properly set up in `test/mocks/`
|
|
64
|
+
|
|
65
|
+
**e. Performance**
|
|
66
|
+
|
|
67
|
+
- No blocking operations on JS thread
|
|
68
|
+
- No unnecessary event listener subscriptions
|
|
69
|
+
- Efficient data structures
|
|
70
|
+
|
|
71
|
+
**f. SDK Best Practices**
|
|
72
|
+
|
|
73
|
+
- No host app crashes
|
|
74
|
+
- Backward compatible
|
|
75
|
+
- Follows existing module patterns
|
|
76
|
+
|
|
77
|
+
### 4. Report
|
|
78
|
+
|
|
79
|
+
For each issue found:
|
|
80
|
+
|
|
81
|
+
- **File:line** - exact location
|
|
82
|
+
- **Severity** - critical / warning / suggestion
|
|
83
|
+
- **Issue** - what's wrong
|
|
84
|
+
- **Before/After** - code showing the fix
|
|
85
|
+
- **Explanation** - why it matters
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Research and document how specific parts of the codebase work
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Research Codebase
|
|
6
|
+
|
|
7
|
+
Research a specific topic in the Luciq React Native SDK codebase and document findings.
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
- `topic` (required): What to research (e.g., "how network interception works", "crash reporting flow")
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
1. **Decompose the question** into searchable sub-topics
|
|
16
|
+
|
|
17
|
+
2. **Search the codebase** using multiple strategies:
|
|
18
|
+
- Grep for relevant class names, method names, and keywords
|
|
19
|
+
- Glob for relevant file patterns
|
|
20
|
+
- Read key files to understand implementation
|
|
21
|
+
|
|
22
|
+
3. **Trace the flow** from public API to native bridge:
|
|
23
|
+
- Start from the public module in `src/modules/`
|
|
24
|
+
- Follow through to native interface in `src/native/`
|
|
25
|
+
- Check any utilities involved from `src/utils/`
|
|
26
|
+
- Note the iOS (`ios/`) and Android (`android/`) native implementations
|
|
27
|
+
|
|
28
|
+
4. **Document findings** with:
|
|
29
|
+
- Overview of the feature/system
|
|
30
|
+
- Entry points (file:line references)
|
|
31
|
+
- Core implementation details
|
|
32
|
+
- Data flow (JS -> NativeModules -> Native)
|
|
33
|
+
- Key patterns used
|
|
34
|
+
- Test coverage locations
|
|
35
|
+
|
|
36
|
+
## Rules
|
|
37
|
+
|
|
38
|
+
- Document and explain the codebase as it exists - no improvements or suggestions
|
|
39
|
+
- All file paths must be relative to the repo root
|
|
40
|
+
- Include file:line references for key code locations
|
|
41
|
+
- Focus on accuracy over completeness
|