// Auto-generated from src/ai-service/skills/system/third-party-migration/replit.md
// Do not edit directly - edit the .md file instead
export const content = `# Replit-specific mapping

This is a per-platform reference loaded from \`SKILL.md\`. The framework — target layout, universal mapping, non-negotiables, workflow, code-emission rules — lives there. This file documents only what's specific to a Replit source.

## Where the source lives

Hallmarks: \`replit.md\`, \`.replit\`, \`artifacts/\`, an Express server entry (e.g. \`server/index.ts\`), an Orval-generated client package (typically \`client/src/api/\` or similar with \`useXxx\` hooks).

If the user gave a path, use it. Otherwise look for the hallmarks above in the working tree. If ambiguous, ask.

## Typical shape

A Replit fullstack app usually looks like:

- **Server**: Express + TypeScript. Routes split across multiple files, mounted with \`app.use("/api/...", router)\`. Middleware for auth (sometimes Passport, sometimes hand-rolled JWT), CORS, error handling. Errors propagated via \`next(err)\` or \`res.status(...).json(...)\`. Env vars via \`process.env.*\`.
- **Database**: \`pg\`, \`knex\`, \`prisma\`, or Drizzle, with credentials in env (\`DATABASE_URL\` / DSN).
- **Client**: React + Vite + Tailwind + shadcn/ui. Routing via \`wouter\` or \`react-router\`. Data fetching via Orval-generated \`useXxx\` hooks backed by \`@tanstack/react-query\`. Forms via \`react-hook-form\` + \`zod\`. Local \`QueryClientProvider\` and base-URL/auth-token getters.

This is the common case. Verify against the actual tree before mapping.

## Discovery checklist

In addition to the framework's discovery requirements, for a Replit source enumerate:

- Every Express route handler (group by router file, then by mounted path).
- Every middleware (auth, CORS, error, logging) — most drop entirely.
- Every DB client and the queries it issues. Note env vars holding the DSN.
- Every external HTTP call (\`axios\` / \`fetch\`) and the API it targets.
- Every \`process.env.*\` read, separated into "credentials/secrets" (move to integrations) and "config" (\`ctx.env\`).
- Every Orval-generated hook usage on the client.

## Core mapping

- **Each Express route handler → one Superblocks API** at \`server/apis/<ApiName>/api.ts\`, registered in \`server/apis/index.ts\`. Within \`api()\`:
  - \`req.body\` / \`req.query\` / \`req.params\` → unified \`input\` Zod schema.
  - \`res.json(data)\` → \`return { ... }\` from \`run\`.
  - Auth middleware that hung user info on \`req.user\` → \`ctx.user\`.
  - DB clients → \`ctx.integrations.db.query/execute(...)\`.
  - External HTTP → declared integration + \`apiRequest(...)\`.
  - Error middleware / \`next(err)\` / \`res.status(...).json(...)\` → throw the documented \`SdkError\` subtypes.
  - \`app.listen\`, CORS, static-file middleware, route grouping → drop entirely. Route groups become separate \`api()\` files.
- **Each React page → one Superblocks page** wired into \`client/router.tsx\`. Replace Orval \`useXxx\` hooks with \`useApiData\` (reads) or \`useApi\` (mutations) keyed by \`<ApiName>\`. Drop the generated client package, the local \`QueryClientProvider\`, any base-URL or auth-token getters.

## Ask-before-guessing — Replit specifics

- "The source uses \`<DB client>\` against \`<DSN env var>\`. I'll bind to a Postgres integration — which one, or do you want to create a new one?"
- "I see external HTTP calls to \`<host>\` with credentials in \`<env var>\`. Bind to an integration of type \`<kind>\`?"
- "Multiple route files mount under \`<prefix>\`. I'll emit one API per handler — does that match how you want to address them, or should some be consolidated?"

## Page port — what changes vs. what doesn't

For each Replit page, only these change:

- **Data hooks**: Orval \`useXxx\` → \`useApi\` / \`useApiData\`.
- **Router primitives**: \`wouter\` → \`react-router\` v7 (or adapt v6 → v7 patterns if the source already used \`react-router\`).

Everything else — JSX structure, Tailwind classes, shadcn variants, custom CSS, theme tokens, fonts, layout containers — transfers unchanged. If the diff goes beyond data + routing, you are over-editing.

## Done — Replit specifics

Nothing extra to surface beyond the framework's "Done" report.
`;
//# sourceMappingURL=replit.generated.js.map