CClaude Code Catalog
全パターン

CLAUDE.md アーキテクチャパターン

CLAUDE.md中級

CLAUDE.mdファイルはグローバル(~/.claude/CLAUDE.md)、プロジェクトルート、サブディレクトリオーバーライドの階層構造を形成します。このパターンは各レイヤーを最大限再利用できるよう構造化する方法を示します -- グローバルは個人スタイルと安全ルール、プロジェクトレベルはスタック固有のコンベンション、ディレクトリレベルはモジュール固有の制約。monorepo、マイクロサービス、個人プロジェクト向けテンプレートを含みます。

CLAUDE.md設定アーキテクチャコンベンション

パターンコード

# CLAUDE.md Layered Architecture ## Layer 1: Global (~/.claude/CLAUDE.md) ```markdown # Global Rules (apply to ALL projects) ## Safety - Never commit .env files or secrets - Never run destructive git commands without confirmation - Never modify files outside the current project ## Style - Use TypeScript strict mode - Prefer functional patterns over classes - Commit messages: imperative mood, <72 chars ## Communication - Respond in Korean, code in English - Use structured output (headings, lists, tables) ``` ## Layer 2: Project Root (./CLAUDE.md) ```markdown # Project: E-Commerce Platform ## Stack - Runtime: Node.js 20 + TypeScript 5.4 - Framework: Next.js 15 (App Router) - Database: PostgreSQL 16 + Drizzle ORM - Testing: Vitest + Playwright ## Conventions - API routes: src/app/api/[resource]/route.ts - Components: PascalCase, co-located tests - Database migrations: drizzle-kit generate ## Forbidden - Do NOT use any ORM other than Drizzle - Do NOT add runtime dependencies without checking bundle size - Do NOT modify shared types in src/types/ without updating all consumers ``` ## Layer 3: Subdirectory (./src/components/CLAUDE.md) ```markdown # Component Rules - Every component must have a .test.tsx file - Use compound component pattern for complex UI - Props interface must be exported separately - Storybook story required for design-system components ``` ## Resolution Order 1. Subdirectory CLAUDE.md (most specific) 2. Project root CLAUDE.md 3. Global CLAUDE.md (least specific) - More specific rules override general ones - Safety rules from global always apply

このパターンをプロジェクト設定にコピーして適用してください。

実行プレビュー

CLAUDE.md アーキテクチャパターン

CLAUDE.md アーキテクチャパターンについて

Claude Codeパターンは、複雑な開発シナリオに対応するための実証済みアーキテクチャ設計とワークフロー構造です。CLAUDE.md アーキテクチャパターンは中級レベルのCLAUDE.mdパターンで、プロジェクトに合わせて応用できるテスト済みの再現可能なアプローチを提供し、より効率的で一貫した成果を実現します。

関連パターン