Skip to content

code_patterns

code_patterns analyzes the indexed codebase and returns the patterns it actually uses — framework, styling approach, state management, i18n strategy, testing setup, and naming conventions. It reads from real code, not configuration files.

code_patterns()
CategoryExamples
FrameworkNext.js, NestJS, Express, FastAPI, Actix
StylingTailwind, CSS Modules, styled-components, Sass
State managementRedux, Zustand, Jotai, React Query, MobX
i18nnext-intl, i18next, react-intl
TestingJest, Vitest, pytest, cargo test, Playwright
NamingcamelCase, snake_case, PascalCase conventions per layer
Detected patterns:
Framework: Next.js 14 (App Router)
Styling: Tailwind CSS with design tokens
State: Zustand (client), React Query (server)
i18n: next-intl, keys in messages/ar.json + en.json
Testing: Jest + Playwright (E2E)
API: tRPC (internal), REST (external)
Naming:
Components: PascalCase
Functions: camelCase
DB columns: snake_case
  • Before writing new code — understand what patterns to follow
  • Onboarding to an unfamiliar project
  • Before code_rules — patterns give the raw facts, rules give the actionable guidance

code_rules uses the detected patterns to return scope-specific rules for your AI agent to follow. Run code_patterns once to understand the project, then use code_rules during work sessions.