본문으로 건너뛰기
Skillpedia
에이전트31k · #9306

minion-orchestrator

하는 일

이 스킬은 세션이 재시작되어도 계속 실행되는 백그라운드 작업을 관리합니다. 간단한 셸 작업과 AI 하위 에이전트가 맡은 작업을 모두 다루며, 진행 상황을 확인하거나 일시 정지할 수 있습니다.

사용하는 경우

  • ✓재시작 후에도 긴 작업이 백그라운드에서 계속 실행되기를 원할 때.
  • ✓큰 작업을 여러 개의 병렬 작업으로 나누고 추적하고 싶을 때.
  • ✓이미 실행 중인 작업을 일시 정지하거나 재개하거나 방향을 바꾸고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/garrytan/gbrain/blob/master/plugin/skills/minion-orchestrator/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 데이터 정리 작업을 재시작 후에도 살아남는 백그라운드 작업으로 실행해 주고, 나중에 진행 상황을 확인하게 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 각 작업을 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
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