This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
pnpm dev- Start development server on localhost:3000pnpm build- Build the application for production (configured for static export)pnpm start- Start production serverpnpm biome:check- Run Biome formatter and linterpnpm biome:fix- Run Biome formatter and linter with auto-fixpnpm biome:staged- Run Biome on staged files only
This project uses Biome for formatting and linting. Always run pnpm biome:check before committing changes. The project has a pre-commit hook (lefthook) that automatically runs Biome on staged files.
IMPORTANT:
- Do NOT run
pnpm devorpnpm buildduring development tasks unless specifically requested by the user. The build process is mainly for final deployment verification. - When implementing new pages or components, use placeholders instead of actual content. Show what type of content should go in each position rather than writing fake content.
- Do NOT create UI structures arbitrarily. Always ask the user for specific requirements and approval before implementing any UI design or structure.
- Main branch:
main- production-ready code - Feature branches:
feature/descriptionorfeat/short-namefor new features - Bug fixes:
fix/descriptionorbugfix/issue-numberfor bug fixes - Documentation:
docs/descriptionfor documentation updates
Follow conventional commits format for clear, searchable history:
<type>: <description>
[optional body]
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Types:
feat:- new featuresfix:- bug fixesdocs:- documentation updatesconfig:- configuration changesrefactor:- code refactoring without feature changeschore:- maintenance tasks, dependency updates
Examples:
feat: 블로그 포스트 검색 기능 추가fix: 모바일에서 네비게이션 메뉴 깨짐 수정docs: CLAUDE.md에 Git 워크플로우 가이드 추가
The project uses lefthook to automatically run quality checks
IMPORTANT: Claude Code must follow this PR-based workflow for ALL development tasks:
# Ensure you're on main and up to date
git checkout main
git pull origin main
# Create a new feature branch
git checkout -b <type>/<description>feat/- New features (e.g.,feat/search-functionality)fix/- Bug fixes (e.g.,fix/mobile-nav-issue)docs/- Documentation updates (e.g.,docs/readme-update)config/- Configuration changes (e.g.,config/eslint-setup)refactor/- Code refactoring (e.g.,refactor/component-structure)chore/- Maintenance tasks (e.g.,chore/dependency-update)
# Stage and commit changes LOGICALLY
# DO NOT commit everything at once - break into logical commits
git add [specific files for logical group 1]
git commit -m "conventional commit message for group 1"
git add [specific files for logical group 2]
git commit -m "conventional commit message for group 2"
# Push to remote
git push -u origin <branch-name>
# Create PR immediately
gh pr create --title "PR Title" --body "$(cat <<'EOF'
## Summary
- Brief description of changes
- Key implementation details
## Checklist
- [ ] Checklist item 1
- [ ] Checklist item 2
🤖 Generated with [Claude Code](https://claude.ai/code)
EOF
)"IMPORTANT: When the user asks to commit changes, NEVER create a single large commit. Always break changes into logical, separate commits such as:
- Documentation changes
- Configuration changes
- New component implementations
- Layout/styling updates
- Bug fixes Each commit should represent one logical change or feature.
- Always create PRs: Never commit directly to main
- Clear titles: Use conventional commit format in PR titles
- Detailed descriptions: Include Summary and Test plan sections
- Link issues: Reference related GitHub issues when applicable
- One logical change per PR: Keep PRs focused and reviewable
- Complete features: Don't leave work in broken state
- Test your changes: Run
pnpm biome:fixbefore committing - Document breaking changes: Clearly explain any breaking changes
- Use placeholders: When implementing new pages/components, use placeholders like "[Page Title]", "[Description]", "[Content]" instead of actual content
- No arbitrary UI: Do NOT create UI structures without explicit user requirements and approval
- Wait for CI checks to pass
- Address any review feedback
- Merge only after approval (if working in team) or when CI is green (if solo)
Remember: This workflow ensures clean git history, proper code review, and CI validation for all changes.
This is a Next.js 15 blog application configured for static export with MDX support for content authoring.
Key Technologies:
- Next.js 15 with App Router
- MDX for blog content with rehype-pretty-code syntax highlighting
- Tailwind CSS for styling
- shadcn/ui for UI components
- TypeScript
- Biome for code formatting/linting
All client-side code is organized under src/app/ following Next.js App Router conventions with a package-like structure:
src/app/- Next.js App Router root directoryabout/- About page routeblog/- Blog routes[slug]/- Dynamic blog post pages
layout.tsx- Root layout componentpage.tsx- Home pagenot-found.tsx- 404 error pageglobals.css- Global styles
src/entities/- Domain entities and business logic (outside app directory)src/contents/- MDX blog posts (*.mdx files)
Naming Convention:
- Use underscore prefix (
_) for folders that should not be treated as routes by Next.js App Router - Follow Java package-like structure: components and hooks are organized by their scope
- Global scope:
src/app/_components/,src/app/_hooks/ - Page/Feature scope:
src/app/[route]/_components/,src/app/[route]/_hooks/
- Global scope:
- This ensures components and logic are co-located with their usage while maintaining clear boundaries
This project follows Domain-Driven Design principles with entities organized in src/entities/:
src/entities/posts/- Blog post domain logic- Repository pattern for data access
- Post entity with type definitions
- Business logic for post operations
src/entities/tags/- Tag system domain logic- Tag entity and graph relationships
- Tag operations and queries
- Graph-based tag analysis
Blog posts are stored as MDX files in src/contents/. Each MDX file contains:
- Frontmatter: YAML metadata with
title,date,slug, andtagsinformation - Content: Markdown content with JSX component support
The post entity in src/entities/posts/ handles parsing and processing of these MDX files.
The app is configured for static export (output: 'export' in next.config.ts) and uses:
generateStaticParams()for blog post routes- Dynamic imports for MDX components in blog pages
- Uses Tailwind CSS with custom configuration
- shadcn/ui for UI components
- CSS variables for theming (light/dark mode support)
- Noto Sans KR font for Korean language support
- Prose styling for blog content rendering
This project uses shadcn/ui for consistent, high-quality UI components:
- Installation: Use
npx shadcn@latest add <component>to add new components - Location: UI components are placed in
src/app/_components/ui/ - Style: Configured with "new-york" style and stone base color
- Theming: Full CSS variables support for light/dark themes
- Icons: Uses Lucide React for icons
- Utilities:
cn()function insrc/app/_lib/utils.tsfor conditional styling - Color Palette: Always use
stonecolor palette for consistent design (e.g.,text-stone-900,border-stone-200,bg-stone-50)
Static files are generated in the out/ directory during build.