Skip to content

Commit 70a7e3b

Browse files
ericyangpanclaude
andcommitted
docs(claude): update development workflow guidelines
Update CLAUDE.md with refined development workflow guidelines and best practices. Changes: - Clarify internationalization requirements and best practices - Update design system guidelines with emphasis on minimalism - Refine metadata and SEO best practices - Update development workflow recommendations - Add DRY principle section for code quality These updates ensure better alignment with current project structure and development practices. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8febae6 commit 70a7e3b

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

CLAUDE.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Internationalization (i18n)
66

7-
**CRITICAL REQUIREMENTS:**
8-
97
When creating or modifying any page, module, or data:
10-
- **MUST support at least 3 languages:** English, Simplified Chinese (zh-Hans), and German (de)
8+
- **MUST support at least 3 languages:** English, Simplified Chinese (zh-Hans), and German (de), NEVER hardcode `'en' | 'zh-Hans'`
119
- **MUST use the localized Link component:** Always import and use `import { Link } from '@/i18n/navigation'` instead of Next.js default Link
1210

1311
### Localization Best Practices
@@ -23,20 +21,29 @@ When creating or modifying any page, module, or data:
2321
- **Minimalist approach:** Follow a unified, extremely minimalist design style throughout the entire application
2422
- **No rounded corners:** All controls, components, labels, and UI elements MUST use sharp corners (border-radius: 0)
2523
- **Restrained color usage:** Use colors extremely sparingly and intentionally. Prefer grayscale and limit accent colors to essential UI elements only. If colors must be used, prefer low-saturation designs.
26-
- **Icon usage:** Avoid using emoji or any other characters as icons. Prioritize SVG for icons.
24+
- **Icon usage:** Prefer using Lucide SVG icons. Avoid using emoji or any other characters as icons.
2725
- **Page width:**
2826
- `max-w-8xl`: for all pages globally
29-
- `max-w-5xl`: for content pages and homepage
27+
- `max-w-6xl`: for content pages and homepage
3028

3129
## Coding Principles
3230

33-
**CRITICAL: Follow these principles rigorously in all code:**
34-
3531
### DRY - Don't Repeat Yourself
3632
- Eliminate code duplication by extracting common logic
3733
- Reuse existing components, functions, and translation keys
3834
- Create shared utilities when patterns emerge
3935

36+
## Metadata & SEO
37+
38+
- **File-based OG images:** Use `opengraph-image.tsx` files for all routes, NOT code-based image paths
39+
- **Request memoization:** Wrap all data fetchers with React `cache()` to prevent duplicate fetching in `generateMetadata()` and page components
40+
- **Type-safe locales:** Always use `import type { Locale } from '@/i18n/config'`
41+
- **Auto-detected OG images:** Do NOT manually specify `images` in OpenGraph metadata - Next.js auto-detects `opengraph-image.tsx` files
42+
43+
**OG Image Design:**
44+
- Size: 1200x630px (OpenGraph standard)
45+
- Follow global design system strictly
46+
4047
## Development Workflow
4148

4249
- **Development server:** Do not start `npm run dev` automatically. User will start it manually when needed.

0 commit comments

Comments
 (0)