Grammar
One line is one statement. A call at runtime is =>. An import is rule a -> b. A file that still says a -> b is read as a call.
| key: Type "Title" "Technology" "Description" | A box. The key is how every other line names it. |
| a => b "label" "HTTPS" | A call at runtime. The caller waits. a -> b still reads as a call. |
| a --> b "label" | A message. Nobody waits. |
| rule a -> b | An import, and only on a code board. The word rule is what makes -> an import. |
| rule a -/-> b | An import that is not allowed. |
| flow "Name": a => b "label", b => c | A path. Cite the label so two arrows between the same boxes stay two steps. |
| inside db boards/api/db.hunch | The board inside that box. One level is boards/api.hunch. The next is boards/api/db.hunch. |
A diagram inside a diagram
- On the outer board, the box has a key, like
api. - One line on that file points at the inner file:
inside api boards/api.hunch. The word before the path is the key. - That file is a whole board. It can be another diagram, the code inside the box, or its screens.
- A box there goes one level down:
inside db boards/api/db.hunch. Two levels is enough. - On the board, the box says Open inside. The first time, an empty file asks: Diagram, Code architecture, or UI sketch.
System
title Shop web: Web app "Storefront" "Next.js" "The shop window" api: Service "Orders" "Go" "Takes the order" db: Relational DB "Orders DB" "Postgres" web => api "Places order" "HTTPS" api => db "Saves" flow "Checkout": web => api "Places order", api => db "Saves" inside api boards/api.hunch
Code inside a box
title Orders style clean http: Route handler "POST /orders" [layer=adapters path=src/http] order: Use case "Place order" [layer=use-cases path=src/order] http => order "calls" rule adapters -> use-cases rule use-cases -/-> adapters inside order boards/api/order.hunch
Screens
title Shop screens mode ui cart-total: Stat "Total $68" pay: Button "Pay" [primary calls="POST /orders"] frame "Cart" [device=mobile route="/cart" empty="Your cart is empty"]: cart-total, pay
The long guide is the skill. The folder still works without the inside line: boards/<key>.hunch, then boards/<key>/<box>.hunch.