AGENT SKILL

brigd-plan

Plan a brigd flow — split a task into stages of parallel coding agents and return the flow JSON that `brigd <name> --flow flow.json` runs. Use when asked to "plan a brigd flow", "make a brigd flow", or "/brigd-plan <task>".

License 许可
MIT
所属仓库
markvrma/brigd
最近更新
2026-11-12
Stars
★ 0
Forks
0

01 前言 Front Matter

name
brigd-plan
description
Plan a brigd flow — split a task into stages of parallel coding agents and return the flow JSON that `brigd <name> --flow flow.json` runs. Use when asked to "plan a brigd flow", "make a brigd flow", or "/brigd-plan <task>".

03 SKILL.md 正文

brigd-plan

Turn a task into a brigd flow: stages that run one after another, where every agent inside a stage runs in parallel as its own interactive agent session. brigd starts stage N+1 only after every agent in stage N has written its result file.

From an agent session you may run brigd <name> --flow <file> yourself: it opens in a new herdr tab, tmux window or Terminal window and returns at once.

Output contract

Return only the flow JSON. No prose, no code fence, no comments.

{
  "goal": string,                     // one line: what the whole flow achieves
  "stages": [                         // run in order
    [                                 // one stage: these agents run in parallel
      {
        "name": string,               // ^[a-z][a-z0-9_-]{0,18}$, unique in the flow, not "log"
        "agent": "claude" | "codex" | "pi" | "kimi",  // an enabled agent, see ## Agents
        "model": string,              // a model of that agent, or "default"; see ## Agents
        "effort": "low" | "medium" | "high" | "xhigh" | "max",
        "worktree": string | null,    // ^[a-z][a-z0-9_-]{0,18}$ or null (main repo)
        "task": string,               // self-contained instructions for this agent
        "files": [string],            // repo paths the agent should check first
        "mode": "default" | "acceptEdits" | "auto",
        "loop": {"to": string, "max": integer}  // optional, reviewers only; see ## Loops
      }
    ]
  ]
}

Example, for "find why login is slow and fix it":

{
  "goal": "Find and fix the slow login path",
  "stages": [
    [
      {"name": "trace-auth", "agent": "claude", "model": "sonnet", "effort": "medium", "worktree": null,
       "task": "Read the login request path and list every call that can block, with file:line and why.",
       "files": ["src/auth/login.rs", "src/db/session.rs"], "mode": "default"},
      {"name": "check-db", "agent": "claude", "model": "haiku", "effort": "low", "worktree": null,
       "task": "List the queries the session table gets on login and whether each has an index.",
       "files": ["migrations/"], "mode": "default"}
    ],
    [
      {"name": "fix-login", "agent": "claude", "model": "opus", "effort": "high", "worktree": "login-fix",
       "task": "Using the earlier stage results, fix the slowest blocking call. Keep the diff small. Run the auth tests.",
       "files": ["src/auth/login.rs"], "mode": "acceptEdits"}
    ],
    [
      {"name": "review-fix", "agent": "claude", "model": "sonnet", "effort": "medium", "worktree": "login-fix",
       "task": "Review the uncommitted diff in this worktree for correctness bugs. Report findings only.",
       "files": [], "mode": "default", "loop": {"to": "fix-login", "max": 3}}
    ]
  ]
}

Splitting rules

  • Use the fewest agents that cover the task. One agent is a valid flow.
  • Agents in one stage must be independent: none needs another's output.
  • Put work that needs earlier output in a later stage. brigd gives every agent the result files of all earlier stages.
  • Each task must stand alone: the agent sees only its task, its files and earlier results, not this conversation.
  • An agent may use its own Task/Agent subagents for fan-out inside its task.
  • brigd saves the flow as the thread's flowmap.json and rereads it before every stage; agents may edit its later stages if the remaining plan must change.

Agents

Use only the agents named in the line Enabled agents: ... of your prompt; if there is none, read ~/.brigd/config.json (agents, base), and if that is missing use claude only. Pick the cheapest agent and model that can do the stage; top tier only for planning, hard debugging, high-stakes edits. Models (cost tier: strengths):

  • claude: haiku cheap (listing, grepping, renaming, formatting); sonnet mid (standard coding, tests, reviews); opus top (planning, hard debugging, high-stakes changes).
  • codex: a -mini model cheap (mechanical edits); gpt-5.4 mid (standard coding); gpt-5.5 top (hard debugging, planning). Names move fast: use "default" when unsure.
  • pi: "default". Models depend on the user's provider; treat it as that model's tier.
  • kimi: "default". Cheap long-context coding, strong tool use. It runs one-shot and cannot ask you questions.

