@event4u/agent-config 1.25.0 → 1.27.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.
@@ -11,6 +11,8 @@ suggestion:
11
11
 
12
12
  # e2e-heal
13
13
 
14
+ > **Mobile scope:** this command targets Playwright (browser/web) tests only. For Detox / Maestro / Appium / XCUITest / Espresso failures, use the `mobile-e2e-strategy` skill plus the framework's own diagnostic tooling — the Playwright-specific steps below do not apply to native mobile.
15
+
14
16
  ## Instructions
15
17
 
16
18
  ### 1. Identify failing tests
@@ -11,6 +11,8 @@ suggestion:
11
11
 
12
12
  # e2e-plan
13
13
 
14
+ > **Mobile scope:** this command targets browser/web E2E only. For native iOS, native Android, or React Native E2E planning, switch to the `mobile-e2e-strategy` skill — Playwright is not the right tool for native UI flows.
15
+
14
16
  ## Instructions
15
17
 
16
18
  ### 1. Gather context
@@ -0,0 +1,158 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2b"
4
+ alwaysApply: false
5
+ description: "Adopting a new domain track (mobile, ML, blockchain, scientific computing, IoT, gaming) into the suite — gates the import on demand, ownership, CI fit, and Sunset compatibility BEFORE any harvest"
6
+ source: package
7
+ triggers:
8
+ - intent: "adopt new domain"
9
+ - intent: "harvest new domain track"
10
+ - intent: "open a domain plate"
11
+ - keyword: "mobile track"
12
+ - keyword: "ml track"
13
+ - keyword: "blockchain track"
14
+ - path_prefix: ".agent-src.uncompressed/skills/"
15
+ validator_ignore:
16
+ - type: "substring"
17
+ pattern: ".agent-src.uncompressed/"
18
+ reason: "Rule names the authoring tree as the gated-entry location for new domain plates."
19
+ ---
20
+
21
+ # Domain Adoption Policy
22
+
23
+ A "domain" is a coherent vertical the suite has not yet entered — mobile, ML,
24
+ blockchain, scientific computing, IoT, gaming, embedded, robotics. Adopting
25
+ one is a structural decision: every new domain plate doubles the surface a
26
+ single maintainer keeps current, and most upstream skill-suites in adjacent
27
+ domains rot within 6-12 months as their underlying SDK churns.
28
+
29
+ This rule gates that decision. It does **not** gate per-skill adoptions inside
30
+ a domain that is already opened — those run under the regular harvest plate
31
+ process. It gates **opening** the domain in the first place.
32
+
33
+ ## The Iron Law
34
+
35
+ ```
36
+ NEVER OPEN A NEW DOMAIN TRACK WITHOUT THE THREE GATES.
37
+ DEMAND-SIGNAL · NAMED MAINTENANCE OWNER · CI-TOOLING DECISION.
38
+ ALL THREE PASS, OR THE ROADMAP MARKS THE DOMAIN GATED.
39
+ ```
40
+
41
+ The three gates fire before any skill, guideline, command, or rule from the
42
+ domain enters `.agent-src.uncompressed/`. A council session may inform the
43
+ decision but cannot replace the gate evidence.
44
+
45
+ ## Gate 1 — Demand signal
46
+
47
+ At least one of the following must be **true and citeable** in the roadmap:
48
+
49
+ - **≥ 2 consumer projects** in the domain. Cite repository names or
50
+ `agents/contexts/` notes — not "I think there might be".
51
+ - **Named user direction with target.** A specific user ask plus a target
52
+ project / use case — e.g. "harvest the mobile skills for project X, due
53
+ next quarter". Vague *"this might be useful"* does not count.
54
+ - **Public-incident pull.** A reproducible incident on a consumer project
55
+ the domain would have prevented, captured in `agents/contexts/` with
56
+ the missing surface area named.
57
+
58
+ If none of the three is citeable, **defer**. Open a watch-only context note
59
+ under `agents/contexts/domain-watch/<domain>.md` listing the missing signal
60
+ so the next harvest can re-evaluate without re-relitigating the case.
61
+
62
+ ## Gate 2 — Named maintenance owner
63
+
64
+ Domain plates rot. Pick the owner before the import, not after.
65
+
66
+ - The roadmap names a **single maintainer** (not "the team", not "TBD")
67
+ responsible for the domain quarterly review.
68
+ - The owner commits to the **refresh cadence** — quarterly review at
69
+ minimum, faster if the domain is volatile (mobile RN/Expo SDK,
70
+ ML model APIs).
71
+ - Each adopted artefact carries an **inline upstream-source line** with
72
+ SHA + last-checked timestamp so refresh is mechanical, not archaeological.
73
+
74
+ If no owner is named or no cadence is set, **defer**. An unowned domain
75
+ plate becomes broken authoritative-links and stale skills inside two cycles.
76
+
77
+ ## Gate 3 — CI-tooling decision
78
+
79
+ Either the domain's verification tooling is validated in CI, or the suite
80
+ explicitly accepts platform-bound reference-only status.
81
+
82
+ - **Validated.** The CI pipeline runs the relevant linters/tests/integration
83
+ checks for the domain (e.g. `mobile-e2e` runners, ML model validation,
84
+ contract conformance) on every PR. Cost noted in the roadmap risk
85
+ register.
86
+ - **Out-of-scope (reference-only).** The domain is a platform fact the
87
+ suite cannot validate (iOS Simulator on non-macOS runners, GPU-bound
88
+ ML, hardware-bound IoT). The roadmap states this explicitly; affected
89
+ artefacts carry a "reference-only on \<unsupported platforms\>" header
90
+ so consumers do not file false-positive bugs.
91
+
92
+ If neither line is drawn, **defer**. Half-validated CI silently rots the
93
+ domain — green builds while the underlying tooling drifts.
94
+
95
+ ## Sunset Policy stacks on top
96
+
97
+ Every domain track inherits the authoritative-link Sunset path documented
98
+ in any plate that imports volatile upstream content:
99
+
100
+ - Volatile content (SDK-pinned, API-pinned, tool-version-pinned) lives as
101
+ guideline body + SHA-pinned upstream link, not as forked scripts.
102
+ - Refresh trigger: quarterly cadence or earlier if a SHA-pinned link
103
+ 404s in CI.
104
+ - The `check-refs` and `check-portability` linters apply unchanged.
105
+
106
+ Adopting a domain does not exempt it from any other suite-wide rule —
107
+ `augment-portability`, `skill-quality`, `size-enforcement`, `docs-sync`,
108
+ `rule-type-governance`. Every domain artefact passes the same gates as a
109
+ core artefact.
110
+
111
+ ## Failure modes
112
+
113
+ - *"It's just one skill, not a domain."* — Audit the skill's prerequisites.
114
+ If it pulls in a new toolchain, simulator, language runtime, or
115
+ platform-specific build system, it **is** a domain entry. Run the gates.
116
+ - *"The upstream is well-maintained, we can just track it."* — Tracking
117
+ upstream means owning the diff, the breaking changes, and the migrations.
118
+ Tracking is maintenance work; budget for it under Gate 2 or skip the
119
+ adoption.
120
+ - *"We'll add CI later."* — Later does not arrive. Either CI is wired in
121
+ the same plate, or the artefacts ship with explicit reference-only
122
+ headers so users do not assume validated coverage.
123
+ - *"Council convergence is enough."* — Council informs the gates; it does
124
+ not replace them. A council session may surface that all three gates
125
+ pass; the roadmap still cites the evidence.
126
+ - *"Demand-signal is the user asking once."* — Single-shot interest is a
127
+ watch trigger, not an open trigger. Either name the target use case
128
+ with project + timeline, or open a watch note and wait.
129
+
130
+ ## What to do when the gates fail
131
+
132
+ 1. Mark the domain plate `[-] gated — <gate name> not met` in the relevant
133
+ roadmap. Do **not** silently shrink scope to dodge the gate.
134
+ 2. Open a watch-only context note under `agents/contexts/domain-watch/`
135
+ capturing what's missing — citations, owner candidates, CI feasibility.
136
+ 3. Re-evaluate at the next harvest cycle. The note is the evidence trail
137
+ so the same questions are not relitigated.
138
+
139
+ ## Allowed without gates
140
+
141
+ - Adding **a single skill** to an **already-opened** domain follows the
142
+ regular harvest plate; the gates do not re-fire per skill.
143
+ - Authoring a **guideline** that documents a domain the suite already
144
+ ships in — the domain is open, the guideline is a within-domain artefact.
145
+ - A **rule** that constrains an already-opened domain — within-domain.
146
+
147
+ ## See also
148
+
149
+ - [`augment-portability`](augment-portability.md) — `.agent-src/`
150
+ must stay project-agnostic; domain plates inherit the floor
151
+ - [`size-enforcement`](size-enforcement.md) — size budgets apply per
152
+ artefact regardless of domain
153
+ - [`docs-sync`](docs-sync.md) — keep cross-references in sync when
154
+ opening a domain plate
155
+ - [`rule-type-governance`](rule-type-governance.md) — within-domain rules
156
+ still pick `always` vs `auto` per the governance table
157
+ - [`skill-quality`](skill-quality.md) — every domain skill passes the
158
+ same linter floor as a core skill
@@ -0,0 +1,107 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ alwaysApply: false
5
+ description: "Working with git history — never rewrite, rebase, squash, fixup, or amend without explicit user request; the linear/squashed shape is the user's call, not a tidiness reflex"
6
+ source: package
7
+ triggers:
8
+ - intent: "rebase the branch"
9
+ - intent: "squash commits"
10
+ - intent: "clean up commit history"
11
+ - intent: "fold this into the previous commit"
12
+ - keyword: "git rebase"
13
+ - keyword: "fixup"
14
+ - keyword: "--amend"
15
+ - keyword: "force-push"
16
+ - keyword: "squash-merge"
17
+ ---
18
+
19
+ # No Unsolicited Rebase
20
+
21
+ ## Iron Law
22
+
23
+ ```
24
+ NEVER REBASE, SQUASH, FIXUP, OR AMEND PUBLISHED OR LOCAL HISTORY
25
+ WITHOUT THE USER ASKING FOR IT THIS TURN.
26
+ LINEAR HISTORY IS A PREFERENCE, NOT A DEFAULT.
27
+ COMMIT-CHUNK ORDER IS NOT A CORRECTNESS GOAL.
28
+ ```
29
+
30
+ Add the next commit on top. Never reorder, fold, drop, or rewrite earlier
31
+ commits to make the log "look right".
32
+
33
+ ## Why this rule exists
34
+
35
+ Interactive rebase + fixup loops generate disproportionate token cost on
36
+ every iteration: re-running CI per replayed commit, resolving the same
37
+ content conflict in three derived files (`.compression-hashes.json`,
38
+ `router.json`, `.windsurfrules`), losing the working tree to a stash that
39
+ silently re-introduces older state. A single conflict can burn the budget
40
+ of an entire feature. The user pays for it. The "clean history" payoff is
41
+ cosmetic; reviewers read the diff, not the log.
42
+
43
+ ## When rebase / amend / fixup IS allowed
44
+
45
+ Exactly three:
46
+
47
+ 1. **User says so this turn** — "rebase onto main", "squash these two",
48
+ "amend that". This operation only, not a standing rule.
49
+ 2. **Standing instruction not yet revoked** — the user said earlier in
50
+ the conversation "always squash before pushing"; honor it.
51
+ 3. **Conflict resolution forced by `git pull --rebase`** — the user
52
+ already invoked the rebase via pull; finish it.
53
+
54
+ Anything else — chunk-tidiness, "logical order", folding a follow-up fix
55
+ into its parent — **forbidden**. The follow-up ships as its own commit
56
+ (`fix: …`, `chore: …`).
57
+
58
+ ## Equivalents that are also forbidden by default
59
+
60
+ - `git rebase -i` (interactive)
61
+ - `git rebase --autosquash`
62
+ - `git commit --fixup` / `--squash` (the helper that feeds the autosquash)
63
+ - `git commit --amend` on already-pushed commits
64
+ - `git push --force` / `--force-with-lease`
65
+ - `git reset --hard` past unpushed work the user might want
66
+ - Squash-merge of a PR via API or CLI when the user has not picked the
67
+ merge strategy
68
+ - Cherry-pick rewriting that drops or reorders commits
69
+
70
+ `--amend` on the *current local* commit before the first push is the
71
+ narrow exception (treated as continuing to compose the commit, not
72
+ rewriting history).
73
+
74
+ ## When you'd be tempted
75
+
76
+ - "I want commit 3 to come before commit 2 because the topic flows better."
77
+ → don't. Reviewers read the PR diff.
78
+ - "There are two `chore: regenerate` commits, ugly." → don't. They are
79
+ honest checkpoints.
80
+ - "A linter caught an issue in commit 2 — let me fold the fix in."
81
+ → don't. Add `fix(scope): …` on top.
82
+ - "I want to drop the WIP commit before pushing." → ask the user first.
83
+ - "Squash-merge when I open the PR will clean it anyway." → also true,
84
+ also irrelevant — let the merge strategy do that work, not you.
85
+
86
+ ## Failure mode catalog
87
+
88
+ - **Rebase-conflict cascade.** Interactive rebase replays N commits. Any
89
+ derived file (`.compression-hashes.json`, generated tool projections,
90
+ index/catalog) carries a hash per commit and conflicts on every replay.
91
+ Resolution time scales with N, not with the actual change.
92
+ - **Stash-pop reverts work.** A `git stash` issued during rebase recovery
93
+ can re-introduce older edits that overwrite committed work after the
94
+ rebase finishes. Hard to spot in `git status` because the file shapes
95
+ match.
96
+ - **Force-push during review.** Rewriting history on a branch with an
97
+ open PR invalidates review comments anchored to commits and forces a
98
+ re-review.
99
+
100
+ ## See also
101
+
102
+ - [`scope-control`](scope-control.md) — git-ops permission gate ("rebase"
103
+ already named in the canonical list).
104
+ - [`commit-policy`](commit-policy.md) — commits are the user's call;
105
+ rewriting them is a stronger version of the same restriction.
106
+ - [`token-efficiency`](token-efficiency.md) — Iron Law on burning the
107
+ user's tokens for cosmetic gain.
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: mobile-e2e-strategy
3
+ description: "Use when picking a mobile E2E framework — Detox / Appium / Maestro / XCUITest / Espresso — or planning iOS Simulator / Android Emulator coverage in CI for RN, Expo, or native apps."
4
+ source: package
5
+ ---
6
+
7
+ # mobile-e2e-strategy
8
+
9
+ ## When to use
10
+
11
+ - Choosing an E2E framework for a mobile app (React Native, Expo, Flutter, native iOS, native Android).
12
+ - Deciding whether to extend existing Playwright/web E2E to mobile or stand up a separate mobile suite.
13
+ - Planning iOS Simulator / Android Emulator coverage in CI (cost, runner type, parallelism).
14
+ - Triaging flaky mobile tests that span the simulator/emulator boundary.
15
+ - Bridging mobile E2E results into the same review surface as web E2E
16
+ (`playwright-testing`, `e2e-plan`, `e2e-heal`).
17
+
18
+ **This skill selects and plans — it does not generate test code.** For the chosen framework, apply its own conventions; for the host environment, see the cross-links below.
19
+
20
+ ## Cross-links
21
+
22
+ - `react-native-setup` — RN/Expo environment, Xcode/Android Studio, EAS Build.
23
+ - `docs/guidelines/agent-infra/ios-simulator-guide.md` — `simctl` / `idb` / accessibility-driven testing on iOS.
24
+ - `playwright-testing` — web E2E baseline (do **not** reuse for native mobile).
25
+ - `e2e-plan` — explore an app and produce an E2E plan in Markdown.
26
+ - `e2e-heal` — debug and fix failing E2E tests.
27
+
28
+ ## Procedure
29
+
30
+ 1. **Classify the app.** Is it native iOS, native Android, React Native, Expo, Flutter, or a web view inside a shell?
31
+ 2. **Classify the goal.** Smoke (boots + login + key flow), regression (every release), visual diff, accessibility audit, or performance baseline.
32
+ 3. **Pick the framework** using the decision matrix below.
33
+ 4. **Confirm host availability.** macOS for iOS Simulator (mandatory); any OS for Android Emulator.
34
+ 5. **Plan CI coverage.** Decide runner type, parallelism, and whether iOS coverage runs every PR or nightly only.
35
+ 6. **Define the artefact contract.** Screenshots, accessibility trees, video, log archives — name the storage path and retention.
36
+ 7. **Validate.** Run a single smoke test locally before wiring CI; verify both iOS and Android paths if both are in scope.
37
+
38
+ ## Decision matrix — framework selection
39
+
40
+ | Framework | Best for | Avoid when |
41
+ |---|---|---|
42
+ | **Detox** | React Native apps, gray-box testing, deterministic sync with the JS bridge | Native iOS/Android-only; Expo managed without a dev client |
43
+ | **Maestro** | Cross-platform smoke + regression, declarative YAML flows, fast onboarding | Need full programmable assertions or deep native introspection |
44
+ | **Appium** | Truly cross-platform (RN + Flutter + native), one team owning many apps, WebDriver-compatible tooling | Solo project — setup overhead is high; flaky on JS-heavy RN unless tuned |
45
+ | **XCUITest** (iOS) | Native iOS apps, deepest Apple toolchain integration, Xcode Cloud | Cross-platform coverage in one suite |
46
+ | **Espresso** (Android) | Native Android apps, in-process execution, fast reliable runs | Cross-platform coverage in one suite |
47
+ | **Playwright + WebView** | Web app embedded in a thin native shell, purely web flows | Native UI flows of any depth (use a mobile framework instead) |
48
+
49
+ **Default starting point:**
50
+
51
+ - React Native / Expo → **Detox** (single-platform RN team) or **Maestro** (cross-platform smoke).
52
+ - Flutter → **Maestro** (smoke) + **Flutter integration_test** (deep) — Flutter-specific, out of scope here.
53
+ - Native iOS only → **XCUITest**.
54
+ - Native Android only → **Espresso**.
55
+ - Mixed native portfolio → **Appium**.
56
+
57
+ ## Host & environment prerequisites
58
+
59
+ **iOS (macOS-only)**
60
+ - Xcode 16.1+ and matching Command Line Tools — see `react-native-setup`.
61
+ - iOS Simulator boot/install/launch via `simctl` — see `ios-simulator-guide.md`.
62
+ - Optional: `idb` for accessibility-tree access and coordinate-level UI control.
63
+ - Apple developer account only required for physical-device or signed-build runs.
64
+
65
+ **Android (any host)**
66
+ - Android Studio Ladybug+ with SDK 35, Platform-Tools, Emulator.
67
+ - AVD with API 35 image; verify `emulator -list-avds` and `adb devices`.
68
+ - HAXM/Hypervisor (Intel) or hardware acceleration on Apple Silicon.
69
+
70
+ **Authoritative upstream docs**
71
+ - iOS Simulator: `https://developer.apple.com/documentation/xcode/running-your-app-in-simulator-or-on-a-device`
72
+ - Android Emulator: `https://developer.android.com/studio/run/emulator`
73
+ - Detox: `https://wix.github.io/Detox/`
74
+ - Maestro: `https://maestro.mobile.dev/`
75
+ - Appium: `https://appium.io/docs/en/latest/`
76
+ - XCUITest: `https://developer.apple.com/documentation/xctest/user_interface_tests`
77
+ - Espresso: `https://developer.android.com/training/testing/espresso`
78
+
79
+ ## CI floor — cost and capacity
80
+
81
+ | Concern | iOS | Android |
82
+ |---|---|---|
83
+ | Runner OS | macOS only (GitHub `macos-latest`, self-hosted Mac) | Any (Linux fastest) |
84
+ | Boot time | 30–90 s per simulator cold-boot | 60–180 s per emulator cold-boot |
85
+ | Parallelism | 1 simulator per macOS runner is the safe default | KVM-accelerated on Linux scales well |
86
+ | Cost (GitHub Actions) | macOS minutes are ~10× Linux minutes | Standard Linux pricing |
87
+ | Recommended cadence | Nightly + on-release for full suite; smoke on every PR | Every PR feasible |
88
+
89
+ **Pragmatic split:**
90
+
91
+ - Every PR: Android emulator full suite + iOS smoke only.
92
+ - Nightly / pre-release: iOS full suite + cross-device matrix.
93
+ - Adjust if the project pays for self-hosted Mac runners or the
94
+ release cadence demands per-PR iOS parity.
95
+
96
+ ## Artefact contract (recommended)
97
+
98
+ For every E2E run the suite SHOULD persist:
99
+
100
+ 1. **Screenshots** — per-step PNG, named `{suite}/{test}/{step}.png`.
101
+ 2. **Accessibility tree** — JSON dump per failure (iOS via `idb ui describe-all --json --nested`, Android via Espresso accessibility checks).
102
+ 3. **Video** — full run on failure; first-class for Detox and Maestro.
103
+ 4. **Logs** — structured logcat (Android) or `simctl spawn log` (iOS) filtered to the app under test.
104
+ 5. **Result XML / JUnit** — for CI dashboard ingestion.
105
+
106
+ Retain artefacts for at least one release cycle; promote screenshots
107
+ of failures to the PR comment surface so reviewers see the failure
108
+ without leaving the review.
109
+
110
+ ## Bridging to the existing E2E surface
111
+
112
+ - **Web + mobile in one repo:** keep Playwright for web, add a separate `mobile/` suite using Detox or Maestro. Do **not** force-fit Playwright onto native UI.
113
+ - **Plan reuse:** the planning patterns in `e2e-plan` (user journeys, test pyramid placement, stable selectors) apply unchanged. The implementation lives in the mobile framework.
114
+ - **Heal reuse:** the diagnostic loop in `e2e-heal` (reproduce → isolate → minimal fix → verify) applies. Replace browser-specific tooling with mobile-framework equivalents (Detox `--loglevel verbose`, Maestro Studio replays, Appium Inspector).
115
+ - **Selectors:** prefer accessibility identifiers (`accessibilityIdentifier` on iOS, `contentDescription` on Android) over coordinate taps — see `ios-simulator-guide.md` Module 1.
116
+
117
+ ## Output format
118
+
119
+ 1. A framework recommendation keyed off app type + team shape + cross-platform need.
120
+ 2. A host & runner plan naming the macOS/Linux split for CI.
121
+ 3. A cadence plan (per-PR vs nightly) with cost rationale.
122
+ 4. An artefact contract listing screenshot/log/video/accessibility-tree paths.
123
+
124
+ ## Auto-trigger keywords
125
+
126
+ - mobile E2E, React Native E2E, Expo E2E, Flutter E2E
127
+ - Detox, Appium, Maestro, XCUITest, Espresso
128
+ - iOS Simulator, Android Emulator, AVD, simctl, idb
129
+ - mobile CI, mobile test runner, macOS runner cost
130
+
131
+ ## Gotcha
132
+
133
+ - Mobile E2E is fundamentally slower than web E2E — the test pyramid still applies; do not reach for E2E when a unit or integration test would do.
134
+ - iOS coverage on every PR is expensive on hosted runners; default to smoke on PR + full suite nightly until the cost is measured.
135
+ - React Native + Appium + non-trivial JS bridge timing is the historical flake hotspot — Detox or Maestro avoids the WebDriver layer entirely.
136
+ - Do not chain emulator-only tests from a developer laptop and a CI runner; environment drift (locale, timezone, API level) corrupts deterministic comparisons.
137
+ - Visual regression baselines are tied to a specific simulator/emulator image — pin the image SHA / API level explicitly in CI config.
138
+ - Maestro YAML is concise but not a full language; complex assertions still need Detox / Appium / native frameworks.
139
+
140
+ ## Do NOT
141
+
142
+ - Do NOT reuse a Playwright suite for native UI flows — accessibility-tree access is wholly different.
143
+ - Do NOT mix two mobile E2E frameworks in one suite — pick one per platform pair, factor shared helpers behind a thin abstraction.
144
+ - Do NOT run iOS E2E on every PR until you measured the macOS-runner cost on the project's actual cadence.
145
+ - Do NOT rely on coordinate taps (`idb ui tap <x> <y>`) for stable tests — use accessibility identifiers instead. Coordinate taps are debug aids, not test selectors.
146
+ - Do NOT fork upstream simulator scripts (`accessibility_audit.py`, `visual_diff.py`, etc.) into the consumer project — link to the upstream SHA per `ios-simulator-guide.md`.
147
+ - Do NOT skip the artefact contract — without screenshots, logs, and accessibility trees, mobile E2E failures are nearly impossible to diagnose.
@@ -18,6 +18,7 @@ Use this skill when:
18
18
 
