Appearance
Coding Standards
This page summarises the enforced standards. The authoritative sources are the repo's CLAUDE.md and documentations/claude/CODING_STANDARDS.md; the design system is documentations/01-layout/guidelines/niftytoolkit-uiux-theme-guidelines.md.
Hard guardrails
- No TypeScript in the app —
.jsx/.jsonly (edge functions are Deno/TS and are exempt). - No
supabase.from()anywhere insrc/. - No
supabase.rpc()outside hooks; nosupabase.functions.invoke()outside services. - No new Supabase clients — use
src/lib/supabaseClient.js. - No inline EF name strings — use
EDGE_FN.CONSTANT. - No Redux — reads use cached hooks; mutations use TanStack
useMutationor local state. - No
console.login frontend code. - No inline styles — Tailwind utilities only.
- No hardcoded hex colors in class strings (chart stroke/fill values are the only exception).
- No legacy theme imports (
@/theme/lightTheme/darkTheme) — usecn()+isLight. - Every component handles dark & light via
isLight. - No speculative abstractions — implement exactly what's asked.
- No
.mddocs unless requested. - Never modify existing migrations — add new ones.
- No cross-tier downward imports (
users/✗admin/). - Every new feature ships a
tests/folder (4-layer model).
No-comments policy
Write zero comments by default. Add one only when the why is non-obvious (a hidden constraint, a workaround, a subtle invariant). Never comment what the code does. No docstrings.
Naming
| Entity | Convention | Example |
|---|---|---|
| Components | PascalCase | TradePlanBriefingCard.jsx |
| Hooks | use + camelCase | useNifty50MoodData.js |
| Services | camelCase + Service | tradePlannerService.js |
| Tables | snake_case | trade_planner_plans |
| RPCs | get_{entity} | get_nifty50_market_mood |
| Edge functions | kebab domain-action | trade-planner-save |
| Migrations | YYYYMMDD_NNN_name.sql | 20260601_133_index_radar_rpc.sql |
| EF config keys | UPPER_SNAKE_CASE | EDGE_FN.SAVE_PLAN |
Testing — mandatory 4-layer model
| Layer | Scope |
|---|---|
| 1 — Pure computation | utils / pure functions, no mocks |
| 2 — Unit | hooks + services (mock supabase + cache) |
| 3 — Component smoke | real component import; first test asserts it mounts (validates react-icons/ri imports) |
| 4 — Page / route integration | real page + real sub-components, mocked hooks/services; assert supabase.from() is never called |
react-icons/ri is never mocked in component tests — that's exactly what the mount test validates. Coverage thresholds: 70% lines, 80% functions.