Hi, I am Mr Lark. In Chinese, I go by 拉克先生.
The faster AI writes code, the less I want to start by reading code.
Code and plans both get long
I used to trace the files first: where the entry point is, where the state comes from, how data moves, and where the result is rendered. That worked in small projects.
Now AI may change routes, components, styles, data scripts, and config in one pass. Each file can be readable on its own, but together they become a web. After reading the code, I still may not know where the change boundary is.
Plans are not much better. They list files, steps, edge cases, and verification. For simple tasks, that is useful. For complex tasks, it becomes another long document. Code complexity turns into text complexity.
So I now look at diagrams first.
Diagrams should answer one question
I tried Mermaid, but complex diagrams get messy. More nodes create crossing arrows. More groups make the diagram wider. The diagram may render, but it is still hard to read.
Then I started using PlantUML. It is better when I split diagrams by question:
- Use a sequence diagram for call order
- Use a component diagram for module relationships
- Use a state diagram for state changes
I ask AI for diagrams first
Now I usually ask AI for this first:
First, draw a PlantUML diagram that explains how these files call each other.
If state changes are involved, draw a separate state diagram.
The diagram helps me see the entry point, data source, business logic, and side effects. After that, I decide whether I need to read the code.
docu.md handles the rendering
One more tool I recommend is docu.md.
PlantUML is easy to maintain inside Markdown, but normal previews may not render it. The docu.md browser extension can render PlantUML in Markdown. It also supports Mermaid, Graphviz, LaTeX, and code highlighting.
Now I ask AI to generate a doc.md file with the task background, key files, PlantUML diagrams, and a short explanation. I open it in the browser, read the diagrams, scan the headings, and then return to the code.
I no longer start from code details or a long plan.
I look at the diagram first.
