[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GPJNN5XR5YGZS8SND2DFDN":3,"skill-same:01M6GPJNN5XR5YGZS8SND2DFDN":86},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":53,"commitSha":54,"skillDirectory":55,"forksCount":56,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":59,"ownerDescription":60,"updatedAt":61,"install":62,"resources":75},"01M6GPJNN5XR5YGZS8SND2DFDN","convert-farcaster-miniapp-to-app",null,"Converts Farcaster miniapp SDK projects into regular Base\u002Fweb apps. Starts with an interactive quiz to choose between the default regular-app conversion and a narrowly isolated Farcaster surface when something truly needs to remain separate. Handles wagmi connectors, providers, auth, SDK actions, manifest routes, meta tags, dependencies, and read-only preservation.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fbase-official-convert-farcaster-miniapp-to-app\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000039","教师与教育","PROFESSION","适用职业",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"convert farcaster miniapp to app","convert","app","farcaster","only","read-only","wagmi","tags","quiz","apps","preservation","default","conversion","auth","interactive","read","choose","projects","Meta Tags","manifest","Providers","Meta","actions","connectors","2026-11-10 10:12:30",false,"---\nname: convert-farcaster-miniapp-to-app\ndescription: Converts Farcaster miniapp SDK projects into regular Base\u002Fweb apps. Starts with an interactive quiz to choose between the default regular-app conversion and a narrowly isolated Farcaster surface when something truly needs to remain separate. Handles wagmi connectors, providers, auth, SDK actions, manifest routes, meta tags, dependencies, and read-only preservation.\n---\n\n# Convert Farcaster Miniapp to Base App\n\nConvert a Farcaster miniapp into a normal app on Base. The default outcome is a regular web app that works in the Base app browser and on the open web, with Farcaster Mini App host coupling removed.\n\nIf some Farcaster functionality truly needs to survive, keep it separate from the main app surface. Prefer read-only data first. Only preserve Mini App-specific behavior when the user explicitly insists, and isolate it behind a dedicated route or page rather than carrying it through the whole app.\n\n## Core Principle\n\nAlways separate these decisions:\n\n1. Remove Mini App host\u002Fruntime coupling.\n2. Decide whether any Farcaster-facing functionality should remain.\n3. If something remains, keep it isolated from the main app and avoid introducing new vendor dependencies by default.\n\nDo **not** automatically turn \"keep some Farcaster functionality\" into \"migrate to Neynar.\" If a project already uses Neynar and the user wants to keep an isolated Farcaster-only area, you may preserve that existing integration. Do not introduce new Neynar adoption as the default recommendation.\n\n## Quick Start\n\nFollow these five phases sequentially:\n\n0. **Discovery** — Quick scan + quiz to choose a path\n1. **Analysis** — Detailed read-only analysis scoped to the chosen path\n2. **Conversion** — Remove Mini App SDK patterns and isolate any intentionally preserved Farcaster surface\n3. **Cleanup** — Remove dead code, env vars, and dependencies\n4. **Verification** — Type check, build, and summarize\n\n## Conversion Paths\n\nThe quiz should route the user into one of two paths:\n\n| Path | Name | Who it's for | What happens |\n|------|------|-------------|-------------|\n| **A** | Regular App Default | Most projects | Strip Farcaster Mini App coupling and become a normal Base\u002Fweb app |\n| **B** | Isolated Farcaster Surface | The app still needs a small Farcaster-specific area | Convert the main app into a normal app, then keep only a separate Farcaster route\u002Fpage for the remaining functionality |\n\n`Path B` is still biased toward removing complexity:\n- Prefer **read-only** Farcaster data.\n- Avoid preserving Mini App host\u002Fruntime behavior unless the user explicitly asks for it.\n- Keep any preserved Farcaster logic out of the main app shell, shared providers, and primary auth flow.\n\n---\n\n## Phase 0: Discovery\n\n### 0A. Quick Scan (automated, no user interaction)\n\nRun a lightweight scan before asking questions. Produce an internal tally:\n\n1. **Detect framework** from `package.json` (`next`, `vite`, `react-scripts`, `@remix-run\u002F*`)\n2. **Count Farcaster packages** in `dependencies` and `devDependencies`\n3. **Grep source files** (`.ts`, `.tsx`, `.js`, `.jsx`) for:\n   - `sdk.actions.*` calls (count total)\n   - `sdk.quickAuth` usage (yes\u002Fno)\n   - `sdk.context` usage (yes\u002Fno)\n   - `.well-known\u002Ffarcaster.json` (yes\u002Fno)\n   - `farcasterMiniApp` \u002F `miniAppConnector` connector (yes\u002Fno)\n   - Total files with any `@farcaster\u002F` import\n   - `@neynar\u002F` imports or `api.neynar.com` fetch calls (yes\u002Fno)\n4. **Identify the blast radius**:\n   - Are Farcaster references spread across the main app shell?\n   - Are they already mostly confined to a route like `app\u002Ffarcaster\u002F`, `pages\u002Ffarcaster\u002F`, or a small set of components?\n   - Are there obvious host-only features such as haptics, notifications, `openMiniApp`, or `sdk.context.client`?\n\nUse this tally to inform quiz suggestions. Do **not** dump raw scan output to the user before asking the quiz.\n\n### 0B. Interactive Quiz\n\nAsk these questions one at a time. Use the quick scan results to suggest the most likely answer.\n\n**Q1** (always ask):\n\n> Based on my scan, your project has [X] files using the Farcaster SDK with [summary of what is used].\n>\n> Which outcome do you want?\n> - **(a) Regular app everywhere** — remove Farcaster-specific behavior and just keep a normal Base\u002Fweb app\n> - **(b) Regular app first, plus a separate Farcaster area** — keep the main app clean, but preserve a small isolated route\u002Fpage if really needed\n\n**Q2** (always ask):\n\n> How deeply is the Mini App SDK used today?\n> - **(a) Minimal** — mostly `sdk.actions.ready()` and a few helpers\n> - **(b) Moderate** — some `context`, `openUrl`, profile links, or conditional `isInMiniApp` logic\n> - **(c) Heavy** — auth, wallet connector, notifications, compose flows, or host-specific behavior\n\n**Q3** (ask if Q1 = b):\n\n> What is the smallest Farcaster feature set you actually need to preserve?\n> - **(a) Read-only only** — profile or cast display, links out to Farcaster profiles, maybe a small social page\n> - **(b) Some Farcaster-specific interactions** — there is a separate page\u002Fpath that still needs more than read-only behavior\n> - **(c) Not sure** — analyze what is isolated already and recommend the smallest keep-surface possible\n\n**Q4** (ask if Q1 = b and there is existing isolated Farcaster code or existing Neynar usage):\n\n> Does the project already have an isolated Farcaster-only route\u002Fpage or integration that you want to keep as-is if possible?\n> - **(a) Yes** — preserve only that isolated surface\n> - **(b) No** — prefer removing it unless there is a very strong reason to keep it\n\n**Q5** (ask if quick auth or other Mini App auth is present):\n\n> After conversion, what should the main app use for authentication?\n> - **(a) SIWE** — wallet-based auth for the regular app\n> - **(b) Existing non-Farcaster auth** — keep whatever normal web auth already exists\n> - **(c) No auth** — remove auth entirely\n\n### 0C. Path Selection\n\nMap answers to a path:\n\n| Desired outcome | Typical result |\n|-----------------|----------------|\n| `Q1 = regular app everywhere` | **Path A** — Regular App Default |\n| `Q1 = regular app first, plus separate Farcaster area` | **Path B** — Isolated Farcaster Surface |\n\nThen tighten the recommendation:\n\n- If the user chose `Path B`, prefer **read-only preservation** unless they explicitly require something else.\n- If the scan shows heavy host\u002Fruntime coupling but the user wants `Path A`, warn them that some features will be deleted rather than recreated.\n- If the project already uses Neynar, only keep it if it remains inside the isolated Farcaster surface. Do not expand it into the main app.\n\nAnnounce the chosen path:\n\n> Based on your answers, I'll use **Path [X]: [Name]**. This will [one-sentence description]. I'll now do a detailed analysis of your project.\n\nRecord the quiz answers internally. They guide whether the agent should:\n- fully remove Farcaster features\n- preserve only a read-only isolated surface\n- quarantine any unavoidable Farcaster-specific logic to a dedicated route\u002Fpage\n\n**Proceed to Phase 1.**\n\n---\n\n## Phase 1: Analysis (Read-Only)\n\n### 1A. Detect Framework\n\nRead `package.json`:\n- `next` → Next.js\n- `vite` → Vite\n- `react-scripts` → Create React App\n- `@remix-run\u002F*` → Remix\n\n### 1B. Scan for Farcaster Dependencies\n\nList all packages matching:\n- `@farcaster\u002Fminiapp-sdk`, `@farcaster\u002Fminiapp-core`, `@farcaster\u002Fminiapp-wagmi-connector`\n- `@farcaster\u002Fframe-sdk`, `@farcaster\u002Fframe-wagmi-connector`\n- `@farcaster\u002Fquick-auth`, `@farcaster\u002Fauth-kit`\n- `@neynar\u002F*` (compatibility only; do not assume it stays)\n\n### 1C. Grep for Farcaster Code\n\nSearch source files (`.ts`, `.tsx`, `.js`, `.jsx`) for:\n\n**SDK imports:**\n```\n@farcaster\u002Fminiapp-sdk\n@farcaster\u002Fminiapp-core\n@farcaster\u002Fminiapp-wagmi-connector\n@farcaster\u002Fframe-sdk\n@farcaster\u002Fframe-wagmi-connector\n@farcaster\u002Fquick-auth\n@farcaster\u002Fauth-kit\n@neynar\u002F\n```\n\n**SDK calls:**\n```\nsdk.actions.ready\nsdk.actions.openUrl\nsdk.actions.close\nsdk.actions.composeCast\nsdk.actions.addMiniApp\nsdk.actions.requestWalletAddress\nsdk.actions.viewProfile\nsdk.actions.viewToken\nsdk.actions.sendToken\nsdk.actions.swapToken\nsdk.actions.signIn\nsdk.actions.setPrimaryButton\nsdk.actions.openMiniApp\nsdk.quickAuth\nsdk.context\nsdk.isInMiniApp\nsdk.getCapabilities\nsdk.haptics\nsdk.back\nsdk.wallet\n```\n\n**Connectors & providers:**\n```\nfarcasterMiniApp()\nminiAppConnector()\nfarcasterFrame()\nMiniAppProvider\nMiniAppContext\nuseMiniApp\nuseMiniAppContext\n```\n\n**Manifest & meta:**\n```\n.well-known\u002Ffarcaster.json\nfc:miniapp\nfc:frame\n```\n\n**Environment variables:**\n```\nNEYNAR_API_KEY\nNEXT_PUBLIC_NEYNAR_CLIENT_ID\nFARCASTER_\nFC_\n```\n\n### 1D. Check Existing Web3 Setup\n\nLook for:\n- `coinbaseWallet` connector in wagmi config\n- SIWE \u002F `siwe` package usage\n- `connectkit`, `rainbowkit`, or `@coinbase\u002Fonchainkit`\n- Existing wallet connection UI\n\n### 1E. Check Separation Boundaries\n\nMap where Farcaster logic currently lives:\n\n- Root providers or app shell\n- Shared hooks or auth middleware\n- One-off components\n- Dedicated routes\u002Fpages like `app\u002Ffarcaster\u002F*`\n- Server routes used only by Farcaster functionality\n\nMark each location with one action:\n- **remove**\n- **stub**\n- **move behind isolated route\u002Fpage**\n- **keep only as read-only**\n\n### 1F. Report Findings\n\nCreate a path-scoped summary.\n\n**All paths include:**\n```\n## Conversion Analysis — Path [X]: [Name]\n\n**Framework:** [detected]\n**Farcaster packages:** [list]\n**Files with Farcaster code:** [count]\n\n### Wagmi Connector\n- File: [path]\n- Current connector: [farcasterMiniApp \u002F miniAppConnector \u002F farcasterFrame \u002F none]\n- Other connectors: [list]\n- Action: [replace with coinbaseWallet \u002F leave existing wallet setup \u002F remove only]\n\n### MiniApp Provider\n- File: [path]\n- Pattern: [simple \u002F complex]\n- Consumers: [files importing from this]\n- Action: [stub \u002F remove \u002F isolate]\n\n### SDK Action Calls\n[list each: file, what it does, action]\n\n### Manifest & Meta\n- Manifest route: [path or N\u002FA]\n- Meta tags: [file or N\u002FA]\n```\n\n**Path A additionally includes:**\n```\n### Main App Outcome\n- Action: remove Farcaster-specific UI and flows from the main app entirely\n\n### Authentication\n- Quick Auth used: [yes\u002Fno, file]\n- Action: replace with SIWE \u002F keep existing non-Farcaster auth \u002F remove\n\n### Existing Neynar Usage\n- Package or files: [list or N\u002FA]\n- Action: remove entirely unless the user later re-scopes to Path B\n\n### Environment Variables\n[list all FC\u002FNeynar vars that will be removed]\n```\n\n**Path B additionally includes:**\n```\n### Main App Outcome\n- Action: convert the main app into a normal web app first\n\n### Isolated Farcaster Surface\n- Route\u002Fpage to keep: [path or proposed path]\n- Scope: [read-only \u002F mixed \u002F host-specific]\n- Recommended target scope: [prefer read-only \u002F quarantine existing behavior \u002F remove]\n\n### Authentication\n- Quick Auth used: [yes\u002Fno, file]\n- Main app action: replace with SIWE \u002F keep existing non-Farcaster auth \u002F remove\n- Isolated Farcaster surface action: [remove auth coupling \u002F preserve existing isolated flow only if explicitly requested]\n\n### Existing Neynar Usage\n- Package or files: [list or N\u002FA]\n- Action: [remove \u002F keep only inside isolated surface]\n\n### Environment Variables\n- Remove from main app: [FC_*, FARCASTER_*, etc.]\n- Keep only if isolated surface truly still needs them: [NEYNAR_API_KEY, etc. or N\u002FA]\n```\n\n**All paths end with:**\n```\n### Potential Issues\n- [ ] FID used as database primary key\n- [ ] Farcaster colors in tailwind config\n- [ ] `isInMiniApp` branches with unique else logic\n- [ ] Components only meaningful inside Farcaster\n- [ ] Farcaster code mixed into shared providers or root layout\n```\n\nAsk:\n\n> Does this analysis look correct? Ready to proceed with conversion?\n\n**STOP and wait for user confirmation before Phase 2.**\n\n---\n\n## Phase 2: Conversion\n\nSteps are organized by feature area. Each step notes which paths it applies to and what to do differently for `Path B`.\n\n### 2A. Wagmi Connector (All Paths)\n\nFind the wagmi config file (`lib\u002Fwagmi.ts`, `config\u002Fwagmi.ts`, `providers\u002Fwagmi-provider.tsx`, etc.):\n\n1. Remove import of `farcasterMiniApp` or `miniAppConnector` from `@farcaster\u002Fminiapp-wagmi-connector`\n2. Remove the `farcasterMiniApp()` \u002F `miniAppConnector()` call from the `connectors` array\n3. If no wallet connector remains, add:\n   ```typescript\n   import { coinbaseWallet } from \"wagmi\u002Fconnectors\";\n\n   coinbaseWallet({ appName: \"\u003Capp name>\" })\n   ```\n4. If `coinbaseWallet` already exists, leave it as-is\n5. Clean up empty lines and stale imports\n\nSkip this step if wagmi is not in the project.\n\n### 2B. MiniApp Provider \u002F Context (All Paths)\n\nIf the app has a shared Mini App provider, remove host\u002Fruntime assumptions from the main app.\n\n**Pattern A: simple provider**\n\nReplace with a safe stub:\n\n```tsx\n'use client'\n\nimport React, { createContext, useContext, useMemo } from \"react\";\n\ninterface MiniAppContextType {\n  context: undefined;\n  ready: boolean;\n  isInMiniApp: boolean;\n}\n\nconst MiniAppContext = createContext\u003CMiniAppContextType | undefined>(undefined);\n\nexport function useMiniAppContext() {\n  const context = useContext(MiniAppContext);\n  if (context === undefined) {\n    throw new Error(\"useMiniAppContext must be used within a MiniAppProvider\");\n  }\n  return context;\n}\n\nexport default function MiniAppProvider({ children }: { children: React.ReactNode }) {\n  const value = useMemo(\n    () => ({\n      context: undefined,\n      ready: true,\n      isInMiniApp: false,\n    }),\n    []\n  );\n\n  return \u003CMiniAppContext.Provider value={value}>{children}\u003C\u002FMiniAppContext.Provider>;\n}\n```\n\nPreserve export style and hook names so consumers do not break.\n\n**Pattern B: complex provider**\n\n- If many consumers depend on it, stub it first.\n- If only a few files use it, remove it and update those imports directly.\n- In `Path B`, do not let the isolated Farcaster surface keep this provider wired through the root app shell. If needed, make it local to the isolated route only.\n\n### 2C. Authentication\n\nThe main app should use normal web auth, not Mini App auth.\n\n**Default rule for both paths:**\n- If `sdk.quickAuth.getToken()` is used, replace it with SIWE or remove it.\n- If a normal non-Farcaster auth system already exists, prefer that over adding new auth.\n- Do not introduce new Farcaster or Neynar auth as the default conversion target.\n\n#### SIWE Replacement Pattern\n\n**Client-side** (e.g. `useSignIn.ts`):\n- Remove `import sdk from \"@farcaster\u002Fminiapp-sdk\"`\n- Remove `sdk.quickAuth.getToken()`\n- Replace with:\n  1. Get wallet address from `useAccount()` (wagmi)\n  2. Create a SIWE message with `siwe`\n  3. Sign with `useSignMessage()` (wagmi)\n  4. Send signature + message to the backend for verification\n\n**Server-side** (e.g. `app\u002Fapi\u002Fauth\u002Fsign-in\u002Froute.ts`):\n- Remove `@farcaster\u002Fquick-auth` verification\n- Replace with SIWE verification:\n  1. Parse the SIWE message\n  2. Verify the signature with `siwe` or `viem`\n  3. Use recovered wallet address as the normal app identity\n\n**If FID is used as a database primary key:**\n- Do not auto-change schema\n- Add a TODO comment for later migration\n- Warn in Phase 4 summary\n\n**Path B note:**\n- If the isolated Farcaster surface already has its own auth or integration flow and the user explicitly wants to keep it, quarantine it there only.\n- Do not let that flow remain the default app-wide auth system.\n\n### 2D. SDK Action Calls\n\n#### 2D-1. Main replacements for both paths\n\n| Original | Replacement |\n|----------|-------------|\n| `sdk.actions.ready()` | Remove entirely |\n| `sdk.actions.openUrl(url)` | `window.open(url, \"_blank\")` |\n| `sdk.actions.close()` | `window.close()` or remove |\n| `sdk.actions.composeCast(...)` | Remove from the main app |\n| `sdk.actions.addMiniApp()` | Remove call and UI |\n| `sdk.actions.requestWalletAddress()` | Remove; wagmi handles wallet access |\n| `sdk.actions.viewProfile(fid)` | `window.open(\\`https:\u002F\u002Fwarpcast.com\u002F~\u002Fprofiles\u002F${fid}\\`, \"_blank\")` |\n| `sdk.actions.viewToken(opts)` | `window.open(\\`https:\u002F\u002Fbasescan.org\u002Ftoken\u002F${opts.token}\\`, \"_blank\")` |\n| `sdk.actions.sendToken(opts)` | Replace with wagmi flow if the feature matters, otherwise remove |\n| `sdk.actions.swapToken(opts)` | Remove call and UI unless there is a real app-specific swap feature outside Farcaster |\n| `sdk.actions.signIn(...)` | Remove; auth handled by normal web auth |\n| `sdk.actions.setPrimaryButton(...)` | Remove entirely |\n| `sdk.actions.openMiniApp(...)` | Remove from the main app |\n| `sdk.isInMiniApp()` | Remove conditional and keep the non-Farcaster branch |\n| `sdk.context` | Remove from the main app |\n| `sdk.getCapabilities()` | Remove or replace with `async () => []` |\n| `sdk.haptics.*` | Remove entirely |\n| `sdk.back.*` | Remove entirely |\n| `sdk.wallet.*` | Remove; wagmi handles wallet access |\n\nFor conditional `isInMiniApp` branches:\n\n```tsx\n\u002F\u002F BEFORE\nif (isInMiniApp) {\n  sdk.actions.openUrl(url);\n} else {\n  window.open(url, \"_blank\");\n}\n\n\u002F\u002F AFTER\nwindow.open(url, \"_blank\");\n```\n\nAlways keep the normal web branch.\n\n#### 2D-2. Path B overrides\n\n`Path B` does **not** mean \"recreate everything.\" It means \"keep the main app clean and preserve the smallest separate Farcaster surface possible.\"\n\n- `sdk.context`\n  - Remove from the main app\n  - For the isolated surface, prefer replacing it with read-only fetched data or explicit route params\n  - Remove `context.location`, `context.client`, safe area, and other host-derived assumptions unless the user explicitly insists on preserving a host-specific page\n\n- `sdk.actions.composeCast(...)`\n  - Remove from the main app\n  - If the user only needs read-only, delete it entirely\n  - If they insist on preserving it, keep it isolated behind a dedicated page\u002Fpath and flag it as a manual follow-up rather than rebuilding it by default\n\n- `sdk.actions.openMiniApp(...)`\n  - Remove from the main app\n  - Only keep it in an isolated route if the user explicitly wants a Farcaster-only surface\n\n- notifications \u002F haptics \u002F host buttons\n  - Remove from the main app\n  - Preserve only if the isolated route truly depends on them and the user has explicitly opted into that complexity\n\n### 2E. Optional Read-Only Farcaster Data (Path B only)\n\nIf the user wants an isolated Farcaster surface, prefer **read-only** data first.\n\n**Create `lib\u002Ffarcaster-readonly.ts`** (or equivalent) only if the app needs it:\n\n```typescript\nconst HUB_URL = \"https:\u002F\u002Fhub.farcaster.xyz\";\n\nexport async function getUserData(fid: number) {\n  const res = await fetch(`${HUB_URL}\u002Fv1\u002FuserDataByFid?fid=${fid}`);\n  if (!res.ok) throw new Error(`Hub user data fetch failed: ${res.status}`);\n  return res.json();\n}\n\nexport async function getCastsByFid(fid: number, pageSize = 25) {\n  const res = await fetch(`${HUB_URL}\u002Fv1\u002FcastsByFid?fid=${fid}&pageSize=${pageSize}`);\n  if (!res.ok) throw new Error(`Hub casts fetch failed: ${res.status}`);\n  return res.json();\n}\n```\n\nThen:\n- Keep these calls inside the isolated route\u002Fpage only\n- Do not thread Farcaster data requirements through the main app shell\n- If the project already has a small isolated Neynar-based read-only integration, you may keep it only if removing it would create more churn than it saves\n- Do not add new Neynar packages for this by default\n\n### 2F. Manifest Route (All Paths)\n\nDelete `.well-known\u002Ffarcaster.json` route:\n- `app\u002F.well-known\u002Ffarcaster.json\u002Froute.ts`\n- `public\u002F.well-known\u002Ffarcaster.json`\n- `api\u002Ffarcaster-manifest.ts` or similar helpers\n\nIf the `.well-known` directory becomes empty, delete it.\n\n### 2G. Meta Tags (All Paths)\n\nIn root layout or metadata files, remove:\n- `\u003Cmeta>` tags with `property=\"fc:miniapp*\"` or `property=\"fc:frame*\"`\n- `Metadata.other` entries that only exist for Farcaster tags\n- `generateMetadata` logic that only produces Mini App metadata\n\n### 2H. Dependencies\n\n**All paths — remove:**\n- `@farcaster\u002Fminiapp-sdk`, `@farcaster\u002Fminiapp-wagmi-connector`, `@farcaster\u002Fminiapp-core`\n- `@farcaster\u002Fframe-sdk`, `@farcaster\u002Fframe-wagmi-connector`\n- `@farcaster\u002Fquick-auth`, `@farcaster\u002Fauth-kit`\n\n**Path A — also remove:**\n- `@neynar\u002Fnodejs-sdk`, `@neynar\u002Freact`\n- any other Neynar packages or helpers\n\n**Path B — remove by default:**\n- `@neynar\u002Fnodejs-sdk`, `@neynar\u002Freact`, and Neynar helpers unless they remain inside the intentionally isolated Farcaster surface\n\n**All paths — add only if truly needed:**\n- `siwe` if SIWE auth is introduced and not already present\n\nDo not add new Neynar packages as part of the default conversion.\n\n### 2I. Farcaster-Specific Routes & Components\n\n**Path A:**\n- Delete `app\u002Ffarcaster\u002F`, `pages\u002Ffarcaster\u002F`, and Farcaster-only components entirely\n- Delete Farcaster-only API routes such as `\u002Fapi\u002Ffarcaster\u002F*` and `\u002Fapi\u002Fneynar\u002F*`\n- Remove any navigation links that point to deleted routes\n\n**Path B:**\n- Keep the main app route tree clean\n- Move preserved Farcaster UI behind one dedicated route\u002Fpage if it is not already isolated\n- Prefer names like `app\u002Ffarcaster\u002F` or `app\u002Fsocial\u002F` over spreading Farcaster logic throughout generic shared pages\n- Remove any component that has no purpose outside that isolated surface\n- Keep any remaining Neynar usage, if any, confined to that isolated route\u002Fpage and its server helpers only\n\n---\n\n## Phase 3: Cleanup\n\n### 3A. Update `package.json`\n\n**All paths — remove Mini App packages:**\n- `@farcaster\u002Fminiapp-sdk`, `@farcaster\u002Fminiapp-wagmi-connector`, `@farcaster\u002Fminiapp-core`\n- `@farcaster\u002Fframe-sdk`, `@farcaster\u002Fframe-wagmi-connector`\n- `@farcaster\u002Fquick-auth`, `@farcaster\u002Fauth-kit`\n\n**Path A — also remove:**\n- all `@neynar\u002F*` packages\n\n**Path B — remove unless still isolated and intentionally preserved:**\n- `@neynar\u002F*`\n\n**All paths — add if introduced:**\n- `siwe`\n\n### 3B. Environment Variables\n\n**Path A — remove from all `.env*` files:**\n- `NEYNAR_API_KEY`\n- `NEXT_PUBLIC_NEYNAR_CLIENT_ID`\n- `FARCASTER_*`\n- `FC_*`\n- `NEXT_PUBLIC_FC_*`\n- `NEXT_PUBLIC_FARCASTER_*`\n\n**Path B — remove from the main app by default:**\n- `FARCASTER_*`\n- `FC_*`\n- `NEXT_PUBLIC_FC_*`\n- `NEXT_PUBLIC_FARCASTER_*`\n\nOnly keep `NEYNAR_*` vars if the isolated surface explicitly still depends on existing Neynar integration.\n\nAlso update env validation schemas (`env.ts`, `env.mjs`, zod schemas, etc.).\n\n### 3C. Dead Code Cleanup\n\n- Remove unused imports from modified files\n- Remove unused Farcaster types and helper functions\n- Remove empty import statements\n- Remove dead hooks or API wrappers that only existed for the Mini App SDK\n\n### 3D. Tailwind Colors\n\nIf `tailwind.config.ts` or `tailwind.config.js` includes Farcaster brand colors such as `farcaster: \"#8B5CF6\"`, remove them unless that branding is intentionally kept inside an isolated Farcaster-only surface.\n\n### 3E. Install Dependencies\n\nTell the user:\n\n```bash\nnpm install\n```\n\n---\n\n## Phase 4: Verification\n\n### 4A. Search for Remaining References\n\n**All paths — search for:**\n```\n@farcaster\nfarcasterMiniApp\nminiAppConnector\nsdk.actions\nsdk.quickAuth\nsdk.context\nfc:miniapp\nfc:frame\n```\n\n**Path A — also search for:**\n```\n@neynar\nNEYNAR_API_KEY\nNEXT_PUBLIC_NEYNAR_CLIENT_ID\napi.neynar.com\n```\n\n**Path B — if Neynar was intentionally preserved:**\n- verify that remaining `@neynar` imports and env vars exist only inside the isolated Farcaster surface and its server helpers\n\nReport any source matches, ignoring `node_modules`, lock files, and git history.\n\n### 4B. Type Check\n\n```bash\nnpx tsc --noEmit\n```\n\nReport and fix type errors.\n\n### 4C. Build Check\n\n```bash\nnpm run build\n```\n\nReport and fix build errors.\n\n### 4D. Conversion Summary\n\n```\n## Conversion Complete — Path [X]: [Name]\n\n**Files modified:** [count]\n**Files deleted:** [count]\n**Files created:** [count, if any]\n**Packages removed:** [list]\n**Packages added:** [list, if any]\n\n### What was done\n- [x] Removed Farcaster Mini App wagmi connector\n- [x] Stubbed or removed Mini App provider\u002Fcontext\n- [x] Replaced Mini App auth with normal web auth or removed it\n- [x] Removed or replaced SDK action calls\n- [x] Deleted manifest route\n- [x] Removed Farcaster meta tags\n- [x] Cleaned up dependencies and env vars\n```\n\n**Path B summary additionally includes:**\n```\n- [x] Kept the main app as a normal web app\n- [x] Confined remaining Farcaster functionality to a dedicated route\u002Fpage\n- [x] Preferred read-only Farcaster data where possible\n- [x] Removed Farcaster host\u002Fruntime coupling from shared app infrastructure\n```\n\n**All paths end with:**\n```\n### Manual steps\n- [ ] Run `npm install`\n- [ ] Test wallet connection flow\n- [ ] If FID migration is needed, migrate from FID-based identity to wallet address\n- [ ] If Path B preserves a Farcaster-only area, verify it stays isolated from the main app shell\n\n### Verification\n- TypeScript: [pass\u002Ffail]\n- Build: [pass\u002Ffail]\n- Remaining Farcaster references: [none \u002F list]\n```\n\n---\n\n## Edge Cases\n\n### No wagmi\n\nSkip Phase 2A. Do not introduce wagmi unless the app actually needs wallet connectivity.\n\n### No auth system\n\nSkip Phase 2C. Do not add SIWE unnecessarily.\n\n### `@farcaster\u002Fframe-sdk` (older)\n\nTreat identically to `@farcaster\u002Fminiapp-sdk`.\n\n### Monorepo\n\nAsk which workspace(s) to convert. Only modify those.\n\n### FID as database primary key\n\nDo not change schema automatically. Flag it and warn in Phase 4.\n\n### Conditional `isInMiniApp` branches\n\nAlways keep the normal web branch and remove the Mini App branch.\n\n### Components with no non-Farcaster purpose\n\nDelete them entirely in `Path A`. In `Path B`, keep them only if they live inside the isolated Farcaster route\u002Fpage.\n\n### Existing Neynar usage\n\nIf the project already uses Neynar:\n- remove it in `Path A`\n- keep it only if it remains inside the isolated `Path B` surface\n- do not add more Neynar usage than already exists unless the user explicitly requests it\n\n### Read-only is usually enough\n\nIf the user says they want to \"keep Farcaster stuff,\" bias toward:\n- profile links\n- read-only profile or cast display\n- a dedicated social page\n\nDo not assume they want write access, notifications, or host\u002Fruntime behavior.\n\n### Quiz ambiguity\n\nIf the scan and quiz conflict, point it out and ask the user to confirm the smaller keep-surface first.\n\n---\n\n## Security\n\n- **Validate wallet setup** — ensure `coinbaseWallet` or the chosen wallet connector is configured correctly\n- **FID-based identity** — requires manual database migration if used as a primary key\n- **SIWE verification** — verify signatures server-side before trusting them\n- **Preserved isolated surface** — do not let a Farcaster-only route\u002Fpage leak host\u002Fruntime assumptions into the main app shell\n- **Existing Neynar usage** — keep API keys server-side only, and only if that isolated surface still depends on them","# Convert Farcaster Miniapp to Base App\n\nConvert a Farcaster miniapp into a normal app on Base. The default outcome is a regular web app that works in the Base app browser and on the open web, with Farcaster Mini App host coupling removed.\n\nIf some Farcaster functionality truly needs to survive, keep it separate from the main app surface. Prefer read-only data first. Only preserve Mini App-specific behavior when the user explicitly insists, and isolate it behind a dedicated route or page rather than carrying it through the whole app.\n\n## Core Principle\n\nAlways separate these decisions:\n\n1. Remove Mini App host\u002Fruntime coupling.\n2. Decide whether any Farcaster-facing functionality should remain.\n3. If something remains, keep it isolated from the main app and avoid introducing new vendor dependencies by default.\n\nDo **not** automatically turn \"keep some Farcaster functionality\" into \"migrate to Neynar.\" If a project already uses Neynar and the user wants to keep an isolated Farcaster-only area, you may preserve that existing integration. Do not introduce new Neynar adoption as the default recommendation.\n\n## Quick Start\n\nFollow these five phases sequentially:\n\n0. **Discovery** — Quick scan + quiz to choose a path\n1. **Analysis** — Detailed read-only analysis scoped to the chosen path\n2. **Conversion** — Remove Mini App SDK patterns and isolate any intentionally preserved Farcaster surface\n3. **Cleanup** — Remove dead code, env vars, and dependencies\n4. **Verification** — Type check, build, and summarize\n\n## Conversion Paths\n\nThe quiz should route the user into one of two paths:\n\n| Path | Name | Who it's for | What happens |\n|------|------|-------------|-------------|\n| **A** | Regular App Default | Most projects | Strip Farcaster Mini App coupling and become a normal Base\u002Fweb app |\n| **B** | Isolated Farcaster Surface | The app still needs a small Farcaster-specific area | Convert the main app into a normal app, then keep only a separate Farcaster route\u002Fpage for the remaining functionality |\n\n`Path B` is still biased toward removing complexity:\n- Prefer **read-only** Farcaster data.\n- Avoid preserving Mini App host\u002Fruntime behavior unless the user explicitly asks for it.\n- Keep any preserved Farcaster logic out of the main app shell, shared providers, and primary auth flow.\n\n---\n\n## Phase 0: Discovery\n\n### 0A. Quick Scan (automated, no user interaction)\n\nRun a lightweight scan before asking questions. Produce an internal tally:\n\n1. **Detect framework** from `package.json` (`next`, `vite`, `react-scripts`, `@remix-run\u002F*`)\n2. **Count Farcaster packages** in `dependencies` and `devDependencies`\n3. **Grep source files** (`.ts`, `.tsx`, `.js`, `.jsx`) for:\n   - `sdk.actions.*` calls (count total)\n   - `sdk.quickAuth` usage (yes\u002Fno)\n   - `sdk.context` usage (yes\u002Fno)\n   - `.well-known\u002Ffarcaster.json` (yes\u002Fno)\n   - `farcasterMiniApp` \u002F `miniAppConnector` connector (yes\u002Fno)\n   - Total files with any `@farcaster\u002F` import\n   - `@neynar\u002F` imports or `api.neynar.com` fetch calls (yes\u002Fno)\n4. **Identify the blast radius**:\n   - Are Farcaster references spread across the main app shell?\n   - Are they already mostly confined to a route like `app\u002Ffarcaster\u002F`, `pages\u002Ffarcaster\u002F`, or a small set of components?\n   - Are there obvious host-only features such as haptics, notifications, `openMiniApp`, or `sdk.context.client`?\n\nUse this tally to inform quiz suggestions. Do **not** dump raw scan output to the user before asking the quiz.\n\n### 0B. Interactive Quiz\n\nAsk these questions one at a time. Use the quick scan results to suggest the most likely answer.\n\n**Q1** (always ask):\n\n> Based on my scan, your project has [X] files using the Farcaster SDK with [summary of what is used].\n>\n> Which outcome do you want?\n> - **(a) Regular app everywhere** — remove Farcaster-specific behavior and just keep a normal Base\u002Fweb app\n> - **(b) Regular app first, plus a separate Farcaster area** — keep the main app clean, but preserve a small isolated route\u002Fpage if really needed\n\n**Q2** (always ask):\n\n> How deeply is the Mini App SDK used today?\n> - **(a) Minimal** — mostly `sdk.actions.ready()` and a few helpers\n> - **(b) Moderate** — some `context`, `openUrl`, profile links, or conditional `isInMiniApp` logic\n> - **(c) Heavy** — auth, wallet connector, notifications, compose flows, or host-specific behavior\n\n**Q3** (ask if Q1 = b):\n\n> What is the smallest Farcaster feature set you actually need to preserve?\n> - **(a) Read-only only** — profile or cast display, links out to Farcaster profiles, maybe a small social page\n> - **(b) Some Farcaster-specific interactions** — there is a separate page\u002Fpath that still needs more than read-only behavior\n> - **(c) Not sure** — analyze what is isolated already and recommend the smallest keep-surface possible\n\n**Q4** (ask if Q1 = b and there is existing isolated Farcaster code or existing Neynar usage):\n\n> Does the project already have an isolated Farcaster-only route\u002Fpage or integration that you want to keep as-is if possible?\n> - **(a) Yes** — preserve only that isolated surface\n> - **(b) No** — prefer removing it unless there is a very strong reason to keep it\n\n**Q5** (ask if quick auth or other Mini App auth is present):\n\n> After conversion, what should the main app use for authentication?\n> - **(a) SIWE** — wallet-based auth for the regular app\n> - **(b) Existing non-Farcaster auth** — keep whatever normal web auth already exists\n> - **(c) No auth** — remove auth entirely\n\n### 0C. Path Selection\n\nMap answers to a path:\n\n| Desired outcome | Typical result |\n|-----------------|----------------|\n| `Q1 = regular app everywhere` | **Path A** — Regular App Default |\n| `Q1 = regular app first, plus separate Farcaster area` | **Path B** — Isolated Farcaster Surface |\n\nThen tighten the recommendation:\n\n- If the user chose `Path B`, prefer **read-only preservation** unless they explicitly require something else.\n- If the scan shows heavy host\u002Fruntime coupling but the user wants `Path A`, warn them that some features will be deleted rather than recreated.\n- If the project already uses Neynar, only keep it if it remains inside the isolated Farcaster surface. Do not expand it into the main app.\n\nAnnounce the chosen path:\n\n> Based on your answers, I'll use **Path [X]: [Name]**. This will [one-sentence description]. I'll now do a detailed analysis of your project.\n\nRecord the quiz answers internally. They guide whether the agent should:\n- fully remove Farcaster features\n- preserve only a read-only isolated surface\n- quarantine any unavoidable Farcaster-specific logic to a dedicated route\u002Fpage\n\n**Proceed to Phase 1.**\n\n---\n\n## Phase 1: Analysis (Read-Only)\n\n### 1A. Detect Framework\n\nRead `package.json`:\n- `next` → Next.js\n- `vite` → Vite\n- `react-scripts` → Create React App\n- `@remix-run\u002F*` → Remix\n\n### 1B. Scan for Farcaster Dependencies\n\nList all packages matching:\n- `@farcaster\u002Fminiapp-sdk`, `@farcaster\u002Fminiapp-core`, `@farcaster\u002Fminiapp-wagmi-connector`\n- `@farcaster\u002Fframe-sdk`, `@farcaster\u002Fframe-wagmi-connector`\n- `@farcaster\u002Fquick-auth`, `@farcaster\u002Fauth-kit`\n- `@neynar\u002F*` (compatibility only; do not assume it stays)\n\n### 1C. Grep for Farcaster Code\n\nSearch source files (`.ts`, `.tsx`, `.js`, `.jsx`) for:\n\n**SDK imports:**\n```\n@farcaster\u002Fminiapp-sdk\n@farcaster\u002Fminiapp-core\n@farcaster\u002Fminiapp-wagmi-connector\n@farcaster\u002Fframe-sdk\n@farcaster\u002Fframe-wagmi-connector\n@farcaster\u002Fquick-auth\n@farcaster\u002Fauth-kit\n@neynar\u002F\n```\n\n**SDK calls:**\n```\nsdk.actions.ready\nsdk.actions.openUrl\nsdk.actions.close\nsdk.actions.composeCast\nsdk.actions.addMiniApp\nsdk.actions.requestWalletAddress\nsdk.actions.viewProfile\nsdk.actions.viewToken\nsdk.actions.sendToken\nsdk.actions.swapToken\nsdk.actions.signIn\nsdk.actions.setPrimaryButton\nsdk.actions.openMiniApp\nsdk.quickAuth\nsdk.context\nsdk.isInMiniApp\nsdk.getCapabilities\nsdk.haptics\nsdk.back\nsdk.wallet\n```\n\n**Connectors & providers:**\n```\nfarcasterMiniApp()\nminiAppConnector()\nfarcasterFrame()\nMiniAppProvider\nMiniAppContext\nuseMiniApp\nuseMiniAppContext\n```\n\n**Manifest & meta:**\n```\n.well-known\u002Ffarcaster.json\nfc:miniapp\nfc:frame\n```\n\n**Environment variables:**\n```\nNEYNAR_API_KEY\nNEXT_PUBLIC_NEYNAR_CLIENT_ID\nFARCASTER_\nFC_\n```\n\n### 1D. Check Existing Web3 Setup\n\nLook for:\n- `coinbaseWallet` connector in wagmi config\n- SIWE \u002F `siwe` package usage\n- `connectkit`, `rainbowkit`, or `@coinbase\u002Fonchainkit`\n- Existing wallet connection UI\n\n### 1E. Check Separation Boundaries\n\nMap where Farcaster logic currently lives:\n\n- Root providers or app shell\n- Shared hooks or auth middleware\n- One-off components\n- Dedicated routes\u002Fpages like `app\u002Ffarcaster\u002F*`\n- Server routes used only by Farcaster functionality\n\nMark each location with one action:\n- **remove**\n- **stub**\n- **move behind isolated route\u002Fpage**\n- **keep only as read-only**\n\n### 1F. Report Findings\n\nCreate a path-scoped summary.\n\n**All paths include:**\n```\n## Conversion Analysis — Path [X]: [Name]\n\n**Framework:** [detected]\n**Farcaster packages:** [list]\n**Files with Farcaster code:** [count]\n\n### Wagmi Connector\n- File: [path]\n- Current connector: [farcasterMiniApp \u002F miniAppConnector \u002F farcasterFrame \u002F none]\n- Other connectors: [list]\n- Action: [replace with coinbaseWallet \u002F leave existing wallet setup \u002F remove only]\n\n### MiniApp Provider\n- File: [path]\n- Pattern: [simple \u002F complex]\n- Consumers: [files importing from this]\n- Action: [stub \u002F remove \u002F isolate]\n\n### SDK Action Calls\n[list each: file, what it does, action]\n\n### Manifest & Meta\n- Manifest route: [path or N\u002FA]\n- Meta tags: [file or N\u002FA]\n```\n\n**Path A additionally includes:**\n```\n### Main App Outcome\n- Action: remove Farcaster-specific UI and flows from the main app entirely\n\n### Authentication\n- Quick Auth used: [yes\u002Fno, file]\n- Action: replace with SIWE \u002F keep existing non-Farcaster auth \u002F remove\n\n### Existing Neynar Usage\n- Package or files: [list or N\u002FA]\n- Action: remove entirely unless the user later re-scopes to Path B\n\n### Environment Variables\n[list all FC\u002FNeynar vars that will be removed]\n```\n\n**Path B additionally includes:**\n```\n### Main App Outcome\n- Action: convert the main app into a normal web app first\n\n### Isolated Farcaster Surface\n- Route\u002Fpage to keep: [path or proposed path]\n- Scope: [read-only \u002F mixed \u002F host-specific]\n- Recommended target scope: [prefer read-only \u002F quarantine existing behavior \u002F remove]\n\n### Authentication\n- Quick Auth used: [yes\u002Fno, file]\n- Main app action: replace with SIWE \u002F keep existing non-Farcaster auth \u002F remove\n- Isolated Farcaster surface action: [remove auth coupling \u002F preserve existing isolated flow only if explicitly requested]\n\n### Existing Neynar Usage\n- Package or files: [list or N\u002FA]\n- Action: [remove \u002F keep only inside isolated surface]\n\n### Environment Variables\n- Remove from main app: [FC_*, FARCASTER_*, etc.]\n- Keep only if isolated surface truly still needs them: [NEYNAR_API_KEY, etc. or N\u002FA]\n```\n\n**All paths end with:**\n```\n### Potential Issues\n- [ ] FID used as database primary key\n- [ ] Farcaster colors in tailwind config\n- [ ] `isInMiniApp` branches with unique else logic\n- [ ] Components only meaningful inside Farcaster\n- [ ] Farcaster code mixed into shared providers or root layout\n```\n\nAsk:\n\n> Does this analysis look correct? Ready to proceed with conversion?\n\n**STOP and wait for user confirmation before Phase 2.**\n\n---\n\n## Phase 2: Conversion\n\nSteps are organized by feature area. Each step notes which paths it applies to and what to do differently for `Path B`.\n\n### 2A. Wagmi Connector (All Paths)\n\nFind the wagmi config file (`lib\u002Fwagmi.ts`, `config\u002Fwagmi.ts`, `providers\u002Fwagmi-provider.tsx`, etc.):\n\n1. Remove import of `farcasterMiniApp` or `miniAppConnector` from `@farcaster\u002Fminiapp-wagmi-connector`\n2. Remove the `farcasterMiniApp()` \u002F `miniAppConnector()` call from the `connectors` array\n3. If no wallet connector remains, add:\n   ```typescript\n   import { coinbaseWallet } from \"wagmi\u002Fconnectors\";\n\n   coinbaseWallet({ appName: \"\u003Capp name>\" })\n   ```\n4. If `coinbaseWallet` already exists, leave it as-is\n5. Clean up empty lines and stale imports\n\nSkip this step if wagmi is not in the project.\n\n### 2B. MiniApp Provider \u002F Context (All Paths)\n\nIf the app has a shared Mini App provider, remove host\u002Fruntime assumptions from the main app.\n\n**Pattern A: simple provider**\n\nReplace with a safe stub:\n\n```tsx\n'use client'\n\nimport React, { createContext, useContext, useMemo } from \"react\";\n\ninterface MiniAppContextType {\n  context: undefined;\n  ready: boolean;\n  isInMiniApp: boolean;\n}\n\nconst MiniAppContext = createContext\u003CMiniAppContextType | undefined>(undefined);\n\nexport function useMiniAppContext() {\n  const context = useContext(MiniAppContext);\n  if (context === undefined) {\n    throw new Error(\"useMiniAppContext must be used within a MiniAppProvider\");\n  }\n  return context;\n}\n\nexport default function MiniAppProvider({ children }: { children: React.ReactNode }) {\n  const value = useMemo(\n    () => ({\n      context: undefined,\n      ready: true,\n      isInMiniApp: false,\n    }),\n    []\n  );\n\n  return \u003CMiniAppContext.Provider value={value}>{children}\u003C\u002FMiniAppContext.Provider>;\n}\n```\n\nPreserve export style and hook names so consumers do not break.\n\n**Pattern B: complex provider**\n\n- If many consumers depend on it, stub it first.\n- If only a few files use it, remove it and update those imports directly.\n- In `Path B`, do not let the isolated Farcaster surface keep this provider wired through the root app shell. If needed, make it local to the isolated route only.\n\n### 2C. Authentication\n\nThe main app should use normal web auth, not Mini App auth.\n\n**Default rule for both paths:**\n- If `sdk.quickAuth.getToken()` is used, replace it with SIWE or remove it.\n- If a normal non-Farcaster auth system already exists, prefer that over adding new auth.\n- Do not introduce new Farcaster or Neynar auth as the default conversion target.\n\n#### SIWE Replacement Pattern\n\n**Client-side** (e.g. `useSignIn.ts`):\n- Remove `import sdk from \"@farcaster\u002Fminiapp-sdk\"`\n- Remove `sdk.quickAuth.getToken()`\n- Replace with:\n  1. Get wallet address from `useAccount()` (wagmi)\n  2. Create a SIWE message with `siwe`\n  3. Sign with `useSignMessage()` (wagmi)\n  4. Send signature + message to the backend for verification\n\n**Server-side** (e.g. `app\u002Fapi\u002Fauth\u002Fsign-in\u002Froute.ts`):\n- Remove `@farcaster\u002Fquick-auth` verification\n- Replace with SIWE verification:\n  1. Parse the SIWE message\n  2. Verify the signature with `siwe` or `viem`\n  3. Use recovered wallet address as the normal app identity\n\n**If FID is used as a database primary key:**\n- Do not auto-change schema\n- Add a TODO comment for later migration\n- Warn in Phase 4 summary\n\n**Path B note:**\n- If the isolated Farcaster surface already has its own auth or integration flow and the user explicitly wants to keep it, quarantine it there only.\n- Do not let that flow remain the default app-wide auth system.\n\n### 2D. SDK Action Calls\n\n#### 2D-1. Main replacements for both paths\n\n| Original | Replacement |\n|----------|-------------|\n| `sdk.actions.ready()` | Remove entirely |\n| `sdk.actions.openUrl(url)` | `window.open(url, \"_blank\")` |\n| `sdk.actions.close()` | `window.close()` or remove |\n| `sdk.actions.composeCast(...)` | Remove from the main app |\n| `sdk.actions.addMiniApp()` | Remove call and UI |\n| `sdk.actions.requestWalletAddress()` | Remove; wagmi handles wallet access |\n| `sdk.actions.viewProfile(fid)` | `window.open(\\`https:\u002F\u002Fwarpcast.com\u002F~\u002Fprofiles\u002F${fid}\\`, \"_blank\")` |\n| `sdk.actions.viewToken(opts)` | `window.open(\\`https:\u002F\u002Fbasescan.org\u002Ftoken\u002F${opts.token}\\`, \"_blank\")` |\n| `sdk.actions.sendToken(opts)` | Replace with wagmi flow if the feature matters, otherwise remove |\n| `sdk.actions.swapToken(opts)` | Remove call and UI unless there is a real app-specific swap feature outside Farcaster |\n| `sdk.actions.signIn(...)` | Remove; auth handled by normal web auth |\n| `sdk.actions.setPrimaryButton(...)` | Remove entirely |\n| `sdk.actions.openMiniApp(...)` | Remove from the main app |\n| `sdk.isInMiniApp()` | Remove conditional and keep the non-Farcaster branch |\n| `sdk.context` | Remove from the main app |\n| `sdk.getCapabilities()` | Remove or replace with `async () => []` |\n| `sdk.haptics.*` | Remove entirely |\n| `sdk.back.*` | Remove entirely |\n| `sdk.wallet.*` | Remove; wagmi handles wallet access |\n\nFor conditional `isInMiniApp` branches:\n\n```tsx\n\u002F\u002F BEFORE\nif (isInMiniApp) {\n  sdk.actions.openUrl(url);\n} else {\n  window.open(url, \"_blank\");\n}\n\n\u002F\u002F AFTER\nwindow.open(url, \"_blank\");\n```\n\nAlways keep the normal web branch.\n\n#### 2D-2. Path B overrides\n\n`Path B` does **not** mean \"recreate everything.\" It means \"keep the main app clean and preserve the smallest separate Farcaster surface possible.\"\n\n- `sdk.context`\n  - Remove from the main app\n  - For the isolated surface, prefer replacing it with read-only fetched data or explicit route params\n  - Remove `context.location`, `context.client`, safe area, and other host-derived assumptions unless the user explicitly insists on preserving a host-specific page\n\n- `sdk.actions.composeCast(...)`\n  - Remove from the main app\n  - If the user only needs read-only, delete it entirely\n  - If they insist on preserving it, keep it isolated behind a dedicated page\u002Fpath and flag it as a manual follow-up rather than rebuilding it by default\n\n- `sdk.actions.openMiniApp(...)`\n  - Remove from the main app\n  - Only keep it in an isolated route if the user explicitly wants a Farcaster-only surface\n\n- notifications \u002F haptics \u002F host buttons\n  - Remove from the main app\n  - Preserve only if the isolated route truly depends on them and the user has explicitly opted into that complexity\n\n### 2E. Optional Read-Only Farcaster Data (Path B only)\n\nIf the user wants an isolated Farcaster surface, prefer **read-only** data first.\n\n**Create `lib\u002Ffarcaster-readonly.ts`** (or equivalent) only if the app needs it:\n\n```typescript\nconst HUB_URL = \"https:\u002F\u002Fhub.farcaster.xyz\";\n\nexport async function getUserData(fid: number) {\n  const res = await fetch(`${HUB_URL}\u002Fv1\u002FuserDataByFid?fid=${fid}`);\n  if (!res.ok) throw new Error(`Hub user data fetch failed: ${res.status}`);\n  return res.json();\n}\n\nexport async function getCastsByFid(fid: number, pageSize = 25) {\n  const res = await fetch(`${HUB_URL}\u002Fv1\u002FcastsByFid?fid=${fid}&pageSize=${pageSize}`);\n  if (!res.ok) throw new Error(`Hub casts fetch failed: ${res.status}`);\n  return res.json();\n}\n```\n\nThen:\n- Keep these calls inside the isolated route\u002Fpage only\n- Do not thread Farcaster data requirements through the main app shell\n- If the project already has a small isolated Neynar-based read-only integration, you may keep it only if removing it would create more churn than it saves\n- Do not add new Neynar packages for this by default\n\n### 2F. Manifest Route (All Paths)\n\nDelete `.well-known\u002Ffarcaster.json` route:\n- `app\u002F.well-known\u002Ffarcaster.json\u002Froute.ts`\n- `public\u002F.well-known\u002Ffarcaster.json`\n- `api\u002Ffarcaster-manifest.ts` or similar helpers\n\nIf the `.well-known` directory becomes empty, delete it.\n\n### 2G. Meta Tags (All Paths)\n\nIn root layout or metadata files, remove:\n- `\u003Cmeta>` tags with `property=\"fc:miniapp*\"` or `property=\"fc:frame*\"`\n- `Metadata.other` entries that only exist for Farcaster tags\n- `generateMetadata` logic that only produces Mini App metadata\n\n### 2H. Dependencies\n\n**All paths — remove:**\n- `@farcaster\u002Fminiapp-sdk`, `@farcaster\u002Fminiapp-wagmi-connector`, `@farcaster\u002Fminiapp-core`\n- `@farcaster\u002Fframe-sdk`, `@farcaster\u002Fframe-wagmi-connector`\n- `@farcaster\u002Fquick-auth`, `@farcaster\u002Fauth-kit`\n\n**Path A — also remove:**\n- `@neynar\u002Fnodejs-sdk`, `@neynar\u002Freact`\n- any other Neynar packages or helpers\n\n**Path B — remove by default:**\n- `@neynar\u002Fnodejs-sdk`, `@neynar\u002Freact`, and Neynar helpers unless they remain inside the intentionally isolated Farcaster surface\n\n**All paths — add only if truly needed:**\n- `siwe` if SIWE auth is introduced and not already present\n\nDo not add new Neynar packages as part of the default conversion.\n\n### 2I. Farcaster-Specific Routes & Components\n\n**Path A:**\n- Delete `app\u002Ffarcaster\u002F`, `pages\u002Ffarcaster\u002F`, and Farcaster-only components entirely\n- Delete Farcaster-only API routes such as `\u002Fapi\u002Ffarcaster\u002F*` and `\u002Fapi\u002Fneynar\u002F*`\n- Remove any navigation links that point to deleted routes\n\n**Path B:**\n- Keep the main app route tree clean\n- Move preserved Farcaster UI behind one dedicated route\u002Fpage if it is not already isolated\n- Prefer names like `app\u002Ffarcaster\u002F` or `app\u002Fsocial\u002F` over spreading Farcaster logic throughout generic shared pages\n- Remove any component that has no purpose outside that isolated surface\n- Keep any remaining Neynar usage, if any, confined to that isolated route\u002Fpage and its server helpers only\n\n---\n\n## Phase 3: Cleanup\n\n### 3A. Update `package.json`\n\n**All paths — remove Mini App packages:**\n- `@farcaster\u002Fminiapp-sdk`, `@farcaster\u002Fminiapp-wagmi-connector`, `@farcaster\u002Fminiapp-core`\n- `@farcaster\u002Fframe-sdk`, `@farcaster\u002Fframe-wagmi-connector`\n- `@farcaster\u002Fquick-auth`, `@farcaster\u002Fauth-kit`\n\n**Path A — also remove:**\n- all `@neynar\u002F*` packages\n\n**Path B — remove unless still isolated and intentionally preserved:**\n- `@neynar\u002F*`\n\n**All paths — add if introduced:**\n- `siwe`\n\n### 3B. Environment Variables\n\n**Path A — remove from all `.env*` files:**\n- `NEYNAR_API_KEY`\n- `NEXT_PUBLIC_NEYNAR_CLIENT_ID`\n- `FARCASTER_*`\n- `FC_*`\n- `NEXT_PUBLIC_FC_*`\n- `NEXT_PUBLIC_FARCASTER_*`\n\n**Path B — remove from the main app by default:**\n- `FARCASTER_*`\n- `FC_*`\n- `NEXT_PUBLIC_FC_*`\n- `NEXT_PUBLIC_FARCASTER_*`\n\nOnly keep `NEYNAR_*` vars if the isolated surface explicitly still depends on existing Neynar integration.\n\nAlso update env validation schemas (`env.ts`, `env.mjs`, zod schemas, etc.).\n\n### 3C. Dead Code Cleanup\n\n- Remove unused imports from modified files\n- Remove unused Farcaster types and helper functions\n- Remove empty import statements\n- Remove dead hooks or API wrappers that only existed for the Mini App SDK\n\n### 3D. Tailwind Colors\n\nIf `tailwind.config.ts` or `tailwind.config.js` includes Farcaster brand colors such as `farcaster: \"#8B5CF6\"`, remove them unless that branding is intentionally kept inside an isolated Farcaster-only surface.\n\n### 3E. Install Dependencies\n\nTell the user:\n\n```bash\nnpm install\n```\n\n---\n\n## Phase 4: Verification\n\n### 4A. Search for Remaining References\n\n**All paths — search for:**\n```\n@farcaster\nfarcasterMiniApp\nminiAppConnector\nsdk.actions\nsdk.quickAuth\nsdk.context\nfc:miniapp\nfc:frame\n```\n\n**Path A — also search for:**\n```\n@neynar\nNEYNAR_API_KEY\nNEXT_PUBLIC_NEYNAR_CLIENT_ID\napi.neynar.com\n```\n\n**Path B — if Neynar was intentionally preserved:**\n- verify that remaining `@neynar` imports and env vars exist only inside the isolated Farcaster surface and its server helpers\n\nReport any source matches, ignoring `node_modules`, lock files, and git history.\n\n### 4B. Type Check\n\n```bash\nnpx tsc --noEmit\n```\n\nReport and fix type errors.\n\n### 4C. Build Check\n\n```bash\nnpm run build\n```\n\nReport and fix build errors.\n\n### 4D. Conversion Summary\n\n```\n## Conversion Complete — Path [X]: [Name]\n\n**Files modified:** [count]\n**Files deleted:** [count]\n**Files created:** [count, if any]\n**Packages removed:** [list]\n**Packages added:** [list, if any]\n\n### What was done\n- [x] Removed Farcaster Mini App wagmi connector\n- [x] Stubbed or removed Mini App provider\u002Fcontext\n- [x] Replaced Mini App auth with normal web auth or removed it\n- [x] Removed or replaced SDK action calls\n- [x] Deleted manifest route\n- [x] Removed Farcaster meta tags\n- [x] Cleaned up dependencies and env vars\n```\n\n**Path B summary additionally includes:**\n```\n- [x] Kept the main app as a normal web app\n- [x] Confined remaining Farcaster functionality to a dedicated route\u002Fpage\n- [x] Preferred read-only Farcaster data where possible\n- [x] Removed Farcaster host\u002Fruntime coupling from shared app infrastructure\n```\n\n**All paths end with:**\n```\n### Manual steps\n- [ ] Run `npm install`\n- [ ] Test wallet connection flow\n- [ ] If FID migration is needed, migrate from FID-based identity to wallet address\n- [ ] If Path B preserves a Farcaster-only area, verify it stays isolated from the main app shell\n\n### Verification\n- TypeScript: [pass\u002Ffail]\n- Build: [pass\u002Ffail]\n- Remaining Farcaster references: [none \u002F list]\n```\n\n---\n\n## Edge Cases\n\n### No wagmi\n\nSkip Phase 2A. Do not introduce wagmi unless the app actually needs wallet connectivity.\n\n### No auth system\n\nSkip Phase 2C. Do not add SIWE unnecessarily.\n\n### `@farcaster\u002Fframe-sdk` (older)\n\nTreat identically to `@farcaster\u002Fminiapp-sdk`.\n\n### Monorepo\n\nAsk which workspace(s) to convert. Only modify those.\n\n### FID as database primary key\n\nDo not change schema automatically. Flag it and warn in Phase 4.\n\n### Conditional `isInMiniApp` branches\n\nAlways keep the normal web branch and remove the Mini App branch.\n\n### Components with no non-Farcaster purpose\n\nDelete them entirely in `Path A`. In `Path B`, keep them only if they live inside the isolated Farcaster route\u002Fpage.\n\n### Existing Neynar usage\n\nIf the project already uses Neynar:\n- remove it in `Path A`\n- keep it only if it remains inside the isolated `Path B` surface\n- do not add more Neynar usage than already exists unless the user explicitly requests it\n\n### Read-only is usually enough\n\nIf the user says they want to \"keep Farcaster stuff,\" bias toward:\n- profile links\n- read-only profile or cast display\n- a dedicated social page\n\nDo not assume they want write access, notifications, or host\u002Fruntime behavior.\n\n### Quiz ambiguity\n\nIf the scan and quiz conflict, point it out and ask the user to confirm the smaller keep-surface first.\n\n---\n\n## Security\n\n- **Validate wallet setup** — ensure `coinbaseWallet` or the chosen wallet connector is configured correctly\n- **FID-based identity** — requires manual database migration if used as a primary key\n- **SIWE verification** — verify signatures server-side before trusting them\n- **Preserved isolated surface** — do not let a Farcaster-only route\u002Fpage leak host\u002Fruntime assumptions into the main app shell\n- **Existing Neynar usage** — keep API keys server-side only, and only if that isolated surface still depends on them",{"name":5,"description":7},"main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fchains\u002Fbase-official-convert-farcaster-miniapp-to-app",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-15 02:28:10",{"source":8,"skillName":5,"commands":63,"prompt":73,"zipAvailable":74},[64,67,70],{"tool":65,"command":66},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill convert-farcaster-miniapp-to-app",{"tool":68,"command":69},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill convert-farcaster-miniapp-to-app",{"tool":71,"command":72},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill convert-farcaster-miniapp-to-app","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fbase-official-convert-farcaster-miniapp-to-app\u002FSKILL.md",true,[76,82],{"path":77,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":80,"sourceHtmlUrl":81},"SOURCE.md","REFERENCE","参考文档",156,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fbase-official-convert-farcaster-miniapp-to-app\u002FSOURCE.md",{"path":83,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":84,"sourceHtmlUrl":85},"TRUST.auto.yaml",2094,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fbase-official-convert-farcaster-miniapp-to-app\u002FTRUST.auto.yaml",[87,115,138,155,168,178],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":48},"01M712C436EQYE43342Q4E7GG1","recipe-performance","Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold\u002Fwarm\u002Fbackground-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout\u002Fpaint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.","MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FSKILL.md",[],[96,97,98,99,100,101,26,102,103,104,105,106,107,108,109,110,111,112,113,114],"performance","recipe performance","recipe","mm","sentry","harness","deterministic","recipes","flow","cold","critical","analysis","tasks","react","browser","layout","screen","network","metamask",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":119,"licenseFileUrl":120,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":48},"01M70XT2F8A5CQZ81JBP98KSW3","mexc-spot-websocket","MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FSKILL.md",[],[124,125,126,127,128,129,130,131,132,133,134,135,136,137],"mexc spot websocket","spot","websocket","api","workflows","public","listen","streams","depth","keys","for","api keys","maintenance","protobuf",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":119,"licenseFileUrl":142,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":48},"01M70XT0MBXN3WZY1BKN0CPNKR","mexc-spot-rest","MEXC Spot REST workflows for public data, signed account requests, orders, wallet\u002Fadmin actions, and secure signing without exposing API keys.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FSKILL.md",[],[146,125,147,148,149,150,151,135,134,133,46,152,153,129,154,128,127],"mexc spot rest","REST","admin","signing","Wallet","requests","secure","data","orders",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":119,"licenseFileUrl":159,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":48},"01M70XSYSVZ2N0N91XCAR2CAK0","mexc-futures-websocket","MEXC Futures WebSocket workflows for public streams, private account\u002Forder\u002Fposition streams, ping\u002Fpong, subscriptions, and depth maintenance.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FSKILL.md",[],[163,164,126,165,166,136,134,167,132,131,129,128],"mexc futures websocket","futures","position","ping","subscriptions",{"skillNo":169,"name":170,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":171,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":48},"01M6H0ZWHVE5W04WG2DKQE2SQC","0xklen-version-and-refresh-sanctions-lists","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FSKILL.md",[],[175,176,177],"refresh","0xklen version and refresh sanctions lists","version",{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":182,"sourceHtmlUrl":183,"categories":184,"keywords":185,"publishedAt":48},"01M6H0Z28Q3R8J0S799GJQWXM3","verify-tests-cover-changed-lines","Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FSKILL.md",[],[186,187,188,189,190,191,192,193,194,195,196],"tests","cover","verify tests cover changed lines","verify","coverage","pr","exercise","use","patch","code","share"]