Convex Skills
repository·main·Indexed 19 days ago
https://github.com/waynesutton/convexskillsA collection of unofficial AI-consumable skills following the Agent Skills open format to help AI coding agents implement Convex best practices. It includes a CLI for managing skills, programmatic JS/TS access, and templates for Claude Code, Codex, and OpenCode. Available skills cover areas such as schema validation, real-time patterns, HTTP actions, cron jobs, and security audits.
What's inside @waynesutton/convex-skills
- Convex Migrations provides strategies for evolving your Convex database schema safely. This skill covers patterns for adding new fields, backfilling data, removing deprecated fields, managing index migrations, and implementing zero-downtime deployment patterns.
Use the avoid-feature-creep skill
mainThe
avoid-feature-creepskill is designed to prevent scope bloat when building software, apps, or AI-powered products. Use this skill during feature planning, scope reviews, MVP development, or when managing backlogs to ensure focus on core user value and faster shipping cycles.Key use cases:
- Planning new features
- Reviewing project scope
- Building MVPs
- Managing backlogs
- Responding to "just one more feature" requests from stakeholders or AI agents.
Convex Security Audit Skill Overview
mainThe
convex-security-auditskill provides deep security review patterns specifically designed for Convex applications. It focuses on auditing five critical areas:- Authorization Logic Audit: Reviewing how permissions are enforced.
- Data Access Boundaries Audit: Ensuring users can only access their own data.
- Action Isolation Audit: Verifying that side-effect-heavy actions are properly isolated.
- Rate Limiting Audit: Checking for protections against abuse.
- Sensitive Operations Protection: Identifying and securing high-risk functions.
This skill is intended to be used as a template or guide for performing comprehensive security reviews of Convex codebases.
name: convex-security-audit displayName: Convex Security Audit description: Deep security review patterns for authorization logic, data access boundaries, action isolation, rate limiting, and protecting sensitive operations version: 1.0.0 author: Convex tags: [convex, security, audit, authorization, rate-limiting, protection]Overview of Convex HTTP Actions
mainConvex HTTP Actions allow you to build custom HTTP endpoints within your Convex application. These endpoints are primarily used for:
- Webhooks: Receiving incoming data from external services (e.g., Stripe, GitHub).
- External API Integrations: Creating custom routes that external systems can call.
- Custom Routing: Implementing specific HTTP request/response logic that falls outside standard Convex queries or mutations.
Understand Convex function types and use cases
mainConvex provides different function types depending on whether you need to access the database, call external APIs, or handle HTTP requests. Choosing the correct type is critical for performance, security, and correctness.
Type Database Access External APIs Caching Use Case Query Read-only No Yes, reactive Fetching data Mutation Read/Write No No Modifying data Action Via runQuery/runMutationYes No External integrations HTTP Action Via runQuery/runMutationYes No Webhooks, APIs Configure Agent Skill Directories
mainThe project supports multiple directory patterns for agent skills to ensure compatibility across different tools:
- Claude Code: Uses the
.claude/skills/directory for active project context and guidelines (e.g.,convex.md,dev.md,gitrules.md). - Standard Agents: Uses the
.agents/skills/directory. This is a compatibility path for tools that scan for standard agent skills. The CLI can create this directory or symlink it to the mainskills/directory. - Codex: Integrates via the
.codex/directory (refer to.codex/README.mdfor setup and symlink instructions).
- Claude Code: Uses the
Define and integrate agent tools
mainYou can extend agent capabilities by defining tools using the
toolfunction. A tool requires aname,description,parameters(using Convexvvalidation), and ahandlerfunction.To use these tools, pass them in the
toolsarray when callingagent.chat.import { tool } from "@convex-dev/agent"; import { v } from "convex/values"; export const searchKnowledge = tool({ name: "search_knowledge", description: "Search the knowledge base for relevant information", parameters: v.object({ query: v.string(), limit: v.optional(v.number()), }), handler: async (ctx, args) => { // Implementation logic here return results; }, }); // Usage in agent.chat const response = await agent.chat(ctx, { threadId: args.threadId, messages: [{ role: "user", content: args.message }], tools: [searchKnowledge], systemPrompt: "You are a helpful assistant.", });Use the Convex Development umbrella skill
mainTheconvexskill acts as an index for all Convex development patterns. Instead of using a single monolithic skill, you should use specific sub-skills via their respective commands to get detailed guidance for your specific task. This umbrella skill routes to specialized skills likeconvex-functions,convex-realtime, andconvex-agents.Maintain discipline when working with AI coding agents
mainAI agents (like Claude, Cursor, or Copilot) often suggest improvements, refactors, or additional features that fall outside your current scope. Treat these suggestions as stakeholder requests:
- Set constraints early: State your specific feature and what is explicitly out of scope at the start of every session.
- Apply the 48-hour rule: Don't add agent suggestions immediately; reflect on them.
- Use the 'Why?' technique: If an agent pushes a feature, ask "Why?" three times to find the underlying need.
- Enforce focus: If an agent starts adding scope, tell it to stop, commit current work, and start a fresh session.
- Log suggestions: Record agent suggestions in a
Scope Decision Logto track their impact.
Distinguish between Optional and Nullable fields
mainIn Convex schemas, there is a semantic difference between a field being optional and a field being nullable:
- Optional (
v.optional(v)): The field may be entirely absent from the document. - Nullable (
v.union(v, v.null())): The field must exist in the document, but its value can benull. - Optional and Nullable: The field may be absent OR it may exist with a
nullvalue.
export default defineSchema({ items: defineTable({ // Optional: field may not exist description: v.optional(v.string()), // Nullable: field exists but can be null deletedAt: v.union(v.number(), v.null()), // Optional and nullable notes: v.optional(v.union(v.string(), v.null())), }), });- Optional (
Change scope and UI/UX restrictions
mainWhen modifying a codebase, adhere to these strict boundaries regarding scope and design.
Change Scope
- Updates: You may update the Convex schema and only files directly necessary to fix the request.
- Changelogs: When updating
changelog.mdorfiles.md, rungit log --date=shortto check history. Set release dates to match the real commit timeline; do not use placeholders or future months. - Restrictions: Do NOT change UI, layout, design, or color styles unless specifically instructed. Preserve all existing components and never remove sections or features unless explicitly requested.
UI/UX Guidelines
- Design System: Always follow the site's existing design system for pop-ups, alerts, modals, warnings, notifications, and confirmations. Never use browser default pop-ups.
- Vercel Guidelines: Follow the Vercel Web Interface Guidelines.
How Convex Realtime works
mainConvex provides a reactive programming model based on four core principles:
- Automatic Subscriptions: Using
useQuerycreates a subscription that automatically updates the UI when the underlying data changes. - Smart Caching: Query results are cached and shared across different components to minimize redundant network requests.
- Consistency: All active subscriptions see a consistent view of the database state.
- Efficient Updates: The system ensures that components only re-render when the specific data they are observing changes.
- Automatic Subscriptions: Using