Skip to content

Instantly share code, notes, and snippets.

View zbeyens's full-sized avatar

Ziad Beyens zbeyens

View GitHub Profile
# Convex Ents
Convex Ents are an ergonomic layer on top of the [Convex](https://convex.dev)
built-in [`ctx.db`](https://docs.convex.dev/database) API for reading from and
writing to the database.
Convex Ents:
1. Build upon the relational capabilities of the database to provide an easier
way to query related documents.
@zbeyens
zbeyens / _convex.mdc
Last active July 17, 2025 20:40
Convex rules (optimized)
---
description: Guidelines and best practices for building Convex projects with Convex Ents, including database schema design, queries, mutations, and real-world examples
globs: **/*.ts,**/*.tsx
alwaysApply: false
---
# Convex guidelines (with Convex Ents)
## Authentication & Functions
@zbeyens
zbeyens / settings.json
Created July 17, 2025 18:39
Claude Code Notifications
{
"permissions": {
"allow": ["Bash", "Edit", "mcp__task_master_ai__*"]
},
"enableAllProjectMcpServers": true,
"hooks": {
"Notification": [
{
"matcher": "",
"hooks": [
@zbeyens
zbeyens / skeleton.tsx
Created June 16, 2025 12:32
WithSkeleton
import React from "react";
import { useMounted } from "@/hooks/use-mounted";
import { cn } from "@/lib/utils";
export function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
className={cn("animate-pulse rounded-md bg-muted", className)}
{...props}
@zbeyens
zbeyens / end-session.md
Last active February 17, 2025 06:57
Store these in your project .ai folder

End Session Instructions

  1. Create a new file: .ai/status/YYYY-MM-DD.md

  2. Structure the update with sections:

    • Development Steps
    • Key Decisions
    • Next Steps

Creating New Mutations and Queries

Follow these steps in order, using existing files as references:

  1. Update Schema

    • Edit packages/db/prisma/schema.prisma
    • Run prisma generate and prisma db push
    • Reference: Existing models in schema.prisma

Using nuqs for URL Query State Management

nuqs is used for managing URL query state in Next.js applications. Follow these guidelines when working with it:

  1. Import necessary functions from nuqs:

    import { parseAsBoolean, parseAsStringEnum, useQueryState } from "nuqs";
// eslint-plugin-array-methods/rules/prefer-array-immutable-methods.js
module.exports = {
create: function (context) {
return {
CallExpression(node) {
const sourceCode = context.getSourceCode()
if (node.callee.type !== 'MemberExpression') return
import type { ZodSchema } from 'zod';
import { parseSchema } from '@/lib/schemas/parseSchema';
/** Get a response with a file to download */
export const getFileResponse = <T>({
file,
filename,
schema,
}: {
'use client';
import * as React from 'react';
import type { DataTableFilterField } from '@/components/ui/data-table/data-table.types';
import {
type ColumnDef,
type ColumnFiltersState,
type PaginationState,