Writes the software design of a change before code is written, so that the review of the plugin laminar finds nothing on the code that follows. It writes 1 design model, which holds every public name at every scale and every named private part, with the decisions each boundary carries: 1 owner for each business decision, the depth of each choice from a forecast of change, the check of outside data at each entry, the failure line of each I/O execution and the tests of each entry. The shape che...
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/clutcher-design)
---
name: design
description: "Writes the software design of a change before code is written, so that the review of the plugin laminar finds nothing on the code that follows. It writes 1 design model, which holds every public name at every scale and every named private part, with the decisions each boundary carries: 1 owner for each business decision, the depth of each choice from a forecast of change, the check of outside data at each entry, the failure line of each I/O execution and the tests of each entry. The shape check of the review judges the tree, a script checks the decisions, and writer agents then write the code, which the review checks. Use when the user asks to design a change or a feature before code, to plan the fixes of a run of the review skill of laminar, or to check a plan of Claude Code or a free-text idea such as a folder structure. It is not a review."
---
# Design a change
You design the code of a change before any code is written: its classes and methods, its folders, and the owner of each decision. You write 1 design model by `references/design-model.md`, `references/design-decisions.md` and `references/design-boundaries.md`. Scripts check it and render it as `design.md`, and the procedure ends at the plan: the model, `design.md`, the migration and `migration.workflow.js`. Writer agents then write the code from it, started by the session that called this skill or by section 5, and the review of the result shows whether the design reached its aim, which is a review with nothing to report on the change. You write no production code yourself and report no finding of your own. The book: "These questions check the planned structure the same way they check existing code, because the failures they target are cognitive rather than structural." (*How to Apply the Principles*, *How to Apply the Principles to New Code*)
Contents: 1. The 2 modes · 2. The input · 3. The results folder · 4. The procedure · 5. Running the plan · 6. What this skill does not do · 7. The reference files
## 1. The 2 modes
The skill runs in 1 of 2 modes. Say the mode in your first line.
- The mode with a user, the default: you ask the user each question of the model (`AskUserQuestion`, in Claude Code), and the user approves `design.md` and the migration before the plan ends.
- Autonomous mode, where the input asks for it, such as with `mode: autonomous`: you ask nothing, and each question takes the answer that its key `autonomous` states. A question whose `autonomous` is `default` takes its recommendation, for every kind of question, and `design.md` prints it as a decision taken by default; for a failure policy, the recommendation is the first choice of the failure line that fits the I/O execution (`references/designing.md`, section 10). Only a question about a change of an existing output that a program outside the application reads has its key `autonomous` set to `stop`, because such an output never changes without a user: the plan then ends with the outcome `question`, and the design and the question are the result. The form of a new output, such as the status code of a new failure or the fields of a new response, is no question: you decide it and write it in the model (`references/design-boundaries.md`, `entries`). A question stays open, and no writer writes code across it, only where it decides no line that a writer writes in this change; a question that decides a signature, a constructor or a failure line takes its recommendation (`references/designing.md`, section 1). Where the input states a ceiling, a shape finding open after the ceiling of shape runs is no question of the model: it has no recommendation to take by default, so where no user can answer, it ends the plan with the outcome `question`, unless the decided list decides it (section 4, step 5). A shape finding that does not close ends the plan with the outcome `stop` in the same case. The change forecaster answers depth. A finding of a review run or an item of a shape run stays unfixed only as `outside the change`, where git or the design check shows that the change did not touch its cause, as `project convention`, as `shown by the code`, where the code itself answers an item of a shape run, or as the decided list of the input decides it, because the calling session decided it. An item to consider that the tree does not answer takes `question to the author`: the finish command lists it under `considerations` of `outcome.json` and under *To consider* of `design.md`, and the plan stays `ready`, because an item to consider claims no defect, and autonomous mode passes it on, never in silence. A kept item of a shape run that you see no change of the tree for and that the code does not answer, before the design check proves it, takes `question to the author` too (section 4, step 5): the finish command lists it under `questions` of `outcome.json`, and the plan ends with the outcome `question`. The finish command with `--autonomous` reports every other reason of yours as the defect `reason-not-autonomous`. A finding on an existing field or member of a modified class that the change neither renames, retypes nor rewrites takes `outside the change`, which the design check verifies against the base commit, because only the user decides a new name for a word of the domain, never a script. Its `says` names the member and the defect, so `design.md` prints it under *Findings* as a defect that the change leaves. You may fix it instead, and the migration then carries the fix in a migration group of its own (`references/design-findings.md`, `existingDefects`). In the mode with a user it is a question whether to fix it now or leave it. So autonomous mode can end in a question for the user, and it never passes a question in silence: `design.md` prints each answer that no user gave.
## 2. The input
Read what the user gives (`$ARGUMENTS`, in Claude Code), and say in 1 short line what you got:
- A described change: free text with ideas, such as a feature, a ticket or a folder structure, or a plan file, such as one written in the plan mode of Claude Code. Its scope is the folders that its words and its file names touch, which you find in the repository. A new type name, a class shape, a known form or a folder that the input proposes is an idea of its writer, not a requirement: check it against the design directions as you check a form of your own, keep it where they hold, and where a design direction speaks against it, write a question of the model that names that direction, with the input's form and the form of the direction as its options, and recommend the form of the direction where the input gives no reason for its own form, and the input's form where it states one.
- The run folder of a run of the skill `review` of the plugin laminar, at any scales. Read 3 files of it: `review.md` for the numbered items and the scope line, `review.sarif` for the abstraction, scale and places of each finding, and `review-evidence.md` for the evidence and the `Cause:` lines; the scripts also read its `prepare.json`. Its scope is the files the findings name and their folders. Every item of `review.md` at the application, module and class scales must be closed by the model, or left on purpose with 1 reason class of section 4, step 3. Each finding at the method and variable scales gets 1 finding step of the migration from the finish command, or 1 no-step line where the decided list decides it, where it is an item to consider, where a finished group of the plan before already fixed it, where no item of its scale in `review.md` shows it, or where the model removes its abstraction (`references/design-checks.md`, section 5); so read it also as a sign of the cause.
- `base: <commit>`: the base commit, the commit that the change starts from, such as the merge base of a branch, required with a run folder. Where a run folder comes with no base, ask the user for it; in autonomous mode the start command ends the plan.
- `results: <path>` of an earlier plan: you start from its model, and the migration plans only what changed, unless the plan is a re-plan (section 3). The reads of section 7 hold for a later plan as for a first plan, also where the model is carried.
- `decided: <file>`: the findings of the run folder that the calling session already decided, each with 1 reason class of section 4, step 3, and `says`, in the form of `references/design-rounds.md`, section 2. You carry each one as it is and never decide it again. You never write, extend or copy a decided list, and a ruling of the user that the list lacks is a question.
- `stop: <file>`: the stops of the writers of the plan before, each with its group and the files the writer left uncommitted. Each stop is the first thing the new plan changes, and you answer a stop only after the reads of section 7, because its fix writes a name, a signature or a body. An object of the list that holds `"committed": true` and an empty `leftFiles` is no stop of a writer. It is the answer of a committed group: a finding that the writer of a finished and committed group recorded `changes-the-model` in its self-check (`references/writer.md`, section 5). You answer it first, as you answer a stop, but its group stays finished, so its written classes stand as written and the findings that its steps fixed read `fixed by plan <n> group <g>`.
- `mode: autonomous`: section 1.
A run folder may come with a described change. The redesign of a folder or a module with no run folder and no described change comes in a later version: for it, ask the user for a described change, or for a run of the skill `review` on that folder first.
## 3. The results folder
The results folder holds `design-model.json`, `design.md`, `migration.md`, `migration.workflow.js`, `base-commit.txt`, the base commit, `plan-commit.txt`, the head when the plan started, whose tree the scripts read as the current tree, `findings.json` for a run folder, the run folders of the shape runs under `shape-runs/`, 1 folder `plans/<n>/` per plan with its copies and its `outcome.json`, and, by section 5, the record of each round under `rounds/<n>/`. The user may name it as `results: <path>`; else create a new temporary folder outside the repository. Name it in your first line. A results folder that already holds a model makes this plan a later plan: the start command carries that model onto the plan commit, so what the plan commit holds stands as written and each written method is marked `unchanged`, and the answers, the names, the stops and the reason classes of the shape runs stay. A re-plan is no later plan: the plan before wrote no group, so its plan commit is the plan commit of this plan, its plan folder holds no `self-check.json`, `self-check/` or `build/`, and no writer of it stopped. The start command then carries nothing and prints `"later": false, "replan": true`, and the finish command plans the whole model, as for plan 1. Remove `unchanged` from each method you change again and write its `body`. Never change the `group` of a class that an earlier plan held, because a stop and its left files name the group by its number. The 1 exception is a new change in a results folder that already holds a model: where the start command gets no run folder and no stop list, the plan before ended `ready`, and the base differs from the base of the plan before, it removes the `group` of each class that the plan commit holds and prints the count as `groupsCleared`, because those groups are commits of the change before, and you number the groups of the new change from 1. You write nothing into the repository; only the writers do. Read the repository itself, and never a review worktree under `.claude/worktrees/` of it, because a worktree holds another head of the same code, and code found there would steer the design.
## 4. The procedure
The paths of the scripts are relative to the folder of this skill, and `<review skill>` is the folder of the skill `review`, `../review` from here.
1. Run the start command, `node scripts/startPlan.mjs --results "<results>" --repo "<repository>"`, with `--base <commit>` from the input, `--run "<run folder>"` for a run folder, `--stop "<file>"` for the stops of the writers, `--decided "<file>"` for the decided list of the input, and `--autonomous` in autonomous mode. It writes `base-commit.txt` and `plan-commit.txt`, numbers the plan, carries the model of an earlier plan and records each stop under `decisions.stops`. Where it prints a `second stop` line, ask the user a question about that abstraction, with the 2 stops as its fact; in autonomous mode it ends the plan itself. Where it exits 2 on a missing base, ask the user for the base. Read the input and find its scope. Read the project conventions as the skill `check-conventions` finds them: each `.md` file under `.claude/rules/conventions/` of the repository whose `paths:` match a folder of the scope, and each file there with no `paths:`. Once the tree names its files, and again after each shape run that adds a path, also read each file whose `paths:` match a file that the model creates, moves or modifies, because a created file under a new folder matches no folder of the scope. A project convention may set the zones and their zone order, the naming grammar, the folder layout and the test file suffixes. It overrides a rule marked narrower than the book, and never a format of this skill or a design direction of the book. Record each clash of a project rule with a rule of the skill `code-style` once, as 1 object of `decisions.conventions.overrides` (`references/design-decisions.md`). In the mode with a user, where the user wants a form that a rule marked narrower than the book forbids and no project file states, such as a suffix word, ask 1 question once per plan and write the answer as a `proposed` rule; in autonomous mode, write no `proposed` rule, and the rule of `code-style` holds.
2. Read the current code of the scope, the private members included, by `references/designing.md`, section 1, and the reference files of the skill `code-style` that section 7 names, and write each file you read under `decisions.referencesRead` (`references/design-model.md`, section 2). A fact about the current code, such as a value of a configuration, a schedule or a signature, comes from the tree of the plan commit, and you write it into the model as you read it there. Where the input or the calling session states such a fact and the tree shows another value, keep the value of the tree until the input names the file and the line that hold the other value, and name the difference in your report. A value that the request asks to change is part of the change, not a fact of the current code.
3. For a run folder, ask of each finding whether it holds and what its cause is, on the code at the head and at the base of the reviewed range. A finding whose behavior the docs or the tests record as intended still holds. A finding stays unfixed only with 1 reason class of this closed set, never because you think it wrong and never because the repository repeats the form: `outside the change`, where the change did not touch its cause lines; `shown by the code`, only on an item of a shape run, where the code answers the item itself (step 5); `question to the author`, where the right shape rests on a fact the code does not show; `project convention`, where it rests on a rule marked narrower than the book and a conventions file of the project covers it; `exempt by the book`, where the book itself states the exemption, quoted with its chapter and section in italics, which also tells the maintainer of the plugin, because a finding against a sentence of the book is a defect of the review; and `fix apart`, where its fix reaches code outside the change in several modules. List every finding of 1 folder, at every scale, before you answer any of them, because a method finding often names the cause that a module finding only shows. Write 1 object of `decisions.findings` for each item at the application, module and class scales, with the part that closes it or its reason class (`references/design-findings.md`). Where the decided list decides an item, write its `reason`, its `says` and its `decidedBy`, `caller` where the list gives none, as they stand. Where a finding at the method or variable scale names a class that the model does not hold, add that class as `modified` with its whole listing and `addedForFindings`. Where the model moves code of a method whose finding a decision holds, such as a ruling of the decided list, into a method that the change creates, write `takesCodeFrom` on the created method with the display name of that method and each decided check whose finding is about the moved lines themselves (`references/design-rounds.md`, section 2). Leave out a check whose finding is about the name, the signature or the place of that method, because the created method has its own, and the review judges them again. Where a decided finding at the class scale on the class that holds the created method has its cause inside the moved lines, also write that class with that check. The decision then follows the code that moved, and the key never decides a new finding.
4. Pass 1, the tree. Write the shape half from the outside in, by `references/designing.md`, sections 2 to 8, from each changed entry down to its exits. Decide first whether each abstraction is a domain object or an operation on one, then what its boundary hides from its caller with the owner of each decision it hides, then the parts until every operation is a part, then the signatures, then the folders. Write `decisions.owners`. Start the change forecaster, the agent `design-forecaster` of the plugin (`laminar:design-forecaster`, in Claude Code), by `references/forecaster.md` once on this draft, and decide depth from its answer; where a later shape run adds owners, start it again on the added owners only. Write `decisions.exits` by `references/designing.md`, section 10, because the failure line of each I/O execution decides its return type. Then run the design check alone, `scripts/checkDesign.mjs` with the options of step 7, on this model and fix each defect it prints before the first shape check, other than the keys of pass 2, which it prints as missing: it costs no agent call and finds defects that would cost a shape run (`references/design-checks.md`, section 1).
5. Run the shape check on the tree. The prepare command reads the shape half of the design model and ignores the rest, so pass the model itself: `node "<review skill>/scripts/runReview.mjs" prepare --run "<results>/shape-runs/<n>" --repo "<repository>" --shape "<results>/design-model.json"`, where `<n>` counts the shape runs from 1. Before that prepare command, run the paths command, `node scripts/listShapeRunPaths.mjs --run "<results>/shape-runs/<n>" --model "<results>/design-model.json" --repo "<repository>"`, which costs no agent call. It prints `whole` for the first shape run and for the first shape run of each later plan, because the writers of the plan before changed the code that a shape run reads, and then the prepare command stands as it is. Else it prints the paths that the last round touched: the files that the round changed, each file or folder that the round created or moved with its parent folder, and the folders that gained or lost a child. It adds the files that call a member or a class that the round renamed, split, removed or gave another signature. It also adds the files of each item of the last shape run that holds no reason class, among them an item that a change of the round aims to close. Add `--paths <that list>` to the prepare command, so the shape run judges only those paths. Where it prints `none`, the round changed no file and left no item open, so run no shape run. A narrowed shape run judges no line outside its paths, so an item that a judge first keeps on a line that earlier shape runs judged without a keep shows only in the review of the written code, which judges the whole change. Then run the judge workflow, the merge and the render of the skill `review`, as its steps 2 to 5 say. Run the merge and the render also on a run that keeps nothing, so its run folder holds `review.md` and `review.sarif`. After the prepare command of each shape run, run the carry command, `node scripts/carryShapeDecisions.mjs --run "<results>/shape-runs/<n>"`, which writes `<results>/shape-runs/<n>/decided-review.json` from the objects of `decisions.findings` of the shape runs before it. Add `--decided-review "<results>/shape-runs/<n>/decided-review.json"` to the render of that shape run. A finding that you decided in an earlier shape run stays decided in the next shape runs while its lines stay as they were, and needs no new decision; where its lines change, it stands again as a kept item. A finding on code that an earlier whole shape run judged unchanged and kept nothing on is judge variance, so the render sets it under the items to consider, and it never holds the plan open (`references/design-findings.md`). Where you have no Workflow tool and the calling session has one, such as where you run as its subagent, split the shape run. You run the prepare command and the carry command, and return the run folder with the input `decided-review: <results>/shape-runs/<n>/decided-review.json` to the calling session. The calling session runs the judge workflow, the verify workflow, the merge and the render on that run folder. It sends you the run folder with the measured cost of its 2 workflows, such as by a message to the same agent (`SendMessage`, in Claude Code). You then read `review.md` of that run folder and go on with this step. A subagent with no Workflow tool always hands the prepared run folder back to the calling session, also where the input does not say that the calling session runs the workflows, and never answers the detection questions of the 6 cognitive failures itself, because only a host with no calling session at all takes the fallback at the end of this step. After each shape run, report its measured cost, the judge workflow and the verify workflow together, as the host reports the use of each workflow; never report the cost plan of the prepare command as the cost, because it leaves out the verify workflow. Where the calling session ran the workflows, report the cost that it sends; where it sends none, report the cost of that shape run as `not measured`. Change the tree for each kept item, by the order of moves of `references/designing.md`, section 3, and run the shape check again, until every kept item is closed by the tree or holds a reason class under `decisions.findings` (`references/design-findings.md`). You write the change for each kept item, also where the calling session ran the shape check, because you decide the model: a change that the calling session, the user or the `To confirm:` line of a judge proposes is input, and you decide it. Before the next shape run, check each name that a change adds as a name you write, by `../code-style/references/naming.md`, and against the `says` of each object of the decided list and each answer of the model, so a form that 1 of them rejected does not come back under a new name. A round renames a name that carries no finding only where the new name is better, and says why: the design check reports such a rename as the recheck case `renamed-without-finding`, and you answer it under `decisions.scriptCases` with 1 line on why the new name is better and each class, method or field that holds the new name (`references/design-checks.md`, section 4). A later change of the same plan never renames again a name that an earlier answer of the plan gave to 2 or more classes, methods or fields, unless an item of a shape run names 1 of them. The prepare command settles by script each method name of the model, a named private part with no body included, that starts with a relating word or ends in a word of its closed end list, and it does so only in the next shape run. It settles no name of a method marked `unchanged`, because the change does not write that name. Where a shape run keeps a prediction failure on the name of a class or a folder that you already renamed once, check what it holds by `references/designing.md`, section 6, before a third name. Where its members form 1 group and only the name is imprecise, a more precise name is the fix (`../code-style/references/naming.md`, section 9). Else give it no third name, and move each group of members that the name cannot cover to the abstraction it belongs to, because "If the abstraction holds unrelated behavior, no name will fix the problem, because the difficulty is structural." (*The Encapsulation Principle*, *When No Name Works*) Where the input states a ceiling, it counts shape runs, never dollars, and you pass it to the finish command as `--ceiling <shape runs>`; never pass it where the input states none. A ceiling the input states limits the shape runs, never the judging: where the tree changes after the last shape run the ceiling allows, run 1 shape check after the ceiling, a shape check of the changed items alone, each at its own scale (`--scales module|class|method --paths <files>` on the prepare command, with the scales of the changed folders, classes and methods), which counts as no shape run. Else run no more shape runs, keep the tree as the last shape run judged it, and write each item that the change would close as `openAfterCeiling` with the change you would make as its text (`references/design-findings.md`), and `design.md` lists the item under `Open after the ceiling`. Such an item waits for a decision. Where the input states no ceiling, no count of shape runs ends the loop: after each change of the tree, run the next shape run, also where it seems that the loop does not get closer to its end. The loop ends early only on an item that does not close, and the design check decides it, never you: after each shape run, run the design check with `--shape-review` once per shape run, and it prints `proven-item-not-stopped` for each item of a shape run whose finding key, its display name with its check, the 2 shape runs before it also kept, where the object of the item in each of those 2 shape runs holds as `closedBy` a change of the tree aimed at it, and the class or the folder of the item changed after each. An item to consider never ends the loop: the design check never proves it, and where neither a change of the tree nor the code answers its question, it takes the reason class `question to the author` (`references/design-findings.md`). Where it prints that line, end the loop on the item. Where each file and each line that its claim names already stands in the base commit, the change did not add the cause, and no change of this plan closes it: write its object with the reason class `outside the change`, which the design check verifies (`references/design-findings.md`). Else write its object with `doesNotClose`, the reason that the 2 changes tried did not close it, and with `check` where the item holds 2 checks. Where it prints no such line, change the tree and run the next shape run. The design check refuses `doesNotClose` where 1 of these facts fails (`does-not-close-without-proof`), and reports a plan or a later shape run over a printed item that holds neither `doesNotClose`, `outside the change` nor a decided reason (`proven-item-not-stopped`). In the mode with a user, ask the user about the item, with the 2 changes tried, and write the answer as its `reason`, `says` and `decidedBy` set to `user`; else the finish command ends the plan with the outcome `stop`, the stop reason `item-does-not-close`, and lists the item with its changes tried under `doesNotClose` of `outcome.json`. No shape run follows that stop, so the design check refuses `closedBy` on another item of the last shape run (`stop-with-unjudged-change`): leave that change out of the model, or give the item a reason class. Where the code answers a kept item of a shape run itself, because the tree answers its `To confirm:` line or a question of the model already decided the option it restates, write its object with the reason class `shown by the code` and each piece of evidence of the answer under `shownBy`, also in autonomous mode: a judge reads only the code of its own call, and a question to the author is only for what the code cannot show (`references/design-findings.md`). Before the design check prints `proven-item-not-stopped` for it, an item that you see no change of the tree for, and that no other reason class fits, takes the reason class `question to the author`, with `says` that names what you tried and why no change of the tree and no other reason class fits, so in autonomous mode the plan ends with the outcome `question`; such an item never stands open after a ceiling and never waits for the next shape run. Before such an item takes it, try each fix that the `Direction` line of the item names, and also a rename where the name says something that the code of its own folder does not know. Name in `says` each fix tried and why it fails, and a fix that adds a cycle between folders fails for that reason, which the design check shows (`folder-cycle`). A shape finding is closed only when no part of its claim still holds on the head it names: a rename that keeps the claim, a named local, or a move that carries the claim to another class closes nothing. A plan goes to the writers with a shape finding open only where the finding holds a reason class with `says`, decided by the user or by the decided list of the calling session, with `decidedBy`; else the plan is not ready, and its line is `question`. In the mode with a user, ask the user about each open finding, with the change you would make, and write the answer as its `reason`, `says` and `decidedBy` set to `user`. The design check reports each open finding with no decided reason as `open-after-ceiling`, and the finish command then ends the plan with the outcome `question` and lists the finding under `openAfterCeiling` of `outcome.json`. The parent folder of each folder that the change creates or moves stands in the shape half as a `modified` folder, because it gains a child. A class whose public members change gets a shape run also where it stays in its file. A method that coordinates 2 or more parts carries its `body` as the calls in order, and a method that does I/O carries its I/O line and its failure line, the same choice as its object under `exits`, so the judges read them before any code exists. An owner may carry the values of its decision as its `body`, the literal table, set or constant and its return, and nothing else, and an owner of 2 or more decisions carries the calls of its named parts in order (`references/design-model.md`, section 1). Where the change creates, moves and removes no file and no folder and changes no public member, the shape check is not needed; say so with the reason. Where depth changes after the shape check passed, or a file that the last shape run read as `unchanged` becomes `modified` in the model, run the shape check again on the changed part only, because the last shape run never judged that file. In a host where the shape check cannot run and no calling session exists, such as GitHub Copilot CLI, ask the detection questions of the 6 cognitive failures about each folder, class and signature yourself, and mark each answer as not checked by the review.
6. Pass 2, the decisions on the tree that passed: `decisions.conventions`, the `placement` of each owner, then `entries` with the `responses` of each entry, `tests` and `questions`, in the form of `references/design-decisions.md` and `references/design-boundaries.md`, by `references/designing.md`, sections 9, 11 and 13. Each question names the fact the code does not show, gives 2 or more options, each with its tree or its signatures, and a recommendation; an option that brings back the failure it was meant to close is no option.
7. Run the finish command on the whole model, `node scripts/finishModel.mjs --model "<results>/design-model.json" --repo "<repository>" --results "<results>"`, and add `--autonomous` in autonomous mode, `--review "<run folder>/review.md"` where the input is a run folder, `--decided "<file>"` with a decided list, `--classes <display names>` in a later plan, the classes you changed in this plan, `--ceiling <shape runs>` only where the input states a ceiling, and `--shape-review "<results>/shape-runs/<n>/review.md"` once per shape run. In a re-plan, the finish command does not pass `--classes` on to the migration script (section 3). It writes `findings.json` from the run folder, runs in order the design check, `scripts/checkDesign.mjs`, the render, `scripts/renderDesign.mjs`, and the migration script, `scripts/planMigration.mjs`, passes each the options it takes, and stops at the first of them that prints a defect or fails, with the name of that script and its output; the 3 scripts may still run alone, with the options of their usage line. Where it passes, it writes `plans/<n>/` with `outcome.json` and prints the plan line last. Fix each defect it prints, and run it again. Recheck each recheck case it prints against the model; where the model shows that a case is wrong, write it as 1 object of `decisions.scriptCases` with its code, its display name and its text, so `design.md` shows it as a defect of the script (`references/design-findings.md`).
8. The finish command renders `design.md` into the results folder once the design check passes. Never write `design.md` by hand.
9. Show `design.md` of this plan, then ask the user the questions of the model, each with the code of its options, and write each answer under `answer`. Where an answer changes the shape half, run step 5 on the changed part. Then run steps 7 and 8 again, and show `design.md`. In autonomous mode, apply section 1 instead.
10. Set `group` on each class that the change creates, moves, renames, modifies or removes, and on no class of an `unchanged` file, by the boundary the classes share: an abstraction, a folder or a decision, and the narrower one where 2 fit, so the abstraction comes before its folder and the folder before the decision (`references/design-model.md`, section 3). Write the migration by running the finish command of step 7 again, which writes `<results>/migration.md`; for the steps as JSON, run `scripts/planMigration.mjs` alone with an `--out` path that ends in `.json`. The migration script writes the steps per migration group in the order of the group numbers, and inside each group in 7 stages: folders, moves and renames, created classes, changed members, bodies, removals, and then tests (`references/design-checks.md`, section 5). A later plan is cut: it plans only the groups of the classes you changed, of the finding steps and of the stopped writers, and each group keeps its number (`references/design-checks.md`, section 5); a re-plan is not cut (section 3). Each finding at the method and variable scales gets 1 finding step, or 1 line under `## Findings with no step` where the decided list decides it, where it is an item to consider, where a finished group of the plan before already fixed it (`fixedBy` of `findings.json`), where no item of its scale in `review.md` shows it, or where the model removes its abstraction. In the mode with a user, wait until the user approves `design.md` and the migration.
11. End the plan. Start no writer and run no review, because the session that called you does that, or section 5 does it. The last line of your report is the plan line of the last script you ran, `plan <n> ready|question|stop <results>`, which the finish command prints where it passes and the start command where it ends the plan. Never write the line by hand: a calling session reads `plans/<n>/outcome.json`, and the line names it. Before the plan line, list each question whose `answer` you wrote with `by` set to `default`, by its id and its option, for the user to confirm. Before the plan line of a plan that ends `question` on a shape finding open after the ceiling, list each such finding, by its shape run, its item number and the change you would make, and before the plan line of a plan that ends on an item that does not close, list the item, the 2 shape runs before it that kept it, and the 2 changes tried. Before the plan line, also list under `referencesRead` each file of `decisions.referencesRead`, the reference files and the conventions files of the skill `code-style` that you read in this plan, each by its path relative to the folder of that skill, such as `references/correctness.md`, with the sections of a file that you read only by section. Report the measured cost of the shape runs, by step 5, and never a cost plan as a cost.
## 5. Running the plan
A plain session, which no other skill called, runs the plan by `references/design-rounds.md`: it starts the writer workflow (`Workflow({ name: "laminar:laminar-design-writers", args: { results: "<results>", review: "<run folder>/review.md" } })`, `review` only where the plan came from a run folder), which starts 1 writer per migration group, the agent `design-writer` of the plugin (`laminar:design-writer`, in Claude Code), by `references/writer.md`; in a host with no Workflow tool, it starts each writer in the order of the migration. Before it starts the writers, it states the self-check share of each group from the line `Self-check:` of the migration. The writer workflow runs 1 self-check on each finished group before the commit, and the writer answers its kept findings once (`references/writer.md`, section 5); the session writes `selfCheck` of each group into `plans/<n>/self-check.json`. It commits each finished group with its files and its commit message in the order of the group numbers. A group whose writer finished with a failed build, or with a test command that did not pass, comes back from the writer workflow stopped with the stop `build-failed` or `tests-failed`, at the `firstClass` of the group in `migration.workflow.js`, else at `migration group <n>`: the session commits nothing of it and writes the stop into the input `stop:` of the next call, with the files of the group as `leftFiles`. 2 groups that share a file finish in 1 call of the writer workflow, so the files of a group can hold the lines of the other: a session that commits group by group calls the writer workflow once per group, in the order of the group numbers, with `groups: [<n>]`, and a call that writes the groups side by side suits a session that commits once. The writer workflow takes the argument `build`. With `per-group`, the default, each writer builds and runs the tests of its own group, as above. With `after-the-last-group`, the writers build nothing, and 1 build of the round follows the last group, with 1 fix call for each group that a failure points to (`references/writer.md`, section 6). With `after-the-last-group`, call the writer workflow once for the round, because the build of the round checks only the groups of 1 call, and commit each group whose `build.result` is `passed` after it returns, in the order of the group numbers. Where `roundBuild.notRun` gives a reason, run the build and the tests of the groups yourself before you commit. Then run the whole build with every test of the repository once, because the build of the round runs only the test files of the call, and write a failure there into the input `stop:` of the next call. It then runs the skill `review` from the base commit to the head, and calls this skill again with the new run folder, the same results folder, the same `base:` and the stops of the writers. The round script compares the rounds and decides pass or stop there. A writer that stops leaves its files uncommitted, and the next plan takes its stop.
## 6. What this skill does not do
- It is not a review. It reports no finding of its own, gives no finding a severity and does not rank the findings.
- It is not a bug fix. A finding that names wrong behavior is fixed as a bug fix (the skill `code-style`, section 1), and only where the fix keeps every output that a user or another system reads. A change of such an output, such as a fail-fast fix that changes an exit code or the result of a gate, is a question to the user, never a silent fix (`references/designing.md`, section 13).
- It takes no finding of another review skill as input, such as one that looks for bugs; name such a finding and leave it out. An answer of a committed group that carries such a finding is a stop, which you answer by the rules of the skill `code-style` (`references/design-findings.md`, `stops`).
- It decides no fact that the code does not show, such as a threshold or where a boundary between applications runs; it asks the user, because "Which depth is right is a question about how the system will change, not something you can read from the code in front of you." (*The Encapsulation Principle*, *Depth Is a Design Decision*)
## 7. The reference files
Each path is relative to the folder of this skill. The designer does not load the skill `code-style`; it reads these files of the skill, because they hold the design directions of the shape and of the bodies it writes. In every plan that writes or changes a body, a name or a signature, a plan with a carried model, a plan that answers a stop and a plan from a run folder included, it reads whole, before the first such key it writes, each file that rules a body: `../code-style/references/naming.md`, because a body names locals, constants and values built in steps, and because its section 3 rules every method name of the model, the methods of a test substitute and of a test helper included; `../code-style/references/methods.md`, because the designer writes method bodies; `../code-style/references/correctness.md`, because a body checks outside data, writes a failure line and a log line, and handles a failure; `../code-style/references/comments.md`, because a body may hold a comment; `../code-style/references/performance.md`, because a body that coordinates parts may call an I/O part in a loop, and an I/O line decides which data it fetches; `../code-style/references/tests.md`, because the designer writes test bodies; and the conventions file of each language of the scope, such as `../code-style/conventions/java.md`, for every name, signature and body it writes. It reads a conventions file of a framework only where the scope already uses that framework. 2 files rule the shape and no body, so it reads them only by section: `../code-style/references/classes.md`, sections 1, 2, 3, 4, 5, 6, 7, 8, 9, 11 and 12; and `../code-style/references/modules.md`, sections 1, 2, 3, 4, 5, 6, 7, 8, 9, 11 and 13. Where the skill `code-style` is loaded in the session anyway, such as by a hook of the plugin before a first write, the designer still takes its rules from these files, and from classes.md and modules.md only the sections that this section names. The designer lists each file it read under `decisions.referencesRead`, and the design check matches that list against the files of this section and the conventions file of each language of the created and modified files (`references/design-checks.md`, section 4). The check proves only what the designer states it read: only a reader of the transcript of the designer confirms a read.
- `references/design-model.md`: the form of the design model as a whole, the order of work, the shape half and its keys beside the shape model, the change marks, and which script reads which key; read before you write the model.
- `references/design-checks.md`: what the design check reports, the zone order, the cycle check, and how the migration script orders its steps; read at steps 4, 7 and 10.
- `references/design-decisions.md`: the keys `conventions`, `owners` with `forecast` and `questions` of `decisions`, and which script reads each; read at steps 4 and 6.
- `references/design-findings.md`: the keys `findings`, `stops`, `existingDefects` and `scriptCases` of `decisions`, filled from the items of the review and the shape runs, the existing defects of a modified class, the recheck cases and the stops of the writer; read at steps 1, 3, 5 and 7.
- `references/design-boundaries.md`: the keys `entries`, `exits` with the failure line, and `tests` of `decisions`, the decisions of each boundary, and which script reads each; read at steps 4 and 6.
- `references/designing.md`: the rules of procedure of the designer; read at steps 2, 4, 5 and 6.
- `references/forecaster.md`: the inputs of the change forecaster and what the designer does with its answer; read at step 4.
- `references/writer.md`: the inputs of the writer, what the designer does with a stop, and the self-check of each group; read at step 1 and for section 5.
- `references/design-rounds.md`: the decided list, the dispositions of a plan, and for section 5 the rounds, the round script with its counts, its comparison and its loop line; read at step 1 and for section 5.
- `../review/shape-model.md`: the shape half, as the shape check reads it.