הגדרת קבצי CLAUDE.md
הגדר הגדרות ספציפיות לפרויקט והקשר כדי למקסם את האפקטיביות של Claude Code לפרויקטים הספציפיים שלך.
מה זה CLAUDE.md?
CLAUDE.md הוא קובץ תצורה מיוחד המאפשר לך לספק הקשר מתמשך והגדרות ספציפיות לפרויקט ל-Claude Code. זה עוזר ל-Claude להבין את הפרויקט שלך טוב יותר ולספק סיוע מדויק יותר.
יתרונות מרכזיים
- הקשר פרויקט מתמשך בין הפעלות
- תצורה מותאמת אישית לצרכים ספציפיים לפרויקט
- המלצות קוד משופרות
- הבנה טובה יותר של ארכיטקטורת הפרויקט
- צורך מופחת בהסברים חוזרים
יצירת קובץ CLAUDE.md בסיסי
בואו נתחיל עם מבנה קובץ CLAUDE.md בסיסי:
שלב 1: צור את הקובץ
צור קובץ בשם CLAUDE.md בספריית השורש של הפרויקט שלך:
# Project: My Awesome App ## Project Description A brief description of what your project does and its main features. ## Tech Stack - Frontend: React, TypeScript - Backend: Node.js, Express - Database: MongoDB - Testing: Jest, React Testing Library ## Code Conventions - We use Prettier for formatting - ESLint for linting - Functional components with hooks for React - 2-space indentation - camelCase for variables and functions - PascalCase for components and classes ## Project Structure - /src - Main source code - /components - React components - /pages - Page components - /api - API routes - /utils - Utility functions - /hooks - Custom React hooks - /styles - CSS/SCSS files - /public - Static assets - /tests - Test files
שלב 2: הוסף קטעים ספציפיים להקשר
שפר את CLAUDE.md שלך עם הקשר ספציפי יותר:
## Important Notes - User authentication uses JWT stored in HttpOnly cookies - API calls should use the client utility in /src/utils/api.ts - New components should have a companion test file - State management uses React Context + useReducer ## Known Issues - Performance issues with large data sets in the dashboard component - Mobile menu animation is choppy on older iOS devices ## Future Plans - Implementing real-time updates with WebSockets - Adding a dark mode theme - Migrating to Next.js for improved SEO
תצורה מתקדמת
קח את קובץ CLAUDE.md שלך לרמה הבאה עם תכונות מתקדמות אלה:
הוראות מותאמות אישית
הוסף הוראות ספציפיות לאופן שבו Claude צריך להתנהג כאשר עובד עם הפרויקט שלך:
## Instructions for Claude - Always suggest TypeScript types for new functions - Prioritize performance optimizations - Use React Query for data fetching - Follow the existing error handling pattern - Include JSDoc comments for public functions - Prefer functional programming approaches
תצורת סביבה
ספק מידע על סביבת הפיתוח:
## Environment Setup - Node.js v16+ - npm scripts: - `npm start` - Start development server - `npm test` - Run tests - `npm run build` - Build for production - `npm run lint` - Run linter - Environment variables (examples, not actual values): - API_URL=http://localhost:3001 - DEBUG=false - FEATURE_FLAGS_ENABLED=true
תרשימי ארכיטקטורה
כלול תרשימי Mermaid להדמיה של ארכיטקטורה:
## Architecture
```mermaid
graph TD
A[Client] --> B[API Gateway]
B --> C[Auth Service]
B --> D[User Service]
B --> E[Content Service]
C --> F[(Auth DB)]
D --> G[(User DB)]
E --> H[(Content DB)]
```
## Component Relationships
```mermaid
graph TD
A[App] --> B[Layout]
B --> C[Header]
B --> D[Main Content]
B --> E[Footer]
D --> F[Dashboard]
F --> G[UserStats]
F --> H[ActivityFeed]
F --> I[Recommendations]
```שיטות עבודה מומלצות
עקוב אחר שיטות עבודה מומלצות אלה לתחזוקת קבצי CLAUDE.md יעילים:
שמור עדכני
- עדכן את CLAUDE.md בכל פעם שארכיטקטורת הפרויקט משתנה
- הוסף קטעים חדשים ככל שמורכבות הפרויקט גדלה
- הסר מידע מיושן
- התייחס אליו כתיעוד חי
השתמש במספר קבצי CLAUDE.md
לפרויקטים גדולים יותר, שקול להשתמש במספר קבצי CLAUDE.md בספריות שונות:
/CLAUDE.md- הקשר פרויקט שורש/frontend/CLAUDE.md- פרטים ספציפיים ל-frontend/backend/CLAUDE.md- פרטים ספציפיים ל-backend/docs/CLAUDE.md- הנחיות תיעוד
בקרת גרסאות
- בצע commit של CLAUDE.md למאגר שלך
- סקור שינויים ל-CLAUDE.md במהלך סקירות קוד
- שקול להוסיף עדכוני CLAUDE.md להגדרת ה-Definition of Done שלך
מדריכים קשורים
חקור מדריכים קשורים אלה לשיפור תהליך העבודה Claude Code שלך:
- למד כיצד להשתמש בפקודה /clear ביעילות לניהול הקשר
- שלוט בשיטות עבודה מומלצות לאינטגרציה עם Git עם Claude Code
- בדוק טכניקות ניהול הקשר מתקדמות