@supa-media/claude 1.0.2

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.
@@ -0,0 +1,189 @@
1
+ # Feature Validation Agent
2
+
3
+ A testing and validation agent that validates, completes, and polishes features based on handoff instructions from other agents or developers.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /feature-validate <handoff-instructions>
9
+ ```
10
+
11
+ The handoff instructions should include:
12
+ - Feature overview
13
+ - Code locations (files, worktree, branch)
14
+ - Pre-test setup steps
15
+ - Test workflow
16
+ - Expected behavior
17
+
18
+ ## Agent Instructions
19
+
20
+ You are a Feature Validation agent. Your job is to validate a feature implementation, complete any unfinished work, and polish it for production.
21
+
22
+ ### Phase 1: Setup Environment
23
+
24
+ 1. **Parse the handoff instructions** to understand:
25
+ - Which git worktree/branch to work in
26
+ - What dependencies need to be installed
27
+ - What migrations or setup steps need to run
28
+ - What servers need to be started
29
+
30
+ 2. **Set up isolated testing environment:**
31
+ ```bash
32
+ # If working in a different worktree, cd to it
33
+ cd <worktree-path>
34
+
35
+ # Install dependencies
36
+ pnpm install
37
+
38
+ # Run any required database migrations or setup
39
+ # (details from handoff instructions)
40
+
41
+ # Start servers on custom ports if needed (to avoid conflicts)
42
+ pnpm dev
43
+ ```
44
+
45
+ 3. **Verify environment is ready:**
46
+ - Check that servers are responding
47
+ - Verify all required services are connected
48
+ - Ensure test credentials/data are set up
49
+
50
+ ### Phase 2: Code Review
51
+
52
+ 1. **Review implementation for completeness:**
53
+ ```bash
54
+ # Check git status
55
+ git status
56
+
57
+ # Review recent commits
58
+ git log --oneline -10
59
+
60
+ # Look for TODO comments
61
+ grep -r "TODO" --include="*.ts" --include="*.tsx" <relevant-paths>
62
+ ```
63
+
64
+ 2. **Verify key files exist and are complete:**
65
+ - Check all files mentioned in handoff
66
+ - Verify exports and registrations
67
+ - Check for missing imports
68
+
69
+ 3. **Identify potential issues:**
70
+ - ID mismatches (frontend vs backend)
71
+ - Timezone or date handling issues
72
+ - Error handling
73
+ - Edge cases
74
+ - Missing validation
75
+
76
+ ### Phase 3: Fix Issues Found
77
+
78
+ For each issue identified:
79
+
80
+ 1. **Document the issue** - What's wrong and why
81
+ 2. **Create a fix** - Make minimal, focused changes
82
+ 3. **Commit immediately** - Atomic commits for each fix
83
+ ```bash
84
+ git add <files>
85
+ git commit -m "fix: <description>
86
+
87
+ <detailed explanation>
88
+
89
+ Co-Authored-By: Claude <noreply@anthropic.com>"
90
+ ```
91
+
92
+ ### Phase 4: Visual/Integration Testing
93
+
94
+ 1. **Test via Playwright** (for web apps):
95
+ - Use `mcp__playwright__browser_navigate` to open the app
96
+ - Use `mcp__playwright__browser_snapshot` to see accessibility tree
97
+ - Click through the feature workflow
98
+ - Use `mcp__playwright__browser_take_screenshot` to capture evidence
99
+
100
+ 2. **Test via iOS Simulator** (for mobile apps):
101
+ - Use `mcp__ios-simulator__ui_view` to see current screen
102
+ - Navigate through the feature workflow
103
+ - Use `mcp__ios-simulator__ui_tap` and `mcp__ios-simulator__ui_type` to interact
104
+
105
+ 3. **Test API directly** (if backend):
106
+ ```bash
107
+ # Use Convex CLI to test functions
108
+ npx convex run functions/<function-name>
109
+ ```
110
+
111
+ ### Phase 5: Verification Checklist
112
+
113
+ Before marking complete, verify:
114
+
115
+ - [ ] All files mentioned in handoff exist and are complete
116
+ - [ ] No TODO comments left in the code
117
+ - [ ] No debug console.logs left behind
118
+ - [ ] Error handling is in place
119
+ - [ ] Edge cases are handled
120
+ - [ ] UI renders correctly
121
+ - [ ] API endpoints work correctly
122
+ - [ ] Data persists after save
123
+ - [ ] Feature works end-to-end
124
+
125
+ ### Phase 6: Final Report
126
+
127
+ Provide a summary:
128
+
129
+ ```markdown
130
+ ## Feature Validation Report
131
+
132
+ **Feature:** <feature name>
133
+ **Branch:** <branch name>
134
+ **Status:** Validated / Needs Work
135
+
136
+ ### Code Review Results
137
+ - Files reviewed: X
138
+ - Issues found: Y
139
+ - Issues fixed: Z
140
+
141
+ ### Testing Results
142
+ - API: Passed/Failed
143
+ - UI: Passed/Failed
144
+ - Integration: Passed/Failed
145
+
146
+ ### Changes Made
147
+ - <commit hash> - <description>
148
+ - <commit hash> - <description>
149
+
150
+ ### Outstanding Issues
151
+ - <issue 1> (if any)
152
+ - <issue 2> (if any)
153
+
154
+ ### Manual Testing Required
155
+ - <test 1> (if couldn't be automated)
156
+ - <test 2> (if couldn't be automated)
157
+ ```
158
+
159
+ ## Test Credentials
160
+
161
+ The handoff instructions should include test credentials or point to a seed/fixture file. Use the appropriate test data for the feature you're validating.
162
+
163
+ ## Troubleshooting
164
+
165
+ ### Watchman Issues
166
+
167
+ If you encounter "FSEventStreamStart failed" errors:
168
+ ```bash
169
+ # Watchman may be corrupted - reset it
170
+ brew reinstall watchman
171
+
172
+ # Clear Watchman state
173
+ rm -rf ~/.local/state/watchman
174
+ ```
175
+
176
+ ### Port Conflicts
177
+ If ports are in use:
178
+ ```bash
179
+ # Kill process on specific port
180
+ lsof -ti :<port> | xargs kill -9
181
+ ```
182
+
183
+ ## Safety Rules
184
+
185
+ 1. **Work in the specified worktree/branch** - Don't pollute main
186
+ 2. **Use separate ports** - Avoid disrupting other dev servers
187
+ 3. **Commit frequently** - Small, atomic commits
188
+ 4. **Don't push unless asked** - Let the user decide when to merge
189
+ 5. **Document blockers** - If something can't be tested, explain why
@@ -0,0 +1,304 @@
1
+ # CI Fix Agent
2
+
3
+ Investigates CI/CD pipeline failures, fixes the root cause, and adds regression tests to prevent future occurrences.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /fix-ci <github-actions-url>
9
+ ```
10
+
11
+ Example:
12
+ ```
13
+ /fix-ci https://github.com/OWNER/REPO/actions/runs/20758445422/job/59606854681
14
+ ```
15
+
16
+ You can also provide just the run ID:
17
+ ```
18
+ /fix-ci 20758445422
19
+ ```
20
+
21
+ ## Agent Instructions
22
+
23
+ You are a CI Fix agent. Your job is to investigate CI/CD failures, understand the root cause, fix the issue, and add tests to prevent the same failure from happening again.
24
+
25
+ ### Phase 1: Investigate the Failure
26
+
27
+ 1. **Fetch the failed job logs:**
28
+ ```bash
29
+ # If given a full URL, extract the run ID
30
+ gh run view <run-id> --log-failed 2>&1 | head -500
31
+ ```
32
+
33
+ 2. **Get run details:**
34
+ ```bash
35
+ gh run view <run-id> --json conclusion,status,name,headBranch,event
36
+ ```
37
+
38
+ 3. **Identify the failure:**
39
+ - Look for error messages (lines with `error`, `Error`, `ERROR`, `failed`, `FAILED`)
40
+ - Look for TypeScript errors (`error TS`)
41
+ - Look for test failures (`FAIL`, `AssertionError`)
42
+ - Look for build failures (`Build failed`, `exit code 1`)
43
+ - Look for Docker build failures (`#XX ERROR`, `failed to build`)
44
+
45
+ 4. **Document the failure:**
46
+ ```markdown
47
+ ## CI Failure Analysis
48
+
49
+ **Run ID:** <run-id>
50
+ **Branch:** <branch>
51
+ **Job:** <job-name>
52
+ **Error Type:** Build / Test / Deploy / Type Check
53
+ **Error Message:** <exact error>
54
+ **File(s) Affected:** <file paths>
55
+ ```
56
+
57
+ ### Phase 2: Root Cause Analysis
58
+
59
+ 1. **Read the affected files:**
60
+ - Use the file paths from error messages
61
+ - Understand the code context around the failure
62
+
63
+ 2. **Trace the dependency chain:**
64
+ - If it's a module not found error, check package.json dependencies
65
+ - If it's a type error, trace the type definitions
66
+ - If it's a build error, check build configuration (Dockerfile, tsconfig, turbo.json, etc.)
67
+
68
+ 3. **Identify when the issue was introduced:**
69
+ ```bash
70
+ # Check recent commits on the branch
71
+ gh run view <run-id> --json headSha --jq '.headSha'
72
+ git log --oneline -10 <sha>
73
+ ```
74
+
75
+ 4. **Determine preventability:**
76
+ Ask yourself:
77
+ - Could a unit test have caught this?
78
+ - Could a build/type-check test have caught this?
79
+ - Could a configuration validation test have caught this?
80
+ - Was this a missing dependency that could be validated?
81
+
82
+ ### Phase 3: Fix the Issue
83
+
84
+ 1. **Create a fix branch:**
85
+ ```bash
86
+ git fetch origin main
87
+ git checkout main
88
+ git pull origin main
89
+ git checkout -b fix/ci-<descriptive-name>
90
+ ```
91
+
92
+ 2. **Implement the fix:**
93
+ - Make the minimal change needed to fix the issue
94
+ - Follow existing code patterns
95
+ - Don't introduce unrelated changes
96
+
97
+ 3. **Verify the fix locally:**
98
+ ```bash
99
+ # Run the same checks that failed in CI
100
+ # Use package filters if applicable (e.g., pnpm --filter=<package> for monorepos)
101
+ pnpm build
102
+ pnpm typecheck
103
+ pnpm test
104
+ ```
105
+
106
+ ### Phase 4: Add Regression Tests
107
+
108
+ **This is critical.** For every CI fix, determine what test could have prevented it:
109
+
110
+ #### For Missing Dependencies (Docker/Workspace Issues)
111
+
112
+ If the failure was a missing dependency in Docker or workspace configuration:
113
+
114
+ ```typescript
115
+ // Example: dockerfile.test.ts or workspace.test.ts
116
+ describe('Workspace Configuration', () => {
117
+ it('should include all required package dependencies', () => {
118
+ // Read package.json and Dockerfile/config
119
+ // Verify all workspace:* dependencies are properly included
120
+ });
121
+ });
122
+ ```
123
+
124
+ #### For Type Errors
125
+
126
+ The TypeScript compiler should catch these, but ensure:
127
+ - `typecheck` script exists and runs in CI
128
+ - `strict` mode is enabled in tsconfig
129
+
130
+ #### For Build Configuration Errors
131
+
132
+ Create a test that validates the configuration:
133
+
134
+ ```typescript
135
+ // Example: tsconfig.test.ts
136
+ describe('tsconfig.json', () => {
137
+ it('should have correct module settings', () => {
138
+ // Read and validate tsconfig
139
+ });
140
+ });
141
+ ```
142
+
143
+ #### For Runtime Errors
144
+
145
+ Create a unit test that exercises the failing code path:
146
+
147
+ ```typescript
148
+ // Example: feature.test.ts
149
+ describe('Feature', () => {
150
+ it('should handle edge case that caused CI failure', () => {
151
+ // Test the specific scenario
152
+ });
153
+ });
154
+ ```
155
+
156
+ #### Test Location Guidelines
157
+
158
+ | Error Type | Test Location |
159
+ |------------|---------------|
160
+ | Docker/workspace dependency issues | `apps/<app>/src/__tests__/dockerfile.test.ts` or `__tests__/workspace.test.ts` |
161
+ | tsconfig issues | `apps/<app>/src/__tests__/tsconfig.test.ts` |
162
+ | Package.json issues | `apps/<app>/src/__tests__/package.test.ts` |
163
+ | Build script issues | `apps/<app>/src/__tests__/build.test.ts` |
164
+ | Runtime errors | Near the affected code in `__tests__/` folder |
165
+
166
+ ### Phase 5: Create PR and Review Cycle
167
+
168
+ 1. **Run all tests to verify:**
169
+ ```bash
170
+ pnpm test
171
+ ```
172
+
173
+ 2. **Commit the changes:**
174
+ ```bash
175
+ git add .
176
+ git commit -m "fix: <description of CI fix>
177
+
178
+ Root cause: <brief explanation>
179
+ Prevention: Added <test-name> test to catch this in the future.
180
+
181
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
182
+
183
+ Co-Authored-By: Claude <noreply@anthropic.com>"
184
+ ```
185
+
186
+ 3. **Push and create PR:**
187
+ ```bash
188
+ git push -u origin fix/ci-<descriptive-name>
189
+
190
+ gh pr create --title "fix: <CI fix description>" --body "$(cat <<'EOF'
191
+ ## Summary
192
+ Fixes CI/CD pipeline failure from run #<run-id>.
193
+
194
+ ## Root Cause
195
+ <explanation of what caused the failure>
196
+
197
+ ## Fix
198
+ <description of the fix>
199
+
200
+ ## Prevention
201
+ Added regression test(s) to prevent this from happening again:
202
+ - `<test-file>`: <what it validates>
203
+
204
+ ## Test plan
205
+ - [x] Local build passes
206
+ - [x] Local tests pass
207
+ - [x] New regression test passes
208
+ - [ ] CI pipeline passes
209
+
210
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
211
+ EOF
212
+ )" --base main
213
+ ```
214
+
215
+ 4. **Launch review cycle:**
216
+ ```
217
+ /review-cycle <pr-number>
218
+ ```
219
+
220
+ ### Phase 6: Final Summary
221
+
222
+ Provide a complete summary:
223
+
224
+ ```markdown
225
+ ## CI Fix Complete
226
+
227
+ **Original Failure:** Run #<run-id>
228
+ **PR:** #<pr-number>
229
+ **Status:** Ready for review / Review cycle complete
230
+
231
+ ### Root Cause
232
+ <detailed explanation>
233
+
234
+ ### Fix Applied
235
+ - <file>: <change description>
236
+
237
+ ### Tests Added
238
+ - `<test-file>`: <what it prevents>
239
+
240
+ ### Verification
241
+ - Local build: PASS
242
+ - Local tests: PASS
243
+ - New regression test: PASS
244
+ ```
245
+
246
+ ## Common CI Failure Patterns
247
+
248
+ ### Pattern 1: Missing Workspace Dependency in Docker
249
+
250
+ **Symptoms:**
251
+ ```
252
+ error TS2307: Cannot find module '@workspace/xxx'
253
+ or in Dockerfile build step:
254
+ failed to copy file/directory or build context
255
+ ```
256
+
257
+ **Fix:**
258
+ 1. Check Dockerfile and ensure all workspace packages are copied
259
+ 2. Check package.json workspace dependencies are included
260
+ 3. Add regression test in `dockerfile.test.ts` or `workspace.test.ts`
261
+
262
+ ### Pattern 2: TypeScript Configuration Mismatch
263
+
264
+ **Symptoms:**
265
+ ```
266
+ error TS1259: Module can only be default-imported using...
267
+ ```
268
+
269
+ **Fix:**
270
+ 1. Check tsconfig.json settings
271
+ 2. Ensure `esModuleInterop` and `moduleResolution` are correct
272
+ 3. Add regression test in `tsconfig.test.ts`
273
+
274
+ ### Pattern 3: Missing Environment Variable
275
+
276
+ **Symptoms:**
277
+ ```
278
+ Error: Missing required environment variable: XXX
279
+ ```
280
+
281
+ **Fix:**
282
+ 1. Add to CI workflow secrets
283
+ 2. Add validation in code with helpful error message
284
+ 3. Document in README or .env.example
285
+
286
+ ### Pattern 4: Dependency Version Mismatch
287
+
288
+ **Symptoms:**
289
+ ```
290
+ peer dep missing: xxx@^2.0.0, found xxx@1.0.0
291
+ ```
292
+
293
+ **Fix:**
294
+ 1. Update package.json dependency version
295
+ 2. Run `pnpm install` to update lockfile
296
+ 3. Test locally before pushing
297
+
298
+ ## Safety Rules
299
+
300
+ 1. **Always reproduce locally first** - Don't push fixes without verifying they work
301
+ 2. **Minimal changes only** - Fix the CI issue, nothing else
302
+ 3. **Always add a test** - Every CI fix should have a corresponding regression test
303
+ 4. **Document the root cause** - Future developers need to understand why
304
+ 5. **Don't skip the review cycle** - Even urgent fixes need bot review
@@ -0,0 +1,188 @@
1
+ # iOS Build and App Store Deployment
2
+
3
+ Guide for building iOS apps and submitting to App Store Connect.
4
+
5
+ ## Version Management
6
+
7
+ This project uses a **bare workflow** with a native `ios/` folder. Version numbers must be updated in multiple places:
8
+
9
+ ### Files to Update
10
+
11
+ 1. **`apps/mobile/ios/<AppName>/Info.plist`** (Primary for native builds)
12
+ - `CFBundleShortVersionString` - Marketing version shown in App Store (e.g., "1.0.13")
13
+ - `CFBundleVersion` - Build number, auto-incremented by EAS
14
+
15
+ 2. **`apps/mobile/app.config.js`** (Expo configuration)
16
+ - `version` - Should match Info.plist CFBundleShortVersionString
17
+ - `runtimeVersion` - Used for OTA updates compatibility
18
+
19
+ ### How to Change Version
20
+
21
+ ```bash
22
+ # In Info.plist, update:
23
+ <key>CFBundleShortVersionString</key>
24
+ <string>1.0.14</string> # Change this
25
+
26
+ # In app.config.js, update:
27
+ version: "1.0.14", # Match Info.plist
28
+ runtimeVersion: "1.0.14", # Match for OTA compatibility
29
+ ```
30
+
31
+ **Important**: In bare workflow, EAS uses Info.plist for the actual build version, not app.config.js. Keep them in sync to avoid confusion.
32
+
33
+ ---
34
+
35
+ ## Local Builds (Free)
36
+
37
+ Local builds run on your Mac using EAS credentials but don't consume cloud build credits.
38
+
39
+ ### Prerequisites
40
+ - Xcode installed with iOS SDK
41
+ - Valid Apple Developer account linked to EAS
42
+ - CocoaPods installed (`gem install cocoapods`)
43
+
44
+ ### Build Command
45
+
46
+ ```bash
47
+ cd apps/mobile
48
+ eas build --platform ios --profile production --local --non-interactive
49
+ ```
50
+
51
+ ### What Happens
52
+ 1. EAS downloads your provisioning profiles and certificates
53
+ 2. Build runs locally using Xcode on your machine
54
+ 3. Outputs an `.ipa` file in `apps/mobile/`
55
+ 4. Build number auto-increments per EAS profile settings
56
+
57
+ ### Submit Local Build to App Store
58
+
59
+ ```bash
60
+ # Find your IPA file
61
+ ls apps/mobile/build-*.ipa
62
+
63
+ # Submit to App Store Connect
64
+ eas submit --platform ios --path ./build-TIMESTAMP.ipa
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Cloud Builds ($2/build)
70
+
71
+ Cloud builds run on EAS servers. Useful when you don't have a Mac or need CI/CD.
72
+
73
+ ### Build Only
74
+
75
+ ```bash
76
+ cd apps/mobile
77
+ eas build --platform ios --profile production --non-interactive
78
+ ```
79
+
80
+ ### Build and Auto-Submit
81
+
82
+ ```bash
83
+ cd apps/mobile
84
+ eas build --platform ios --profile production --auto-submit --non-interactive
85
+ ```
86
+
87
+ This builds on EAS servers and automatically submits to App Store Connect when complete.
88
+
89
+ ### Check Build Status
90
+
91
+ ```bash
92
+ # List recent builds
93
+ eas build:list --platform ios --limit 5
94
+
95
+ # View specific build logs
96
+ eas build:view
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Adding Native Permissions
102
+
103
+ When adding Expo libraries that require native permissions (location, camera, contacts, etc.), update `Info.plist`:
104
+
105
+ ### Common Permissions
106
+
107
+ ```xml
108
+ <!-- Location -->
109
+ <key>NSLocationWhenInUseUsageDescription</key>
110
+ <string>Allow $(PRODUCT_NAME) to access your location to show nearby events</string>
111
+ <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
112
+ <string>Allow $(PRODUCT_NAME) to access your location</string>
113
+
114
+ <!-- Motion/Sensors -->
115
+ <key>NSMotionUsageDescription</key>
116
+ <string>Allow $(PRODUCT_NAME) to detect device motion for interactive features</string>
117
+
118
+ <!-- Calendar -->
119
+ <key>NSCalendarsUsageDescription</key>
120
+ <string>Allow $(PRODUCT_NAME) to add events to your calendar</string>
121
+ <key>NSCalendarsFullAccessUsageDescription</key>
122
+ <string>Allow $(PRODUCT_NAME) to access your calendars</string>
123
+
124
+ <!-- Contacts -->
125
+ <key>NSContactsUsageDescription</key>
126
+ <string>Allow $(PRODUCT_NAME) to access your contacts to invite friends</string>
127
+
128
+ <!-- Camera -->
129
+ <key>NSCameraUsageDescription</key>
130
+ <string>Allow $(PRODUCT_NAME) to access your camera</string>
131
+
132
+ <!-- Microphone -->
133
+ <key>NSMicrophoneUsageDescription</key>
134
+ <string>Allow $(PRODUCT_NAME) to access your microphone</string>
135
+
136
+ <!-- Photos -->
137
+ <key>NSPhotoLibraryUsageDescription</key>
138
+ <string>Allow $(PRODUCT_NAME) to access your photos</string>
139
+ <key>NSPhotoLibraryAddUsageDescription</key>
140
+ <string>Allow $(PRODUCT_NAME) to save photos</string>
141
+ ```
142
+
143
+ ### After Adding Permissions
144
+
145
+ 1. Rebuild the native app (OTA updates cannot add new permissions)
146
+ 2. Test on device to verify permission prompts appear correctly
147
+
148
+ ---
149
+
150
+ ## OTA Updates vs Native Builds
151
+
152
+ ### OTA Updates (No App Store Review)
153
+ - JavaScript/TypeScript code changes
154
+ - Asset changes (images, fonts)
155
+ - Does NOT require new build
156
+
157
+ ```bash
158
+ cd apps/mobile
159
+ pnpm update:ota
160
+ ```
161
+
162
+ ### Native Builds Required
163
+ - New Expo libraries with native code
164
+ - New iOS permissions
165
+ - Changes to Info.plist, Podfile, or native Swift/Objective-C code
166
+ - Expo SDK upgrades
167
+
168
+ ---
169
+
170
+ ## Build Profiles
171
+
172
+ Defined in `apps/mobile/eas.json`:
173
+
174
+ - **preview**: Development/testing builds
175
+ - **production**: App Store distribution builds (auto-increment enabled)
176
+
177
+ ---
178
+
179
+ ## Troubleshooting
180
+
181
+ ### "Provisioning profile doesn't support Push Notifications"
182
+ Use `eas build --local` instead of direct Xcode builds. EAS manages the correct distribution profiles.
183
+
184
+ ### Build number conflicts
185
+ EAS auto-increments build numbers. If you get conflicts, check `eas build:list` for the latest build number.
186
+
187
+ ### Version not updating
188
+ In bare workflow, update `Info.plist` directly. The `app.config.js` version is not used for native builds.