Claude AI Assistant Guidelines
Defines conventions, project structure rules, and workflow patterns for a Hono + Prisma + Kysely backend with TypeScript and PostgreSQL.
What this file does
Defines conventions, project structure rules, and workflow patterns for a Hono + Prisma + Kysely backend with TypeScript and PostgreSQL.
When to use it
- Onboarding a new developer to a Hono + Prisma + Kysely project
- Setting up a fresh repository with the same tech stack and conventions
- Enforcing consistent naming, folder layout, and testing practices across a team
- Creating a reference for AI assistants to follow when generating code
Assumes this stack
Claude AI Assistant Guidelines
Project Context
This is a Hono + Prisma + Kysely backend project with TypeScript and PostgreSQL. When working on this codebase, you must adhere to the established conventions and patterns.
Important Instructions
0. Running Tests
ALWAYS do pnpm test run <file_path> or pnpm test run for all.
1. Project Structure Compliance
ALWAYS follow the structure and conventions defined in README.project-structure.md when:
- Creating new files or folders
- Organizing code modules
- Naming files, folders, functions, types, etc.
- Implementing features or API routes
2. Rules and Patterns
ALWAYS check the rules/ folder for specific implementation patterns before:
- Creating controllers → See
rules/controllers-and-routes.md - Implementing data access → See
rules/data-access-via-db.mdorrules/data-access-via-api.md - Creating service layers → See
rules/service-layer.md - Writing tests → See
rules/testing-data-access-layer.md - Implementing any feature that might have established patterns
3. Code Generation Guidelines
When generating or modifying code:
- First, understand the existing patterns in the codebase
- Check if there are similar implementations to reference
- Follow the established naming conventions strictly
- Place files in the correct folders according to the project structure
- Use appropriate workflow patterns (Pattern 1, 2, or 3) based on complexity
4. Key Conventions Summary
- File/Folder naming:
kebab-case(use_kebab-casefor feature-specific modules) - Types/Classes:
PascalCase - Functions/Variables/Zod Schemas:
camelCase - Database:
snake_casefor tables, columns, query params, and request body - Package Manager: Always use
pnpm - API Framework: Hono
- Database ORM: Prisma (schema) + Kysely (queries)
- Validation: Zod
- Testing: Vitest
5. Before Making Changes
Always:
- Read the relevant documentation in
README.project-structure.md - Check for existing patterns in
rules/folder - Look for similar implementations in the codebase
- Maintain consistency with existing code style
- Run all checks for TypeScript, Lint & Check Spell:
pnpm check:all
6. When Creating New Features
Follow this checklist:
- Determine if it's a shared module or feature domain
- Create the appropriate folder structure as defined in the project structure
- Follow the naming conventions for all files and exports
- Check rules folder for implementation patterns
- Use existing utilities and shared modules when possible
- Only create service layers when business logic is complex
- Write type-safe code using TypeScript
- Implement proper DTOs for request/response validation
- Ensure proper error handling in data access and controllers
7. Checks Commands
pnpm build- Build for productionpnpm test- Run testspnpm format- Format code with Prettierpnpm check:all- Run all checks concurrently for TypeScript, Lint and Check Spell
Remember: Consistency and adherence to established patterns is crucial for maintaining a clean, scalable codebase.
What's inside
7 sections covering project context, instructions, conventions, feature checklist, and check commands
Change this for your project
- Replace
pnpmwith your package manager if not using pnpm - Replace
README.project-structure.mdwith your own project structure document - Replace
rules/folder references with your actual rules directory path
Where it goes
Save as AGENTS.md in your repository root. Read by Codex, Cursor and other agents that follow the AGENTS.md convention.
Worth borrowing
- Requiring AI to check a rules folder before generating code ensures pattern consistency
- Checklist for new features (shared vs domain, folder structure, naming, error handling) prevents omissions
- Running
pnpm check:allas a single command enforces TypeScript, lint, and spell checks together
Related Documents
Browser-only development
Guides AI assistants on an Electron + React + TypeScript desktop app for browsing and organizing AI-generated images locally.
Claude Agents — Reference & Recommendations
Catalogues 40+ Claude agents and marketing skills for building a cat adoption charity landing page, with a ready-to-paste prompt and backend API reference.
Golden DKG Prototype -- Master Plan
Defines an 8-phase implementation plan for a Rust prototype of the Golden non-interactive DKG protocol using BLS12-381 and tokio.
Swarms Examples Index
Lists 60+ example scripts for building single and multi-agent systems with the Swarms framework, organized by category and use case.