Skip to content

Destynova2/cli-code-skills / cli-forge-chef

cli-forge-chef

Unverified

Generate a multi-agent orchestrator for any project using the Brigade de Cuisine pattern: Chef (plans, decides), Sous-Chef (validates, merges), Commis (execute). Clients order via a Menu (PERT), the kitchen delivers Plats (merged features). Creates tmuxinator config, prompts, shared-state memory, quality gates, and permissions. Uses Claude Code Agent Teams (TeamCreate + SendMessage) with visible tmux panes. Use when the user wants to parallelize work across multiple Claude Code agents, orchestrate a multi-agent sprint, or says 'boss', 'multi-agent', 'orchestrate', 'parallelize agents', 'team of claudes', 'sprint multi-agent', 'brigade', 'chef'. Also triggers on 'swarm', 'agent team', 'parallel workers', 'PERT multi-agent'.

references/tmuxinator-template.md

View on GitHub
# Template — Tmuxinator Config (native `--append-system-prompt-file`)

## Contents

- What changed (vs the previous wrapper approach)
- Embedded gotchas
- Required artefacts (generated by the skill in Phase 2)
- Architecture in tmux
- Verification after generation

---

Generate at `~/.config/tmuxinator/{session_name}.yml`.

## What changed (vs the previous wrapper approach)

The wrapper `brigade-launch-agent.sh` is GONE. Claude Code natively exposes
`--append-system-prompt-file <path>`, which reads the `.md` file internally — the
shell never sees the file content, so G34 (backtick/quote mangling) disappears
without any wrapper. Same for `.initial.txt` — not needed anymore, the initial
message is just a positional arg on the claude command (short enough to not need
shell escaping).

What we keep:

- `scripts/brigade-setup-worktrees.sh` — G35 (SIGPIPE on `git worktree add | head`)
  and G36 (one branch per commis) are git-level bugs, still relevant. The script
  also copies the per-worktree `.claude/settings.local.json` files into place so
  the standalone tmuxinator panes (chef, ccheck, inter, gate, apply) each get their
  own permissions. Agent Teams teammates ignore these files (G32) — see
  `gotchas-chef.md` G32 for the full caveat.

## Embedded gotchas

- G1: `--permission-mode bypassPermissions` (baked into each claude invocation)
- G4: `--teammate-mode tmux` on panes that spawn teammates (chef, inter)
- G12: `on_project_first_start` does NOT exist, use `on_project_start`
- G24: The ccheck window is MANDATORY
- G31: Kick-off positional arg MANDATORY so claude starts without waiting for user
- G32: Per-worktree `settings.local.json` works for standalone panes, NOT for teammates
- G33: Apply pane is a separate standalone pane (not a teammate) — its permissions are its own
- G34: **Resolved by `--append-system-prompt-file`** (no wrapper needed)
- G35: git SIGPIPE — `brigade-setup-worktrees.sh` handles it
- G36: one branch per commis — `brigade-setup-worktrees.sh` handles it
- G37: First-time trust prompt — `Down Enter` on each claude pane after launch

---

## Required artefacts (generated by the skill in Phase 2)

1. `{project}/scripts/brigade-setup-worktrees.sh` (chmod +x) — from `references/brigade-setup-worktrees.sh`
2. `{project}/.claude/prompts/<role>-<session>.md` for every role with a claude pane (chef, ccheck, contre-chef-inter)
3. `{project}/.claude/permissions-brigade/<role>/settings.local.json` for every role (see `permissions-template.md`)

No wrapper script, no `.initial.txt`, no `$(cat ...)` in the YAML.

---

