Skillpedia
الوكلاء31k · #9306

minion-orchestrator

ما الذي تفعله

تدير هذه المهارة مهام خلفية تستمر حتى لو أُعيد تشغيل الجلسة. تتعامل مع مهام الأوامر البسيطة والمهام التي ينفذها وكلاء فرعيون بالذكاء الاصطناعي، وتتيح لك متابعة التقدم أو إيقافه مؤقتًا.

متى تستخدمها

  • ✓عندما تريد أن تستمر مهمة طويلة في الخلفية حتى بعد إعادة التشغيل.
  • ✓عندما تريد تقسيم عمل كبير إلى مهام متوازية كثيرة ومتابعتها.
  • ✓عندما تريد إيقاف مهمة قيد التشغيل مؤقتًا أو استئنافها أو توجيهها.

رابط المهارة

https://github.com/garrytan/gbrain/blob/master/plugin/skills/minion-orchestrator/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/garrytan/gbrain/blob/master/plugin/skills/minion-orchestrator/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“شغّل تنظيف البيانات هذا كمهمة خلفية تستمر بعد إعادة التشغيل، واسمح لي أن أتابع تقدمها لاحقًا.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يرسل وكيلك كل مهمة إلى قائمة انتظار دائمة مخزنة في Postgres. يسجل التقدم واستهلاك الرموز، ويتيح لك إرسال رسائل توجيه إلى العمل الجاري، ويعلن عند تسليم النتائج.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Minion Orchestrator

Contract

Minions is a Postgres-native job queue for durable, observable background work. This single skill handles two lanes:

  • Deterministic shell jobs (gbrain jobs submit shell ...)
  • LLM subagent jobs (gbrain agent run ...)

When to route to Minions: durable, observable work that must survive restarts, fan out across many parallel tasks, or persist across sessions. Routing policy is defined in skills/conventions/subagent-routing.md — the project default is pain_triggered (native subagents first, Minions after specific pain signals fire); Mode A (all-through-Minions) is opt-in.

Guarantees:

  • Jobs survive gateway restart (Postgres-backed)
  • Every job has structured progress, token accounting, and session transcripts
  • Running agents can be steered mid-flight via inbox messages
  • Jobs can be paused, resumed, or cancelled at any time
  • Parent-child DAGs with configurable failure policies

Durable-execution doctrine (routing convention the agent follows — nothing mechanically enforces it; see "Durable execution" below):

  • Operations expected to exceed ~2 minutes route through the capability ladder, never a bare background shell that dies with the session.
  • A deadman check verifies the result was REPORTED to the user, not merely that the process exited — a swallowed completion event looks identical to a dead job from the user's side.
  • The deadman is second-line insurance, not a delivery guarantee: it can itself die before firing (scheduler restart, deleted entry). Backstop: on the next turn, sweep gbrain jobs list --status active and recent completions for overdue work whose result never reached the user.
  • Deadman checks are idempotent. A double-fire, or a fire that races the normal completion report, produces silence — it checks reported-state first and tags any recovery report with the job ID so duplicates are detectable.
  • A checkpoint or progress file is trusted only with a freshness check. A stale checkpoint reads as "still running" forever; compare its timestamp against the expected progress interval and against gbrain jobs get <id>.

Route the Request: Shell Job vs Subagent

Condition Action
User asks for deterministic command/script run Shell job (CLI: gbrain jobs submit shell ...)
User asks to "run in minions" + explicit command/argv Shell job (CLI, --params with cmd or argv)
User asks for research/reasoning/iterative agent Subagent job (CLI: gbrain agent run)
User asks to steer/pause/resume an agent Subagent job lifecycle tools (MCP-callable)
Single simple operation under ~30s Consider inline execution first
Needs restart durability/observability Submit as Minion job
Operation expected to exceed ~2 minutes Route through the Durable execution ladder (below)
Parallel work (2+ streams) gbrain agent run --fanout-manifest or parent + child subagents

If intent is ambiguous, ask one clarification: "Do you want a deterministic shell command job, or an LLM agent job?"

Shell Jobs (Deterministic Scripts)

Use for reproducible command execution, ETL steps, cron work, and scriptable tasks where no LLM reasoning loop is needed.

Preconditions (read before submitting your first shell job)

  • The worker must be started with gbrain jobs work --allow-shell-jobs (equivalently GBRAIN_ALLOW_SHELL_JOBS=1 exported on the worker; a .env in the worker's directory cannot set it). The shell handler is always registered but guarded: an unflagged worker that claims a shell job dead-letters it immediately (UnrecoverableError, straight to dead, no retries) with the flag named in error_text. A job that sits in waiting means NO worker is running at all — check gbrain jobs supervisor status. Gate lives in src/core/minions/handlers/shell.ts.
  • Security: flipping GBRAIN_ALLOW_SHELL_JOBS=1 authorizes arbitrary command execution on the worker. On a shared queue, this is a remote code execution surface. Treat as privileged infrastructure authorization.
  • Execution mode — pick one:
    • Postgres + daemon: gbrain jobs work runs a persistent worker that claims and executes jobs from the queue.
    • PGLite + --follow: gbrain jobs submit ... --follow runs inline. The daemon mode is not available on PGLite (exclusive file lock). See docs/guides/minions-shell-jobs.md.
  • MCP boundary: shell-job submission is CLI-only. `submit_job n
الأسئلة الشائعة

هل تنجو المهام من إعادة التشغيل؟

نعم. قائمة الانتظار مخزنة في Postgres، فتستمر المهام بعد إعادة تشغيل البوابة.

هل أستطيع تغيير مهمة وهي تعمل؟

نعم. يمكنك إرسال رسائل توجيه، أو إيقاف المهمة مؤقتًا أو استئنافها أو إلغاؤها.

متى أستخدم وكيلًا فرعيًا عاديًا بدلًا منها؟

قواعد التوجيه تفضّل الوكلاء الفرعيين الأصليين أولًا، وتلجأ إلى قائمة الانتظار بعد ظهور مشكلات محددة.

التفاصيل

الوصف الأصلي من المؤلف

Unified Minions skill for both deterministic shell jobs and LLM subagent orchestration. Replaces the older `gbrain-jobs` routing intent. Use when: submitting gbrain jobs, shell/background tasks, spawning subagents, checking progress, steering running work, pausing/resuming, parallel fan-out. One durable, observable, steerable queue interface. Also carries the durable-execution doctrine for any operation expected to exceed ~2 minutes: capability ladder, deadman checks that verify the result was reported, and content-addressed stage checkpoints for expensive pipelines.

repo: garrytan/gbrain

الشعبية

نجوم GitHub
31k
الترتيب
#9306
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة