من دروس RL المصورة إلى مهارات هندسة RL للإنتاج
شارك القائمون على Terminal-Bench وHarbor الكثير من المعرفة التي اكتسبوها بشق الأنفس في هندسة RL: كيف يحزمون المهام، وكيف يكتشفون الوكلاء الذين يغشّون، وكيف يحوّلون عمليات rollout إلى بيانات تدريب. ومعظم ذلك موجود في محاضرات مؤتمرات طويلة.
ثلاث من هذه المحاضرات تبلغ معًا نحو ساعة ونصف من الفيديو. كل دقيقة منها تستحق المشاهدة، لكن إعادة استخدامها صعبة. في المرة القادمة التي تبني فيها بيئة، ستعود إلى تمرير الخط الزمني بحثًا عن تلك الشريحة التي تتذكرها.
لذلك أوكلنا المشاهدة إلى فريق من الوكلاء. باستخدام Gemini 4 في Eigent، حوّل موجز واحد ثلاث محاضرات عن Terminal-Bench إلى أربع مهارات قائمة على الملفات لهندسة بيئات RL للإنتاج، إضافة إلى تقرير مرتبط بالمصادر يوضح من أين جاءت كل فكرة.
سير العمل الكامل في لمحة
أنت من يختار المحاضرات. وبعد ذلك، يأخذك موجز واحد حتى مهارات يمكن لوكلائك إعادة استخدامها. تترك كل مرحلة ملفًا خلفها، لتتمكن من مراجعة العمل في كل خطوة.
| المرحلة | ما الذي يحدث | ما الذي تحصل عليه |
|---|---|---|
| الاختيار | اختيار محاضرات YouTube التي تريد التعلم منها | قائمة قصيرة بروابط المقاطع في الموجز |
| المشاهدة | تنزيل الترجمات واللقطات ومشاهدة كل محاضرة كاملة | مخطط بالطوابع الزمنية لكل محاضرة |
| التحليل | استخراج الأساليب والرؤى والنتائج المعلنة والتحذيرات | نقاط تعلم مصنفة OBSERVED أو INFERRED أو UPDATED |
| المقارنة | وضع المحاضرات جنبًا إلى جنب | أين تتفق، وأين تختلف، وكيف تسد كل منها فجوات الأخرى |
| الاستخلاص | تجميع الأساليب والرؤى حسب القدرة العملية | ملف SKILL.md وملف evidence.md لكل مهارة |
| التحقق | فحص البنية وتشغيل السكربتات وتجربة مهارة على مهمة جديدة | كل مهارة موسومة STRUCTURALLY CHECKED أو EXECUTED أو UNTESTED |
| التقرير | إنشاء تقرير HTML وتقديمه على 127.0.0.1 | محاضرات مضمّنة وطوابع زمنية قابلة للنقر ومصفوفة تغطية تُظهر الفجوات |
| إعادة الاستخدام | توجيه زميل عمل إلى ملف SKILL.md | هندسة بيئات RL للإنتاج في مشروعك الخاص |
إليك طريقة تنفيذ ذلك بنفسك، خطوة بخطوة، بما في ذلك درس تعلمناه أثناء كتابة الموجز.
ما الذي ستحصل عليه
- مهارات قابلة لإعادة الاستخدام - كل منها ملف
SKILL.mdمع ملفevidence.md، مكتوبة بحيث يمكن لوكيل آخر تطبيقها دون مشاهدة المحاضرات. - تقرير HTML مرتبط بالمصادر - يُقدَّم محليًا، مع تضمين كل محاضرة، ومخطط بالطوابع الزمنية، ونقاط تعلم يمكنك النقر عليها للانتقال مباشرة إلى اللحظة المقصودة.
- مصفوفة تغطية - أي مهارة تغطي أي جزء من سير عمل RL، وأي المجالات لم تتناولها أي محاضرة.
- سجل أمين - كل ادعاء مصنف OBSERVED أو INFERRED أو UPDATED، وكل مهارة موسومة بأنها نُفذت أو فُحصت بنيويًا أو لم تُختبر.
قبل أن تبدأ
- تثبيت Eigent على جهازك.
- مفتاح Gemini API.
- روابط YouTube التي تريد أن يتعلم منها وكلاؤك. استخدمنا هذه الثلاثة:
| المحاضرة | القناة | المدة |
|---|---|---|
| Introducing Terminal-Bench: Evaluating LLM Agents in Realistic Terminal Settings | Anyscale (Ray Summit 2025) | 31:23 |
| Everything Is a Rollout - Alex Shaw + Ryan Marten | AI Engineer | 21:11 |
| Terminal-Bench 2.0: Launch + Q&A with the founders | Latent Space | 35:00 |
أضف مفتاح Gemini API
- افتح Settings → Models.
- ابحث عن Gemini وافتح إعداداته.
- الصق API key الخاص بك.
- اضبط model type على
gemini-4. - انقر Save.
اختر Gemini 4
- في الشاشة الرئيسية، افتح منتقي النموذج أسفل مربع الإدخال.
- اختر Gemini → gemini-4.
- اضبط مستوى التفكير إن أردت - القيمة الافتراضية تعمل جيدًا.
الصق الموجز
انسخ الموجز أدناه إلى مربع الإدخال Cowork with. استبدل الروابط بمقاطعك الخاصة، واضبط سطر Docker على allowed أو not allowed.
Watch the YouTube videos listed below and turn their methods and insights into reusable,
file-based agent skills. Then publish the results as a well-designed HTML report served from a
local web server.
Videos:
- https://www.youtube.com/watch?v=zt-U4lDdenY&t=1559s
- https://www.youtube.com/watch?v=jRCpXUjz4CI
- https://www.youtube.com/watch?v=5wo0mLlG0fk&t=1815s
Use only these videos as primary sources. Do not search for, substitute, or add other videos.
You may consult official documentation and the code repositories the videos link to or name,
but only to check or update details shown in the videos.
## Focus
Extract practical, repeatable methods. Where the videos cover them, include:
- Defining tasks, observations, actions, and termination conditions.
- Creating reproducible environments and reset behaviour.
- Building verifiers and reward functions.
- Detecting reward hacking and invalid successes.
- Collecting, scoring, and reviewing agent trajectories.
- Preparing data for agent training and evaluation.
Do not invent coverage for areas the videos don't address. List those areas as gaps instead.
Capture insights, not only procedures. For every method, record why the speakers use it, what
went wrong before they did, any results or numbers they reported, and the warnings they gave.
Treat named tools and frameworks (for example Harbor or Terminal-Bench) as one implementation
of a method. Record the underlying principle first and the tool-specific steps second.
## Permissions and limits
- Allowed: reading the video pages; downloading subtitles, transcripts, and the video files
for analysis; extracting frames; reading official docs and repositories named in the
videos; creating a local virtual environment and installing open-source packages into it;
running a local static web server bound to 127.0.0.1.
- Docker: [allowed / not allowed].
- Not allowed: model training, GPU jobs, paid hosted services, calls to paid LLM APIs, or
publishing anything to a public host. For trajectory collection tests, use a scripted,
rule-based, or random policy.
- Keep all files inside ./rl-env-skills/ in the current working directory. Delete downloaded
video files when finished.
- Do not ask for confirmation for the actions allowed above. Stop and report only if a required
action falls outside them.
- If a video is private, removed, region-locked, or has no usable audio or transcript, say so in
the report. Continue with the remaining videos, and do not replace it.
## Capability honesty
Before starting, record which relevant capabilities you have: video viewing, frame
extraction, transcript access, code execution, browser preview. If you cannot inspect video
visuals, work from transcripts and mark every visual claim as "not observed".
Never describe on-screen content you did not actually see.
## Analysis
For each video:
- Record title, channel, published date, duration, and view count with the date checked.
- Watch it in full. Inspect visual demonstrations, code, diagrams, and narration where your
capabilities allow.
- Build a timestamped outline of the main sections.
- Preserve timestamps for every important procedure, decision, and warning.
- List the key insights and takeaways: design decisions and the reasons behind them, lessons
learned, failure stories, reported results, and warnings. Give each one a timestamp.
- Label each claim OBSERVED (seen or heard in the video), INFERRED (your interpretation), or
UPDATED (adapted to current official docs; cite the doc URL and the date checked).
- Re-inspect unclear moments. Record unresolved details instead of guessing.
- Paraphrase. Quotes must be under 15 words and carry a timestamp. Do not reproduce transcripts.
Then note where the videos agree, where they differ, and where one fills a gap in another.
## Skills
Create 2–4 skills grouped by practical capability. A skill may draw from several videos.
Layout:
rl-env-skills/
<skill-name>/
SKILL.md # required
evidence.md # timestamps, OBSERVED/INFERRED/UPDATED labels, source per point
scripts/ templates/ # only if they materially help; scripts must be tested
report/
index.html # the HTML report (see below)
assets/ # extracted frames or screenshots used in the report, if any
REPORT.md
manifest.json
SKILL.md must begin with YAML frontmatter:
---
name: <kebab-case, matches folder name>
description: <1–2 sentences: what it does and when to use it, including trigger phrases>
---
The body must cover: prerequisites, required inputs, key insights (the principles and lessons
behind the procedure, each with its source and timestamp), procedure (numbered steps), expected
outputs, decision rules, failure recovery, observable success checks, and a tool-agnostic path
for projects that don't use the tools shown in the videos. Another agent should be able to
apply it to a new project without watching the videos.
A skill must not be only a wrapper around one tool's features. If you removed every
tool-specific command, the insights and decision rules should still stand on their own.
Keep these four things distinct throughout: task datasets, recorded trajectories, supervised
training examples, and RL policy optimisation. Never imply that exporting trajectories is RL
training.
## Validation
- Structural: frontmatter is present and valid, the name matches the folder, every referenced
file exists, every evidence timestamp falls within the source video's duration, and every
skill has a key insights section with at least three sourced insights.
- Execution: run every script you created. Where feasible, apply at least one skill end to end on
a small example the videos don't use (e.g. a text grid-world, or a "make this failing unit
test pass" task).
- Report each item as STRUCTURALLY CHECKED, EXECUTED (with command and result), or UNTESTED
(with reason).
## HTML report (report/index.html)
### Content, in this order
1. Header: report title, date checked, the agent's capability summary (had / lacked).
2. Summary: 3–5 sentences on what was produced and the main limitations. No marketing language.
3. Sources: one row per video (title, channel, published date, duration, views with date
checked, linked code or repository, access status).
4. One section per video:
- The original video embedded with a privacy-enhanced YouTube embed
(https://www.youtube-nocookie.com/embed/<VIDEO_ID>), with a 16:9 responsive frame.
- Link to the original.
- Timestamped outline of the video.
- Key insights and takeaways, each with a clickable timestamp and a label.
- Learning points: numbered, each with a clickable timestamp that seeks the embedded player
(YouTube IFrame Player API) and an OBSERVED / INFERRED / UPDATED label.
- Unresolved details.
- If embedding is blocked, show the video thumbnail linked to youtube.com/watch?v=<ID>
and state that embedding was unavailable.
5. How the videos compare: agreements, differences, and how each fills the others' gaps.
6. One section per skill:
- Name, absolute path to SKILL.md, one-sentence purpose, and when to use it.
- Key insights the skill carries, with their sources.
- Procedure summary (the key steps, not the whole file).
- Evidence: every supporting source point as a row — video, timestamp (clickable), label,
and what the skill took from it. Include doc URLs for UPDATED items.
- Validation status with the command and result if executed.
7. Coverage matrix: skills × the videos, showing which video supports which skill, plus
the focus areas no video covered.
8. Data distinctions: a short table defining task dataset, trajectory, supervised example, and
RL policy optimisation, and which of them the skills actually produce.
9. Limitations and untested items.
10. Three copy-paste reuse requests, each in a code block with a copy button.
### Visual design: light mode, in Google's design language
- Style only: do not use Google logos or wordmarks, or suggest the report is a Google product.
- Colours: page #FFFFFF; secondary surfaces #F8F9FA; borders #DADCE0; primary text #202124;
secondary text #5F6368; links and primary actions #1A73E8. Use the Google accent set
(blue #4285F4, red #EA4335, yellow #FBBC04, green #34A853) only for status and labels,
e.g. OBSERVED blue, INFERRED yellow tint with dark text, UPDATED green, UNTESTED red.
Text must meet WCAG AA contrast.
- Type: Google Sans / Google Sans Text if available from Google Fonts, otherwise Roboto; Roboto
Mono or Google Sans Code for code and timestamps. Clear scale: one H1, H2 per section, 16px
body, 1.5 line height, comfortable line length (about 70–80 characters).
- Layout: 8px spacing grid, max content width about 1100px, sticky left table of contents on
desktop that collapses on mobile, flat cards with 1px borders or a subtle Material elevation
shadow, 8–12px corner radius, plain tables with hairline row dividers.
- Avoid the generic "AI-generated" look: no gradients, purple/indigo themes, glassmorphism,
glowing effects, emoji used as icons, sparkle icons, oversized hero banners, decorative
blobs, or hype copy ("unlock", "supercharge", "seamless"). Prefer real content, tables, and
data over decoration.
- Technical: one self-contained HTML file with inline CSS and JS. Only external requests allowed:
Google Fonts and YouTube embed/API. Responsive down to 360px width with no horizontal
page scroll. Semantic HTML, keyboard-accessible controls, alt text on images.
### Serve and verify
1. Start a static server from rl-env-skills/report/ bound to 127.0.0.1, e.g.
`python3 -m http.server 8000 --bind 127.0.0.1`. If port 8000 is busy, use the next free port.
Keep the server running when you finish.
2. Do not rely on opening the file from disk: YouTube embeds often fail without an http origin.
3. Verify: the page returns HTTP 200; every embed loads or shows the fallback; timestamp links
seek the player; all anchors and file links resolve; no console errors. If you have a browser
tool, take a desktop and a 375px-wide screenshot and save them to report/assets/.
4. Report how you verified each item, and which checks you could not run.
## Deliverables
- REPORT.md: a plain-text version of the report's findings.
- manifest.json:
{ "date_checked": "...",
"videos": [{"url","title","channel","published","duration","views","access_status"}],
"skills": [{"name","path","sources":["<video id>", "..."],
"insights": <number of sourced insights>,
"validation":"executed|structural|untested"}],
"capabilities": {"video": bool, "frames": bool, "transcripts": bool, "code_exec": bool,
"browser_preview": bool},
"report": {"path": "<absolute path to index.html>", "preview_url": "http://127.0.0.1:<port>/",
"server_command": "...", "verified": [...], "not_verified": [...]} }
- Final reply: the preview link on its own line first
(http://127.0.0.1:<port>/), then the command to restart the server if it stops, then a short
summary of the videos, skills with absolute paths, validation results, and limitations.
بعض أجزاء هذا الموجز تؤدي العمل الأهم:
- Use only these videos يُبقي وكلاءك على المصادر التي اخترتها، دون استبدال ودون إضافات.
- Capture insights, not only procedures يضمن أن ينتقل السبب مع الطريقة. المزيد عن ذلك أدناه.
- Capability honesty يمنع أي أحد من وصف لقطة فيديو لم يرها أحد فعلًا.
- وسوم OBSERVED / INFERRED / UPDATED تفصل بين الحقائق والتفسير والتحديثات التي جرى التحقق منها في الوثائق.
- تمييزات البيانات تُبقي مجموعات بيانات المهام والمسارات والأمثلة الخاضعة للإشراف وتحسين سياسة RL منفصلة، حتى لا يُخلط أبدًا بين تصدير المسارات والتدريب.
ما الذي غيّرناه في الموجز، ولماذا
استخدم التشغيل الذي يظهر في الفيديو نسخة سابقة من هذا الموجز. وقد أصاب في أمور كثيرة. شاهد Gemini 4 المحاضرات الثلاث كلها، وقارن التفاصيل بوثائق Harbor ومستودعه، وبنى أربع مهارات. وعمل سكربت كل مهارة من البداية إلى النهاية على مهمة لا تستخدمها أي من المحاضرات: إصلاح محلل إعدادات بلغة Python يُدعى fix-ini-interpolator.
لكن عندما قرأنا المهارات، لاحظنا أمرًا ما. فقد اعتمدت بشدة على ميزات Harbor، مثل هيكل مجلدات المهام وصيغ المسارات وأوامر CLI. أما الرؤى التي تقف خلفها فبقي معظمها في التقرير.
والمحاضرات مليئة بالرؤى. وقد رصد التقرير نفسه هذه منها:
- البنية المحيطة لا تقل أهمية عن النموذج. إلغاء الأوامر العالقة مبكرًا حقق تحسنًا بنحو 5–10%، ومزج النماذج في تشغيل واحد حقق نحو 5–6% (محاضرة Ray Summit، 18:05–19:23).
- خطّط للتوسع مبكرًا. يبلغ الحاسوب المحمول حده عند نحو ستة حاويات متزامنة، ولهذا انتقلت الفرق إلى بيئات معزولة سحابية (المحاضرات الثلاث).
- التلاعب بالمكافأة هو فرط التخصيص في RL. تعامل مع الدرجة المرتفعة على نحو مريب كما تتعامل مع خسارة تحقق منخفضة على نحو مريب (محاضرة AI Engineer، 06:35).
المهارة التي لا تعرف إلا كيفية تشغيل أداة لا يمكنها أن تخبرك متى يفشل النهج، ولا ما الذي تفعله على منظومة تقنية تخلو من تلك الأداة. لذلك أجرينا أربعة تغييرات:
- الرؤى مُخرَج أساسي. صار كل قسم فيديو وكل مهارة يسجل منطق المتحدثين والدروس المستفادة والنتائج والتحذيرات، ولكل منها طابع زمني.
- المبدأ أولًا، ثم الأداة. يُعد Harbor وTerminal-Bench طريقة واحدة لتطبيق الأسلوب، لا الأسلوب نفسه.
- لا أغلفة للأدوات. تحتاج كل مهارة إلى قسم للرؤى الرئيسية ومسار لا يعتمد على أداة بعينها. احذف الأوامر، ويجب أن تظل المهارة تعلّم شيئًا.
- التحقق يفحص ذلك. يجب أن تحمل كل مهارة ثلاث رؤى موثقة المصدر على الأقل، وإلا فشلت في الفحص البنيوي.
كما أصلحنا تعارضًا صغيرًا. فقد ذكر الموجز السابق "المقطعين" لكنه أدرج ثلاثة روابط. لاحظ Gemini 4 ذلك ودوّنه في التقرير وحلل المقاطع الثلاثة، لكن الصياغة الجديدة تصلح لأي عدد من المقاطع.
دع وكلاءك يعملون
أرسل الموجز. يخطط Gemini 4 للعمل ويشغّل الوكلاء. ومن هناك، يسير التشغيل وفق الموجز:
- مشاهدة كل محاضرة - الترجمة واللقطات والشرائح والعروض الحية - مع الاحتفاظ بالطوابع الزمنية.
- استخلاص الأساليب والرؤى في مهارات، لكل منها ملف أدلة خاص بها.
- التحقق من المهارات وتسجيل ما جرى فحصه أو تنفيذه أو تُرك دون اختبار.
- إنشاء التقرير وتقديمه على
127.0.0.1.
في تشغيلنا، نزّل الوكلاء المحاضرات الثلاث، واستخرجوا أكثر من 25 لقطة رئيسية، وجلبوا النصوص الكاملة بالطوابع الزمنية، وقارنوا تفاصيل Harbor بالوثائق الرسمية، ثم حذفوا ملفات الفيديو التي نزّلوها كما يطلب الموجز.
افتح التقرير
يُفتح التقرير على خادم محلي - في تشغيلنا كان http://127.0.0.1:8000. إليك ما ستجده:
- القدرات - ما كان لدى الوكلاء وما افتقروا إليه، من مشاهدة الفيديو إلى المعاينة في المتصفح.
- الملخص والمصادر - كل محاضرة مع قناتها وتاريخ نشرها ومدتها وعدد مشاهداتها والمستودعات المرتبطة بها.
- قسم لكل محاضرة - الفيديو مضمّن بمشغّل معزز للخصوصية، ومخطط بالطوابع الزمنية، ونقاط تعلم موسومة.
- مقارنة المحاضرات - أين تتفق، وأين تختلف، وكيف تسد كل منها فجوات الأخرى.
- قسم لكل مهارة - الغرض والخطوات الرئيسية والأدلة وأمر التحقق الدقيق.
- القيود - ما بقي دون اختبار ولماذا، مثل البيئات المعزولة السحابية وواجهات API المدفوعة للنماذج.
اقرأ مصفوفة التغطية
تُظهر المصفوفة أي مهارة تغطي أي جزء من سير عمل RL، وأين تترك المحاضرات فجوات.
| مجال التركيز | Task Scaffolder | Verifier & Anti-Cheat | Rollout Collector | SFT Dataset Preparer |
|---|---|---|---|---|
| تحديد المهام والملاحظات والإجراءات وشروط الإنهاء | أساسي | ثانوي | أساسي | - |
| بيئات قابلة لإعادة الإنتاج وإعادة الضبط | أساسي | ثانوي | ثانوي | - |
| بناء المدققات ودوال المكافأة | ثانوي | أساسي | - | - |
| اكتشاف التلاعب بالمكافأة والنجاحات غير الصالحة | - | أساسي | ثانوي | - |
| جمع المسارات وتقييمها ومراجعتها | - | - | أساسي | ثانوي |
| إعداد البيانات لتدريب SFT والتقييم | - | - | - | أساسي |
| فجوة: رياضيات تدرج السياسة في RL والآليات الداخلية للمدرِّب | غير مغطى | غير مغطى | غير مغطى | منفصل |
| فجوة: تشكيل مكافأة عملية كثيفة على مستوى الخطوة | غير مغطى | مكافأة النتيجة فقط | غير مغطى | غير مغطى |
صفّا الفجوات مهمان. تذكر المحاضرات مدرِّبات مثل SkyRL وTinker لكنها لا تعرض حلقة التدريب أبدًا، لذا لا تدّعي المهارات أنها تغطيها.
ضع المهارات موضع التنفيذ
توجد كل مهارة في مجلدها الخاص داخل rl-env-skills/:
sandboxed-task-environment-scaffolder- إنشاء مهام قابلة لإعادة الإنتاج داخل حاويات والتحقق منها.verifier-and-anti-cheat-auditor- بناء مدققات للنتائج وتدقيقها بحثًا عن التلاعب بالمكافأة.rollout-trajectory-collector-and-debugger- تشغيل عمليات rollout في بيئة معزولة، وتسجيل المسارات، وتصنيف حالات الفشل.trajectory-to-sft-dataset-preparer- تصفية المسارات التي جرى التحقق منها إلى بيانات SFT نظيفة، مع فصلها تمامًا عن تدريب RL.
وجّه زميل عمل إلى إحداها وكلّفه بمهمة حقيقية، على سبيل المثال:
Use rl-env-skills/verifier-and-anti-cheat-auditor/SKILL.md to design a verifier
for my "make this failing unit test pass" task. Flag any way an agent could
pass without fixing the bug.
تتضمن المهارة الإجراء وقواعد القرار وفحوصات النجاح. ويتضمن ملف الأدلة الإثباتات، ومع الموجز الجديد تنتقل الرؤى أيضًا.
اجعله خاصًا بك
يصلح هذا الموجز لأي مجموعة من المحاضرات التقنية. استبدل روابط المقاطع وقائمة المحاور، واحتفظ بالباقي:
- احتفظ بقواعد الرؤى. فهي ما يحوّل دليل استخدام أداة إلى حكمة مكتسبة بشق الأنفس.
- احتفظ بقواعد الأمانة. فحوصات القدرات ووسوم الادعاءات هي ما يجعل المخرجات جديرة بالثقة.
- احتفظ بخطوة التحقق. المهارة التي لم تُشغَّل قط هي مجرد ملاحظة، لا مهارة.
لا يجب أن تبقى ساعة ونصف من المحاضرات مجرد ساعة ونصف من المحاضرات. سلّمها إلى وكلائك، واحتفظ بما يتعلمونه.
الحقوق: أُنتج باستخدام Gemini 4 وEigent. المحاضرات لـ Mike Merrill (Ray Summit 2025)، وAlex Shaw وRyan Marten (AI Engineer)، ومؤسسي Terminal-Bench على Latent Space، شاهد المقاطع الأصلية على YouTube. الموسيقى: "Wallpaper" Kevin MacLeod (incompetech.com)، مرخصة بموجب Creative Commons: By Attribution 4.0.