```yaml
name: {session_name}
root: {project_path}

# --- Worktrees + per-pane permissions (idempotent, G35, G36) ---
on_project_start:
  - COMMIS_LIST="{commis_names}" BASE_BRANCH="{base_branch}" {project_path}/scripts/brigade-setup-worktrees.sh {project_path} {session_name}

  # First-time trust prompt (G37) — send Down+Enter to each claude pane 3s after launch
  - (sleep 3 && for w in chef ccheck inter; do tmux send-keys -t {session_name}:$w Down Enter 2>/dev/null || true; done) &

on_project_stop:
  - |
    for role in gate maitre apply vote-scope vote-secu vote-qualite {commis_role_names}; do
      git -C {project_path} worktree remove {project_path}-wt-${{role}} --force 2>/dev/null || true
    done

windows:
  # --- CHEF: creates the team, spawns sous-chefs + commis + apply-pane-driver ---
  # `--append-system-prompt-file` reads the .md internally (no shell re-parsing — G34 resolved).
  # The trailing positional arg is the kick-off user message (short — no shell metacharacters, G31).
  - chef:
      root: {project_path}
      panes:
        - claude
            --dangerously-skip-permissions
            --permission-mode bypassPermissions
            --teammate-mode tmux
            --append-system-prompt-file {project_path}/.claude/prompts/chef-{session_name}.md
            "Demarre IMMEDIATEMENT Phase 0 selon le system prompt."

  # --- GATE: pure shell, Sous-Chef Merge sends commands here via tmux send-keys ---
  - gate:
      root: {project_path}-wt-gate
      panes:
        - echo "=== GATE — merge, rebase, test, build, push, CI ===" && pwd

  # --- APPLY: infra mutations (tofu/helm/kubectl) after 3/3 quorum (only if infra) ---
  # Standalone pane, NOT an Agent Teams teammate — so its own settings.local.json applies.
  - apply:
      root: {project_path}-wt-apply
      panes:
        - echo "=== APPLY — tofu/helm/kubectl, gated by 3/3 quorum ===" && pwd

  # --- CCHECK: keyboard permission auto-approver (G24) ---
  - ccheck:
      root: {project_path}
      panes:
        - claude
            --dangerously-skip-permissions
            --permission-mode bypassPermissions
            --append-system-prompt-file {project_path}/.claude/prompts/ccheck-{session_name}.md
            "Start watching chef pane per the system prompt."

  # --- INTER: Agent Teams permission card forwarder (G29 — tier ≥ M) ---
  - inter:
      root: {project_path}
      panes:
        - claude
            --dangerously-skip-permissions
            --permission-mode bypassPermissions
            --teammate-mode tmux
            --append-system-prompt-file {project_path}/.claude/prompts/contre-chef-inter-{session_name}.md
            "Start the inter-agent permission scan loop per the system prompt."
```

YAML notes:
- Tmuxinator allows a single list item to span multiple lines if indented — the
  multi-line `claude` invocations above work as long as every continuation line is
  indented deeper than the `- ` marker.
- Omit the `apply` window entirely when the project has no infra (G33).
- Omit the `inter` window for tier S (no Agent Teams = no team leader approval cards).

## Architecture in tmux

```
Window 1: chef (cwd = {project}, standalone claude — own settings.local.json)
  ┌──────────────────┬─────────────┬──────────────┬──────────────┐
  │ Chef (leader)    │ Sous-Chef   │ Commis 1     │ Commis 2     │
  │                  │ (teammate)  │ (teammate)   │ (teammate)   │
  │ own settings     │ inherits    │ inherits     │ inherits     │
  └──────────────────┴─────────────┴──────────────┴──────────────┘

Window 2: gate (cwd = {project}-wt-gate, pure shell, not claude)
  pushes, PRs, CI. No settings.local.json issue (pure shell).

Window 3: apply (cwd = {project}-wt-apply, pure shell, only if infra)
  tofu/helm/kubectl apply — permissions from .claude/permissions-brigade/apply/

Window 4: ccheck (cwd = {project}, standalone claude — own settings.local.json)

Window 5: inter (cwd = {project}, standalone claude, tier ≥ M)
```

## Verification after generation

```bash
# Setup script present and executable
test -x {project_path}/scripts/brigade-setup-worktrees.sh && echo "setup OK"

# --append-system-prompt-file used, NOT the broken $(cat ...) pattern
! grep -q '\$(cat ' ~/.config/tmuxinator/{session_name}.yml && echo "G34 safe"
grep -qc 'append-system-prompt-file' ~/.config/tmuxinator/{session_name}.yml && echo "native file flag used"

# All per-role settings.local.json present (for standalone panes + generator consistency)
for role in gate maitre apply vote-scope vote-secu vote-qualite; do
  test -f {project_path}-wt-${role}/.claude/settings.local.json \
    && echo "perms $role OK" \
    || echo "perms $role MISSING"
done
```
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 467kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 319kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 319kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 319kUpdated Claude CodeCodexVerifiedInstall