Runs the design stage of a BDK Change - maps the code with explore, drafts the acceptance scenarios and key decisions of its issue with design-draft, checks them with verify-design until a report passes or policy.budgets.verifier is spent, then applies the design gate of policy.gates.design, showing the intent page when the scope changed since propose, syncs the issue to the tracker with a gate summary, creates the sub-issues of an approved split and accepts the ADRs the design proposed (bdk ...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Design?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/broneq-design)
---
name: design
description: 'Runs the design stage of a BDK Change - maps the code with explore, drafts the acceptance scenarios and key decisions of its issue with design-draft, checks them with verify-design until a report passes or policy.budgets.verifier is spent, then applies the design gate of policy.gates.design, showing the intent page when the scope changed since propose, syncs the issue to the tracker with a gate summary, creates the sub-issues of an approved split and accepts the ADRs the design proposed (bdk adr accept with the issues that implement them). Resumes from the run files. Use when a Change has a proposal and needs its design, when asked to "design" a Change, or when /bdk:run reaches the design stage.'
argument-hint: "[change-name]"
allowed-tools: Bash(${CLAUDE_PLUGIN_ROOT}/bin/bdk *) Bash(npx -y lavish-axi *) Read Glob Grep Write Agent SendMessage ToolSearch AskUserQuestion
---
Current BDK configuration of this project:
!`"${CLAUDE_PLUGIN_ROOT}/bin/bdk" config show`
Arguments: $ARGUMENTS
# Design
You compose three blocks, apply the gate and write the issue to the tracker; you never do a block's work. Do not map the code, write or fix the scenarios, the key decisions or the proposal in `issue.md`, or check the design yourself: the blocks do that. The only files you write are the gate files `.bdk/runs/<change>/design/gate.md` and `gate-comment.md`, the `design/gate.md` of each sub-issue, the index `.bdk/runs/<change>/explore/index.md`, and the merge of a tracker conflict (step 6); `bdk adr accept` sets the status of the proposed ADRs (step 6), never you. Never commit, create a branch or start the plan stage. Run each command on its own, without `;`, `&&`, pipes or `echo`, the Lavish poll too: the result shows the exit code, and a compound command falls outside this skill's grants, so it is denied or asks the user for permission.
The blocks:
- **explore**: start an agent with the Agent tool in the foreground (`run_in_background: false`), `subagent_type: "bdk:explorer"`, prompt `Run the skill bdk:explore with the arguments: <change>`, `model` set to `models.explorer.model` and `effort` set to `models.explorer.effort`, each only when the configuration above sets it. It writes `.bdk/runs/<change>/explore/design.md`. Then build the index: read the front matter of every file in `.bdk/runs/<change>/explore/` other than `index.md` and write `explore/index.md` again whole with Write, one line per file, its stage, question and summary:
```markdown
# Explore: <change>
- [propose-recon.md](propose-recon.md) (propose) <question> - <summary>
- [design.md](design.md) (design) <question> - <summary>
```
- **design-draft**: start an agent with the Agent tool in the foreground (`run_in_background: false`), `subagent_type: "bdk:designer"`, prompt `Run the skill bdk:design-draft with the arguments: <change>. Write the questions in <language>, the language the user writes in.` (with `<change> <revision request>` as the arguments after a gate asking for changes; `<language>` is the language of the user's messages), `model` set to `models.designer.model` and `effort` set to `models.designer.effort`, each only when the configuration above sets it. Keep the agent ID it returns. It writes `## Acceptance scenarios` and `## Key decisions` into `issue.md` (and a proposed split into `design/split.json`), or fixes them when the last report failed. It cannot ask the user itself: it ends with `Needs user: SL-<n>` (an acceptance criterion only the user may change; handle it as step 3 says), or with `Page open: <page>` and the round's decisions, or, when the Lavish page does not open, with its open questions, and writes nothing; handle them as step 3 says, each time this block runs, for every round.
- **verify-design**: start an agent with the Agent tool in the foreground (`run_in_background: false`), `subagent_type: "bdk:verifier"`, prompt `Run the skill bdk:verify-design with the arguments: <change>`, `model` set to `models.verifier.model` and `effort` set to `models.verifier.effort`, each only when the configuration above sets it. It writes the next `.bdk/runs/<change>/design/verify-N.md` and returns its verdict. Keep the agent ID it returns.
Start every block in the foreground (`run_in_background: false`) and wait for its result: the next step reads the file it writes. When an agent runs in the background anyway, end your turn with one line naming the running block; its notification resumes you, and step 2 finds where to start.
Before each block, tell the user in one line which block runs and which file it writes, e.g. `Mapping the code: bdk:explorer writes .bdk/runs/add-csv-export/explore/design.md`.
## 1. Check the configuration and the Change
When the block above says `BDK not configured: run /bdk:setup` or that the configuration is invalid, stop: run no block, write nothing, and reply with that line. Otherwise note `policy.gates.design` (`manual` when absent), `policy.budgets.verifier` (3 when absent), `tracker.kind` and `tracker.instructions`.
The argument names the Change. Without one, take the `current` Change of `.bdk/runs/run.json`, else the only directory under `.bdk/runs/` other than `pr-<N>/` that holds an `issue.md`. With none or several, name what you found, ask which Change to design, and stop. When `.bdk/runs/<change>/issue.md` is missing or has no `## Proposal` heading, stop: run no block and name `/bdk:propose` as the stage to run first.
Done when you hold the Change name, the gate setting and the budget.
## 2. Find where to start
List `.bdk/runs/<change>/design/` and `.bdk/runs/<change>/explore/`, and check with Grep whether `issue.md` holds `## Key decisions` (the draft). The last report is `verify-N.md` with the highest N; read its frontmatter. Take the first row that matches:
| # | Files | Start at |
|---|---|---|
| 1 | `gate.md` exists and its `report` names the last report | nothing to run: go to step 7 and report the approved design |
| 2 | no `explore/design.md` and no draft | step 3, explore |
| 3 | no draft | step 3, design-draft |
| 4 | no `verify-N.md` | step 4 |
| 5 | the last report says `verdict: fail` | step 4, starting with the fix |
| 6 | the last report says `verdict: pass` | step 5 |
A step whose file exists never runs again. Done when you know the row.
## 3. Map and draft
1. Without `explore/design.md` and a draft: run **explore**, wait for it, and build the index.
2. Run **design-draft** with `<change>`. Until it writes the files, answer each round it ends with:
- `Needs user: SL-<n>`: an entry of `.bdk/runs/<change>/scope-log.md` that only the user may decide (it changes an acceptance criterion) and the designer could not ask. Stop: run no other block, write no gate file, and reply with the entry's id, its AC and question, and that `/bdk:design <change>` in a session that can ask answers it.
- `Page open: <page>`: the page is where the user answers; the decisions listed after that line are only for you to name. Tell the user in one line that the questions are on that page in the browser, then always wait with `npx -y lavish-axi poll <page>` in the foreground, whatever else the designer reports about the page; never ask the page's questions in your reply instead (Bash `timeout` 600000; run it again when it times out). Continue the same designer with `SendMessage` (load it first with `ToolSearch` query `select:SendMessage` when it is listed only by name): `Answers: <the poll's output, verbatim>`. Do not summarise, interpret or settle anything in it: a note the user wrote may open a new decision, and only the designer decides that. When the poll is interrupted, or the user asks to stop waiting, do not poll again in this turn: answer what the user asked (a summary of the open decisions, for one), name the page, say that answers given on the page stay queued and that `/bdk:design <change>` picks them up, and end your turn. A later run resumes at row 3, and the designer opens the same page again.
- Open questions without a page: ask them with `AskUserQuestion`: at most four questions per call, the recommended option first, each option one label and one sentence. Continue the same designer with `SendMessage`: `Answers: <question>: <chosen option or the user's note>; ...`. Without the tool or the agent ID, run **design-draft** again with `<change> Answers: ...`.
- When `AskUserQuestion` is not available: say that the browser review page (Lavish) could not open when the designer says so, list the questions in your reply, the recommended option first and marked "(recommended)", end the reply with one line saying how to answer (`Reply with the numbers of your choices, or your own answer.`), and stop here: the user's answers continue the designer, and a later `/bdk:design <change>` resumes at row 3.
Done when `issue.md` holds `## Key decisions`.
## 4. Verify within the budget
Count the verifier passes you start in this run; at most `policy.budgets.verifier`.
1. When the last report says `verdict: fail` (row 5, or a failed pass of this loop): run **design-draft** with `<change>`; it fixes the report's `Must address` items. Then verify.
2. Verify: the first pass of this run starts the **verify-design** agent. A later pass continues the same agent with `SendMessage` (load it first with `ToolSearch` query `select:SendMessage` when it is listed only by name): `Verify the design of <change> again: design-draft fixed it.` Without the agent's ID or the tool, start a new **verify-design** agent instead; the report numbers and open IDs come from the files either way.
3. Tell the user the verdict and the report path.
4. `verdict: pass`: go to step 5. `verdict: fail` with budget left: back to 1. `verdict: fail` with the budget spent: stop before the gate and write no gate file. Report the last report's path, its open `Must address` IDs, and that `/bdk:design <change>` continues with a new budget.
Done when the last report passes, or you stopped on a spent budget.
## 5. Apply the design gate
Collect every line of `issue.md` that starts with `Decided without the user:`, `Scope changed by the user:` or `Deviation:`, and the bullets of its `### Living documentation` (`- ADR:`, `- Module map:`, `- Glossary:`) (Grep, not a full read).
**Scope change to show.** Grep `.bdk/runs/<change>/scope-log.md` for its `## SL-` headings and `- Stage:` lines. There is one when an entry whose `Stage` is not `propose` has a number above the `scope_log` of an earlier `design/gate.md` (above 0 without one). Then, under `manual` and `auto` alike, the user sees it before approval:
1. When `.bdk/runs/<change>/design/intent.html` is missing, or its `<meta name="bdk-scope-log" content="SL-<n>">` names a lower entry than the log's last (Grep), run **design-draft** with `<change> intent page` and wait; it writes the page.
2. Open it with `npx -y lavish-axi .bdk/runs/<change>/design/intent.html`, as a Bash command of its own, and tell the user in one line that the intent page is open in the browser.
3. Ask as `manual` says below, naming the page and each entry to show (its id, its AC, before and after), whatever `policy.gates.design` says.
Without a scope change to show:
- `policy.gates.design: auto`: approve without asking.
- `manual`: end your turn on exactly one question: one `AskUserQuestion` call, header `Design gate`, and no reply text after it. Put everything the user needs into the question text, not into a reply before it: approve the design of `<change>`? Name `issue.md` with its scenarios and key decisions, the passing report, the decisions taken without the user, the scope changes (and the intent page when there is one to show), each deviation, the living-documentation changes (each proposed ADR with its file, each module-map and glossary change), that approving writes the issue to the tracker and accepts the proposed ADRs, and, when `design/split.json` exists, the sub-issues it creates (key and title each). Options: `Approve` (recommended) and `Request changes` (the user says what to change in a note or in "Other").
- Approve: approved.
- Request changes (also "keep it one change" against a split, or "drop ADR-0012" against a proposed ADR, which design-draft deletes with `bdk adr reject`): run **design-draft** with `<change> <the requested change>`, then go back to step 4, verify step, within the same budget; after a pass, ask again.
- When `AskUserQuestion` is not available: name the same files, decisions, scope changes, page and deviations in your reply, say that the gate file is written once the user approves, then end the reply with exactly one line, `Approve the design of <change>? Reply "approve", or say what to change.`, with nothing after it, and end your turn without writing the gate file. When the user approves in the conversation, go on with step 6 then.
Done when the design is approved, or you asked for approval and ended your turn.
## 6. Write the issue and the gate
On approval, in this order:
1. Write `.bdk/runs/<change>/design/gate-comment.md`: `Design approved` with who approved it, the passing report and its verdict, every `Decided without the user:`, `Scope changed by the user:` and `Deviation:` line, the bullets of `### Living documentation`, and the split's sub-issues when there is one.
2. Run `"${CLAUDE_PLUGIN_ROOT}/bin/bdk" tracker sync --run <change> --comment-file .bdk/runs/<change>/design/gate-comment.md`: it writes the body of `issue.md` and the comment in one write. On `env/body-changed`, someone edited the issue meanwhile: merge `issue.remote.md` into `issue.md` with Edit (keep the run's sections, take GitHub's other edits), then run the same sync again. On `env/tracker-not-github`, do it as `tracker.instructions` say. On any other error, stop: write no gate file, quote the error, and say that `/bdk:design <change>` asks for the approval again.
3. When `design/split.json` exists: run `"${CLAUDE_PLUGIN_ROOT}/bin/bdk" tracker split --run <change> --file .bdk/runs/<change>/design/split.json`; it prints `<key>: <ref> ...` per sub-issue. For each, run `"${CLAUDE_PLUGIN_ROOT}/bin/bdk" tracker fetch <ref> --run <change>-<key>` and write `.bdk/runs/<change>-<key>/design/gate.md` with the frontmatter below, but `parent: <change>` in place of `report` and `scope_log`.
4. When `### Living documentation` names ADRs (`- ADR: ADR-<NNNN>`), accept them with the issues that implement them: run `"${CLAUDE_PLUGIN_ROOT}/bin/bdk" adr accept --adr ADR-<NNNN> --adr ... --issue <ref> --issue ...`, one `--adr` per ADR and one `--issue` per sub-issue `<ref>` that step 3 printed, or, without a split, the issue's `url` from `.bdk/runs/<change>/issue.json`. It sets `status: accepted` and `issues`, and rewrites the ADR index; an ADR accepted already only gets the issues, so a gate that stopped here runs it again. Each `/bdk:close` of those issues then derives the ADR's status. On an error, stop: write no gate file, quote the error, and say that `/bdk:design <change>` finishes the gate.
5. Write `.bdk/runs/<change>/design/gate.md` last:
```markdown
---
gate: approved
by: user
report: design/verify-2.md
scope_log: SL-2
---
```
The file is this frontmatter and nothing else; `bdk run status` reads it and stops on any other key. `gate` is always `approved`: a gate file is written on approval only. `by` is `user`, or `policy.gates.design auto` for the automatic gate; `report` names the passing report; `scope_log` names the last entry of `scope-log.md`, or `none` without an entry or a log. Done when the gate file exists, or you stopped.
## 7. Report
Reply in a few lines:
- the files written in this run (`explore/design.md`, `issue.md`, each `verify-N.md`, `intent.html`, `gate.md`);
- the last verdict and the verifier passes used of the budget;
- every `Decided without the user:`, `Scope changed by the user:` and `Deviation:` line of `issue.md`, and every scope-log entry the gate showed;
- the gate's outcome, the issue written (its reference and the comment), each sub-issue created and each ADR accepted;
- after an approval, the next stage: `/bdk:plan <change>`, or after a split `/bdk:plan <change>-<key>` for the first sub-issue that waits for none (`/bdk:run` runs them in order).
End your turn there; nothing is committed.