AGENT SKILL

admob-ads

Builds and checks Pocket Arcade AdMob ads - AdsPort adapters, UMP consent, ATT prompt, spec 8.8 ad policy, banner/interstitial/rewarded slots, ADS_MODE test IDs, SKAdNetwork. Use when touching ads, consent, ATT, ad IDs or rewarded perks. Not for Premium (premium-purchase) or N3 audits.

License 许可
MIT
最近更新
2026-11-05
Stars
★ 0
Forks
0

01 前言 Front Matter

name
admob-ads
description
Builds and checks Pocket Arcade AdMob ads - AdsPort adapters, UMP consent, ATT prompt, spec 8.8 ad policy, banner/interstitial/rewarded slots, ADS_MODE test IDs, SKAdNetwork. Use when touching ads, consent, ATT, ad IDs or rewarded perks. Not for Premium (premium-purchase) or N3 audits.

02 资源文件 283

03 SKILL.md 正文

AdMob ads and consent

Makes every game show Google AdMob ads that never interrupt play: consent and Apple's tracking prompt come first, every "may an ad appear now?" answer comes from pure, tested functions, test builds only ever see Google's test ads, and two scripts prove it on the real code.

Rules that must hold

  1. Ads never interrupt play (spec N8, 8.8). No ad during a level, the tutorial or app start; banners only at the bottom of Home, Levels and Statistics; interstitials only after the player taps Next / Replay / Try again on the Result screen; rewarded ads only when the player taps "Watch an ad to ...". Why: this is the product's promise; everything else in this skill serves it.
  2. Every ad decision comes from ad-policy.ts / perk-offer.ts (pure, numbers from game.config.ts, facts from the Premium store, ConnectivityPort, ConsentPort and the saved AdHistory). No ad logic in screens or adapters, no hard-coded caps; the free hints come from game.config.ts hints.freePerDay through useHintPerk(today). Every finished level is counted in the history in the one run-end update (extendRunEnd: recordAdLevelEnd in the composition root). Why: only pure rules can be tested one by one, the spec makes the numbers per-game configuration, and a history that never counts a level allows exactly one interstitial ever.
  3. Consent, then Apple's tracking prompt, before any ad request, through the Shell's consent moment, and none at all when ads are off. Refresh consent info at every launch (not Premium, ads enabled); where Google's form is required show S3 (ConsentIntroScreen) first and the form only after Continue, and nowhere else: where no form is due, Apple's system prompt appears on its own with the app's usage text (lead decision L10, proven by check-ad-behaviour's case "prepareAds where consent is not required"); once canRequestAds is true ask App Tracking Transparency through ConsentPort.requestTracking() (only while not-determined, the app active); then setRequestConfiguration + initialize and load ads. All of it after the tutorial, online, not Premium, over a banner screen (never over a level), before the first ad. ConsentMoment (mounted in ShellFeatures) is the only runner of prepareAds. Build the ConsentPort only with createConsentPort(adsMode, ...), so an ADS_MODE=off build never calls UMP or ATT. Android: Google's form only, never a tracking prompt: requestTracking() answers 'unavailable' off iOS before it touches expo-tracking-transparency or waits for the app to be active (L14; check-ads rule no-att-android), and L10 holds (S3 only right before Google's form). Why: Google requires consent (EEA/UK/CH), the spec puts the Shell's S3 moment before Google's form, Apple requires the ATT answer before an ad request can use the IDFA (owner decision O1, guideline 5.1.2(i)), the SDK may preload at initialisation, and a UMP info update is a network request that would fail the E2E network audit of off builds.
  4. Test builds never see real ads; real IDs reach the runtime only in store + live builds. ADS_MODE decides: test -> Google's sample app ID + TestIds, live -> the game's IDs via expo.extra.adUnits, off -> nothing. IDs live only in apps/<game>/game.config.ts; app code never types an ad ID. Android: the same per platform: test/off get Google's Android sample app id, live gets ads.ids.android, and a live build without Android ids gets no Android app id at all, never the sample (owner step GP5; android-ids); the live units are embedded per platform and read for Platform.OS, so Android never shows the iOS units (android-units). Why: spec 8.8; real ads in a test build risk the owner's AdMob account.
  5. react-native-google-mobile-ads is exactly 17.2.0 and is imported only by admob-ads-adapter.ts, admob-consent-adapter.ts and the test-only admob-consent-debug-adapter.ts, with the classic create/load/show API (no v17 hooks or pools). Why: an upgrade then touches three files, and caps stay in pure code.
  6. The reward is granted only on RewardedAdEventType.EARNED_REWARD, and the AdsPort reports a RewardedStatus ('loading' | 'ready' | 'unavailable'), never a loaded flag. perkOffer gives a continue 'loading' while its ad loads (S7 draws it busy) and 'hidden' only when no ad can come; hints never wait. So a hidden continue always means unavailable, and a lost run nobody can rescue ends at once (lead decision L11, game-host-integration's isLossStranded). Why: spec 8.8 "the reward is given only when the ad completes" and "hidden, not broken", and round 4's flag stranded finished runs (an endless run in an ads-off build never showed its result).
  7. Pause the game loop and audio around every fullscreen ad (runFullscreenAd), resuming in finally, and make every show settle. The adapter resolves on CLOSED, on ERROR and on a rejected show(): a failed presentation sends ERROR (phase show) and never CLOSED, after show() has already resolved. Android: the ad starts its own Activity, so AppState leaves active while it shows; runFullscreenAd still suspends and resumes itself, and the game comes back to the same run. Why: iOS does not background the app for these ads, so nothing else pauses the game, and a show that never settles leaves the game suspended and the Next button dead.
  8. Ads are silent. Never an error, a spinner or "please connect" for ads; failures go to the ErrorLogPort; branch on error.phase, then error.reason, never the deprecated error.code. The banner slot has zero height until an ad has loaded. Why: spec 4.1 and S4 (no empty box).
  9. General audience, and Apple's rules for tracking: maxAdContentRating: PG, no child-directed or under-age tags. expo-tracking-transparency 57.0.2 is imported only by admob-consent-adapter.ts; its plugin entry gets the en text of consent.tracking.usage-description and withShell writes it for en, de, fa and ckb; the AdMob plugin gets no userTrackingUsageDescription, and the AdMob console publishes no IDFA explainer (step A3). A declined, restricted or unavailable answer still serves ads, without the IDFA, and nothing is gated on it. Android: no ATT and no SKAdNetwork; the advertising-id permission com.google.android.gms.permission.AD_ID (declared by the SDK and the tracking plugin) is never blocked or stripped (ad-id-permission). Why: decision D8 and owner decision O1 (2026-09-30, reversing the old "no ATT prompt in v1"): guideline 5.1.2(i) asks for explicit permission through the ATT APIs and forbids gating anything on it.
  10. The SKAdNetwork list is Google's full list of xxxxxxxxxx.skadnetwork identifiers, refreshed before every release. Why: the plugin only copies what it gets; Google changes the list.
  11. Consent reset, the debug geography and the Ad Inspector exist only in test builds, behind the Shell's test-only entry: the geography (debugGeography: 'eea' | 'other', testDeviceIdentifiers) reaches the consent adapter only through debugServices.setConsentGeography, which the debug link's geo= calls (check-ads rule debug-geography-test-only). Why: they change consent behaviour for real players.
  12. The owner does the AdMob console steps (A1-A5); ask and wait, never invent IDs or publish anything yourself. On Android the owner also makes the AdMob Android app and its three units (GP5). Why: the console belongs to the owner's account, and an invented ID or a published setting would reach real players and risk that account.

Workflow

  1. Read references/setup-ids-and-modes.md. Install the SDK exactly (npm install -E react-native-google-mobile-ads@17.2.0 in every app) plus expo-network, expo-constants and expo-tracking-transparency (~57.0.2, the Expo table spec; a * peer in the Shell and a root override, planned with the dependency-management skill) via npx expo install.
  2. Copy the templates into the repo at the same relative paths (keep an existing app-variant.ts; ads-config.ts replaces the bootstrap version): templates/packages/shell/src/config/, templates/packages/shell/src/services/{ads,consent,connectivity}/, templates/packages/shell/src/ui/ad-banner-slot.tsx (+ test), templates/packages/tooling/src/ads/refresh-skadnetwork.ts, templates/__mocks__/react-native-google-mobile-ads.ts and templates/__mocks__/expo-tracking-transparency.ts. Do not rewrite them from memory.
  3. Check that the Shell's one plugin list, shellPlugins(game, adsMode) in packages/shell/src/config/shell-plugins.ts (architecture-and-boundaries; with-shell.ts spreads it), holds the lines ['react-native-google-mobile-ads', admobPluginOptions(adsMode, game.ads.ids, SKADNETWORK_IDS)] and ['expo-tracking-transparency', { userTrackingPermission: TRACKING_USAGE_DESCRIPTIONS.en }], and that withShell's locales write NSUserTrackingUsageDescription for the four languages (the templates already do; add exactly those lines if a copy lacks them), where adsMode = game.ads.isEnabled ? variant.adsMode : 'off', and make its extra hold adsMode plus ...(adUnits === null ? {} : { adUnits }) with adUnits = adUnitsExtra(adsMode, game.ads.ids) (the live units per platform, { ios, android }); fill the ads section of every apps/<game>/game.config.ts (policy 3 / 180_000 / 2; the owner's IDs or documented-format placeholders). Run npx expo prebuild --platform ios --clean after plugin changes.
  4. Read references/consent-flow.md (with "App Tracking Transparency" and its sources). Create the ports once with createAdsPort(readAdsExtra(), ...) and createConsentPort(readAdsExtra().adsMode, ...); feed isAdsEnabled = extra.game.adPolicy.isAdsEnabled && adsMode !== 'off' into the gate input and the policy config. With the composition root (Shell step 7) copy the consent moment: templates/packages/shell/src/app/consent-moment.tsx, consent-moment-context.tsx and use-consent-moment.ts (+ consent-moment.test.tsx; the flow services/ads/consent-moment-flow.ts came with step 2), and check that ShellFeatures renders <ConsentMoment isHeld={parts.isConsentMomentHeld} debug={debug.services}> around the navigator (game-host-integration's template does). It refreshes consent once per launch and runs prepareAds (S3 intro, then Google's form, then Apple's ATT prompt) the first time a banner screen is open; never call the gate or requestTracking by hand. It needs toybox-screens' screens/consent/consent-intro-screen.tsx (part of the Shell core in every slice). Show the "Ad privacy choices" row only when required.
  5. Read references/ad-policy.md and references/placements-and-lifecycle.md. Copy templates/packages/shell/src/app/use-ad-context.ts (+ test) at Shell step 7, with the composition root (it reads the services context, the debug services and the game extra, which exist from then on): useAdContext(placement) gathers the live AdContext (Premium store, useIsOnline(), the consent moment's live answer, else the saved save.doc().ads.consent.canRequestAds, tutorial done, levels won), useAdPolicyConfig(placement) the game's numbers (off in ADS_MODE=off builds), useHintPerk(today) the hint perk with the game's hints.freePerDay, and useBannerSlot('home' | 'levels' | 'stats') the banner model the screens' model hooks return (it also asks the consent moment for the ad moment while the screen is open); the parity harness of test builds opens a placement through ForcedAdPlacementsContext. Put AdBannerSlot at the bottom of Home, Levels and Statistics with isAllowed from useBannerSlot('<screen>') (in the screen's model hook, never built by hand) and the Toybox banner band as loadedStyle; call showInterstitialIfDue only in the Next / Replay / Try again handlers and save the returned history; render hint and continue buttons from perkOffer and run the perk only when earnRewardedPerk returns true; give runFullscreenAd the game lifecycle. examples/ad-wiring.md shows each call in place.
  6. Run the Jest suites: npx jest packages/shell/src/services/ads packages/shell/src/services/consent packages/shell/src/config packages/shell/src/ui/ad-banner-slot.test.tsx packages/shell/src/app/use-ad-context.test.tsx packages/shell/src/app/consent-moment.test.tsx --ci --selectProjects unit --coverage --collectCoverageFrom='packages/shell/src/services/ads/**/*.ts' --coverageThreshold='{}' (paths first; only npm run test:coverage judges the thresholds).
  7. Run node ${CLAUDE_SKILL_DIR}/scripts/check-ads.mjs . and node ${CLAUDE_SKILL_DIR}/scripts/check-ad-behaviour.mjs .. Fix every FAIL line (each names the file, the rule and the fix) and rerun until both print RESULT: PASS. Rules whose target a later Shell build step creates print SKIP lines until it exists (a pass): plugin-entry and att-plugin until packages/shell/src/config/shell-plugins.ts (step 8), level-end-recorded until packages/shell/src/app/create-shell-parts.ts and consent-moment until packages/shell/src/app/shell-features.tsx (step 7). The Android rules (android-ids, android-units, ad-id-permission, no-att-android) apply at once: iOS builds are unaffected by them, and an Android port is not done until they pass.
  8. Before a release: node packages/tooling/src/ads/refresh-skadnetwork.ts --check, then the ads smoke test, by hand on an ADS_MODE=test build: the Maestro flows templates/packages/shell/e2e/ads-smoke/01 to 06 (pocket-arcade-index copies them at Shell step 10, with e2e-maestro's flows and its debug-setup.yaml), each run as tools/maestro/bin/maestro --device <udid> --driver-host-port <port> test -e APP_ID=<bundle id> -e APP_SCHEME=<scheme> packages/shell/e2e/ads-smoke/<flow>.yaml after a fresh install started with xcrun simctl launch <udid> <bundle id> (Maestro's launchApp grants the ATT answer), never through e2e:ios. They cover geo=eea (S3, the form, the ATT prompt declined, a banner), a relaunch, Next with an interstitial, the rewarded continue with its board assertion (game.board-frame settled for the continue's seq), offline, and geo=other (references/console-privacy-troubleshooting.md, "Simulator smoke test"). Then hand off for the privacy-manifest and network audits (App Privacy: Device ID used for tracking by the Google Mobile Ads SDK; the app's own manifest keeps NSPrivacyTracking false).
  9. Tell the owner, in plain words, which console steps are still open (A1-A4 before the first store build, A5 after the first release; GP5, the AdMob Android app and its three units, before the first live Android build) and what each one needs from them.
  10. On Android: copy the three Android tests with the other templates, admob-consent-adapter.android.test.ts, admob-ads-adapter.android.test.ts and consent-moment.android.test.tsx (they run in the unit-android Jest project), and run the ads smoke flows on an ADS_MODE=test emulator build after a fresh install started with adb -s <serial> shell am start -W -n <package>/.MainActivity (references/console-privacy-troubleshooting.md, "On the Android emulator"); the tracking steps run only on iOS.

Definition of done

  • [ ] The SDK is exactly 17.2.0 in every app and imported only by the three adapter files; expo-tracking-transparency ~57.0.2 is in every app and imported only by admob-consent-adapter.ts; both root mocks exist.
  • [ ] Every template file is in place and its Jest suite passes (ad policy, perk offer, ad history, ad gate, ad moments, ads adapter, ads factory, read-ads-extra, ads config, app variant, consent adapter, consent factory, banner slot).
  • [ ] The plugin gets admobPluginOptions(...); expo.extra.adUnits exists only in store + live builds; no ad ID is typed in app code.
  • [ ] Consent: launch refresh, S3 (ConsentMoment in ShellFeatures) then Google's form, then Apple's ATT prompt (while not-determined), after the tutorial, over a banner screen and before the first ad; nothing initialised or loaded without canRequestAds; the moment publishes canRequestAds: true only after the ATT answer and a finished initialize, and the adapter's banner mounts its native view only after initialize; declined, restricted or unavailable tracking still initializes; the S3 parity frame holds the moment without asking Google or Apple; the privacy row appears only when required; the ConsentPort comes from createConsentPort, so ADS_MODE=off never calls UMP or ATT.
  • [ ] The ATT text: the plugin entry with the en text, NSUserTrackingUsageDescription in withShell's locales for en, de, fa and ckb from consent.tracking.usage-description (fa and ckb listed for the owner's own review, never blocking); no IDFA explainer in the AdMob console.
  • [ ] Every finished level counts in the ad history in the one run-end update (extendRunEnd: recordAdLevelEnd), and the free hints follow hints.freePerDay (useHintPerk).
  • [ ] Banners only on home.banner-ad, levels.banner-ad, stats.banner-ad, each flag computed by shouldShowBanner and the loaded slot drawn as the Toybox band; interstitials only from Result-screen handlers; perks only on the player's tap, rewarded only on EARNED_REWARD; the game is suspended during fullscreen ads.
  • [ ] Offline, Premium, no consent and ADS_MODE=off each show no ad and no message.
  • [ ] refresh-skadnetwork.ts --check passes before a release; the ads-smoke flows 1 to 6 passed on an ADS_MODE=test build, each after a fresh install started with xcrun simctl launch (S3, form, ATT declined, banner; relaunch without prompts; the interstitial; the rewarded continue with the board settled; offline; geo=other); the owner has done A1-A4 for this game (A5 after release).
  • [ ] Android: a live build gets the game's Android ids or no Android app id at all (never Google's sample), the live units per platform, no tracking prompt (requestTracking answers 'unavailable'), and AD_ID is never blocked; admob-consent-adapter.android.test.ts, admob-ads-adapter.android.test.ts and consent-moment.android.test.tsx pass in unit-android.
  • [ ] L11: the AdsPort, the adapter, the factory's off port and the fake report rewardedStatus/subscribeRewardedStatus; perk-offer.test.ts covers the loading row; nothing uses isRewardedLoaded.
  • [ ] node ${CLAUDE_SKILL_DIR}/scripts/check-ads.mjs . and node ${CLAUDE_SKILL_DIR}/scripts/check-ad-behaviour.mjs . both print RESULT: PASS

Anti-patterns

  • Calling showInterstitialIfDue from a Result-screen effect. The ad would cover the result. Only the button handlers call it.
  • "Upgrading" the adapter to useInterstitialAd, useRewardedAd or ad pools. Hooks tie ads to component lifetime and pools start preloading (and on Android initialise the SDK) before consent. Keep the classic API.
  • Initialising the SDK at app start "to be ready". It may preload ads before consent. prepareAds is the only caller of initialize.
  • Typing test unit IDs or the sample publisher ID in code. Use TestIds.* in the adapter and GOOGLE_SAMPLE_APP_IDS in ads-config.ts; whether an id is one of Google's sample ids is isGoogleSampleAdId, the one answer live builds and the release gates share.
  • npx expo install react-native-google-mobile-ads. It writes ^17.2.0; use npm install -E.
  • A .skadnetwork-less SKAdNetwork list, or one edited by hand. Regenerate with the refresh script.
  • Hiding an ad failure behind a message, a retry button or a spinner. Ads are silent; log and move on.
  • Granting a reward on CLOSED, or showing a pressable "Watch an ad" button with nothing loaded.
  • Hiding a continue while its rewarded ad is still loading. "Hidden" then means two things and a lost run waits for nobody; offer it busy ('loading') and keep 'hidden' for "no ad can come".
  • Putting ads=test in an ads-smoke setup link. It is S15's "Always show test ads" (no pacing), kept across launches; the interstitial step then proves nothing.
  • Changing one game's caps by editing ad-policy.ts. Change the numbers in that game's game.config.ts; they may be raised above the spec floors (3 levels, 180 000 ms, 2 levels), never lowered.
  • Putting AdsConsent.reset() or the Ad Inspector in the consent adapter. They belong to the test-only debug adapter.
  • Calling createAdmobConsentAdapter directly, or taking isAdsEnabled from the game config alone. An ADS_MODE=off build (screenshots, E2E) then asks Google UMP at launch and the runtime network audit fails; use createConsentPort(adsMode, ...) and isAdsEnabled && adsMode !== 'off'.
  • Wrapping AdBannerSlot in a band that renders nothing until an ad has loaded. The native banner must be mounted to load; pass the band as loadedStyle.
  • Asking ATT at launch, before Google's form, or from a screen. Apple's prompt comes through ConsentPort.requestTracking() inside prepareAds, after the form and before initialize, over a banner screen only.
  • Hiding ads, a perk or Premium behind "Allow". Declined tracking serves the same ads without the IDFA; guideline 5.1.2(i) forbids gating anything on the answer.
  • Publishing an IDFA explainer in the AdMob console or setting the AdMob plugin's userTrackingUsageDescription. UMP would run a second ATT flow, and the text would have two writers.
  • Proving ATT with a flow that starts with launchApp. Maestro grants every permission by default, so the status reads authorized and the prompt never shows; launch with xcrun simctl launch <udid> <bundleId>.
  • Fixing a failing checker by weakening a Jest test or the fixture. The behaviour check runs the real modules; fix the module.

Files in this skill

File What it is Read/run when
references/setup-ids-and-modes.md Versions, install, the APP_VARIANT x ADS_MODE matrix, IDs, plugin options, test IDs, SKAdNetwork refresh, re-verify Workflow steps 1-3
references/consent-flow.md UMP rules, App Tracking Transparency (owner decision O1, how Expo reports restricted, the sources checked 2026-09-30), ConsentPort, the consent -> ATT -> initialize -> preload sequence, the privacy row, test-only tools Workflow step 4
references/ad-policy.md Spec 8.8/8.10 rules, the pure policy, ad history, perk offers, pinned interpretations, tests Workflow step 5, before changing any ad rule
references/placements-and-lifecycle.md AdsPort and adapter facts, banner slot, Result-screen flow, rewarded perks, pausing, offline table Workflow step 5
references/console-privacy-troubleshooting.md AdMob console steps A1-A6 (no IDFA explainer), privacy facts (Device ID used for tracking by the ads SDK, the app's manifest without tracking), the simulator smoke test with ATT and the rewarded continue and its recorded run, root mocks, error and symptom tables Workflow steps 8-9, and when an ad misbehaves
examples/ad-wiring.md The whole wiring for the pilot game, call by call Workflow step 5, as the model
templates/packages/shell/src/config/ ads-config.ts (+ test; GOOGLE_SAMPLE_PUBLISHER and isGoogleSampleAdId, which the release tooling imports), app-variant.ts (+ test; both synced from the library, do not edit here), skadnetwork-ids.ts (Google's 50 IDs, 2026-09-26) Workflow steps 2-3
templates/packages/shell/src/services/ads/ Port, AdMob adapter (+ test, and admob-ads-adapter.android.test.ts for the unit-android project: Google's Android test units, the game's units in live, fullscreen ads that settle, the reward only on EARNED_REWARD), fake, factory, read-ads-extra, policy, history, perk offer, gate (with the S3 intro step), the consent moment flow, fullscreen lifecycle, moments, with tests Workflow step 2
templates/packages/shell/src/services/consent/ ConsentPort (with TrackingStatus and requestTracking), AdMob consent adapter with the ATT request (+ test; the test is synced from the library, the same file as unit-and-component-tests' example: do not edit here), consent factory createConsentPort (+ test), test-only debug adapter (+ test), fake (scripted ATT status, prompt count), and admob-consent-adapter.android.test.ts (the unit-android project: no tracking step, UMP as on iOS) Workflow step 2
templates/packages/shell/src/services/connectivity/ ConnectivityPort, expo-network adapter, fake Workflow step 2
templates/packages/shell/src/ui/ ad-banner-slot.tsx (collapsed until loaded, loadedStyle for the band) and its test Workflow step 2
templates/packages/shell/src/app/ use-ad-context.ts (useAdContext, useAdPolicyConfig, useHintPerk, useBannerSlot, ForcedAdPlacementsContext) and its test; the consent moment consent-moment.tsx (+ test, and consent-moment.android.test.tsx for the unit-android project: S3 then Google's form then initialize, no tracking step), consent-moment-context.tsx and use-consent-moment.ts; they import toybox-screens' use-is-online.ts, use-game-extra.ts and consent-intro-screen.tsx Workflow steps 4 and 5
templates/packages/tooling/src/ads/refresh-skadnetwork.ts Regenerates or --checks the SKAdNetwork list from Google's page Workflow step 8
templates/packages/shell/e2e/ads-smoke/ The ads smoke test as six Maestro flows (tag ads-smoke, run by hand on an ADS_MODE=test build, never by e2e:ios): 01-consent-eea.yaml, 02-relaunch.yaml, 03-next-interstitial.yaml, 04-rewarded-continue.yaml (the board assertion), 05-offline.yaml, 06-geo-other.yaml; the tracking-prompt steps run only when: platform: iOS, and flow 6 has an Android branch Workflow steps 8 and 10
templates/packages/shell/e2e/subflows/close-test-ad.yaml Closes Google's full-screen test ad at the close key's point POINT (03 and 04; they also use e2e-maestro's win-and-next.yaml) Workflow step 8
templates/__mocks__/react-native-google-mobile-ads.ts Jest root mock of the SDK surface the adapters use (synced from the library) Workflow step 2
templates/__mocks__/expo-tracking-transparency.ts Jest root mock of the tracking module (jest-expo mocks only its native module): undetermined, then denied when asked (synced from the library) Workflow step 2
assets/admob-facts.json Pinned version, adapter import allowlists, the tracking facts (package, adapter, allowed names, plugin, catalog key, languages), banned SDK names, ID patterns, policy floors, banner slots, required files Read by the checkers; update on an SDK upgrade
scripts/check-ads.mjs Static checks: files, pin, imports, SDK API, consent only through createConsentPort, the debug geography only in test-only code (debug-geography-test-only), the rewarded status instead of a loaded flag (rewarded-status), IDs, ATT (att-adapter-only, att-order: after the form and the canRequestAds check, before initialize; att-plugin: the plugin entry, the four texts and the package, due at Shell step 8), plugin entry (due at Shell step 8), extra.adUnits only through adUnitsExtra, SKAdNetwork, policy floors, banner placement and its shouldShowBanner flag, ads in effects, the level end in the ad history and the consent moment (due at step 7), the free hints from the config; Android: android-ids (no sample app id in a live build), android-units (units per platform), ad-id-permission, no-att-android (the first two run the repo's ads-config.ts and read-ads-extra.ts) Workflow step 7
scripts/check-ad-behaviour.mjs Runs the repo's own ad modules (type stripping) against the spec 8.8 decision table and the consent -> ATT -> initialize order (declined, restricted and unavailable still initialize; nothing with ads off, for Premium, offline, before the tutorial or while held; ATT only over a banner screen), and the two adapters (the ATT request included), both factories and read-ads-extra against scripted stand-ins Workflow step 7
scripts/lib/repo-scan.mjs File listing and import parsing helpers for the checkers Read only to change a checker
scripts/lib/load-ts.mjs Imports repo TypeScript modules with the @e07/* workspace aliases and the module stand-ins Read only to change a checker
scripts/lib/stubs/ Scripted Node stand-ins for react-native-google-mobile-ads 17.2.0, expo-tracking-transparency 57.0.2, react-native (Platform, AppState), react and expo-constants used by the behaviour check (update on an SDK upgrade) Read only to change a checker
scripts/lib/assemble-fixtures.mjs Builds each self-test case from templates + base repo + mutation.json Read only to add a self-test case
scripts/selftest.mjs Proves both checkers on the clean repo, 89 planted problems (the Android ids, units, AD_ID permission and tracking cases included, the not-yet-due SKIP lines, a banner mounted or allowed before initialize, and the ATT order, plugin, locale, import, ads-off, decline, held and over-a-level cases, the L11 offer and status, and the debug geography included) and two passing facts (a type-only import of the debug tools; blocked permissions that leave AD_ID alone) After changing a checker, a template or a fixture
scripts/check-lib.mjs Shared script helper, synced from the library (do not edit here) Never by hand
assets/shared.json Declares the shared files copied into this skill When adding a shared file
tests/fixtures/ base-repo/ plus one mutation.json and EXPECT.txt per case (bad-* must fail, pass-* must pass), per checker When adding a rule

Related skills

  • premium-purchase - Premium turns ads off; isPremium comes from its store.
  • privacy-and-network-audit - privacy manifest, App Privacy answers and the network audit after installing the SDK.
  • architecture-and-boundaries - ports, adapters and where withShell lives.
  • settings-and-preferences - the "Ad privacy choices" row in S11.
  • toybox-visual-parity - Home, Levels and Statistics parity with the banner slot masked as dynamic pixels.
  • game-host-integration - the game lifecycle that runFullscreenAd suspends, and the Result-screen flow.
  • save-persistence-and-migrations - the save's ads section that stores AdHistory.
  • ios-release-testflight - the store-artifact gate that checks GADApplicationIdentifier.
  • dependency-management - pinning and upgrading the SDK.

04 同仓库更多 Skills

zakariaf
zakariaf/pocket-arcade

unit-and-component-tests

Sets up Jest and writes Pocket Arcade test code - three projects, RNTL 14 async via renderWithShell, root SDK mocks, fakes, fast-check, coverage, Stryker. Use when a test needs the Shell wrapper, a mock or a fake, or Jest fails. Not for the red-green loop (tdd-workflow) or goldens (golden-tests).

★ 0
zakariaf
zakariaf/pocket-arcade

typescript-and-lint-rules

Enforces Pocket Arcade's strict TypeScript 6 tsconfigs, ESLint 9 flat config, Prettier and size limits. Use when writing or splitting .ts/.tsx or fixing a tsc or lint error. Not for gate wiring (quality-gates), names (naming-conventions) or import zones (architecture-and-boundaries).

★ 0
zakariaf
zakariaf/pocket-arcade

demo-skill

Builds a demo. Use when testing the pitfall checker.

★ 0
zakariaf
zakariaf/pocket-arcade

demo-skill

Builds a demo. Use when testing the pitfall checker.

★ 0
zakariaf
zakariaf/pocket-arcade

troubleshooting-playbook

Diagnoses and fixes Pocket Arcade failures with a catalogue of 300+ known ones (symptom, cause, fix). Use when something errors, crashes, hangs or renders wrong, or an error or log needs explaining. Not for gate setup (quality-gates) or running builds (ios-simulator-build, ios-release-testflight).

★ 0
zakariaf
zakariaf/pocket-arcade

toybox-visual-parity

Proves a built Pocket Arcade screen matches its Toybox design screenshot (light/dark, en/fa) and drives the fixes: capture, element gates, sheets, sign-off. Use when any screen is built or changed, or for visual parity, design match, screenshot compare. Not for building screens (toybox-screens).

★ 0