Apply Grey Haven Studio's TypeScript/React and Python/FastAPI coding standards from production templates...
Actual coding standards from Grey Haven Studio production templates.
Follow these exactly when working on Grey Haven codebases. This skill provides navigation to detailed examples, reference configs, and templates.
Based on cvi-template - TanStack Start + React 19
Key Settings:
any, unused vars)~/ maps to ./src/*Naming Conventions:
camelCase (getUserData, isAuthenticated)PascalCase (UserProfile, AuthProvider)UPPER_SNAKE_CASE (API_BASE_URL, MAX_RETRIES)PascalCase (User, AuthConfig)snake_case (user_id, created_at, tenant_id) ā ļø CRITICALProject Structure:
src/
āāā routes/ # File-based routing (TanStack Router)
āāā lib/
ā āāā components/ # UI components (grouped by feature)
ā āāā server/ # Server functions and DB schema
ā āāā config/ # Environment validation
ā āāā hooks/ # Custom React hooks (use-* naming)
ā āāā utils/ # Utility functions
ā āāā types/ # TypeScript definitions
āāā public/ # Static assets
Based on cvi-backend-template - FastAPI + SQLModel
Key Settings:
Naming Conventions:
snake_case (get_user_data, is_authenticated)PascalCase (UserRepository, AuthService)UPPER_SNAKE_CASE (API_BASE_URL, MAX_RETRIES)snake_case (user_id, created_at, tenant_id) ā ļø CRITICALis_ or has_ (is_active, has_access)Project Structure:
app/
āāā config/ # Application settings
āāā db/
ā āāā models/ # SQLModel entities
ā āāā repositories/ # Repository pattern (tenant isolation)
āāā routers/ # FastAPI endpoints
āāā services/ # Business logic
āāā schemas/ # Pydantic models (API contracts)
āāā utils/ # Utilities
ALWAYS use snake_case for database column names - this is non-negotiable in Grey Haven projects.
ā Correct:
// TypeScript - Drizzle schema
export const users = pgTable("users", {
id: uuid("id").primaryKey(),
created_at: timestamp("created_at").defaultNow(),
tenant_id: uuid("tenant_id").notNull(),
email_address: text("email_address").notNull(),
is_active: boolean("is_active").default(true),
});
# Python - SQLModel
class User(SQLModel, table=True):
id: UUID = Field(default_factory=uuid4, primary_key=True)
created_at: datetime = Field(default_factory=datetime.utcnow)
tenant_id: UUID = Field(foreign_key="tenants.id", index=True)
email_address: str = Field(unique=True, index=True)
is_active: bool = Field(default=True)
ā Wrong:
// DON'T use camelCase in database schemas
export const users = pgTable("users", {
id: uuid("id"),
createdAt: timestamp("createdAt"), // WRONG!
tenantId: uuid("tenantId"), // WRONG!
emailAddress: text("emailAddress"), // WRONG!
});
See EXAMPLES.md for complete examples.
Every database table must include tenant isolation:
tenant_id (snake_case in DB) or tenantId (camelCase in TypeScript code)tenant_idSee EXAMPLES.md for implementation patterns.
ā ļø ALWAYS activate virtual environment before running Python commands:
source .venv/bin/activate
Required for:
pytest)task test, task format)Use this skill when:
These standards come from actual Grey Haven production templates:
cvi-template (TanStack Start + React 19 + Drizzle)cvi-backend-template (FastAPI + SQLModel + PostgreSQL)When in doubt, reference these templates for patterns and configurations.
snake_case (both TypeScript and Python schemas)any type: ALLOWED in Grey Haven TypeScript (pragmatic approach)singleQuote: false)disallow_untyped_defs: true)tenant_id/tenantId~/ for TypeScript imports from src/trailingComma: "all")