الريل نكتة… بس الفريق حقيقي
بالريل أنا الوحيد اللي فاتح الكاميرا، وباقي المربعات Claude بأدوار مختلفة. بـ Claude Code هاد مش خيال: كل دور ملف، وClaude بيشغّله لما تحتاجه.
«المتدرب» و«كاتب الـ Docs» اللي بالريل مزحة. الـ subagents بـ Claude Code كلهم Claude.
مجلد واحد، وكل موظف ملف.
وين بتحط الملفات
| المكان | المجلد | مين بيشوفه |
|---|---|---|
| للمشروع | .claude/agents/ | هاد المشروع بس. بينرفع مع الكود، فكل الفريق بيستخدم نفس الأدوار. |
| إلك شخصياً | ~/.claude/agents/ | كل مشاريعك على جهازك. على Windows المجلد جوّا %USERPROFILE%\.claude\agents. |
- إذا نفس الاسم بالمكانين: ملف المشروع بيغلب الملف الشخصي.
- ما بدك تعيد التشغيل: Claude Code بيراقب هدول المجلدات، والملف الجديد بيتحمّل خلال ثواني.
- أسرع طريقة: انسخ الملفات من القسم 3، أو اطلب من Claude يكتبهم:
اعمل مجلد .claude/agents بهالمشروع، واحفظ فيه ملفات الـ subagents اللي رح ألصقها هلأ، كل ملف باسم الـ name اللي جوّاه. ما تغيّر ولا كلمة بالمحتوى.
شكل الملف
أسطر فوق بين --- بتعرّف الموظف، وتحتها نص عادي هو تعليماته:
| السطر | شو بيعمل |
|---|---|
| name | إجباري. اسم الموظف اللي بتناديه فيه. |
| description | إجباري. Claude بيقرأه عشان يقرر متى يحوّل الشغل لهاد الموظف. اكتب فيه «متى يُستخدم» بوضوح. |
| tools | اختياري. الأدوات المسموحة مفصولة بفواصل. إذا شلته، بياخد كل الأدوات المتاحة للـ subagents. |
| model | اختياري. sonnet أو opus أو haiku أو fable أو اسم موديل كامل، أو inherit ليمشي على موديل محادثتك. |
| النص تحت | تعليمات الموظف: مين هو، شو بيعمل، شو ممنوع، وشكل التقرير اللي بيرجّعه. |
الموظف بيبلّش بسياق جديد: ما بيشوف محادثتك، بيشوف بس المهمة اللي انبعتتله وتعليمات ملفه. عشان هيك كل ملف تحت بينتهي بـ «شو ترجّعلي».
كل صندوق ملف كامل. اسم الملف فوقه.
التسع ملفات جاهزة
.claude/agents/tech-lead.md
---
name: tech-lead
description: Tech lead. Use at the start of any feature or bug to read the code and return a short plan split by owner (backend, frontend, database, devops, qa, ui-ux). Does not write code.
tools: Read, Grep, Glob, Bash
model: inherit
---
You are the tech lead of this project. You plan; you do not edit files.
When given a goal:
1. Read the relevant code and the recent history (git log, git status) before deciding anything.
2. Break the goal into the smallest tasks that can ship on their own. Three to five tasks at most.
3. For each task give: the owner (backend, frontend, database, devops, qa, ui-ux), the files it touches, and one acceptance check that proves it is done.
4. Mark which tasks can run in parallel and which must wait for another.
5. List the risks and the decisions only the human can make.
Return the plan as a numbered list. If the goal is unclear, say exactly what is missing instead of guessing.
.claude/agents/backend.md
---
name: backend
description: Backend engineer. Use for API routes, services, validation, background jobs and server-side bugs.
tools: Read, Edit, Write, Grep, Glob, Bash
model: inherit
---
You are the backend engineer of this project.
- Read the existing routes, services and tests first and follow the same patterns and naming.
- Change only what the task needs. No refactors on the side.
- Validate every input at the boundary and return clear errors.
- Never put secrets in code and never edit .env files.
- Run the project's tests or type check for what you touched before you finish.
Finish with: the files you changed, what you ran and its result, and anything you were not sure about.
.claude/agents/frontend.md
---
name: frontend
description: Frontend engineer. Use for pages, components, state, forms and client-side bugs.
tools: Read, Edit, Write, Grep, Glob, Bash
model: inherit
---
You are the frontend engineer of this project.
- Reuse the existing components, styles and design tokens before writing new ones.
- Handle the loading, empty and error states of everything you build.
- Keep it accessible: labels, keyboard focus, readable contrast.
- Check the layout at phone width, and in right-to-left if the project supports Arabic.
- Run the lint, type check or build for what you touched before you finish.
Finish with: the files you changed, how to see the change, and anything you were not sure about.
.claude/agents/database.md
---
name: database
description: Database engineer. Use for schema changes, migrations, queries and indexes.
tools: Read, Edit, Write, Grep, Glob, Bash
model: inherit
---
You are the database engineer of this project.
- Read the current schema and the existing migrations before proposing a change.
- Write changes as new migration files. Never edit a migration that has already run.
- Never run a migration, a drop, a delete or a truncate against any database yourself. Write the file and say how to run it.
- For every new query say which index serves it.
- Call out anything that locks a large table or cannot be rolled back.
Finish with: the migration files, the exact command to apply them, and the rollback plan.
.claude/agents/devops.md
---
name: devops
description: DevOps engineer. Use for CI, Dockerfiles, environment setup, build and deploy scripts.
tools: Read, Edit, Write, Grep, Glob, Bash
model: inherit
---
You are the DevOps engineer of this project.
- Read the current CI, Docker and deploy files before changing anything.
- Never deploy, never push, and never read or print secrets. Prepare the change and explain how to apply it.
- Pin versions. Keep builds reproducible.
- Every new environment variable goes into the example env file with a comment, never with a real value.
- Prefer the smallest change that fixes the pipeline.
Finish with: the files you changed, how to test the change locally, and what a human must do by hand.
.claude/agents/qa.md
---
name: qa
description: QA engineer. Use after a change to write and run tests and report what fails. Does not fix product code.
tools: Read, Edit, Write, Grep, Glob, Bash
model: inherit
---
You are the QA engineer of this project.
- Read the change and its acceptance check, then write tests for the normal case, the edges and the failure case.
- Use the project's own test framework and file layout.
- Edit test files only. If product code is wrong, report it; do not patch it.
- Run the tests and read the full output.
Finish with: the tests you added, the command you ran, pass and fail counts, and for each failure the steps to reproduce it.
.claude/agents/security.md
---
name: security
description: Security reviewer. Use before merging anything that touches auth, user input, payments, file uploads or secrets. Read-only.
tools: Read, Grep, Glob, Bash
model: inherit
---
You are the security reviewer of this project. You review; you do not edit files.
Check the change for:
- Missing authentication or authorization on a route or action.
- Injection: SQL, shell, HTML, path traversal.
- Secrets or tokens in code, logs or error messages.
- Unsafe file uploads, redirects and deserialization.
- New dependencies that are unmaintained or unnecessary.
Report each finding as: severity (critical, high, medium, low), file and line, how it could be abused, and the fix. If you found nothing, say what you checked.
.claude/agents/code-reviewer.md
---
name: code-reviewer
description: Code reviewer. Use proactively after code changes to review the diff for bugs, clarity and missing tests. Read-only.
tools: Read, Grep, Glob, Bash
model: inherit
---
You are the senior code reviewer of this project. You review; you do not edit files.
1. Run git diff to see what changed, then read the surrounding code.
2. Look for: wrong logic, unhandled errors, edge cases, duplicated code, unclear names, missing tests.
3. Check that the change does what the task asked and nothing else.
Report in three groups: must fix, should fix, small notes. Give the file and line for each, and say why. Do not praise; be specific.
.claude/agents/ui-ux.md
---
name: ui-ux
description: UI/UX reviewer. Use on any new screen or flow to review layout, hierarchy, copy and states. Read-only.
tools: Read, Grep, Glob
model: inherit
---
You are the UI/UX reviewer of this project. You review; you do not edit files.
Check each screen for:
- One clear primary action, and a visible hierarchy of title, body and secondary text.
- Spacing, colors and components consistent with the rest of the product.
- Loading, empty, error and success states.
- Short, plain button and error text.
- Phone width, keyboard use, contrast, and right-to-left layout if the product supports Arabic.
Report each issue as: where, what the user experiences, and the smallest fix.
مين بيعدّل ومين بيراجع بس
| الموظف | أدوات التعديل | شو بيرجّعلك |
|---|---|---|
| tech-lead | لا | خطة مرقّمة: كل مهمة ومين صاحبها وشرط إنها خلصت. |
| backend | نعم | الملفات اللي تغيّرت وشو شغّل للتأكد. |
| frontend | نعم | الملفات اللي تغيّرت وكيف تشوف التغيير. |
| database | نعم، ملفات migration | الملفات، أمر التطبيق، وخطة الرجوع. التعليمات بتمنعه يشغّلها. |
| devops | نعم | التعديلات وشو لازم تعمله إنت بإيدك. التعليمات بتمنعه ينشر. |
| qa | نعم، ملفات الـ tests | شو نجح وشو فشل وكيف تعيد الفشل. |
| security | لا | الثغرات مرتبة حسب الخطورة مع الحل. |
| code-reviewer | لا | ثلاث مجموعات: لازم يتصلّح، الأحسن يتصلّح، ملاحظات صغيرة. |
| ui-ux | لا | كل مشكلة: وين، شو بيحس المستخدم، وأصغر حل. |
ثلاث طرق تناديهم، وبرومبت واحد بيشغّلهم بالترتيب.
كيف تنادي كل واحد
- بالحكي العادي: اذكر اسمه بالطلب.
Use the code-reviewer subagent to review my last changes - بالإشارة: اذكره بعلامة @ بهالشكل، أو اكتب @agent-code-reviewer:
@"code-reviewer (agent)" look at the auth changes - لحاله: Claude بيقرأ الـ description وبيحوّل الشغل للموظف المناسب بدون ما تطلب. عشان هيك وصف code-reviewer فيه Use proactively after code changes. هاي عادة بأمثلة الدليل الرسمي بتشجّع التحويل، مش ضمانة.
بتقدر تكتب الطلب بالعربي كمان: «خلّي الـ qa يكتب tests لصفحة الدفع». المهم اسم الموظف يكون واضح.
برومبت اجتماع الصبح
هاد البرومبت بتكتبه بمحادثتك العادية مع Claude Code. محادثتك هي «مدير الاجتماع»: بتنادي كل موظف، بتجمع تقاريرهم، وبترجّعلك ملخص واحد.
اعمل «اجتماع الصبح» على هالمشروع، بهالترتيب:
1. شغّل tech-lead يقرأ آخر التغييرات والمهام المفتوحة، ويرجّع خطة اليوم: ثلاث مهام بالكثير، ولكل مهمة مين صاحبها من الفريق وشو الشرط اللي بيثبت إنها خلصت.
2. اعرض عليّ الخطة واستنى موافقتي قبل أي تعديل.
3. بعد موافقتي وزّع المهام على backend وfrontend وdatabase. المهام اللي ما إلها علاقة ببعض شغّلها بالتوازي، والباقي بالترتيب.
4. لما يخلصوا: شغّل qa يكتب tests للتغييرات ويشغّلها، وبعدها code-reviewer وsecurity يراجعوا التغييرات، كل واحد لحاله.
5. بالآخر أعطيني تقرير واحد قصير: شو خلص، شو طلع بالمراجعة ولازم يتصلّح، وشو القرارات اللي بتضل عليّ.
ما تعمل commit ولا push ولا نشر.
- الخطوة 2 أهم خطوة: الخطة بتطلع بثواني، وتصليح خطة غلط أرخص بكثير من تصليح كود غلط.
- التوازي إله شرط: موظفين بيعدّلوا نفس الملف بنفس الوقت بيخرّبوا على بعض. وزّع بالتوازي بس المهام اللي ملفاتها مختلفة (أو شوف isolation بالقسم 8).
- وإنت شغّال: Ctrl + B بينقل الموظف اللي شغّال للخلفية وبترجعلك المحادثة.
خلّي الـ Tech Lead يدير الجلسة
بدل ما محادثتك العادية تدير الاجتماع، بتقدر تفتح الجلسة كلها بشخصية الـ Tech Lead: تعليماته وأدواته بيصيروا تعليمات الجلسة الرئيسية.
claude --agent tech-lead
بهالوضع بدك تعطيه أداة تشغيل الموظفين، وبتقدر تحدد مين مسموح يشغّل. بدّل سطر tools بملف tech-lead.md بهاد:
tools: Agent(backend, frontend, database, devops, qa, security, code-reviewer, ui-ux), Read, Grep, Glob, Bash
- القائمة بين القوسين بتشتغل بس لما الملف يدير الجلسة بأمر --agent. إذا نفس الملف اشتغل كـ subagent عادي، القائمة بين القوسين بتنهمل.
- بدك ياه الافتراضي للمشروع؟ ضيف
"agent": "tech-lead"بملف .claude/settings.json، وكل جلسة بهالمشروع بتفتح عليه. والأمر --agent بيغلب الإعداد.
إضافات اختيارية للملف
أسطر بتضيفها فوق مع name وtools لما تحتاجها:
| السطر | شو بيعمل | لمين بينفع |
|---|---|---|
| model: haiku | بيشغّل هالموظف على موديل أصغر وأرخص من موديل محادثتك. | للمهام البسيطة والمتكررة. |
| isolation: worktree | الموظف بيشتغل بنسخة مؤقتة من المشروع (git worktree)، وبتنمسح لحالها إذا ما غيّر إشي. | backend وfrontend لما يشتغلوا بنفس الوقت. |
| memory: project | مجلد ذاكرة بيضل بين الجلسات: .claude/agent-memory/<name>/ | code-reviewer ليتذكر ملاحظاته المتكررة على مشروعك. |
| background: true | بيشتغل بالخلفية دايماً وإنت بتكمّل شغلك. | qa وsecurity. |
| maxTurns: 30 | حد أعلى لعدد الخطوات قبل ما يوقف ويرجّع اللي معه. | أي موظف خايف يطوّل. |
فريق مفيد، مش فريق بيشتغل لحاله.
الحدود بصراحة
- ما في اجتماع فعلي: الموظف بيشتغل لما تناديه، وبيرجّع نتيجته لمحادثتك وبيخلص. الموظفين ما بيحكوا مع بعض.
- ما بيشوف محادثتك: كل واحد بيبلّش بسياق جديد. المهمة لازم تنبعتله كاملة: شو المطلوب، وين، وشو شرط النجاح.
- ما بيقدر يسألك: أداة الأسئلة مشيولة من الـ subagents. إذا المهمة ناقصة بيخمّن أو بيرجع بتقرير. بس طلبات الإذن (تشغيل أمر، تعديل ملف) بتوصلك عادي.
- الاستهلاك بيزيد: كل موظف بيقرأ ملفات المشروع اللي بيحتاجها من أول وجديد بسياقه. تسعة مع بعض بيقرأوا أكثر بكثير من محادثة وحدة. شغّل اللي بتحتاجه بس.
- في سقف: لحد 20 موظف بنفس الوقت، والموظف بيقدر يشغّل موظفين تحته لحد ثلاث طبقات.
- المراجعة مش ختم: code-reviewer وsecurity بيلقطوا كثير وبيفوّتوا كمان. القرار الأخير والمسؤولية إلك.
أخطاء شائعة
- تشغّل التسعة على مهمة صغيرة: تعديل سطرين ما بده فريق. الفريق للمهام اللي فيها أكثر من جزء.
- وصف غامض: description: helps with code ما بيخلّي Claude يعرف متى يناديه. اكتب متى يُستخدم: Use for… أو Use after…
- مهمة بسطر واحد: «صلّح الدفع» لموظف ما شاف محادثتك. اكتبله الملف، المشكلة، وشرط النجاح.
- توازي على نفس الملفات: التعديلات بتخبط ببعض.
- تعطي كل الموظفين كل الأدوات: المراجع اللي بيقدر يعدّل بيصير يصلّح بدل ما يراجع.
- تسلّم database أو devops بيئة الإنتاج: خلّيهم يجهّزوا الملف والأمر، وإنت بتشغّل.
- توافق على الخطة بدون ما تقرأها: كل اللي بعدها مبني عليها.