# Convex Best Practices

> General Convex implementation guidance for this repo. Use before or during schema, function, realtime, auth, or migration work.

- Skill: `majiayu000/convex-best-practices-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/convex-best-practices-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/convex-best-practices-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/convex-best-practices-2

---


# Convex Best Practices

Use this skill as the default baseline for Convex work before switching to a narrower Convex skill.

## Default guidance

- Treat functions as the API surface.
- Keep schema explicit and indexes intentional.
- Validate public inputs and outputs.
- Prefer typed helpers over repeated inline logic.
- Use `npx convex dev` during development.

## AgentForge-specific constraints

- Convex is the data layer for this repo.
- Mastra runtime logic belongs in `packages/runtime/`, not in Convex actions.
- Avoid patterns that assume a standalone all-in-one Convex agent app.

## References

- Read [best-practices-checklist.md](/Users/eduardojaviergarcialopez/AgenticEngineering/agentforge/.agents/skills/convex-best-practices/references/best-practices-checklist.md).

