Ns optimizer

From Melvynx/saveit.now · View interactive version

Ns optimizer is an AI agent skill from the GitHub repository Melvynx/saveit.now. Optimize NowStack Mobile across Convex, Expo, and TanStack Start. Use for performance, state, subscriptions, rendering, routing, forms, mobile UI, bundle, or data-fetching improvements.

How to use this skill

Skill file

Optimizer - NowStack Mobile

<objective>

Improve performance and architecture in this repo without importing assumptions from the web-only NowStack SaaS app. NowStack Mobile has three surfaces:

</objective>

<first_steps>

  1. Identify the affected surface: Convex, web, mobile, or cross-surface.
  2. Read the matching rule file before editing:
  1. Before touching convex/, read convex/_generated/ai/guidelines.md.
  2. Gather the cheapest real signal available: build/typecheck output, route behavior, screen flow, query callsites, logs, or measured slow path.

</first_steps>

<decision_tree>

| Problem | Preferred path |

| --- | --- |

| Convex reads are expensive, .filter() scans, missing indexes, high docs read | Use convex-cost-optimizer or convex-performance-audit first |

| Convex schema/data shape needs a rollout | Use convex-migration-helper |

| Web route state, admin rendering, landing bundle, TanStack Router behavior | Work in web-app/ and verify with web typecheck/build |

| Mobile render jank, onboarding/paywall flow, NativeWind layout, auth store state | Work in mobile-app/ and verify with TypeScript/lint plus simulator when needed |

| Shared auth, payments, R2, account behavior | Treat Convex + web + mobile as one contract and verify every touched surface |

</decision_tree>

<patterns>

Convex

Web App

Mobile App

Cross-Surface

</patterns>

<verification>

Pick the narrowest set that covers the touched surface:

npx convex dev --once
cd web-app && npm run typecheck
cd web-app && npm run build
cd mobile-app && npx tsc --noEmit
cd mobile-app && npm run lint

For visible web behavior, run cd web-app && npm run dev and verify the relevant route. For mobile behavior, use Expo/simulator verification when the change affects navigation, native APIs, payments, screenshots, or layout.

</verification>

<anti_patterns>

</anti_patterns>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.