19
19
  **Guideline:** `../../../docs/guidelines/e2e/playwright.md` — full conventions, config templates, CI setup.
20
20
  **Rule:** `.augment/rules/e2e-testing.md` — constraints enforced during E2E test work.
21
+ **Mobile:** for native iOS/Android or React Native E2E, do NOT reuse Playwright — see the `mobile-e2e-strategy` skill for framework selection.
21
22
 
22
23
  ## Procedure: Write Playwright tests
23
24
 
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: react-native-setup
3
+ description: "Use when setting up React Native or Expo dev environments — Xcode, Android Studio, CocoaPods, EAS, Metro, New Architecture — even when the user just says 'my RN build won't start'."
4
+ source: package
5
+ ---
6
+
7
+ # react-native-setup
8
+
9
+ ## When to use
10
+
11
+ - Initial React Native 0.76+ / Expo SDK 52+ environment setup
12
+ - Installing or configuring Xcode, Android Studio, or their command-line tools
13
+ - Setting up iOS simulators or Android emulators for development
14
+ - Troubleshooting "Command not found", `ANDROID_HOME`, or SDK path errors
15
+ - Fixing CocoaPods install failures (Apple Silicon, FFI, Ruby mismatches)
16
+ - Clearing Metro / Watchman cache or diagnosing reload loops
17
+ - Configuring EAS Build, dev clients, or OTA updates
18
+ - Migrating to or troubleshooting the New Architecture (Fabric / Turbo Modules)
19
+
20
+ **Cross-links:** `mobile-e2e-strategy` (Detox / Appium / Maestro selection),
21
+ `docs/guidelines/agent-infra/ios-simulator-guide.md` (iOS simulator decision matrix).
22
+
23
+ ## Assess current setup before changing anything
24
+
25
+ Before installing or upgrading anything, inspect what's already there — modifying a working toolchain blindly is the most common source of wasted hours.
26
+
27
+ 1. **Read `package.json`** — RN version, Expo SDK, scripts, native dependencies.
28
+ 2. **Check `ios/Podfile` and `ios/Podfile.lock`** — CocoaPods version, deployment target, RCT_NEW_ARCH_ENABLED flag.
29
+ 3. **Check `android/build.gradle` and `android/gradle.properties`** — Gradle version, compile/target SDK, `newArchEnabled`, NDK version.
30
+ 4. **Verify host tools** — `node --version`, `xcodebuild -version`, `sdkmanager --list_installed`, `pod --version`, `watchman --version`.
31
+ 5. **Check for an existing `.nvmrc`, `.tool-versions`, or `Brewfile`** — honour the project's pinned versions over global ones.
32
+ 6. **Read project README and CONTRIBUTING** — many RN repos document one-time setup quirks (Apple Silicon Rosetta, Hermes flags, EAS profile names).
33
+
34
+ ## Procedure
35
+
36
+ 1. **Identify the target stack** — RN CLI vs Expo, target SDK, supported OS, monorepo or single-package.
37
+ 2. **Verify prerequisites** — Node, package manager, Watchman, platform SDKs (see matrix below).
38
+ 3. **Configure platform tooling** — Xcode + CocoaPods (iOS) or Android Studio + SDK 34/35 (Android).
39
+ 4. **Install project dependencies** — `npm`/`yarn`/`pnpm`/`bun install`, then `pod install` for iOS.
40
+ 5. **Run a smoke build** — `npm run ios` / `npm run android` / `npx expo start`.
41
+ 6. **Validate** — app launches, fast refresh works, Metro bundler runs without warnings.
42
+ 7. **On failure** — apply the matching pattern from "Common setup issues" below.
43
+
44
+ ## Prerequisites (2025 baseline)
45
+
46
+ **Node.js**
47
+ - Node 20.x minimum (Node 18 EOL April 2025); Node 22 LTS recommended.
48
+ - `node --version && npm --version`.
49
+ - npm, yarn, pnpm, bun all supported. Corepack for yarn:
50
+ `corepack enable && corepack prepare yarn@stable --activate`.
51
+
52
+ **Xcode (macOS, iOS)**
53
+ - Xcode 16.1+ minimum (RN 0.83), Xcode 26+ for Liquid Glass.
54
+ - `xcode-select --install` then `sudo xcodebuild -license accept`.
55
+ - iOS 15.1+ deployment target; iOS 18+/26 for latest features.
56
+
57
+ **Android Studio**
58
+ - Ladybug or later (2024.2.1+).
59
+ - SDK Platform 35 (API 35), Build-Tools 35.0.0, Platform-Tools, Emulator.
60
+ - NDK 27.1.12297006 + CMake 3.22.1+ for native modules / Turbo Modules.
61
+ - `compileSdkVersion 35`, `targetSdkVersion 35`, `minSdkVersion 24`.
62
+ - `ANDROID_HOME` exported; edge-to-edge display ready (Android 15+).
63
+
64
+ **Watchman**
65
+ - macOS: `brew install watchman`.
66
+ - Required for fast refresh on large codebases. Reset: `watchman watch-del-all`.
67
+
68
+ ## Platform setup
69
+
70
+ **iOS**
71
+ - CocoaPods 1.15+: `sudo gem install cocoapods`.
72
+ - New Architecture pods: `RCT_NEW_ARCH_ENABLED=1 pod install`.
73
+ - Provisioning profiles, certificates managed in Xcode or via EAS.
74
+ - Simulator management: `xcrun simctl list devices`. Liquid Glass requires iOS 26 simulator.
75
+
76
+ **Android**
77
+ - Gradle 8.10+ (bundled with Ladybug).
78
+ - AVD with API 35 image; verify edge-to-edge layout.
79
+ - New Architecture: `newArchEnabled=true` in `gradle.properties`.
80
+
81
+ **Metro bundler**
82
+ - Default port 8081. Cache reset: `npx react-native start --reset-cache`.
83
+ - Symlink support and custom resolvers needed for monorepos.
84
+
85
+ **EAS Build (Expo)**
86
+ - `npm install -g eas-cli` then `eas login`.
87
+ - `eas build:configure` to seed `eas.json`.
88
+ - Dev clients for custom native modules; EAS Update for OTA.
89
+
90
+ ## Common setup issues
91
+
92
+ **"Command not found"**
93
+ - PATH for Node, Android SDK, Xcode tools missing in `~/.zshrc` or `~/.bash_profile`.
94
+ - Symlink drift with nvm / fnm — re-run `nvm use` after shell reload.
95
+
96
+ **SDK not found**
97
+ - `echo $ANDROID_HOME` empty → re-export.
98
+ - Re-run SDK Manager; reinstall NDK if native modules fail.
99
+
100
+ **Pod install failures**
101
+ - CocoaPods < 1.15 incompatible with New Architecture — upgrade.
102
+ - Apple Silicon FFI compile errors → use system Ruby or rbenv-managed Ruby.
103
+ - Stuck pods: `pod deintegrate && pod install`.
104
+
105
+ **Build failures**
106
+ - Clean iOS: `cd ios && rm -rf build Pods Podfile.lock && pod install && cd ..`.
107
+ - Clean Android: `cd android && ./gradlew clean && cd ..`.
108
+ - Clear Xcode derived data when stale build artefacts persist.
109
+
110
+ **New Architecture issues**
111
+ - Turbo Module not found → confirm codegen ran during build.
112
+ - Fabric component not rendering → verify native registration.
113
+ - Bridge incompatibility → use the interop layer.
114
+
115
+ ## Quick verification
116
+
117
+ ```bash
118
+ node --version # 20+ (22 LTS preferred)
119
+ npm --version
120
+ xcodebuild -version # 16.1+
121
+ pod --version # 1.15+
122
+ adb --version
123
+ emulator -version
124
+ watchman version
125
+ eas --version # Expo only
126
+ echo $ANDROID_HOME # non-empty
127
+ ```
128
+
129
+ ## Quick commands
130
+
131
+ **Create / run RN CLI project**
132
+ ```bash
133
+ npx @react-native-community/cli init MyProject
134
+ cd MyProject
135
+ cd ios && RCT_NEW_ARCH_ENABLED=1 pod install && cd ..
136
+ npm start # Metro
137
+ npm run ios # in a second terminal
138
+ npm run android # in a third terminal
139
+ ```
140
+
141
+ **Create / run Expo project**
142
+ ```bash
143
+ npx create-expo-app@latest MyProject
144
+ cd MyProject
145
+ npx expo start
146
+ # Custom native code → dev client:
147
+ npx expo install expo-dev-client
148
+ eas build --profile development --platform ios
149
+ eas build --profile development --platform android
150
+ ```
151
+
152
+ **Simulator / emulator**
153
+ ```bash
154
+ xcrun simctl list devices
155
+ xcrun simctl boot "iPhone 16 Pro"
156
+ emulator -list-avds
157
+ emulator -avd Pixel_8_API_35
158
+ ```
159
+
160
+ **Reset everything**
161
+ ```bash
162
+ watchman watch-del-all
163
+ npx react-native start --reset-cache # RN CLI
164
+ npx expo start --clear # Expo
165
+ ```
166
+
167
+ ## Pro tips
168
+
169
+ 1. **Shell profile** — add SDK paths once, reload once:
170
+ ```bash
171
+ export ANDROID_HOME=$HOME/Library/Android/sdk
172
+ export PATH=$PATH:$ANDROID_HOME/emulator
173
+ export PATH=$PATH:$ANDROID_HOME/platform-tools
174
+ export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
175
+ ```
176
+ 2. **EAS minimum `eas.json`** — `development` (dev client + internal), `preview` (internal), `production` (defaults).
177
+ 3. **Hermes** — RN ≥ 0.70 ships Hermes by default; verify with `global.HermesInternal !== undefined` at runtime.
178
+ 4. **Health check** — a single shell function running the verification block above catches 80 % of "it doesn't build" reports.
179
+
180
+ ## Version compatibility (2025)
181
+
182
+ | Component | Minimum | Recommended | Notes |
183
+ |---|---|---|---|
184
+ | Node.js | 20.x | 22 LTS | Node 18 EOL April 2025 |
185
+ | React Native | 0.76 | 0.83 | New Architecture default since 0.76 |
186
+ | React | 18.3 | 19.2 | `Activity`, `useEffectEvent` |
187
+ | Expo SDK | 52 | 54 | Native tabs, Liquid Glass |
188
+ | Xcode | 16.1 | 26 | iOS 26 required for Liquid Glass |
189
+ | Android SDK | 34 | 35 | Edge-to-edge support |
190
+ | CocoaPods | 1.14 | 1.15+ | New Architecture compatibility |
191
+ | Gradle | 8.6 | 8.10+ | K2 compiler support |
192
+
193
+ ## Output format
194
+
195
+ 1. A short setup plan keyed off the target stack (RN CLI vs Expo, iOS vs Android vs both).
196
+ 2. Concrete shell commands the user can paste — no placeholders unless flagged `<…>`.
197
+ 3. A verification block confirming the toolchain is healthy before any feature work.
198
+
199
+ ## Auto-trigger keywords
200
+
201
+ - React Native, Expo, EAS Build
202
+ - Xcode, CocoaPods, pod install
203
+ - Android Studio, ANDROID_HOME, AVD, emulator
204
+ - Metro bundler, Watchman, fast refresh
205
+ - New Architecture, Fabric, Turbo Modules
206
+
207
+ ## Gotcha
208
+
209
+ - Don't set `RCT_NEW_ARCH_ENABLED=1` selectively — once enabled, every `pod install` for that project must use it or cached artefacts diverge.
210
+ - Apple Silicon + system Ruby + FFI is the single biggest source of "pod install hangs" reports — switch to rbenv before retrying.
211
+ - Watchman left over from a previous project can pin Metro to a stale tree — `watchman watch-del-all` is cheap, run it before deeper debugging.
212
+ - iOS Simulator versions are tied to Xcode versions. Liquid Glass features need both Xcode 26 AND an iOS 26 simulator image installed.
213
+ - Android NDK version drift breaks Turbo Modules silently — pin `27.1.12297006` until the project explicitly upgrades.
214
+
215
+ ## Do NOT
216
+
217
+ - Do NOT mix `npm`, `yarn`, `pnpm`, and `bun` lockfiles in the same project — pick one, commit its lockfile, delete the others.
218
+ - Do NOT skip `pod install` after pulling iOS-side changes — the JS bundle will load but native modules will be stale.
219
+ - Do NOT enable New Architecture mid-feature — flag it on a clean branch, run a full clean build, validate both platforms.
220
+ - Do NOT hand-edit `Podfile.lock` or `gradle.lock`-style files — re-run the installers instead.
221
+ - Do NOT commit `node_modules`, `ios/Pods`, `android/.gradle`, or platform `build/` directories.