npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ai0x0/utils

v0.0.50

Published

AI0x0 utils

Readme

@ai0x0/utils

AI0x0 shared utilities — backend CRUD factories for Next.js App Router + drizzle-orm, custom ESLint rules and presets.

Backend (src/backend/)

Declarative CRUD factories on top of next-rest-framework, drizzle-orm/pg-core, drizzle-zod, and zod. Each factory returns a RouteOperationDefinition that plugs directly into route({ … }).

| Export | HTTP | Description | | ------------------------ | ------ | ---------------------------------------- | | createPostOperation | POST | Create a record | | createGetOperation | GET | Get one record by filters | | createGetListOperation | GET | Paginated list with filters, sort, joins | | createPutOperation | PUT | Update a record | | createDeleteOperation | DELETE | Delete a record | | createTableSchema | — | Generate pg table + 5 Zod schemas |

See SKILL.md for detailed workflow, setup, and escape hatches.

SQLite Backend (src/backend/sqlite/)

Projects that use a local SQLite database can import the same CRUD factory surface from @ai0x0/utils/es/backend/sqlite.

import {
  createTableSchema,
  queryListSchema,
} from "@ai0x0/utils/es/backend/sqlite/schemas/index.js";
import {
  createGetOperation,
  createPostOperation,
} from "@ai0x0/utils/es/backend/sqlite/index.js";

The SQLite helpers mirror the PostgreSQL helpers, but use drizzle-orm/sqlite-core, SQLite LIKE, and json_each(...) for JSON-array filtering.

Focused SQLite coverage should verify:

  1. createTableSchema generates SQLite tables with the base fields: id, creatorId, editorId, accessedAt, createdAt, and updatedAt.
  2. queryListSchema preserves pagination defaults.
  3. createGetListAction works with SQLite query builders that expose .all().
  4. getListData executes plain queries directly and does not depend on next-rest-framework RPC wrappers.
  5. createPostAction and createPutAction normalize *At fields through transformBody.
  6. String filters use SQLite LIKE, comma-separated id filters use inArray, JSON-array filters use json_each(...), and date range filters map createdAtFrom / createdAtTo to the matching timestamp column.

Run the focused SQLite tests:

pnpm test -- src/__tests__/sqlite-actions.test.ts src/__tests__/sqlite-schemas.test.ts

Run the full package checks before publishing:

pnpm test
pnpm exec tsc --noEmit
pnpm build
npm pack --dry-run --json

Agent Skills

This package also ships reusable project skills under .agents/skills:

| Skill | Covers | | --------------------- | ------------------------------------------------------------------------------------------------- | | ai0x0-utils/backend | CRUD factories, drizzle schemas, route-operation setup, action helpers | | nextjs | App Router directories, API routes, drizzle schemas, OpenAPI client generation, code organization | | antd | Ant Design forms, ProTable, ModalForm, token-based styling, ahooks data flow | | cloudflare | OpenNext, Cloudflare Workers, Wrangler, Hyperdrive, Neon, deploy and runtime troubleshooting |

To use them in a project, copy the packaged skills into the project root:

cp -R node_modules/@ai0x0/utils/.agents ./

After copying, Codex/agents can load them from .agents/skills/<name>/SKILL.md.

If the project already has local skills, copy only the packaged skill folders you need:

mkdir -p .agents/skills
cp -R node_modules/@ai0x0/utils/.agents/skills/nextjs .agents/skills/
cp -R node_modules/@ai0x0/utils/.agents/skills/antd .agents/skills/
cp -R node_modules/@ai0x0/utils/.agents/skills/cloudflare .agents/skills/
mkdir -p .agents/skills/ai0x0-utils
cp -R node_modules/@ai0x0/utils/.agents/skills/ai0x0-utils/backend .agents/skills/ai0x0-utils/

ESLint Rules & Config

Plugin (eslint-rules/)

Custom ESLint 9 flat-config rules. All enabled via configs.recommended:

// eslint.config.js
import { ai0x0 } from "@ai0x0/utils/eslint-config/index.js";

export default [
  ai0x0.configs.recommended,
  // ... other config
];

| Rule | Description | | ------------------------- | ----------------------------------------------------------------------- | | no-hardcoded-style | Forbid hardcoded style values | | no-one-letter-vars | Forbid single-letter variable names | | no-then | Prefer async/await over .then() | | no-antd-space | Use <Flex> instead of <Space> | | require-pro-components | Require ProComponents usage | | require-section-divider | Large files need === comment dividers | | no-consecutive-setstate | Merge consecutive setState calls | | no-use-request-run | Forbid useRequest.run() | | require-use-form | Use useForm() for form state | | require-form-convention | Form naming conventions | | max-lines | Limit each file to 500 code lines and prompt splitting into child files |

Shared restrictions (eslint-config/)

Pre-defined no-restricted-syntax selectors for antd + ahooks convention enforcement:

import {
  ai0x0,
  allRestrictions,
  allRestrictionsWithNetworking,
} from "@ai0x0/utils/eslint-config/index.js";

export default [
  ai0x0.configs.recommended,
  // ... Prettier + TypeScript configs ...
  // Backend code
  {
    files: ["app/(backend)/**/*.ts"],
    rules: { "no-restricted-syntax": ["error", ...allRestrictions] },
  },
  // Frontend code (also restricts fetch / WebSocket)
  {
    files: ["app/(frontend)/**/*.ts"],
    rules: {
      "no-restricted-syntax": ["error", ...allRestrictionsWithNetworking],
    },
  },
];

Restrictions cover: TryStatement, as (non-const), useState, useEffect, useMemo, useCallback, native div/span/p/h tags, hardcoded colors, fetch and new WebSocket().

Installation

pnpm add @ai0x0/utils

Peer dependencies: drizzle-orm ^0.45.x, drizzle-zod ^0.8.x, next ^16.x, next-rest-framework, zod ^4.x.

Docs