Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add Bamose/everything-codex-cli --skill "project-guidelines-example"
Install specific skill from multi-skill repository
# Description
Example project-specific skill for the Ongize monorepo (Next.js + Cloudflare Workers + Drizzle).
# SKILL.md
name: project-guidelines-example
description: Example project-specific skill for the Ongize monorepo (Next.js + Cloudflare Workers + Drizzle).
Project Guidelines Skill (Ongize Example)
This is an example of a project-specific skill. Use this as a template for your own projects.
Based on the local Ongize monorepo.
When to Use
Reference this skill when working on the Ongize repo. Project skills contain:
- Architecture overview
- File structure
- Code patterns
- Testing and quality workflow
- Deployment workflow
Architecture Overview
Tech Stack:
- Monorepo: Turborepo + pnpm workspaces
- Frontend: Next.js 15 (App Router), React 19, TypeScript, Mantine, Tailwind 4
- Backend: Cloudflare Workers (Hono + Zod OpenAPI)
- Database: Neon Postgres with Drizzle ORM (Kysely for complex SQL)
- Auth: better-auth
- Background Jobs: Trigger.dev
- Tooling: Biome, TypeScript, Lefthook, Commitlint
- Deployment: OpenNext on Cloudflare (web/app) + Wrangler for API
Services:
ββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββ
β Frontend (website) β β Frontend (app) β
β Next.js + React + Mantine β β Next.js + React + Mantine β
βββββββββββββββββ¬βββββββββββββ βββββββββββββββββ¬βββββββββββββ
β β
βββββββββββββββββ¬βββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β API (Cloudflare) β
β Hono + Zod OpenAPI + TypeScript β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββ
β Postgres (Neon) β
β Drizzle + Kysely β
ββββββββββββββββββββ
Other services: S3 (files), Resend (email), Twilio (SMS), Trigger.dev (jobs)
File Structure
ongize/
βββ apps/
β βββ website/ # Marketing site (Next.js)
β βββ app/ # Main product (Next.js)
β βββ api/ # Cloudflare Workers API (Hono)
βββ packages/
β βββ shared/ # Shared types, utilities, styles
βββ scripts/ # Tooling scripts (type generation, etc.)
βββ docs/ # Documentation
βββ turbo.json # Turbo pipelines
βββ pnpm-workspace.yaml # Workspaces
βββ biome.json # Lint/format rules
Code Patterns
API Response Format (Hono)
interface ApiResponse<T> {
success: boolean
data?: T
error?: string
}
app.get('/health', (c) => {
const response: ApiResponse<{ status: string }> = {
success: true,
data: { status: 'ok' },
}
return c.json(response)
})
Database Access (Drizzle)
import { db } from '@/db'
import { users } from '@/db/schema'
// Typed query from schema
const rows = await db.select().from(users)
Frontend API Calls (TypeScript)
interface ApiResponse<T> {
success: boolean
data?: T
error?: string
}
async function fetchApi<T>(
endpoint: string,
options?: RequestInit
): Promise<ApiResponse<T>> {
try {
const response = await fetch(endpoint, {
...options,
headers: {
'Content-Type': 'application/json',
...options?.headers,
},
})
if (!response.ok) {
return { success: false, error: `HTTP ${response.status}` }
}
return await response.json()
} catch (error) {
return { success: false, error: String(error) }
}
}
Shared Types
Use packages/shared for cross-app types, utilities, and shared styles.
Testing and Quality
Quality checks:
pnpm lint
pnpm check-types
Type generation:
pnpm generate:types
E2E tests (when configured):
# Add Playwright config under apps/app when needed
pnpm --filter @ongize/app exec playwright test
Deployment Workflow
# Website (Next.js on Cloudflare)
pnpm --filter @ongize/website deploy
# App (Next.js on Cloudflare)
pnpm --filter @ongize/app deploy
# API (Cloudflare Workers)
pnpm --filter @ongize/api deploy
Environment Variables
- Per-app
.envfiles live underapps/appandapps/api. - Cloudflare bindings live in
apps/*/wrangler.jsonc. - Do not commit secrets; use Cloudflare secrets or CI env vars.
Critical Rules
- Immutability over mutation
- TDD for new features and fixes
- 80%+ coverage target
- Many small files (200-400 lines typical)
- No console.log in production code
- Proper error handling with try/catch
- Input validation with Zod
Related Skills
coding-standards/- General coding best practicesbackend-patterns/- API and database patternsfrontend-patterns/- React and Next.js patternstdd-workflow/- Test-driven development methodology
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.