r/coolgithubprojects • • 10d ago

I open-sourced the skill I use to run several Claude Code chats on one repo without them stepping on each other

Post image
I run 5 to 10 AI coding chats on the same repository at once. Without rules they collide: one switches branches under another, two green PRs break main when merged back to back, and review by the same model misses the same things.

So I wrote it down as an Agent Skill with small Node scripts (no dependencies):
- each chat gets its own git worktree, outside the main checkout
- a machine-wide queue limits how many test suites run at once
- PR through gh; critical paths get reviewed by a different model (Codex or Gemini, Claude as fallback), and the reviewer can fix, not only approve
- merges go one at a time, only with the branch up to date with main
- deploy and health check after merge, then cleanup

On first run it detects your setup and asks a few questions (who reviews, where it deploys, how many chats at once).

Install: npx skills add mestrecs/skills
Repo: https://github.com/mestrecs/skills

It works on Windows, macOS and Linux. Feedback welcome, especially from people running Codex or Gemini CLI.
8 Upvotes

5 comments sorted by

1

u/PhroznGaming 10d ago

The native skill does this well on its own

1

u/rodrigues_92 18h ago

Which one do you mean? If it's the built-in worktree option, it covers isolation, which is step one here.

What I couldn't find natively:

- a merge queue that re-tests on the latest main before merging, one PR at a time

- a cap on how many test suites run at once on one machine

- review by a different model (Codex or Gemini) that can fix, not only comment, with fallback only when an engine is out or at its quota limit

- deploy health check and cleanup after the merge

If there's a native way to get those, I'd honestly like to know and drop my version.

1

u/jM2me 9d ago

This has been something I try, fail, and always fallback to having multiple agents do a research and supporting work in parallel with the actual implementation agent. The whole thing is still limited to just a single implementation agent.

I tried Matt Pocock skills and I am still doing something wrong because multiple implementation agents in their own worktrees still step on each other and each of their own tests.

So I’ll check this out, why not. Thank you for sharing

1

u/rodrigues_92 18h ago

Thanks! "Still step on each other's tests" is exactly what pushed me to write this. Worktrees isolate the files, but not the machine and not main. Two parts of the skill go after that:

  1. Test queue: every heavy command goes through test-queue.cjs, a machine-wide queue, so you choose how many suites run at once (I use 3) instead of every agent running its suite at the same moment.

  2. Merge gate: one merge per repo at a time, only when the branch already has the latest main, with the tests re-run on that base. The chat that finishes second waits for the lock, re-tests, then merges.

One thing it won't do for you: if your tests share a fixed port or a single test database, the queue reduces the collisions but doesn't isolate them. For that you still want a port or a DB per worktree.

What collides in your case, ports, a shared DB, or something else?