xiaohongshu
xiaohongshu
convex-backend-development
Develop and maintain Convex backend functions including queries, mutations, and actions. Use when working with database operations, authentication, game management, scoring logic, and real-time data updates in the dev-quiz-battle app.
Full skill instructions
This skill covers building and maintaining Convex backend functions for the dev-quiz-battle application.
The Convex backend is located in the convex/ directory with:
queries/ - Read-only functions (games, users, answers, leaderboard)mutations/ - Write operations (creating games, submitting answers, updating user scores)actions/ - Long-running operations (AI question generation)schema.ts - Database schema definitionauth.ts - Authentication configurationQueries fetch data from the database without modifying it. Common patterns:
import { query } from "convex/server";
import { v } from "convex/values";
export const getGameData = query({
args: { gameCode: v.string() },
handler: async (ctx, args) => {
const game = await ctx.db
.query("games")
.filter((q) => q.eq(q.field("code"), args.gameCode))
.first();
return game;
},
});
Mutations modify the database state. Always validate input:
import { mutation } from "convex/server";
import { v } from "convex/values";
export const createGame = mutation({
args: { creatorId: v.id("users"), language: v.string() },
handler: async (ctx, args) => {
const gameId = await ctx.db.insert("games", {
creatorId: args.creatorId,
language: args.language,
code: generateUniqueCode(),
status: "waiting",
createdAt: Date.now(),
});
return gameId;
},
});
Actions handle async operations like API calls:
import { action } from "convex/server";
import { v } from "convex/values";
export const generateQuestion = action({
args: { language: v.string(), difficulty: v.string() },
handler: async (ctx, args) => {
// Call external API or perform async work
const response = await fetch("https://api.example.com/questions");
return response.json();
},
});
Access the authenticated user:
const identity = await ctx.auth.getUserIdentity();
if (!identity) {
throw new Error("Not authenticated");
}
const userId = identity.subject;
Always validate arguments using Convex validators:
args: {
email: v.string(),
password: v.string(),
language: v.string(),
}
See Convex Schema Reference for complete schema definition.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience