Skip to content

pathrule/patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pathrule Patterns

The context layer for AI coding agents.
Ready-to-use, path-scoped bundles of memories, rules, and skills that drop into your workspace and apply where they belong.

Catalog  ·  What is a Pattern  ·  Using a Pattern  ·  Browse online

License: Apache-2.0 npm 43 patterns First-party content

Works with Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, and any MCP client.


A Pattern is not a single skill. It is a small, opinionated bundle of memories, rules, and skills, each pre-scoped to the path it belongs to (for example, a "Server Components by default" rule scoped to /app). Add a Pattern and your AI assistant gets the right conventions in the right place, then it evolves with your project.

Everything here is free and Apache-2.0. Pathrule only ever charges for the hosted product, never for this content.

Catalog

43 patterns across 8 categories. Each links to its full page; Bundle shows the mix of Rules, Memories, and Skills, composed to fit the topic rather than a fixed template.

Framework

Pattern What it gives you Bundle Token
Astro Ship content-first sites that send almost no JavaScript by default. 3R · 3M · 1S ::pathrule:package:astro
Expo (React Native) Ship Expo apps with file-based routing, EAS Build, and safe OTA updates. 3R · 3M · 1S ::pathrule:package:expo-react-native
Flutter Build Flutter apps that stay fast and leak-free with disciplined widgets and clear state boundaries. 2R · 3M · 1S ::pathrule:package:flutter
Next.js App Router Battle-tested conventions for a Next.js App Router codebase, scoped to the paths they belong to. 4R · 2M · 1S ::pathrule:package:nextjs-app-router
Nuxt Ship Nuxt 4 apps with correct data fetching, server routes, and SSR-safe code. 5R · 2M · 1S ::pathrule:package:nuxt
React Router 7 Build full-stack React apps with framework mode loaders, actions, and generated route types. 3R · 2M · 1S ::pathrule:package:react-router
SvelteKit Keep server secrets, load data, and mutations correct across SvelteKit 2 and Svelte 5. 2R · 4M · 1S ::pathrule:package:sveltekit

Frontend

Pattern What it gives you Bundle Token
Forms with React Hook Form + Zod Schema-first, type-safe forms with shared client and server validation. 3R · 1M · 1S ::pathrule:package:forms-rhf-zod
React + TypeScript Pragmatic React and TypeScript conventions: typed props, accessible UI, and predictable hooks. 2R · 3M · 1S ::pathrule:package:react-typescript
TypeScript Strict Make the compiler do the work: no any, no escape hatches, types that model reality. 4R · 1M · 1S ::pathrule:package:typescript-strict
shadcn/ui Own your component code and theme it with CSS variables instead of installing a black-box UI library. 2R · 3M · 1S ::pathrule:package:shadcn-ui
Tailwind CSS Keep Tailwind v4 utility code clean, token-driven, and free of arbitrary-value sprawl. 2R · 3M · 1S ::pathrule:package:tailwind-css
TanStack Query Treat the server as the source of truth and let the cache do the work. 2R · 3M · 1S ::pathrule:package:tanstack-query
Web Accessibility Ship interfaces that work for keyboard, screen reader, and low-vision users by default. 3R · 2M · 1S ::pathrule:package:web-accessibility

Backend

Pattern What it gives you Bundle Token
Auth (Sessions, JWT, OAuth) Build authentication that resists XSS, CSRF, and token replay by default. 4R · 1M · 1S ::pathrule:package:auth-sessions-jwt-oauth
Background Jobs & Queues Make every queued job safe to run twice so retries heal instead of corrupt. 2R · 3M · 1S ::pathrule:package:background-jobs-queues
Drizzle ORM Keep your TypeScript schema, migrations, and typed queries honest with Drizzle. 2R · 3M · 1S ::pathrule:package:drizzle-orm
Node + TypeScript API (Hono) Build type-safe Hono APIs with chained routes, schema validation, and a typed RPC client. 3R · 3M · 1S ::pathrule:package:node-ts-api-hono
PostgreSQL Schema & Migrations Design normalized PostgreSQL schemas and ship lock-safe, forward-only migrations. 3R · 2M · 1S ::pathrule:package:postgres-schema
REST / HTTP API Design Design HTTP APIs that stay predictable, safe to retry, and easy to evolve. 2R · 3M · 1S ::pathrule:package:rest-api-design
Supabase + RLS Row Level Security done right: deny by default, user JWT only, and a clean migration workflow. 3R · 3M · 1S ::pathrule:package:supabase-rls
FastAPI (Python) Build type-safe async Python APIs with Pydantic validation and dependency injection. 4R · 2M · 1S ::pathrule:package:fastapi
Go API (Gin / Echo) Build idiomatic Go HTTP services with honest errors, context propagation, and validated input. 3R · 2M · 1S ::pathrule:package:go-api
Redis Caching Cache with Redis so reads get faster without serving stale or inconsistent data. 2R · 3M · 1S ::pathrule:package:redis-caching

Billing

Pattern What it gives you Bundle Token
Stripe Billing Safe Stripe integration: verified webhooks, idempotent handlers, and the right API for the job. 4R · 4M · 1S ::pathrule:package:stripe-billing
Subscriptions & Usage Billing Ship metered subscriptions on Stripe Billing without dropping usage or double-charging customers. 3R · 2M · 1S ::pathrule:package:subscriptions-usage-billing

Infra

Pattern What it gives you Bundle Token
Docker & Containers Ship small, secure, cache-friendly container images by default. 2R · 2M · 1S ::pathrule:package:docker-containers
GitHub Actions CI/CD Build hardened, fast, OIDC-deployed GitHub Actions pipelines that AI agents keep secure by default. 3R · 1M · 1S ::pathrule:package:github-actions-cicd
Observability Emit correlated logs, metrics, and traces that make incidents debuggable. 2R · 2M · 1S ::pathrule:package:observability
Secrets & Environment Management Keep secrets out of git, inject them at runtime, and rotate them automatically. 3R · 2M · 1S ::pathrule:package:secrets-env-management
Terraform / IaC Ship Terraform with locked remote state, pinned versions, and a plan-gated CI pipeline. 3R · 3M · 1S ::pathrule:package:terraform-iac
Vercel Deployment Ship to Vercel with safe previews, scoped env vars, and instant rollbacks. 2R · 3M · 1S ::pathrule:package:vercel-deploy

Workflow

Pattern What it gives you Bundle Token
Code Review Ship small pull requests that reviewers can approve fast with confidence. 3R · 1M · 1S ::pathrule:package:code-review
Git & Conventional Commits Keep history readable and releases automatic with small commits and Conventional Commits. 2R · 1M · 1S ::pathrule:package:git-conventional-commits
Monorepo (pnpm + Turborepo) Keep a pnpm and Turborepo monorepo fast, cacheable, and boundary-clean. 3R · 2M · 1S ::pathrule:package:monorepo-pnpm-turborepo
Testing (Vitest + Playwright) Unit test behavior with Vitest, drive real user flows with Playwright, and keep both green in CI. 3R · 2M · 1S ::pathrule:package:testing-vitest-playwright
Modern Python Tooling (uv + Ruff) Set up Python projects the 2026 way: one fast tool for envs and deps, one for lint and format. 2R · 2M · 1S ::pathrule:package:python-tooling

AI

Pattern What it gives you Bundle Token
AI SDK (Vercel AI SDK) Build streaming, tool-calling LLM features with one typed API across every provider. 3R · 2M · 1S ::pathrule:package:ai-sdk
RAG & Embeddings Ground LLM answers in your own data with retrieval that returns the right chunks, not just similar ones. 2R · 3M · 1S ::pathrule:package:rag-embeddings
MCP Server Authoring Build Model Context Protocol servers whose tools an LLM can actually call correctly and safely. 3R · 1M · 1S ::pathrule:package:mcp-server-authoring
LLM Evaluations & Testing Catch hallucinations and quality regressions before users do, with evals on every prompt change. 1R · 2M · 2S ::pathrule:package:llm-evals

Security

Pattern What it gives you Bundle Token
Software Supply Chain Security Stop a poisoned dependency from running in your build, CI, and production. 4R · 1M · 1S ::pathrule:package:supply-chain-security
Web Security (OWASP) Build web apps that deny by default, distrust every input, and ship secure headers. 3R · 2M · 1S ::pathrule:package:web-security

What is a Pattern

Each Pattern declares its pieces with a kind (memory | rule | skill), the target nodePath, and the full content body:

  • Memories capture decisions and conventions ("how we do X here").
  • Rules are constraints your agent should respect (with scope, priority, and advisory or strict enforcement).
  • Skills are reusable checklists or procedures.

The bundle for each pattern is composed from its actual subject: rule-heavy for constraint and security topics, memory-heavy for conventions and architecture, skill-heavy for review and checklist topics. No two need to look alike.

Using a Pattern

Browse the catalog at pathrule.io/patterns.

  • One-click import: paste a reference token into your AI assistant and Pathrule places each piece at the right path in your workspace.
    ::pathrule:package:nextjs-app-router
    
  • Manual copy: copy the full bundle from a Pattern page and paste the pieces where you want them.

Using the package programmatically

import { getAllPatterns, getPattern, serializePatternBundle } from "@pathrule/patterns";

const pattern = getPattern("nextjs-app-router");
if (pattern) {
  console.log(serializePatternBundle(pattern));
}

The package is a pure, dependency-free, serializable data module. It carries no React, DOM, or cloud imports, so it can be rendered on the web, bundled into a local snapshot, or synced to a backend without change.

Contributing

Patterns are curated and first-party for now, so we keep quality and provenance high. Community contribution will open later with a review process. Until then, please use issues to suggest a Pattern or report a fix.

License

Apache-2.0. See NOTICE.

About

Curated, path-scoped knowledge packages for AI coding agents (Claude Code, Cursor, Codex, Copilot, Windsurf, and any MCP client): ready-to-use bundles of memories, rules, and skills. First-party and free.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors