{"id":5863,"plugin_id":"plugin_asdk_app_6a0faef988b48191b843bac5cd170a9e","kind":"skill","collection_source":null,"comparison_source":null,"observed_at":"2026-09-30T22:46:51.719Z","digest":"9228df0a278823d06bd05586f1fbe5d02a94746f77aa0e185d89ca5f026c0e41","against":null,"payload":{"name":"quickstart","description":"Scaffold a running Next.js + shadcn Convex app from one sentence — convex dev + next dev already running — then build the idea live (runs locally). TRIGGER when the user wants to START a new Convex app from scratch — e.g. they ran $quickstart, said 'scaffold a new app', 'build me an app where users can ___', or 'new app'. SKIP when there's already a Convex project in the cwd.","included_files":[],"skill_md_contents":"---\nname: \"quickstart\"\ndescription: \"Scaffold a running Next.js + shadcn Convex app from one sentence — convex dev + next dev already running — then build the idea live (runs locally). TRIGGER when the user wants to START a new Convex app from scratch — e.g. they ran $quickstart, said 'scaffold a new app', 'build me an app where users can ___', or 'new app'. SKIP when there's already a Convex project in the cwd.\"\nlicense: \"Apache-2.0\"\n---\n\n# Convex Quickstart (Codex beta)\n\nStand up a running Next.js + shadcn \"wow-shell\" Convex app from one sentence, then\nbuild the user's idea live (locally). The heavy scaffold runs as a served shell script\nfrom the Convex quickstart backend (\"anteater\"); your job is to launch it, then build.\n\n> **Auth (passkeys), the feedback panel, custom domains, and public `*.convex.app`\n> publishing are de-scoped for this release** — they ship later. The scaffold runs\n> **locally only**, with no login and no panel. (The error-watch monitor in STEP 5\n> still applies and is valuable — keep it.)\n\nThe user's request after `$quickstart` is the **app idea** (e.g.\n`$quickstart a movie-night voting app` → idea = \"a movie-night voting app\"). If no\nidea was given, ask for a one-sentence idea, then continue.\n\n## Degradation rule — when the scaffold can't run, write code, not ceremony\n\nIf the bootstrap can't run — a non-interactive/one-shot session, no network access, a\nsandboxed temp dir, or the user just wants code rather than a running app — **don't\nwait on the scaffold**. Write a standard Convex project directly:\n\n- **ALL backend code goes under `convex/`** (`schema.ts`, queries, mutations, actions)\n  — **NEVER at the project root.** Convex functions only run from the `convex/`\n  directory.\n- **Write ZERO scaffold/documentation files** unless explicitly asked — no\n  `START_HERE.md`, `ARCHITECTURE.md`, `MANIFEST.txt`, or README walls. \"Build me a\n  backend\" is a request for code, not a design-doc package.\n\n## Data access + imports — read before writing any convex/*.ts\n\n- Never an unbounded `.collect()` on a table that can grow — use `.withIndex(...)` +\n  `.paginate(paginationOpts)`/`.take(n)`.\n- Index, don't filter — `.index(...)` in `schema.ts` for every read path, queried via\n  `.withIndex(...)`; `.filter()` is a full table scan.\n- Imports: `query`/`mutation`/`action`/`internalQuery`/`internalMutation`/`internalAction`\n  from `\"./_generated/server\"`; `api`/`internal` from `\"./_generated/api\"`; never from\n  `\"convex/server\"` in application code.\n- `v.literal(\"exact value\")` for fixed string/enum members, not a bare `v.string()`.\n- `\"use node\";` is action-only — never in a file that also exports a `query` or\n  `mutation`.\n\n## Self-verify — before declaring backend work done\n\nBefore you call any backend work finished: run `npx tsc --noEmit` and, when a\ndeployment is available (or via a local anonymous one:\n`CONVEX_AGENT_MODE=anonymous npx convex dev --once`), push it. Fix every error\neither one reports before finishing — one verify round catches the\nwrong-relative-import / duplicate-symbol / unbalanced-paren class that otherwise\nbreaks the deploy.\n\n## STEP 0 — launch the scaffold NOW (before anything else)\n\nRun this **first**, before any reasoning or other tool calls — it kicks off the\n~45–120s scaffold (npm install, convex dev, next dev) in the background so it's\ninstalling while you read the rest. Substitute the user's idea for `<IDEA>`:\n\n```bash\nBASE=\"https://basic-anteater-667.convex.site\"\nIDEA=\"<IDEA>\"\nSLUG=$(curl -fsS --max-time 15 -X POST \"$BASE/generate\" -H 'content-type: application/json' \\\n  --data \"$(node -e 'process.stdout.write(JSON.stringify({idea:process.argv[1],template:\"nextjs-shadcn\"}))' \"$IDEA\")\" \\\n  | node -e 'let s=\"\";process.stdin.on(\"data\",d=>s+=d).on(\"end\",()=>{try{process.stdout.write(JSON.parse(s).id||\"\")}catch{}})') || true\necho \"SLUG=$SLUG\"\nQB=$(mktemp -t convex-qb-XXXX.sh)\ncurl -fsS --max-time 20 \"$BASE/quickstart-bootstrap\" -o \"$QB\" || { echo \"BOOTSTRAP_FETCH_FAILED\"; exit 3; }\n# The bootstrap is feature-flagged via a profile. We ship the MINIMAL profile: scaffold\n# only — no auth/passkeys, no feedback panel, no custom domain, and public *.convex.app\n# publishing disabled (they ship later). To restore the goodness pass QB_PROFILE=full\n# (or individual flags, e.g. QB_PASSKEYS=1 QB_PANEL=1 QB_DOMAIN=1).\necho \"AUTH_MODE=none\"   # minimal profile = no pre-baked auth; the build has no login\n# QB_HARNESS=codex tags telemetry. QB_ARGS_BASE=$BASE is CRITICAL: the slug was\n# generated on THIS deployment, so the bootstrap must fetch the personalized args +\n# bespoke runbook from the SAME host (its default is prod, which 404s a staging slug\n# → generic \"My Convex App\" defaults).\nnohup env QB_PROFILE=minimal QB_HARNESS=codex QB_ARGS_BASE=\"$BASE\" QB_FEEDBACK_URL=\"$BASE/feedback\" \\\n  bash \"$QB\" $SLUG > .quickstart-bootstrap.log 2>&1 &\necho \"SCAFFOLD_LAUNCHED log=.quickstart-bootstrap.log SLUG=$SLUG\"\n```\n\n- If it prints `SCAFFOLD_LAUNCHED`, the scaffold is running in the background.\n  **Do NOT run it again.** Note the `SLUG=`.\n- If `curl` is blocked or you see `BOOTSTRAP_FETCH_FAILED`, the network/sandbox\n  blocked it — tell the user they likely need to run Codex with network access /\n  auto-approve (`codex --sandbox danger-full-access`), then retry.\n\n## STEP 1 — wait for the scaffold, open the browser\n\nPoll `.quickstart-bootstrap.log` until it contains `BOOTSTRAP_COMPLETE`.\n\n**Codex's sandbox often reaps backgrounded (`nohup … &`) processes when the launch\ncall returns** — so the bootstrap may write its first line, then die before scaffolding.\nIf within ~20s the log has stalled (no new lines), **no app subdirectory has appeared**,\nand there's no `BOOTSTRAP_COMPLETE`, the background launch was reaped. Recover by running\nthe bootstrap in the **FOREGROUND** — re-run the STEP 0 block but replace the\n`nohup env … &` line with a plain foreground run, same env:\n\n```bash\nQB_PROFILE=minimal QB_HARNESS=codex QB_ARGS_BASE=\"$BASE\" QB_FEEDBACK_URL=\"$BASE/feedback\" bash \"$QB\" $SLUG\n```\n\nIt backgrounds `convex dev` / `next dev` itself and returns at `BOOTSTRAP_COMPLETE` in\n~1–2 min (set a generous command timeout, 300s+). `BOOTSTRAP_FETCH_FAILED` → server\nunreachable; tell the user. When it completes the log prints:\n- `OPEN_BROWSER_URL: http://localhost:<port>` — open this for the user immediately.\n- The app is scaffolded in a new subdirectory with `convex dev` + `next dev` running\n  and error watchers armed (`convex-errors.log` / `next-errors.log` paths are in the log).\n\n## STEP 2 — read the runbook + build the idea live\n\nRead the personalized runbook for the full build flow (it's served — fetch it):\n\n```bash\ncurl -fsS \"https://basic-anteater-667.convex.site/q/$SLUG.md\"\n```\n\nThen build the user's idea following it. What's already done by the scaffold:\n- **No auth this release** — the scaffold ships with **no login**. Only add auth if the\n  user explicitly asks (then wire their requested provider via the `convex-expert` skill).\n  *(Passkeys are de-scoped — `QB_PROFILE=minimal` sets `QB_PASSKEYS=0`.)*\n- **No feedback panel this release** — narrate your build **in chat**; do NOT call\n  `progress:post` / `todos:*` / `refinementQuestions:*`. *(Panel is off — `QB_PANEL=0`.)*\n- **Publishing is disabled this release** — the app runs **locally** at the printed URL;\n  do not publish or run `$add hosting`.\n\nRules while building:\n- Delegate all code inside `convex/` to the **`convex-expert`** skill's rules\n  (object-form syntax, validators, indexes, internal vs public).\n- Watch for `convex/` + `next` errors and fix them as they appear — the easiest way\n  is the `fix_errors_automatically` tool (see STEP 5), which surfaces them as events.\n\n## STEP 3 — wrap up (runs locally; no publish this release)\n\nWhen the app builds clean and the core feature works (your \"v1\"), tell the user it's\nrunning **locally** at the printed URL and summarize what you built. Publishing to a\npublic `*.convex.app` URL and custom domains are **disabled this release** — don't\ndeploy, don't run `$add hosting`, and don't look for `.quickstart-domains.json`.\n\n## STEP 5 — stay on watch with `fix_errors_automatically` (start EARLY, don't yield)\n\nThis harness has no push: a runtime error (or a slow async result) sits **unseen**\nuntil you actively look. This plugin bundles a `convex-plugin` MCP server with one\n**blocking** tool that surfaces it as an event — keep using it even though the\nfeedback panel is off this release (the `convex_error` / `next_error` watch is the\nvaluable part).\n\n**Start watching as soon as the app is open (right after STEP 1) — not just after\nv1.** The user is most engaged at the very start and will often submit a request or\nquestion while you're still building. Call `fix_errors_automatically` between build\nmilestones and whenever you'd otherwise pause; on the FIRST call it returns\n**immediately** if anything is already pending (it surfaces existing unhandled\nrequests/questions as `existing: true`), so feedback submitted before you started\nwatching is never lost. Then make it your standing idle action for the rest of the\nsession.\n\n> **Avoid the repeated approval prompt:** each call is a separate tool invocation,\n> so a one-time \"Allow\" re-asks every loop. Choose **\"Always allow\"** when prompted,\n> or add to `~/.codex/config.toml`: `[mcp_servers.convex-plugin]` then\n> `trust_level = \"trusted\"`. Also pass a long `timeoutMs` (e.g. 280000) so each\n> block is long and you re-call less often.\n\nCall the **`fix_errors_automatically`** tool with `projectDir` set to your app's\n**absolute path** (the `convex-app/` subdir, where `.env.local` lives). It BLOCKS\nuntil the next event, then returns one of:\n- `feature_request` / `refinement_answer` → the user wants something — handle it\n  (loop back through STEP 2/3), then call the tool again.\n- `convex_error` / `next_error` → stop, read the line, fix the file, wait for\n  `convex dev` / Next to recover, then call again.\n- `quiet` → heartbeat timeout, nothing happened — just call it again.\n\n**Loop on this tool instead of ending your turn.** Each call blocks, so you stay on\nwatch and react within seconds — no polling, no walking away. Keep looping until the\nuser clearly says they're done.\n\n## After the run\n\nOffer `$quickstart-improve` so the user can send this session for an AI review that\nimproves the quickstart.\n\n## On failure / friction — offer to self-report (WITH the user's permission)\n\nIf the run doesn't go smoothly — you give up, hit a blocker, it takes way too long, or\nthe user is frustrated — don't yield silently. **Ask first, send only on a yes**:\n\n> \"That didn't go as smoothly as it should have. May I send this session — the transcript,\n>  with secrets redacted — to the Convex team so they can fix what went wrong? [yes / no]\"\n\n- **On yes** → run the `quickstart-improve` flow (ships the redacted transcript):\n  `curl -fsSL \"https://basic-anteater-667.convex.site/send-transcript\" | QB_HARNESS=codex bash -s -- --idea \"<what broke>\"`\n- **On no** → respect it; send nothing.\n- Either way, give the user an honest summary of where it got stuck.\n\nNever send the transcript without an explicit yes.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}