questionnaire docs
Development

Coding Rules

Project conventions and anti-patterns from AGENTS.md.

Coding Rules

File size

Hard limit: 200 lines per file. Split by responsibility if approaching the limit.

Naming conventions

TypeConventionExample
ComponentsPascalCaseUserCard.js
HooksuseCamelCaseuseAuthState.js
Utils / libcamelCaseformatDate.js
API routeskebab-caseuser-profile/route.js
Docskebab-caseuser-auth.md

Anti-patterns (never do)

  • No wrapper functions that only return their parameters
  • No over-engineering or premature abstraction
  • No business logic inside ui/ components
  • No inline styles unless dynamic

Atomic todos

  • 1 todo = 1 file or 1 function
  • Each todo must be independently testable and reversible
  • Multi-file changes → split into separate todos

Shared utilities

Use existing helpers instead of reimplementing:

NeedUse
Display KV valuesgetDisplayKv1Values() from lib/utils/adConfig.js
Interstitial KV valuesgetInterstitialKv1Values()
Ad timing checkuseAdThemeTiming hook
Screen sizeuseScreenSize hook
Content bluruseContentBlur hook

Documentation rule

Every new or updated feature → create or update documentation/content/docs/<section>/<feature>.mdx

Memory comments

Add // @memory comments on non-obvious decisions. Search with:

grep -r "@memory" components/ lib/

Next.js warning

This project uses Next.js 16 with breaking changes. Read node_modules/next/dist/docs/ before writing Next.js code.

On this page