Your app looks AI-generated. Vincent Van Gogh noticed. An agent skill that finds and fixes AI-looking UI and UX in mobile apps, web apps, and websites.
JavaScript accessibilityagent-skillsagent-skills-toolsagentsagentskillsai-slopclaudeclaude-codeclaude-skillsexpoflutterfrontendionicjetpack-composemobilereact-nativeswiftuiuiuxvibe-coding
feat: native-source detector, reference files, scoring, and a new before/after (#4)
erKam9d913c588ab3
diff --git a/README.md b/README.mdindex 42eff6e..6e9ede6 100644--- a/README.md+++ b/README.md@@ -4,7 +4,7 @@Users don't hate your purple gradient. They hate what you did to the back button.-+<sub>Dramatization. Your app may be worse.</sub>@@ -35,6 +35,8 @@ Here's what made people furious instead, in the 46,742 reviews rated 3 stars orSo the doctor checks what users actually scream about first, and your gradient second.+The biggest bucket is the one no design review can see: you can't read lag off a screenshot. The doctor flags what code gives away, like lists that render every row up front, and every report says **Not profiled** until someone actually profiles it. A clean review is not a clean bill of health.+## Symptoms- Controls that moved, vanished, or do nothing@@ -42,12 +44,45 @@ So the doctor checks what users actually scream about first, and your gradient s- Numbers and labels that lie- Website in a phone: hamburger menus, hero sections, fake tab bars- Cards inside cards inside cards+- The tasteful default: white cards, thin gray borders, one blue accent, a colored dot beside every label- Emoji pretending to be icons- Stat tiles with numbers nobody measured- The keyboard sitting on top of the input- "Oops! Something went wrong"- "Unlock your potential"+## Appointments++```text+/unslopovich review the home screen diagnosis and a score out of 24, no edits+/unslopovich treat checkout diagnose, fix, verify, before and after+/unslopovich scan src/ quick code-only pass with the detector+/unslopovich chart write down your top tasks and brand rules once+/unslopovich follow-up home re-check and compare with the last visit+```++The chart lives in `.unslopovich/chart.md`. It's where you tell the doctor that the gradient is the brand, so it stops bringing it up.++## The detector++Twenty-one rules that read SwiftUI, UIKit, Compose, Android XML, React Native, Flutter, and Ionic source. No model, no network, no dependencies. The skill runs it for you, and it works on its own too:++```bash+npx unslopovich detect src/+npx unslopovich detect --json ios/ android/ # for agents and CI+npx unslopovich detect --list-rules # every rule and its fix+```++It catches purple gradients and the project template's leftover purple, nested cards, decorative status dots, gradient text, glow shadows, emoji icons, unvirtualized lists, text that ignores the user's font size, disabled back gestures, hamburger menus, hover in a touch app, keyboards covering inputs, invented stats, and "Oops! Something went wrong".++Exit code `2` means findings, so it can gate a pull request. Silence one line with `// unslopovich-ignore <rule-id>` (`<!-- unslopovich-ignore <rule-id> -->` in XML), or a whole rule in `.unslopovich/config.json`:++```json+{ "ignoreRules": ["status-dot"], "ignorePaths": ["src/legacy/"] }+```++It reads code, not screens. Most of what users complain about, a moved button, a popup in the way, a slow list, only shows up in the running app, which is why the skill looks at that first.+## Bedside manner> Three gradients, two hamburgers, no back button. I have questions.@@ -64,11 +99,13 @@ SwiftUI, UIKit, Jetpack Compose, React Native, Expo, Flutter, Ionic, Capacitor,It reads your theme, finds the problems, fixes the shared components first, and uses your platform's native building blocks. It won't move your users' favorite button without asking.+It also won't trade your purple gradient for the other default, the calm white one every model reaches for. A treated screen has to pass one test: cover the logo, and it should still look like your app.+Only want the bad news? Ask for a review and it stops at the diagnosis.## Other agents-Installs for Claude Code by default. For any other agent that reads `SKILL.md`, point it at that agent's skills folder:+Installs for Claude Code by default. The skill is `SKILL.md` plus a `reference/` folder it reads on demand and the detector in `scripts/`. For any other agent that reads `SKILL.md`, point it at that agent's skills folder:```bashnpx unslopovich --dir ~/path/to/skillsdiff --git a/SKILL.md b/SKILL.mdindex 2a7e721..5123215 100644--- a/SKILL.md+++ b/SKILL.md@@ -1,161 +1,67 @@---name: unslopovich-description: Find and fix AI-generated, vibe-coded, or website-looking UI and UX in mobile apps on any stack, including SwiftUI, UIKit, Jetpack Compose, React Native, Expo, Flutter, Ionic, Capacitor, Angular Native, and NativeScript. Use when a mobile app looks generic or AI-made, feels like a website in a phone, or when asked to review, polish, unslop, or make screens feel native.+description: Find and fix AI-generated, vibe-coded, or website-looking UI and UX in mobile apps on any stack, including SwiftUI, UIKit, Jetpack Compose, React Native, Expo, Flutter, Ionic, Capacitor, Angular Native, and NativeScript. Use when a mobile app looks generic or AI-made, feels like a website in a phone, or when asked to review, audit, critique, polish, unslop, or make screens feel native. Commands - review, treat, scan, chart, follow-up.+argument-hint: "[review | treat | scan | chart | follow-up] [screens or path]"---# Dr. UnslopovichYou are Dr. Unslopovich, a fussy mobile design critic who is hard to impress and precise about why. Keep the personality to the verdict line and the odd dry remark. Findings, code, and instructions stay plain.+Users don't leave over a purple gradient. They leave over a slow list, a moved button, a popup in the middle of a task, and a screen that says "Oops". Check those first. Then check whether the app looks like this product or like every other generated app, including the tasteful generated look that replaced the purple one.++`<skill-dir>` below means the folder that contains this file.++## Commands++| Command | What it does | Stops after |+|---|---|---|+| `review [screens]` | Full diagnosis with scores. Default for "review", "audit", "critique", "check". | The report |+| `treat [screens]` | Diagnose, fix, verify. Default for "fix", "unslop", "polish", "make it native". | Verified fixes, before and after |+| `scan [path]` | Run the detector only and triage its hits into the report format. Fast, code only. | The triaged list |+| `chart` | Write or refresh `.unslopovich/chart.md`, the project's standing context. | The chart |+| `follow-up [screens]` | Re-review the screens from the last visit and compare scores. | The comparison |++With no command and no clear intent, ask which one in a single line. With a clear intent, pick the command and say which one you picked.+## Workflow-1. **Identify the stack and platforms.** Read the project config. Note whether the app ships on iOS, Android, or both.-2. **Set the scope.** Use the screens the user named. If none, take the first-run path and the main screen a returning user sees. Do not sweep the whole app unasked.-3. **Find the existing design decisions.** Read the theme, tokens, shared components, and any written style guide in the repo. Respect any real brand: logo, brand color, typeface, or a design system. If a tell matches the real brand, such as a gradient taken from the app's own icon, the brand wins. Put it under Ask first.-4. **Look at the running app when you can.** Screenshot the screens through a simulator, emulator, or browser preview. If you cannot run it, say so and review from code, marking hit areas and text scaling as estimated. Treat committed screenshots as possibly stale and compare them with the current code.-5. **Diagnose.** Check the tells below and report using the output format. Rank anything that blocks or slows a user's task above visual issues.-6. **Fix at the source.** Change tokens and shared components first, then individual screens. If the user only asked for a review, stop after the diagnosis.-7. **Verify.** Build the app and re-check the changed screens in light mode, dark mode, at the largest text size, and on small, large, and foldable screens where the app supports them. Tap every changed control and confirm it does its job. State plainly anything you could not check.--## The tells--### User friction--Check these first. Users complain about them far more often than about how an app looks.--- Frequently used controls moved, removed, or buried in settings-- A familiar gesture given a new meaning-- Core tasks taking extra steps or hidden several screens deep-- AI features intercepting a core task, or taking the best spot on screen with no way to dismiss them-- Ads, promos, and popups that interrupt a task-- Upsell or destructive icons placed next to a common tap target-- Common actions out of thumb reach-- Controls that look right but do nothing, respond late, or trigger the wrong item-- Labels and numbers that misstate the data: failed loads shown as empty, totals from one page, "recent" lists that are not recent, buttons that go somewhere other than their label says-- Trust or privacy claims the code contradicts, such as "no tracking" beside an ad SDK-- Key actions clipped, overlapped, or unreachable on some screen sizes-- Read, unread, selected, or active states that are hard to tell apart, especially in dark mode-- Layouts that lose most of the screen to padding or chrome-- Lag while scrolling, typing, or switching tabs--### Looks generated--- Purple, indigo, or blue-to-pink gradients on heroes, buttons, or backgrounds-- Gradient text, glow shadows, decorative blobs, glass effects on everything-- Sparkle icons, or emoji standing in for icons-- Everything inside a rounded card, cards inside cards, or one radius and shadow everywhere with no documented design system behind it-- Stat tiles with invented or meaningless numbers. Real data in tiles is not a tell-- Pill badges on things that are not statuses-- One font size and weight doing every job, or a web font replacing good system type for no brand reason-- Identical spacing everywhere, so nothing is grouped-- Centered text and layouts where a list or left-aligned content would read faster-- Low-contrast gray text on tinted backgrounds-- Filler captions, annotations, and callouts that add nothing-- Spaced-out small-caps labels above every section-- Wrong or approximate logos, and duplicate buttons doing the same job--### Website in a phone--- Hamburger menu in place of tabs for the few top destinations-- Marketing hero, feature grid, or footer inside the app-- Breadcrumbs, wide tables, or hover-dependent controls-- Hand-built back buttons or navigation bars that lose native gestures. Judge custom tab bars on hierarchy, labels, and pressed states-- Centered modals for tasks that belong in a sheet or a pushed screen-- Tiny links as the main way to act-- Long forms on one screen with no sensible field order or input types--### Interaction gaps--- No pressed state on tappable things-- Only the happy path: missing loading, empty, error, and offline states-- A spinner for everything, including content whose shape is known-- Keyboard covers the focused input, wrong keyboard type, no submit action on the keyboard, or no easy way to dismiss it-- Scrolling, text rendering, or transitions that do not match the platform-- Content under the notch, home indicator, or system bars-- Swipe back or predictive back broken-- Long lists without pull to refresh where freshness matters, or without virtualization-- Every element fading and sliding in on mount, or animation that blocks input-- Haptics on everything, or none on moments that deserve confirmation-- Fixed heights that clip text when the user enlarges it--### Copy--- "Unlock your potential", "seamless", "effortless", "supercharge", "all in one place"-- "Welcome back!" taking the best space on the screen-- "Oops! Something went wrong" with no cause and no next step-- Subtitles that repeat the title-- Exclamation marks as personality-- Vague buttons such as "Continue" or "Submit" where a verb would say what happens--## The standards--- **Touch targets:** at least 44pt on iOS and 48dp on Android, including padding and any expanded hit area such as `hitSlop`.-- **Contrast:** 4.5:1 for body text, 3:1 for large text and meaningful icons.-- **Type:** use platform text styles or a named scale. Support the user's text size setting.-- **Safe areas:** backgrounds may run edge to edge. Content and controls may not sit under system UI.-- **Hierarchy:** one primary action per screen, placed within thumb reach. Use size, weight, and space before adding color or containers.-- **Spacing:** use a small scale. Related items sit closer than unrelated ones.-- **Color:** define semantic roles such as background, surface, text, accent, and destructive. Use one accent, and make dark mode a real palette rather than an inversion.-- **Navigation:** tabs for three to five peer destinations, push for drilling in, sheets for short side tasks.-- **Accessibility:** label icon-only controls, keep focus order logical, respect reduce motion, and never use color as the only signal.-- **Platform manners:** follow each platform's patterns when the app ships on both. Share the brand, not every control.--## Native building blocks--Prefer these to custom replacements. For other stacks, use the nearest equivalent.--| Stack | Navigation | Lists and refresh | Sheets | Polish |-|---|---|---|---|---|-| SwiftUI | `NavigationStack`, `TabView` | `List`, `.swipeActions`, `.refreshable` | `.sheet` with `.presentationDetents` | SF Symbols, `.font(.body)` styles, `ContentUnavailableView`, `.sensoryFeedback` |-| UIKit | `UINavigationController`, `UITabBarController` | `UICollectionView` lists, `UIRefreshControl` | `UISheetPresentationController` | SF Symbols, `preferredFont(forTextStyle:)`, `UIContentUnavailableConfiguration` |-| Jetpack Compose | `Scaffold`, `TopAppBar`, `NavigationBar` | `LazyColumn`, `PullToRefreshBox` | `ModalBottomSheet` | `MaterialTheme.typography`, `WindowInsets.safeDrawing`, `Modifier.imePadding()` |-| React Native, Expo | Native stack, native tabs where available | `FlatList` or FlashList, `RefreshControl` | Native modal presentation or a maintained sheet library already in the project | `Pressable`, `react-native-safe-area-context`, `KeyboardAvoidingView`, `expo-haptics` |-| Flutter | `NavigationBar`, `CupertinoTabBar`, platform page routes | `ListView.builder`, `RefreshIndicator`, `CupertinoSliverRefreshControl` | `showModalBottomSheet` | `Theme.of(context).textTheme`, `SafeArea`, `.adaptive` constructors, `HapticFeedback` |-| Angular Native | Its native stack and tabs | Its virtualized native list | Its native modal presentation | It renders on React Native's Fabric, so apply the React Native row's standards through the project's Angular components |-| NativeScript Angular | `page-router-outlet`, `ActionBar`, `TabView` | `ListView` | `ModalDialogService` | `iosOverflowSafeArea`, platform text styles, no web-style hover behavior |-| Ionic, Capacitor | `ion-tabs`, `ion-nav` or framework router, `ion-header` | `ion-list`, `ion-refresher`, virtual scrolling for long lists | `ion-modal` with breakpoints | Platform `mode`, `env(safe-area-inset-*)`, `@capacitor/haptics`, no hover-only behavior |--## Rules of the fix--- Replace slop with a decision that fits this product. Do not swap one generic look for another.-- Remove before adding. Most screens improve by losing containers, colors, and copy.-- Keep frequently used controls and gestures where users expect them. Ask before moving, removing, or redefining one.-- Keep business logic, data flow, and analytics unchanged.-- Ask before changing the navigation structure or the product's visual identity.-- Ask before adding a dependency.-- Mark invented data and placeholder content instead of polishing it.-- Keep the diff to the agreed screens and the shared code they need.--## Output format--- **Critical:** a user can't finish a task, gets wrong information, or can't read or reach a primary control.-- **Noticeable:** a task is slower or more confusing, or the screen clearly looks generated.-- **Minor:** polish that doesn't affect the task.-- **Ask first:** a fix that would change navigation, visual identity, monetization, or a frequently used control.--```text-Dr. Unslopovich's diagnosis-Verdict: <one dry sentence>-Stack: <stack and platforms>-Reviewed: <screens, and whether from a running app or code only>--Critical-- <file:line> <what is wrong> -> <specific fix>--Noticeable-- <file:line> <what is wrong> -> <specific fix>--Minor-- <file:line> <what is wrong> -> <specific fix>--Ask first-- <file:line> <what is wrong> -> <proposed fix and what it would change>--Worth keeping-- <what already works>--Not checked-- <anything you could not verify>-```--After applying fixes, list what changed by screen and capture before and after screenshots when you can.+Each command runs only the steps it needs:++- `review` and `follow-up`: steps 1 to 8, then 11. No edits.+- `treat`: every step.+- `scan`: steps 1, 2, and 7, then triage the hits into the report format and stop. No screenshots, no scores, no saved visit.+- `chart`: steps 1 and 2, then write the chart as [reference/chart.md](reference/chart.md) describes and stop.++1. **Read the chart.** If `.unslopovich/chart.md` exists, read it: platforms, stack, top tasks, brand decisions, accepted exceptions. Do not re-flag anything it accepts. If it is missing, infer what you can from the code and offer `chart` at the end instead of blocking on it. See [reference/chart.md](reference/chart.md).+2. **Identify the stack and platforms.** Read the project config. Note whether the app ships on iOS, Android, or both, then read the matching guides: [reference/ios.md](reference/ios.md), [reference/android.md](reference/android.md), and for cross-platform stacks [reference/stacks.md](reference/stacks.md).+3. **Set the scope.** Use the screens the user named. If none, take the first-run path and the main screen a returning user sees. Name the one or two tasks people open those screens to do. Do not sweep the whole app unasked.+4. **Find the existing design decisions.** Read the theme, tokens, shared components, and any style guide. Respect a real brand: logo, brand color, typeface, design system. If a tell matches the real brand, the brand wins. Put it under Ask first.+5. **Look at the running app when you can.** Screenshot the scoped screens on a simulator, emulator, or device, in light and dark, and at the largest text size. If you cannot run it, say so, review from code, and mark hit areas and text scaling as estimated. Treat committed screenshots as possibly stale.+6. **Form your own read first.** Walk each top task as three people: a first-time user, a returning user in a hurry with one thumb, and a user with the largest text and a screen reader on. Note what slows each of them before you run the detector, so the rule list does not become the review.+7. **Run the detector.** `node <skill-dir>/scripts/detect.js <source dirs> --json`. It reads code, not screens, and catches patterns that are easy to skim past. Verify every hit in context before reporting it: a hit is evidence, not a finding. If Node is missing, skip it and say so under Not checked.+8. **Diagnose.** Check the tells in [reference/tells.md](reference/tells.md) and performance with [reference/performance.md](reference/performance.md), then score and write the report as [reference/report.md](reference/report.md) describes. Rank anything that blocks or slows a task above anything visual.+9. **Treat at the source.** For `treat` only. Read [reference/treatment.md](reference/treatment.md) before the first edit. Fix tokens and shared components first, then screens.+10. **Verify.** Build and re-check the changed screens in light, dark, the largest text size, and every screen size the app supports. Tap every changed control. Run the detector again on the changed files. State plainly what you could not check.+11. **Record the visit.** Save the report to `.unslopovich/visits/<YYYY-MM-DD-HHmm>-<scope>.md` unless the chart opts out. Mention the path in one line.++## The short list++The full catalog, with detector rule ids, is in [reference/tells.md](reference/tells.md). The ones that matter most:++- Frequently used controls moved, removed, or buried. A familiar gesture given a new meaning.+- Popups, promos, and AI features in the path of the core task.+- Numbers and labels that are not true: failed loads shown as empty, invented stats, "recent" that is not recent.+- Slow lists, slow typing, slow tab switches. You cannot see these in code, so say so.+- Website in a phone: hamburger menus, heroes, hover, centered modals, hand-built back buttons.+- Missing loading, empty, error, and offline states. "Oops! Something went wrong".+- The generated look, old and new: purple gradients and sparkles, and also the tasteful default of white cards, thin gray borders, one blue accent, an icon in a tinted square on every row, and a colored dot beside every label.++## Rules that do not bend++- Never move, remove, or redefine a frequently used control or gesture without asking.+- Never change business logic, data flow, or analytics.+- Never add a dependency, change the navigation structure, or change the visual identity without asking.+- Never call performance healthy without profiling. A static review says "not profiled".+- Never polish invented data. Mark it.+- Never trade one generic look for another. The after must look more like this product, not more like a template.diff --git a/bin/install.js b/bin/install.jsindex 0c23861..b432cbf 100755--- a/bin/install.js+++ b/bin/install.js@@ -4,10 +4,23 @@ const os = require("os");const path = require("path");const args = process.argv.slice(2);++if (args[0] === "detect") {+ process.exitCode = require("../scripts/detect.js").main(args.slice(1));+ return;+}++const usage = "Usage:\n npx unslopovich [--dir <skills folder>] install the skill\n npx unslopovich detect [paths...] scan mobile source for slop";++if (args.includes("--help") || args.includes("-h")) {+ console.log(usage);+ return;+}+const flag = args.indexOf("--dir");if (flag !== -1 && !args[flag + 1]) {- console.error("Usage: npx unslopovich [--dir <skills folder>]");+ console.error(usage);process.exit(1);}@@ -16,8 +29,13 @@ const base =? path.resolve(args[flag + 1].replace(/^~(?=$|\/)/, os.homedir())): path.join(os.homedir(), ".claude", "skills");const dest = path.join(base, "unslopovich");+const root = path.join(__dirname, "..");fs.mkdirSync(dest, { recursive: true });-fs.copyFileSync(path.join(__dirname, "..", "SKILL.md"), path.join(dest, "SKILL.md"));+fs.copyFileSync(path.join(root, "SKILL.md"), path.join(dest, "SKILL.md"));+for (const dir of ["reference", "scripts"]) {+ fs.rmSync(path.join(dest, dir), { recursive: true, force: true });+ fs.cpSync(path.join(root, dir), path.join(dest, dir), { recursive: true });+}console.log(`Dr. Unslopovich will see you now.\nInstalled to ${dest}\nNext, ask your agent: /unslopovich review my app`);diff --git a/docs/before-after.png b/docs/before-after.pngindex 127e2d9..40df7c5 100644Binary files a/docs/before-after.png and b/docs/before-after.png differdiff --git a/package.json b/package.jsonindex 8aa159c..bc5b38c 100644--- a/package.json+++ b/package.json@@ -11,6 +11,8 @@},"files": ["SKILL.md",+ "reference",+ "scripts","bin"],"keywords": [@@ -19,7 +21,18 @@"mobile","ui","ux",- "ai-slop"+ "ai-slop",+ "react-native",+ "flutter",+ "swiftui",+ "jetpack-compose",+ "linter"],- "license": "MIT"+ "license": "MIT",+ "scripts": {+ "test": "node --test"+ },+ "engines": {+ "node": ">=18"+ }}diff --git a/reference/android.md b/reference/android.mdnew file mode 100644index 0000000..7dd7c43--- /dev/null+++ b/reference/android.md@@ -0,0 +1,40 @@+# Android++For anything that ships to Android: Jetpack Compose, Android Views, and cross-platform stacks on phones, tablets, and foldables.++The question for every screen: would a long-time Android user trust this, or trip on an iPhone app wearing a Material costume?++## Structure++- Navigation bar for three to five top destinations on phones; navigation rail or a permanent drawer on wide windows. Do not stretch the phone layout across a tablet.+- System Back always works and predictive back previews where it lands. Intercept Back only to guard real data loss, with `OnBackPressedCallback` or `BackHandler`, never `onBackPressed`.+- Edge to edge with window insets: status bar, navigation bar, display cutout, and the IME (`WindowInsets.safeDrawing`, `Modifier.imePadding()`).+- Top app bar for screen context. One FAB, only when the screen has one clear primary action.++## Controls++- Material 3 components: filled, tonal, outlined, and text buttons; chips; switches; snackbars; bottom sheets; dialogs only for decisions that must interrupt.+- Snackbars for transient feedback, with an action when undo makes sense.+- Material Symbols for icons, one style throughout.+- No iOS-shaped switches, action sheets, or back chevrons on Android.++## Type and color++- The Material type scale (display, headline, title, body, label). Sizes in `sp` so text follows the user's font size.+- Color roles (`primary`, `onPrimary`, `surface`, `surfaceContainer`, `outline`, `error`), never raw hex in components.+- Dynamic color where it fits the brand, with a static fallback scheme.+- Dark theme designed, not inverted. Elevation through tonal surfaces.+- If `Color.kt` still holds `Purple40` and `Purple80` from the project template, the app has no color decisions yet.++## Motion and feedback++- Material motion: container transform, shared axis, fade through. Honor "Remove animations".+- Haptics through `HapticFeedbackConstants` or `LocalHapticFeedback`, for confirmations and long presses.++## Checking it++- Screenshot from an emulator or device: `adb exec-out screencap -p > <file>.png`. With several attached, add `-s <serial>`.+- Dark theme: `adb shell cmd uimode night yes`.+- Large text: `adb shell settings put system font_scale 2.0`. Read the old value first with `adb shell settings get system font_scale` and restore it afterward.+- Check a small phone, and a tablet or foldable if the app supports them.+- Emulators are fine for layout. Gestures, refresh rate, and performance need hardware. Say which you used.diff --git a/reference/chart.md b/reference/chart.mdnew file mode 100644index 0000000..4f36d61--- /dev/null+++ b/reference/chart.md@@ -0,0 +1,46 @@+# The chart++`.unslopovich/chart.md` is the project's standing context. Every command reads it. `chart` writes it.++## Writing it++1. Infer everything you can from the code: stack, platforms, navigation structure, theme files, brand color and typeface, existing design system, analytics and ad SDKs.+2. Ask only for what code cannot tell you, in one message, at most four questions:+ - What do people open this app to do? The top one to three tasks.+ - Who are they, and where are they when they use it? (Driving, cooking, at a desk, one-handed on a train.)+ - Which parts of the look are the brand and must stay?+ - Anything off limits: screens, controls, flows owned by another team.+3. Write the file in the format below. Keep it under a page.++When it already exists, show what changed in the code since it was written and update only those lines.++## Format++```markdown+# Chart++Stack: <framework and version>+Platforms: <iOS, Android, iPad, tablets, foldables, web>+Visits: on++## Top tasks+1. <task, and the screen it starts on>++## Users and context+<one or two lines>++## Brand+- Color: <hex and where it comes from>+- Type: <faces and where they are used>+- Keep: <brand decisions that win over a tell, e.g. "the gradient comes from the app icon">++## Accepted+- <tell or rule id>: <why it stays, who decided, date>++## Off limits+- <screen or control>: <why>+```++## Accepted exceptions++When the user decides a tell stays, add it under Accepted with the reason. For detector rules, also add the rule id to `ignoreRules` in `.unslopovich/config.json` if it applies project-wide, or an inline `unslopovich-ignore <rule-id>` comment if it applies to one line. Do not re-flag accepted items in later visits.diff --git a/reference/ios.md b/reference/ios.mdnew file mode 100644index 0000000..de7091b--- /dev/null+++ b/reference/ios.md@@ -0,0 +1,42 @@+# iOS and iPadOS++For anything that ships to Apple hardware: SwiftUI, UIKit, and cross-platform stacks on iPhone and iPad.++The question for every screen: would someone who has used an iPhone for ten years trust this, or stop at a control that is almost right?++## Structure++- Tab bar for two to five top-level sections. Tabs are places, never actions. No hamburger for the main destinations.+- Navigation stack for drilling in. Large titles on top-level screens, collapsing on scroll; inline titles deeper in.+- Sheets for short, self-contained tasks, with detents where a partial height makes sense. Full-screen covers for immersive flows only.+- Edge-swipe back always works. A custom back button must not cost the gesture.+- Safe areas respected: nothing tappable under the Dynamic Island, the home indicator, or the rounded corners.++## Controls++- System controls before custom ones: `Toggle`, `Picker`, segmented control, `Stepper`, `Menu`, context menus, swipe actions, confirmation dialogs.+- SF Symbols for icons, at the text style's weight and scale. Do not mix in a web icon set.+- Destructive actions use the destructive role and ask for confirmation only when the loss is real.+- Settings-shaped content goes in an inset grouped `List`, not a stack of cards.++## Type and color++- Dynamic Type through text styles (`.largeTitle` to `.caption2`). Custom fonts scale with `relativeTo:` or `UIFontMetrics`.+- SF Pro carries body, labels, and controls. A brand face is for display moments.+- Semantic colors (`label`, `secondaryLabel`, `systemBackground`, `separator`, the tint). Raw hex breaks in dark mode and increased contrast.+- One tint for interactive elements. It is not decoration.+- System materials behind bars and sheets. Content surfaces stay opaque.++## Motion and feedback++- System transitions: push, sheet, dismiss in reverse. Custom transitions that fight the navigation model disorient.+- Reduce Motion replaces slides and parallax with a crossfade.+- Haptics through `.sensoryFeedback` or `UIFeedbackGenerator`, for confirmations and selection changes, not every tap.++## Checking it++- Run on the Simulator: `xcrun simctl io booted screenshot <file>.png`. With several booted, use the device UDID from `xcrun simctl list devices booted`.+- Dark mode: `xcrun simctl ui booted appearance dark`.+- Largest text: `xcrun simctl ui booted content_size accessibility-extra-extra-extra-large`. Reset with `large` afterward.+- Check one small iPhone (SE size) and, if iPad is a target, one iPad in Split View.+- The Simulator is fine for layout. Gestures, haptics, and performance need a device. Say which you used.diff --git a/reference/performance.md b/reference/performance.mdnew file mode 100644index 0000000..6157e1d--- /dev/null+++ b/reference/performance.md@@ -0,0 +1,56 @@+# Performance++Lag, glitches, and crashes are the biggest complaint in low-rated app reviews, bigger than any visual problem. A design review cannot measure them. So this file does two things: it lists what you can catch in code, and it makes sure the report never implies a clean bill of health it did not earn.++## The rule++Performance is never scored from code alone. Every report carries a Performance line:++- `Not profiled.` plus the static leads you found, when you only read code. This is the default.+- `Profiled on <device or emulator>, <build type>, with <tool>:` plus the numbers, when you actually measured.++Simulators and debug builds are not evidence of speed. Say which one produced the number.++## What code can show++These are leads. Report them under Noticeable with "suspected", not as measured problems.++**Lists**+- Items mapped inside a plain scroll container instead of a virtualized list [`unvirtualized-list`]+- React Native `FlatList` without `keyExtractor`, with inline `renderItem` closures re-created every render, or with `getItemLayout` missing on fixed-height rows; FlashList without `estimatedItemSize` on older versions+- SwiftUI `List` or `ForEach` over a collection without stable identity (`id: \.self` on mutable values)+- Compose `LazyColumn` `items` without `key`, or unstable lambdas and collections causing recomposition of every row+- Flutter `ListView(children:)` with many children instead of `ListView.builder`++**The main thread**+- JSON parsing, sorting, filtering, or image processing in a render, `body`, composable, or `build` method+- Synchronous storage reads (`AsyncStorage` in a loop, `UserDefaults` of large blobs, `SharedPreferences` commit on the main thread)+- Network or database calls started from view construction instead of a task or effect++**Images**+- Full-size remote images shown as thumbnails with no resizing or caching library already in the project+- Large images bundled as PNG where the platform asset catalog or vector would do++**Startup**+- Every SDK initialized before the first frame+- Fonts, remote config, and analytics blocking the first screen++**Animation**+- JS-driven animations on React Native where the native driver or Reanimated is available+- Layout animations on every list row++## How to profile, per stack++Only when the user wants it and you can run the app. Use release or profile builds on a physical device where possible.++| Stack | Tool | What to read |+|---|---|---|+| SwiftUI, UIKit | Instruments: Time Profiler, Hangs, SwiftUI template | Hangs over 250 ms, view body counts, main-thread time during scroll |+| Compose, Android Views | Android Studio Profiler, Macrobenchmark, `adb shell dumpsys gfxinfo <package>` | Janky frames percentage, startup time, recomposition counts in Layout Inspector |+| React Native, Expo | Perf Monitor, React DevTools profiler, Flashlight on Android | JS and UI thread FPS while scrolling, commit durations |+| Flutter | DevTools Performance view in profile mode | Frame build and raster times over 16 ms, shader jank |+| Ionic, Capacitor | Safari Web Inspector or Chrome DevTools against the device WebView | Long tasks, layout shifts, scroll FPS |++## What to write++Under Noticeable, for each lead: the file and line, what is suspected, and the fix. Under Not checked, always: "Performance not profiled" unless you did. If the user asked about performance specifically and you could not profile, say so in the verdict line instead of burying it.diff --git a/reference/report.md b/reference/report.mdnew file mode 100644index 0000000..e96a800--- /dev/null+++ b/reference/report.md@@ -0,0 +1,81 @@+# The report++## Severity++- **Critical:** a user can't finish a task, gets wrong information, or can't read or reach a primary control.+- **Noticeable:** a task is slower or more confusing, or the screen clearly looks generated.+- **Minor:** polish that doesn't affect the task.+- **Ask first:** a fix that would change navigation, visual identity, monetization, or a frequently used control.++Keep Minor short. A long tail of polish buries the findings that matter. If there are more than eight, list the top eight and give a count for the rest.++## Scores++Score each dimension 0 to 4 from what you saw. A score needs a reason: the worst finding in that dimension, or what earned the 4.++| Dimension | Asks | 0 | 4 |+|---|---|---|---|+| Task path | Can people do what they came to do, fast, with controls where they expect them and nothing in the way? | Core task blocked or interrupted | Core task direct, thumb reachable, uninterrupted |+| Truth | Do labels, numbers, and states say what is true? | Errors shown as empty, invented data | Every number and state is real and labeled |+| Native fit | Navigation, gestures, controls, and safe areas as the platform expects | A website in a phone | A fluent user trusts every screen |+| States and input | Loading, empty, error, offline, pressed, keyboard | Happy path only | Every state designed and reachable |+| Access | Targets, contrast, text scaling, screen reader labels and order | Unusable with a screen reader or large text | Labeled, ordered, scales cleanly |+| Specificity | Does it look like this product, not a template, old or new? | Could be any app; generated tells throughout | Built from this product's content and voice |++Total out of 24:++- **21 to 24: Discharged.** Minor polish.+- **16 to 20: Outpatient.** Address the weak dimensions.+- **11 to 15: Admitted.** Significant work.+- **0 to 10: Intensive care.** Start with Critical and Task path.++Performance is not scored. It gets its own line (see [performance.md](performance.md)).++When you reviewed from code only, mark Native fit, States and input, and Access as estimated with a `~` before the score.++## Format++```text+Dr. Unslopovich's diagnosis+Verdict: <one dry sentence>+Stack: <stack and platforms>+Reviewed: <screens, top tasks, and whether from a running app or code only>+Score: <total>/24 <band> Task path <n> · Truth <n> · Native fit <n> · States <n> · Access <n> · Specificity <n>+Performance: <"Not profiled." and the static leads, or what was profiled, how, and the numbers>++Critical+- <file:line> <what is wrong and who it hurts> -> <specific fix>++Noticeable+- <file:line> <what is wrong> -> <specific fix>++Minor+- <file:line> <what is wrong> -> <specific fix>++Ask first+- <file:line> <what is wrong> -> <proposed fix and what it would change for users>++Worth keeping+- <what already works and should survive the treatment>++Not checked+- <anything you could not verify, always including performance unless profiled>+```++Leave out empty sections, except Not checked.++## The verdict line++One sentence, dry, specific to this app. It names the worst thing, not the funniest. It is never cruel about the person and never about AI use; the patient is the screen.++Good: "The order button moved, the list stutters, and the dashboard reports numbers no one measured."++Bad: "Classic AI slop." It is generic, which is the thing we are treating.++## After a treatment++List what changed by screen. Capture before and after screenshots of the same screen, same data, same device, same appearance, when you can. Then run the self-check in [treatment.md](treatment.md) and give the new score.++## Saving the visit++Write the report to `.unslopovich/visits/<YYYY-MM-DD-HHmm>-<scope>.md`, with the local time in 24-hour form and the scope as a short slug of the screens ("home", "checkout-flow"). If that file already exists, add `-2`, `-3`, and so on before `.md`; never overwrite a visit. File names sort by time, so `follow-up` reads the last file for the same scope in name order and adds a line per dimension: `Task path 2 -> 3`. Skip saving if `.unslopovich/chart.md` says `visits: off`.diff --git a/reference/stacks.md b/reference/stacks.mdnew file mode 100644index 0000000..660dbc6--- /dev/null+++ b/reference/stacks.md@@ -0,0 +1,38 @@+# Stacks++Native building blocks per stack. Prefer these to custom replacements. A cross-platform app still owes each platform its own guarantees: read [ios.md](ios.md) and [android.md](android.md) for the ones it ships to.++| Stack | Navigation | Lists and refresh | Sheets | Polish |+|---|---|---|---|---|+| SwiftUI | `NavigationStack`, `TabView` | `List`, `.swipeActions`, `.refreshable` | `.sheet` with `.presentationDetents` | SF Symbols, `.font(.body)` styles, `ContentUnavailableView`, `.sensoryFeedback` |+| UIKit | `UINavigationController`, `UITabBarController` | `UICollectionView` lists, `UIRefreshControl` | `UISheetPresentationController` | SF Symbols, `preferredFont(forTextStyle:)`, `UIContentUnavailableConfiguration` |+| Jetpack Compose | `Scaffold`, `TopAppBar`, `NavigationBar`, `NavigationSuiteScaffold` | `LazyColumn` with `key`, `PullToRefreshBox` | `ModalBottomSheet` | `MaterialTheme.typography`, `WindowInsets.safeDrawing`, `Modifier.imePadding()` |+| React Native, Expo | Native stack, native tabs where available | `FlatList` or FlashList, `RefreshControl` | Native modal presentation (`presentation: 'formSheet'`) or a sheet library already in the project | `Pressable`, `react-native-safe-area-context`, `KeyboardAvoidingView`, `expo-haptics` |+| Flutter | `NavigationBar`, `CupertinoTabBar`, platform page routes | `ListView.builder`, `RefreshIndicator`, `CupertinoSliverRefreshControl` | `showModalBottomSheet` | `Theme.of(context).textTheme`, `SafeArea`, `.adaptive` constructors, `HapticFeedback` |+| Angular Native | Its native stack and tabs | Its virtualized native list | Its native modal presentation | It renders on React Native's Fabric, so apply the React Native row through the project's Angular components |+| NativeScript Angular | `page-router-outlet`, `ActionBar`, `TabView` | `ListView` | `ModalDialogService` | `iosOverflowSafeArea`, platform text styles, no web-style hover |+| Ionic, Capacitor | `ion-tabs`, `ion-nav` or the framework router, `ion-header` | `ion-list`, `ion-refresher`, virtual scrolling for long lists | `ion-modal` with breakpoints | Platform `mode`, `env(safe-area-inset-*)`, `@capacitor/haptics`, no hover-only behavior |++## Stack-specific tells++**React Native and Expo**+- `TouchableOpacity` everywhere with the default fade and no other pressed state; prefer `Pressable` with a real pressed style.+- `Alert.alert` used for every error, success, and confirmation.+- One shared `SafeAreaView` at the root that leaves headers or tab bars double-padded or under the notch.+- A JS tab bar or stack that recreates native ones and loses the native feel.+- Expo template leftovers: the default tint, the `ParallaxScrollView` and `HelloWave` from the starter screens, `ThemedText` with no real type scale behind it.++**Flutter**+- Material widgets on iOS where `.adaptive` constructors or Cupertino equivalents exist.+- `Colors.deepPurple` still the seed color from `flutter create`.+- `WillPopScope`, which is deprecated and breaks predictive back; use `PopScope`.+- Fixed `TextScaler` or clamped scaling to stop overflow instead of fixing the layout.++**Ionic and Capacitor**+- `mode="md"` forced on iOS, or `mode="ios"` forced on Android, without a brand reason.+- Desktop CSS: hover states, wide max-widths, multi-column grids on a phone.+- Missing `viewport-fit=cover` and safe-area insets, so headers sit under the notch.++**Compose and SwiftUI**+- Previews full of invented data that ships as the real empty state.+- A `Card` or rounded `RoundedRectangle` background on every row instead of a list.diff --git a/reference/tells.md b/reference/tells.mdnew file mode 100644index 0000000..a6da8bd--- /dev/null+++ b/reference/tells.md@@ -0,0 +1,115 @@+# The tells++Each tell names what to look for. Where the detector can see it in code, its rule id is in brackets. A tell without an id needs eyes on the running app or judgment about the product.++Check in this order. The order follows what users complain about, not what is easy to spot.++## 1. User friction++Users complain about these far more than about how an app looks.++- Frequently used controls moved, removed, or buried in settings+- A familiar gesture given a new meaning+- Core tasks taking extra steps or hidden several screens deep+- AI features intercepting a core task, or taking the best spot on screen with no way to dismiss them. The sparkle button in the toolbar where search used to be. [`sparkle-icon`]+- Ads, promos, rating prompts, and popups that interrupt a task+- Upsell or destructive icons placed next to a common tap target+- Common actions out of thumb reach+- Controls that look right but do nothing, respond late, or trigger the wrong item+- Key actions clipped, overlapped, or unreachable on some screen sizes+- Read, unread, selected, or active states that are hard to tell apart, especially in dark mode+- Layouts that lose most of the screen to padding or chrome++## 2. Truthfulness++The app says something that is not so.++- Failed loads shown as empty states ("No orders yet" when the request failed)+- Totals computed from one page of results+- "Recent" lists that are not recent, "live" data that is cached+- Buttons that go somewhere other than their label says+- Stat tiles with invented or placeholder numbers [`invented-stat`]. Real data in a tile is not a tell.+- Trust or privacy claims the code contradicts, such as "no tracking" beside an ad SDK+- Wrong or approximate logos++## 3. Website in a phone++- Hamburger menu in place of tabs for the few top destinations [`drawer-nav`]+- Marketing hero, feature grid, or footer inside the app+- Breadcrumbs, wide tables, or hover-dependent controls [`hover-only`]+- Hand-built back buttons or navigation bars that lose native gestures [`back-gesture`]. Judge custom tab bars on hierarchy, labels, and pressed states, not on being custom.+- Centered modals for tasks that belong in a sheet or a pushed screen+- Tiny text links as the main way to act+- Long forms on one screen with no sensible field order or input types++## 4. Interaction and states++- No pressed state on tappable things+- Only the happy path: missing loading, empty, error, and offline states+- A spinner for everything, including content whose shape is known+- Keyboard covers the focused input [`keyboard-cover`], wrong keyboard type, no submit action on the keyboard, no easy way to dismiss it+- Content under the notch, home indicator, or system bars [`safe-area-off`]+- Swipe back or predictive back broken [`back-gesture`]+- Long lists without pull to refresh where freshness matters, or without virtualization [`unvirtualized-list`]+- Every element fading and sliding in on mount, or animation that blocks input+- Haptics on everything, or none on moments that deserve confirmation+- Fixed heights or fixed text sizes that clip when the user enlarges text [`fixed-text-size`]++## 5. Looks generated: the old default++The 2023 look. Easy to spot, and most models have learned to avoid it unless told otherwise.++- Purple, indigo, or blue-to-pink gradients on heroes, buttons, or backgrounds [`slop-gradient`]+- The project template's color left as the theme: Flutter's `Colors.deepPurple` seed, Android Studio's `Purple40` [`template-theme`]+- Gradient text [`gradient-text`], glow shadows [`glow-shadow`], decorative blobs, glass on everything [`glass-everywhere`]+- Sparkle icons [`sparkle-icon`], or emoji standing in for icons [`emoji-icon`]+- Cards inside cards [`nested-cards`]+- Pill badges on things that are not statuses+- "Unlock your potential" copy (see Copy below)++## 6. Looks generated: the new default++The look that replaced the purple one. It reads as tasteful and calm, and it is just as generic. A fix that lands here has swapped one template for another. Check every after screenshot against this list.++- Everything on white or off-white, every group in a rounded card with a 1px gray border and a soft shadow, one radius everywhere+- One blue or black accent, with nothing else in the palette carrying meaning+- An icon in a tinted rounded square at the start of every row+- A small colored dot beside labels that carries no status the user acts on [`status-dot`]. A dot that marks unread or online, has a text or shape backup, and is consistent across the app is a status, not a tell.+- Section headers like "Overview", "Quick actions", "Recent activity", in small gray caps or with letter spacing+- Large empty margins presented as calm, so the content a user came for gets less of the screen than the chrome+- Gray secondary text under every title, repeating it in other words+- A stat row of three numbers at the top of every main screen+- One font size and weight doing every job, or a web font replacing good system type for no brand reason+- Identical spacing everywhere, so nothing is grouped+- Centered text where a left-aligned list would read faster+- Low-contrast gray text on tinted backgrounds+- Filler captions, annotations, and callouts that add nothing+- Duplicate buttons doing the same job++The test for this section: cover the logo and the app name. Could this screen belong to a banking app, a fitness app, and a to-do app equally well? Then it is the default, however clean it looks.++## 7. Copy++- "Unlock your potential", "seamless", "effortless", "supercharge", "all in one place" [`buzzword-copy`]+- "Welcome back!" taking the best space on the screen [`welcome-back`]+- "Oops! Something went wrong" with no cause and no next step [`oops-error`]+- Subtitles that repeat the title+- Exclamation marks as personality+- Vague buttons such as "Submit" where a verb would say what happens [`vague-button`]++## 8. Performance++You can only suspect these from code. See [performance.md](performance.md).++- Lists that render every row up front [`unvirtualized-list`]+- Heavy work on launch, on the main thread, or in a scroll or typing path+- Full-size images decoded for thumbnails+- Lag while scrolling, typing, or switching tabs: needs profiling on a real device++## Using the detector++`node <skill-dir>/scripts/detect.js <dirs> --json` runs every rule. `--list-rules` prints each rule with its fix. Rules fire on patterns, so:++- A hit is a lead. Open the file and confirm it is real in this product before you report it.+- No hit means nothing. Most of sections 1, 2, and 6 cannot be seen in code at all.+- Silence a confirmed false positive with `// unslopovich-ignore <rule-id>` on that line or the line above. In XML and HTML files, where `//` is not a comment, use `<!-- unslopovich-ignore <rule-id> -->` instead. Or list the rule under `ignoreRules` in `.unslopovich/config.json` when the chart accepts it project-wide.diff --git a/reference/treatment.md b/reference/treatment.mdnew file mode 100644index 0000000..1427ba4--- /dev/null+++ b/reference/treatment.md@@ -0,0 +1,62 @@+# Treatment++Read this before the first edit. The diagnosis says what is wrong. This says how to fix it without making a different mess.++## Order of work++1. Tokens: color roles, type scale, spacing scale, radius, elevation.+2. Shared components: buttons, list rows, cards, headers, empty and error states.+3. Screens, in the order of the findings: Critical, then Noticeable, then Minor.+4. Ask first items only after the user answers.++## Rules of the fix++- Remove before adding. Most screens improve by losing containers, colors, captions, and copy.+- Keep frequently used controls and gestures where users expect them. Ask before moving, removing, or redefining one.+- Keep business logic, data flow, and analytics unchanged.+- Ask before changing the navigation structure or the product's visual identity.+- Ask before adding a dependency. Use what the platform and the project already have.+- Mark invented data and placeholder content instead of polishing it.+- Keep the diff to the agreed screens and the shared code they need.+- Use the platform's native building blocks (see [ios.md](ios.md), [android.md](android.md), [stacks.md](stacks.md)) before custom ones.++## Do not swap one default for another++The most common failed treatment takes a purple, sparkly screen and returns a white screen with gray-bordered cards, one blue accent, an icon in a tinted square on each row, and a lot of empty space. It is cleaner. It is also the default look of every model, and people recognize it at a glance. Read section 6 of [tells.md](tells.md) before you design anything.++A treated screen gets its character from the product, not from a style:++- **Content first.** The thing the user came for, their orders, their zones, their messages, gets the most space and the strongest type. Chrome, greetings, and section labels get less. If the after shows less real content than the before, look again.+- **The product's own nouns.** Headers name what is there ("Kitchen lights", "Due this week"), not a dashboard category ("Overview", "Quick actions").+- **Color with a job.** Keep the brand color. Give color to state and meaning (selected, overdue, offline, destructive), not to decoration. If the app has no brand color, ask before inventing one.+- **Hierarchy from type and space first.** Size, weight, and grouping before containers, borders, and tints. A list is usually better than a stack of cards.+- **Native over bespoke.** A system list, a system sheet, a system tab bar, styled with the brand's type and color, beats a hand-built imitation of any of them.+- **Density that fits the use.** A tool used many times a day can be dense. Generous whitespace is a choice for a reason, not a default.++## The floor++Every changed screen meets these before you call it done.++- Touch targets at least 44pt on iOS and 48dp on Android, including padding and expanded hit areas such as `hitSlop`.+- Contrast 4.5:1 for body text, 3:1 for large text and meaningful icons, in light and dark.+- Platform text styles or a named scale. Text follows the user's size setting and nothing clips at the largest size.+- Content and controls clear of the notch, Dynamic Island, home indicator, status bar, and keyboard. Backgrounds may run edge to edge.+- One primary action per screen, within thumb reach.+- Spacing from a small scale. Related items closer than unrelated ones.+- Semantic color roles: background, surface, text, secondary text, accent, destructive. Dark mode is a real palette, not an inversion.+- Tabs for three to five peer destinations, push for drilling in, sheets for short side tasks.+- Icon-only controls labeled for screen readers. Logical focus order. Reduce Motion honored. Color never the only signal.+- Pressed, disabled, loading, empty, error, and offline states for everything you touched.+- On apps that ship to both platforms, each platform's patterns. Share the brand, not every control.++## Self-check before you hand it back++Answer each in one line in the treatment summary.++1. **Cover the logo.** Could the after screen belong to an unrelated app? If yes, it is not done.+2. **Count the containers.** Did the number of cards, borders, and tinted backgrounds go down?+3. **Count the colors.** Does every color on screen carry meaning?+4. **Find the dots.** Every small colored dot, badge, and pill: what status does it show, and would a color-blind user get it?+5. **Find the task.** Is the top task's control in the same place or better, and reachable with one thumb?+6. **Run the detector** on the changed files. Explain any hit you kept.+7. **Say what you did not check**, performance included.diff --git a/scripts/detect.js b/scripts/detect.jsnew file mode 100644index 0000000..60ea157--- /dev/null+++ b/scripts/detect.js@@ -0,0 +1,830 @@+#!/usr/bin/env node+"use strict";++// Dr. Unslopovich's static detector. Reads mobile source (SwiftUI, UIKit,+// Jetpack Compose, Android XML, React Native, Expo, Flutter, Ionic) and flags+// patterns that make an app look generated or behave like a website.+// No dependencies, no network, no model. It reads code; it never runs the app.++const fs = require("fs");+const path = require("path");++const VERSION = 1;++const STACK_BY_EXT = {+ ".swift": "swift",+ ".kt": "kotlin",+ ".kts": "kotlin",+ ".dart": "dart",+ ".tsx": "js",+ ".jsx": "js",+ ".ts": "js",+ ".js": "js",+ ".mjs": "js",+ ".vue": "web",+ ".html": "web",+ ".xml": "xml",+ ".css": "css",+ ".scss": "css",+};++const SKIP_DIRS = new Set([+ "node_modules", ".git", "Pods", "build", "dist", ".expo", ".dart_tool",+ "DerivedData", ".gradle", ".idea", ".vscode", "coverage", "vendor", ".next",+ "www", ".unslopovich", "Carthage", ".build", "generated", "__generated__",+]);++const TEST_FILE = /(^|[./_-])(test|tests|spec|stories|story|preview|previews|fixture|fixtures|mock|mocks)\.[a-z]+$|Tests?\.(swift|kt)$|_test\.dart$|PreviewParameterProvider\.kt$|Previews?\.(swift|kt)$/i;+const TEST_DIR = /^(?:__tests__|__mocks__|__fixtures__|test|tests|testing|fixtures|mocks|androidTest|testDebug|UITests|e2e)$/;++const SEVERITY_RANK = { critical: 0, noticeable: 1, minor: 2 };++// ---------- helpers ----------++function hexToHsl(hex) {+ const n = parseInt(hex, 16);+ const r = ((n >> 16) & 255) / 255;+ const g = ((n >> 8) & 255) / 255;+ const b = (n & 255) / 255;+ const max = Math.max(r, g, b);+ const min = Math.min(r, g, b);+ const l = (max + min) / 2;+ if (max === min) return { h: 0, s: 0, l };+ const d = max - min;+ const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);+ let h;+ if (max === r) h = ((g - b) / d + (g < b ? 6 : 0)) * 60;+ else if (max === g) h = ((b - r) / d + 2) * 60;+ else h = ((r - g) / d + 4) * 60;+ return { h, s, l };+}++// Six-digit hex colors in a snippet: #RRGGBB, 0xFFRRGGBB, Color(0xRRGGBB).+function hexColors(snippet) {+ const out = [];+ const re = /#([0-9a-fA-F]{6})\b|0x[fF]{2}([0-9a-fA-F]{6})\b/g;+ let m;+ while ((m = re.exec(snippet))) out.push((m[1] || m[2]).toUpperCase());+ return out;+}++// The purple, indigo, violet and hot-pink band that default AI palettes live in.+function isSlopHue(hex) {+ const { h, s, l } = hexToHsl(hex);+ return s >= 0.4 && l >= 0.2 && l <= 0.85 && h >= 235 && h <= 340;+}++function isSaturated(hex) {+ const { s, l } = hexToHsl(hex);+ return s >= 0.35 && l >= 0.15 && l <= 0.9;+}++const SLOP_COLOR_NAME = /(?:\.|Colors\.|Color\.|\b)(purple|deepPurple|indigo|violet|pink|magenta|fuchsia)\b/i;++// Replace comments with spaces, keeping offsets and newlines, so rules never+// match commented-out code. Strings are kept.+function blankComments(text, stack) {+ const out = text.split("");+ const blank = (from, to) => {+ for (let i = from; i < to; i++) if (out[i] !== "\n") out[i] = " ";+ };+ if (stack === "xml" || stack === "web") {+ const re = /<!--[\s\S]*?-->/g;+ let m;+ while ((m = re.exec(text))) blank(m.index, m.index + m[0].length);+ if (stack === "xml") return out.join("");+ }+ let i = 0;+ let quote = null;+ while (i < text.length) {+ const c = text[i];+ const next = text[i + 1];+ if (quote) {+ if (c === "\\") { i += 2; continue; }+ if (c === quote || (c === "\n" && quote !== "`")) quote = null;+ i++;+ continue;+ }+ if (c === "/" && next === "/") {+ // Skip URLs such as https:// outside quotes.+ if (text[i - 1] === ":") { i++; continue; }+ const end = text.indexOf("\n", i);+ const stop = end === -1 ? text.length : end;+ blank(i, stop);+ i = stop;+ continue;+ }+ if (c === "/" && next === "*") {+ const end = text.indexOf("*/", i + 2);+ const stop = end === -1 ? text.length : end + 2;+ blank(i, stop);+ i = stop;+ continue;+ }+ if (c === "/" && stack === "js" && isRegexStart(text, i)) {+ i = skipRegex(text, i);+ continue;+ }+ if (c === '"' || c === "`" || (c === "'" && stack !== "swift")) {+ // An apostrophe between letters is prose (JSX text such as Don't), not a string.+ if (c === "'" && /[A-Za-z]/.test(text[i - 1] || "") && /[A-Za-z]/.test(next || "")) { i++; continue; }+ quote = c;+ }+ i++;+ }+ return out.join("");+}++// A slash starts a regex literal when it follows an operator, an opening+// bracket, a keyword such as return, or the start of the text.+function isRegexStart(text, i) {+ let j = i - 1;+ while (j >= 0 && (text[j] === " " || text[j] === "\t")) j--;+ if (j < 0 || text[j] === "\n") return true;+ // Not after <, > or }: those are JSX closing tags and text such as {a}/{b}.+ if ("(,=:[!&|?{;+-*%~^".includes(text[j])) return true;+ return /\b(?:return|typeof|case|do|else|in|of|void|yield|await)$/.test(text.slice(Math.max(0, j - 6), j + 1));+}++// Index just past a regex literal starting at i (flags included). Stops at+// the end of the line if the literal is not closed.+function skipRegex(text, i) {+ let inClass = false;+ for (let k = i + 1; k < text.length; k++) {+ const c = text[k];+ if (c === "\n") return k;+ if (c === "\\") { k++; continue; }+ if (c === "[") inClass = true;+ else if (c === "]") inClass = false;+ else if (c === "/" && !inClass) {+ k++;+ while (k < text.length && /[a-z]/i.test(text[k])) k++;+ return k;+ }+ }+ return text.length;+}++function lineStarts(text) {+ const starts = [0];+ for (let i = 0; i < text.length; i++) if (text[i] === "\n") starts.push(i + 1);+ return starts;+}++function lineAt(starts, index) {+ let lo = 0;+ let hi = starts.length - 1;+ while (lo < hi) {+ const mid = (lo + hi + 1) >> 1;+ if (starts[mid] <= index) lo = mid;+ else hi = mid - 1;+ }+ return lo + 1;+}++function* matches(re, text) {+ const g = new RegExp(re.source, re.flags.includes("g") ? re.flags : re.flags + "g");+ let m;+ while ((m = g.exec(text))) {+ yield m;+ if (m[0] === "") g.lastIndex++;+ }+}++// Index just past the bracket that closes the one at `open`.+function closeOf(text, open) {+ const pairs = { "(": ")", "{": "}", "[": "]" };+ const opener = text[open];+ const closer = pairs[opener];+ let depth = 0;+ for (let i = open; i < text.length; i++) {+ if (text[i] === opener) depth++;+ else if (text[i] === closer) {+ depth--;+ if (depth === 0) return i + 1;+ }+ }+ return text.length;+}++// ---------- rules ----------+// Each rule gets ctx { code, stack, file } and returns indexes into code.++const rules = [+ {+ id: "slop-gradient",+ family: "looks-generated",+ severity: "noticeable",+ stacks: null,+ message: "Purple, indigo, or pink gradient: the default AI palette.",+ fix: "Use a flat surface from the theme. Keep a gradient only if it comes from the brand (logo, icon) and record that in .unslopovich/decisions.md.",+ find({ code, file }) {+ if (/icon|logo|brand/i.test(path.basename(file))) return [];+ const hits = [];+ for (const m of matches(/(?<!<\/)(?:LinearGradient|linearGradient|RadialGradient|radialGradient|AngularGradient|Brush\.(?:linear|radial|horizontal|vertical|sweep)Gradient|linear-gradient|radial-gradient|GradientDrawable|<gradient\b)/, code)) {+ const lineStart = code.lastIndexOf("\n", m.index) + 1;+ if (/^\s*(?:import|export\s+\{|from)\b/.test(code.slice(lineStart, m.index))) continue;+ const snippet = code.slice(m.index, m.index + 400);+ if (hexColors(snippet).some(isSlopHue) || SLOP_COLOR_NAME.test(snippet.slice(0, 250))) hits.push(m.index);+ }+ return hits;+ },+ },+ {+ id: "gradient-text",+ family: "looks-generated",+ severity: "noticeable",+ stacks: null,+ message: "Gradient-filled text.",+ fix: "Emphasize with weight or size from the type scale, in a solid theme color.",+ find({ code }) {+ const re = /<MaskedView|\bShaderMask\s*\(|\.foregroundStyle\(\s*(?:LinearGradient|\.linearGradient)|\.foregroundStyle\([^)]*Gradient|brush\s*=\s*Brush\.\w+Gradient|background-clip:\s*text|-webkit-background-clip:\s*text/;+ return [...matches(re, code)].map((m) => m.index);+ },+ },+ {+ id: "template-theme",+ family: "looks-generated",+ severity: "noticeable",+ stacks: null,+ message: "The project template's default color is still the theme.",+ fix: "Pick the brand's own accent and define semantic roles (background, surface, text, accent, destructive). Ask first if that purple has become the brand.",+ find({ code }) {+ const re = /seedColor:\s*Colors\.deepPurple|0x[fF]{2}(?:6650[aA]4|[dD]0[bB][cC][fF][fF]|6200[eE][eE]|3700[bB]3|[bB][bB]86[fF][cC])\b|#(?:6200[eE][eE]|3700[bB]3|[bB][bB]86[fF][cC])\b/;+ return [...matches(re, code)].map((m) => m.index);+ },+ },+ {+ id: "glow-shadow",+ family: "looks-generated",+ severity: "minor",+ stacks: null,+ message: "Colored glow shadow.",+ fix: "Shadows carry depth, not color: use the platform elevation or a soft neutral shadow, or remove it.",+ find({ code }) {+ const hits = [];+ for (const m of matches(/\.shadow\(\s*color:\s*([^,)]+)|shadowColor\s*[:=]\s*([^,;\n}]+)|(?:ambientColor|spotColor)\s*=\s*([^,)\n]+)|BoxShadow\(\s*color:\s*([^,)\n]+)|box-shadow:\s*([^;\n]+)/, code)) {+ const value = m.slice(1).find(Boolean) || "";+ if (/black|gray|grey|shadow|\.primary\b|label|0x[0-9a-f]{2}000000|#000|rgba?\(\s*0\s*,\s*0\s*,\s*0/i.test(value)) continue;+ const named = /(?:\.|Colors\.|Color\.|\b)(purple|deepPurple|indigo|violet|pink|magenta|fuchsia|blue|cyan|teal|mint|accentColor|accent)\b/i.test(value);+ const hex = hexColors(value).some(isSaturated);+ const rgb = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/.exec(value);+ const rgbSat = rgb && Math.max(+rgb[1], +rgb[2], +rgb[3]) - Math.min(+rgb[1], +rgb[2], +rgb[3]) > 60;+ if (named || hex || rgbSat) hits.push(m.index);+ }+ return hits;+ },+ },+ {+ id: "status-dot",+ family: "looks-generated",+ severity: "minor",+ stacks: null,+ message: "Small colored dot. Decorative dots next to labels are a common generated tell.",+ fix: "Keep it only if it shows a real status the user acts on, with a text label or shape, never color alone. Otherwise delete it.",+ find({ code, stack }) {+ const hits = [];+ const small = (n) => n >= 3 && n <= 12;+ if (stack === "js" || stack === "web") {+ for (const m of matches(/\bwidth:\s*(\d{1,2})\b/, code)) {+ const n = +m[1];+ if (!small(n)) continue;+ const around = code.slice(Math.max(0, m.index - 120), m.index + 160);+ const radius = /borderRadius:\s*(\d+)/.exec(around);+ if (new RegExp(`height:\\s*${n}\\b`).test(around) && radius && +radius[1] >= n / 2) hits.push(m.index);+ }+ for (const m of matches(/["'`][^"'`\n]*\b(?:[wh]|size)-(?:1|1\.5|2|2\.5|3)\b[^"'`\n]*["'`]/, code)) {+ if (/\brounded-full\b/.test(m[0]) && /\b(?:size-|w-(?:1|1\.5|2|2\.5|3)\b[^"'`]*\bh-|h-(?:1|1\.5|2|2\.5|3)\b[^"'`]*\bw-)/.test(m[0])) hits.push(m.index);+ }+ }+ if (stack === "swift") {+ for (const m of matches(/\bCircle\(\)/, code)) {+ const f = /^[\s\S]{0,200}?\.frame\(\s*width:\s*(\d+(?:\.\d+)?)\s*,\s*height:\s*(\d+(?:\.\d+)?)/.exec(code.slice(m.index, m.index + 260));+ if (f && small(+f[1]) && +f[1] === +f[2]) hits.push(m.index);+ }+ }+ if (stack === "kotlin") {+ for (const m of matches(/\.size\(\s*(\d+)\.dp\s*\)/, code)) {+ const around = code.slice(Math.max(0, m.index - 160), m.index + 160);+ if (small(+m[1]) && /CircleShape/.test(around)) hits.push(m.index);+ }+ }+ if (stack === "dart") {+ for (const m of matches(/BoxShape\.circle/, code)) {+ const around = code.slice(Math.max(0, m.index - 220), m.index + 120);+ const w = /width:\s*(\d+(?:\.\d+)?)/.exec(around);+ if (w && small(+w[1])) hits.push(m.index);+ }+ }+ return hits;+ },+ },+ {+ id: "nested-cards",+ family: "looks-generated",+ severity: "noticeable",+ stacks: ["js", "kotlin", "dart", "web"],+ message: "A card inside a card.",+ fix: "Keep one container level. Group inner content with spacing, a divider, or a list section instead.",+ find({ code, stack }) {+ const hits = [];+ if (stack === "js" || stack === "web") {+ for (const m of matches(/<(Card|ion-card)\b[^>]*?(\/?)>/, code)) {+ if (m[2] === "/") continue;+ const tag = m[1];+ const close = code.indexOf(`</${tag}>`, m.index);+ if (close === -1) continue;+ const inner = code.slice(m.index + m[0].length, close);+ if (new RegExp(`<${tag}\\b`).test(inner)) hits.push(m.index);+ }+ } else {+ const card = /\b(?:Elevated|Outlined|Filled)?Card\s*[({]/;+ for (const m of matches(card, code)) {+ const open = m.index + m[0].length - 1;+ let end = closeOf(code, open);+ const lambda = /^\s*\{/.exec(code.slice(end));+ if (code[open] === "(" && lambda) end = closeOf(code, end + lambda[0].length - 1);+ if (card.test(code.slice(open + 1, end - 1))) hits.push(m.index);+ }+ }+ return hits;+ },+ },+ {+ id: "glass-everywhere",+ family: "looks-generated",+ severity: "minor",+ stacks: null,+ message: "Blur and glass used on several surfaces in one file.",+ fix: "Keep system materials behind bars and sheets. Make content surfaces opaque.",+ find({ code }) {+ const all = [...matches(/\.(?:ultraThin|thin|regular|thick|ultraThick)Material\b|<BlurView\b|backdrop-filter|BackdropFilter\(|ImageFilter\.blur|\.glassEffect\(/, code)];+ return all.length >= 3 ? [all[0].index] : [];+ },+ },+ {+ id: "sparkle-icon",+ family: "looks-generated",+ severity: "minor",+ stacks: null,+ message: "Sparkle icon. It usually marks an AI feature or stands in for meaning.",+ fix: "Use an icon that names the action, or a text label. If it marks an AI feature, make sure that feature is not in the way of the core task.",+ find({ code }) {+ const re = /["']sparkles?["']|["']wand\.and\.stars|\bauto_awesome\b|\bAutoAwesome\b|\bSparkles\b|\bSparklesIcon\b|✨/;+ return [...matches(re, code)].map((m) => m.index);+ },+ },+ {+ id: "emoji-icon",+ family: "looks-generated",+ severity: "minor",+ stacks: ["swift", "kotlin", "dart", "js", "web", "xml"],+ message: "Emoji in interface text, often standing in for an icon.",+ fix: "Use the platform icon set (SF Symbols, Material Symbols) with an accessibility label, or drop it.",+ find({ code }) {+ // Only emoji sitting beside a word, as in "🚀 Fast" or "Video 📺". Emoji+ // pickers, reactions and user content are left alone.+ const re = /(?<!\p{L})(\p{Emoji_Presentation}|\p{Extended_Pictographic}️)[ ]?\p{L}{2,}|\p{L}{2,}[ ]?(\p{Emoji_Presentation}|\p{Extended_Pictographic}️)/u;+ const hits = [];+ for (const m of matches(re, code)) {+ if ((m[1] || m[2]) === "✨") continue; // reported by sparkle-icon+ hits.push(m.index);+ }+ return hits;+ },+ },+ {+ id: "unvirtualized-list",+ family: "performance",+ severity: "noticeable",+ stacks: ["js", "swift", "kotlin", "dart"],+ message: "A list built by mapping items inside a plain scroll container. Every row renders up front.",+ fix: "Use the virtualized list: FlatList or FlashList, List or LazyVStack, LazyColumn, ListView.builder. Then profile scrolling on a real device.",+ find({ code, stack }) {+ const hits = [];+ if (stack === "js") {+ for (const m of matches(/(?<![\w.])<(?:Animated\.)?ScrollView\b/, code)) {+ const end = code.slice(m.index).search(/<\/(?:Animated\.)?ScrollView>/);+ if (end === -1) continue;+ const body = code.slice(m.index, m.index + end);+ // Horizontal scrollers are usually short chip rows and carousels.+ const props = body.slice(0, body.indexOf(">") + 1);+ if (/\bhorizontal\b(?!\s*=\s*\{\s*false\s*\})/.test(props)) continue;+ if (/\.map\(/.test(body)) hits.push(m.index);+ }+ }+ if (stack === "swift") {+ for (const m of matches(/\bScrollView\b[^{\n]*\{\s*VStack\b/, code)) {+ const open = code.indexOf("{", m.index);+ if (/\bForEach\b/.test(code.slice(open, closeOf(code, open)))) hits.push(m.index);+ }+ }+ if (stack === "kotlin") {+ for (const m of matches(/\bColumn\s*\(/, code)) {+ const head = code.slice(m.index, closeOf(code, m.index + m[0].length - 1));+ if (!/verticalScroll/.test(head)) continue;+ const bodyOpen = code.indexOf("{", m.index + head.length);+ if (bodyOpen === -1 || bodyOpen - (m.index + head.length) > 5) continue;+ if (/\.forEach\b|\bfor\s*\(/.test(code.slice(bodyOpen, closeOf(code, bodyOpen)))) hits.push(m.index);+ }+ }+ if (stack === "dart") {+ for (const m of matches(/\bSingleChildScrollView\s*\(|\bListView\s*\(/, code)) {+ const open = m.index + m[0].length - 1;+ const body = code.slice(open, closeOf(code, open));+ if (/children:/.test(body) && /\.map\(|\bfor\s*\(/.test(body)) hits.push(m.index);+ }+ }+ return hits;+ },+ },+ {+ id: "fixed-text-size",+ family: "accessibility",+ severity: "noticeable",+ stacks: ["swift", "js", "dart", "xml"],+ message: "Text that ignores the user's text size setting.",+ fix: "Use platform text styles (.body, MaterialTheme.typography, textTheme) or scale custom sizes (relativeTo:, UIFontMetrics, sp). Then check the screen at the largest size.",+ find({ code, stack }) {+ if (stack === "swift") {+ const hits = [...matches(/\.system\(\s*size:|\.custom\(\s*"[^"]*"\s*,\s*size:\s*[\d.]+\s*\)/, code)].map((m) => m.index);+ if (!/UIFontMetrics|adjustsFontForContentSizeCategory/.test(code)) {+ for (const m of matches(/UIFont\.(?:systemFont|boldSystemFont)\(\s*ofSize:|UIFont\(\s*name:/, code)) hits.push(m.index);+ }+ return hits;+ }+ const re = {+ js: /allowFontScaling\s*[=:]\s*\{?\s*false|maxFontSizeMultiplier\s*[=:]\s*\{?\s*1(?:\.0+)?(?![\d.])/,+ dart: /textScaleFactor:\s*1(?:\.0+)?(?![\d.])|TextScaler\.noScaling|textScaler:\s*(?:const\s+)?TextScaler\.linear\(\s*1(?:\.0)?\s*\)/,+ xml: /android:textSize="\d+(?:\.\d+)?(?:dp|px|dip)"/,+ }[stack];+ return [...matches(re, code)].map((m) => m.index);+ },+ },+ {+ id: "back-gesture",+ family: "native-fit",+ severity: "noticeable",+ stacks: ["swift", "js", "kotlin", "dart", "xml"],+ message: "System back gesture disabled, hidden, or handled the deprecated way.",+ fix: "Keep edge-swipe back on iOS and predictive back on Android. Guard only real data loss (PopScope, OnBackPressedCallback, usePreventRemove) and say why.",+ find({ code, stack }) {+ const re = {+ swift: /interactivePopGestureRecognizer\??\.isEnabled\s*=\s*false|\.navigationBarBackButtonHidden\(\s*(?:true)?\s*\)/,+ js: /gestureEnabled\s*[:=]\s*\{?\s*false|fullScreenGestureEnabled\s*[:=]\s*\{?\s*false/,+ kotlin: /override\s+fun\s+onBackPressed\s*\(/,+ dart: /\bWillPopScope\s*\(/,+ xml: /android:enableOnBackInvokedCallback="false"/,+ }[stack];+ return [...matches(re, code)].map((m) => m.index);+ },+ },+ {+ id: "drawer-nav",+ family: "native-fit",+ severity: "noticeable",+ stacks: null,+ message: "Hamburger menu or navigation drawer. It hides the top destinations behind a tap.",+ fix: "Ask first. Use tabs for three to five peer destinations; keep a drawer only for many destinations or a large-screen rail.",+ find({ code }) {+ const re = /["']line\.3\.horizontal["']|\bIcons\.(?:Default\.|Filled\.|Outlined\.|Rounded\.|Sharp\.)?Menu\b|\bIcons\.menu\b|name=["']menu(?:-outline)?["']|\bcreateDrawerNavigator\b|from\s+["']expo-router\/drawer["']|\bModalNavigationDrawer\b|\bdrawer:\s*(?:const\s+)?\w*Drawer\b|<ion-menu\b/;+ const first = matches(re, code).next();+ return first.done ? [] : [first.value.index];+ },+ },+ {+ id: "hover-only",+ family: "native-fit",+ severity: "minor",+ stacks: ["js", "web", "css"],+ message: "Hover behavior in a touch app. Nobody hovers on a phone.",+ fix: "Make the information or control visible without hover, or guard it with @media (hover: hover) for pointer devices only.",+ find({ code }) {+ if (/hover:\s*hover/.test(code)) return [];+ return [...matches(/\bonHoverIn\b|\bonMouseEnter\b|\bonMouseOver\b|:hover\b/, code)].map((m) => m.index);+ },+ },+ {+ id: "keyboard-cover",+ family: "interaction",+ severity: "minor",+ stacks: ["js"],+ message: "Screen with a text input and no keyboard handling. The keyboard may cover the field.",+ fix: "Use KeyboardAvoidingView, automaticallyAdjustKeyboardInsets, or the project's keyboard library, and set keyboardShouldPersistTaps on the scroll view. Check it on a small phone.",+ find({ code }) {+ const input = /<TextInput\b/.exec(code);+ if (!input) return [];+ if (!/<(?:ScrollView|FlatList|FlashList|SafeAreaView|KeyboardAwareScrollView)\b/.test(code)) return [];+ if (/KeyboardAvoidingView|KeyboardAware|KeyboardProvider|KeyboardStickyView|KeyboardController|automaticallyAdjustKeyboardInsets|keyboardShouldPersistTaps/.test(code)) return [];+ return [input.index];+ },+ },+ {+ id: "safe-area-off",+ family: "native-fit",+ severity: "minor",+ stacks: ["swift"],+ message: "Safe area ignored. Content may sit under the notch or home indicator.",+ fix: "Ignore the safe area for backgrounds only, e.g. .background(Color.surface.ignoresSafeArea()).",+ find({ code }) {+ const hits = [];+ for (const m of matches(/\.ignoresSafeArea\(\s*\)|\.edgesIgnoringSafeArea\(\s*\.all\s*\)/, code)) {+ const lineStart = code.lastIndexOf("\n", m.index) + 1;+ if (/background|Color\(|Color\.|Image\(|Gradient|Rectangle\(\)|Divider\(\)/.test(code.slice(lineStart, m.index))) continue;+ hits.push(m.index);+ }+ return hits;+ },+ },+ {+ id: "oops-error",+ family: "copy",+ severity: "noticeable",+ stacks: null,+ message: "\"Oops\" or \"Something went wrong\": no cause, no next step.",+ fix: "Say what failed in the product's words and what the user can do: retry, check the connection, contact support.",+ find({ code }) {+ return [...matches(/\boops\b|something went wrong/i, code)].map((m) => m.index);+ },+ },+ {+ id: "buzzword-copy",+ family: "copy",+ severity: "minor",+ stacks: null,+ message: "Marketing filler in the interface.",+ fix: "Say what the screen does in plain words, or delete the line.",+ find({ code }) {+ const re = /unlock (?:your|the) (?:full )?potential|\bseamless(?:ly)?\b|\beffortless(?:ly)?\b|\bsupercharg\w*|all in one place|\bnext[- ]level\b|\belevate your\b|\bgame[- ]?changer\b|\brevolutioni[sz]\w*|\bunleash\b|\bempower(?:s|ing)? you/i;+ return [...matches(re, code)].map((m) => m.index);+ },+ },+ {+ id: "welcome-back",+ family: "copy",+ severity: "minor",+ stacks: null,+ message: "\"Welcome back!\" spending prime screen space on a greeting.",+ fix: "Use that space for what a returning user came to do.",+ find({ code }) {+ return [...matches(/welcome back\s*(?:,[^"'<\n]*)?!/i, code)].map((m) => m.index);+ },+ },+ {+ id: "vague-button",+ family: "copy",+ severity: "minor",+ stacks: null,+ message: "Button label that does not say what happens.",+ fix: "Use a verb and an object: \"Save address\", \"Send invoice\", \"Book table\".",+ find({ code }) {+ return [...matches(/(?:title|label|text)\s*[=:]\s*\{?\s*["'](?:Submit|Click here|Tap here)["']|>\s*(?:Submit|Click here|Tap here)\s*</i, code)].map((m) => m.index);+ },+ },+ {+ id: "invented-stat",+ family: "truthfulness",+ severity: "minor",+ stacks: ["swift", "kotlin", "dart", "js", "web"],+ message: "Hard-coded statistic in the interface.",+ fix: "Compute it from real data, or mark it as placeholder content. Stat tiles with invented numbers mislead users.",+ find({ code }) {+ // A number with %, k, M or + shown as text: JSX text, Text("..."), or a+ // value/stat field in a data literal. Widths and other style values are not text.+ const stat = String.raw`[+↑↓]?\d{1,3}(?:[.,]\d{1,3})*\s*(?:%|[kKM]\+?|\+)`;+ const re = new RegExp(+ String.raw`>\s*${stat}\s*<|\bText\(\s*(?:text\s*=\s*)?["']${stat}["']|\b(?:value|stat|metric|count|total|number|figure)\s*:\s*["']${stat}["']`,+ "g",+ );+ return [...matches(re, code)].map((m) => m.index);+ },+ },+];++// ---------- scanning ----------++function loadConfig(root) {+ // The nearest project config above the scan target wins; the current+ // directory's config is the last fallback.+ const candidates = [];+ for (let dir = path.resolve(root); ; dir = path.dirname(dir)) {+ candidates.push(path.join(dir, ".unslopovich", "config.json"));+ if (path.dirname(dir) === dir) break;+ }+ candidates.push(path.join(process.cwd(), ".unslopovich", "config.json"));+ for (const file of candidates) {+ try {+ const raw = JSON.parse(fs.readFileSync(file, "utf8"));+ return { ignoreRules: raw.ignoreRules || [], ignorePaths: raw.ignorePaths || [] };+ } catch {+ // No config, or unreadable: use defaults.+ }+ }+ return { ignoreRules: [], ignorePaths: [] };+}++// True when the nearest package.json (up to the filesystem root) ships the app to the web too.+function isUniversalApp(dir) {+ for (let d = dir; ; d = path.dirname(d)) {+ try {+ const pkg = fs.readFileSync(path.join(d, "package.json"), "utf8");+ return /"react-native-web"|"@expo\/metro-runtime"/.test(pkg);+ } catch {+ // Keep looking upward.+ }+ if (path.dirname(d) === d) return false;+ }+}++function walk(target, opts, out = []) {+ let stat;+ try {+ stat = fs.statSync(target);+ } catch {+ throw new Error(`Cannot read ${target}`);+ }+ if (stat.isFile()) {+ if (STACK_BY_EXT[path.extname(target).toLowerCase()]) out.push(target);+ return out;+ }+ for (const entry of fs.readdirSync(target, { withFileTypes: true })) {+ const full = path.join(target, entry.name);+ if (entry.isDirectory()) {+ if (SKIP_DIRS.has(entry.name) || entry.name.startsWith(".")) continue;+ if (!opts.includeTests && TEST_DIR.test(entry.name)) continue;+ walk(full, opts, out);+ } else if (entry.isFile()) {+ if (!STACK_BY_EXT[path.extname(entry.name).toLowerCase()]) continue;+ if (!opts.includeTests && TEST_FILE.test(entry.name)) continue;+ if (/\.(?:min|d)\.(?:js|ts)$/.test(entry.name)) continue;+ out.push(full);+ }+ }+ return out;+}++// A trailing comment silences its own line; a comment on a line of its own+// silences the next line.+function ignoredByComment(lines, line, ruleId) {+ const previous = lines[line - 2];+ const own = previous && /^\s*(?:\/\/|\/\*|\*|<!--|#)/.test(previous) ? previous : null;+ for (const l of [lines[line - 1], own]) {+ if (!l) continue;+ const m = /unslopovich-ignore(?:\s+([\w-]+(?:\s*,\s*[\w-]+)*))?/.exec(l);+ if (m && (!m[1] || m[1].split(/\s*,\s*/).includes(ruleId))) return true;+ }+ return false;+}++function scanSource(text, file, options = {}) {+ const stack = options.stack || STACK_BY_EXT[path.extname(file).toLowerCase()];+ if (!stack) return [];+ if (stack === "xml" && !/<(?:LinearLayout|ConstraintLayout|TextView|FrameLayout|RelativeLayout|manifest|application|shape|gradient|resources|androidx\.)/.test(text)) return [];+ const code = blankComments(text, stack);+ const starts = lineStarts(text);+ const lines = text.split("\n");+ const ignoreRules = new Set(options.ignoreRules || []);+ const findings = [];+ for (const rule of rules) {+ if (ignoreRules.has(rule.id)) continue;+ if (rule.stacks && !rule.stacks.includes(stack)) continue;+ const seen = new Set();+ for (const index of rule.find({ code, stack, file })) {+ const line = lineAt(starts, index);+ if (seen.has(line) || ignoredByComment(lines, line, rule.id)) continue;+ seen.add(line);+ findings.push({+ rule: rule.id,+ family: rule.family,+ severity: rule.severity,+ file,+ line,+ snippet: lines[line - 1].trim().slice(0, 120),+ message: rule.message,+ fix: rule.fix,+ });+ }+ }+ return findings;+}++function scan(targets, opts = {}) {+ const findings = [];+ const unreadable = [];+ let filesScanned = 0;+ for (const target of targets) {+ const root = path.resolve(target);+ const config = loadConfig(fs.statSync(root).isDirectory() ? root : path.dirname(root));+ const ignoreRules = [...config.ignoreRules, ...(opts.ignoreRules || [])];+ // Apps that also ship to the web legitimately use hover there.+ if (isUniversalApp(fs.statSync(root).isDirectory() ? root : path.dirname(root))) ignoreRules.push("hover-only");+ for (const file of walk(root, opts)) {+ const rel = path.relative(process.cwd(), file) || file;+ if (config.ignorePaths.some((p) => rel.split(path.sep).join("/").includes(p))) continue;+ let text;+ try {+ text = fs.readFileSync(file, "utf8");+ } catch {+ unreadable.push(rel);+ continue;+ }+ if (text.length > 1_000_000) continue;+ filesScanned++;+ findings.push(...scanSource(text, rel, { ignoreRules }));+ }+ }+ findings.sort((a, b) => SEVERITY_RANK[a.severity] - SEVERITY_RANK[b.severity] || a.file.localeCompare(b.file) || a.line - b.line);+ return { version: VERSION, filesScanned, unreadable, findings };+}++// ---------- output ----------++function formatText(result) {+ const { findings, filesScanned } = result;+ const out = [];+ if (findings.length === 0) {+ out.push(`Dr. Unslopovich found nothing in ${filesScanned} files. Suspicious, but fine.`);+ } else {+ const count = (s) => findings.filter((f) => f.severity === s).length;+ const files = new Set(findings.map((f) => f.file)).size;+ const parts = ["critical", "noticeable", "minor"].filter((s) => count(s)).map((s) => `${count(s)} ${s}`);+ out.push(`${findings.length} findings in ${files} of ${filesScanned} files (${parts.join(", ")})`);+ let current = null;+ for (const f of findings.slice().sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line)) {+ if (f.file !== current) {+ current = f.file;+ out.push("", f.file);+ }+ out.push(` ${String(f.line).padStart(4)} ${f.severity.padEnd(10)} ${f.rule.padEnd(18)} ${f.message}`);+ }+ out.push("", "Fixes: npx unslopovich detect --list-rules");+ }+ out.push("Static checks only. Nothing was run, profiled, or tapped. A clean scan is not a clean bill of health.");+ return out.join("\n");+}++function listRules() {+ return rules+ .map((r) => `${r.id.padEnd(18)} ${r.severity.padEnd(10)} ${r.family.padEnd(15)} ${r.message}\n${" ".repeat(20)}Fix: ${r.fix}`)+ .join("\n");+}++const USAGE = `Usage: unslopovich detect [paths...] [--json] [--ignore rule,rule] [--include-tests] [--list-rules]++Scans mobile source for generated-looking UI and website-in-a-phone patterns.+Exit code: 0 clean, 2 findings, 1 error.+Silence one line with a comment: unslopovich-ignore <rule-id>+Project config: .unslopovich/config.json { "ignoreRules": [], "ignorePaths": [] }`;++function main(argv) {+ const args = argv.slice();+ if (args.includes("--help") || args.includes("-h")) {+ console.log(USAGE);+ return 0;+ }+ if (args.includes("--list-rules")) {+ console.log(listRules());+ return 0;+ }+ const json = args.includes("--json");+ const includeTests = args.includes("--include-tests");+ const ignoreRules = [];+ const targets = [];+ for (let i = 0; i < args.length; i++) {+ const a = args[i];+ if (a === "--ignore") {+ if (!args[i + 1]) {+ console.error(USAGE);+ return 1;+ }+ ignoreRules.push(...args[++i].split(","));+ } else if (!a.startsWith("--")) targets.push(a);+ else if (!["--json", "--include-tests"].includes(a)) {+ console.error(`Unknown option ${a}\n\n${USAGE}`);+ return 1;+ }+ }+ const known = new Set(rules.map((r) => r.id));+ const unknown = ignoreRules.filter((r) => !known.has(r));+ if (unknown.length) {+ console.error(`Unknown rule: ${unknown.join(", ")}. See --list-rules.`);+ return 1;+ }+ let result;+ try {+ result = scan(targets.length ? targets : ["."], { includeTests, ignoreRules });+ } catch (err) {+ console.error(err.message);+ return 1;+ }+ console.log(json ? JSON.stringify(result, null, 2) : formatText(result));+ if (result.unreadable.length) {+ console.error(`Could not read ${result.unreadable.length} file(s): ${result.unreadable.join(", ")}. The scan is incomplete.`);+ return 1;+ }+ return result.findings.length ? 2 : 0;+}++module.exports = { rules, scan, scanSource, blankComments, isSlopHue, main };++if (require.main === module) process.exitCode = main(process.argv.slice(2));diff --git a/scripts/package.json b/scripts/package.jsonnew file mode 100644index 0000000..5bbefff--- /dev/null+++ b/scripts/package.json@@ -0,0 +1,3 @@+{+ "type": "commonjs"+}diff --git a/test/detect.test.js b/test/detect.test.jsnew file mode 100644index 0000000..e61f0eb--- /dev/null+++ b/test/detect.test.js@@ -0,0 +1,179 @@+"use strict";++const test = require("node:test");+const assert = require("node:assert");+const path = require("path");+const { scan, scanSource, rules, isSlopHue, main } = require("../scripts/detect.js");++const fixtures = path.join(__dirname, "fixtures");+const rulesIn = (file) => new Set(scan([path.join(fixtures, "slop", file)]).findings.map((f) => f.rule));++test("clean fixtures produce no findings", () => {+ const { findings, filesScanned } = scan([path.join(fixtures, "clean")]);+ assert.strictEqual(filesScanned, 4);+ assert.deepStrictEqual(findings, []);+});++test("React Native slop is caught", () => {+ const found = rulesIn("HomeScreen.tsx");+ for (const id of [+ "slop-gradient", "gradient-text", "nested-cards", "status-dot", "unvirtualized-list",+ "fixed-text-size", "emoji-icon", "sparkle-icon", "oops-error", "buzzword-copy",+ "welcome-back", "vague-button", "invented-stat", "glow-shadow", "hover-only",+ "keyboard-cover", "back-gesture", "drawer-nav",+ ]) assert.ok(found.has(id), `missing ${id}`);+});++test("SwiftUI slop is caught", () => {+ const found = rulesIn("Dashboard.swift");+ for (const id of ["unvirtualized-list", "status-dot", "fixed-text-size", "slop-gradient", "glow-shadow", "back-gesture", "drawer-nav", "safe-area-off"]) {+ assert.ok(found.has(id), `missing ${id}`);+ }+});++test("Compose slop is caught", () => {+ const found = rulesIn("MainScreen.kt");+ for (const id of ["template-theme", "unvirtualized-list", "nested-cards", "status-dot", "drawer-nav", "back-gesture"]) {+ assert.ok(found.has(id), `missing ${id}`);+ }+});++test("Flutter slop is caught", () => {+ const found = rulesIn("home.dart");+ for (const id of ["template-theme", "back-gesture", "unvirtualized-list", "nested-cards", "status-dot", "fixed-text-size"]) {+ assert.ok(found.has(id), `missing ${id}`);+ }+});++test("every rule has a fixture that triggers it", () => {+ const all = new Set(scan([path.join(fixtures, "slop")]).findings.map((f) => f.rule));+ for (const rule of rules) assert.ok(all.has(rule.id), `no fixture for ${rule.id}`);+});++test("commented-out code is ignored", () => {+ const src = '// <LinearGradient colors={["#7C3AED", "#EC4899"]} />\n/* Oops! Something went wrong */\n';+ assert.deepStrictEqual(scanSource(src, "a.tsx"), []);+});++test("URLs in strings do not start a comment", () => {+ const src = 'const a = "https://x.dev"; const b = "Oops";\n';+ assert.deepStrictEqual(scanSource(src, "a.ts").map((f) => f.rule), ["oops-error"]);+});++test("inline ignore comments silence a line", () => {+ const src = '// unslopovich-ignore oops-error\nconst a = "Oops";\nconst b = "Oops"; // unslopovich-ignore\nconst c = "Oops";\n';+ assert.deepStrictEqual(scanSource(src, "a.ts").map((f) => f.line), [4]);+});++test("ignored rules are skipped", () => {+ assert.deepStrictEqual(scanSource('const a = "Oops";', "a.ts", { ignoreRules: ["oops-error"] }), []);+});++test("style percentages and scale multipliers are not findings", () => {+ const src = [+ "<View style={{ width: '80%', maxWidth: '100%' }} />",+ "<Text maxFontSizeMultiplier={1.5}>Hi</Text>",+ "<ScrollView horizontal>{chips.map((c) => <Chip key={c} />)}</ScrollView>",+ "const ref = useAnimatedRef<ScrollView>()",+ ].join("\n");+ assert.deepStrictEqual(scanSource(src, "a.tsx"), []);+});++test("emoji pickers are not icon findings, labeled emoji are", () => {+ assert.deepStrictEqual(scanSource("const picks = ['😀', '😂', '🎉'];", "a.ts"), []);+ assert.deepStrictEqual(scanSource("<Text>🚀 Fast</Text>", "a.tsx").map((f) => f.rule), ["emoji-icon"]);+});++test("the slop hue band", () => {+ assert.ok(isSlopHue("7C3AED")); // violet+ assert.ok(isSlopHue("6366F1")); // indigo+ assert.ok(isSlopHue("EC4899")); // pink+ assert.ok(!isSlopHue("1B6E5A")); // green+ assert.ok(!isSlopHue("0A7EA4")); // teal blue+ assert.ok(!isSlopHue("777777")); // gray+});++test("exit codes and json shape", () => {+ const log = console.log;+ let out = "";+ console.log = (s) => (out += s);+ try {+ assert.strictEqual(main([path.join(fixtures, "slop"), "--json"]), 2);+ const parsed = JSON.parse(out);+ assert.strictEqual(parsed.version, 1);+ assert.ok(parsed.findings.every((f) => f.rule && f.severity && f.file && f.line && f.message && f.fix));+ out = "";+ assert.strictEqual(main([path.join(fixtures, "clean")]), 0);+ } finally {+ console.log = log;+ }+ const err = console.error;+ console.error = () => {};+ try {+ assert.strictEqual(main(["--ignore", "not-a-rule"]), 1);+ assert.strictEqual(main(["--nope"]), 1);+ } finally {+ console.error = err;+ }+});++test("a quote inside a regex literal does not hide a real comment", () => {+ assert.deepStrictEqual(scanSource('const quote = /"/g; // Oops\n', "a.ts"), []);+ assert.deepStrictEqual(scanSource("<Text>Hi</Text> // Oops\n", "a.tsx"), []);+ assert.deepStrictEqual(scanSource('const r = a / b; const s = "Oops";\n', "a.ts").map((f) => f.rule), ["oops-error"]);+});++test("horizontal={false} is still a vertical list", () => {+ const src = "<ScrollView horizontal={false}>{items.map((i) => <Row key={i} />)}</ScrollView>";+ assert.deepStrictEqual(scanSource(src, "a.tsx").map((f) => f.rule), ["unvirtualized-list"]);+});++test("Android color resources reach template-theme", () => {+ const src = '<resources>\n <color name="purple_500">#6200EE</color>\n</resources>\n';+ assert.deepStrictEqual(scanSource(src, "colors.xml").map((f) => f.rule), ["template-theme"]);+});++test("XML ignore comments work", () => {+ const src = '<resources>\n <!-- unslopovich-ignore template-theme -->\n <color name="purple_500">#6200EE</color>\n</resources>\n';+ assert.deepStrictEqual(scanSource(src, "colors.xml"), []);+});++test("project config is found above the scan target", () => {+ const fs = require("fs");+ const os = require("os");+ const root = fs.mkdtempSync(path.join(os.tmpdir(), "unslop-"));+ fs.mkdirSync(path.join(root, ".unslopovich"));+ fs.writeFileSync(path.join(root, ".unslopovich", "config.json"), JSON.stringify({ ignoreRules: ["oops-error"] }));+ fs.mkdirSync(path.join(root, "src", "screens"), { recursive: true });+ fs.writeFileSync(path.join(root, "src", "screens", "A.ts"), 'const a = "Oops";\n');+ try {+ assert.deepStrictEqual(scan([path.join(root, "src", "screens")]).findings, []);+ } finally {+ fs.rmSync(root, { recursive: true, force: true });+ }+});++test("an unreadable file makes the scan fail, not pass", () => {+ const fs = require("fs");+ const os = require("os");+ const root = fs.mkdtempSync(path.join(os.tmpdir(), "unslop-"));+ const file = path.join(root, "A.ts");+ fs.writeFileSync(file, "const a = 1;\n");+ const read = fs.readFileSync;+ fs.readFileSync = (f, ...rest) => {+ if (f === file) throw Object.assign(new Error("EACCES"), { code: "EACCES" });+ return read(f, ...rest);+ };+ const err = console.error;+ const log = console.log;+ console.error = () => {};+ console.log = () => {};+ try {+ assert.strictEqual(main([file]), 1);+ } finally {+ fs.readFileSync = read;+ console.error = err;+ console.log = log;+ fs.rmSync(root, { recursive: true, force: true });+ }+});diff --git a/test/fixtures/clean/Dashboard.swift b/test/fixtures/clean/Dashboard.swiftnew file mode 100644index 0000000..515526b--- /dev/null+++ b/test/fixtures/clean/Dashboard.swift@@ -0,0 +1,13 @@+import SwiftUI++struct Dashboard: View {+ let rows: [Row]+ var body: some View {+ List(rows) { row in+ Label(row.title, systemImage: row.symbol)+ .font(.body)+ }+ .background(Color(.systemGroupedBackground).ignoresSafeArea())+ .shadow(color: .black.opacity(0.1), radius: 4, y: 2)+ }+}diff --git a/test/fixtures/clean/HomeScreen.tsx b/test/fixtures/clean/HomeScreen.tsxnew file mode 100644index 0000000..60aecd8--- /dev/null+++ b/test/fixtures/clean/HomeScreen.tsx@@ -0,0 +1,16 @@+import { FlatList, Text, TextInput, KeyboardAvoidingView, View } from "react-native";++// A purple gradient used to live here: <LinearGradient colors={["#7C3AED"]} />+export function HomeScreen({ items, total }) {+ return (+ <KeyboardAvoidingView behavior="padding">+ <TextInput placeholder="Search zones" />+ <FlatList data={items} renderItem={({ item }) => <Text>{item.name}</Text>} />+ <Text>{total} zones</Text>+ <View style={{ width: "100%", height: 1 }} />+ <Text>Couldn't load zones. Check your connection and pull to retry.</Text>+ <Button title="Add zone" />+ <Text>Visit https://example.com for help</Text>+ </KeyboardAvoidingView>+ );+}diff --git a/test/fixtures/clean/MainScreen.kt b/test/fixtures/clean/MainScreen.ktnew file mode 100644index 0000000..165d8b7--- /dev/null+++ b/test/fixtures/clean/MainScreen.kt@@ -0,0 +1,7 @@+@Composable+fun MainScreen(items: List<Item>) {+ LazyColumn {+ items(items) { item -> ListItem(headlineContent = { Text(item.name) }) }+ }+ Card { Text("Single card") }+}diff --git a/test/fixtures/clean/home.dart b/test/fixtures/clean/home.dartnew file mode 100644index 0000000..23af6ec--- /dev/null+++ b/test/fixtures/clean/home.dart@@ -0,0 +1,18 @@+import 'package:flutter/material.dart';++final theme = ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Color(0xFF1B6E5A)));++class Home extends StatelessWidget {+ final List<String> items;+ const Home(this.items);+ @override+ Widget build(BuildContext context) {+ return PopScope(+ canPop: true,+ child: ListView.builder(+ itemCount: items.length,+ itemBuilder: (context, i) => ListTile(title: Text(items[i])),+ ),+ );+ }+}diff --git a/test/fixtures/slop/Dashboard.swift b/test/fixtures/slop/Dashboard.swiftnew file mode 100644index 0000000..e056a62--- /dev/null+++ b/test/fixtures/slop/Dashboard.swift@@ -0,0 +1,25 @@+import SwiftUI++struct Dashboard: View {+ let rows: [Row]+ var body: some View {+ ScrollView {+ VStack {+ ForEach(rows) { row in+ HStack {+ Circle().fill(.green).frame(width: 8, height: 8)+ Text(row.title).font(.system(size: 15))+ }+ }+ }+ }+ .background(LinearGradient(colors: [.purple, .indigo], startPoint: .top, endPoint: .bottom))+ .shadow(color: .purple, radius: 20)+ .navigationBarBackButtonHidden(true)+ .toolbar { Image(systemName: "line.3.horizontal") }+ .ignoresSafeArea()+ .overlay { Text("A").background(.ultraThinMaterial) }+ .safeAreaInset(edge: .top) { Text("B").background(.thinMaterial) }+ .toolbarBackground(.regularMaterial)+ }+}diff --git a/test/fixtures/slop/HomeScreen.tsx b/test/fixtures/slop/HomeScreen.tsxnew file mode 100644index 0000000..28dfccf--- /dev/null+++ b/test/fixtures/slop/HomeScreen.tsx@@ -0,0 +1,34 @@+import { ScrollView, View, Text, TextInput, Pressable } from "react-native";+import { LinearGradient } from "expo-linear-gradient";+import MaskedView from "@react-native-masked-view/masked-view";+import { createDrawerNavigator } from "@react-navigation/drawer";++export function HomeScreen({ items }) {+ return (+ <ScrollView>+ <LinearGradient colors={["#7C3AED", "#EC4899"]} style={{ padding: 24 }}>+ <Text>Welcome back!</Text>+ <Text>Unlock your potential with seamless planning ✨</Text>+ </LinearGradient>+ <MaskedView maskElement={<Text>Pro</Text>} />+ <Card>+ <Card>+ <Text>12.5k</Text>+ <Text>+23%</Text>+ </Card>+ </Card>+ <View style={{ width: 8, height: 8, borderRadius: 4, backgroundColor: "green" }} />+ <View className="h-2 w-2 rounded-full bg-emerald-500" />+ <Text allowFontScaling={false}>🚀 Fast</Text>+ <TextInput placeholder="Search" />+ {items.map((item) => (+ <Text key={item.id}>{item.name}</Text>+ ))}+ <Text>Oops! Something went wrong</Text>+ <Button title="Submit" />+ <View style={{ shadowColor: "#8B5CF6", shadowRadius: 20 }} onHoverIn={() => {}} />+ </ScrollView>+ );+}++export const screenOptions = { gestureEnabled: false };diff --git a/test/fixtures/slop/MainScreen.kt b/test/fixtures/slop/MainScreen.ktnew file mode 100644index 0000000..f72fb6c--- /dev/null+++ b/test/fixtures/slop/MainScreen.kt@@ -0,0 +1,20 @@+package com.example++val Purple80 = Color(0xFFD0BCFF)++@Composable+fun MainScreen(items: List<Item>) {+ Column(modifier = Modifier.verticalScroll(rememberScrollState())) {+ items.forEach { item ->+ Card {+ Card { Text(item.name) }+ }+ }+ Box(Modifier.size(8.dp).background(Color.Green, CircleShape))+ Icon(Icons.Default.Menu, contentDescription = null)+ }+}++class MainActivity : ComponentActivity() {+ override fun onBackPressed() { finish() }+}diff --git a/test/fixtures/slop/home.dart b/test/fixtures/slop/home.dartnew file mode 100644index 0000000..7dbcf9b--- /dev/null+++ b/test/fixtures/slop/home.dart@@ -0,0 +1,22 @@+import 'package:flutter/material.dart';++final theme = ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple));++class Home extends StatelessWidget {+ final List<String> items;+ const Home(this.items);+ @override+ Widget build(BuildContext context) {+ return WillPopScope(+ onWillPop: () async => false,+ child: SingleChildScrollView(+ child: Column(+ children: items.map((i) => Card(child: Card(child: Text(i)))).toList(),+ ),+ ),+ );+ }+}++final dot = Container(width: 8, height: 8, decoration: BoxDecoration(shape: BoxShape.circle));+final t = MediaQuery(data: MediaQueryData(textScaler: TextScaler.noScaling), child: Text('Hi'));