agentleFS
thales8461thales8461/mapa-skills/skills/orquestrador/SKILL.md

orquestrador

Skill1 starsChanged 22 days agoMITView on GitHub

Use when the user sends /orquestrador with a topic of the project map (mapa HTML), a range of task ids (for example A10 to A20) or a list of ids to run; the session becomes the orchestrator that runs those tasks with subagents until they are done.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. BasisTI/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository8 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before starting, show the plan in a few lines: waves, model and effort of each task, what runs in parallel.

    line 27
  2. Very specific:

    nota: update it when what the user needs to know changes (e.g.

    line 38
  3. Distinctive:

    Priority on X: run only X (and its missing dependencies) until X is ready.

    line 44
  4. Very specific:

    Map: write trabalhando: true on the task (re-read the lines right before the edit.

    line 52
  5. Distinctive:

    When neither the orchestrator nor Fable is sure: do nothing on that task.

    line 64
  6. Distinctive:

    After the answer, continue the same subagent with SendMessage (do not start a new one).

    line 66
  7. Very specific:

    Read the real diff (gh pr diff <N>): the prompt was followed, tests cover the change, progressFiles updated, no secrets or private data.

    line 69
  8. Distinctive:

    Run the tests of the changed area if the subagent did not show the results.

    line 70
  9. Very specific:

    Start sleep <mergeWaitSeconds> in the background (Bash, run_in_background: true) and end the turn.

    line 77
  10. Very specific:

    Keep <scratchpad>/orquestrador/ESTADO.md: tasks, subagent of each, worktree, PR, status (running, ready, merge at the end, merged, …

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/orquestrador: run many map tasks with subagents

This session becomes the orchestrator. It does not implement tasks. It creates the worktrees, launches one subagent per task, reviews, asks before merging and merges. The user often leaves the computer on and follows from the phone.

Reply in the user's language. Helper: node <mapa skill folder>/scripts/mapa.mjs (below: mapa.mjs); the mapa skill is the sibling folder ../mapa. Project settings: .claude/mapa.json (keys in ../mapa/references/config.md); read it at the start. Missing keys use the defaults there.

Step 0: Remote Control and phone alerts

  • The model cannot turn on Remote Control. In the first reply, if Remote Control is not on, ask: "Type /rc (or /remote-control) to follow from your phone." Go on without waiting. It can also be on for every session (remoteControlAtStartup: true in ~/.claude/settings.json, or "Enable Remote Control for all sessions").
  • Load PushNotification if available (ToolSearch select:PushNotification). Use it for every question to the user and when a task is ready.

Step 1: read the request

The text after /orquestrador can be:

  • a topic (id or part of the title): mapa.mjs tasks <dir> <topic>;
  • a range: "from A10 to A20" becomes mapa.mjs tasks <dir> A10..A20;
  • loose ids: mapa.mjs tasks <dir> A3 A7 K71;
  • "priority on X": note X as the priority.

<dir> = <scratchpad>/orquestrador/prompts. The helper writes one <id>.txt per task with the Claude prompt (constants resolved) and prints JSON with the pending tasks, alreadyDone and waves.

AMBIGUOUS, NOT FOUND or ERROR: ask the user with options. Do not guess.

Before starting, show the plan in a few lines: waves, model and effort of each task, what runs in parallel. Then start without waiting. Ask first only when:

  • a task has trabalhando: true or pr (another session may be on it);
  • a task has no Claude prompt (only another AI);
  • dependsOutsideSelectionPending is not empty;
  • waves ends with blocked.

Orchestrators panel in the map

The top of the map shows each running orchestrator from DADOS.orquestradores. Re-read the lines right before each edit and touch only this session's entry.

  • At the start (after showing the plan): add { id: 'orq-<ddmm-hhmm>', pedido: '<topic or ids, short>', desde: 'dd/mm hh:mm', tarefas: [<pending ids>], estados: {}, nota: '<next step, short>' }. Write the id in the orchestrator ESTADO.md.
  • estados only when the status does not come from the task itself: 'pronta' (PR reviewed, waiting for "can I merge?"), 'fim' (in the "merge at the end" list), 'duvida' (waiting for the user). Remove the key when that status ends. Running, merged and waiting come from trabalhando and feita.
  • mudou: 'dd/mm hh:mm' of the last change to estados (entering or leaving a question, PR ready, merge at the end); write it with every change of estados. The map uses it for the card badge: Stalled (red) when a question has waited 24 h or more, Pending (yellow) for a newer question, Only the merge left (green) and Working (blue).
  • nota: update it when what the user needs to know changes (e.g. "Question on A8: which layout"; "Waiting for the merge of #15").
  • At the end (step 8, nothing running and nothing waiting): remove the entry. If the session stops with a question or a merge pending, the entry stays, with the nota saying what.

Step 2: execution order

  • A task is ready when each dependency is done in the map or has its PR ready (reviewed and approved by you), even if not merged yet.
  • Ready tasks with no dependency between them run in parallel.
  • Priority on X: run only X (and its missing dependencies) until X is ready. Only then release the others.
  • Machine limits: at most parallel.max tasks at once (default 4) and parallel.maxHeavy heavy ones (default 2; heavyHint says what is heavy).
  • Tasks that change the same generated file (PDF, screenshot, lock file) run one after the other.

Step 3: launch each task

For each ready task, in this order:

  1. Worktree, one at a time: worktree.create with the branch named in the prompt. Never create two at the same time.
  2. Dependency not merged yet: in the new worktree, git merge origin/<dependency branch> for each missing one. Write in the PR description: "Depends on #N; merge after it."
  3. Map: write trabalhando: true on the task (re-read the lines right before the edit; touch only this field).
  4. Subagent (Agent tool, in the background). Model from the prompt: Opus → opus, Sonnet → sonnet, Haiku → haiku. Brief, in this order:
    • the whole text of <id>.txt;
    • the worktree absolute path, and subagentNotes from the config;
    • what the other parallel tasks are changing;
    • new ending: "Open the PR and stop. Do not merge, do not remove the worktree, do not mark feita in the map. Actually write the files the prompt asks to update.";
    • questions: "Do not ask the user. If a question changes the result, stop and end the report with one line QUESTION: <question> | options: ... | suggestion: ....";
    • final report: PR number, tests run with results, what was left out.

Step 4: questions (fixed chain)

  1. The orchestrator answers when the answer is in the plan files, the project instructions, the prompt or the code.
  2. Otherwise consult Fable (Agent, model: fable, read-only) with the question, the context and the options. Check its recommendation against the real environment before using it.
  3. When neither the orchestrator nor Fable is sure: do nothing on that task. Ask the user (text + PushNotification, options with the suggestion marked) and keep the other tasks running. Questions have no timeout: the task waits for the answer.

After the answer, continue the same subagent with SendMessage (do not start a new one).

Step 5: review when a subagent finishes

  • Read the real diff (gh pr diff <N>): the prompt was followed, tests cover the change, progressFiles updated, no secrets or private data.
  • Run the tests of the changed area if the subagent did not show the results.
  • Problem: send it back to the same subagent with SendMessage. A subagent with a background process that repeats its report: TaskStop once the PR exists.
  • Approved: the PR is ready. Tasks that depend on it can start (step 2).

Step 6: ask to merge (timed wait)

For each ready PR:

  1. Send in the chat and by PushNotification: "Task X ready (PR #N: summary). Can I merge? (no answer in 2 min: I leave it for the end)" — use mergeWaitSeconds (default 120).
  2. Start sleep <mergeWaitSeconds> in the background (Bash, run_in_background: true) and end the turn. The other tasks keep running.
  3. "Yes" before the sleep notification: merge (step 7). "No": leave it for the end.
  4. Sleep notification with no answer: put X in the "merge at the end" list and go on. A late answer applies to that list.

Step 7: merge (one PR at a time)

  1. In the worktree: git fetch and git merge origin/main. Resolve conflicts in progress/doc files by keeping main first and re-adding the branch's part. Run the tests of the changed area again.
  2. mergeCommand (default gh pr merge {pr} --merge) and confirm it merged (gh pr view <N> --json state = MERGED). Only then worktree.remove.
  3. Map: feita: true (remove trabalhando, pr, fila), remove the id from estados in the orchestrator entry and update atualizado.
  4. Main folder: afterMerge commands (default git pull).
  5. A PR that depends on an unmerged one: merge only after it, already with git merge origin/main.

Step 8: end

  • Nothing left running: list the "merge at the end" PRs in dependency order and ask once (no timeout). Merge the approved ones with step 7. Each PR waiting for the merge and each unanswered question goes to the bell of the map (sino skill) and leaves it when the user answers.
  • A topic finished completely: prompt-revisao skill (writes the topic's revisao).
  • Final summary: merged, still open, unanswered questions, warnings.

Long runs and usage limits

  • Keep <scratchpad>/orquestrador/ESTADO.md: tasks, subagent of each, worktree, PR, status (running, ready, merge at the end, merged, question), next step.
  • At the start, create a /loop 30m (Skill loop): "Continue the orchestration of this session from the orchestrator ESTADO.md; if everything is done, stop the loop."

Common mistakes

MistakeRight
Subagent merges because the map prompt says soThe brief replaces the ending: open the PR and stop
Two worktrees created at the same timeOne at a time, before launching the subagents
More heavy tasks than maxHeavyRespect the limit
Waiting for the dependency merge to start the next taskA ready PR already releases it (merge its branch into the new worktree)
Blocking everything while waiting for "can I merge?"Background sleep and go on
Picking the most likely option when unsureOrchestrator → Fable → user; without certainty, the task stops
Writing the map from an old copyRe-read right before each edit (other sessions write too)
Marking feita before the mergeOnly after state: MERGED
Ending and leaving the entry in orquestradoresRemove it at the end; it stays only with a question or merge pending, with the nota

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.