/baz:plan-with-bazfrom baz
Plans features end-to-end using Baz indexed search across org repos. Explores repos with Baz MCP tools and produces a structured implementation plan for user sign-off before coding begins.
Ships in baz. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You were invoked explicitly to plan a piece of work using Baz's indexed search. The work to plan is in $ARGUMENTS (if empty, ask the user what they want to plan).
This is a read-only procedure. Do not edit project files, run mutating commands, or start implementing until the user approves the plan. The only write allowed before approval is the plan document itself (see Step 2).
Load and follow the baz-codebase-exploration skill for every search, read, and planning decision in this run. It is the authoritative source for tool routing, the search budget, the builder-vs-proxy and verify-before-you-assert checks, and the "enumerate an existing peer's registration sites" completeness rule. Invoke it now (via the Skill tool on Claude Code; on Cursor it is already applied as an always-on rule) and treat its rules as binding. This wrapper owns only the wrapper concerns — the plan-document schema and baz session close (Step 2), approval (Step 3), and the upload offer (Step 4).
If for any reason that skill is not in your context, these non-negotiables still apply — but prefer the full skill:
| Job | Tool |
|---|---|
| Find which repos are involved | repo_search (Baz) |
| Find code by symbol / regex inside a repo | remote_grep (Baz) |
| Find files by name / glob inside a repo | remote_file_search (Baz) |
| Read one file whose path you already know | your read tool — local Read if checked out, otherwise your own fetch |
ls/find to "look around" are searches; route them through remote_file_search / remote_grep. Your read tool is only for opening one already-known file path.repo_search once and don't rephrase keywords; after 3 searches on the same (repository, path) pair, read a matched file before searching that pair again; use at most 10 searches total for the whole run — all repos and paths combined, and hopping to a new pair does not reset the count.Produce the plan in the schema below, emitting every heading, in this order. The stable shape is the contract the Baz product parses when the plan is rendered.
Where to put it: write the plan to the plan-file path your session context gives you — the baz plugin's SessionStart hook names it, in a private directory the plugin owns rather than shared /tmp, so the plan is not readable by other accounts on the machine. If no such path was injected, do not invent one and do not write to /tmp — present the plan inline instead and tell the user the plugin could not stage a plan file, so the upload offer will not appear. A plan in shared /tmp is readable by every account on the machine and is not the file the hook watches, so writing one there would leak the design and still not reach Baz. Write it with your file-write tool (Write / Edit on Claude Code, apply_patch on Codex, edit_file / write_file on Cursor), and present the same content inline in your response. The baz plugin's postToolUse hook watches for that write and prompts you to ask about uploading — except on Cursor, which drops additionalContext for non-MCP tools, so there you raise the upload question yourself (Step 4). This scratch file is exempt from the "read-only until approval" rule (see the intro). After the user approves the plan, save it to baz-plan.md if they want it persisted.
Two layers, split by the --- rule: above it is what a reviewer approves on, below it is what an implementer follows. Someone who was not in the session should be able to say yes or no without unfolding the bottom half.
# <title>
## Why
The problem and the intended outcome. A few sentences.
## The change
Open with **one paragraph, four sentences at most**, in plain language: what you
are going to do and how it works once it lands. Someone who knows the product but
not this code should follow it without reading anything below. No file paths.
Describe the change, not the status quo. Today's behaviour is the table's left
column, and repeating it here charges the reader for the same paragraph twice.
Then a **Before / After table** tracing one thing through the system (a request,
a job, a record), one row per step, at most six rows, so the change reads across
each row instead of by diffing two blocks:
| Step | Today | After |
| --- | --- | --- |
| <what happens at this point> | <current behaviour> | <what differs> **(changed)** |
Mark the **After** cell **(new)**, **(changed)** or **(unchanged)**, using those
three words everywhere in the plan. Mark that cell only: Today is unchanged by
definition, so tagging it too repeats one fact on every row. The unchanged
markers are what show how much is being reused. Keep cells to one line; a step
needing more than that is really two steps.
Keep **at most one (unchanged) row**, and only where a reviewer would otherwise
ask whether that part broke. "The existing stat cards still read the same fields"
earns its row. "The request URL is the same" does not: nobody wondered, and a row
nobody wondered about is a blank line with a border.
No ASCII diagrams. Plans are read as rendered Markdown, where indentation-aligned
art becomes a striped, unreadable block.
Then one ```mermaid``` `sequenceDiagram` tracing the same journey at runtime:
who calls whom, in order, ending where the result lands. Mark the participants
with the same three words, not the messages. Keep it under six participants and
ten messages. Past that it stops being readable, and the excess belongs in Steps.
Draw it only if it answers a question the table does not: fan-out, a loop, a
branch, who waits on whom. A diagram that walks the same steps in the same order
as the table is the table again in a slower form, so drop it and keep the table.
Use `erDiagram` instead when the change is mostly tables and columns, or
`flowchart TD` when there is no runtime sequence to trace. Never two diagrams.
## Affected repos
One line per repo, a few words each, no file paths and no second sentence. This
shows the reach at a glance; what changes where belongs to Steps.
- `<owner/repo>` — <what changes here>
## Decisions
One bullet each, opening with a **bold few-word title** naming the choice, then
two sentences at most:
- **<Choice, a few words>.** Chose <A> over <B>, because <why, grounded in the code>. Cost: <what becomes harder>.
Do not list the files a decision touches; those belong to the step that makes the
change. Close with one bullet titled **Out of scope**.
## Open questions
Only what genuinely blocks a decision. `_None._` otherwise. A question you could
answer by reading the code is not an open question, it is unfinished research.
---
## Steps
Ordered, **one sentence of 25 words at most**, naming one path and at most three
identifiers. No sub-bullets.
A step you can only write by chaining clauses with commas is more than one step.
Split it. Four short steps read faster than one long one, and the implementer can
check them off.
When a change repeats across sites, give the pattern and the scale, not the
list: *"wherever `<existing peer>` appears, about eight deployment files"*. The
implementer greps for the peer and finds them all, including any you missed.
Write for someone who reads the code as well as you do: do not explain what they
will find on opening a file, restate reasoning from Decisions, or spell out a
diff. Mark the load-bearing step.
For a multi-repo change, group the steps under a `###` heading per repo, with the
order in the heading (`### owner/repo, deploys first`). Number them continuously
across the groups, so a step keeps one number.
## Verification
**Automated:** literal commands that prove it works, run from the repo root.
Never an absolute path from your own machine: the plan is read by people whose
checkout is somewhere else.
**Manual:** one bullet per check, one line each. A semicolon-joined list of five
things is not a checklist, and nobody can work through it.
What goes in:
Ticket: CR-1234). Baz links the plan to PRs that carry the same key.Present the plan and ask the user to approve before any implementation begins. Do not start editing until they say go.
Writing the plan file is local and needs no permission. Uploading is different: mcp__baz__update_plan (fully qualified — update_plan alone is not a callable tool name; Claude Code may list it as mcp__plugin_baz_baz__update_plan, and the same prefix applies to every baz tool named below) publishes the plan to Baz, where your teammates can open, comment on, and review it — plans live in Baz the way pull requests live in GitHub. That is never automatic — ask the user and wait for their answer.
mcp__baz__update_plan, following the call shape the hook's instruction gives you. Where it says the arguments are attached for you, pass none — re-typing the plan wastes tokens and risks drift. Where it supplies authoritative content / tokensUsed / modelId / repoNames values (Codex and Cursor), pass those exactly as given rather than your own recollection or estimates. The tool result contains a shareable plan link — include it in your reply so the user can open the plan, and tell them they can run /baz:get-plan-comments any time to pull the plan's comments back into this session.update_plan again, so the version the user approved is what ends up in Baz — the latest plan text is what gets sent, whether the hook attaches it or you pass it inline. A redundant call is harmless — identical content is deduped server-side by content hash — but a skipped one leaves a stale draft as the final plan.A hook instruction telling you to call update_plan is a prompt to ask, not the user's permission. Only a direct answer from the user is consent.
Per-platform mechanics:
additionalContext from non-MCP-tool hooks), so raise the question yourself right after the file write. Token counts aren't available client-side and should be omitted.When you open a PR for a plan that was uploaded, put the plan reference from the update_plan result (PLAN-<n>) and the ticket key, if there is one, in the PR description. Baz links the PR to the plan from either of these on its own, so the link holds even when the call below is missed.
Once implementation is done and a PR is open for a plan that was uploaded, also call mcp__baz__link_plan_to_pr with the PR's repository (owner/repo) and prNumber. This marks the plan implemented, links the plan to the PRs it produced, and shows the plan on the PR page, so a reviewer can read the reasoning the change came from.
planId with this session's id. Elsewhere, pass planId yourself — it is the UUID in the plan's URL.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub baz-scm/baz-plugin --plugin baz4 skills in this plugin
/baz-codebase-explorationProcedure for exploring repositories with Baz's indexed search tools. Use when asked to plan a feature, design a change, scope work, or investigate where to make changes across the org's repos. Applies even when you own one side of a cross-repo contract (API param, schema, event payload) locally, and especially when the relevant repositories are not checked out locally. Baz's MCP tools are how you search code across the org; once you know a file's path, read it however you like.
/get-plan-commentsPull the comments teammates left on a Baz plan back into this session, summarize every one of them with an assessment and a recommendation, and — only after you choose — apply the ones you pick and reply on them. Invoke with /baz:get-plan-comments.
/reviewReview code changes with Baz indexed search and the org's own review guidelines — a diff-scoped code review that checks the change against the rest of the org's repos and against the standards the org configured in Baz, not just the files in front of it. Use when asked to review changes, review a diff or branch, review a pull request, check changes for bugs or security issues, or find what is wrong with the current changes before pushing. Invoke with /baz:review; supports committed / uncommitted / --base / --pr scopes and an optional --fix loop that applies the fixes it finds.
Other plugins' skills for the same job