Skip to content

Latest commit

 

History

History
45 lines (39 loc) · 1.8 KB

File metadata and controls

45 lines (39 loc) · 1.8 KB

OpenCode.md

Build, Lint, and Test

  • Dev server: bun run dev (auto-refresh enabled)
  • Build: bun run build
  • Lint: bun run lint
  • Dependencies: Add with bun add [package-name]
  • UI components: Add via bunx --bun shadcn@latest add [component-name]
  • Testing: No standard/unit test runner detected; project may be E2E/manual test only

Code Style & Guidelines

  • Imports: Use absolute imports as per Next.js conventions; group external before relative.
  • Formatting: Prettier+ESLint conventions, follow project config.
  • Types:
    • Prefer interface for objects; use type for unions/intersections
    • Strict typing; no any, use unknown if necessary
    • Co-locate types with usage; use types/ dir for shared
    • React prop interfaces prefixed with Props
  • Naming:
    • Types/Interfaces: PascalCase
    • Vars/functions: camelCase
    • Constants: UPPER_CASE
    • Folders: kebab-case (e.g., policy-card)
  • Project Structure:
    • Page-specific: app/
    • Shared components: components/ (shadcn/ui in components/ui/)
    • Utilities: lib/
    • CSS in globals.css
  • Components:
    • Use Server Components by default; "use client" opt-in
    • Shadcn/ui or Tailwind style for all UI—avoid custom CSS where possible
    • Accessibility matters—use semantic HTML and Radix UI features
  • Error Handling:
    • Server: Custom error types; use try/catch with typed errors
    • Client: Show meaningful messages, implement error boundaries
  • Other:
    • Minimize client state & use SSR/RSC when possible
    • Use Zod for form validation if authoring forms
    • Favor utility-first (Tailwind) for styling, keep classes organized

This file empowers agentic tools to build, lint, and format code, and keeps contributions aligned with repository standards.