effort for kimi is ignored; codex clamps max to high, pi to xhigh. Start effort at low and raise it only when the task needs real reasoning.

Loops

  • A reviewer may send work back with "loop": {"to": "<agent>", "max": 3}. After the reviewer's stage, brigd types "fix these" into to's session and "re-review" into the reviewer's, up to max rounds, until the reviewer's verdict is pass. Both keep their sessions.
  • Prefer a loop over implement → review → fix → re-review chains of fresh agents.
  • to must be an agent of the stage right before the reviewer, in the same worktree. The reviewer's mode is default. An agent is in at most one loop.
  • max 3 unless told otherwise. brigd adds the verdict and round rules to the prompts; the tasks need not mention them.
  • A final reviewer after the loop is a normal agent in a later stage.

Worktrees and modes

  • Agents with the same worktree string share one git worktree, across all stages. A different string means a different worktree.
  • null means the main repo checkout. Use it for read-only work.
  • Give a worktree only to agents that edit code. A fresh worktree has no build artifacts or untracked files (e.g. .env).
  • One independent change set = one worktree.
  • mode: brigd launches every agent in its closest no-prompt mode (claude auto, codex workspace-write sandbox, pi and kimi auto-approve); mode only marks which agents edit files. default for read-only work, acceptEdits (or auto) for agents that edit files.
  • At most one acceptEdits/auto agent per worktree per stage (null counts as one worktree). Put a second editor of the same worktree in the next stage.

Paths

files must be real paths in the repo. Read the repo (Read, Grep, Glob) before choosing them. Use [] rather than guessing.

plan-review-go (opt-in)

Only when the user's task explicitly asks for it (it names plan-review-go or /plan-review-go): return exactly this flow, with <task> = the user's task. Never infer it; otherwise ignore this section and plan as usual.

plan-review-go needs claude's ponytail plugin and a stage that can hold an approval dialog: use claude for stage 1 when it is enabled, and never kimi (it runs one-shot).

{"goal": "<task, one line>", "stages": [
  [{"name": "plan-review", "agent": "<base agent>", "model": "<opus for claude, else that agent's top model>", "effort": "high", "worktree": null,
    "task": "Invoke the plan-review-go skill on this task: <task>. It needs the grill-me skill and the ponytail plugin's ponytail-review skill; if any is missing, say so and stop. Follow it through to the user approving the plan. Then APPEND stages 2..N to this thread's flowmap.json that implement the approved plan, following the brigd-plan splitting, agent/model/effort, worktree, mode and paths rules and keeping the schema valid. Leave stage 1 untouched. Do not implement the plan yourself. Your output.md holds the approved plan plus a short summary of the stages you added.",
    "files": [], "mode": "default"}]
]}

This one-stage flow is intentional: brigd rereads flowmap.json after each stage and runs whatever stages the agent appended.

04 同仓库更多 Skills

markvrma
markvrma/brigd

plan-review-go

For any non-trivial task, first draft a plan, have ponytail review it, revise per feedback, build a todo list, then ask the user before starting work. Use when the user says "plan-review-go", "/plan-review-go", or asks to plan-then-execute a task with review.

★ 0
markvrma
markvrma/brigd

grilling

Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

★ 0
markvrma
markvrma/brigd

grill-me

A relentless interview to sharpen a plan or design.

★ 0
markvrma
markvrma/brigd

find-skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

★ 0
markvrma
markvrma/brigd

brigd-resume

Continue a finished or stopped brigd thread with new stages. Appends stages to the thread's flowmap.json, reopens the thread, and runs `brigd resume <name> --bg` so an open brigd TUI or a new terminal picks them up. Use when asked to "resume a brigd thread", "add a stage to a brigd flow", "continue the flow", or "/brigd-resume <thread> <what to add>".

★ 0
markvrma
markvrma/brigd

brigd-master

Run the brigd master session — turn each thing the user asks for into a background brigd thread in the right repo, asking only "Use plan-review-go? (y/N)". Use when started by `brigd master` or the brigd TUI's master row, or on "/brigd-master".

★ 0