convex-component-authoring
How to create, structure, and publish self-contained Convex components with proper isolation, exports, and dependency management
By waynesutton · 1,077 installs
npx skills add waynesutton/convexskills --skill convex-component-authoring
Source repository · Upstream listing
Convex Component Authoring
Create self contained, reusable Convex components with proper isolation, exports, and dependency management for sharing across projects.
Documentation Sources
Before implementing, do not assume; fetch the latest documentation:
Primary: https://docs.convex.dev/components
Component Authoring: https://docs.convex.dev/components/authoring
For broader context: https://docs.convex.dev/llms.txt
Instructions
What Are Convex Components?
Convex components are self contained packages that include:
Database tables (isolated from the main app)
Functions (queries, mutations, actions)
TypeScript types and validators
Optional frontend hooks
Component Structure
Creating a Component
1. Component Configuration
2. Component Schema
3. Component Definition
4. Component Functions
5. Main Exports
Using a Component
Component Configuration Options
Providing Component Hooks
Publishing a Component
package.json
tsconfig.json
Examples
Rate Limiter Component
Best Practices
Never run npx convex deploy unless explicitly instructed
Never run any git commands unless explicitly instructed
Keep component tables isolated (don't reference main app tables)
Export clear TypeScript types for consumers
Document all public functions and their arguments
Use semantic versioning for component releases
Include comprehensive README with examples
Test components in isolation before publishing
Common Pitfalls
1. Cross referencing tables Component tables should be self contained
2. Missing type exports Export all necessary types
3. Hardcoded configuration Use component options for customization
4. No versioning Follow semantic versioning
5. Poor documentation Document all public APIs
References
Convex Documentation: https://docs.convex.dev/
Convex LLMs.txt: https://docs.convex.dev/llms.txt
Components: https://docs.convex.dev/components
Component Authoring: https://docs.convex.dev/components/authoring