agent-harness
ما الذي تفعله
تجعل هذه المهارة الوكيل يعمل على هدف في خطوات صغيرة متحقق منها، مع متحكّم يقرر متى يكتمل العمل. وهي موجهة لمن يريد أن ينجز وكيل الذكاء الاصطناعي عملًا متعدد الخطوات بثبات، لا أن يدّعي أنه أنجزه.
متى تستخدمها
- ✓عندما تعطي وكيلًا هدفًا متعدد الخطوات وتحتاج إلى أن يتحقق من كل خطوة.
- ✓عندما يستمر الوكيل في ادعاء إنجاز المهام دون دليل.
- ✓عندما تحتاج مهمة طويلة إلى الاستئناف من حالة محفوظة في جلسة جديدة.
رابط المهارة
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-harness/skills/agent-harness/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“راجع خدمة المدفوعات لدينا وصمّم SLO مع ميزانية أخطاء، واجعل كل خطوة متحققًا منها قبل أن تعتبرها منتهية.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يحوّل الوكيل الهدف إلى خطة مهام مع فحوص، وينفذ مهمة واحدة في كل مرة، ويتيح للمتحكم التحقق من كل نتيجة. وتكون المحاولات محدودة، وإذا نفدت الميزانية يُصعَّد العمل بدل أن يُعلَّم بأنه منتهٍ.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Agent Harness
You are a harness operator, not a hero. The loop — not your optimism — decides when work is done. Your job: compile the goal into tasks with checks, execute one task at a time, let the controller adjudicate verification, and stop when the state machine says stop.
The contract
GOAL → goal_compiler → PLAN → loop_controller: [execute → verify]* → CLOSE
↑______retry (≤ max_attempts, changed approach)
└── ESCALATE on exhausted budgets — never fake success
Three layers, all JSON: a committed per-domain manifest (what skills/tools/checks exist), a per-goal plan (which tasks, which verifications, what "done" means), and a per-run state file (the single source of truth; a fresh session resumes from it alone).
Quick start
# 0. Pick the domain manifest (20 committed under assets/harnesses/, e.g. engineering-team.json)
ls assets/harnesses/
# 1. Compile the goal (refuses vague goals with exit 3 + forcing questions)
python3 scripts/goal_compiler.py \
--goal "audit the payments service and design an SLO with an error budget" \
--manifest assets/harnesses/engineering.json --out plan.json
# 2. Initialize the loop state
python3 scripts/loop_controller.py init --plan plan.json --state .agent-harness/state.json
# 3. Drive the loop — repeat until directive is "close" or "escalate"
python3 scripts/loop_controller.py next --state .agent-harness/state.json
# → {"action": "execute", "task": "T1", ...}: open the task's skill (SKILL.md at
# skill_path), do the work with its tools, then:
python3 scripts/loop_controller.py record --state .agent-harness/state.json \
--task T1 --phase execute --exit-code 0
# → the controller runs the task's checks ITSELF (subprocess, timeout, evidence log):
python3 scripts/loop_controller.py verify --state .agent-harness/state.json --task T1 --cwd <repo-root>
# 4. Close — refused (exit 4) while any task is unverified and unwaived
python3 scripts/loop_controller.py close --state .agent-harness/state.json
Regenerate a manifest after skills change (diff-stable, CI-checkable):
python3 scripts/harness_manifest_builder.py --domain engineering-team \
--repo-root <repo-root> --out-dir assets/harnesses --no-timestamp
Hard rules
- Never adjudicate your own verification.
verifyruns the checks via subprocess; a passingrecord --phase verifywithout--evidenceis rejected (exit 6). You do not get to declare a task verified. - Never modify a gate you are judged by. Check commands come from the manifest/plan. Editing a check to make it pass is the reward-hacking failure mode (see references/verification_discipline.md) — same invariant as autoresearch-agent's locked evaluator.
- One task at a time, writes serialized. Parallelize reading and judging, never two tasks writing the same artifact (references/agentic_loop_canon.md).
- Retry means a changed approach. Same command + same input = same failure. The retry directive says so; honor it.
- Budgets are terminal states, not suggestions.
max_attempts_per_task→ escalated (exit 2);max_loop_iterations→ escalate (exit 5). Exhausted budgets are never reported as success — a human waives (close --waive T3 --reason "..."), you don't. - Fresh context beats long context. Every
nextdirective is executable by a new session reading only the plan + state files. Long-running goals: run each iteration as its own session against the durable state. - State lives in
.agent-harness/— never in.agenthub/,.autoresearch/, ordocs/TC/(those belong to sibling skills). - Plan and state files are a trust boundary.
verifyshell-executes each task's check command; only run the harness on plan/state files you orgoal_compiler.pyproduced, never on files from untrusted input (see references/verification_discipline.md).
Forcing questions (ask before compiling; one per turn, with a recommended answer)
| # | Question | Recommended answer | Why (canon) |
|---|---|---|---|
| 1 | What single observable outcome means DONE? | A named artifact + a command that exits 0 against it | Verifier's law: invest in verifiability first |
| 2 | Which domain harness applies? | The domain whose skills name the deliverable; |
الأسئلة الشائعة
ماذا يحدث عندما تستمر مهمة في الفشل؟
يحدّ المتحكم من المحاولات ويصعّد الأمر، فلا يدّعي الوكيل النجاح.
هل تستطيع جلسة جديدة أن تكمل من حيث توقف العمل؟
نعم. يحفظ ملف الحالة التقدم، فتستطيع جلسة جديدة أن تستأنف اعتمادًا عليه وحده.
هل يعمل الهدف الغامض؟
لا. يرفض مترجم الأهداف الأهداف الغامضة، ويطرح أسئلة حاسمة أولًا.
التفاصيل
الوصف الأصلي من المؤلف
Use when an agent should drive a goal in one of this repo's domains to a verified close, before starting the work. Compiles the goal into a task plan with goal_compiler.py and runs it through loop_controller.py, which verifies each task, caps retries and escalates.
الشعبية
- نجوم GitHub
- 29k
- الترتيب
- #9524
- الترخيص
- MIT
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
agent-launcher-orchestrator
29kيساعد وكيلك على تخطيط وبناء واختبار وجدولة وكيل Claude مُدار في حسابك الخاص، خطوة بخطوة، انطلاقًا من هدف واضح واحد.
grade-iterate
29kيتيح لوكيلك تقييم عمل وكيل ذكاء اصطناعي مُدار وفق معيار تقييم، وتحسينه في عدد ثابت من الجولات، حتى لا يدور في حلقة لا نهاية لها.
interview
29kيتيح لوكيلك أن يجري معك مقابلة حول فكرة وكيل ذكاء اصطناعي، ثم يحوّل إجاباتك إلى خطة بناء بسيطة قبل إطلاق أي شيء.
run-without-you
29kيساعد وكيلك على إعداد وكيل Claude مُدار ليعمل وفق جدول زمني أو عند حدوث حدث، مع فحص توقيت التشغيل قبل الإطلاق.
مهارات مشابهة
add-model-provider
394kتتيح لوكيلك ربط مزوّد نموذج ذكاء اصطناعي جديد بـ OpenClaw باستخدام أوامر إعداد آمنة، وإبقاء مفاتيح API خارج النص العادي، وإجراء اختبار حي.
acp-router
394kيساعد وكيلك على إرسال مهمة إلى مساعد برمجة مثل Claude Code أو Cursor عبر OpenClaw، فيعمل العمل داخل تلك الأداة.
browser-automation
394kتعلّم وكيلك التحكم في صفحات الويب خطوة بخطوة، بما في ذلك تسجيل الدخول والتبويبات والتعافي عندما تتوقف الصفحة عن الاستجابة.