# How to draw the plan before your agent writes the code with diagram-design

Repo: [cathrynlavery/diagram-design](https://github.com/cathrynlavery/diagram-design) | Difficulty: Intermediate | Time: 30 minutes | Basis: Seen in the wild

Ask for a flow or sequence diagram of a proposed change and approve the design first.

**Who it is for:** Developer about to hand a multi-step feature to a coding agent who wants to catch design mistakes early

**The problem:** Agents start coding from a vague plan and the wrong design only shows up after many files change.

**The outcome:** A sequence or flow diagram of the planned change that you read, correct and approve before any code is written.

## Steps

1. Install the skill with: npx skills add cathrynlavery/diagram-design
2. Describe the feature, for example: Give me a sequence of a bearer call with token refresh on 401.
3. Read the diagram and fix any wrong step by telling the agent what to change.
4. Once the diagram matches your intent, ask the agent to implement it.

## Prompt to paste into your agent

```text
Before writing code for <feature>, use the diagram-design skill to draw the planned flow as one HTML diagram. Wait for my approval of the diagram, and flag any step where you made an assumption.
```

## Caveat

The diagram only helps if you actually read it before the agent continues. Tell the agent explicitly to stop and wait for approval.

## Seen in the wild

- Reddit: https://i.redd.it/scj22allyuvh1.jpeg

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/cathrynlavery-diagram-design/review-plan-diagram-before-coding/
