convex-self-hosting
Skill628 starsChanged 7 months agoMITView on GitHub
Integrate Convex static self hosting into existing apps using the latest upstream instructions from get-convex/self-hosting every time. Use when setting up upload APIs, HTTP routes, deployment scripts, migration from external hosting, or troubleshooting static deploy issues across React, Vite, Next.js, and other frontends.
- Installs packages
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- public/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/convex2.mdcCursor rule
- .cursor/rules/convex-doctor.mdcCursor rule
- .cursor/rules/convex-write-conflicts.mdcCursor rule
- .cursor/rules/dev2.mdcCursor rule
- .cursor/rules/gitruels.mdcCursor rule
- .cursor/rules/help.mdcCursor rule
- .cursor/rules/rulesforconvex.mdcCursor rule
- .cursor/rules/sec-check.mdcCursor rule
- .cursor/rules/task.mdcCursor rule
- .cursor/rules/workflow.mdcCursor rule
- .cursor/rules/write.mdcCursor rule
- public/llms.txtllms.txt
- convex-create-componentSkill
- convex-migration-helperSkill
- convex-performance-auditSkill
- convex-quickstartSkill
- convex-setup-authSkill
- convexSkill
- impeccableSkill
- convex-quickstartSkill
- convex-setup-authSkill
- devSkill
- function-creatorSkill
- gitrulesSkill
- helpSkill
- migration-helperSkill
- react-effect-decisionSkill
- real-time-backendSkill
- schema-builderSkill
- sec-checkSkill
- workflowSkill
- writeSkill
- convex-doctorSkill
- convex-return-validatorsSkill
- create-prdSkill
- robel-authSkill
- update-project-docsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 20 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill to integrate Convex based static hosting in a repeatable way across projects.
- Distinctive: line 12
Run this check before making any code changes or giving setup advice.
- Distinctive: line 20
Read latest integration guide:
- Distinctive: line 22
Read latest README manual setup section:
- Distinctive: line 24
Read Convex docs index for current guidance:
- Distinctive: line 29
If upstream docs conflict with local rules, follow upstream docs and explain what changed.
- Distinctive: line 33
Ask these before implementing:
- Very specific: line 37
Do they want root path hosting or a prefix like /app.
- Distinctive: line 38
Do they want one shot deploy or separate backend and static deploy steps.
- Distinctive: line 39
If package is unpublished, do they want:
- Distinctive: line 42
wait for npm release
- Distinctive: line 44
Never assume unpublished package install details.
- Distinctive: line 50
If npm package exists, use the package directly.
- Distinctive: line 58
If package is missing on npm, use GitHub source and pin to commit or tag.
- Distinctive: line 64
If project policy requires deterministic builds, ask for a commit SHA and pin to it.
- Very specific: line 68
Use the latest upstream file patterns from INTEGRATION.md.
- Very specific: line 156
Always use the tool driven build flow.
- Distinctive: line 163
Keep upload APIs internal only and never expose them as public HTTP actions.
- Very specific: line 167
If get-convex/convex-agent-plugins is present, follow its Convex rules with this skill:
- Distinctive: line 169
keep validators on all Convex functions
- Distinctive: line 170
keep internal functions for upload operations
- Distinctive: line 171
use indexed reads, avoid broad filtering in data access patterns
- Very specific: line 180
verify convex/http.ts exists and exports router.
- Distinctive: line 182
verify package install source and import path.
- Very specific: line 188
run npx convex dev once to push backend state.
- Distinctive: line 199
Never claim setup is complete without showing these four outputs.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Convex self hosting skill
Use this skill to integrate Convex based static hosting in a repeatable way across projects.
Non negotiable update check
Run this check before making any code changes or giving setup advice.
Preferred command:
bash skills/convex-self-hosting/scripts/check-upstream.sh- Read latest integration guide:
https://raw.githubusercontent.com/get-convex/self-hosting/main/INTEGRATION.md
- Read latest README manual setup section:
https://github.com/get-convex/self-hosting?tab=readme-ov-file#manual-setup-1
- Read Convex docs index for current guidance:
https://docs.convex.dev/llms.txt
- Confirm package publish state:
npm view @convex-dev/self-hosting version
If upstream docs conflict with local rules, follow upstream docs and explain what changed.
Clarifying questions you must ask first
Ask these before implementing:
- Confirm
get-convex/self-hostingis the source of truth for this setup. - Is the target app Vite, Next.js, Expo web export, or another bundler.
- Do they want root path hosting or a prefix like
/app. - Do they want one shot deploy or separate backend and static deploy steps.
- If package is unpublished, do they want:
- GitHub dependency install
- vendored local copy
- wait for npm release
Never assume unpublished package install details.
Install strategy
Path A published package
If npm package exists, use the package directly.
npm install @convex-dev/self-hostingPath B package not published yet
If package is missing on npm, use GitHub source and pin to commit or tag.
npm install github:get-convex/self-hosting#mainIf project policy requires deterministic builds, ask for a commit SHA and pin to it.
Required file changes
Use the latest upstream file patterns from INTEGRATION.md.
1) convex/convex.config.ts
import { defineApp } from "convex/server";
import selfHosting from "@convex-dev/self-hosting/convex.config";
const app = defineApp();
app.use(selfHosting);
export default app;2) convex/staticHosting.ts
import { components } from "./_generated/api";
import {
exposeUploadApi,
exposeDeploymentQuery,
} from "@convex-dev/self-hosting";
export const { generateUploadUrl, recordAsset, gcOldAssets, listAssets } =
exposeUploadApi(components.selfHosting);
export const { getCurrentDeployment } =
exposeDeploymentQuery(components.selfHosting);3) convex/http.ts
import { httpRouter } from "convex/server";
import { registerStaticRoutes } from "@convex-dev/self-hosting";
import { components } from "./_generated/api";
const http = httpRouter();
registerStaticRoutes(http, components.selfHosting);
export default http;Optional prefix mode:
registerStaticRoutes(http, components.selfHosting, {
pathPrefix: "/app",
spaFallback: true,
});4) package.json scripts
{
"scripts": {
"deploy": "npx @convex-dev/self-hosting deploy",
"deploy:static": "npx @convex-dev/self-hosting upload --build --prod"
}
}Deployment flow
First setup
npm install @convex-dev/self-hosting
npx @convex-dev/self-hosting setup
npx convex dev --once
npm run deployOngoing deploys
npm run deployTwo step deploy alternative
npx convex deploy
npx @convex-dev/self-hosting upload --build --prodAlways use the tool driven build flow. Do not run npm run build first when using upload deploy commands.
Cross app support notes
- Vite: use
--buildflow as default. - Next.js and Expo: pass through
VITE_CONVEX_URLin the app build script as documented upstream. - Existing API routes: prefer
pathPrefix: "/app"for static hosting. - Keep upload APIs internal only and never expose them as public HTTP actions.
Integration with convex agent plugins
If get-convex/convex-agent-plugins is present, follow its Convex rules with this skill:
- keep validators on all Convex functions
- keep internal functions for upload operations
- use indexed reads, avoid broad filtering in data access patterns
- preserve strict TypeScript in generated Convex and frontend code
Reference:
https://github.com/get-convex/convex-agent-plugins
Troubleshooting checklist
404for static routes:- verify
convex/http.tsexists and exports router.
- verify
Cannot find module .../convex.config:- verify package install source and import path.
- wrong backend URL in built assets:
- redeploy with CLI
--buildflow.
- redeploy with CLI
- no updates visible:
- clear cache and verify deployment ID changes.
- HTTP actions disabled:
- run
npx convex devonce to push backend state.
- run
Completion requirements
Before finishing, provide:
- exact upstream docs commit date or latest retrieval timestamp
- which package path was selected and why
- list of changed files
- commands the user should run next
Never claim setup is complete without showing these four outputs.
Source links
https://github.com/get-convex/self-hostinghttps://raw.githubusercontent.com/get-convex/self-hosting/main/INTEGRATION.mdhttps://github.com/get-convex/self-hosting?tab=readme-ov-file#manual-setup-1https://docs.convex.dev/llms.txthttps://github.com/get-convex/convex-agent-pluginshttps://github.com/agentskills/agentskills
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

