Convex Skills

repository·main·Indexed 19 days ago

https://github.com/waynesutton/convexskills

A 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.

Tokens
47.1K
Snippets
100
Records
160
Agent score
64%

What's inside @waynesutton/convex-skills

  1. Use the avoid-feature-creep skill

    main

    The avoid-feature-creep skill 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.
  2. Convex Security Audit Skill Overview

    main

    The convex-security-audit skill provides deep security review patterns specifically designed for Convex applications. It focuses on auditing five critical areas:

    1. Authorization Logic Audit: Reviewing how permissions are enforced.
    2. Data Access Boundaries Audit: Ensuring users can only access their own data.
    3. Action Isolation Audit: Verifying that side-effect-heavy actions are properly isolated.
    4. Rate Limiting Audit: Checking for protections against abuse.
    5. 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]
  3. Overview of Convex HTTP Actions

    main

    Convex 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.
  4. Understand Convex function types and use cases

    main

    Convex 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.

    TypeDatabase AccessExternal APIsCachingUse Case
    QueryRead-onlyNoYes, reactiveFetching data
    MutationRead/WriteNoNoModifying data
    ActionVia runQuery/runMutationYesNoExternal integrations
    HTTP ActionVia runQuery/runMutationYesNoWebhooks, APIs
  5. Configure Agent Skill Directories

    main

    The 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 main skills/ directory.
    • Codex: Integrates via the .codex/ directory (refer to .codex/README.md for setup and symlink instructions).
  6. Define and integrate agent tools

    main

    You can extend agent capabilities by defining tools using the tool function. A tool requires a name, description, parameters (using Convex v validation), and a handler function.

    To use these tools, pass them in the tools array when calling agent.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.",
    });
  7. Use the Convex Development umbrella skill

    main
    The convex skill 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 like convex-functions, convex-realtime, and convex-agents.
  8. Maintain discipline when working with AI coding agents

    main

    AI 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:

    1. Set constraints early: State your specific feature and what is explicitly out of scope at the start of every session.
    2. Apply the 48-hour rule: Don't add agent suggestions immediately; reflect on them.
    3. Use the 'Why?' technique: If an agent pushes a feature, ask "Why?" three times to find the underlying need.
    4. Enforce focus: If an agent starts adding scope, tell it to stop, commit current work, and start a fresh session.
    5. Log suggestions: Record agent suggestions in a Scope Decision Log to track their impact.
  9. Distinguish between Optional and Nullable fields

    main

    In 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 be null.
    • Optional and Nullable: The field may be absent OR it may exist with a null value.
    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())),
      }),
    });
  10. Change scope and UI/UX restrictions

    main

    When 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.md or files.md, run git log --date=short to 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.
  11. How Convex Realtime works

    main

    Convex provides a reactive programming model based on four core principles:

    1. Automatic Subscriptions: Using useQuery creates a subscription that automatically updates the UI when the underlying data changes.
    2. Smart Caching: Query results are cached and shared across different components to minimize redundant network requests.
    3. Consistency: All active subscriptions see a consistent view of the database state.
    4. Efficient Updates: The system ensures that components only re-render when the specific data they are observing changes.