claude-md
ما الذي تفعله
يرشد وكيلك إلى كتابة ملف CLAUDE.md الذي يشرح لـClaude طريقة عمل المشروع، أو إلى مراجعته. وهو مناسب للمطورين الذين يريدون أن تبدأ مساعدتهم الذكية كل جلسة بالسياق الصحيح.
متى تستخدمها
- ✓عندما تبدأ مشروعًا جديدًا وتريد كتابة ملف CLAUDE.md له.
- ✓عندما يكون ملف CLAUDE.md الموجود طويلًا جدًا أو غير واضح ويحتاج إلى تحسين.
- ✓عندما تريد فحص جودة ملف CLAUDE.md لمشروع قبل مشاركته مع الفريق.
رابط المهارة
https://github.com/luongnv89/claude-howto/blob/main/03-skills/claude-md/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل يمكنك مراجعة ملف CLAUDE.md الخاص بي واقتراح ما يجب حذفه ليبقى قصيرًا ومفيدًا؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يحلل الوكيل المشروع، ويتحقق من وجود ملفات CLAUDE.md، ثم ينشئها أو يحدّثها أو يراجعها وفق مجموعة من المبادئ. ويُبقي فقط المعلومات التي تنطبق على كل جلسة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty). User may specify:
create- Create new CLAUDE.md from scratchupdate- Improve existing CLAUDE.mdaudit- Analyze and report on current CLAUDE.md quality- A specific path to create/update (e.g.,
src/api/CLAUDE.mdfor directory-specific instructions)
Core Principles
LLMs are stateless: CLAUDE.md is the main project file loaded into every conversation (alongside auto memory and unscoped rules). It serves as the primary onboarding document for AI agents into your codebase.
The Golden Rules
Less is More: Frontier LLMs can follow ~150-200 instructions. Claude Code's system prompt already uses ~50. Keep your CLAUDE.md focused and concise.
Universal Applicability: Only include information relevant to EVERY session. Task-specific instructions belong in separate files.
Don't Use Claude as a Linter: Style guidelines bloat context and degrade instruction-following. Use deterministic tools (prettier, eslint, etc.) instead.
Never Auto-Generate: CLAUDE.md is the highest leverage point of the AI harness. Craft it manually with careful consideration.
Execution Flow
1. Project Analysis
First, analyze the current project state:
Check for existing CLAUDE.md files:
- Root level:
./CLAUDE.mdor.claude/CLAUDE.md - Directory-specific:
**/CLAUDE.md - Global user config:
~/.claude/CLAUDE.md
- Root level:
Identify the project structure:
- Technology stack (languages, frameworks)
- Project type (monorepo, single app, library)
- Development tools (package manager, build system, test runner)
Review existing documentation:
- README.md
- CONTRIBUTING.md
- package.json, pyproject.toml, Cargo.toml, etc.
2. Content Strategy (WHAT, WHY, HOW)
Structure CLAUDE.md around three dimensions:
WHAT - Technology & Structure
- Technology stack overview
- Project organization (especially important for monorepos)
- Key directories and their purposes
WHY - Purpose & Context
- What the project does
- Why certain architectural decisions were made
- What each major component is responsible for
HOW - Workflow & Conventions
- Development workflow (bun vs node, pip vs uv, etc.)
- Testing procedures and commands
- Verification and build methods
- Critical "gotchas" or non-obvious requirements
3. Progressive Disclosure Strategy
For larger projects, recommend creating an agent_docs/ folder:
agent_docs/
|- building_the_project.md
|- running_tests.md
|- code_conventions.md
|- architecture_decisions.md
In CLAUDE.md, reference these files with instructions like:
For detailed build instructions, refer to `agent_docs/building_the_project.md`
Important: Use file:line references instead of code snippets to avoid outdated context.
4. Quality Constraints
When creating or updating CLAUDE.md:
- Target Length: Keep it under 200 lines; shorter is better
- No Style Rules: Remove any linting/formatting instructions
- No Task-Specific Instructions: Move to separate files
- No Code Snippets: Use file references instead
- No Redundant Information: Don't repeat what's in package.json or README
5. Essential Sections
A well-structured CLAUDE.md should include:
# Project Name
Brief one-line description.
## Tech Stack
- Primary language and version
- Key frameworks/libraries
- Database/storage (if any)
## Project Structure
[Only for monorepos or complex structures]
- `apps/` - Application entry points
- `packages/` - Shared libraries
## Development Commands
- Install: `command`
- Test: `command`
- Build: `command`
## Critical Conventions
[Only non-obvious, high-impact conventions]
- Convention 1 with brief explanation
- Convention 2 with brief explanation
## Known Issues / Gotchas
[Things that consistently trip up developers]
- Issue 1
- Issue 2
6. Anti-Patterns to Avoid
DO NOT include:
- Code style guidelines (use linters)
- Documentation on how to use Claude
- Long explanations of obvious patterns
- Copy-pasted code examples
- Generic best practices ("write clean code")
- Instructions for specific tasks
- Auto-generated content
- Extensive TODO lists
7. Validation Checklist
Before finalizing, verify:
- Kept under 200 lines; shorter is better
- Every line applies to ALL sessions
- No style/formatting rules
- No code snipp
الأسئلة الشائعة
لماذا يبقى الملف قصيرًا؟
تقول المهارة إن النماذج المتقدمة تستطيع اتباع نحو 150 إلى 200 تعليمة فقط، وموجّه النظام يستهلك جزءًا منها.
هل يكتبه الوكيل تلقائيًا؟
لا. تقول المهارة إنه لا يُولَّد تلقائيًا، بل يُكتب يدويًا وبعناية.
هل يستطيع العمل على ملف في مجلد فرعي؟
نعم. يمكنك أن تعطيه مسارًا، مثل مجلد فرعي، لتعليمات تنطبق على ذلك المجلد وحده.
التفاصيل
الوصف الأصلي من المؤلف
Create or update CLAUDE.md files following best practices for optimal AI agent onboarding
repo: luongnv89/claude-howto
الشعبية
- نجوم GitHub
- 46k
- الترتيب
- #6321
- الترخيص
- MIT
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
lesson-quiz
46kيختبرك في درس واحد من دروس Claude Code بعشرة أسئلة، ويحسب درجتك، ويشير إلى الموضوعات التي تحتاج إلى مراجعة.
self-assessment
46kيعطيك اختبارًا في 10 مجالات من ميزات Claude Code، ثم درجة حسب الموضوع ومسارًا تعليميًا لما يجب دراسته بعد ذلك.
blog-draft
46kيرشد وكيلك خطوة بخطوة في كتابة مسودة مدونة من أفكارك ومصادرك، مع تتبع النسخ أثناء التقدم.
code-review-specialist
46kيراجع الكود بحثًا عن مشكلات الأمان والأداء وصعوبة الصيانة، بقائمة تحقق وملاحظات مكتوبة بوضوح.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.